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;
28 Eina_Bool align_x_exists;
30 Eina_Bool align_y_exists;
35 external_gengrid_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
37 const Elm_Params_Gengrid *p;
39 if (to_params) p = to_params;
40 else if (from_params) p = from_params;
44 elm_gengrid_multi_select_set(obj, p->multi);
45 if (p->no_select_exists)
46 elm_gengrid_no_select_mode_set (obj, p->no_select);
47 if (p->always_select_exists)
48 elm_gengrid_always_select_mode_set (obj, p->always_select);
49 if (p->h_bounce_exists)
51 Eina_Bool h_bounce, v_bounce;
52 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
53 elm_gengrid_bounce_set(obj, p->h_bounce, v_bounce);
55 if (p->v_bounce_exists)
57 Eina_Bool h_bounce, v_bounce;
58 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
59 elm_gengrid_bounce_set(obj, h_bounce, p->v_bounce);
61 if (p->h_pagerel_exists)
63 double h_pagerel, v_pagerel;
64 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
65 elm_gengrid_page_relative_set(obj, h_pagerel, p->v_pagerel);
67 if (p->v_pagerel_exists)
69 double h_pagerel, v_pagerel;
70 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
71 elm_gengrid_page_relative_set(obj, p->h_pagerel, v_pagerel);
73 if (p->h_itemsize_exists)
75 int h_itemsize, v_itemsize;
76 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
77 elm_gengrid_item_size_set(obj, h_itemsize, p->v_itemsize);
79 if (p->v_itemsize_exists)
81 int h_itemsize, v_itemsize;
82 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
83 elm_gengrid_item_size_set(obj, p->h_itemsize, v_itemsize);
85 else if (p->align_x_exists || p->align_y_exists)
88 elm_gengrid_align_get(obj, &x, &y);
89 if (p->align_x_exists)
90 elm_gengrid_align_set(obj, p->align_x, y);
92 elm_gengrid_align_set(obj, x, p->align_y);
94 if (p->horizontal_exists)
96 elm_gengrid_horizontal_set(obj, p->horizontal);
101 external_gengrid_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
103 if (!strcmp(param->name, "multi select"))
105 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
107 elm_gengrid_multi_select_set(obj, param->i);
111 else if (!strcmp(param->name, "no selected"))
113 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
115 elm_gengrid_no_select_mode_set(obj, param->i);
119 else if (!strcmp(param->name, "always select"))
121 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
123 elm_gengrid_always_select_mode_set(obj, param->i);
127 else if (!strcmp(param->name, "height bounce"))
129 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
131 Eina_Bool h_bounce, v_bounce;
132 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
133 elm_gengrid_bounce_set(obj, param->i, v_bounce);
137 else if (!strcmp(param->name, "width bounce"))
139 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
141 Eina_Bool h_bounce, v_bounce;
142 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
143 elm_gengrid_bounce_set(obj, h_bounce, param->i);
147 else if (!strcmp(param->name, "horizontal page relative"))
149 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
151 double h_pagerel, v_pagerel;
152 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
153 elm_gengrid_page_relative_set(obj, param->d, v_pagerel);
157 else if (!strcmp(param->name, "vertical page relative"))
159 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
161 double h_pagerel, v_pagerel;
162 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
163 elm_gengrid_page_relative_set(obj, h_pagerel, param->d);
167 else if (!strcmp(param->name, "horizontal item size"))
169 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
171 int h_itemsize, v_itemsize;
172 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
173 elm_gengrid_item_size_set(obj, param->i, v_itemsize);
177 else if (!strcmp(param->name, "vertical item size"))
179 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
181 int h_itemsize, v_itemsize;
182 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
183 elm_gengrid_item_size_set(obj, h_itemsize, param->i);
187 else if (!strcmp(param->name, "horizontal"))
189 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
191 elm_gengrid_horizontal_set(obj, param->i);
195 else if (!strcmp(param->name, "align x")
196 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
199 elm_gengrid_align_get(obj, &x, &y);
200 elm_gengrid_align_set(obj, param->d, y);
203 else if (!strcmp(param->name, "align y")
204 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
207 elm_gengrid_align_get(obj, &x, &y);
208 elm_gengrid_align_set(obj, x, param->d);
211 ERR("unknown parameter '%s' of type '%s'",
212 param->name, edje_external_param_type_str(param->type));
218 external_gengrid_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
220 if (!strcmp(param->name, "multi select"))
222 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
224 param->i = elm_gengrid_multi_select_get(obj);
228 else if (!strcmp(param->name, "no selected"))
230 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
232 param->i = elm_gengrid_no_select_mode_get(obj);
236 else if (!strcmp(param->name, "always select"))
238 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
240 param->i = elm_gengrid_always_select_mode_get(obj);
244 else if (!strcmp(param->name, "height bounce"))
246 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
248 Eina_Bool h_bounce, v_bounce;
249 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
254 else if (!strcmp(param->name, "width bounce"))
256 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
258 Eina_Bool h_bounce, v_bounce;
259 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
264 else if (!strcmp(param->name, "horizontal page relative"))
266 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
268 double h_pagerel, v_pagerel;
269 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
270 param->d = h_pagerel;
274 else if (!strcmp(param->name, "vertical page relative"))
276 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
278 double h_pagerel, v_pagerel;
279 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
280 param->d = v_pagerel;
284 else if (!strcmp(param->name, "horizontal item size"))
286 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
288 int h_itemsize, v_itemsize;
289 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
290 param->i = h_itemsize;
294 else if (!strcmp(param->name, "vertical item size"))
296 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
298 int h_itemsize, v_itemsize;
299 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
300 param->i = v_itemsize;
304 else if (!strcmp(param->name, "horizontal"))
306 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
308 param->i = elm_gengrid_horizontal_get(obj);
312 else if (!strcmp(param->name, "align x")
313 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
316 elm_gengrid_align_get(obj, &x, &y);
320 else if (!strcmp(param->name, "align y")
321 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
324 elm_gengrid_align_get(obj, &x, &y);
328 ERR("unknown parameter '%s' of type '%s'",
329 param->name, edje_external_param_type_str(param->type));
335 external_gengrid_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const Eina_List *params)
337 Elm_Params_Gengrid *mem;
338 Edje_External_Param *param;
341 mem = ELM_NEW(Elm_Params_Gengrid);
345 EINA_LIST_FOREACH(params, l, param)
347 if (!strcmp(param->name, "multi select"))
349 mem->multi = !!param->i;
350 mem->multi_exists = EINA_TRUE;
352 else if (!strcmp(param->name, "no selected"))
354 mem->no_select = !!param->i;
355 mem->no_select_exists = EINA_TRUE;
357 else if (!strcmp(param->name, "always select"))
359 mem->always_select = !!param->i;
360 mem->always_select_exists = EINA_TRUE;
362 else if (!strcmp(param->name, "height bounce"))
364 mem->h_bounce = !!param->i;
365 mem->h_bounce_exists = EINA_TRUE;
367 else if (!strcmp(param->name, "width bounce"))
369 mem->v_bounce = !!param->i;
370 mem->v_bounce_exists = EINA_TRUE;
372 else if (!strcmp(param->name, "horizontal page relative"))
374 mem->h_pagerel = param->d;
375 mem->h_pagerel_exists = EINA_TRUE;
377 else if (!strcmp(param->name, "vertical page relative"))
379 mem->v_pagerel = param->d;
380 mem->v_pagerel_exists = EINA_TRUE;
382 else if (!strcmp(param->name, "horizontal item size"))
384 mem->h_itemsize = param->i;
385 mem->h_itemsize_exists = EINA_TRUE;
387 else if (!strcmp(param->name, "vertical item size"))
389 mem->v_itemsize = param->i;
390 mem->v_itemsize_exists = EINA_TRUE;
392 else if (!strcmp(param->name, "horizontal"))
394 mem->horizontal = !!param->i;
395 mem->horizontal_exists = EINA_TRUE;
397 else if (!strcmp(param->name, "align x"))
399 mem->align_x = param->d;
400 mem->align_x_exists = EINA_TRUE;
402 else if (!strcmp(param->name, "align y"))
404 mem->align_y = param->d;
405 mem->align_y_exists = EINA_TRUE;
413 external_gengrid_content_get(void *data __UNUSED__, const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
420 external_gengrid_params_free(void *params)
422 Elm_Params_Gengrid *mem = params;
426 static Edje_External_Param_Info external_gengrid_params[] = {
427 DEFINE_EXTERNAL_COMMON_PARAMS,
428 EDJE_EXTERNAL_PARAM_INFO_BOOL("multi select"),
429 EDJE_EXTERNAL_PARAM_INFO_BOOL("no select"),
430 EDJE_EXTERNAL_PARAM_INFO_BOOL("always select"),
431 EDJE_EXTERNAL_PARAM_INFO_BOOL("height bounce"),
432 EDJE_EXTERNAL_PARAM_INFO_BOOL("width bounce"),
433 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("horizontal page relative"),
434 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("vertical page relative"),
435 EDJE_EXTERNAL_PARAM_INFO_INT("horizontal item size"),
436 EDJE_EXTERNAL_PARAM_INFO_INT("vertical item size"),
437 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"),
438 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("align x"),
439 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("align y"),
440 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
443 DEFINE_EXTERNAL_ICON_ADD(gengrid, "gengrid");
444 DEFINE_EXTERNAL_TYPE_SIMPLE(gengrid, "Generic Grid");