|
From: Ralph T. <ra...@us...> - 2005-04-22 21:42:15
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/sources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22678/visual_refactor/adobe/test/visual/sources Modified Files: client_assembler.cpp Log Message: window_server_t now takes a function to work as the widget factory. This completes the factory work on visual (aside from fixing any regressions I have introduced with this work). The next steps are to remove the proxies and factory functions into a file called factory.cpp, and add a "libvisual" target (and probably move the adobe begin stuff out into another directory). Index: client_assembler.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/sources/client_assembler.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** client_assembler.cpp 22 Apr 2005 20:17:09 -0000 1.7 --- client_assembler.cpp 22 Apr 2005 21:42:06 -0000 1.8 *************** *** 3316,3327 **** /****************************************************************************************************/ ! boost::any client_assembler(adobe::factory_token_t& token, const boost::any& parent, adobe::name_t class_name, const adobe::dictionary_t& arguments) { // ! // REVISIT (ralpht): It looks almost like boost::bind could replace the ! // client assembler. The only change due here is to use the factory ! // function given to window_server_t rather than default_factory. // ! return default_factory(class_name, arguments, boost::any_cast<adobe::widget_node_t>(parent), token); } --- 3316,3325 ---- /****************************************************************************************************/ ! boost::any client_assembler(adobe::factory_token_t& token, const boost::any& parent, adobe::name_t class_name, const adobe::dictionary_t& arguments, adobe::widget_factory_proc_t my_factory) { // ! // Notice that we use the supplied factory to create widgets. // ! return my_factory(class_name, arguments, boost::any_cast<adobe::widget_node_t>(parent), token); } *************** *** 3338,3342 **** window_server_t::window_server_t(const char* directory_path, adobe::sheet_t& sheet) : directory_path_m(directory_path), ! sheet_m(sheet) { } --- 3336,3341 ---- window_server_t::window_server_t(const char* directory_path, adobe::sheet_t& sheet) : directory_path_m(directory_path), ! sheet_m(sheet), ! widget_factory_m(adobe::default_factory) { } *************** *** 3362,3369 **** window_list_m.back() = make_view( (directory_path_m + "/" + file_name).c_str(), ! sheet_m, ! boost::bind(&window_server_t::dispatch_window_action, ! boost::ref(*this), window, _1, _2), ! dialog_size).release(); sheet_m.update(); // Force values to their correct states. --- 3361,3369 ---- window_list_m.back() = make_view( (directory_path_m + "/" + file_name).c_str(), ! sheet_m, ! boost::bind(&window_server_t::dispatch_window_action, ! boost::ref(*this), window, _1, _2), ! dialog_size, ! widget_factory_m).release(); sheet_m.update(); // Force values to their correct states. *************** *** 3382,3385 **** --- 3382,3392 ---- /****************************************************************************************************/ + void window_server_t::set_widget_factory(adobe::widget_factory_proc_t proc) + { + widget_factory_m = proc; + } + + /****************************************************************************************************/ + void window_server_t::set_action_fallback(action_fallback_proc_t proc) { *************** *** 3456,3470 **** /****************************************************************************************************/ ! adobe::auto_ptr<eve_client_holder> make_view( const char* file_name, ! adobe::sheet_t& sheet, ! const button_notifier_t& notifier, ! size_enum_t dialog_size) { ! std::ifstream stream(file_name); adobe::auto_ptr<eve_client_holder> result(new eve_client_holder()); ! ! adobe::eve_t* result_eve(new adobe::eve_t()); ! adobe::factory_token_t token(adobe::get_main_display(), result->assemblage_m, *result_eve, sheet, notifier, result->widget_stream_m, result->show_window_m); ! // // We set the initial parent to be the root of the main display, an --- 3463,3476 ---- /****************************************************************************************************/ ! adobe::auto_ptr<eve_client_holder> make_view( const char* file_name, ! adobe::sheet_t& sheet, ! const button_notifier_t& notifier, ! size_enum_t dialog_size, ! adobe::widget_factory_proc_t factory) { ! std::ifstream stream(file_name); adobe::auto_ptr<eve_client_holder> result(new eve_client_holder()); ! adobe::eve_t* result_eve(new adobe::eve_t()); ! adobe::factory_token_t token(adobe::get_main_display(), result->assemblage_m, *result_eve, sheet, notifier, result->widget_stream_m, result->show_window_m); // // We set the initial parent to be the root of the main display, an *************** *** 3473,3477 **** adobe::eve::parse(stream, adobe::line_position_t(file_name), adobe::widget_node_t(dialog_size, adobe::eve_t::iterator(), adobe::get_main_display().root()), ! boost::bind(&::client_assembler, boost::ref(token), _1, _3, boost::bind(adobe::eve::evaluate_arguments(), _4))); result_eve->evaluate(adobe::eve_t::evaluate_flat); --- 3479,3484 ---- adobe::eve::parse(stream, adobe::line_position_t(file_name), adobe::widget_node_t(dialog_size, adobe::eve_t::iterator(), adobe::get_main_display().root()), ! boost::bind(&::client_assembler, boost::ref(token), _1, _3, boost::bind(adobe::eve::evaluate_arguments(), _4), ! factory)); result_eve->evaluate(adobe::eve_t::evaluate_flat); |