summaryrefslogtreecommitdiff
path: root/efl/edje
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-04-15 22:20:01 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-04-15 22:20:01 +0300
commit397aabf3a4d9d680223eefc370f240ba44c6fca2 (patch)
tree020d7e8ac3375d450f38c576926dc97878fe1da8 /efl/edje
parent0ce26275feb87a48b86f8400d51cdbcd2d424892 (diff)
Code cleanup: Use line comments to disable code, not docstrings
Diffstat (limited to 'efl/edje')
-rw-r--r--efl/edje/efl.edje_edit.pyx15
-rw-r--r--efl/edje/efl.edje_edit_part_state.pxi1563
2 files changed, 788 insertions, 790 deletions
diff --git a/efl/edje/efl.edje_edit.pyx b/efl/edje/efl.edje_edit.pyx
index 0f9240e..755136d 100644
--- a/efl/edje/efl.edje_edit.pyx
+++ b/efl/edje/efl.edje_edit.pyx
@@ -351,15 +351,14 @@ cdef class EdjeEdit(Edje):
351 if isinstance(name, unicode): name = name.encode("UTF-8") 351 if isinstance(name, unicode): name = name.encode("UTF-8")
352 return bool(edje_edit_program_exist(self.obj, 352 return bool(edje_edit_program_exist(self.obj,
353 <const char *>name if name is not None else NULL)) 353 <const char *>name if name is not None else NULL))
354 """
355 property error:
356 def __get__(self):
357 last_error = c_evas.eina_error_get()
358 if last_error:
359 return c_evas.eina_error_msg_get(last_error)
360 354
361 return None 355 # property error:
362 """ 356 # def __get__(self):
357 # last_error = c_evas.eina_error_get()
358 # if last_error:
359 # return c_evas.eina_error_msg_get(last_error)
360 #
361 # return None
363 362
364 # Scripts 363 # Scripts
365 property script: 364 property script:
diff --git a/efl/edje/efl.edje_edit_part_state.pxi b/efl/edje/efl.edje_edit_part_state.pxi
index 74ea00b..671f8a3 100644
--- a/efl/edje/efl.edje_edit_part_state.pxi
+++ b/efl/edje/efl.edje_edit_part_state.pxi
@@ -57,12 +57,12 @@ cdef class State:
57 return False 57 return False
58 eina_stringshare_replace(&self.name, <const char *>new_name) 58 eina_stringshare_replace(&self.name, <const char *>new_name)
59 return True 59 return True
60 """ 60
61 def copy_from(self, from_state, from_value=0.0): 61 # def copy_from(self, from_state, from_value=0.0):
62 return bool(edje_edit_state_copy(self.edje.obj, self.part, 62 # return bool(edje_edit_state_copy(self.edje.obj, self.part,
63 from_state, from_value, self.name, 63 # from_state, from_value, self.name,
64 self.value)) 64 # self.value))
65 """ 65
66 def rel1_to_get(self): 66 def rel1_to_get(self):
67 cdef: 67 cdef:
68 const char *tx 68 const char *tx
@@ -85,780 +85,779 @@ cdef class State:
85 y = None 85 y = None
86 86
87 return (x, y) 87 return (x, y)
88 """
89 def rel1_to_set(self, x, y):
90 if x:
91 edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
92 self.value, x)
93 else:
94 edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
95 self.value, NULL)
96 if y:
97 edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
98 self.value, y)
99 else:
100 edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
101 self.value, NULL)
102 # remove when fixed in edje_edit
103 edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
104 self.value)
105
106 property rel1_to:
107 def __get__(self):
108 return self.rel1_to_get()
109 def __set__(self, rel1_to):
110 self.rel1_to_set(*rel1_to)
111
112 def rel1_to_x_set(self, x):
113 if x:
114 edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
115 self.value, x)
116 else:
117 edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
118 self.value, NULL)
119 # remove when fixed in edje_edit
120 edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
121 self.value)
122
123 def rel1_to_y_set(self, y):
124 if y:
125 edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
126 self.value, y)
127 else:
128 edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
129 self.value, NULL)
130 # remove when fixed in edje_edit
131 edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
132 self.value)
133
134 def rel1_relative_get(self):
135 cdef double x, y
136 x = edje_edit_state_rel1_relative_x_get(self.edje.obj, self.part,
137 self.name, self.value)
138 y = edje_edit_state_rel1_relative_y_get(self.edje.obj, self.part,
139 self.name, self.value)
140 return (x, y)
141
142 def rel1_relative_set(self, double x, double y):
143 edje_edit_state_rel1_relative_x_set(self.edje.obj, self.part, self.name,
144 self.value, x)
145 edje_edit_state_rel1_relative_y_set(self.edje.obj, self.part, self.name,
146 self.value, y)
147
148 property rel1_relative:
149 def __get__(self):
150 return self.rel1_relative_get()
151 def __set__(self, value):
152 self.rel1_relative_set(*value)
153
154 def rel1_relative_x_set(self, double x):
155 edje_edit_state_rel1_relative_x_set(self.edje.obj, self.part, self.name,
156 self.value, x)
157
158 def rel1_relative_y_set(self, double y):
159 edje_edit_state_rel1_relative_y_set(self.edje.obj, self.part, self.name,
160 self.value, y)
161
162 def rel1_offset_get(self):
163 cdef int x, y
164 x = edje_edit_state_rel1_offset_x_get(self.edje.obj, self.part,
165 self.name, self.value)
166 y = edje_edit_state_rel1_offset_y_get(self.edje.obj, self.part,
167 self.name, self.value)
168 return (x, y)
169
170 def rel1_offset_set(self, int x, int y):
171 edje_edit_state_rel1_offset_x_set(self.edje.obj, self.part, self.name,
172 self.value, x)
173 edje_edit_state_rel1_offset_y_set(self.edje.obj, self.part, self.name,
174 self.value, y)
175
176 property rel1_offset:
177 def __get__(self):
178 return self.rel1_offset_get()
179 def __set__(self, value):
180 self.rel1_offset_set(*value)
181
182 def rel1_offset_x_set(self, int x):
183 edje_edit_state_rel1_offset_x_set(self.edje.obj, self.part, self.name,
184 self.value, x)
185
186 def rel1_offset_y_set(self, int y):
187 edje_edit_state_rel1_offset_y_set(self.edje.obj, self.part, self.name,
188 self.value, y)
189
190 def rel2_to_get(self):
191 cdef const char_ptr tx, ty
192 tx = edje_edit_state_rel2_to_x_get(self.edje.obj, self.part, self.name,
193 self.value)
194 ty = edje_edit_state_rel2_to_y_get(self.edje.obj, self.part, self.name,
195 self.value)
196 if tx != NULL:
197 x = tx
198 edje_edit_string_free(tx)
199 else:
200 x = None
201
202 if ty != NULL:
203 y = ty
204 edje_edit_string_free(ty)
205 else:
206 y = None
207
208 return (x, y)
209
210 def rel2_to_set(self, x, y):
211 if x:
212 edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
213 self.value, x)
214 else:
215 edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
216 self.value, NULL)
217 if y:
218 edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
219 self.value, y)
220 else:
221 edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
222 self.value, NULL)
223 # remove when fixed in edje_edit
224 edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
225 self.value)
226
227 property rel2_to:
228 def __get__(self):
229 return self.rel2_to_get()
230 def __set__(self, rel2_to):
231 self.rel2_to_set(*rel2_to)
232
233 def rel2_to_x_set(self, x):
234 if x:
235 edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
236 self.value, x)
237 else:
238 edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
239 self.value, NULL)
240 # remove when fixed in edje_edit
241 edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
242 self.value)
243 def rel2_to_y_set(self, y):
244 if y:
245 edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
246 self.value, y)
247 else:
248 edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
249 self.value, NULL)
250 # remove when fixed in edje_edit
251 edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
252 self.value)
253
254 def rel2_relative_get(self):
255 cdef double x, y
256 x = edje_edit_state_rel2_relative_x_get(self.edje.obj, self.part,
257 self.name, self.value)
258 y = edje_edit_state_rel2_relative_y_get(self.edje.obj, self.part,
259 self.name, self.value)
260 return (x, y)
261
262 def rel2_relative_set(self, double x, double y):
263 edje_edit_state_rel2_relative_x_set(self.edje.obj, self.part, self.name,
264 self.value, x)
265 edje_edit_state_rel2_relative_y_set(self.edje.obj, self.part, self.name,
266 self.value, y)
267
268 property rel2_relative:
269 def __get__(self):
270 return self.rel2_relative_get()
271 def __set__(self, value):
272 self.rel2_relative_set(*value)
273
274 def rel2_relative_x_set(self, double x):
275 edje_edit_state_rel2_relative_x_set(self.edje.obj, self.part, self.name,
276 self.value, x)
277 def rel2_relative_y_set(self, double y):
278 edje_edit_state_rel2_relative_y_set(self.edje.obj, self.part, self.name,
279 self.value, y)
280
281 def rel2_offset_get(self):
282 cdef int x, y
283 x = edje_edit_state_rel2_offset_x_get(self.edje.obj, self.part,
284 self.name, self.value)
285 y = edje_edit_state_rel2_offset_y_get(self.edje.obj, self.part,
286 self.name, self.value)
287 return (x, y)
288
289 def rel2_offset_set(self, int x, int y):
290 edje_edit_state_rel2_offset_x_set(self.edje.obj, self.part, self.name,
291 self.value, x)
292 edje_edit_state_rel2_offset_y_set(self.edje.obj, self.part, self.name,
293 self.value, y)
294
295 property rel2_offset:
296 def __get__(self):
297 return self.rel2_offset_get()
298 def __set__(self, value):
299 self.rel2_offset_set(*value)
300
301 def rel2_offset_x_set(self, int x):
302 edje_edit_state_rel2_offset_x_set(self.edje.obj, self.part, self.name,
303 self.value, x)
304 def rel2_offset_y_set(self, int y):
305 edje_edit_state_rel2_offset_y_set(self.edje.obj, self.part, self.name,
306 self.value, y)
307
308 def color_get(self):
309 cdef int r, g, b, a
310 edje_edit_state_color_get(self.edje.obj, self.part, self.name,
311 self.value, &r, &g, &b, &a)
312 return (r, g, b, a)
313
314 def color_set(self, int r, int g, int b, int a):
315 edje_edit_state_color_set(self.edje.obj, self.part, self.name,
316 self.value, r, g, b, a)
317
318 property color:
319 def __get__(self):
320 return self.color_get()
321 def __set__(self, color):
322 self.color_set(*color)
323
324 def color2_get(self):
325 cdef int r, g, b, a
326 edje_edit_state_color2_get(self.edje.obj, self.part, self.name,
327 self.value, &r, &g, &b, &a)
328 return (r, g, b, a)
329
330 def color2_set(self, int r, int g, int b, int a):
331 edje_edit_state_color2_set(self.edje.obj, self.part, self.name,
332 self.value, r, g, b, a)
333
334 property color2:
335 def __get__(self):
336 return self.color2_get()
337 def __set__(self, color):
338 self.color2_set(*color)
339
340 def color3_get(self):
341 cdef int r, g, b, a
342 edje_edit_state_color3_get(self.edje.obj, self.part, self.name,
343 self.value, &r, &g, &b, &a)
344 return (r, g, b, a)
345
346 def color3_set(self, int r, int g, int b, int a):
347 edje_edit_state_color3_set(self.edje.obj, self.part, self.name,
348 self.value, r, g, b, a)
349
350 property color3:
351 def __get__(self):
352 return self.color3_get()
353 def __set__(self, color):
354 self.color3_set(*color)
355
356 def align_get(self):
357 cdef double x, y
358 x = edje_edit_state_align_x_get(self.edje.obj, self.part, self.name,
359 self.value)
360 y = edje_edit_state_align_y_get(self.edje.obj, self.part, self.name,
361 self.value)
362 return (x, y)
363
364 def align_set(self, double x, double y):
365 edje_edit_state_align_x_set(self.edje.obj, self.part, self.name,
366 self.value, x)
367 edje_edit_state_align_y_set(self.edje.obj, self.part, self.name,
368 self.value, y)
369
370 property align:
371 def __get__(self):
372 return self.align_get()
373 def __set__(self, align):
374 self.align_set(*align)
375
376 def min_get(self):
377 cdef int w, h
378 w = edje_edit_state_min_w_get(self.edje.obj, self.part, self.name,
379 self.value)
380 h = edje_edit_state_min_h_get(self.edje.obj, self.part, self.name,
381 self.value)
382 return (w, h)
383
384 def min_set(self, int w, int h):
385 edje_edit_state_min_w_set(self.edje.obj, self.part, self.name,
386 self.value, w)
387 edje_edit_state_min_h_set(self.edje.obj, self.part, self.name,
388 self.value, h)
389
390 property min:
391 def __get__(self):
392 return self.min_get()
393 def __set__(self, min):
394 self.min_set(*min)
395
396 def max_get(self):
397 cdef int w, h
398 w = edje_edit_state_max_w_get(self.edje.obj, self.part, self.name,
399 self.value)
400 h = edje_edit_state_max_h_get(self.edje.obj, self.part, self.name,
401 self.value)
402 return (w, h)
403
404 def max_set(self, int w, int h):
405 edje_edit_state_max_w_set(self.edje.obj, self.part, self.name,
406 self.value, w)
407 edje_edit_state_max_h_set(self.edje.obj, self.part, self.name,
408 self.value, h)
409
410 property max:
411 def __get__(self):
412 return self.max_get()
413 def __set__(self, max):
414 self.max_set(*max)
415
416 def aspect_min_get(self):
417 return edje_edit_state_aspect_min_get(self.edje.obj, self.part,
418 self.name, self.value)
419
420 def aspect_min_set(self, double a):
421 edje_edit_state_aspect_min_set(self.edje.obj, self.part, self.name,
422 self.value, a)
423
424 def aspect_max_get(self):
425 return edje_edit_state_aspect_max_get(self.edje.obj, self.part,
426 self.name, self.value)
427
428 def aspect_max_set(self, double a):
429 edje_edit_state_aspect_max_set(self.edje.obj, self.part, self.name,
430 self.value, a)
431
432 def aspect_pref_get(self):
433 return edje_edit_state_aspect_pref_get(self.edje.obj, self.part,
434 self.name, self.value)
435
436 def aspect_pref_set(self, char a):
437 edje_edit_state_aspect_pref_set(self.edje.obj, self.part, self.name,
438 self.value, a)
439
440 def fill_origin_relative_get(self):
441 cdef double x, y
442 x = edje_edit_state_fill_origin_relative_x_get(self.edje.obj, self.part,
443 self.name, self.value)
444 y = edje_edit_state_fill_origin_relative_y_get(self.edje.obj, self.part,
445 self.name, self.value)
446 return (x, y)
447
448 def fill_origin_relative_set(self, double x, double y):
449 edje_edit_state_fill_origin_relative_x_set(self.edje.obj, self.part,
450 self.name, self.value, x)
451 edje_edit_state_fill_origin_relative_y_set(self.edje.obj, self.part,
452 self.name, self.value, y)
453
454 def fill_origin_offset_get(self):
455 cdef int x, y
456 x = edje_edit_state_fill_origin_offset_x_get(self.edje.obj, self.part,
457 self.name, self.value)
458 y = edje_edit_state_fill_origin_offset_y_get(self.edje.obj, self.part,
459 self.name, self.value)
460 return (x, y)
461
462 def fill_origin_offset_set(self, x, y):
463 edje_edit_state_fill_origin_offset_x_set(self.edje.obj, self.part,
464 self.name, self.value, x)
465 edje_edit_state_fill_origin_offset_y_set(self.edje.obj, self.part,
466 self.name, self.value, y)
467
468 def fill_size_relative_get(self):
469 cdef double x, y
470 x = edje_edit_state_fill_size_relative_x_get(self.edje.obj, self.part,
471 self.name, self.value)
472 y = edje_edit_state_fill_size_relative_y_get(self.edje.obj, self.part,
473 self.name, self.value)
474 return (x, y)
475
476 def fill_size_relative_set(self, double x, double y):
477 edje_edit_state_fill_size_relative_x_set(self.edje.obj, self.part,
478 self.name, self.value, x)
479 edje_edit_state_fill_size_relative_y_set(self.edje.obj, self.part,
480 self.name, self.value, y)
481
482 def fill_size_offset_get(self):
483 cdef int x, y
484 x = edje_edit_state_fill_size_offset_x_get(self.edje.obj, self.part,
485 self.name, self.value)
486 y = edje_edit_state_fill_size_offset_y_get(self.edje.obj, self.part,
487 self.name, self.value)
488 return (x, y)
489
490 def fill_size_offset_set(self, x, y):
491 edje_edit_state_fill_size_offset_x_set(self.edje.obj, self.part,
492 self.name, self.value, x)
493 edje_edit_state_fill_size_offset_y_set(self.edje.obj, self.part,
494 self.name, self.value, y)
495
496 property visible:
497 def __get__(self):
498 return bool(edje_edit_state_visible_get(self.edje.obj, self.part,
499 self.name, self.value))
500 def __set__(self, v):
501 if v:
502 edje_edit_state_visible_set(self.edje.obj, self.part, self.name,
503 self.value, 1)
504 else:
505 edje_edit_state_visible_set(self.edje.obj, self.part, self.name, self.value, 0)
506
507 def color_class_get(self):
508 cdef const char_ptr cc
509 cc = edje_edit_state_color_class_get(self.edje.obj, self.part,
510 self.name, self.value)
511 if cc == NULL:
512 return None
513 rcc = cc
514 edje_edit_string_free(cc)
515 return rcc
516
517 def color_class_set(self, cc):
518 if not cc:
519 edje_edit_state_color_class_set(self.edje.obj, self.part,
520 self.name, self.value, NULL)
521 else:
522 edje_edit_state_color_class_set(self.edje.obj, self.part,
523 self.name, self.value, cc)
524
525 def external_params_get(self):
526 cdef evas.c_evas.const Eina_List *lst
527 ret = []
528 lst = edje_edit_state_external_params_list_get(self.edje.obj, self.part,
529 self.name, self.value)
530 while lst:
531 p = c_edje._ExternalParam_from_ptr(<uintptr_t>lst.data)
532 if p is not None:
533 ret.append(p)
534 lst = lst.next
535 return ret
536
537 def external_param_get(self, param):
538 cdef c_edje.Edje_External_Param_Type type
539 cdef void *value
540 cdef const char_ptr s
541
542 if not edje_edit_state_external_param_get(self.edje.obj, self.part,
543 self.name, self.value, param,
544 &type, &value):
545 return None
546 if type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_BOOL:
547 b = (<evas.c_evas.Eina_Bool *>value)[0]
548 return (type, bool(b))
549 elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_INT:
550 i = (<int *>value)[0]
551 return (type, i)
552 elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
553 d = (<double *>value)[0]
554 return (type, d)
555 elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_STRING:
556 s = <char *>value
557 if s == NULL:
558 return (type, None)
559 else:
560 return (type, s)
561 elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
562 s = <char *>value
563 if s == NULL:
564 return (type, None)
565 else:
566 return (type, s)
567 return None
568
569 def external_param_set(self, param, value):
570 cdef const char_ptr expected
571
572 if isinstance(value, bool):
573 return self.external_param_bool_set(param, value)
574 elif isinstance(value, (long, int)):
575 return self.external_param_int_set(param, value)
576 elif isinstance(value, float):
577 return self.external_param_double_set(param, value)
578 elif isinstance(value, str):
579 t = edje_object_part_external_param_type_get(
580 self.edje.obj, self.part, param)
581 if t == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_STRING:
582 return self.external_param_string_set(param, value)
583 elif t == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
584 return self.external_param_choice_set(param, value)
585
586 t = edje_object_part_external_param_type_get(
587 self.edje.obj, self.part, param)
588 if t >= edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_MAX:
589 raise TypeError("no external parameter %s" % (param,))
590 else:
591 expected = edje_external_param_type_str(t)
592 raise TypeError(
593 "invalid external parameter %s of (%s), expected %s" %
594 (param, type(value).__name__, expected))
595
596 def external_param_int_get(self, param):
597 cdef int value
598
599 if not edje_edit_state_external_param_int_get(self.edje.obj, self.part,
600 self.name, self.value,
601 param, &value):
602 return None
603 return value
604
605 def external_param_bool_get(self, param):
606 cdef evas.c_evas.Eina_Bool value
607
608 if not edje_edit_state_external_param_bool_get(
609 self.edje.obj, self.part, self.name, self.value, param, &value):
610 return None
611 return bool(value)
612
613 def external_param_double_get(self, param):
614 cdef double value
615
616 if not edje_edit_state_external_param_double_get(self.edje.obj, self.part,
617 self.name, self.value,
618 param, &value):
619 return None
620 return value
621
622 def external_param_string_get(self, param):
623 cdef const char_ptr value
624
625 if not edje_edit_state_external_param_string_get(
626 self.edje.obj, self.part, self.name, self.value, param, &value):
627 return None
628 if value != NULL:
629 return value
630
631 def external_param_choice_get(self, param):
632 cdef const char_ptr value
633
634 if not edje_edit_state_external_param_choice_get(
635 self.edje.obj, self.part, self.name, self.value, param, &value):
636 return None
637 if value != NULL:
638 return value
639
640 def external_param_int_set(self, param, value):
641 return bool(edje_edit_state_external_param_int_set(self.edje.obj,
642 self.part, self.name,
643 self.value, param,
644 value))
645
646 def external_param_bool_set(self, param, value):
647 return bool(edje_edit_state_external_param_bool_set(
648 self.edje.obj, self.part, self.name, self.value, param, value))
649
650 def external_param_double_set(self, param, value):
651 return bool(edje_edit_state_external_param_double_set(self.edje.obj,
652 self.part, self.name,
653 self.value,param,
654 value))
655
656 def external_param_string_set(self, param, value):
657 return bool(edje_edit_state_external_param_string_set(self.edje.obj,
658 self.part, self.name,
659 self.value, param,
660 value))
661
662 def external_param_choice_set(self, param, value):
663 return bool(edje_edit_state_external_param_choice_set(
664 self.edje.obj, self.part, self.name, self.value, param, value))
665
666 def text_get(self):
667 cdef const char_ptr t
668 t = edje_edit_state_text_get(self.edje.obj, self.part, self.name,
669 self.value)
670 if t == NULL:
671 return None
672 r = t
673 edje_edit_string_free(t)
674 return r
675
676 def text_set(self, t):
677 edje_edit_state_text_set(self.edje.obj, self.part, self.name,
678 self.value, t)
679
680 property text:
681 def __get__(self):
682 return self.text_get()
683 def __set__(self, text):
684 self.text_set(text)
685
686 def font_get(self):
687 cdef const char_ptr f
688 f = edje_edit_state_font_get(self.edje.obj, self.part, self.name,
689 self.value)
690 if f == NULL:
691 return None
692 r = f
693 edje_edit_string_free(f)
694 return r
695
696 def font_set(self, char *f):
697 edje_edit_state_font_set(self.edje.obj, self.part, self.name,
698 self.value, f)
699
700 property font:
701 def __get__(self):
702 return self.font_get()
703 def __set__(self, font):
704 self.font_set(font)
705
706 def text_size_get(self):
707 return edje_edit_state_text_size_get(self.edje.obj, self.part,
708 self.name, self.value)
709
710 def text_size_set(self, int s):
711 edje_edit_state_text_size_set(self.edje.obj, self.part, self.name,
712 self.value, s)
713
714 property text_size:
715 def __get__(self):
716 return self.text_size_get()
717 def __set__(self, value):
718 self.text_size_set(value)
719
720 def text_align_get(self):
721 cdef double x, y
722 x = edje_edit_state_text_align_x_get(self.edje.obj, self.part,
723 self.name, self.value)
724 y = edje_edit_state_text_align_y_get(self.edje.obj, self.part,
725 self.name, self.value)
726 return (x, y)
727
728 def text_align_set(self, double x, double y):
729 edje_edit_state_text_align_x_set(self.edje.obj, self.part, self.name,
730 self.value, x)
731 edje_edit_state_text_align_y_set(self.edje.obj, self.part, self.name,
732 self.value, y)
733
734 property text_align:
735 def __get__(self):
736 return self.text_align_get()
737 def __set__(self, align):
738 self.text_align_set(*align)
739
740 # FIXME: These should be ellipsis, not elipsis. Was this API ever released?
741 def text_elipsis_get(self):
742 return edje_edit_state_text_elipsis_get(self.edje.obj, self.part,
743 self.name, self.value)
744
745 def text_elipsis_set(self, double e):
746 edje_edit_state_text_elipsis_set(self.edje.obj, self.part, self.name,
747 self.value, e)
748
749 property text_elipsis:
750 def __get__(self):
751 return self.text_elipsis_get()
752 def __set__(self, value):
753 self.text_elipsis_set(value)
754
755 def text_fit_get(self):
756 x = bool(edje_edit_state_text_fit_x_get(self.edje.obj, self.part,
757 self.name, self.value))
758 y = bool(edje_edit_state_text_fit_y_get(self.edje.obj, self.part,
759 self.name, self.value))
760 return (x, y)
761
762 def text_fit_set(self, x, y):
763 if x:
764 edje_edit_state_text_fit_x_set(self.edje.obj, self.part, self.name,
765 self.value, 1)
766 else:
767 edje_edit_state_text_fit_x_set(self.edje.obj, self.part, self.name,
768 self.value, 0)
769 if y:
770 edje_edit_state_text_fit_y_set(self.edje.obj, self.part, self.name,
771 self.value, 1)
772 else:
773 edje_edit_state_text_fit_y_set(self.edje.obj, self.part, self.name,
774 self.value, 0)
775
776 property text_fit:
777 def __get__(self):
778 return self.text_fit_get()
779 def __set__(self, value):
780 self.text_fit_set(*value)
781
782 def image_get(self):
783 cdef const char_ptr img
784 img = edje_edit_state_image_get(self.edje.obj, self.part, self.name,
785 self.value)
786 if img == NULL:
787 return None
788 r = img
789 edje_edit_string_free(img)
790 return r
791
792 def image_set(self, char *image):
793 if not image:
794 return
795
796 edje_edit_state_image_set(self.edje.obj, self.part, self.name,
797 self.value, image)
798
799 property image:
800 def __get__(self):
801 return self.image_get()
802 def __set__(self, image):
803 self.image_set(image)
804
805 def image_border_get(self):
806 cdef int l, r, t, b
807 edje_edit_state_image_border_get(self.edje.obj, self.part, self.name,
808 self.value, &l, &r, &t, &b)
809 return (l, r, t, b)
810
811 def image_border_set(self, int l, int r, int t, int b):
812 edje_edit_state_image_border_set(self.edje.obj, self.part, self.name,
813 self.value, l, r, t, b)
814
815 property image_border:
816 def __get__(self):
817 return self.image_border_get()
818 def __set__(self, value):
819 self.image_border_set(*value)
820
821 def image_border_fill_get(self):
822 cdef unsigned char r
823 r = edje_edit_state_image_border_fill_get(self.edje.obj, self.part,
824 self.name, self.value)
825 if r == 0:
826 return False
827 return True
828
829 def image_border_fill_set(self, fill):
830 if fill:
831 edje_edit_state_image_border_fill_set(self.edje.obj, self.part,
832 self.name, self.value, 1)
833 else:
834 edje_edit_state_image_border_fill_set(self.edje.obj, self.part,
835 self.name, self.value, 0)
836
837 property image_border_fill:
838 def __get__(self):
839 return self.image_border_fill_get()
840 def __set__(self, value):
841 self.image_border_fill_set(value)
842
843 property tweens:
844 def __get__(self):
845 "@rtype: list of str"
846 cdef evas.c_evas.Eina_List *lst, *itr
847 ret = []
848 lst = edje_edit_state_tweens_list_get(self.edje.obj, self.part,
849 self.name, self.value)
850 itr = lst
851 while itr:
852 ret.append(<char*>itr.data)
853 itr = itr.next
854 edje_edit_string_list_free(lst)
855 return ret
856
857 def tween_add(self, char *img):
858 return bool(edje_edit_state_tween_add(self.edje.obj, self.part,
859 self.name, self.value, img))
860 88
861 def tween_del(self, char *img): 89 # def rel1_to_set(self, x, y):
862 return bool(edje_edit_state_tween_del(self.edje.obj, self.part, 90 # if x:
863 self.name, self.value, img)) 91 # edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
864 """ 92 # self.value, x)
93 # else:
94 # edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
95 # self.value, NULL)
96 # if y:
97 # edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
98 # self.value, y)
99 # else:
100 # edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
101 # self.value, NULL)
102 # # remove when fixed in edje_edit
103 # edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
104 # self.value)
105 #
106 # property rel1_to:
107 # def __get__(self):
108 # return self.rel1_to_get()
109 # def __set__(self, rel1_to):
110 # self.rel1_to_set(*rel1_to)
111 #
112 # def rel1_to_x_set(self, x):
113 # if x:
114 # edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
115 # self.value, x)
116 # else:
117 # edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
118 # self.value, NULL)
119 # # remove when fixed in edje_edit
120 # edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
121 # self.value)
122 #
123 # def rel1_to_y_set(self, y):
124 # if y:
125 # edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
126 # self.value, y)
127 # else:
128 # edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
129 # self.value, NULL)
130 # # remove when fixed in edje_edit
131 # edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
132 # self.value)
133 #
134 # def rel1_relative_get(self):
135 # cdef double x, y
136 # x = edje_edit_state_rel1_relative_x_get(self.edje.obj, self.part,
137 # self.name, self.value)
138 # y = edje_edit_state_rel1_relative_y_get(self.edje.obj, self.part,
139 # self.name, self.value)
140 # return (x, y)
141 #
142 # def rel1_relative_set(self, double x, double y):
143 # edje_edit_state_rel1_relative_x_set(self.edje.obj, self.part, self.name,
144 # self.value, x)
145 # edje_edit_state_rel1_relative_y_set(self.edje.obj, self.part, self.name,
146 # self.value, y)
147 #
148 # property rel1_relative:
149 # def __get__(self):
150 # return self.rel1_relative_get()
151 # def __set__(self, value):
152 # self.rel1_relative_set(*value)
153 #
154 # def rel1_relative_x_set(self, double x):
155 # edje_edit_state_rel1_relative_x_set(self.edje.obj, self.part, self.name,
156 # self.value, x)
157 #
158 # def rel1_relative_y_set(self, double y):
159 # edje_edit_state_rel1_relative_y_set(self.edje.obj, self.part, self.name,
160 # self.value, y)
161 #
162 # def rel1_offset_get(self):
163 # cdef int x, y
164 # x = edje_edit_state_rel1_offset_x_get(self.edje.obj, self.part,
165 # self.name, self.value)
166 # y = edje_edit_state_rel1_offset_y_get(self.edje.obj, self.part,
167 # self.name, self.value)
168 # return (x, y)
169 #
170 # def rel1_offset_set(self, int x, int y):
171 # edje_edit_state_rel1_offset_x_set(self.edje.obj, self.part, self.name,
172 # self.value, x)
173 # edje_edit_state_rel1_offset_y_set(self.edje.obj, self.part, self.name,
174 # self.value, y)
175 #
176 # property rel1_offset:
177 # def __get__(self):
178 # return self.rel1_offset_get()
179 # def __set__(self, value):
180 # self.rel1_offset_set(*value)
181 #
182 # def rel1_offset_x_set(self, int x):
183 # edje_edit_state_rel1_offset_x_set(self.edje.obj, self.part, self.name,
184 # self.value, x)
185 #
186 # def rel1_offset_y_set(self, int y):
187 # edje_edit_state_rel1_offset_y_set(self.edje.obj, self.part, self.name,
188 # self.value, y)
189 #
190 # def rel2_to_get(self):
191 # cdef const char_ptr tx, ty
192 # tx = edje_edit_state_rel2_to_x_get(self.edje.obj, self.part, self.name,
193 # self.value)
194 # ty = edje_edit_state_rel2_to_y_get(self.edje.obj, self.part, self.name,
195 # self.value)
196 # if tx != NULL:
197 # x = tx
198 # edje_edit_string_free(tx)
199 # else:
200 # x = None
201 #
202 # if ty != NULL:
203 # y = ty
204 # edje_edit_string_free(ty)
205 # else:
206 # y = None
207 #
208 # return (x, y)
209 #
210 # def rel2_to_set(self, x, y):
211 # if x:
212 # edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
213 # self.value, x)
214 # else:
215 # edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
216 # self.value, NULL)
217 # if y:
218 # edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
219 # self.value, y)
220 # else:
221 # edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
222 # self.value, NULL)
223 # # remove when fixed in edje_edit
224 # edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
225 # self.value)
226 #
227 # property rel2_to:
228 # def __get__(self):
229 # return self.rel2_to_get()
230 # def __set__(self, rel2_to):
231 # self.rel2_to_set(*rel2_to)
232 #
233 # def rel2_to_x_set(self, x):
234 # if x:
235 # edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
236 # self.value, x)
237 # else:
238 # edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
239 # self.value, NULL)
240 # # remove when fixed in edje_edit
241 # edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
242 # self.value)
243 # def rel2_to_y_set(self, y):
244 # if y:
245 # edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
246 # self.value, y)
247 # else:
248 # edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
249 # self.value, NULL)
250 # # remove when fixed in edje_edit
251 # edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
252 # self.value)
253 #
254 # def rel2_relative_get(self):
255 # cdef double x, y
256 # x = edje_edit_state_rel2_relative_x_get(self.edje.obj, self.part,
257 # self.name, self.value)
258 # y = edje_edit_state_rel2_relative_y_get(self.edje.obj, self.part,
259 # self.name, self.value)
260 # return (x, y)
261 #
262 # def rel2_relative_set(self, double x, double y):
263 # edje_edit_state_rel2_relative_x_set(self.edje.obj, self.part, self.name,
264 # self.value, x)
265 # edje_edit_state_rel2_relative_y_set(self.edje.obj, self.part, self.name,
266 # self.value, y)
267 #
268 # property rel2_relative:
269 # def __get__(self):
270 # return self.rel2_relative_get()
271 # def __set__(self, value):
272 # self.rel2_relative_set(*value)
273 #
274 # def rel2_relative_x_set(self, double x):
275 # edje_edit_state_rel2_relative_x_set(self.edje.obj, self.part, self.name,
276 # self.value, x)
277 # def rel2_relative_y_set(self, double y):
278 # edje_edit_state_rel2_relative_y_set(self.edje.obj, self.part, self.name,
279 # self.value, y)
280 #
281 # def rel2_offset_get(self):
282 # cdef int x, y
283 # x = edje_edit_state_rel2_offset_x_get(self.edje.obj, self.part,
284 # self.name, self.value)
285 # y = edje_edit_state_rel2_offset_y_get(self.edje.obj, self.part,
286 # self.name, self.value)
287 # return (x, y)
288 #
289 # def rel2_offset_set(self, int x, int y):
290 # edje_edit_state_rel2_offset_x_set(self.edje.obj, self.part, self.name,
291 # self.value, x)
292 # edje_edit_state_rel2_offset_y_set(self.edje.obj, self.part, self.name,
293 # self.value, y)
294 #
295 # property rel2_offset:
296 # def __get__(self):
297 # return self.rel2_offset_get()
298 # def __set__(self, value):
299 # self.rel2_offset_set(*value)
300 #
301 # def rel2_offset_x_set(self, int x):
302 # edje_edit_state_rel2_offset_x_set(self.edje.obj, self.part, self.name,
303 # self.value, x)
304 # def rel2_offset_y_set(self, int y):
305 # edje_edit_state_rel2_offset_y_set(self.edje.obj, self.part, self.name,
306 # self.value, y)
307 #
308 # def color_get(self):
309 # cdef int r, g, b, a
310 # edje_edit_state_color_get(self.edje.obj, self.part, self.name,
311 # self.value, &r, &g, &b, &a)
312 # return (r, g, b, a)
313 #
314 # def color_set(self, int r, int g, int b, int a):
315 # edje_edit_state_color_set(self.edje.obj, self.part, self.name,
316 # self.value, r, g, b, a)
317 #
318 # property color:
319 # def __get__(self):
320 # return self.color_get()
321 # def __set__(self, color):
322 # self.color_set(*color)
323 #
324 # def color2_get(self):
325 # cdef int r, g, b, a
326 # edje_edit_state_color2_get(self.edje.obj, self.part, self.name,
327 # self.value, &r, &g, &b, &a)
328 # return (r, g, b, a)
329 #
330 # def color2_set(self, int r, int g, int b, int a):
331 # edje_edit_state_color2_set(self.edje.obj, self.part, self.name,
332 # self.value, r, g, b, a)
333 #
334 # property color2:
335 # def __get__(self):
336 # return self.color2_get()
337 # def __set__(self, color):
338 # self.color2_set(*color)
339 #
340 # def color3_get(self):
341 # cdef int r, g, b, a
342 # edje_edit_state_color3_get(self.edje.obj, self.part, self.name,
343 # self.value, &r, &g, &b, &a)
344 # return (r, g, b, a)
345 #
346 # def color3_set(self, int r, int g, int b, int a):
347 # edje_edit_state_color3_set(self.edje.obj, self.part, self.name,
348 # self.value, r, g, b, a)
349 #
350 # property color3:
351 # def __get__(self):
352 # return self.color3_get()
353 # def __set__(self, color):
354 # self.color3_set(*color)
355 #
356 # def align_get(self):
357 # cdef double x, y
358 # x = edje_edit_state_align_x_get(self.edje.obj, self.part, self.name,
359 # self.value)
360 # y = edje_edit_state_align_y_get(self.edje.obj, self.part, self.name,
361 # self.value)
362 # return (x, y)
363 #
364 # def align_set(self, double x, double y):
365 # edje_edit_state_align_x_set(self.edje.obj, self.part, self.name,
366 # self.value, x)
367 # edje_edit_state_align_y_set(self.edje.obj, self.part, self.name,
368 # self.value, y)
369 #
370 # property align:
371 # def __get__(self):
372 # return self.align_get()
373 # def __set__(self, align):
374 # self.align_set(*align)
375 #
376 # def min_get(self):
377 # cdef int w, h
378 # w = edje_edit_state_min_w_get(self.edje.obj, self.part, self.name,
379 # self.value)
380 # h = edje_edit_state_min_h_get(self.edje.obj, self.part, self.name,
381 # self.value)
382 # return (w, h)
383 #
384 # def min_set(self, int w, int h):
385 # edje_edit_state_min_w_set(self.edje.obj, self.part, self.name,
386 # self.value, w)
387 # edje_edit_state_min_h_set(self.edje.obj, self.part, self.name,
388 # self.value, h)
389 #
390 # property min:
391 # def __get__(self):
392 # return self.min_get()
393 # def __set__(self, min):
394 # self.min_set(*min)
395 #
396 # def max_get(self):
397 # cdef int w, h
398 # w = edje_edit_state_max_w_get(self.edje.obj, self.part, self.name,
399 # self.value)
400 # h = edje_edit_state_max_h_get(self.edje.obj, self.part, self.name,
401 # self.value)
402 # return (w, h)
403 #
404 # def max_set(self, int w, int h):
405 # edje_edit_state_max_w_set(self.edje.obj, self.part, self.name,
406 # self.value, w)
407 # edje_edit_state_max_h_set(self.edje.obj, self.part, self.name,
408 # self.value, h)
409 #
410 # property max:
411 # def __get__(self):
412 # return self.max_get()
413 # def __set__(self, max):
414 # self.max_set(*max)
415 #
416 # def aspect_min_get(self):
417 # return edje_edit_state_aspect_min_get(self.edje.obj, self.part,
418 # self.name, self.value)
419 #
420 # def aspect_min_set(self, double a):
421 # edje_edit_state_aspect_min_set(self.edje.obj, self.part, self.name,
422 # self.value, a)
423 #
424 # def aspect_max_get(self):
425 # return edje_edit_state_aspect_max_get(self.edje.obj, self.part,
426 # self.name, self.value)
427 #
428 # def aspect_max_set(self, double a):
429 # edje_edit_state_aspect_max_set(self.edje.obj, self.part, self.name,
430 # self.value, a)
431 #
432 # def aspect_pref_get(self):
433 # return edje_edit_state_aspect_pref_get(self.edje.obj, self.part,
434 # self.name, self.value)
435 #
436 # def aspect_pref_set(self, char a):
437 # edje_edit_state_aspect_pref_set(self.edje.obj, self.part, self.name,
438 # self.value, a)
439 #
440 # def fill_origin_relative_get(self):
441 # cdef double x, y
442 # x = edje_edit_state_fill_origin_relative_x_get(self.edje.obj, self.part,
443 # self.name, self.value)
444 # y = edje_edit_state_fill_origin_relative_y_get(self.edje.obj, self.part,
445 # self.name, self.value)
446 # return (x, y)
447 #
448 # def fill_origin_relative_set(self, double x, double y):
449 # edje_edit_state_fill_origin_relative_x_set(self.edje.obj, self.part,
450 # self.name, self.value, x)
451 # edje_edit_state_fill_origin_relative_y_set(self.edje.obj, self.part,
452 # self.name, self.value, y)
453 #
454 # def fill_origin_offset_get(self):
455 # cdef int x, y
456 # x = edje_edit_state_fill_origin_offset_x_get(self.edje.obj, self.part,
457 # self.name, self.value)
458 # y = edje_edit_state_fill_origin_offset_y_get(self.edje.obj, self.part,
459 # self.name, self.value)
460 # return (x, y)
461 #
462 # def fill_origin_offset_set(self, x, y):
463 # edje_edit_state_fill_origin_offset_x_set(self.edje.obj, self.part,
464 # self.name, self.value, x)
465 # edje_edit_state_fill_origin_offset_y_set(self.edje.obj, self.part,
466 # self.name, self.value, y)
467 #
468 # def fill_size_relative_get(self):
469 # cdef double x, y
470 # x = edje_edit_state_fill_size_relative_x_get(self.edje.obj, self.part,
471 # self.name, self.value)
472 # y = edje_edit_state_fill_size_relative_y_get(self.edje.obj, self.part,
473 # self.name, self.value)
474 # return (x, y)
475 #
476 # def fill_size_relative_set(self, double x, double y):
477 # edje_edit_state_fill_size_relative_x_set(self.edje.obj, self.part,
478 # self.name, self.value, x)
479 # edje_edit_state_fill_size_relative_y_set(self.edje.obj, self.part,
480 # self.name, self.value, y)
481 #
482 # def fill_size_offset_get(self):
483 # cdef int x, y
484 # x = edje_edit_state_fill_size_offset_x_get(self.edje.obj, self.part,
485 # self.name, self.value)
486 # y = edje_edit_state_fill_size_offset_y_get(self.edje.obj, self.part,
487 # self.name, self.value)
488 # return (x, y)
489 #
490 # def fill_size_offset_set(self, x, y):
491 # edje_edit_state_fill_size_offset_x_set(self.edje.obj, self.part,
492 # self.name, self.value, x)
493 # edje_edit_state_fill_size_offset_y_set(self.edje.obj, self.part,
494 # self.name, self.value, y)
495 #
496 # property visible:
497 # def __get__(self):
498 # return bool(edje_edit_state_visible_get(self.edje.obj, self.part,
499 # self.name, self.value))
500 # def __set__(self, v):
501 # if v:
502 # edje_edit_state_visible_set(self.edje.obj, self.part, self.name,
503 # self.value, 1)
504 # else:
505 # edje_edit_state_visible_set(self.edje.obj, self.part, self.name, self.value, 0)
506 #
507 # def color_class_get(self):
508 # cdef const char_ptr cc
509 # cc = edje_edit_state_color_class_get(self.edje.obj, self.part,
510 # self.name, self.value)
511 # if cc == NULL:
512 # return None
513 # rcc = cc
514 # edje_edit_string_free(cc)
515 # return rcc
516 #
517 # def color_class_set(self, cc):
518 # if not cc:
519 # edje_edit_state_color_class_set(self.edje.obj, self.part,
520 # self.name, self.value, NULL)
521 # else:
522 # edje_edit_state_color_class_set(self.edje.obj, self.part,
523 # self.name, self.value, cc)
524 #
525 # def external_params_get(self):
526 # cdef evas.c_evas.const Eina_List *lst
527 # ret = []
528 # lst = edje_edit_state_external_params_list_get(self.edje.obj, self.part,
529 # self.name, self.value)
530 # while lst:
531 # p = c_edje._ExternalParam_from_ptr(<uintptr_t>lst.data)
532 # if p is not None:
533 # ret.append(p)
534 # lst = lst.next
535 # return ret
536 #
537 # def external_param_get(self, param):
538 # cdef c_edje.Edje_External_Param_Type type
539 # cdef void *value
540 # cdef const char_ptr s
541 #
542 # if not edje_edit_state_external_param_get(self.edje.obj, self.part,
543 # self.name, self.value, param,
544 # &type, &value):
545 # return None
546 # if type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_BOOL:
547 # b = (<evas.c_evas.Eina_Bool *>value)[0]
548 # return (type, bool(b))
549 # elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_INT:
550 # i = (<int *>value)[0]
551 # return (type, i)
552 # elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
553 # d = (<double *>value)[0]
554 # return (type, d)
555 # elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_STRING:
556 # s = <char *>value
557 # if s == NULL:
558 # return (type, None)
559 # else:
560 # return (type, s)
561 # elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
562 # s = <char *>value
563 # if s == NULL:
564 # return (type, None)
565 # else:
566 # return (type, s)
567 # return None
568 #
569 # def external_param_set(self, param, value):
570 # cdef const char_ptr expected
571 #
572 # if isinstance(value, bool):
573 # return self.external_param_bool_set(param, value)
574 # elif isinstance(value, (long, int)):
575 # return self.external_param_int_set(param, value)
576 # elif isinstance(value, float):
577 # return self.external_param_double_set(param, value)
578 # elif isinstance(value, str):
579 # t = edje_object_part_external_param_type_get(
580 # self.edje.obj, self.part, param)
581 # if t == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_STRING:
582 # return self.external_param_string_set(param, value)
583 # elif t == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
584 # return self.external_param_choice_set(param, value)
585 #
586 # t = edje_object_part_external_param_type_get(
587 # self.edje.obj, self.part, param)
588 # if t >= edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_MAX:
589 # raise TypeError("no external parameter %s" % (param,))
590 # else:
591 # expected = edje_external_param_type_str(t)
592 # raise TypeError(
593 # "invalid external parameter %s of (%s), expected %s" %
594 # (param, type(value).__name__, expected))
595 #
596 # def external_param_int_get(self, param):
597 # cdef int value
598 #
599 # if not edje_edit_state_external_param_int_get(self.edje.obj, self.part,
600 # self.name, self.value,
601 # param, &value):
602 # return None
603 # return value
604 #
605 # def external_param_bool_get(self, param):
606 # cdef evas.c_evas.Eina_Bool value
607 #
608 # if not edje_edit_state_external_param_bool_get(
609 # self.edje.obj, self.part, self.name, self.value, param, &value):
610 # return None
611 # return bool(value)
612 #
613 # def external_param_double_get(self, param):
614 # cdef double value
615 #
616 # if not edje_edit_state_external_param_double_get(self.edje.obj, self.part,
617 # self.name, self.value,
618 # param, &value):
619 # return None
620 # return value
621 #
622 # def external_param_string_get(self, param):
623 # cdef const char_ptr value
624 #
625 # if not edje_edit_state_external_param_string_get(
626 # self.edje.obj, self.part, self.name, self.value, param, &value):
627 # return None
628 # if value != NULL:
629 # return value
630 #
631 # def external_param_choice_get(self, param):
632 # cdef const char_ptr value
633 #
634 # if not edje_edit_state_external_param_choice_get(
635 # self.edje.obj, self.part, self.name, self.value, param, &value):
636 # return None
637 # if value != NULL:
638 # return value
639 #
640 # def external_param_int_set(self, param, value):
641 # return bool(edje_edit_state_external_param_int_set(self.edje.obj,
642 # self.part, self.name,
643 # self.value, param,
644 # value))
645 #
646 # def external_param_bool_set(self, param, value):
647 # return bool(edje_edit_state_external_param_bool_set(
648 # self.edje.obj, self.part, self.name, self.value, param, value))
649 #
650 # def external_param_double_set(self, param, value):
651 # return bool(edje_edit_state_external_param_double_set(self.edje.obj,
652 # self.part, self.name,
653 # self.value,param,
654 # value))
655 #
656 # def external_param_string_set(self, param, value):
657 # return bool(edje_edit_state_external_param_string_set(self.edje.obj,
658 # self.part, self.name,
659 # self.value, param,
660 # value))
661 #
662 # def external_param_choice_set(self, param, value):
663 # return bool(edje_edit_state_external_param_choice_set(
664 # self.edje.obj, self.part, self.name, self.value, param, value))
665 #
666 # def text_get(self):
667 # cdef const char_ptr t
668 # t = edje_edit_state_text_get(self.edje.obj, self.part, self.name,
669 # self.value)
670 # if t == NULL:
671 # return None
672 # r = t
673 # edje_edit_string_free(t)
674 # return r
675 #
676 # def text_set(self, t):
677 # edje_edit_state_text_set(self.edje.obj, self.part, self.name,
678 # self.value, t)
679 #
680 # property text:
681 # def __get__(self):
682 # return self.text_get()
683 # def __set__(self, text):
684 # self.text_set(text)
685 #
686 # def font_get(self):
687 # cdef const char_ptr f
688 # f = edje_edit_state_font_get(self.edje.obj, self.part, self.name,
689 # self.value)
690 # if f == NULL:
691 # return None
692 # r = f
693 # edje_edit_string_free(f)
694 # return r
695 #
696 # def font_set(self, char *f):
697 # edje_edit_state_font_set(self.edje.obj, self.part, self.name,
698 # self.value, f)
699 #
700 # property font:
701 # def __get__(self):
702 # return self.font_get()
703 # def __set__(self, font):
704 # self.font_set(font)
705 #
706 # def text_size_get(self):
707 # return edje_edit_state_text_size_get(self.edje.obj, self.part,
708 # self.name, self.value)
709 #
710 # def text_size_set(self, int s):
711 # edje_edit_state_text_size_set(self.edje.obj, self.part, self.name,
712 # self.value, s)
713 #
714 # property text_size:
715 # def __get__(self):
716 # return self.text_size_get()
717 # def __set__(self, value):
718 # self.text_size_set(value)
719 #
720 # def text_align_get(self):
721 # cdef double x, y
722 # x = edje_edit_state_text_align_x_get(self.edje.obj, self.part,
723 # self.name, self.value)
724 # y = edje_edit_state_text_align_y_get(self.edje.obj, self.part,
725 # self.name, self.value)
726 # return (x, y)
727 #
728 # def text_align_set(self, double x, double y):
729 # edje_edit_state_text_align_x_set(self.edje.obj, self.part, self.name,
730 # self.value, x)
731 # edje_edit_state_text_align_y_set(self.edje.obj, self.part, self.name,
732 # self.value, y)
733 #
734 # property text_align:
735 # def __get__(self):
736 # return self.text_align_get()
737 # def __set__(self, align):
738 # self.text_align_set(*align)
739 #
740 # # FIXME: These should be ellipsis, not elipsis. Was this API ever released?
741 # def text_elipsis_get(self):
742 # return edje_edit_state_text_elipsis_get(self.edje.obj, self.part,
743 # self.name, self.value)
744 #
745 # def text_elipsis_set(self, double e):
746 # edje_edit_state_text_elipsis_set(self.edje.obj, self.part, self.name,
747 # self.value, e)
748 #
749 # property text_elipsis:
750 # def __get__(self):
751 # return self.text_elipsis_get()
752 # def __set__(self, value):
753 # self.text_elipsis_set(value)
754 #
755 # def text_fit_get(self):
756 # x = bool(edje_edit_state_text_fit_x_get(self.edje.obj, self.part,
757 # self.name, self.value))
758 # y = bool(edje_edit_state_text_fit_y_get(self.edje.obj, self.part,
759 # self.name, self.value))
760 # return (x, y)
761 #
762 # def text_fit_set(self, x, y):
763 # if x:
764 # edje_edit_state_text_fit_x_set(self.edje.obj, self.part, self.name,
765 # self.value, 1)
766 # else:
767 # edje_edit_state_text_fit_x_set(self.edje.obj, self.part, self.name,
768 # self.value, 0)
769 # if y:
770 # edje_edit_state_text_fit_y_set(self.edje.obj, self.part, self.name,
771 # self.value, 1)
772 # else:
773 # edje_edit_state_text_fit_y_set(self.edje.obj, self.part, self.name,
774 # self.value, 0)
775 #
776 # property text_fit:
777 # def __get__(self):
778 # return self.text_fit_get()
779 # def __set__(self, value):
780 # self.text_fit_set(*value)
781 #
782 # def image_get(self):
783 # cdef const char_ptr img
784 # img = edje_edit_state_image_get(self.edje.obj, self.part, self.name,
785 # self.value)
786 # if img == NULL:
787 # return None
788 # r = img
789 # edje_edit_string_free(img)
790 # return r
791 #
792 # def image_set(self, char *image):
793 # if not image:
794 # return
795 #
796 # edje_edit_state_image_set(self.edje.obj, self.part, self.name,
797 # self.value, image)
798 #
799 # property image:
800 # def __get__(self):
801 # return self.image_get()
802 # def __set__(self, image):
803 # self.image_set(image)
804 #
805 # def image_border_get(self):
806 # cdef int l, r, t, b
807 # edje_edit_state_image_border_get(self.edje.obj, self.part, self.name,
808 # self.value, &l, &r, &t, &b)
809 # return (l, r, t, b)
810 #
811 # def image_border_set(self, int l, int r, int t, int b):
812 # edje_edit_state_image_border_set(self.edje.obj, self.part, self.name,
813 # self.value, l, r, t, b)
814 #
815 # property image_border:
816 # def __get__(self):
817 # return self.image_border_get()
818 # def __set__(self, value):
819 # self.image_border_set(*value)
820 #
821 # def image_border_fill_get(self):
822 # cdef unsigned char r
823 # r = edje_edit_state_image_border_fill_get(self.edje.obj, self.part,
824 # self.name, self.value)
825 # if r == 0:
826 # return False
827 # return True
828 #
829 # def image_border_fill_set(self, fill):
830 # if fill:
831 # edje_edit_state_image_border_fill_set(self.edje.obj, self.part,
832 # self.name, self.value, 1)
833 # else:
834 # edje_edit_state_image_border_fill_set(self.edje.obj, self.part,
835 # self.name, self.value, 0)
836 #
837 # property image_border_fill:
838 # def __get__(self):
839 # return self.image_border_fill_get()
840 # def __set__(self, value):
841 # self.image_border_fill_set(value)
842 #
843 # property tweens:
844 # def __get__(self):
845 # "@rtype: list of str"
846 # cdef evas.c_evas.Eina_List *lst, *itr
847 # ret = []
848 # lst = edje_edit_state_tweens_list_get(self.edje.obj, self.part,
849 # self.name, self.value)
850 # itr = lst
851 # while itr:
852 # ret.append(<char*>itr.data)
853 # itr = itr.next
854 # edje_edit_string_list_free(lst)
855 # return ret
856 #
857 # def tween_add(self, char *img):
858 # return bool(edje_edit_state_tween_add(self.edje.obj, self.part,
859 # self.name, self.value, img))
860 #
861 # def tween_del(self, char *img):
862 # return bool(edje_edit_state_tween_del(self.edje.obj, self.part,
863 # self.name, self.value, img))