From: Foster B. <fos...@us...> - 2006-02-03 18:34:23
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/headers/win32 Modified Files: event_dispatcher.hpp metrics.hpp ui_core_implementation.hpp wincast.hpp Log Message: asl 1.0.13 Index: event_dispatcher.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32/event_dispatcher.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** event_dispatcher.hpp 24 Jan 2006 19:38:47 -0000 1.1 --- event_dispatcher.hpp 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 47,121 **** class event_dispatcher { ! typedef std::map<int, control_t*> control_map_t; ! control_map_t control_map_m; ///< Mapping Child ID -> control_t* ! int current_id_m; ///< Child ID to next issue ! // ! /// This private constructor maintains the singleton nature of ! /// this class. ! // ! event_dispatcher(); ! friend class reference; public: ! // ! /// This reference class contains a reference to the event_dispatcher, ! /// and should be used by controls to subscribe and unsubscribe -- all ! /// controls should have one of these as a member variable. ! // ! class reference ! { ! int child_id_m; ///< The child ID for the owning control_t. ! public: ! // ! /// This constructor initializes all values to zero, and acquires a ! /// reference to the event_dispatcher. ! // ! reference(); ! // ! /// Unsubscribe any control which subscribed to the event_dispatcher ! /// and release the reference to the event_dispatcher. ! // ! ~reference(); ! // ! /// Subscribe the given control_t to the event_dispatcher. The returned ! /// value should be used as the child Id for the window which the given ! /// control will create. ! /// ! /// \param control the control to subscribe to events. ! /// \return the child id for the control to use. ! // ! HMENU subscribe(control_t* control); ! // ! /// Return the child ID. ! /// ! /// \return the child id to use for windows belonging to the subscribed ! /// control, or NULL if no control has subscribed through this ! /// reference. ! // ! HMENU child_id() const; ! }; ! // ! /// Dispatch an event through to the control which needs to process it. ! /// ! /// \param message The Windows message type. ! /// \param wParam The pointer parameter of the message. ! /// \param lParam the long parameter of the message. ! /// \param handled this reference bool is set to true if the message ! /// was dispatched to a child, or to false if no child ! /// could be found. ! /// \return the result of the event. ! // ! static LRESULT event(UINT message, WPARAM wParam, LPARAM lParam, bool& handled); ! // ! /// Examine the given keyboard message and send any required modifier events ! /// to controls. ! /// ! /// \param message The Windows message type. ! /// \param wParam The WPARAM value from the Windows message. ! // ! static void keyboard(UINT message, WPARAM wParam); }; /****************************************************************************************************/ ! } --- 47,121 ---- class event_dispatcher { ! typedef std::map<int, control_t*> control_map_t; ! control_map_t control_map_m; ///< Mapping Child ID -> control_t* ! int current_id_m; ///< Child ID to next issue ! // ! /// This private constructor maintains the singleton nature of ! /// this class. ! // ! event_dispatcher(); ! friend class reference; public: ! // ! /// This reference class contains a reference to the event_dispatcher, ! /// and should be used by controls to subscribe and unsubscribe -- all ! /// controls should have one of these as a member variable. ! // ! class reference ! { ! int child_id_m; ///< The child ID for the owning control_t. ! public: ! // ! /// This constructor initializes all values to zero, and acquires a ! /// reference to the event_dispatcher. ! // ! reference(); ! // ! /// Unsubscribe any control which subscribed to the event_dispatcher ! /// and release the reference to the event_dispatcher. ! // ! ~reference(); ! // ! /// Subscribe the given control_t to the event_dispatcher. The returned ! /// value should be used as the child Id for the window which the given ! /// control will create. ! /// ! /// \param control the control to subscribe to events. ! /// \return the child id for the control to use. ! // ! HMENU subscribe(control_t* control); ! // ! /// Return the child ID. ! /// ! /// \return the child id to use for windows belonging to the subscribed ! /// control, or NULL if no control has subscribed through this ! /// reference. ! // ! HMENU child_id() const; ! }; ! // ! /// Dispatch an event through to the control which needs to process it. ! /// ! /// \param message The Windows message type. ! /// \param wParam The pointer parameter of the message. ! /// \param lParam the long parameter of the message. ! /// \param handled this reference bool is set to true if the message ! /// was dispatched to a child, or to false if no child ! /// could be found. ! /// \return the result of the event. ! // ! static LRESULT event(UINT message, WPARAM wParam, LPARAM lParam, bool& handled); ! // ! /// Examine the given keyboard message and send any required modifier events ! /// to controls. ! /// ! /// \param message The Windows message type. ! /// \param wParam The WPARAM value from the Windows message. ! // ! static void keyboard(UINT message, WPARAM wParam); }; /****************************************************************************************************/ ! } Index: wincast.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32/wincast.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wincast.hpp 24 Jan 2006 19:38:47 -0000 1.1 --- wincast.hpp 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 1,6 **** /* ! 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) */ --- 1,6 ---- /* ! 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) */ *************** *** 25,49 **** inline T cast(U u) { ! // REVISIT (fbrereto) : This function circumvents an issue where MSVC won't allow for the casting ! // of a primitive of smaller type to one of larger type. Please use sparingly, ! // but when this type of cast must be made use this function so it can be ! // pulled out easily. ! #pragma warning ( push ) ! #pragma warning ( disable : 4311 ) // typecast pointer truncation from type to type ! #pragma warning ( disable : 4312 ) // typecast conversion from type to type of greater size ! #pragma warning ( disable : 4800 ) // conversion to true/false performance warning ! return (T)(u); ! #pragma warning ( pop ) } /****************************************************************************************************/ ! } // namespace hackery /****************************************************************************************************/ ! } // namespace --- 25,49 ---- inline T cast(U u) { ! // REVISIT (fbrereto) : This function circumvents an issue where MSVC won't allow for the casting ! // of a primitive of smaller type to one of larger type. Please use sparingly, ! // but when this type of cast must be made use this function so it can be ! // pulled out easily. ! #pragma warning ( push ) ! #pragma warning ( disable : 4311 ) // typecast pointer truncation from type to type ! #pragma warning ( disable : 4312 ) // typecast conversion from type to type of greater size ! #pragma warning ( disable : 4800 ) // conversion to true/false performance warning ! return (T)(u); ! #pragma warning ( pop ) } /****************************************************************************************************/ ! } // namespace hackery /****************************************************************************************************/ ! } // namespace 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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ui_core_implementation.hpp 2 Feb 2006 09:10:30 -0000 1.2 --- ui_core_implementation.hpp 3 Feb 2006 18:33:36 -0000 1.3 *************** *** 1,11 **** /* ! 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_UI_CORE_IMPLEMENTATION_HPP #define ADOBE_UI_CORE_IMPLEMENTATION_HPP [...1114 lines suppressed...] ! void signal_value_change(const implementation::slider_value_proc_t& proc); ! ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::slider_t::implementation_t); ! virtual dictionary_t essentials() const; ! implementation::slider_value_proc_t value_proc_m; ! bool is_vertical_m; ! slider_style_t style_m; ! long num_tick_marks_m; }; *************** *** 630,634 **** ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::unit_edit_text_t::implementation_t); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::slider_t::implementation_t); - ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::bevel_button_t::implementation_t); /****************************************************************************************************/ --- 597,600 ---- Index: metrics.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/win32/metrics.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** metrics.hpp 24 Jan 2006 19:38:47 -0000 1.1 --- metrics.hpp 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 50,173 **** class metrics_t { public: ! // ! /// Return a reference to the single instance of metrics_t. ! /// ! /// \return a reference to the single instance of metrics_t. ! // ! static metrics_t& get_instance(); ! // ! /// Get the correct font to use for the given widget. This font must ! /// be used for the font metrics to be correct. ! /// ! /// \param widget_type the type of the widget. ! /// \param out_font a reference filled with the requested font. ! /// ! /// \return true if the font was returned successfully, false if ! /// the font could not be returned. ! // ! virtual bool get_font(int widget_type, LOGFONTW& out_font) const = 0; ! // ! /// Get the metrics for the font which should be used in the given widget. ! /// ! /// \param widget_type the type of the widget. ! /// \param out_metrics a reference filled with the text metrics. ! /// ! /// \return true if the font metrics were returned successfully, false ! /// if the metrics could not be returned. ! // ! virtual bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics) const = 0; ! // ! /// Get the extents for the given text string, to be contained in the ! /// specified widget. ! /// ! /// \param widget_type the type of the widget. ! /// \param text the string to return the extents for. ! /// \param out_extents a reference filled with the text extents. ! /// ! /// \return true if the text extents were returned successfully, false ! /// 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 ! /// given state. ! /// ! /// \param widget_type the type of the widget. ! /// \param measurement the required measurement. ! /// \param out_val a reference filled with the requested value. ! /// ! /// \return true if the value was returned successfully, false ! /// if the value could not be found. ! // ! virtual bool get_integer(int widget_type, int measurement, int& out_val) const = 0; ! // ! /// Get the size of the specified widget. ! /// ! /// \param widget_type the type of the widget. ! /// \param measurement the size to get: TS_MIN, TS_TRUE, or TS_DRAW. ! /// \param out_size a reference filled with the requested rectangle. ! /// ! /// \return true if the rectangle was returned successfully, false ! /// if the rectangle could not be found. ! // ! virtual bool get_size(int widget_type, THEMESIZE measurement, SIZE& out_size) const = 0; ! // ! /// Get the margins for the specified widget. Typically the margins ! /// describe space which must be added around the text rectangle for ! /// controls with a caption. ! /// ! /// \param widget_type the type of the widget. ! /// \param out_margins a reference filled with the margins of the widget. ! /// ! /// \return true if the margins were returned successfully, false ! /// if the margins could not be found. ! // ! virtual bool get_margins(int widget_type, MARGINS& out_margins) const = 0; ! // ! /// Get the text margins for a button widget. This call is specific ! /// to a button widget, but is only available with Visual Styles on ! /// Windows XP (hence is grouped in with the other metrics functions ! /// of similar availability). ! /// ! /// \param widget_type the UXTheme type of button ! /// \param out_margins a rectangle containing the margins ! /// ! /// \return true if the margins were returned successfully, false ! /// if the margins could not be found. ! // ! virtual bool get_button_text_margins(int widget_type, RECT& out_margins) const = 0; ! // ! /// Return true if visual styles are currently in use, false if they ! /// are not being used. ! /// ! /// \return true if visual styles are in use, false otherwise. ! // ! virtual bool using_styles() const = 0; ! // ! /// Use the current style to draw the background of the parent control ! /// of the given window using the given DC. This function is useful for ! /// drawing the background of controls which appear on top of tab controls, ! /// or other places where the color isn't regulation. ! /// ! /// \param window the window to draw the parent background of. ! /// \param dc the DC to draw with. This DC does not have to be ! /// drawing onto the given window. ! // ! virtual void draw_parent_background(HWND window, HDC dc) = 0; ! // ! /// 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 ! /// important which window is used, it does not have to ! /// be the same window every time. ! /// ! /// \return true if the theme was obtained from the window, false if the ! /// theme could not be obtained from the window. ! // ! virtual bool set_window(HWND window) = 0; ! virtual ~metrics_t() { } }; --- 50,173 ---- class metrics_t { public: ! // ! /// Return a reference to the single instance of metrics_t. ! /// ! /// \return a reference to the single instance of metrics_t. ! // ! static metrics_t& get_instance(); ! // ! /// Get the correct font to use for the given widget. This font must ! /// be used for the font metrics to be correct. ! /// ! /// \param widget_type the type of the widget. ! /// \param out_font a reference filled with the requested font. ! /// ! /// \return true if the font was returned successfully, false if ! /// the font could not be returned. ! // ! virtual bool get_font(int widget_type, LOGFONTW& out_font) const = 0; ! // ! /// Get the metrics for the font which should be used in the given widget. ! /// ! /// \param widget_type the type of the widget. ! /// \param out_metrics a reference filled with the text metrics. ! /// ! /// \return true if the font metrics were returned successfully, false ! /// if the metrics could not be returned. ! // ! virtual bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics) const = 0; ! // ! /// Get the extents for the given text string, to be contained in the ! /// specified widget. ! /// ! /// \param widget_type the type of the widget. ! /// \param text the string to return the extents for. ! /// \param out_extents a reference filled with the text extents. ! /// ! /// \return true if the text extents were returned successfully, false ! /// 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 ! /// given state. ! /// ! /// \param widget_type the type of the widget. ! /// \param measurement the required measurement. ! /// \param out_val a reference filled with the requested value. ! /// ! /// \return true if the value was returned successfully, false ! /// if the value could not be found. ! // ! virtual bool get_integer(int widget_type, int measurement, int& out_val) const = 0; ! // ! /// Get the size of the specified widget. ! /// ! /// \param widget_type the type of the widget. ! /// \param measurement the size to get: TS_MIN, TS_TRUE, or TS_DRAW. ! /// \param out_size a reference filled with the requested rectangle. ! /// ! /// \return true if the rectangle was returned successfully, false ! /// if the rectangle could not be found. ! // ! virtual bool get_size(int widget_type, THEMESIZE measurement, SIZE& out_size) const = 0; ! // ! /// Get the margins for the specified widget. Typically the margins ! /// describe space which must be added around the text rectangle for ! /// controls with a caption. ! /// ! /// \param widget_type the type of the widget. ! /// \param out_margins a reference filled with the margins of the widget. ! /// ! /// \return true if the margins were returned successfully, false ! /// if the margins could not be found. ! // ! virtual bool get_margins(int widget_type, MARGINS& out_margins) const = 0; ! // ! /// Get the text margins for a button widget. This call is specific ! /// to a button widget, but is only available with Visual Styles on ! /// Windows XP (hence is grouped in with the other metrics functions ! /// of similar availability). ! /// ! /// \param widget_type the UXTheme type of button ! /// \param out_margins a rectangle containing the margins ! /// ! /// \return true if the margins were returned successfully, false ! /// if the margins could not be found. ! // ! virtual bool get_button_text_margins(int widget_type, RECT& out_margins) const = 0; ! // ! /// Return true if visual styles are currently in use, false if they ! /// are not being used. ! /// ! /// \return true if visual styles are in use, false otherwise. ! // ! virtual bool using_styles() const = 0; ! // ! /// Use the current style to draw the background of the parent control ! /// of the given window using the given DC. This function is useful for ! /// drawing the background of controls which appear on top of tab controls, ! /// or other places where the color isn't regulation. ! /// ! /// \param window the window to draw the parent background of. ! /// \param dc the DC to draw with. This DC does not have to be ! /// drawing onto the given window. ! // ! virtual void draw_parent_background(HWND window, HDC dc) = 0; ! // ! /// 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 ! /// important which window is used, it does not have to ! /// be the same window every time. ! /// ! /// \return true if the theme was obtained from the window, false if the ! /// theme could not be obtained from the window. ! // ! virtual bool set_window(HWND window) = 0; ! virtual ~metrics_t() { } }; |