stlab.adobe.com Adobe Systems Incorporated
layout_attributes.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_LAYOUT_ATTRIBUTES_HPP
10 #define ADOBE_LAYOUT_ATTRIBUTES_HPP
11 
12 #include <adobe/config.hpp>
13 #include <adobe/extents.hpp>
14 
21 namespace adobe {
22 
23  /*************************************************************************************************/
24 
30  {
31  align_forward = 0, // Used as index for guide array.
32  align_reverse = 1, // Used as index for guide array.
37 
39 
49  };
50 };
51 
57  {
61  place_overlay
62  };
63 };
64 
69 #if !defined(ADOBE_NO_DOCUMENTATION)
70  : public extents_slices_t,
73 #endif
74 {
76  indent_m(0),
77  create_m(true),
78  spacing_m(2, 0),
79  placement_m(place_leaf)
80  {
81  spacing_m[1] = 10; /* REVISIT FIXED VALUE container_spacing */
82  }
83 
84  typedef std::vector<int> spacing_t;
85 
86  struct slice_t
87  {
88  slice_t() : alignment_m(align_default),
89  suppress_m(false),
90  balance_m(false),
91  child_alignment_m(align_forward) {}
92 
94  bool suppress_m;
95  bool balance_m;
96 
97  // containers only
100  };
101 
103  int indent_m;
104  bool create_m;
105  spacing_t spacing_m;
106  boost::array<slice_t, 2> slice_m;
107 
108  // containers only
109  placement_t placement_m;
110 
113 
114  const slice_t& vertical() const { return slice_m[extents_slices_t::vertical]; }
115  const slice_t& horizontal() const { return slice_m[extents_slices_t::horizontal]; }
116 
117 
118  int& height() { return extents_m.height(); }
119  int& width() { return extents_m.width(); }
120 
121  const int& height() const { return extents_m.height(); }
122  const int& width() const { return extents_m.width(); }
123 };
124 
125 /*************************************************************************************************/
126 
131 #if !defined(ADOBE_NO_DOCUMENTATION)
133 #endif
134 {
135  struct slice_t
136  {
137 #if !defined(ADOBE_NO_DOCUMENTATION)
138  slice_t();
139 #endif
140 
141  int length_m;
145  };
146 
147  boost::array<slice_t, 2> slice_m;
148 
151 
152  const slice_t& vertical() const { return slice_m[extents_slices_t::vertical]; }
153  const slice_t& horizontal() const { return slice_m[extents_slices_t::horizontal]; }
154 };
155 
156 
160 inline int top(const place_data_t& place_data) { return place_data.vertical().position_m; }
161 
165 inline int left(const place_data_t& place_data) { return place_data.horizontal().position_m; }
166 
170 inline int& top(place_data_t& place_data) { return place_data.vertical().position_m; }
171 
175 inline int& left(place_data_t& place_data) { return place_data.horizontal().position_m; }
176 
180 inline int height(const place_data_t& place_data) { return place_data.vertical().length_m; }
181 
185 inline int width(const place_data_t& place_data) { return place_data.horizontal().length_m; }
186 
190 inline int& height(place_data_t& place_data) { return place_data.vertical().length_m; }
191 
195 inline int& width(place_data_t& place_data) { return place_data.horizontal().length_m; }
196 
200 inline int bottom(const place_data_t& place_data) { return top(place_data) + height(place_data); }
201 
205 inline int right(const place_data_t& place_data) { return left(place_data) + width(place_data); }
206 
207 /*************************************************************************************************/
208 }
209 
210 
211 #endif
int height(const place_data_t &place_data)
int right(const place_data_t &place_data)
int top(const place_data_t &place_data)
const slice_t & horizontal() const
int & height()
Definition: extents.hpp:101
Element geometry for a single orientation of place_data_t.
const slice_t & horizontal() const
int bottom(const place_data_t &place_data)
Layout data interface from the engine to the client.
placeable object geometry for a single orientation of layout_attributes_t.
An intrinsic geometry class for objects with a graphical representation.
Definition: extents.hpp:75
const slice_t & vertical() const
boost::array< slice_t, 2 > slice_m
int width(const place_data_t &place_data)
Layout data interface from the client to the engine.
int left(const place_data_t &place_data)
boost::array< slice_t, 2 > slice_m
A utility class for referencing the two slices of a extents_t.
Definition: extents.hpp:68
A utility class for referencing the alignment characteristics in layout_attributes_t.
std::pair< int, int > pair_long_t
Definition: extents.hpp:51
std::vector< int > guide_set_t
Definition: extents.hpp:53
const slice_t & vertical() const

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google