summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm_gengrid.c
diff options
context:
space:
mode:
authorMichael BOUCHAUD <michael.bouchaud@gmail.com>2011-04-18 10:59:45 +0000
committerMichael BOUCHAUD <michael.bouchaud@gmail.com>2011-04-18 10:59:45 +0000
commit68bc0564b752aeb500693d468d5df395b645eaa3 (patch)
tree0f475fa8b51c03fac19965f5154b9a09813ca730 /src/edje_externals/elm_gengrid.c
parentb63264fe54bce3efa767074a287208f6c9977617 (diff)
elementary: add page relative, item size and horizontal controls to external gengrid
SVN revision: 58706
Diffstat (limited to 'src/edje_externals/elm_gengrid.c')
-rw-r--r--src/edje_externals/elm_gengrid.c164
1 files changed, 164 insertions, 0 deletions
diff --git a/src/edje_externals/elm_gengrid.c b/src/edje_externals/elm_gengrid.c
index 4af188018..45faca58c 100644
--- a/src/edje_externals/elm_gengrid.c
+++ b/src/edje_externals/elm_gengrid.c
@@ -15,6 +15,16 @@ typedef struct _Elm_Params_Gengrid
15 Eina_Bool h_bounce_exists:1; 15 Eina_Bool h_bounce_exists:1;
16 Eina_Bool v_bounce:1; 16 Eina_Bool v_bounce:1;
17 Eina_Bool v_bounce_exists:1; 17 Eina_Bool v_bounce_exists:1;
18 double h_pagerel;
19 Eina_Bool h_pagerel_exists : 1;
20 double v_pagerel;
21 Eina_Bool v_pagerel_exists : 1;
22 int h_itemsize;
23 Eina_Bool h_itemsize_exists : 1;
24 int v_itemsize;
25 Eina_Bool v_itemsize_exists : 1;
26 Eina_Bool horizontal : 1;
27 Eina_Bool horizontal_exists : 1;
18} Elm_Params_Gengrid; 28} Elm_Params_Gengrid;
19 29
20static void 30static void
@@ -44,6 +54,34 @@ external_gengrid_state_set(void *data __UNUSED__, Evas_Object *obj, const void *
44 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce); 54 elm_gengrid_bounce_get(obj, &h_bounce, &v_bounce);
45 elm_gengrid_bounce_set(obj, h_bounce, p->v_bounce); 55 elm_gengrid_bounce_set(obj, h_bounce, p->v_bounce);
46 } 56 }
57 if (p->h_pagerel_exists)
58 {
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);
62 }
63 if (p->v_pagerel_exists)
64 {
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);
68 }
69 if (p->h_itemsize_exists)
70 {
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);
74 }
75 if (p->v_itemsize_exists)
76 {
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);
80 }
81 if (p->horizontal_exists)
82 {
83 elm_gengrid_horizontal_set(obj, p->horizontal);
84 }
47} 85}
48 86
49static Eina_Bool 87static Eina_Bool
@@ -93,6 +131,54 @@ external_gengrid_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
93 return EINA_TRUE; 131 return EINA_TRUE;
94 } 132 }
95 } 133 }
134 else if (!strcmp(param->name, "horizontal page relative"))
135 {
136 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
137 {
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);
141 return EINA_TRUE;
142 }
143 }
144 else if (!strcmp(param->name, "vertical page relative"))
145 {
146 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
147 {
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);
151 return EINA_TRUE;
152 }
153 }
154 else if (!strcmp(param->name, "horizontal item size"))
155 {
156 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
157 {
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);
161 return EINA_TRUE;
162 }
163 }
164 else if (!strcmp(param->name, "vertical item size"))
165 {
166 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
167 {
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);
171 return EINA_TRUE;
172 }
173 }
174 else if (!strcmp(param->name, "horizontal"))
175 {
176 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
177 {
178 elm_gengrid_horizontal_set(obj, param->i);
179 return EINA_TRUE;
180 }
181 }
96 182
97 ERR("unknown parameter '%s' of type '%s'", 183 ERR("unknown parameter '%s' of type '%s'",
98 param->name, edje_external_param_type_str(param->type)); 184 param->name, edje_external_param_type_str(param->type));
@@ -147,6 +233,54 @@ external_gengrid_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
147 return EINA_TRUE; 233 return EINA_TRUE;
148 } 234 }
149 } 235 }
236 else if (!strcmp(param->name, "horizontal page relative"))
237 {
238 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
239 {
240 double h_pagerel, v_pagerel;
241 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
242 param->d = h_pagerel;
243 return EINA_TRUE;
244 }
245 }
246 else if (!strcmp(param->name, "vertical page relative"))
247 {
248 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
249 {
250 double h_pagerel, v_pagerel;
251 elm_gengrid_page_relative_get(obj, &h_pagerel, &v_pagerel);
252 param->d = v_pagerel;
253 return EINA_TRUE;
254 }
255 }
256 else if (!strcmp(param->name, "horizontal item size"))
257 {
258 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
259 {
260 int h_itemsize, v_itemsize;
261 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
262 param->i = h_itemsize;
263 return EINA_TRUE;
264 }
265 }
266 else if (!strcmp(param->name, "vertical item size"))
267 {
268 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
269 {
270 int h_itemsize, v_itemsize;
271 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
272 param->i = v_itemsize;
273 return EINA_TRUE;
274 }
275 }
276 else if (!strcmp(param->name, "horizontal"))
277 {
278 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
279 {
280 param->i = elm_gengrid_horizontal_get(obj);
281 return EINA_TRUE;
282 }
283 }
150 284
151 ERR("unknown parameter '%s' of type '%s'", 285 ERR("unknown parameter '%s' of type '%s'",
152 param->name, edje_external_param_type_str(param->type)); 286 param->name, edje_external_param_type_str(param->type));
@@ -192,6 +326,31 @@ external_gengrid_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__
192 mem->v_bounce = !!param->i; 326 mem->v_bounce = !!param->i;
193 mem->v_bounce_exists = EINA_TRUE; 327 mem->v_bounce_exists = EINA_TRUE;
194 } 328 }
329 else if (!strcmp(param->name, "horizontal page relative"))
330 {
331 mem->h_pagerel = param->d;
332 mem->h_pagerel_exists = EINA_TRUE;
333 }
334 else if (!strcmp(param->name, "vertical page relative"))
335 {
336 mem->v_pagerel = param->d;
337 mem->v_pagerel_exists = EINA_TRUE;
338 }
339 else if (!strcmp(param->name, "horizontal item size"))
340 {
341 mem->h_itemsize = param->i;
342 mem->h_itemsize_exists = EINA_TRUE;
343 }
344 else if (!strcmp(param->name, "vertical item size"))
345 {
346 mem->v_itemsize = param->i;
347 mem->v_itemsize_exists = EINA_TRUE;
348 }
349 else if (!strcmp(param->name, "horizontal"))
350 {
351 mem->horizontal = !!param->i;
352 mem->horizontal_exists = EINA_TRUE;
353 }
195 } 354 }
196 355
197 return mem; 356 return mem;
@@ -218,6 +377,11 @@ static Edje_External_Param_Info external_gengrid_params[] = {
218 EDJE_EXTERNAL_PARAM_INFO_BOOL("always select"), 377 EDJE_EXTERNAL_PARAM_INFO_BOOL("always select"),
219 EDJE_EXTERNAL_PARAM_INFO_BOOL("height bounce"), 378 EDJE_EXTERNAL_PARAM_INFO_BOOL("height bounce"),
220 EDJE_EXTERNAL_PARAM_INFO_BOOL("width 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"),
221 EDJE_EXTERNAL_PARAM_INFO_SENTINEL 385 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
222}; 386};
223 387