summaryrefslogtreecommitdiff
path: root/efl/edje/efl.edje_edit_part_state.pxi
blob: 8c4b69d4bfecbdb3b247ec6a8ea0fb951240e054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
#
# This file is part of Python-EFL.
#
# Python-EFL is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# Python-EFL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.


cdef class State:
    cdef EdjeEdit edje
    cdef object part
    cdef object name
    cdef object part_obj
    cdef object value

    def __init__(self, Part part, name, double value=0.0):
        if isinstance(name, unicode): name = name.encode("UTF-8")
        self.part_obj = part
        self.edje = part.edje
        self.part = part.name
        self.name = name
        self.value = value

    property name:
        def __get__(self):
            return self.name

    property value:
        def __get__(self):
            return self.value

    def part_get(self):
        return self.part_obj

    def name_set(self, new_name, new_value=None):
        if new_value == None:
            new_value = self.value
        return bool(edje_edit_state_name_set(self.edje.obj, self.part,
                                             self.name, self.value, new_name,
                                             new_value))
    """
    def copy_from(self, from_state, from_value=0.0):
        return bool(edje_edit_state_copy(self.edje.obj, self.part,
                                         from_state, from_value, self.name,
                                         self.value))
    """
    def rel1_to_get(self):
        cdef const_char  *tx, *ty
        tx = edje_edit_state_rel1_to_x_get(self.edje.obj, self.part, self.name,
                                           self.value)
        ty = edje_edit_state_rel1_to_y_get(self.edje.obj, self.part, self.name,
                                           self.value)
        if tx != NULL:
            x = tx
            edje_edit_string_free(tx)
        else:
            x = None

        if ty != NULL:
            y = ty
            edje_edit_string_free(ty)
        else:
            y = None

        return (x, y)
    """
    def rel1_to_set(self, x, y):
        if x:
            edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
        else:
            edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        if y:
            edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)
        else:
            edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        # remove when fixed in edje_edit
        edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
                                          self.value)

    property rel1_to:
        def __get__(self):
            return self.rel1_to_get()
        def __set__(self, rel1_to):
            self.rel1_to_set(*rel1_to)

    def rel1_to_x_set(self, x):
        if x:
            edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
        else:
            edje_edit_state_rel1_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        # remove when fixed in edje_edit
        edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
                                          self.value)

    def rel1_to_y_set(self, y):
        if y:
            edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)
        else:
            edje_edit_state_rel1_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        # remove when fixed in edje_edit
        edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
                                          self.value)

    def rel1_relative_get(self):
        cdef double x, y
        x = edje_edit_state_rel1_relative_x_get(self.edje.obj, self.part,
                                                self.name, self.value)
        y = edje_edit_state_rel1_relative_y_get(self.edje.obj, self.part,
                                                self.name, self.value)
        return (x, y)

    def rel1_relative_set(self, double x, double y):
        edje_edit_state_rel1_relative_x_set(self.edje.obj, self.part, self.name,
                                            self.value, x)
        edje_edit_state_rel1_relative_y_set(self.edje.obj, self.part, self.name,
                                            self.value, y)

    property rel1_relative:
        def __get__(self):
            return self.rel1_relative_get()
        def __set__(self, value):
            self.rel1_relative_set(*value)

    def rel1_relative_x_set(self, double x):
        edje_edit_state_rel1_relative_x_set(self.edje.obj, self.part, self.name,
                                            self.value, x)

    def rel1_relative_y_set(self, double y):
        edje_edit_state_rel1_relative_y_set(self.edje.obj, self.part, self.name,
                                            self.value, y)

    def rel1_offset_get(self):
        cdef int x, y
        x = edje_edit_state_rel1_offset_x_get(self.edje.obj, self.part,
                                              self.name, self.value)
        y = edje_edit_state_rel1_offset_y_get(self.edje.obj, self.part,
                                              self.name, self.value)
        return (x, y)

    def rel1_offset_set(self, int x, int y):
        edje_edit_state_rel1_offset_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
        edje_edit_state_rel1_offset_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)

    property rel1_offset:
        def __get__(self):
            return self.rel1_offset_get()
        def __set__(self, value):
            self.rel1_offset_set(*value)

    def rel1_offset_x_set(self, int x):
        edje_edit_state_rel1_offset_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)

    def rel1_offset_y_set(self, int y):
        edje_edit_state_rel1_offset_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)

    def rel2_to_get(self):
        cdef const_char_ptr tx, ty
        tx = edje_edit_state_rel2_to_x_get(self.edje.obj, self.part, self.name,
                                           self.value)
        ty = edje_edit_state_rel2_to_y_get(self.edje.obj, self.part, self.name,
                                           self.value)
        if tx != NULL:
            x = tx
            edje_edit_string_free(tx)
        else:
            x = None

        if ty != NULL:
            y = ty
            edje_edit_string_free(ty)
        else:
            y = None

        return (x, y)

    def rel2_to_set(self, x, y):
        if x:
            edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
        else:
            edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        if y:
            edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)
        else:
            edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        # remove when fixed in edje_edit
        edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
                                          self.value)

    property rel2_to:
        def __get__(self):
            return self.rel2_to_get()
        def __set__(self, rel2_to):
            self.rel2_to_set(*rel2_to)

    def rel2_to_x_set(self, x):
        if x:
            edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
        else:
            edje_edit_state_rel2_to_x_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        # remove when fixed in edje_edit
        edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
                                          self.value)
    def rel2_to_y_set(self, y):
        if y:
            edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)
        else:
            edje_edit_state_rel2_to_y_set(self.edje.obj, self.part, self.name,
                                          self.value, NULL)
        # remove when fixed in edje_edit
        edje_edit_part_selected_state_set(self.edje.obj, self.part, self.name,
                                          self.value)

    def rel2_relative_get(self):
        cdef double x, y
        x = edje_edit_state_rel2_relative_x_get(self.edje.obj, self.part,
                                                self.name, self.value)
        y = edje_edit_state_rel2_relative_y_get(self.edje.obj, self.part,
                                                self.name, self.value)
        return (x, y)

    def rel2_relative_set(self, double x, double y):
        edje_edit_state_rel2_relative_x_set(self.edje.obj, self.part, self.name,
                                            self.value, x)
        edje_edit_state_rel2_relative_y_set(self.edje.obj, self.part, self.name,
                                            self.value, y)

    property rel2_relative:
        def __get__(self):
            return self.rel2_relative_get()
        def __set__(self, value):
            self.rel2_relative_set(*value)

    def rel2_relative_x_set(self, double x):
        edje_edit_state_rel2_relative_x_set(self.edje.obj, self.part, self.name,
                                            self.value, x)
    def rel2_relative_y_set(self, double y):
        edje_edit_state_rel2_relative_y_set(self.edje.obj, self.part, self.name,
                                            self.value, y)

    def rel2_offset_get(self):
        cdef int x, y
        x = edje_edit_state_rel2_offset_x_get(self.edje.obj, self.part,
                                              self.name, self.value)
        y = edje_edit_state_rel2_offset_y_get(self.edje.obj, self.part,
                                              self.name, self.value)
        return (x, y)

    def rel2_offset_set(self, int x, int y):
        edje_edit_state_rel2_offset_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
        edje_edit_state_rel2_offset_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)

    property rel2_offset:
        def __get__(self):
            return self.rel2_offset_get()
        def __set__(self, value):
            self.rel2_offset_set(*value)

    def rel2_offset_x_set(self, int x):
        edje_edit_state_rel2_offset_x_set(self.edje.obj, self.part, self.name,
                                          self.value, x)
    def rel2_offset_y_set(self, int y):
        edje_edit_state_rel2_offset_y_set(self.edje.obj, self.part, self.name,
                                          self.value, y)

    def color_get(self):
        cdef int r, g, b, a
        edje_edit_state_color_get(self.edje.obj, self.part, self.name,
                                  self.value, &r, &g, &b, &a)
        return (r, g, b, a)

    def color_set(self, int r, int g, int b, int a):
        edje_edit_state_color_set(self.edje.obj, self.part, self.name,
                                  self.value, r, g, b, a)

    property color:
        def __get__(self):
            return self.color_get()
        def __set__(self, color):
            self.color_set(*color)

    def color2_get(self):
        cdef int r, g, b, a
        edje_edit_state_color2_get(self.edje.obj, self.part, self.name,
                                   self.value, &r, &g, &b, &a)
        return (r, g, b, a)

    def color2_set(self, int r, int g, int b, int a):
        edje_edit_state_color2_set(self.edje.obj, self.part, self.name,
                                   self.value, r, g, b, a)

    property color2:
        def __get__(self):
            return self.color2_get()
        def __set__(self, color):
            self.color2_set(*color)

    def color3_get(self):
        cdef int r, g, b, a
        edje_edit_state_color3_get(self.edje.obj, self.part, self.name,
                                   self.value, &r, &g, &b, &a)
        return (r, g, b, a)

    def color3_set(self, int r, int g, int b, int a):
        edje_edit_state_color3_set(self.edje.obj, self.part, self.name,
                                   self.value, r, g, b, a)

    property color3:
        def __get__(self):
            return self.color3_get()
        def __set__(self, color):
            self.color3_set(*color)

    def align_get(self):
        cdef double x, y
        x = edje_edit_state_align_x_get(self.edje.obj, self.part, self.name,
                                        self.value)
        y = edje_edit_state_align_y_get(self.edje.obj, self.part, self.name,
                                        self.value)
        return (x, y)

    def align_set(self, double x, double y):
        edje_edit_state_align_x_set(self.edje.obj, self.part, self.name,
                                    self.value, x)
        edje_edit_state_align_y_set(self.edje.obj, self.part, self.name,
                                    self.value, y)

    property align:
        def __get__(self):
            return self.align_get()
        def __set__(self, align):
            self.align_set(*align)

    def min_get(self):
        cdef int w, h
        w = edje_edit_state_min_w_get(self.edje.obj, self.part, self.name,
                                      self.value)
        h = edje_edit_state_min_h_get(self.edje.obj, self.part, self.name,
                                      self.value)
        return (w, h)

    def min_set(self, int w, int h):
        edje_edit_state_min_w_set(self.edje.obj, self.part, self.name,
                                  self.value, w)
        edje_edit_state_min_h_set(self.edje.obj, self.part, self.name,
                                  self.value, h)

    property min:
        def __get__(self):
            return self.min_get()
        def __set__(self, min):
            self.min_set(*min)

    def max_get(self):
        cdef int w, h
        w = edje_edit_state_max_w_get(self.edje.obj, self.part, self.name,
                                      self.value)
        h = edje_edit_state_max_h_get(self.edje.obj, self.part, self.name,
                                      self.value)
        return (w, h)

    def max_set(self, int w, int h):
        edje_edit_state_max_w_set(self.edje.obj, self.part, self.name,
                                  self.value, w)
        edje_edit_state_max_h_set(self.edje.obj, self.part, self.name,
                                  self.value, h)

    property max:
        def __get__(self):
            return self.max_get()
        def __set__(self, max):
            self.max_set(*max)

    def aspect_min_get(self):
        return edje_edit_state_aspect_min_get(self.edje.obj, self.part,
                                              self.name, self.value)

    def aspect_min_set(self, double a):
        edje_edit_state_aspect_min_set(self.edje.obj, self.part, self.name,
                                       self.value, a)

    def aspect_max_get(self):
        return edje_edit_state_aspect_max_get(self.edje.obj, self.part,
                                              self.name, self.value)

    def aspect_max_set(self, double a):
        edje_edit_state_aspect_max_set(self.edje.obj, self.part, self.name,
                                       self.value, a)

    def aspect_pref_get(self):
        return edje_edit_state_aspect_pref_get(self.edje.obj, self.part,
                                               self.name, self.value)

    def aspect_pref_set(self, char a):
        edje_edit_state_aspect_pref_set(self.edje.obj, self.part, self.name,
                                        self.value, a)

    def fill_origin_relative_get(self):
        cdef double x, y
        x = edje_edit_state_fill_origin_relative_x_get(self.edje.obj, self.part,
                                                       self.name, self.value)
        y = edje_edit_state_fill_origin_relative_y_get(self.edje.obj, self.part,
                                                       self.name, self.value)
        return (x, y)

    def fill_origin_relative_set(self, double x, double y):
        edje_edit_state_fill_origin_relative_x_set(self.edje.obj, self.part,
                                                   self.name, self.value, x)
        edje_edit_state_fill_origin_relative_y_set(self.edje.obj, self.part,
                                                   self.name, self.value, y)

    def fill_origin_offset_get(self):
        cdef int x, y
        x = edje_edit_state_fill_origin_offset_x_get(self.edje.obj, self.part,
                                                     self.name, self.value)
        y = edje_edit_state_fill_origin_offset_y_get(self.edje.obj, self.part,
                                                     self.name, self.value)
        return (x, y)

    def fill_origin_offset_set(self, x, y):
        edje_edit_state_fill_origin_offset_x_set(self.edje.obj, self.part,
                                                 self.name, self.value, x)
        edje_edit_state_fill_origin_offset_y_set(self.edje.obj, self.part,
                                                 self.name, self.value, y)

    def fill_size_relative_get(self):
        cdef double x, y
        x = edje_edit_state_fill_size_relative_x_get(self.edje.obj, self.part,
                                                     self.name, self.value)
        y = edje_edit_state_fill_size_relative_y_get(self.edje.obj, self.part,
                                                     self.name, self.value)
        return (x, y)

    def fill_size_relative_set(self, double x, double y):
        edje_edit_state_fill_size_relative_x_set(self.edje.obj, self.part,
                                                 self.name, self.value, x)
        edje_edit_state_fill_size_relative_y_set(self.edje.obj, self.part,
                                                 self.name, self.value, y)

    def fill_size_offset_get(self):
        cdef int x, y
        x = edje_edit_state_fill_size_offset_x_get(self.edje.obj, self.part,
                                                   self.name, self.value)
        y = edje_edit_state_fill_size_offset_y_get(self.edje.obj, self.part,
                                                   self.name, self.value)
        return (x, y)

    def fill_size_offset_set(self, x, y):
        edje_edit_state_fill_size_offset_x_set(self.edje.obj, self.part,
                                               self.name, self.value, x)
        edje_edit_state_fill_size_offset_y_set(self.edje.obj, self.part,
                                               self.name, self.value, y)

    property visible:
        def __get__(self):
            return bool(edje_edit_state_visible_get(self.edje.obj, self.part,
                                                    self.name, self.value))
        def __set__(self, v):
            if v:
                edje_edit_state_visible_set(self.edje.obj, self.part, self.name,
                                            self.value, 1)
            else:
                edje_edit_state_visible_set(self.edje.obj, self.part, self.name,                                            self.value, 0)

    def color_class_get(self):
        cdef const_char_ptr cc
        cc = edje_edit_state_color_class_get(self.edje.obj, self.part,
                                             self.name, self.value)
        if cc == NULL:
            return None
        rcc = cc
        edje_edit_string_free(cc)
        return rcc

    def color_class_set(self, cc):
        if not cc:
            edje_edit_state_color_class_set(self.edje.obj, self.part,
                                            self.name, self.value, NULL)
        else:
            edje_edit_state_color_class_set(self.edje.obj, self.part,
                                            self.name, self.value, cc)

    def external_params_get(self):
        cdef evas.c_evas.const_Eina_List *lst
        ret = []
        lst = edje_edit_state_external_params_list_get(self.edje.obj, self.part,
                                                       self.name, self.value)
        while lst:
            p = c_edje._ExternalParam_from_ptr(<long>lst.data)
            if p is not None:
                ret.append(p)
            lst = lst.next
        return ret

    def external_param_get(self, param):
        cdef c_edje.Edje_External_Param_Type type
        cdef void *value
        cdef const_char_ptr s

        if not edje_edit_state_external_param_get(self.edje.obj, self.part,
                                                  self.name, self.value, param,
                                                  &type, &value):
            return None
        if type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_BOOL:
            b = (<evas.c_evas.Eina_Bool *>value)[0]
            return (type, bool(b))
        elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_INT:
            i = (<int *>value)[0]
            return (type, i)
        elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
            d = (<double *>value)[0]
            return (type, d)
        elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_STRING:
            s = <char *>value
            if s == NULL:
                return (type, None)
            else:
                return (type, s)
        elif type == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
            s = <char *>value
            if s == NULL:
                return (type, None)
            else:
                return (type, s)
        return None

    def external_param_set(self, param, value):
        cdef const_char_ptr expected

        if isinstance(value, bool):
            return self.external_param_bool_set(param, value)
        elif isinstance(value, (long, int)):
            return self.external_param_int_set(param, value)
        elif isinstance(value, float):
            return self.external_param_double_set(param, value)
        elif isinstance(value, str):
            t = edje_object_part_external_param_type_get(
                self.edje.obj, self.part, param)
            if t == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_STRING:
                return self.external_param_string_set(param, value)
            elif t == edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
                return self.external_param_choice_set(param, value)

        t = edje_object_part_external_param_type_get(
            self.edje.obj, self.part, param)
        if t >= edje.c_edje.EDJE_EXTERNAL_PARAM_TYPE_MAX:
            raise TypeError("no external parameter %s" % (param,))
        else:
            expected = edje_external_param_type_str(t)
            raise TypeError(
                "invalid external parameter %s of (%s), expected %s" %
                (param, type(value).__name__, expected))

    def external_param_int_get(self, param):
        cdef int value

        if not edje_edit_state_external_param_int_get(self.edje.obj, self.part,
                                                      self.name, self.value,
                                                      param, &value):
            return None
        return value

    def external_param_bool_get(self, param):
        cdef evas.c_evas.Eina_Bool value

        if not edje_edit_state_external_param_bool_get(
            self.edje.obj, self.part, self.name, self.value, param, &value):
            return None
        return bool(value)

    def external_param_double_get(self, param):
        cdef double value

        if not edje_edit_state_external_param_double_get(self.edje.obj, self.part,
                                                      self.name, self.value,
                                                      param, &value):
            return None
        return value

    def external_param_string_get(self, param):
        cdef const_char_ptr value

        if not edje_edit_state_external_param_string_get(
            self.edje.obj, self.part, self.name, self.value, param, &value):
            return None
        if value != NULL:
            return value

    def external_param_choice_get(self, param):
        cdef const_char_ptr value

        if not edje_edit_state_external_param_choice_get(
            self.edje.obj, self.part, self.name, self.value, param, &value):
            return None
        if value != NULL:
            return value

    def external_param_int_set(self, param, value):
        return bool(edje_edit_state_external_param_int_set(self.edje.obj,
                                                           self.part, self.name,
                                                           self.value, param,
                                                           value))

    def external_param_bool_set(self, param, value):
        return bool(edje_edit_state_external_param_bool_set(
                self.edje.obj, self.part, self.name, self.value, param, value))

    def external_param_double_set(self, param, value):
        return bool(edje_edit_state_external_param_double_set(self.edje.obj,
                                                           self.part, self.name,
                                                           self.value,param,
                                                           value))

    def external_param_string_set(self, param, value):
        return bool(edje_edit_state_external_param_string_set(self.edje.obj,
                                                           self.part, self.name,
                                                           self.value, param,
                                                           value))

    def external_param_choice_set(self, param, value):
        return bool(edje_edit_state_external_param_choice_set(
                self.edje.obj, self.part, self.name, self.value, param, value))

    def text_get(self):
        cdef const_char_ptr t
        t = edje_edit_state_text_get(self.edje.obj, self.part, self.name,
                                     self.value)
        if t == NULL:
            return None
        r = t
        edje_edit_string_free(t)
        return r

    def text_set(self, t):
        edje_edit_state_text_set(self.edje.obj, self.part, self.name,
                                 self.value, t)

    property text:
        def __get__(self):
            return self.text_get()
        def __set__(self, text):
            self.text_set(text)

    def font_get(self):
        cdef const_char_ptr f
        f = edje_edit_state_font_get(self.edje.obj, self.part, self.name,
                                     self.value)
        if f == NULL:
            return None
        r = f
        edje_edit_string_free(f)
        return r

    def font_set(self, char *f):
        edje_edit_state_font_set(self.edje.obj, self.part, self.name,
                                 self.value, f)

    property font:
        def __get__(self):
            return self.font_get()
        def __set__(self, font):
            self.font_set(font)

    def text_size_get(self):
        return edje_edit_state_text_size_get(self.edje.obj, self.part,
                                             self.name, self.value)

    def text_size_set(self, int s):
        edje_edit_state_text_size_set(self.edje.obj, self.part, self.name,
                                      self.value, s)

    property text_size:
        def __get__(self):
            return self.text_size_get()
        def __set__(self, value):
            self.text_size_set(value)

    def text_align_get(self):
        cdef double x, y
        x = edje_edit_state_text_align_x_get(self.edje.obj, self.part,
                                             self.name, self.value)
        y = edje_edit_state_text_align_y_get(self.edje.obj, self.part,
                                             self.name, self.value)
        return (x, y)

    def text_align_set(self, double x, double y):
        edje_edit_state_text_align_x_set(self.edje.obj, self.part, self.name,
                                         self.value, x)
        edje_edit_state_text_align_y_set(self.edje.obj, self.part, self.name,
                                         self.value, y)

    property text_align:
        def __get__(self):
            return self.text_align_get()
        def __set__(self, align):
            self.text_align_set(*align)

    def text_elipsis_get(self):
        return edje_edit_state_text_elipsis_get(self.edje.obj, self.part,
                                                self.name, self.value)

    def text_elipsis_set(self, double e):
        edje_edit_state_text_elipsis_set(self.edje.obj, self.part, self.name,
                                         self.value, e)

    property text_elipsis:
        def __get__(self):
            return self.text_elipsis_get()
        def __set__(self, value):
            self.text_elipsis_set(value)

    def text_fit_get(self):
        x = bool(edje_edit_state_text_fit_x_get(self.edje.obj, self.part,
                                                self.name, self.value))
        y = bool(edje_edit_state_text_fit_y_get(self.edje.obj, self.part,
                                                self.name, self.value))
        return (x, y)

    def text_fit_set(self, x, y):
        if x:
            edje_edit_state_text_fit_x_set(self.edje.obj, self.part, self.name,
                                           self.value, 1)
        else:
            edje_edit_state_text_fit_x_set(self.edje.obj, self.part, self.name,
                                           self.value, 0)
        if y:
            edje_edit_state_text_fit_y_set(self.edje.obj, self.part, self.name,
                                           self.value, 1)
        else:
            edje_edit_state_text_fit_y_set(self.edje.obj, self.part, self.name,
                                           self.value, 0)

    property text_fit:
        def __get__(self):
            return self.text_fit_get()
        def __set__(self, value):
            self.text_fit_set(*value)

    def image_get(self):
        cdef const_char_ptr img
        img = edje_edit_state_image_get(self.edje.obj, self.part, self.name,
                                        self.value)
        if img == NULL:
            return None
        r = img
        edje_edit_string_free(img)
        return r

    def image_set(self, char *image):
        if not image:
            return

        edje_edit_state_image_set(self.edje.obj, self.part, self.name,
                                  self.value, image)

    property image:
        def __get__(self):
            return self.image_get()
        def __set__(self, image):
            self.image_set(image)

    def image_border_get(self):
        cdef int l, r, t, b
        edje_edit_state_image_border_get(self.edje.obj, self.part, self.name,
                                         self.value, &l, &r, &t, &b)
        return (l, r, t, b)

    def image_border_set(self, int l, int r, int t, int b):
        edje_edit_state_image_border_set(self.edje.obj, self.part, self.name,
                                         self.value, l, r, t, b)

    property image_border:
        def __get__(self):
            return self.image_border_get()
        def __set__(self, value):
            self.image_border_set(*value)

    def image_border_fill_get(self):
        cdef unsigned char r
        r = edje_edit_state_image_border_fill_get(self.edje.obj, self.part,
                                                  self.name, self.value)
        if r == 0:
            return False
        return True

    def image_border_fill_set(self, fill):
        if fill:
            edje_edit_state_image_border_fill_set(self.edje.obj, self.part,
                                                  self.name, self.value, 1)
        else:
            edje_edit_state_image_border_fill_set(self.edje.obj, self.part,
                                                  self.name, self.value, 0)

    property image_border_fill:
        def __get__(self):
            return self.image_border_fill_get()
        def __set__(self, value):
            self.image_border_fill_set(value)

    property tweens:
        def __get__(self):
            "@rtype: list of str"
            cdef evas.c_evas.Eina_List *lst, *itr
            ret = []
            lst = edje_edit_state_tweens_list_get(self.edje.obj, self.part,
                                                  self.name, self.value)
            itr = lst
            while itr:
                ret.append(<char*>itr.data)
                itr = itr.next
            edje_edit_string_list_free(lst)
            return ret

    def tween_add(self, char *img):
        return bool(edje_edit_state_tween_add(self.edje.obj, self.part,
                                              self.name, self.value, img))

    def tween_del(self, char *img):
        return bool(edje_edit_state_tween_del(self.edje.obj, self.part,
                                              self.name, self.value, img))
    """