summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_grid.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/canvas/evas_object_grid.c
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/canvas/evas_object_grid.c')
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c677
1 files changed, 677 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c
new file mode 100644
index 0000000..7a440cb
--- /dev/null
+++ b/src/lib/evas/canvas/evas_object_grid.c
@@ -0,0 +1,677 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include <errno.h>
4
5#include <Eo.h>
6
7EAPI Eo_Op EVAS_OBJ_GRID_BASE_ID = EO_NOOP;
8
9#define MY_CLASS EVAS_OBJ_GRID_CLASS
10
11typedef struct _Evas_Object_Grid_Data Evas_Object_Grid_Data;
12typedef struct _Evas_Object_Grid_Option Evas_Object_Grid_Option;
13typedef struct _Evas_Object_Grid_Iterator Evas_Object_Grid_Iterator;
14typedef struct _Evas_Object_Grid_Accessor Evas_Object_Grid_Accessor;
15
16struct _Evas_Object_Grid_Option
17{
18 Evas_Object *obj;
19 Eina_List *l;
20 int x, y, w, h;
21};
22
23struct _Evas_Object_Grid_Data
24{
25 Evas_Object_Smart_Clipped_Data base;
26 Eina_List *children;
27 struct {
28 int w, h;
29 } size;
30 Eina_Bool is_mirrored : 1;
31};
32
33struct _Evas_Object_Grid_Iterator
34{
35 Eina_Iterator iterator;
36
37 Eina_Iterator *real_iterator;
38 const Evas_Object *grid;
39};
40
41struct _Evas_Object_Grid_Accessor
42{
43 Eina_Accessor accessor;
44
45 Eina_Accessor *real_accessor;
46 const Evas_Object *grid;
47};
48
49#define EVAS_OBJECT_GRID_DATA_GET(o, ptr) \
50 Evas_Object_Grid_Data *ptr = eo_data_get(o, MY_CLASS)
51
52#define EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, ptr) \
53 EVAS_OBJECT_GRID_DATA_GET(o, ptr); \
54 if (!ptr) \
55 { \
56 CRIT("no widget data for object %p (%s)", \
57 o, evas_object_type_get(o)); \
58 abort(); \
59 return; \
60 }
61
62#define EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
63 EVAS_OBJECT_GRID_DATA_GET(o, ptr); \
64 if (!ptr) \
65 { \
66 CRIT("No widget data for object %p (%s)", \
67 o, evas_object_type_get(o)); \
68 abort(); \
69 return val; \
70 }
71
72static const char EVAS_OBJECT_GRID_OPTION_KEY[] = "|EvGd";
73
74static Eina_Bool
75_evas_object_grid_iterator_next(Evas_Object_Grid_Iterator *it, void **data)
76{
77 Evas_Object_Grid_Option *opt;
78
79 if (!eina_iterator_next(it->real_iterator, (void **)&opt))
80 return EINA_FALSE;
81 if (data) *data = opt->obj;
82 return EINA_TRUE;
83}
84
85static Evas_Object *
86_evas_object_grid_iterator_get_container(Evas_Object_Grid_Iterator *it)
87{
88 return (Evas_Object *)it->grid;
89}
90
91static void
92_evas_object_grid_iterator_free(Evas_Object_Grid_Iterator *it)
93{
94 eina_iterator_free(it->real_iterator);
95 free(it);
96}
97
98static Eina_Bool
99_evas_object_grid_accessor_get_at(Evas_Object_Grid_Accessor *it, unsigned int idx, void **data)
100{
101 Evas_Object_Grid_Option *opt = NULL;
102
103 if (!eina_accessor_data_get(it->real_accessor, idx, (void **)&opt))
104 return EINA_FALSE;
105 if (data) *data = opt->obj;
106 return EINA_TRUE;
107}
108
109static Evas_Object *
110_evas_object_grid_accessor_get_container(Evas_Object_Grid_Accessor *it)
111{
112 return (Evas_Object *)it->grid;
113}
114
115static void
116_evas_object_grid_accessor_free(Evas_Object_Grid_Accessor *it)
117{
118 eina_accessor_free(it->real_accessor);
119 free(it);
120}
121
122static Evas_Object_Grid_Option *
123_evas_object_grid_option_get(Evas_Object *o)
124{
125 return evas_object_data_get(o, EVAS_OBJECT_GRID_OPTION_KEY);
126}
127
128static void
129_evas_object_grid_option_set(Evas_Object *o, const Evas_Object_Grid_Option *opt)
130{
131 evas_object_data_set(o, EVAS_OBJECT_GRID_OPTION_KEY, opt);
132}
133
134static Evas_Object_Grid_Option *
135_evas_object_grid_option_del(Evas_Object *o)
136{
137 return evas_object_data_del(o, EVAS_OBJECT_GRID_OPTION_KEY);
138}
139
140static void
141_on_child_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *child, void *einfo EINA_UNUSED)
142{
143 Evas_Object *grid = data;
144 evas_object_grid_unpack(grid, child);
145}
146
147static void
148_evas_object_grid_child_connect(Evas_Object *o, Evas_Object *child)
149{
150 evas_object_event_callback_add
151 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
152}
153
154static void
155_evas_object_grid_child_disconnect(Evas_Object *o, Evas_Object *child)
156{
157 evas_object_event_callback_del_full
158 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
159}
160
161EVAS_SMART_SUBCLASS_NEW("Evas_Object_Grid", _evas_object_grid,
162 Evas_Smart_Class, Evas_Smart_Class,
163 evas_object_smart_clipped_class_get, NULL)
164
165static void
166_evas_object_grid_smart_add(Evas_Object *o)
167{
168 Evas_Object_Grid_Data *priv;
169
170 priv = evas_object_smart_data_get(o);
171 if (!priv)
172 {
173 priv = eo_data_get(o, MY_CLASS);
174 evas_object_smart_data_set(o, priv);
175 }
176
177 priv->size.w = 100;
178 priv->size.h = 100;
179
180 _evas_object_grid_parent_sc->add(o);
181}
182
183static void
184_evas_object_grid_smart_del(Evas_Object *o)
185{
186 EVAS_OBJECT_GRID_DATA_GET(o, priv);
187 Eina_List *l;
188
189 l = priv->children;
190 while (l)
191 {
192 Evas_Object_Grid_Option *opt = l->data;
193 _evas_object_grid_child_disconnect(o, opt->obj);
194 _evas_object_grid_option_del(opt->obj);
195 free(opt);
196 l = eina_list_remove_list(l, l);
197 }
198 _evas_object_grid_parent_sc->del(o);
199}
200
201static void
202_evas_object_grid_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
203{
204 Evas_Coord ow, oh;
205 evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
206 if ((ow == w) && (oh == h)) return;
207 evas_object_smart_changed(o);
208}
209
210static void
211_evas_object_grid_smart_calculate(Evas_Object *o)
212{
213 Eina_List *l;
214 Evas_Object_Grid_Option *opt;
215 Evas_Coord x, y, w, h, vw, vh, t;
216 Eina_Bool mirror;
217
218 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
219 if (!priv) return;
220 if (!priv->children) return;
221 evas_object_geometry_get(o, &x, &y, &w, &h);
222 mirror = priv->is_mirrored;
223 vw = priv->size.w;
224 vh = priv->size.h;
225 EINA_LIST_FOREACH(priv->children, l, opt)
226 {
227 Evas_Coord x1, y1, x2, y2;
228
229 x1 = x + ((w * opt->x) / vw);
230 y1 = y + ((h * opt->y) / vh);
231 x2 = x + ((w * (opt->x + opt->w)) / vw);
232 y2 = y + ((h * (opt->y + opt->h)) / vh);
233 if (mirror)
234 {
235 t = x1; x1 = x2; x2 = t;
236 t = y1; y1 = y2; y2 = t;
237 }
238 evas_object_move(opt->obj, x1, y1);
239 evas_object_resize(opt->obj, x2 - x1, y2 - y1);
240 }
241}
242
243static void
244_evas_object_grid_smart_set_user(Evas_Smart_Class *sc)
245{
246 sc->add = _evas_object_grid_smart_add;
247 sc->del = _evas_object_grid_smart_del;
248 sc->resize = _evas_object_grid_smart_resize;
249 sc->calculate = _evas_object_grid_smart_calculate;
250}
251
252EAPI Evas_Object *
253evas_object_grid_add(Evas *evas)
254{
255 Evas_Object *obj = eo_add(MY_CLASS, evas);
256 eo_unref(obj);
257 return obj;
258}
259
260static void
261_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
262{
263 eo_do_super(obj, eo_constructor());
264 eo_do(obj, evas_obj_smart_attach(_evas_object_grid_smart_class_new()));
265
266// return evas_object_smart_add(evas, _evas_object_grid_smart_class_new());
267}
268
269EAPI Evas_Object *
270evas_object_grid_add_to(Evas_Object *parent)
271{
272 Evas_Object *o = NULL;
273 eo_do(parent, evas_obj_grid_add_to(&o));
274 return o;
275}
276
277static void
278_add_to(Eo *parent, void *_pd EINA_UNUSED, va_list *list)
279{
280 Evas *evas;
281 Evas_Object **ret = va_arg(*list, Evas_Object **);
282 evas = evas_object_evas_get(parent);
283 *ret = evas_object_grid_add(evas);
284 evas_object_smart_member_add(*ret, parent);
285}
286
287EAPI void
288evas_object_grid_size_set(Evas_Object *o, int w, int h)
289{
290 eo_do(o, evas_obj_grid_size_set(w, h));
291}
292
293static void
294_size_set(Eo *o, void *_pd, va_list *list)
295{
296 Evas_Object_Grid_Data *priv = _pd;
297 int w = va_arg(*list, int);
298 int h = va_arg(*list, int);
299
300 if ((priv->size.w == w) && (priv->size.h == h)) return;
301 priv->size.w = w;
302 priv->size.h = h;
303 evas_object_smart_changed(o);
304}
305
306EAPI void
307evas_object_grid_size_get(const Evas_Object *o, int *w, int *h)
308{
309 eo_do((Eo *)o, evas_obj_grid_size_get(w, h));
310}
311
312static void
313_size_get(Eo *o EINA_UNUSED, void *_pd, va_list *list)
314{
315 const Evas_Object_Grid_Data *priv = _pd;
316 int *w = va_arg(*list, int *);
317 int *h = va_arg(*list, int *);
318 if (w) *w = priv->size.w;
319 if (h) *h = priv->size.h;
320}
321
322EAPI Eina_Bool
323evas_object_grid_pack(Evas_Object *o, Evas_Object *child, int x, int y, int w, int h)
324{
325 Eina_Bool ret = EINA_FALSE;
326 eo_do(o, evas_obj_grid_pack(child, x, y, w, h, &ret));
327 return ret;
328}
329
330static void
331_pack(Eo *o, void *_pd, va_list *list)
332{
333 Evas_Object_Grid_Option *opt;
334 Eina_Bool newobj = EINA_FALSE;
335
336 Evas_Object_Grid_Data *priv = _pd;
337
338 Evas_Object *child = va_arg(*list, Evas_Object *);
339 int x = va_arg(*list, int);
340 int y = va_arg(*list, int);
341 int w = va_arg(*list, int);
342 int h = va_arg(*list, int);
343 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
344 if (ret) *ret = EINA_FALSE;
345
346 opt = _evas_object_grid_option_get(child);
347 if (!opt)
348 {
349 opt = malloc(sizeof(*opt));
350 if (!opt)
351 {
352 ERR("could not allocate grid option data.");
353 return;
354 }
355 newobj = EINA_TRUE;
356 }
357
358 opt->x = x;
359 opt->y = y;
360 opt->w = w;
361 opt->h = h;
362
363 if (newobj)
364 {
365 opt->obj = child;
366 priv->children = eina_list_append(priv->children, opt);
367 opt->l = eina_list_last(priv->children);
368 _evas_object_grid_option_set(child, opt);
369 evas_object_smart_member_add(child, o);
370 _evas_object_grid_child_connect(o, child);
371 }
372 // FIXME: we could keep a changed list
373 evas_object_smart_changed(o);
374 if (ret) *ret = EINA_TRUE;
375}
376
377static void
378_evas_object_grid_remove_opt(Evas_Object_Grid_Data *priv, Evas_Object_Grid_Option *opt)
379{
380 priv->children = eina_list_remove_list(priv->children, opt->l);
381 opt->l = NULL;
382}
383
384EAPI Eina_Bool
385evas_object_grid_unpack(Evas_Object *o, Evas_Object *child)
386{
387 Eina_Bool ret = EINA_FALSE;
388 eo_do(o, evas_obj_grid_unpack(child, &ret));
389 return ret;
390}
391
392static void
393_unpack(Eo *o, void *_pd, va_list *list)
394{
395 Evas_Object_Grid_Option *opt;
396
397 Evas_Object_Grid_Data *priv = _pd;
398
399 Evas_Object *child = va_arg(*list, Evas_Object *);
400 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
401 if (ret) *ret = EINA_FALSE;
402
403 if (o != evas_object_smart_parent_get(child))
404 {
405 ERR("cannot unpack child from incorrect grid!");
406 return;
407 }
408
409 opt = _evas_object_grid_option_del(child);
410 if (!opt)
411 {
412 ERR("cannot unpack child with no packing option!");
413 return;
414 }
415
416 _evas_object_grid_child_disconnect(o, child);
417 _evas_object_grid_remove_opt(priv, opt);
418 evas_object_smart_member_del(child);
419 free(opt);
420 if (ret) *ret = EINA_TRUE;
421}
422
423EAPI void
424evas_object_grid_clear(Evas_Object *o, Eina_Bool clear)
425{
426 eo_do(o, evas_obj_grid_clear(clear));
427}
428
429static void
430_clear(Eo *o, void *_pd, va_list *list)
431{
432 Evas_Object_Grid_Option *opt;
433
434 Evas_Object_Grid_Data *priv = _pd;
435 Eina_Bool clear = va_arg(*list, int);
436
437 EINA_LIST_FREE(priv->children, opt)
438 {
439 _evas_object_grid_child_disconnect(o, opt->obj);
440 _evas_object_grid_option_del(opt->obj);
441 evas_object_smart_member_del(opt->obj);
442 if (clear)
443 evas_object_del(opt->obj);
444 free(opt);
445 }
446}
447
448EAPI Eina_Bool
449evas_object_grid_pack_get(const Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h)
450{
451 Eina_Bool ret = EINA_FALSE;
452 eo_do((Eo *)o, evas_obj_grid_pack_get(child, x, y, w, h, &ret));
453 return ret;
454}
455
456static void
457_pack_get(Eo *o EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
458{
459 Evas_Object *child = va_arg(*list, Evas_Object *);
460 int *x = va_arg(*list, int *);
461 int *y = va_arg(*list, int *);
462 int *w = va_arg(*list, int *);
463 int *h = va_arg(*list, int *);
464 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
465
466 Evas_Object_Grid_Option *opt;
467
468 if (x) *x = 0;
469 if (y) *y = 0;
470 if (w) *w = 0;
471 if (h) *h = 0;
472 opt = _evas_object_grid_option_get(child);
473 if (!opt)
474 {
475 *ret = 0;
476 return;
477 }
478 if (x) *x = opt->x;
479 if (y) *y = opt->y;
480 if (w) *w = opt->w;
481 if (h) *h = opt->h;
482 *ret = 1;
483}
484
485EAPI Eina_Iterator *
486evas_object_grid_iterator_new(const Evas_Object *o)
487{
488 Eina_Iterator *ret = NULL;
489 eo_do((Eo *)o, evas_obj_grid_iterator_new(&ret));
490 return ret;
491}
492
493static void
494_iterator_new(Eo *o, void *_pd, va_list *list)
495{
496 Eina_Iterator **ret = va_arg(*list, Eina_Iterator **);
497 Evas_Object_Grid_Iterator *it;
498
499 const Evas_Object_Grid_Data *priv = _pd;
500
501 if (!priv->children)
502 {
503 *ret = NULL;
504 return;
505 }
506
507 it = calloc(1, sizeof(Evas_Object_Grid_Iterator));
508 if (!it)
509 {
510 *ret = NULL;
511 return;
512 }
513
514 EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
515
516 it->real_iterator = eina_list_iterator_new(priv->children);
517 it->grid = o;
518
519 it->iterator.next = FUNC_ITERATOR_NEXT(_evas_object_grid_iterator_next);
520 it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_evas_object_grid_iterator_get_container);
521 it->iterator.free = FUNC_ITERATOR_FREE(_evas_object_grid_iterator_free);
522
523 *ret = &it->iterator;
524}
525
526EAPI Eina_Accessor *
527evas_object_grid_accessor_new(const Evas_Object *o)
528{
529 Eina_Accessor *ret = NULL;
530 eo_do((Eo *)o, evas_obj_grid_accessor_new(&ret));
531 return ret;
532}
533
534static void
535_accessor_new(Eo *o, void *_pd, va_list *list)
536{
537 Eina_Accessor **ret = va_arg(*list, Eina_Accessor **);
538 Evas_Object_Grid_Accessor *it;
539
540 const Evas_Object_Grid_Data *priv = _pd;
541
542 if (!priv->children)
543 {
544 *ret = NULL;
545 return;
546 }
547
548 it = calloc(1, sizeof(Evas_Object_Grid_Accessor));
549 if (!it)
550 {
551 *ret = NULL;
552 return;
553 }
554
555 EINA_MAGIC_SET(&it->accessor, EINA_MAGIC_ACCESSOR);
556
557 it->real_accessor = eina_list_accessor_new(priv->children);
558 it->grid = o;
559
560 it->accessor.get_at = FUNC_ACCESSOR_GET_AT(_evas_object_grid_accessor_get_at);
561 it->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(_evas_object_grid_accessor_get_container);
562 it->accessor.free = FUNC_ACCESSOR_FREE(_evas_object_grid_accessor_free);
563
564 *ret = &it->accessor;
565}
566
567EAPI Eina_List *
568evas_object_grid_children_get(const Evas_Object *o)
569{
570 Eina_List *ret = NULL;
571 eo_do((Eo *)o, evas_obj_grid_children_get(&ret));
572 return ret;
573}
574
575static void
576_children_get(Eo *o EINA_UNUSED, void *_pd, va_list *list)
577{
578 Eina_List **ret = va_arg(*list, Eina_List **);
579
580 Eina_List *new_list = NULL, *l;
581 Evas_Object_Grid_Option *opt;
582
583 const Evas_Object_Grid_Data *priv = _pd;
584
585 EINA_LIST_FOREACH(priv->children, l, opt)
586 new_list = eina_list_append(new_list, opt->obj);
587
588 *ret = new_list;
589}
590
591EAPI Eina_Bool
592evas_object_grid_mirrored_get(const Evas_Object *o)
593{
594 Eina_Bool ret = EINA_FALSE;
595 eo_do((Eo *)o, evas_obj_grid_mirrored_get(&ret));
596 return ret;
597}
598
599static void
600_mirrored_get(Eo *o EINA_UNUSED, void *_pd, va_list *list)
601{
602 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
603 const Evas_Object_Grid_Data *priv = _pd;
604 *ret = priv->is_mirrored;
605}
606
607EAPI void
608evas_object_grid_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
609{
610 eo_do(obj, evas_obj_grid_mirrored_set(mirrored));
611}
612
613static void
614_mirrored_set(Eo *o EINA_UNUSED, void *_pd, va_list *list)
615{
616 Eina_Bool mirrored = va_arg(*list, int);
617
618 Evas_Object_Grid_Data *priv = _pd;
619 mirrored = !!mirrored;
620 if (priv->is_mirrored != mirrored)
621 {
622 priv->is_mirrored = mirrored;
623 _evas_object_grid_smart_calculate(o);
624 }
625}
626
627static void
628_class_constructor(Eo_Class *klass)
629{
630 const Eo_Op_Func_Description func_desc[] = {
631 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
632 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ADD_TO), _add_to),
633 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_SIZE_SET), _size_set),
634 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_SIZE_GET), _size_get),
635 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_PACK), _pack),
636 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_UNPACK), _unpack),
637 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_CLEAR), _clear),
638 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_PACK_GET), _pack_get),
639 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ITERATOR_NEW), _iterator_new),
640 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ACCESSOR_NEW), _accessor_new),
641 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_CHILDREN_GET), _children_get),
642 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_MIRRORED_GET), _mirrored_get),
643 EO_OP_FUNC(EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_MIRRORED_SET), _mirrored_set),
644 EO_OP_FUNC_SENTINEL
645 };
646 eo_class_funcs_set(klass, func_desc);
647}
648
649static const Eo_Op_Description op_desc[] = {
650 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_ADD_TO, "Create a grid that is child of a given element parent."),
651 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_SIZE_SET, "Set the virtual resolution for the grid."),
652 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_SIZE_GET, "Get the current virtual resolution."),
653 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_PACK, "Add a new child to a grid object."),
654 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_UNPACK, "Remove child from grid."),
655 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_CLEAR, "Faster way to remove all child objects from a grid object."),
656 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_PACK_GET, "Get the pack options for a grid child."),
657 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_ITERATOR_NEW, "Get an iterator to walk the list of children for the grid."),
658 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_ACCESSOR_NEW, "Get an accessor to get random access to the list of children for the grid."),
659 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_CHILDREN_GET, "Get the list of children for the grid."),
660 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_MIRRORED_GET, "Gets the mirrored mode of the grid."),
661 EO_OP_DESCRIPTION(EVAS_OBJ_GRID_SUB_ID_MIRRORED_SET, "Sets the mirrored mode of the grid."),
662 EO_OP_DESCRIPTION_SENTINEL
663};
664
665static const Eo_Class_Description class_desc = {
666 EO_VERSION,
667 "Evas_Object_Grid",
668 EO_CLASS_TYPE_REGULAR,
669 EO_CLASS_DESCRIPTION_OPS(&EVAS_OBJ_GRID_BASE_ID, op_desc, EVAS_OBJ_GRID_SUB_ID_LAST),
670 NULL,
671 sizeof(Evas_Object_Grid_Data),
672 _class_constructor,
673 NULL
674};
675
676EO_DEFINE_CLASS(evas_object_grid_class_get, &class_desc, EVAS_OBJ_SMART_CLIPPED_CLASS, NULL);
677