summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_var.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-06-08 14:43:00 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-06-08 14:43:00 -0400
commit172a0ccf0cd609dac4a3c0b48965c96afd3e1b01 (patch)
treef04c61fc19fdb17727f31cddb9b4dae3cdbbb29b /src/lib/edje/edje_var.c
parent86e5a1a27c41b07a8eee74f6a7d90f534dab13c8 (diff)
edje: reformat all C files
this has been unreadable for years due to the french tabber.
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_var.c860
1 files changed, 439 insertions, 421 deletions
diff --git a/src/lib/edje/edje_var.c b/src/lib/edje/edje_var.c
index 14f7d2df84..6c2ddf26f3 100644
--- a/src/lib/edje/edje_var.c
+++ b/src/lib/edje/edje_var.c
@@ -4,7 +4,7 @@ static Eina_Bool _edje_var_timer_cb(void *data);
4static Eina_Bool _edje_var_anim_cb(void *data); 4static Eina_Bool _edje_var_anim_cb(void *data);
5 5
6static Ecore_Animator *_edje_animator = NULL; 6static Ecore_Animator *_edje_animator = NULL;
7static Eina_List *_edje_anim_list = NULL; 7static Eina_List *_edje_anim_list = NULL;
8 8
9static Eina_Bool 9static Eina_Bool
10_edje_var_timer_cb(void *data) 10_edje_var_timer_cb(void *data)
@@ -23,38 +23,38 @@ _edje_var_timer_cb(void *data)
23 ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); 23 ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et);
24 fn = et->func; 24 fn = et->func;
25 free(et); 25 free(et);
26 { 26 {
27 void *pdata; 27 void *pdata;
28 int ret; 28 int ret;
29 29
30 pdata = embryo_program_data_get(ed->collection->script); 30 pdata = embryo_program_data_get(ed->collection->script);
31 embryo_program_data_set(ed->collection->script, ed); 31 embryo_program_data_set(ed->collection->script, ed);
32 embryo_program_max_cycle_run_set(ed->collection->script, 5000000); 32 embryo_program_max_cycle_run_set(ed->collection->script, 5000000);
33 ret = embryo_program_run(ed->collection->script, fn); 33 ret = embryo_program_run(ed->collection->script, fn);
34 if (ret == EMBRYO_PROGRAM_FAIL) 34 if (ret == EMBRYO_PROGRAM_FAIL)
35 { 35 {
36 ERR("ERROR with embryo script (timer callback). " 36 ERR("ERROR with embryo script (timer callback). "
37 "OBJECT NAME: '%s', " 37 "OBJECT NAME: '%s', "
38 "OBJECT FILE: '%s', " 38 "OBJECT FILE: '%s', "
39 "ERROR: '%s'", 39 "ERROR: '%s'",
40 ed->collection->part, 40 ed->collection->part,
41 ed->file->path, 41 ed->file->path,
42 embryo_error_string_get(embryo_program_error_get(ed->collection->script))); 42 embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
43 } 43 }
44 else if (ret == EMBRYO_PROGRAM_TOOLONG) 44 else if (ret == EMBRYO_PROGRAM_TOOLONG)
45 { 45 {
46 ERR("ERROR with embryo script (timer callback). " 46 ERR("ERROR with embryo script (timer callback). "
47 "OBJECT NAME: '%s', " 47 "OBJECT NAME: '%s', "
48 "OBJECT FILE: '%s', " 48 "OBJECT FILE: '%s', "
49 "ERROR: 'Script exceeded maximum allowed cycle count of %i'", 49 "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
50 ed->collection->part, 50 ed->collection->part,
51 ed->file->path, 51 ed->file->path,
52 embryo_program_max_cycle_run_get(ed->collection->script)); 52 embryo_program_max_cycle_run_get(ed->collection->script));
53 } 53 }
54 embryo_program_data_set(ed->collection->script, pdata); 54 embryo_program_data_set(ed->collection->script, pdata);
55 embryo_program_vm_pop(ed->collection->script); 55 embryo_program_vm_pop(ed->collection->script);
56 _edje_recalc(ed); 56 _edje_recalc(ed);
57 } 57 }
58 return ECORE_CALLBACK_CANCEL; 58 return ECORE_CALLBACK_CANCEL;
59} 59}
60 60
@@ -70,105 +70,105 @@ _edje_var_anim_cb(void *data EINA_UNUSED)
70 tl = eina_list_append(tl, tmp); 70 tl = eina_list_append(tl, tmp);
71 while (tl) 71 while (tl)
72 { 72 {
73 Edje *ed; 73 Edje *ed;
74 Eina_List *tl2; 74 Eina_List *tl2;
75 Edje_Var_Animator *ea; 75 Edje_Var_Animator *ea;
76 76
77 ed = eina_list_data_get(tl); 77 ed = eina_list_data_get(tl);
78 _edje_ref(ed); 78 _edje_ref(ed);
79 _edje_block(ed); 79 _edje_block(ed);
80 _edje_util_freeze(ed); 80 _edje_util_freeze(ed);
81 tl = eina_list_remove(tl, ed); 81 tl = eina_list_remove(tl, ed);
82 if (!ed->var_pool) continue; 82 if (!ed->var_pool) continue;
83 tl2 = NULL; 83 tl2 = NULL;
84 EINA_LIST_FOREACH(ed->var_pool->animators, l, tmp) 84 EINA_LIST_FOREACH(ed->var_pool->animators, l, tmp)
85 tl2 = eina_list_append(tl2, tmp); 85 tl2 = eina_list_append(tl2, tmp);
86 ed->var_pool->walking_list++; 86 ed->var_pool->walking_list++;
87 while (tl2) 87 while (tl2)
88 { 88 {
89 ea = eina_list_data_get(tl2); 89 ea = eina_list_data_get(tl2);
90 if ((ed->var_pool) && (!ea->delete_me)) 90 if ((ed->var_pool) && (!ea->delete_me))
91 { 91 {
92 if ((!ed->paused) && (!ed->delete_me)) 92 if ((!ed->paused) && (!ed->delete_me))
93 { 93 {
94 Embryo_Function fn; 94 Embryo_Function fn;
95 float v; 95 float v;
96 int ret; 96 int ret;
97 97
98 v = (t - ea->start) / ea->len; 98 v = (t - ea->start) / ea->len;
99 if (v > 1.0) v= 1.0; 99 if (v > 1.0) v = 1.0;
100// _edje_embryo_script_reset(ed); 100// _edje_embryo_script_reset(ed);
101 embryo_program_vm_push(ed->collection->script); 101 embryo_program_vm_push(ed->collection->script);
102 _edje_embryo_globals_init(ed); 102 _edje_embryo_globals_init(ed);
103 embryo_parameter_cell_push(ed->collection->script, (Embryo_Cell)ea->val); 103 embryo_parameter_cell_push(ed->collection->script, (Embryo_Cell)ea->val);
104 embryo_parameter_cell_push(ed->collection->script, EMBRYO_FLOAT_TO_CELL(v)); 104 embryo_parameter_cell_push(ed->collection->script, EMBRYO_FLOAT_TO_CELL(v));
105 fn = ea->func; 105 fn = ea->func;
106 { 106 {
107 void *pdata; 107 void *pdata;
108 108
109 pdata = embryo_program_data_get(ed->collection->script); 109 pdata = embryo_program_data_get(ed->collection->script);
110 embryo_program_data_set(ed->collection->script, ed); 110 embryo_program_data_set(ed->collection->script, ed);
111 embryo_program_max_cycle_run_set(ed->collection->script, 5000000); 111 embryo_program_max_cycle_run_set(ed->collection->script, 5000000);
112 ret = embryo_program_run(ed->collection->script, fn); 112 ret = embryo_program_run(ed->collection->script, fn);
113 if (ret == EMBRYO_PROGRAM_FAIL) 113 if (ret == EMBRYO_PROGRAM_FAIL)
114 { 114 {
115 ERR("ERROR with embryo script (anim callback). " 115 ERR("ERROR with embryo script (anim callback). "
116 "OBJECT NAME: '%s', " 116 "OBJECT NAME: '%s', "
117 "OBJECT FILE: '%s', " 117 "OBJECT FILE: '%s', "
118 "ERROR: '%s'", 118 "ERROR: '%s'",
119 ed->collection->part, 119 ed->collection->part,
120 ed->file->path, 120 ed->file->path,
121 embryo_error_string_get(embryo_program_error_get(ed->collection->script))); 121 embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
122 } 122 }
123 else if (ret == EMBRYO_PROGRAM_TOOLONG) 123 else if (ret == EMBRYO_PROGRAM_TOOLONG)
124 { 124 {
125 ERR("ERROR with embryo script (anim callback). " 125 ERR("ERROR with embryo script (anim callback). "
126 "OBJECT NAME: '%s', " 126 "OBJECT NAME: '%s', "
127 "OBJECT FILE: '%s', " 127 "OBJECT FILE: '%s', "
128 "ERROR: 'Script exceeded maximum allowed cycle count of %i'", 128 "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
129 ed->collection->part, 129 ed->collection->part,
130 ed->file->path, 130 ed->file->path,
131 embryo_program_max_cycle_run_get(ed->collection->script)); 131 embryo_program_max_cycle_run_get(ed->collection->script));
132 } 132 }
133 embryo_program_data_set(ed->collection->script, pdata); 133 embryo_program_data_set(ed->collection->script, pdata);
134 embryo_program_vm_pop(ed->collection->script); 134 embryo_program_vm_pop(ed->collection->script);
135 _edje_recalc(ed); 135 _edje_recalc(ed);
136 } 136 }
137 if (v == 1.0) ea->delete_me = 1; 137 if (v == 1.0) ea->delete_me = 1;
138 } 138 }
139 } 139 }
140 tl2 = eina_list_remove(tl2, ea); 140 tl2 = eina_list_remove(tl2, ea);
141 if (ed->block_break) 141 if (ed->block_break)
142 { 142 {
143 eina_list_free(tl2); 143 eina_list_free(tl2);
144 break; 144 break;
145 } 145 }
146 } 146 }
147 ed->var_pool->walking_list--; 147 ed->var_pool->walking_list--;
148 EINA_LIST_FOREACH(ed->var_pool->animators, l, ea) 148 EINA_LIST_FOREACH(ed->var_pool->animators, l, ea)
149 { 149 {
150 if (ea->delete_me) 150 if (ea->delete_me)
151 { 151 {
152 l = eina_list_next(l); 152 l = eina_list_next(l);
153 ed->var_pool->animators = eina_list_remove(ed->var_pool->animators, ea); 153 ed->var_pool->animators = eina_list_remove(ed->var_pool->animators, ea);
154 free(ea); 154 free(ea);
155 } 155 }
156 else 156 else
157 l = eina_list_next(l); 157 l = eina_list_next(l);
158 } 158 }
159 if (!ed->var_pool->animators) 159 if (!ed->var_pool->animators)
160 _edje_anim_list = eina_list_remove(_edje_anim_list, ed); 160 _edje_anim_list = eina_list_remove(_edje_anim_list, ed);
161 _edje_unblock(ed); 161 _edje_unblock(ed);
162 _edje_util_thaw(ed); 162 _edje_util_thaw(ed);
163 _edje_unref(ed); 163 _edje_unref(ed);
164 } 164 }
165 if (!_edje_anim_list) 165 if (!_edje_anim_list)
166 { 166 {
167 if (_edje_animator) 167 if (_edje_animator)
168 { 168 {
169 ecore_animator_del(_edje_animator); 169 ecore_animator_del(_edje_animator);
170 _edje_animator = NULL; 170 _edje_animator = NULL;
171 } 171 }
172 } 172 }
173 return !!_edje_animator; 173 return !!_edje_animator;
174} 174}
@@ -184,10 +184,10 @@ _edje_var_free(Edje_Var *var)
184{ 184{
185 if (var->type == EDJE_VAR_STRING) 185 if (var->type == EDJE_VAR_STRING)
186 { 186 {
187 if (var->data.s.v) 187 if (var->data.s.v)
188 { 188 {
189 free(var->data.s.v); 189 free(var->data.s.v);
190 } 190 }
191 } 191 }
192 free(var); 192 free(var);
193} 193}
@@ -214,57 +214,57 @@ _edje_var_shutdown(Edje *ed)
214 if (!ed->var_pool) return; 214 if (!ed->var_pool) return;
215 if (ed->var_pool->vars) 215 if (ed->var_pool->vars)
216 { 216 {
217 int i; 217 int i;
218 218
219 for (i = 0; i < ed->var_pool->size; i++) 219 for (i = 0; i < ed->var_pool->size; i++)
220 { 220 {
221 if (ed->var_pool->vars[i].type == EDJE_VAR_STRING) 221 if (ed->var_pool->vars[i].type == EDJE_VAR_STRING)
222 { 222 {
223 if (ed->var_pool->vars[i].data.s.v) 223 if (ed->var_pool->vars[i].data.s.v)
224 { 224 {
225 free(ed->var_pool->vars[i].data.s.v); 225 free(ed->var_pool->vars[i].data.s.v);
226 ed->var_pool->vars[i].data.s.v = NULL; 226 ed->var_pool->vars[i].data.s.v = NULL;
227 } 227 }
228 } 228 }
229 else if (ed->var_pool->vars[i].type == EDJE_VAR_LIST) 229 else if (ed->var_pool->vars[i].type == EDJE_VAR_LIST)
230 { 230 {
231 while (ed->var_pool->vars[i].data.l.v) 231 while (ed->var_pool->vars[i].data.l.v)
232 { 232 {
233 _edje_var_free(eina_list_data_get(ed->var_pool->vars[i].data.l.v)); 233 _edje_var_free(eina_list_data_get(ed->var_pool->vars[i].data.l.v));
234 ed->var_pool->vars[i].data.l.v = eina_list_remove_list(ed->var_pool->vars[i].data.l.v, ed->var_pool->vars[i].data.l.v); 234 ed->var_pool->vars[i].data.l.v = eina_list_remove_list(ed->var_pool->vars[i].data.l.v, ed->var_pool->vars[i].data.l.v);
235 } 235 }
236 } 236 }
237 } 237 }
238 free(ed->var_pool->vars); 238 free(ed->var_pool->vars);
239 } 239 }
240 while (ed->var_pool->timers) 240 while (ed->var_pool->timers)
241 { 241 {
242 Edje_Var_Timer *et; 242 Edje_Var_Timer *et;
243 243
244 et = eina_list_data_get(ed->var_pool->timers); 244 et = eina_list_data_get(ed->var_pool->timers);
245 ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); 245 ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et);
246 ecore_timer_del(et->timer); 246 ecore_timer_del(et->timer);
247 free(et); 247 free(et);
248 } 248 }
249 if (ed->var_pool->animators) 249 if (ed->var_pool->animators)
250 { 250 {
251 _edje_anim_list = eina_list_remove(_edje_anim_list, ed); 251 _edje_anim_list = eina_list_remove(_edje_anim_list, ed);
252 if (!_edje_anim_list) 252 if (!_edje_anim_list)
253 { 253 {
254 if (_edje_animator) 254 if (_edje_animator)
255 { 255 {
256 ecore_animator_del(_edje_animator); 256 ecore_animator_del(_edje_animator);
257 _edje_animator = NULL; 257 _edje_animator = NULL;
258 } 258 }
259 } 259 }
260 } 260 }
261 while (ed->var_pool->animators) 261 while (ed->var_pool->animators)
262 { 262 {
263 Edje_Var_Animator *ea; 263 Edje_Var_Animator *ea;
264 264
265 ea = eina_list_data_get(ed->var_pool->animators); 265 ea = eina_list_data_get(ed->var_pool->animators);
266 ed->var_pool->animators = eina_list_remove(ed->var_pool->animators, ea); 266 ed->var_pool->animators = eina_list_remove(ed->var_pool->animators, ea);
267 free(ea); 267 free(ea);
268 } 268 }
269 free(ed->var_pool); 269 free(ed->var_pool);
270 ed->var_pool = NULL; 270 ed->var_pool = NULL;
@@ -280,7 +280,7 @@ _edje_var_string_id_get(Edje *ed, const char *string)
280 if (!ed->collection->script) return 0; 280 if (!ed->collection->script) return 0;
281 if (!string) return 0; 281 if (!string) return 0;
282 cell = embryo_program_variable_find(ed->collection->script, (char *)string); 282 cell = embryo_program_variable_find(ed->collection->script, (char *)string);
283 if (cell == EMBRYO_CELL_NONE) return 0; 283 if (cell == EMBRYO_CELL_NONE) return 0;
284 cptr = embryo_data_address_get(ed->collection->script, cell); 284 cptr = embryo_data_address_get(ed->collection->script, cell);
285 if (!cptr) return 0; 285 if (!cptr) return 0;
286 return (int)(*cptr); 286 return (int)(*cptr);
@@ -292,33 +292,33 @@ _edje_var_var_int_get(Edje *ed EINA_UNUSED, Edje_Var *var)
292 /* auto-cast */ 292 /* auto-cast */
293 if (var->type == EDJE_VAR_STRING) 293 if (var->type == EDJE_VAR_STRING)
294 { 294 {
295 if (var->data.s.v) 295 if (var->data.s.v)
296 { 296 {
297 double f; 297 double f;
298 298
299 f = atof(var->data.s.v); 299 f = atof(var->data.s.v);
300 free(var->data.s.v); 300 free(var->data.s.v);
301 var->data.s.v = NULL; 301 var->data.s.v = NULL;
302 var->data.i.v = (int)f; 302 var->data.i.v = (int)f;
303 } 303 }
304 var->type = EDJE_VAR_INT; 304 var->type = EDJE_VAR_INT;
305 } 305 }
306 else if (var->type == EDJE_VAR_FLOAT) 306 else if (var->type == EDJE_VAR_FLOAT)
307 { 307 {
308 var->data.i.v = (int)(var->data.f.v); 308 var->data.i.v = (int)(var->data.f.v);
309 var->type = EDJE_VAR_INT; 309 var->type = EDJE_VAR_INT;
310 } 310 }
311 else if (var->type == EDJE_VAR_NONE) 311 else if (var->type == EDJE_VAR_NONE)
312 { 312 {
313 var->type = EDJE_VAR_INT; 313 var->type = EDJE_VAR_INT;
314 } 314 }
315 else if (var->type == EDJE_VAR_LIST) 315 else if (var->type == EDJE_VAR_LIST)
316 { 316 {
317 return 0; 317 return 0;
318 } 318 }
319 else if (var->type == EDJE_VAR_HASH) 319 else if (var->type == EDJE_VAR_HASH)
320 { 320 {
321 return 0; 321 return 0;
322 } 322 }
323 return var->data.i.v; 323 return var->data.i.v;
324} 324}
@@ -329,28 +329,28 @@ _edje_var_var_int_set(Edje *ed EINA_UNUSED, Edje_Var *var, int v)
329 /* auto-cast */ 329 /* auto-cast */
330 if (var->type == EDJE_VAR_STRING) 330 if (var->type == EDJE_VAR_STRING)
331 { 331 {
332 if (var->data.s.v) 332 if (var->data.s.v)
333 { 333 {
334 free(var->data.s.v); 334 free(var->data.s.v);
335 var->data.s.v = NULL; 335 var->data.s.v = NULL;
336 } 336 }
337 var->type = EDJE_VAR_INT; 337 var->type = EDJE_VAR_INT;
338 } 338 }
339 else if (var->type == EDJE_VAR_FLOAT) 339 else if (var->type == EDJE_VAR_FLOAT)
340 { 340 {
341 var->type = EDJE_VAR_INT; 341 var->type = EDJE_VAR_INT;
342 } 342 }
343 else if (var->type == EDJE_VAR_NONE) 343 else if (var->type == EDJE_VAR_NONE)
344 { 344 {
345 var->type = EDJE_VAR_INT; 345 var->type = EDJE_VAR_INT;
346 } 346 }
347 else if (var->type == EDJE_VAR_LIST) 347 else if (var->type == EDJE_VAR_LIST)
348 { 348 {
349 return; 349 return;
350 } 350 }
351 else if (var->type == EDJE_VAR_HASH) 351 else if (var->type == EDJE_VAR_HASH)
352 { 352 {
353 return; 353 return;
354 } 354 }
355 var->data.i.v = v; 355 var->data.i.v = v;
356} 356}
@@ -361,33 +361,33 @@ _edje_var_var_float_get(Edje *ed EINA_UNUSED, Edje_Var *var)
361 /* auto-cast */ 361 /* auto-cast */
362 if (var->type == EDJE_VAR_STRING) 362 if (var->type == EDJE_VAR_STRING)
363 { 363 {
364 if (var->data.s.v) 364 if (var->data.s.v)
365 { 365 {
366 double f; 366 double f;
367 367
368 f = atof(var->data.s.v); 368 f = atof(var->data.s.v);
369 free(var->data.s.v); 369 free(var->data.s.v);
370 var->data.s.v = NULL; 370 var->data.s.v = NULL;
371 var->data.f.v = f; 371 var->data.f.v = f;
372 } 372 }
373 var->type = EDJE_VAR_FLOAT; 373 var->type = EDJE_VAR_FLOAT;
374 } 374 }
375 else if (var->type == EDJE_VAR_INT) 375 else if (var->type == EDJE_VAR_INT)
376 { 376 {
377 var->data.f.v = (double)(var->data.i.v); 377 var->data.f.v = (double)(var->data.i.v);
378 var->type = EDJE_VAR_FLOAT; 378 var->type = EDJE_VAR_FLOAT;
379 } 379 }
380 else if (var->type == EDJE_VAR_NONE) 380 else if (var->type == EDJE_VAR_NONE)
381 { 381 {
382 var->type = EDJE_VAR_FLOAT; 382 var->type = EDJE_VAR_FLOAT;
383 } 383 }
384 else if (var->type == EDJE_VAR_LIST) 384 else if (var->type == EDJE_VAR_LIST)
385 { 385 {
386 return 0.0; 386 return 0.0;
387 } 387 }
388 else if (var->type == EDJE_VAR_HASH) 388 else if (var->type == EDJE_VAR_HASH)
389 { 389 {
390 return 0.0; 390 return 0.0;
391 } 391 }
392 return var->data.f.v; 392 return var->data.f.v;
393} 393}
@@ -398,29 +398,29 @@ _edje_var_var_float_set(Edje *ed EINA_UNUSED, Edje_Var *var, double v)
398 /* auto-cast */ 398 /* auto-cast */
399 if (var->type == EDJE_VAR_STRING) 399 if (var->type == EDJE_VAR_STRING)
400 { 400 {
401 if (var->data.s.v) 401 if (var->data.s.v)
402 { 402 {
403 free(var->data.s.v); 403 free(var->data.s.v);
404 var->data.s.v = NULL; 404 var->data.s.v = NULL;
405 } 405 }
406 var->type = EDJE_VAR_FLOAT; 406 var->type = EDJE_VAR_FLOAT;
407 } 407 }
408 else if (var->type == EDJE_VAR_INT) 408 else if (var->type == EDJE_VAR_INT)
409 { 409 {
410 var->data.f.v = 0; 410 var->data.f.v = 0;
411 var->type = EDJE_VAR_FLOAT; 411 var->type = EDJE_VAR_FLOAT;
412 } 412 }
413 else if (var->type == EDJE_VAR_NONE) 413 else if (var->type == EDJE_VAR_NONE)
414 { 414 {
415 var->type = EDJE_VAR_FLOAT; 415 var->type = EDJE_VAR_FLOAT;
416 } 416 }
417 else if (var->type == EDJE_VAR_LIST) 417 else if (var->type == EDJE_VAR_LIST)
418 { 418 {
419 return; 419 return;
420 } 420 }
421 else if (var->type == EDJE_VAR_HASH) 421 else if (var->type == EDJE_VAR_HASH)
422 { 422 {
423 return; 423 return;
424 } 424 }
425 var->data.f.v = v; 425 var->data.f.v = v;
426} 426}
@@ -431,32 +431,32 @@ _edje_var_var_str_get(Edje *ed EINA_UNUSED, Edje_Var *var)
431 /* auto-cast */ 431 /* auto-cast */
432 if (var->type == EDJE_VAR_INT) 432 if (var->type == EDJE_VAR_INT)
433 { 433 {
434 char buf[64]; 434 char buf[64];
435 435
436 snprintf(buf, sizeof(buf), "%i", var->data.i.v); 436 snprintf(buf, sizeof(buf), "%i", var->data.i.v);
437 var->data.s.v = strdup(buf); 437 var->data.s.v = strdup(buf);
438 var->type = EDJE_VAR_STRING; 438 var->type = EDJE_VAR_STRING;
439 } 439 }
440 else if (var->type == EDJE_VAR_FLOAT) 440 else if (var->type == EDJE_VAR_FLOAT)
441 { 441 {
442 char buf[64]; 442 char buf[64];
443 443
444 snprintf(buf, sizeof(buf), "%f", var->data.f.v); 444 snprintf(buf, sizeof(buf), "%f", var->data.f.v);
445 var->data.s.v = strdup(buf); 445 var->data.s.v = strdup(buf);
446 var->type = EDJE_VAR_STRING; 446 var->type = EDJE_VAR_STRING;
447 } 447 }
448 else if (var->type == EDJE_VAR_NONE) 448 else if (var->type == EDJE_VAR_NONE)
449 { 449 {
450 var->data.s.v = strdup(""); 450 var->data.s.v = strdup("");
451 var->type = EDJE_VAR_STRING; 451 var->type = EDJE_VAR_STRING;
452 } 452 }
453 else if (var->type == EDJE_VAR_LIST) 453 else if (var->type == EDJE_VAR_LIST)
454 { 454 {
455 return NULL; 455 return NULL;
456 } 456 }
457 else if (var->type == EDJE_VAR_HASH) 457 else if (var->type == EDJE_VAR_HASH)
458 { 458 {
459 return NULL; 459 return NULL;
460 } 460 }
461 return var->data.s.v; 461 return var->data.s.v;
462} 462}
@@ -467,31 +467,31 @@ _edje_var_var_str_set(Edje *ed EINA_UNUSED, Edje_Var *var, const char *str)
467 /* auto-cast */ 467 /* auto-cast */
468 if (var->type == EDJE_VAR_STRING) 468 if (var->type == EDJE_VAR_STRING)
469 { 469 {
470 if (var->data.s.v) 470 if (var->data.s.v)
471 { 471 {
472 free(var->data.s.v); 472 free(var->data.s.v);
473 var->data.s.v = NULL; 473 var->data.s.v = NULL;
474 } 474 }
475 } 475 }
476 else if (var->type == EDJE_VAR_INT) 476 else if (var->type == EDJE_VAR_INT)
477 { 477 {
478 var->type = EDJE_VAR_STRING; 478 var->type = EDJE_VAR_STRING;
479 } 479 }
480 else if (var->type == EDJE_VAR_FLOAT) 480 else if (var->type == EDJE_VAR_FLOAT)
481 { 481 {
482 var->type = EDJE_VAR_STRING; 482 var->type = EDJE_VAR_STRING;
483 } 483 }
484 else if (var->type == EDJE_VAR_NONE) 484 else if (var->type == EDJE_VAR_NONE)
485 { 485 {
486 var->type = EDJE_VAR_STRING; 486 var->type = EDJE_VAR_STRING;
487 } 487 }
488 else if (var->type == EDJE_VAR_LIST) 488 else if (var->type == EDJE_VAR_LIST)
489 { 489 {
490 return; 490 return;
491 } 491 }
492 else if (var->type == EDJE_VAR_HASH) 492 else if (var->type == EDJE_VAR_HASH)
493 { 493 {
494 return; 494 return;
495 } 495 }
496 var->data.s.v = strdup(str); 496 var->data.s.v = strdup(str);
497} 497}
@@ -623,7 +623,8 @@ _edje_var_list_count_get(Edje *ed, int id)
623 if ((id < 0) || (id >= ed->var_pool->size)) return 0; 623 if ((id < 0) || (id >= ed->var_pool->size)) return 0;
624 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 624 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
625 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 625 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
626 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0; 626 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
627 return 0;
627 return eina_list_count(ed->var_pool->vars[id].data.l.v); 628 return eina_list_count(ed->var_pool->vars[id].data.l.v);
628} 629}
629 630
@@ -636,17 +637,18 @@ _edje_var_list_remove_nth(Edje *ed, int id, int n)
636 if ((id < 0) || (id >= ed->var_pool->size)) return; 637 if ((id < 0) || (id >= ed->var_pool->size)) return;
637 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 638 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
638 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 639 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
639 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 640 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
640 { 641 return;
641 Eina_List *nth; 642 {
642 643 Eina_List *nth;
643 nth = eina_list_nth_list(ed->var_pool->vars[id].data.l.v, n); 644
644 if (nth) 645 nth = eina_list_nth_list(ed->var_pool->vars[id].data.l.v, n);
645 { 646 if (nth)
646 _edje_var_free(eina_list_data_get(nth)); 647 {
647 ed->var_pool->vars[id].data.l.v = eina_list_remove_list(ed->var_pool->vars[id].data.l.v, nth); 648 _edje_var_free(eina_list_data_get(nth));
648 } 649 ed->var_pool->vars[id].data.l.v = eina_list_remove_list(ed->var_pool->vars[id].data.l.v, nth);
649 } 650 }
651 }
650} 652}
651 653
652int 654int
@@ -658,15 +660,16 @@ _edje_var_list_nth_int_get(Edje *ed, int id, int n)
658 if ((id < 0) || (id >= ed->var_pool->size)) return 0; 660 if ((id < 0) || (id >= ed->var_pool->size)) return 0;
659 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 661 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
660 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 662 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
661 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0; 663 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
662 { 664 return 0;
663 Edje_Var *var; 665 {
664 666 Edje_Var *var;
665 id += EDJE_VAR_MAGIC_BASE; 667
666 var = _edje_var_list_nth(ed, id, n); 668 id += EDJE_VAR_MAGIC_BASE;
667 if (!var) return 0; 669 var = _edje_var_list_nth(ed, id, n);
668 return _edje_var_var_int_get(ed, var); 670 if (!var) return 0;
669 } 671 return _edje_var_var_int_get(ed, var);
672 }
670} 673}
671 674
672void 675void
@@ -678,15 +681,16 @@ _edje_var_list_nth_int_set(Edje *ed, int id, int n, int v)
678 if ((id < 0) || (id >= ed->var_pool->size)) return; 681 if ((id < 0) || (id >= ed->var_pool->size)) return;
679 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 682 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
680 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 683 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
681 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 684 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
682 { 685 return;
683 Edje_Var *var; 686 {
684 687 Edje_Var *var;
685 id += EDJE_VAR_MAGIC_BASE; 688
686 var = _edje_var_list_nth(ed, id, n); 689 id += EDJE_VAR_MAGIC_BASE;
687 if (!var) return; 690 var = _edje_var_list_nth(ed, id, n);
688 _edje_var_var_int_set(ed, var, v); 691 if (!var) return;
689 } 692 _edje_var_var_int_set(ed, var, v);
693 }
690} 694}
691 695
692void 696void
@@ -698,16 +702,17 @@ _edje_var_list_int_append(Edje *ed, int id, int v)
698 if ((id < 0) || (id >= ed->var_pool->size)) return; 702 if ((id < 0) || (id >= ed->var_pool->size)) return;
699 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 703 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
700 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 704 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
701 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 705 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
702 { 706 return;
703 Edje_Var *var; 707 {
704 708 Edje_Var *var;
705 var = _edje_var_new(); 709
706 if (!var) return; 710 var = _edje_var_new();
707 id += EDJE_VAR_MAGIC_BASE; 711 if (!var) return;
708 _edje_var_var_int_set(ed, var, v); 712 id += EDJE_VAR_MAGIC_BASE;
709 _edje_var_list_var_append(ed, id, var); 713 _edje_var_var_int_set(ed, var, v);
710 } 714 _edje_var_list_var_append(ed, id, var);
715 }
711} 716}
712 717
713void 718void
@@ -719,16 +724,17 @@ _edje_var_list_int_prepend(Edje *ed, int id, int v)
719 if ((id < 0) || (id >= ed->var_pool->size)) return; 724 if ((id < 0) || (id >= ed->var_pool->size)) return;
720 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 725 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
721 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 726 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
722 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 727 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
723 { 728 return;
724 Edje_Var *var; 729 {
725 730 Edje_Var *var;
726 var = _edje_var_new(); 731
727 if (!var) return; 732 var = _edje_var_new();
728 id += EDJE_VAR_MAGIC_BASE; 733 if (!var) return;
729 _edje_var_var_int_set(ed, var, v); 734 id += EDJE_VAR_MAGIC_BASE;
730 _edje_var_list_var_prepend(ed, id, var); 735 _edje_var_var_int_set(ed, var, v);
731 } 736 _edje_var_list_var_prepend(ed, id, var);
737 }
732} 738}
733 739
734void 740void
@@ -740,20 +746,21 @@ _edje_var_list_int_insert(Edje *ed, int id, int n, int v)
740 if ((id < 0) || (id >= ed->var_pool->size)) return; 746 if ((id < 0) || (id >= ed->var_pool->size)) return;
741 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 747 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
742 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 748 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
743 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 749 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
744 { 750 return;
745 Edje_Var *var, *var_rel; 751 {
746 752 Edje_Var *var, *var_rel;
747 var = _edje_var_new(); 753
748 if (!var) return; 754 var = _edje_var_new();
749 id += EDJE_VAR_MAGIC_BASE; 755 if (!var) return;
750 _edje_var_var_int_set(ed, var, v); 756 id += EDJE_VAR_MAGIC_BASE;
751 var_rel = _edje_var_list_nth(ed, id, n); 757 _edje_var_var_int_set(ed, var, v);
752 if (!var_rel) 758 var_rel = _edje_var_list_nth(ed, id, n);
753 _edje_var_list_var_append(ed, id, var); 759 if (!var_rel)
754 else 760 _edje_var_list_var_append(ed, id, var);
755 _edje_var_list_var_prepend_relative(ed, id, var, var_rel); 761 else
756 } 762 _edje_var_list_var_prepend_relative(ed, id, var, var_rel);
763 }
757} 764}
758 765
759double 766double
@@ -765,15 +772,16 @@ _edje_var_list_nth_float_get(Edje *ed, int id, int n)
765 if ((id < 0) || (id >= ed->var_pool->size)) return 0; 772 if ((id < 0) || (id >= ed->var_pool->size)) return 0;
766 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 773 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
767 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 774 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
768 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0; 775 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
769 { 776 return 0;
770 Edje_Var *var; 777 {
771 778 Edje_Var *var;
772 id += EDJE_VAR_MAGIC_BASE; 779
773 var = _edje_var_list_nth(ed, id, n); 780 id += EDJE_VAR_MAGIC_BASE;
774 if (!var) return 0; 781 var = _edje_var_list_nth(ed, id, n);
775 return _edje_var_var_float_get(ed, var); 782 if (!var) return 0;
776 } 783 return _edje_var_var_float_get(ed, var);
784 }
777} 785}
778 786
779void 787void
@@ -785,15 +793,16 @@ _edje_var_list_nth_float_set(Edje *ed, int id, int n, double v)
785 if ((id < 0) || (id >= ed->var_pool->size)) return; 793 if ((id < 0) || (id >= ed->var_pool->size)) return;
786 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 794 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
787 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 795 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
788 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 796 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
789 { 797 return;
790 Edje_Var *var; 798 {
791 799 Edje_Var *var;
792 id += EDJE_VAR_MAGIC_BASE; 800
793 var = _edje_var_list_nth(ed, id, n); 801 id += EDJE_VAR_MAGIC_BASE;
794 if (!var) return; 802 var = _edje_var_list_nth(ed, id, n);
795 _edje_var_var_float_set(ed, var, v); 803 if (!var) return;
796 } 804 _edje_var_var_float_set(ed, var, v);
805 }
797} 806}
798 807
799void 808void
@@ -805,16 +814,17 @@ _edje_var_list_float_append(Edje *ed, int id, double v)
805 if ((id < 0) || (id >= ed->var_pool->size)) return; 814 if ((id < 0) || (id >= ed->var_pool->size)) return;
806 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 815 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
807 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 816 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
808 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 817 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
809 { 818 return;
810 Edje_Var *var; 819 {
811 820 Edje_Var *var;
812 var = _edje_var_new(); 821
813 if (!var) return; 822 var = _edje_var_new();
814 id += EDJE_VAR_MAGIC_BASE; 823 if (!var) return;
815 _edje_var_var_float_set(ed, var, v); 824 id += EDJE_VAR_MAGIC_BASE;
816 _edje_var_list_var_append(ed, id, var); 825 _edje_var_var_float_set(ed, var, v);
817 } 826 _edje_var_list_var_append(ed, id, var);
827 }
818} 828}
819 829
820void 830void
@@ -826,16 +836,17 @@ _edje_var_list_float_prepend(Edje *ed, int id, double v)
826 if ((id < 0) || (id >= ed->var_pool->size)) return; 836 if ((id < 0) || (id >= ed->var_pool->size)) return;
827 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 837 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
828 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 838 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
829 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 839 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
830 { 840 return;
831 Edje_Var *var; 841 {
832 842 Edje_Var *var;
833 var = _edje_var_new(); 843
834 if (!var) return; 844 var = _edje_var_new();
835 id += EDJE_VAR_MAGIC_BASE; 845 if (!var) return;
836 _edje_var_var_float_set(ed, var, v); 846 id += EDJE_VAR_MAGIC_BASE;
837 _edje_var_list_var_prepend(ed, id, var); 847 _edje_var_var_float_set(ed, var, v);
838 } 848 _edje_var_list_var_prepend(ed, id, var);
849 }
839} 850}
840 851
841void 852void
@@ -847,20 +858,21 @@ _edje_var_list_float_insert(Edje *ed, int id, int n, double v)
847 if ((id < 0) || (id >= ed->var_pool->size)) return; 858 if ((id < 0) || (id >= ed->var_pool->size)) return;
848 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 859 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
849 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 860 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
850 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 861 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
851 { 862 return;
852 Edje_Var *var, *var_rel; 863 {
853 864 Edje_Var *var, *var_rel;
854 var = _edje_var_new(); 865
855 if (!var) return; 866 var = _edje_var_new();
856 id += EDJE_VAR_MAGIC_BASE; 867 if (!var) return;
857 _edje_var_var_float_set(ed, var, v); 868 id += EDJE_VAR_MAGIC_BASE;
858 var_rel = _edje_var_list_nth(ed, id, n); 869 _edje_var_var_float_set(ed, var, v);
859 if (!var_rel) 870 var_rel = _edje_var_list_nth(ed, id, n);
860 _edje_var_list_var_append(ed, id, var); 871 if (!var_rel)
861 else 872 _edje_var_list_var_append(ed, id, var);
862 _edje_var_list_var_prepend_relative(ed, id, var, var_rel); 873 else
863 } 874 _edje_var_list_var_prepend_relative(ed, id, var, var_rel);
875 }
864} 876}
865 877
866const char * 878const char *
@@ -872,15 +884,16 @@ _edje_var_list_nth_str_get(Edje *ed, int id, int n)
872 if ((id < 0) || (id >= ed->var_pool->size)) return NULL; 884 if ((id < 0) || (id >= ed->var_pool->size)) return NULL;
873 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 885 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
874 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 886 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
875 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return NULL; 887 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
876 { 888 return NULL;
877 Edje_Var *var; 889 {
878 890 Edje_Var *var;
879 id += EDJE_VAR_MAGIC_BASE; 891
880 var = _edje_var_list_nth(ed, id, n); 892 id += EDJE_VAR_MAGIC_BASE;
881 if (!var) return NULL; 893 var = _edje_var_list_nth(ed, id, n);
882 return _edje_var_var_str_get(ed, var); 894 if (!var) return NULL;
883 } 895 return _edje_var_var_str_get(ed, var);
896 }
884} 897}
885 898
886void 899void
@@ -892,15 +905,16 @@ _edje_var_list_nth_str_set(Edje *ed, int id, int n, const char *v)
892 if ((id < 0) || (id >= ed->var_pool->size)) return; 905 if ((id < 0) || (id >= ed->var_pool->size)) return;
893 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 906 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
894 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 907 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
895 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 908 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
896 { 909 return;
897 Edje_Var *var; 910 {
898 911 Edje_Var *var;
899 id += EDJE_VAR_MAGIC_BASE; 912
900 var = _edje_var_list_nth(ed, id, n); 913 id += EDJE_VAR_MAGIC_BASE;
901 if (!var) return; 914 var = _edje_var_list_nth(ed, id, n);
902 _edje_var_var_str_set(ed, var, v); 915 if (!var) return;
903 } 916 _edje_var_var_str_set(ed, var, v);
917 }
904} 918}
905 919
906void 920void
@@ -912,16 +926,17 @@ _edje_var_list_str_append(Edje *ed, int id, const char *v)
912 if ((id < 0) || (id >= ed->var_pool->size)) return; 926 if ((id < 0) || (id >= ed->var_pool->size)) return;
913 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 927 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
914 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 928 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
915 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 929 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
916 { 930 return;
917 Edje_Var *var; 931 {
918 932 Edje_Var *var;
919 var = _edje_var_new(); 933
920 if (!var) return; 934 var = _edje_var_new();
921 id += EDJE_VAR_MAGIC_BASE; 935 if (!var) return;
922 _edje_var_var_str_set(ed, var, v); 936 id += EDJE_VAR_MAGIC_BASE;
923 _edje_var_list_var_append(ed, id, var); 937 _edje_var_var_str_set(ed, var, v);
924 } 938 _edje_var_list_var_append(ed, id, var);
939 }
925} 940}
926 941
927void 942void
@@ -933,16 +948,17 @@ _edje_var_list_str_prepend(Edje *ed, int id, const char *v)
933 if ((id < 0) || (id >= ed->var_pool->size)) return; 948 if ((id < 0) || (id >= ed->var_pool->size)) return;
934 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 949 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
935 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 950 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
936 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 951 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
937 { 952 return;
938 Edje_Var *var; 953 {
939 954 Edje_Var *var;
940 var = _edje_var_new(); 955
941 if (!var) return; 956 var = _edje_var_new();
942 id += EDJE_VAR_MAGIC_BASE; 957 if (!var) return;
943 _edje_var_var_str_set(ed, var, v); 958 id += EDJE_VAR_MAGIC_BASE;
944 _edje_var_list_var_prepend(ed, id, var); 959 _edje_var_var_str_set(ed, var, v);
945 } 960 _edje_var_list_var_prepend(ed, id, var);
961 }
946} 962}
947 963
948void 964void
@@ -954,20 +970,21 @@ _edje_var_list_str_insert(Edje *ed, int id, int n, const char *v)
954 if ((id < 0) || (id >= ed->var_pool->size)) return; 970 if ((id < 0) || (id >= ed->var_pool->size)) return;
955 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE) 971 if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
956 ed->var_pool->vars[id].type = EDJE_VAR_LIST; 972 ed->var_pool->vars[id].type = EDJE_VAR_LIST;
957 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return; 973 else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST)
958 { 974 return;
959 Edje_Var *var, *var_rel; 975 {
960 976 Edje_Var *var, *var_rel;
961 var = _edje_var_new(); 977
962 if (!var) return; 978 var = _edje_var_new();
963 id += EDJE_VAR_MAGIC_BASE; 979 if (!var) return;
964 _edje_var_var_str_set(ed, var, v); 980 id += EDJE_VAR_MAGIC_BASE;
965 var_rel = _edje_var_list_nth(ed, id, n); 981 _edje_var_var_str_set(ed, var, v);
966 if (!var_rel) 982 var_rel = _edje_var_list_nth(ed, id, n);
967 _edje_var_list_var_append(ed, id, var); 983 if (!var_rel)
968 else 984 _edje_var_list_var_append(ed, id, var);
969 _edje_var_list_var_prepend_relative(ed, id, var, var_rel); 985 else
970 } 986 _edje_var_list_var_prepend_relative(ed, id, var, var_rel);
987 }
971} 988}
972 989
973int 990int
@@ -988,8 +1005,8 @@ _edje_var_timer_add(Edje *ed, double in, const char *fname, int val)
988 et->timer = ecore_timer_add(in, _edje_var_timer_cb, et); 1005 et->timer = ecore_timer_add(in, _edje_var_timer_cb, et);
989 if (!et->timer) 1006 if (!et->timer)
990 { 1007 {
991 free(et); 1008 free(et);
992 return 0; 1009 return 0;
993 } 1010 }
994 ed->var_pool->timers = eina_list_prepend(ed->var_pool->timers, et); 1011 ed->var_pool->timers = eina_list_prepend(ed->var_pool->timers, et);
995 return et->id; 1012 return et->id;
@@ -1082,8 +1099,8 @@ _edje_var_anim_del(Edje *ed, int id)
1082 1099
1083 if (ed->var_pool->walking_list) 1100 if (ed->var_pool->walking_list)
1084 { 1101 {
1085 ea->delete_me = 1; 1102 ea->delete_me = 1;
1086 return; 1103 return;
1087 } 1104 }
1088 1105
1089 ed->var_pool->animators = eina_list_remove(ed->var_pool->animators, ea); 1106 ed->var_pool->animators = eina_list_remove(ed->var_pool->animators, ea);
@@ -1094,10 +1111,11 @@ _edje_var_anim_del(Edje *ed, int id)
1094 _edje_anim_list = eina_list_remove(_edje_anim_list, ed); 1111 _edje_anim_list = eina_list_remove(_edje_anim_list, ed);
1095 if (!_edje_anim_list) 1112 if (!_edje_anim_list)
1096 { 1113 {
1097 if (_edje_animator) 1114 if (_edje_animator)
1098 { 1115 {
1099 ecore_animator_del(_edje_animator); 1116 ecore_animator_del(_edje_animator);
1100 _edje_animator = NULL; 1117 _edje_animator = NULL;
1101 } 1118 }
1102 } 1119 }
1103} 1120}
1121