summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_box.eo
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/lib/elementary/elm_box.eo
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/lib/elementary/elm_box.eo')
-rw-r--r--src/lib/elementary/elm_box.eo298
1 files changed, 298 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_box.eo b/src/lib/elementary/elm_box.eo
new file mode 100644
index 0000000..fb80153
--- /dev/null
+++ b/src/lib/elementary/elm_box.eo
@@ -0,0 +1,298 @@
1class Elm.Box (Elm.Widget)
2{
3 eo_prefix: elm_obj_box;
4 methods {
5 @property homogeneous {
6 set {
7 [[Set the box to arrange its children homogeneously
8
9 If enabled, homogeneous layout makes all items the same size, according
10 to the size of the largest of its children.
11
12 Note: This flag is ignored if a custom layout function is set.
13
14 ]]
15 }
16 get {
17 [[Get whether the box is using homogeneous mode or not ($true if
18 it's homogeneous, $false otherwise)]]
19 }
20 values {
21 homogeneous: bool; [[The homogeneous flag]]
22 }
23 }
24 @property align {
25 set {
26 [[Set the alignment of the whole bounding box of contents.
27
28 Sets how the bounding box containing all the elements of the box, after
29 their sizes and position has been calculated, will be aligned within
30 the space given for the whole box widget.
31
32 ]]
33 }
34 get {
35 [[Get the alignment of the whole bounding box of contents.
36
37 See also @.align.set.
38
39 ]]
40 }
41 values {
42 horizontal: double; [[The horizontal alignment of elements]]
43 vertical: double; [[The vertical alignment of elements]]
44 }
45 }
46 @property horizontal {
47 set {
48 [[Set the horizontal orientation
49
50 By default, box object arranges their contents vertically from top to
51 bottom.
52 By calling this function with $horizontal as $true, the box will
53 become horizontal, arranging contents from left to right.
54
55 Note: This flag is ignored if a custom layout function is set.
56
57 ]]
58 }
59 get {
60 [[Get the horizontal orientation ($true if the box is set to
61 horizontal mode, $false otherwise)]]
62 }
63 values {
64 horizontal: bool; [[The horizontal flag]]
65 }
66 }
67 @property padding {
68 set {
69 [[Set the space (padding) between the box's elements.
70
71 Extra space in pixels that will be added between a box child and its
72 neighbors after its containing cell has been calculated. This padding
73 is set for all elements in the box, besides any possible padding that
74 individual elements may have through their size hints.
75
76 ]]
77 }
78 get {
79 [[Get the space (padding) between the box's elements.
80
81 See also @.padding.set.
82
83 ]]
84 }
85 values {
86 horizontal: Evas.Coord; [[The horizontal space between elements]]
87 vertical: Evas.Coord; [[The vertical space between elements]]
88 }
89 }
90 @property layout {
91 set {
92 [[Set the layout defining function to be used by the box
93
94 Whenever anything changes that requires the box in $obj to recalculate
95 the size and position of its elements, the function $cb will be called
96 to determine what the layout of the children will be.
97
98 Once a custom function is set, everything about the children layout
99 is defined by it. The flags set by @.horizontal.set and
100 @.homogeneous.set no longer have any meaning, and the values
101 given by @.padding.set and @.align.set are up to this
102 layout function to decide if they are used and how. These last two
103 will be found in the $priv parameter, of type $Evas_Object_Box_Data,
104 passed to $cb. The $Evas_Object the function receives is not the
105 Elementary widget, but the internal Evas Box it uses, so none of the
106 functions described here can be used on it.
107
108 Any of the layout functions in $Evas can be used here, as well as the
109 special \@ref elm_box_layout_transition.
110
111 The final $data argument received by $cb is the same $data passed
112 here, and the $free_data function will be called to free it
113 whenever the box is destroyed or another layout function is set.
114
115 Setting $cb to $null will revert back to the default layout function.
116
117 See also \@ref elm_box_layout_transition.
118
119 ]]
120 }
121 values {
122 cb: Evas_Object_Box_Layout @nullable; [[The callback function used for layout]]
123 data: const(void)* @optional; [[Data that will be passed to layout function]]
124 free_data: Ecore_Cb @optional; [[Function called to free $data]]
125 }
126 }
127 @property children {
128 get {
129 [[Get a list of the objects packed into the box
130
131 Returns a new $list with a pointer to $Evas_Object in its nodes.
132 The order of the list corresponds to the packing order the box uses.
133
134 You must free this list with eina_list_free() once you are done with it.
135
136 ]]
137 return: free(own(list<Evas.Object*>*), eina_list_free) @warn_unused;
138 }
139 }
140 pack_end {
141 [[Add an object at the end of the pack list
142
143 Pack $subobj into the box $obj, placing it last in the list of
144 children objects. The actual position the object will get on screen
145 depends on the layout used. If no custom layout is set, it will be at
146 the bottom or right, depending if the box is vertical or horizontal,
147 respectively.
148
149 See also @.pack_start,
150 @.pack_before,
151 @.pack_after,
152 @.unpack,
153 @.unpack_all,
154 @.clear.
155 ]]
156
157 params {
158 @in subobj: Evas.Object *; [[The object to add to the box]]
159 }
160 }
161 unpack_all {
162 [[Remove all items from the box, without deleting them
163
164 Clear the box from all children, but don't delete the respective objects.
165 If no other references of the box children exist, the objects will never
166 be deleted, and thus the application will leak the memory. Make sure
167 when using this function that you hold a reference to all the objects
168 in the box $obj.
169
170 See also @.clear,
171 @.unpack.
172 ]]
173 }
174 unpack {
175 [[Unpack a box item
176
177 Remove the object given by $subobj from the box $obj without
178 deleting it.
179
180 See also @.unpack_all,
181 @.clear.
182
183 ]]
184
185 params {
186 @in subobj: Evas.Object *; [[The object to unpack]]
187 }
188 }
189 pack_after {
190 [[Adds an object to the box after the indicated object
191
192 This will add the $subobj to the box indicated after the object
193 indicated with $after. If $after is not already in the box, results
194 are undefined. After means either to the right of the indicated object or
195 below it depending on orientation.
196
197 See also @.pack_start,
198 @.pack_end,
199 @.pack_before,
200 @.unpack,
201 @.unpack_all,
202 @.clear.
203
204 ]]
205
206 params {
207 @in subobj: Evas.Object *; [[The object to add to the box]]
208 @in after: Evas.Object *; [[The object after which to add it]]
209 }
210 }
211 pack_start {
212 [[Add an object to the beginning of the pack list
213
214 Pack $subobj into the box $obj, placing it first in the list of
215 children objects. The actual position the object will get on screen
216 depends on the layout used. If no custom layout is set, it will be at
217 the top or left, depending if the box is vertical or horizontal,
218 respectively.
219
220 See also @.pack_end,
221 @.pack_before,
222 @.pack_after,
223 @.unpack,
224 @.unpack_all,
225 @.clear.
226
227 ]]
228
229 params {
230 @in subobj: Evas.Object *; [[The object to add to the box]]
231 }
232 }
233 recalculate {
234 [[Force the box to recalculate its children packing.
235
236 If any children was added or removed, box will not calculate the
237 values immediately rather leaving it to the next main loop
238 iteration. While this is great as it would save lots of
239 recalculation, whenever you need to get the position of a just
240 added item you must force recalculate before doing so.
241
242 ]]
243
244 }
245 pack_before {
246 [[Adds an object to the box before the indicated object
247
248 This will add the $subobj to the box indicated before the object
249 indicated with $before. If $before is not already in the box, results
250 are undefined. Before means either to the left of the indicated object or
251 above it depending on orientation.
252
253 See also @.pack_start,
254 @.pack_end,
255 @.pack_after,
256 @.unpack,
257 @.unpack_all,
258 @.clear.
259
260 ]]
261
262 params {
263 @in subobj: Evas.Object *; [[The object to add to the box]]
264 @in before: Evas.Object *; [[The object before which to add it]]
265 }
266 }
267 clear {
268 [[Clear the box of all children
269
270 Remove all the elements contained by the box, deleting the respective
271 objects.
272
273 See also @.unpack,
274 @.unpack_all.
275
276 ]]
277
278 }
279 }
280 implements {
281 class.constructor;
282 Eo.Base.constructor;
283 Evas.Object_Smart.add;
284 Evas.Object_Smart.del;
285 Evas.Object_Smart.calculate;
286 Elm.Widget.focus_direction;
287 Elm.Widget.focus_next_manager_is;
288 Elm.Widget.focus_direction_manager_is;
289 Elm.Widget.focus_next;
290 Elm.Widget.theme_apply;
291 Elm.Widget.sub_object_del;
292 }
293 events {
294 child,added;
295 child,removed;
296 }
297
298}