visible_change_queue.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_VISIBLE_CHANGE_QUEUE_HPP 00010 #define ADOBE_VISIBLE_CHANGE_QUEUE_HPP 00011 00012 /****************************************************************************************************/ 00013 00014 #include <vector> 00015 00016 #include <adobe/eve.hpp> 00017 #include <adobe/future/behavior.hpp> 00018 #include <adobe/name.hpp> 00019 00020 /****************************************************************************************************/ 00021 00022 namespace adobe { 00023 00024 /*************************************************************************************************/ 00025 00026 /* 00027 REVISIT (sparent) : As a current "hack" for handling the drawing order of widgets when optional 00028 panels come and go we are going to define a dpq of callbacks which need to be shown or hidden 00029 and the window will handle the logic. Still need to figure out the right place to put this. 00030 */ 00031 struct visible_change_queue_t 00032 { 00033 visible_change_queue_t(eve_t& eve) : 00034 root_m(false), 00035 hide_queue_m(root_m.insert_behavior(true)), 00036 eve_eval_token_m(root_m.insert(boost::bind(&eve_t::evaluate, boost::ref(eve), eve_t::evaluate_nested, 0, 0))), 00037 show_queue_m(root_m.insert_behavior(true)), 00038 force_m(false) 00039 { } 00040 00041 behavior_t root_m; 00042 behavior_t::behavior_token_t hide_queue_m; 00043 behavior_t::verb_token_t eve_eval_token_m; 00044 behavior_t::behavior_token_t show_queue_m; 00045 bool force_m; // force an update irrespective of the show/hide queues being empty 00046 00047 void update() 00048 { 00049 if (force_m || hide_queue_m->empty() == false || show_queue_m->empty() == false) 00050 root_m(); 00051 00052 force_m = false; 00053 } 00054 }; 00055 00056 00057 /****************************************************************************************************/ 00058 00059 typedef std::vector<name_t> touch_set_t; 00060 00061 /****************************************************************************************************/ 00062 00063 } // namespace adobe 00064 00065 /****************************************************************************************************/ 00066 00067 #endif 00068 00069 /****************************************************************************************************/ |