5 typedef struct _Elm_Params_Gengrid
9 Eina_Bool multi_exists : 1;
10 Eina_Bool no_select : 1;
11 Eina_Bool no_select_exists : 1;
12 Eina_Bool always_select : 1;
13 Eina_Bool always_select_exists : 1;
15 Eina_Bool h_bounce_exists:1;
17 Eina_Bool v_bounce_exists:1;
19 Eina_Bool h_pagerel_exists : 1;
21 Eina_Bool v_pagerel_exists : 1;
23 Eina_Bool h_itemsize_exists : 1;
25 Eina_Bool v_itemsize_exists : 1;
26 Eina_Bool horizontal : 1;
27 Eina_Bool horizontal_exists : 1;
31 external_gengrid_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
33 const Elm_Params_Gengrid *p;
35 if (to_params) p = to_params;
36 else if (from_params) p = from_params;
40 elm_gengrid_multi_select_set(obj, p->multi);
41 if (p->no_select_exists)
42 elm_gengrid_no_select_mode_set (obj, p->no_select);
43 if (p->always_select_exists)
44 elm_gengrid_always_select_mode_set (obj, p->always_select);
45 if (p->h_bounce_exists)
47 Eina_Bool h_bounce, v_bounce;
48 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
49 elm_gengrid_bounce_set(obj, p->h_bounce, v_bounce);
51 if (p->v_bounce_exists)
53 Eina_Bool h_bounce, v_bounce;
54 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
55 elm_gengrid_bounce_set(obj, h_bounce, p->v_bounce);
57 if (p->h_pagerel_exists)
59 double h_pagerel, v_pagerel;
60 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
61 elm_gengrid_page_relative_set(obj, h_pagerel, p->v_pagerel);
63 if (p->v_pagerel_exists)
65 double h_pagerel, v_pagerel;
66 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
67 elm_gengrid_page_relative_set(obj, p->h_pagerel, v_pagerel);
69 if (p->h_itemsize_exists)
71 int h_itemsize, v_itemsize;
72 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
73 elm_gengrid_item_size_set(obj, h_itemsize, p->v_itemsize);
75 if (p->v_itemsize_exists)
77 int h_itemsize, v_itemsize;
78 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
79 elm_gengrid_item_size_set(obj, p->h_itemsize, v_itemsize);
81 if (p->horizontal_exists)
83 elm_gengrid_horizontal_set(obj, p->horizontal);
88 external_gengrid_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
90 if (!strcmp(param->name, "multi select"))
92 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
94 elm_gengrid_multi_select_set(obj, param->i);
98 else if (!strcmp(param->name, "no selected"))
100 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
102 elm_gengrid_no_select_mode_set(obj, param->i);
106 else if (!strcmp(param->name, "always select"))
108 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
110 elm_gengrid_always_select_mode_set(obj, param->i);
114 else if (!strcmp(param->name, "height bounce"))
116 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
118 Eina_Bool h_bounce, v_bounce;
119 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
120 elm_gengrid_bounce_set(obj, param->i, v_bounce);
124 else if (!strcmp(param->name, "width bounce"))
126 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
128 Eina_Bool h_bounce, v_bounce;
129 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
130 elm_gengrid_bounce_set(obj, h_bounce, param->i);
134 else if (!strcmp(param->name, "horizontal page relative"))
136 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
138 double h_pagerel, v_pagerel;
139 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
140 elm_gengrid_page_relative_set(obj, param->d, v_pagerel);
144 else if (!strcmp(param->name, "vertical page relative"))
146 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
148 double h_pagerel, v_pagerel;
149 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
150 elm_gengrid_page_relative_set(obj, h_pagerel, param->d);
154 else if (!strcmp(param->name, "horizontal item size"))
156 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
158 int h_itemsize, v_itemsize;
159 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
160 elm_gengrid_item_size_set(obj, param->i, v_itemsize);
164 else if (!strcmp(param->name, "vertical item size"))
166 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
168 int h_itemsize, v_itemsize;
169 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
170 elm_gengrid_item_size_set(obj, h_itemsize, param->i);
174 else if (!strcmp(param->name, "horizontal"))
176 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
178 elm_gengrid_horizontal_set(obj, param->i);
183 ERR("unknown parameter '%s' of type '%s'",
184 param->name, edje_external_param_type_str(param->type));
190 external_gengrid_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
192 if (!strcmp(param->name, "multi select"))
194 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
196 param->i = elm_gengrid_multi_select_get(obj);
200 else if (!strcmp(param->name, "no selected"))
202 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
204 param->i = elm_gengrid_no_select_mode_get(obj);
208 else if (!strcmp(param->name, "always select"))
210 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
212 param->i = elm_gengrid_always_select_mode_get(obj);
216 else if (!strcmp(param->name, "height bounce"))
218 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
220 Eina_Bool h_bounce, v_bounce;
221 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
226 else if (!strcmp(param->name, "width bounce"))
228 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
230 Eina_Bool h_bounce, v_bounce;
231 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
236 else if (!strcmp(param->name, "horizontal page relative"))
238 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
240 double h_pagerel, v_pagerel;
241 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
242 param->d = h_pagerel;
246 else if (!strcmp(param->name, "vertical page relative"))
248 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
250 double h_pagerel, v_pagerel;
251 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
252 param->d = v_pagerel;
256 else if (!strcmp(param->name, "horizontal item size"))
258 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
260 int h_itemsize, v_itemsize;
261 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
262 param->i = h_itemsize;
266 else if (!strcmp(param->name, "vertical item size"))
268 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
270 int h_itemsize, v_itemsize;
271 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
272 param->i = v_itemsize;
276 else if (!strcmp(param->name, "horizontal"))
278 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
280 param->i = elm_gengrid_horizontal_get(obj);
285 ERR("unknown parameter '%s' of type '%s'",
286 param->name, edje_external_param_type_str(param->type));
292 external_gengrid_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const Eina_List *params)
294 Elm_Params_Gengrid *mem;
295 Edje_External_Param *param;
298 mem = ELM_NEW(Elm_Params_Gengrid);
302 EINA_LIST_FOREACH(params, l, param)
304 if (!strcmp(param->name, "multi select"))
306 mem->multi = !!param->i;
307 mem->multi_exists = EINA_TRUE;
309 else if (!strcmp(param->name, "no selected"))
311 mem->no_select = !!param->i;
312 mem->no_select_exists = EINA_TRUE;
314 else if (!strcmp(param->name, "always select"))
316 mem->always_select = !!param->i;
317 mem->always_select_exists = EINA_TRUE;
319 else if (!strcmp(param->name, "height bounce"))
321 mem->h_bounce = !!param->i;
322 mem->h_bounce_exists = EINA_TRUE;
324 else if (!strcmp(param->name, "width bounce"))
326 mem->v_bounce = !!param->i;
327 mem->v_bounce_exists = EINA_TRUE;
329 else if (!strcmp(param->name, "horizontal page relative"))
331 mem->h_pagerel = param->d;
332 mem->h_pagerel_exists = EINA_TRUE;
334 else if (!strcmp(param->name, "vertical page relative"))
336 mem->v_pagerel = param->d;
337 mem->v_pagerel_exists = EINA_TRUE;
339 else if (!strcmp(param->name, "horizontal item size"))
341 mem->h_itemsize = param->i;
342 mem->h_itemsize_exists = EINA_TRUE;
344 else if (!strcmp(param->name, "vertical item size"))
346 mem->v_itemsize = param->i;
347 mem->v_itemsize_exists = EINA_TRUE;
349 else if (!strcmp(param->name, "horizontal"))
351 mem->horizontal = !!param->i;
352 mem->horizontal_exists = EINA_TRUE;
360 external_gengrid_content_get(void *data __UNUSED__, const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
367 external_gengrid_params_free(void *params)
369 Elm_Params_Gengrid *mem = params;
373 static Edje_External_Param_Info external_gengrid_params[] = {
374 DEFINE_EXTERNAL_COMMON_PARAMS,
375 EDJE_EXTERNAL_PARAM_INFO_BOOL("multi select"),
376 EDJE_EXTERNAL_PARAM_INFO_BOOL("no select"),
377 EDJE_EXTERNAL_PARAM_INFO_BOOL("always select"),
378 EDJE_EXTERNAL_PARAM_INFO_BOOL("height bounce"),
379 EDJE_EXTERNAL_PARAM_INFO_BOOL("width bounce"),
380 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("horizontal page relative"),
381 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("vertical page relative"),
382 EDJE_EXTERNAL_PARAM_INFO_INT("horizontal item size"),
383 EDJE_EXTERNAL_PARAM_INFO_INT("vertical item size"),
384 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"),
385 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
388 DEFINE_EXTERNAL_ICON_ADD(gengrid, "gengrid");
389 DEFINE_EXTERNAL_TYPE_SIMPLE(gengrid, "Generic Grid");