From: Foster B. <fos...@us...> - 2006-02-23 23:29:33
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760/adobe/future/widgets/headers/win32 Modified Files: metrics.hpp ui_core_implementation.hpp Added Files: label_t_impl.hpp Log Message: the state of things. We've been working to isolate static_text_t (now called label_t) but it has been slow going because we're trying to wrestle with perfecting the API and what effect that has on other components that were using label_t in a way that isn't in accordance with the new API we're trying to write. As it stands static_disabled_text_m is broken on both platforms, but everything else should be working better. Index: metrics.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32/metrics.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** metrics.hpp 3 Feb 2006 18:33:36 -0000 1.2 --- metrics.hpp 23 Feb 2006 23:28:55 -0000 1.3 *************** *** 77,80 **** --- 77,82 ---- // virtual bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics) const = 0; + + static const RECT kBigExtents; // /// Get the extents for the given text string, to be contained in the *************** *** 88,92 **** /// if the metrics could not be returned. // ! virtual bool get_text_extents(int widget_type, std::wstring text, RECT& out_extents) const = 0; // /// Get the specified measurement for the given widget when in the --- 90,94 ---- /// if the metrics could not be returned. // ! virtual bool get_text_extents(int widget_type, std::wstring text, RECT& out_extents, const RECT* in_extents=NULL) const = 0; // /// Get the specified measurement for the given widget when in the *************** *** 158,162 **** /// Before any of the other functions can be called, the theme data must be /// loaded from the window. This function should also be called any time the ! /// window recieves a WM_THEMECHANGED message. /// /// \param window the window to get the theme from. Note that it is not --- 160,165 ---- /// Before any of the other functions can be called, the theme data must be /// loaded from the window. This function should also be called any time the ! /// window recieves a WM_THEMECHANGED message. Alternatively, set_theme_name ! /// can be used. /// /// \param window the window to get the theme from. Note that it is not *************** *** 168,171 **** --- 171,181 ---- // virtual bool set_window(HWND window) = 0; + // + /// Before any of the other functions can be called, the theme name must be set. + /// Alternatively, set_window can be used. + /// + /// \param the name of the theme to use. + // + virtual void set_theme_name(const WCHAR* theme_name) = 0; virtual ~metrics_t() { } Index: ui_core_implementation.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32/ui_core_implementation.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ui_core_implementation.hpp 3 Feb 2006 18:33:36 -0000 1.3 --- ui_core_implementation.hpp 23 Feb 2006 23:28:55 -0000 1.4 *************** *** 19,22 **** --- 19,24 ---- #include "ui_core.hpp" #include "event_dispatcher.hpp" + #include "label_t.hpp" + #include "label_t_impl.hpp" #include <adobe/future/memory.hpp> *************** *** 44,47 **** --- 46,61 ---- /****************************************************************************************************/ + // + /// \return the invisible window used as the initial parent for all controls. + HWND invisible_parent(); + void set_font(HWND window, int uxtheme_type, const WCHAR* theme_name=NULL); + #if !defined(ADOBE_NO_DOCUMENTATION) + namespace implementation { + std::string get_window_title(HWND window); + void get_control_bounds(HWND control, RECT& bounds); + void set_control_bounds(HWND control, const RECT& bounds); + } + #endif + struct control_t : boost::equality_comparable<control_t> { *************** *** 56,60 **** void set_bounds(const point_2d_t& position, const extents_t& geometry); void set_name(const std::string& name); ! virtual void set_theme(theme_t theme); void adorn_theme(theme_t theme); void unadorn_theme(theme_t theme); --- 70,74 ---- void set_bounds(const point_2d_t& position, const extents_t& geometry); void set_name(const std::string& name); ! virtual void set_theme(theme_t theme); void adorn_theme(theme_t theme); void unadorn_theme(theme_t theme); *************** *** 93,99 **** extents_t geometry_m; // saving set_bounds param for essentials point_2d_t position_m; // saving set_bounds param for widget framing ! int uxtheme_type_m; ! static HWND invisible_parent_m; // an invisible window used as the initial parent for all controls. ! event_dispatcher::reference event_dispatcher_m; // ref. to singleton event dispatcher. HMENU child_id_m; // this control_m's child id. }; --- 107,112 ---- extents_t geometry_m; // saving set_bounds param for essentials point_2d_t position_m; // saving set_bounds param for widget framing ! int uxtheme_type_m; ! event_dispatcher::reference event_dispatcher_m; // ref. to singleton event dispatcher. HMENU child_id_m; // this control_m's child id. }; *************** *** 332,335 **** --- 345,349 ---- void initialize(const RECT& bounds); void set_bounds(const point_2d_t& position, const extents_t& geometry); + void set_theme(theme_t); void set_value(bool value); void set_visible(bool make_visible); *************** *** 389,412 **** }; - /****************************************************************************************************/ - - struct static_text_t::implementation_t : control_t - { - typedef control_t _super; - - implementation_t(); - implementation_t(const implementation_t& rhs); - - void initialize(const RECT& bounds, const std::string& name); - long best_height_given_width(long width); - void set_name(const std::string& name); - void signal_hit(const implementation::static_text_hit_proc_t& proc); - - ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::static_text_t::implementation_t); - - virtual dictionary_t essentials() const; - - implementation::static_text_hit_proc_t hit_proc_m; - }; /****************************************************************************************************/ --- 403,406 ---- *************** *** 427,442 **** long cols, long rows); ! static_text_t& get_label(); ! virtual extents_t best_bounds(); ! void set_bounds(const point_2d_t& position, const extents_t& geometry); ! void set_active(bool active); ! virtual void set_theme(theme_t theme); ! void set_name(const std::string& text); ! void set_field_text(const std::string& text); ! void set_static_disabled(bool is_static_disabled); ! void set_selection(long start_char, long end_char); ! void signal_pre_edit(const implementation::edit_text_pre_edit_proc_t& proc); ! void signal_post_edit(const implementation::edit_text_post_edit_proc_t& proc); ! void signal_label_hit(const implementation::edit_text_label_hit_proc_t& proc); // /// Recalculate the style which should be given as the Window style --- 421,436 ---- long cols, long rows); ! label_t& get_label(); ! virtual extents_t best_bounds(); ! void set_bounds(const point_2d_t& position, const extents_t& geometry); ! void set_active(bool active); ! virtual void set_theme(theme_t theme); ! void set_name(const std::string& text); ! void set_field_text(const std::string& text); ! void set_static_disabled(bool is_static_disabled); ! void set_selection(long start_char, long end_char); ! void signal_pre_edit(const implementation::edit_text_pre_edit_proc_t& proc); ! void signal_post_edit(const implementation::edit_text_post_edit_proc_t& proc); ! void signal_label_hit(const implementation::edit_text_label_hit_proc_t& proc); // /// Recalculate the style which should be given as the Window style *************** *** 445,450 **** /// \return the window style which should be applied to control_m. // ! long get_window_style() const; ! virtual LRESULT event(UINT msg, WPARAM wParam, LPARAM lParam); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); --- 439,444 ---- /// \return the window style which should be applied to control_m. // ! long get_window_style() const; ! virtual LRESULT event(UINT msg, WPARAM wParam, LPARAM lParam); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); *************** *** 452,458 **** virtual dictionary_t essentials() const; ! static_text_t name_m; ! std::wstring field_text_m; ! static_text_t static_disabled_text_m; //HWND scroll_control_m; bool static_disabled_m; --- 446,452 ---- virtual dictionary_t essentials() const; ! label_t name_m; ! std::wstring field_text_m; ! label_t static_disabled_text_m; //HWND scroll_control_m; bool static_disabled_m; *************** *** 483,487 **** void initialize(const RECT& bounds, const std::string& name); ! static_text_t& get_label(); virtual extents_t best_bounds(); void set_bounds(const point_2d_t& position, const extents_t& geometry); --- 477,481 ---- void initialize(const RECT& bounds, const std::string& name); ! label_t& get_label(); virtual extents_t best_bounds(); void set_bounds(const point_2d_t& position, const extents_t& geometry); *************** *** 501,506 **** virtual dictionary_t essentials() const; ! static_text_t name_m; ! static_text_t static_disabled_text_m; bool static_disabled_m; long static_baseline_m; --- 495,500 ---- virtual dictionary_t essentials() const; ! label_t name_m; ! label_t static_disabled_text_m; bool static_disabled_m; long static_baseline_m; *************** *** 544,547 **** --- 538,542 ---- popup_t popup_m; bool using_popup_m; + long popup_width_m; long popup_height_m; long popup_baseline_m; *************** *** 592,596 **** ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::progress_bar_t::implementation_t); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::separator_t::implementation_t); - ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::static_text_t::implementation_t); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::edit_text_t::implementation_t); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::popup_t::implementation_t); --- 587,590 ---- --- NEW FILE: label_t_impl.hpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_LABEL_T_IMPL_HPP #define ADOBE_LABEL_T_IMPL_HPP /****************************************************************************************************/ #include <windows.h> #include "ui_core.hpp" #include "label_t.hpp" #include <adobe/future/memory.hpp> #include <boost/operators.hpp> #include <string> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ template <> struct delete_ptr<HWND> { void operator()(HWND x) const { ::DestroyWindow(x); }; }; typedef adobe::auto_resource<HWND> auto_hwnd_t; /****************************************************************************************************/ struct label_t::implementation_t : boost::equality_comparable<label_t::implementation_t> { implementation_t(const std::string& name, std::size_t characters, theme_t theme); #if !defined(ADOBE_NO_DOCUMENTATION) implementation_t(const implementation_t& rhs); implementation_t& operator=(const implementation_t& rhs); ~implementation_t(); #endif void initialize(const RECT& bounds, const std::string& name); extents_t::slice_t measure_horizontal(); extents_t::slice_t measure_vertical(const extents_t::slice_t& horizontal); void place(const point_2d_t& position, const extents_t& extents); void enable(bool make_enabled); friend bool operator== (const adobe::label_t& x, const adobe::label_t& y); #if !defined(ADOBE_NO_DOCUMENTATION) struct implementation_t; private: implementation_t* object_m; public: implementation_t& implementation(); const implementation_t& implementation() const; #endif inline friend bool operator==(const adobe::label_t::implementation_t& x, const adobe::label_t::implementation_t& y) { return &x == &y; } auto_hwnd_t window_m; theme_t theme_m; WNDPROC default_window_proc_m; RECT bounds_m; std::string name_m; std::size_t characters_m; }; /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif /****************************************************************************************************/ |