eve.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_EVE_HPP 00010 #define ADOBE_EVE_HPP 00011 00012 #include <adobe/config.hpp> 00013 00014 #include <utility> 00015 00016 #include <boost/noncopyable.hpp> 00017 00018 #include <adobe/forest.hpp> 00019 #include <adobe/extents.hpp> 00020 #include <adobe/poly_placeable.hpp> 00021 #include <adobe/layout_attributes.hpp> 00022 00023 /*************************************************************************************************/ 00024 00025 namespace adobe { 00026 namespace implementation { 00027 00028 /*************************************************************************************************/ 00029 00030 struct view_proxy_t; 00031 00032 /*************************************************************************************************/ 00033 00034 } // namespace implementation 00035 } // namespace adobe 00036 00037 /*************************************************************************************************/ 00038 00039 #if !defined(ADOBE_NO_DOCUMENTATION) 00040 namespace boost { 00041 namespace detail { 00042 template <> 00043 struct is_pod_impl<adobe::implementation::view_proxy_t> 00044 { 00045 BOOST_STATIC_CONSTANT(bool, value = true); 00046 }; 00047 } 00048 } 00049 #endif 00050 00051 /*************************************************************************************************/ 00052 00053 namespace adobe { 00054 00055 /*************************************************************************************************/ 00056 00057 00065 class eve_t 00066 #if !defined(ADOBE_NO_DOCUMENTATION) 00067 : boost::noncopyable, public extents_slices_t, public layout_attributes_placement_t 00068 #endif 00069 { 00070 public: 00071 00072 #if !defined(ADOBE_NO_DOCUMENTATION) 00073 typedef forest<implementation::view_proxy_t> proxy_tree_t; 00074 typedef proxy_tree_t::iterator iterator; 00075 #endif 00076 00077 00078 00079 00085 enum evaluate_options_t 00086 { 00087 evaluate_nested, 00090 evaluate_flat 00093 }; 00094 00095 /* 00096 REVISIT (sparent) : I'm just starting a long cleanup of the Eve API - the steps should include 00097 the following: 00098 00099 * eliminate the container default proc in favor of an inital extents setting. 00100 * rename calculate to calculate_horizontal - all calculation passes are optional (initial should 00101 often suffice). 00102 */ 00103 00104 00105 #if !defined(ADOBE_NO_DOCUMENTATION) 00106 explicit eve_t(); 00107 ~eve_t(); 00108 #endif 00109 00192 iterator add_placeable( iterator parent, 00193 const layout_attributes_t& initial, 00194 bool is_container_type, 00195 poly_placeable_t& placeable, 00196 bool reverse=false); 00197 00202 void set_visible(iterator, bool); 00203 00204 00216 std::pair<int, int> evaluate(evaluate_options_t options, int width = 0, int height = 0); 00217 00218 00235 std::pair<int, int> adjust(evaluate_options_t options, int width, int height); 00236 00237 private: 00238 friend struct implementation::view_proxy_t; 00239 00240 class implementation_t; 00241 implementation_t* object_m; 00242 }; 00243 00244 00245 /*************************************************************************************************/ 00246 00247 void set_margin(layout_attributes_t& container, int x); 00248 00249 /*************************************************************************************************/ 00250 00251 } // namespace adobe 00252 00253 /*************************************************************************************************/ 00254 00255 #endif 00256 00257 /*************************************************************************************************/ 00258 |