From: Foster B. <fos...@us...> - 2006-02-23 23:29:36
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760/adobe/future/widgets/headers/mac Modified Files: os_utilities.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: ui_core_implementation.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/mac/ui_core_implementation.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ui_core_implementation.hpp 3 Feb 2006 18:33:36 -0000 1.8 --- ui_core_implementation.hpp 23 Feb 2006 23:28:55 -0000 1.9 *************** *** 28,31 **** --- 28,33 ---- #include <adobe/array.hpp> + #include "label_t_impl.hpp" + /****************************************************************************************************/ *************** *** 606,665 **** /****************************************************************************************************/ - struct static_text_hit_handler_t : implementation::event_handler<implementation::static_text_hit_proc_t> - { - explicit static_text_hit_handler_t(static_text_t::implementation_t& widget) : - widget_m(widget) - { - insert_event(kEventClassControl, kEventControlClick); - } - - ::OSStatus handle_event( ::EventHandlerCallRef next, - ::EventRef event); - - static_text_t::implementation_t& widget_m; - }; - - /****************************************************************************************************/ - - struct static_text_t::implementation_t - { - - implementation_t(); - implementation_t(const implementation_t& rhs); - - void initialize(const Rect& bounds, const std::string& name); - - extents_t best_bounds(); - void set_bounds(const point_2d_t& position, const extents_t& extents); - - void set_name(const std::string& name); - - void set_theme(theme_t theme) { implementation::set_theme(*this, theme); } - void adorn_theme(theme_t theme) { implementation::adorn_theme(*this, theme); } - void unadorn_theme(theme_t theme) { implementation::unadorn_theme(*this, theme); } - - void set_active(bool make_active) { implementation::set_active(control_m, make_active); } - void set_visible(bool make_visible) { implementation::set_visible(control_m, make_visible); } - - long best_height_given_width(long width); - - void signal_hit(const implementation::static_text_hit_proc_t& proc); - - ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::static_text_t::implementation_t); - - ::ControlRef control_m; - theme_t theme_m; - metric_extractor_t metrics_m; - static_text_hit_handler_t hit_handler_m; - }; - - /****************************************************************************************************/ - /****************************************************************************************************/ - /****************************************************************************************************/ - /****************************************************************************************************/ - /****************************************************************************************************/ - /****************************************************************************************************/ - /****************************************************************************************************/ - class mouse_in_out_event_tag_t { } ; --- 608,611 ---- *************** *** 752,757 **** long rows); ! static_text_t& get_label() { return name_m; } ! const static_text_t& get_label() const { return name_m; } extents_t best_bounds(); --- 698,703 ---- long rows); ! label_t& get_label() { return name_m; } ! const label_t& get_label() const { return name_m; } extents_t best_bounds(); *************** *** 781,807 **** ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); ! ::ControlRef control_m; ! theme_t theme_m; ! metric_extractor_t metrics_m; ! ::HIViewRef scroll_control_m; ! static_text_t name_m; ! std::string field_text_m; ! static_text_t static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! bool scrollable_m; ! bool password_m; ! long rows_m; ! long cols_m; ! long static_width_m; ! long static_height_m; ! long static_baseline_m; ! long edit_height_m; ! long edit_baseline_m; ! mouse_in_out_event_handler_t mouse_handler_m; ! edit_text_pre_handler_t pre_edit_handler_m; ! edit_text_post_handler_t post_edit_handler_m; ! edit_textview_validator_t textview_validation_handler_m; ! focus_handler_t focus_handler_m; }; --- 727,753 ---- ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); ! ::ControlRef control_m; ! theme_t theme_m; ! metric_extractor_t metrics_m; ! ::HIViewRef scroll_control_m; ! label_t name_m; ! std::string field_text_m; ! label_t static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! bool scrollable_m; ! bool password_m; ! long rows_m; ! long cols_m; ! long static_width_m; ! long static_height_m; ! long static_baseline_m; ! long edit_height_m; ! long edit_baseline_m; ! mouse_in_out_event_handler_t mouse_handler_m; ! edit_text_pre_handler_t pre_edit_handler_m; ! edit_text_post_handler_t post_edit_handler_m; ! edit_textview_validator_t textview_validation_handler_m; ! focus_handler_t focus_handler_m; }; *************** *** 882,896 **** ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::popup_t::implementation_t); ! ::ControlRef control_m; ! theme_t theme_m; ! metric_extractor_t metrics_m; ! std::string name_m; ! static_text_t static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! menu_items_t menu_items_m; ! popup_value_handler_t value_handler_m; ! popup_key_handler_t key_handler_m; ! focus_handler_t focus_handler_m; }; --- 828,842 ---- ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::popup_t::implementation_t); ! ::ControlRef control_m; ! theme_t theme_m; ! metric_extractor_t metrics_m; ! std::string name_m; ! label_t static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! menu_items_t menu_items_m; ! popup_value_handler_t value_handler_m; ! popup_key_handler_t key_handler_m; ! focus_handler_t focus_handler_m; }; *************** *** 1039,1043 **** 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); --- 985,989 ---- 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::label_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); --- 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_WIDGET_LABEL_T_IMPLEMENTATION_HPP #define ADOBE_WIDGET_LABEL_T_IMPLEMENTATION_HPP /****************************************************************************************************/ #include <adobe/future/widgets/headers/label_t.hpp> #include "os_utilities.hpp" #include "carbon_safe.hpp" #include "metric_extractor.hpp" /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ #if 0 struct label_hit_handler_t : implementation::event_handler<implementation::label_hit_proc_t> { explicit label_hit_handler_t(label_t::implementation_t& widget) : widget_m(widget) { insert_event(kEventClassControl, kEventControlClick); } ::OSStatus handle_event( ::EventHandlerCallRef next, ::EventRef event); label_t::implementation_t& widget_m; }; #endif /****************************************************************************************************/ struct label_t::implementation_t { implementation_t(const std::string& name, std::size_t characters, theme_t theme); implementation_t(const implementation_t& rhs); implementation_t& operator=(const implementation_t& rhs); 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) { implementation::set_bounds(*this, position, extents); } void enable(bool make_enabled) { implementation::set_active(control_m, make_enabled); } #if 0 void signal_hit(const implementation::label_hit_proc_t& proc); #endif inline friend bool operator== (const adobe::label_t::implementation_t& x, const adobe::label_t::implementation_t& y) { return &x == &y; } ::ControlRef control_m; theme_t theme_m; metric_extractor_t metrics_m; std::size_t characters_m; #if 0 label_hit_handler_t hit_handler_m; #endif }; /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif /****************************************************************************************************/ Index: os_utilities.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/mac/os_utilities.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** os_utilities.hpp 3 Feb 2006 18:33:36 -0000 1.1 --- os_utilities.hpp 23 Feb 2006 23:28:55 -0000 1.2 *************** *** 348,351 **** --- 348,354 ---- /****************************************************************************************************/ + // this is using ATSUI on the backend, and should be replaced by measure_theme_text + // once we remove all the specializations for adobe::theme_t + adobe::extents_t get_text_dimensions(const std::string& text, adobe::theme_t theme); *************** *** 585,588 **** --- 588,595 ---- /****************************************************************************************************/ + + adobe::extents_t measure_theme_text(const std::string& text, adobe::theme_t theme); + + /****************************************************************************************************/ /****************************************************************************************************/ /****************************************************************************************************/ |