1 #include "edje_private.h"
4 #define E_SMART_OBJ_GET(smart, o, type) \
9 smart = evas_object_smart_data_get(o); \
11 _e_smart_str = (char *)evas_object_type_get(o); \
12 if (!_e_smart_str) return; \
13 if (strcmp(_e_smart_str, type)) return; \
16 #define E_SMART_OBJ_GET_RETURN(smart, o, type, ret) \
21 smart = evas_object_smart_data_get(o); \
22 if (!smart) return ret; \
23 _e_smart_str = (char *)evas_object_type_get(o); \
24 if (!_e_smart_str) return ret; \
25 if (strcmp(_e_smart_str, type)) return ret; \
28 #define E_OBJ_NAME "edje_container_object"
30 typedef struct _Smart_Data Smart_Data;
31 typedef struct _Smart_Data_Colinfo Smart_Data_Colinfo;
35 Evas_Coord x, y, w, h;
37 Evas_Object *smart_obj;
40 Evas_Coord contents_w, contents_h;
41 Evas_Coord min_row_h, max_row_h;
42 Evas_Coord min_w, max_w, min_h, max_h;
44 Smart_Data_Colinfo *colinfo;
48 double scroll_x, scroll_y;
49 double align_x, align_y;
51 unsigned char changed : 1;
52 unsigned char change_child : 1;
53 unsigned char change_child_list : 1;
54 unsigned char change_cols : 1;
55 unsigned char change_scroll : 1;
57 unsigned char need_layout : 1;
59 unsigned char homogenous : 1;
62 struct _Smart_Data_Colinfo
64 Evas_Coord minw, maxw;
67 /* All items are virtual constructs that provide Evas_Objects at some point.
68 * Edje may move, resize, show, hide, clip, unclip, raise, lower etc. this
69 * item AFTER it calls the item's add() method and before it calls the del()
70 * method. Edje may call add() and del() at any time as often items may not
71 * be visible and so may not need to exist at all - they are merely information
72 * used for layout, and nothing more. this helps save cpu and memory keeping
73 * things responsive for BIG lists of items. you create an item from an item
74 * class then ask that item to be appended/prepended etc. to the container.
76 typedef struct _Edje_Item Edje_Item;
77 typedef struct _Edje_Item_Cell Edje_Item_Cell;
78 typedef struct _Edje_Item_Class Edje_Item_Class;
80 struct _Edje_Item_Class
82 Evas_Object *(*add) (Edje_Item *ei);
83 void (*del) (Edje_Item *ei);
84 void (*select) (Edje_Item *ei);
85 void (*deselect) (Edje_Item *ei);
86 void (*focus) (Edje_Item *ei);
87 void (*unfocus) (Edje_Item *ei);
93 Edje_Item_Class *class;
101 Evas_Object *overlay_object;
105 Evas_Coord minh, maxh;
108 Edje_Item_Cell *cells;
110 unsigned char accessible : 1;
112 unsigned char recalc : 1;
113 unsigned char selected : 1;
114 unsigned char disabled : 1;
115 unsigned char focused : 1;
118 struct _Edje_Item_Cell
122 Evas_Coord minw, minh, maxw, maxh;
125 /* here is an item for a vertical list - with 1 or more columns. this has 3 */
126 /* just rotate for a horizontal list */
131 * +-----------------------------+ +-------+ +----------------+
132 * | pad_top | | | | |
133 * | pad_left OBJECT pad_right | | OBJ | | OBJECT | ROW 0
134 * | pad_bottom | | | | |
135 * +-----------------------------+ +-------+ +----------------+
137 * space_row || +-- space_col
139 * +-----------------------------+ +-------+ +----------------+
143 * +-----------------------------+ +-------+ +----------------+
146 * 1 Edje object goes in-between each row as a spacer object (opt)
147 * 1 Edje object goes in-between each column as a spacer object (opt)
150 * 1 Edje object goes around each item - item swallowed into "item" part (opt)
151 * if no "item" part then just underlay it
152 * on select send "select" "" signal
153 * on unselect send "unselect" "" signal
154 * on focus send "focus" "" signal
155 * on unfocus send "unfocus" signal
157 * if any list item/cell is an Edje object emit this to them too.
159 * also call callbacks.
160 * if a surround object emits such a signal itself then call callbacks too
162 * only 1 or 0 items can be focused
163 * disabled items cannot be focused or selected/deselected