window_server.hpp
Go to the documentation of this file.
00001 /* 00002 Copyright 2005-2007 Adobe Systems Incorporated 00003 Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt 00004 or a copy at http://stlab.adobe.com/licenses.html) 00005 */ 00006 00007 /****************************************************************************************************/ 00008 00009 #ifndef ADOBE_WIDGET_WINDOW_SERVER_HPP 00010 #define ADOBE_WIDGET_WINDOW_SERVER_HPP 00011 00012 /****************************************************************************************************/ 00013 00014 #include <adobe/config.hpp> 00015 00016 #include <adobe/adam.hpp> 00017 #include <adobe/any_regular.hpp> 00018 #include <adobe/dictionary.hpp> 00019 #include <adobe/eve.hpp> 00020 #include <adobe/future/assemblage.hpp> 00021 #include <adobe/future/debounce.hpp> 00022 #include <adobe/future/widgets/headers/display.hpp> 00023 #include <adobe/future/widgets/headers/widget_tokens.hpp> 00024 #include <adobe/future/widgets/headers/widget_factory.hpp> 00025 #include <adobe/future/widgets/headers/widget_factory_registry.hpp> 00026 #include <adobe/istream.hpp> 00027 #include <adobe/memory.hpp> 00028 #include <adobe/name.hpp> 00029 00030 #include <boost/function.hpp> 00031 #include <boost/filesystem/path.hpp> 00032 00033 #include <list> 00034 #include <vector> 00035 00036 /*************************************************************************************************/ 00037 00038 namespace adobe { 00039 00040 /*************************************************************************************************/ 00041 /* 00042 This is a basic "Window Server" - it can be called to construct a window by name. The window 00043 is attached to a sheet as a slave (meaning the Window must be destructed before the sheet). 00044 00045 REVISIT (sparent) : Here are some thoughts on the direction this design should be going... 00046 00047 We have an assemblage (or package of items with the same lifespace) for the window which 00048 includes the eve structure and the slave connection (the wire bundle to attach the 00049 assamblage to a sheet). 00050 */ 00051 00052 struct eve_client_holder; 00053 00054 // 00058 // 00059 class window_server_t 00060 { 00061 public: 00062 typedef boost::function<void (const name_t&, const any_regular_t&)> action_fallback_proc_t; 00063 // 00073 // 00074 window_server_t(sheet_t& sheet, behavior_t& behavior); 00075 // 00077 // 00078 ~window_server_t(); 00079 // 00090 // 00091 void push_back(const char* name, size_enum_t dialog_size); 00092 // 00105 // 00106 void push_back(std::istream& data, const boost::filesystem::path& file_path, const line_position_t::getline_proc_t& getline_proc, size_enum_t dialog_size); 00107 00108 #if 0 00109 void set_back(const char* name, size_enum_t dialog_size); 00110 void pop_back(bool cancel); 00111 #endif 00112 // 00122 // 00123 void set_widget_factory(const widget_factory_t& factory) 00124 { widget_factory_m = factory; } 00125 // 00137 // 00138 void set_action_fallback(action_fallback_proc_t proc); 00139 // REVISIT (sparent) : Hack. These need to go to the correct window. 00140 // 00148 // 00149 void dispatch_action(name_t action, const any_regular_t& parameter); 00150 // 00154 // 00155 std::size_t size() const { return window_list_m.size(); } 00156 00157 // 00160 // 00161 eve_client_holder& top_client_holder(); 00162 00163 private: 00164 typedef std::list<eve_client_holder*> window_list_t; 00165 typedef window_list_t::iterator iterator; 00166 00167 void dispatch_window_action(iterator window, name_t action, const any_regular_t& parameter); 00168 void erase(iterator window); 00169 00170 sheet_t& sheet_m; 00171 behavior_t& behavior_m; 00172 window_list_t window_list_m; 00173 action_fallback_proc_t fallback_m; 00174 widget_factory_t widget_factory_m; 00175 }; 00176 00177 /*************************************************************************************************/ 00178 00179 } 00180 00181 /*************************************************************************************************/ 00182 00183 #endif |