|
From: Ralph T. <ra...@us...> - 2005-04-20 20:34:17
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1374/visual_refactor/adobe/test/visual/headers Modified Files: client_assembler.hpp factory.hpp Log Message: mac_token_t has gone, and factory_token_t has replaced it. This is the beginning of adding the factory support to client_assembler, things left for me to do are: - Remove "window_t* root_m" from factory_token_t, and put signals to bind to (for show window, hide window, etc) in instead. - Write factory functions for each widget (as detailed in factory.hpp). - Write convenience factory function "default_factory" - Make client_assembler fn use the factory function instead of having knowledge of the widgetry (as it currently does with maker_t, etc). Then we should have a really flexible factory mechanism in place. This code compiles on Windows with MSVC 2003. Index: factory.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/headers/factory.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** factory.hpp 19 Apr 2005 20:41:17 -0000 1.1 --- factory.hpp 20 Apr 2005 20:34:07 -0000 1.2 *************** *** 14,17 **** --- 14,18 ---- #include "display.hpp" #include "ui_core.hpp" + #include "client_assembler.hpp" #include <adobe/future/assemblage.hpp> *************** *** 41,59 **** // /// This structure is given to all factory functions, so that they can correctly create ! /// the widgets they need to create. // struct factory_token_t { ! factory_token_t() {} ! /* explicit factory_token_t(display_t& display, assemblage_t& assemblage, sheet_t& sheet) : display_m(display), assemblage_m(assemblage), ! sheet_m(sheet) ! {}*/ // /// Created widgets should be made with respect to this display, and inserted /// into the given parent by this display. // ! display_t* display_m; // /// This is the assemblage which widget factories register the created widget --- 42,64 ---- // /// This structure is given to all factory functions, so that they can correctly create ! /// the widgets they need to create. Things inside this structure should not change ! /// between creating two widgets. // struct factory_token_t { ! factory_token_t(display_t& display, assemblage_t& assemblage, eve_t& layout, sheet_t& sheet, eve_client::button_notifier_t notifier, eve_client::serialize_signal_t& serialize_signal, size_enum_t dialog_size) : display_m(display), assemblage_m(assemblage), ! sheet_m(sheet), ! layout_m(layout), ! notifier_m(notifier), ! widget_stream_m(serialize_signal), ! root_m(0) ! {} // /// Created widgets should be made with respect to this display, and inserted /// into the given parent by this display. // ! display_t& display_m; // /// This is the assemblage which widget factories register the created widget *************** *** 61,70 **** /// assemblage does. // ! assemblage_t* assemblage_m; // /// The current Adam sheet -- this contains all of the cells which widgets might /// want to bind against. // ! sheet_t* sheet_m; }; /****************************************************************************************************/ --- 66,109 ---- /// assemblage does. // ! assemblage_t& assemblage_m; // /// The current Adam sheet -- this contains all of the cells which widgets might /// want to bind against. // ! sheet_t& sheet_m; ! // ! /// The Eve engine which all of these widgets are being inserted into. This must ! /// be known by top-level windows, and by widgets which manage trees of Eve ! /// widgets (such as splitter widgets). ! // ! eve_t& layout_m; ! // ! /// The function to call when a button is pressed. This should be called by ! /// buttons and button-like widgets when they are hit (and have an action, ! /// rather than a state change). ! // ! eve_client::button_notifier_t notifier_m; ! // ! /// This is the signal which should trigger widget serialization. All widgets ! /// should bind to this signal. ! // ! eve_client::serialize_signal_t& widget_stream_m; ! // ! /// This specifies the size of the widgets to be used in the window. ! // ! size_enum_t dialog_size_m; ! // ! /// When a top-level widget is created (like a window), it sets this member ! /// to point to itself. This is the only part of factory_token_t which actually ! /// gets set by one of the factory functions. ! /// ! /// REVISIT (ralpht): This means that windows have to conform to adobe::window_t, ! /// which doesn't seem right. We only need the window to say "show ! /// yourself" when all of the child widgets have been created. ! /// ! /// Really we should make a window bind some methods in it's factory ! /// function to do everything we want to do with this pointer. ! // ! mutable adobe::window_t* root_m; }; /****************************************************************************************************/ Index: client_assembler.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/headers/client_assembler.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** client_assembler.hpp 19 Apr 2005 17:55:55 -0000 1.2 --- client_assembler.hpp 20 Apr 2005 20:34:07 -0000 1.3 *************** *** 100,103 **** --- 100,107 ---- /*************************************************************************************************/ + typedef boost::signal<void (std::ostream& s)> serialize_signal_t; + + /*************************************************************************************************/ + class eve_client_holder : public boost::noncopyable { *************** *** 111,115 **** adobe::eve_t* eve_m; adobe::window_t* window_m; ! boost::signal<void (std::ostream& s)> widget_stream_m; adobe::assemblage_t assemblage_m; adobe::dictionary_t contributing_m; --- 115,119 ---- adobe::eve_t* eve_m; adobe::window_t* window_m; ! serialize_signal_t widget_stream_m; adobe::assemblage_t assemblage_m; adobe::dictionary_t contributing_m; |