summaryrefslogtreecommitdiff
path: root/efl
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-01-04 22:02:09 +0100
committerDave Andreoli <dave@gurumeditation.it>2015-01-04 22:02:09 +0100
commit3ebc6f21e9f206a079f874bc8183f23d84c03c35 (patch)
treec787936ced1fa134153dae56ce6d8b992ba5d852 /efl
parent419405e456c3b774ea726d199dbef07ac734a11b (diff)
New style enums for edje
Diffstat (limited to 'efl')
-rw-r--r--efl/edje/efl.edje.pyx100
-rw-r--r--efl/edje/efl.edje_external.pxi20
-rw-r--r--efl/edje/efl.edje_message.pxi24
-rw-r--r--efl/edje/efl.edje_object.pxi12
4 files changed, 28 insertions, 128 deletions
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
index 28de858..3a79c06 100644
--- a/efl/edje/efl.edje.pyx
+++ b/efl/edje/efl.edje.pyx
@@ -30,106 +30,6 @@ from efl.utils.conversions cimport _ctouni, _touni, \
30 eina_list_strings_to_python_list 30 eina_list_strings_to_python_list
31 31
32 32
33# Edje_Message_Type:
34EDJE_MESSAGE_NONE = 0
35EDJE_MESSAGE_SIGNAL = 1
36EDJE_MESSAGE_STRING = 2
37EDJE_MESSAGE_INT = 3
38EDJE_MESSAGE_FLOAT = 4
39EDJE_MESSAGE_STRING_SET = 5
40EDJE_MESSAGE_INT_SET = 6
41EDJE_MESSAGE_FLOAT_SET = 7
42EDJE_MESSAGE_STRING_INT = 8
43EDJE_MESSAGE_STRING_FLOAT = 9
44EDJE_MESSAGE_STRING_INT_SET = 10
45EDJE_MESSAGE_STRING_FLOAT_SET = 11
46
47# Edje_Aspect_Control:
48EDJE_ASPECT_CONTROL_NONE = 0
49EDJE_ASPECT_CONTROL_NEITHER = 1
50EDJE_ASPECT_CONTROL_HORIZONTAL = 2
51EDJE_ASPECT_CONTROL_VERTICAL = 3
52EDJE_ASPECT_CONTROL_BOTH = 4
53
54# Edje_Drag_Dir:
55EDJE_DRAG_DIR_NONE = 0
56EDJE_DRAG_DIR_X = 1
57EDJE_DRAG_DIR_Y = 2
58EDJE_DRAG_DIR_XY = 3
59
60# Edje_Load_Error:
61EDJE_LOAD_ERROR_NONE = 0
62EDJE_LOAD_ERROR_GENERIC = 1
63EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2
64EDJE_LOAD_ERROR_PERMISSION_DENIED = 3
65EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4
66EDJE_LOAD_ERROR_CORRUPT_FILE = 5
67EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6
68EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7
69EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8
70
71# Edje_Part_Type:
72EDJE_PART_TYPE_NONE = 0
73EDJE_PART_TYPE_RECTANGLE = 1
74EDJE_PART_TYPE_TEXT = 2
75EDJE_PART_TYPE_IMAGE = 3
76EDJE_PART_TYPE_SWALLOW = 4
77EDJE_PART_TYPE_TEXTBLOCK = 5
78EDJE_PART_TYPE_GRADIENT = 6
79EDJE_PART_TYPE_GROUP = 7
80EDJE_PART_TYPE_BOX = 8
81EDJE_PART_TYPE_TABLE = 9
82EDJE_PART_TYPE_EXTERNAL = 10
83EDJE_PART_TYPE_LAST = 11
84
85# Edje_Text_Effect:
86EDJE_TEXT_EFFECT_NONE = 0
87EDJE_TEXT_EFFECT_PLAIN = 1
88EDJE_TEXT_EFFECT_OUTLINE = 2
89EDJE_TEXT_EFFECT_SOFT_OUTLINE = 3
90EDJE_TEXT_EFFECT_SHADOW = 4
91EDJE_TEXT_EFFECT_SOFT_SHADOW = 5
92EDJE_TEXT_EFFECT_OUTLINE_SHADOW = 6
93EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW = 7
94EDJE_TEXT_EFFECT_FAR_SHADOW = 8
95EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW = 9
96EDJE_TEXT_EFFECT_GLOW = 10
97EDJE_TEXT_EFFECT_LAST = 11
98
99# Edje_Action_Type:
100EDJE_ACTION_TYPE_NONE = 0
101EDJE_ACTION_TYPE_STATE_SET = 1
102EDJE_ACTION_TYPE_ACTION_STOP = 2
103EDJE_ACTION_TYPE_SIGNAL_EMIT = 3
104EDJE_ACTION_TYPE_DRAG_VAL_SET = 4
105EDJE_ACTION_TYPE_DRAG_VAL_STEP = 5
106EDJE_ACTION_TYPE_DRAG_VAL_PAGE = 6
107EDJE_ACTION_TYPE_SCRIPT = 7
108EDJE_ACTION_TYPE_FOCUS_SET = 8
109EDJE_ACTION_TYPE_LUA_SCRIPT = 9
110EDJE_ACTION_TYPE_LAST = 10
111
112# Edje_Tween_Mode:
113EDJE_TWEEN_MODE_NONE = 0
114EDJE_TWEEN_MODE_LINEAR = 1
115EDJE_TWEEN_MODE_SINUSOIDAL = 2
116EDJE_TWEEN_MODE_ACCELERATE = 3
117EDJE_TWEEN_MODE_DECELERATE = 4
118EDJE_TWEEN_MODE_LAST = 5
119
120# Edje_External_Param_Type:
121EDJE_EXTERNAL_PARAM_TYPE_INT = 0
122EDJE_EXTERNAL_PARAM_TYPE_DOUBLE = 1
123EDJE_EXTERNAL_PARAM_TYPE_STRING = 2
124EDJE_EXTERNAL_PARAM_TYPE_BOOL = 3
125EDJE_EXTERNAL_PARAM_TYPE_CHOICE = 4
126EDJE_EXTERNAL_PARAM_TYPE_MAX = 5
127
128# Edje_Input_Hints
129EDJE_INPUT_HINT_NONE = 0
130EDJE_INPUT_HINT_AUTO_COMPLETE = 1
131EDJE_INPUT_HINT_SENSITIVE_DATA = 2
132
133 33
134def init(): 34def init():
135 cdef int r = edje_init() 35 cdef int r = edje_init()
diff --git a/efl/edje/efl.edje_external.pxi b/efl/edje/efl.edje_external.pxi
index c09532e..021c509 100644
--- a/efl/edje/efl.edje_external.pxi
+++ b/efl/edje/efl.edje_external.pxi
@@ -60,15 +60,15 @@ cdef class ExternalParam:
60 def __get__(self): 60 def __get__(self):
61 if self.obj == NULL: 61 if self.obj == NULL:
62 raise ValueError("Object uninitialized") 62 raise ValueError("Object uninitialized")
63 if self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_INT: 63 if self.obj.type == <int>EDJE_EXTERNAL_PARAM_TYPE_INT:
64 return self.obj.i 64 return self.obj.i
65 elif self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: 65 elif self.obj.type == <int>EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
66 return self.obj.d 66 return self.obj.d
67 elif self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_STRING or \ 67 elif self.obj.type == <int>EDJE_EXTERNAL_PARAM_TYPE_STRING or \
68 self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE: 68 self.obj.type == <int>EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
69 if self.obj.s != NULL: 69 if self.obj.s != NULL:
70 return self.obj.s 70 return self.obj.s
71 elif self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL: 71 elif self.obj.type == <int>EDJE_EXTERNAL_PARAM_TYPE_BOOL:
72 return bool(self.obj.i) 72 return bool(self.obj.i)
73 73
74 74
@@ -313,15 +313,15 @@ cdef class ExternalParamInfoChoice(ExternalParamInfo):
313 313
314cdef ExternalParamInfo ExternalParamInfo_from_ptr(type, Edje_External_Param_Info *ptr): 314cdef ExternalParamInfo ExternalParamInfo_from_ptr(type, Edje_External_Param_Info *ptr):
315 cdef ExternalParamInfo p 315 cdef ExternalParamInfo p
316 if ptr.type == EDJE_EXTERNAL_PARAM_TYPE_INT: 316 if ptr.type == <int>EDJE_EXTERNAL_PARAM_TYPE_INT:
317 p = ExternalParamInfoInt() 317 p = ExternalParamInfoInt()
318 elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: 318 elif ptr.type == <int>EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
319 p = ExternalParamInfoDouble() 319 p = ExternalParamInfoDouble()
320 elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_STRING: 320 elif ptr.type == <int>EDJE_EXTERNAL_PARAM_TYPE_STRING:
321 p = ExternalParamInfoString() 321 p = ExternalParamInfoString()
322 elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL: 322 elif ptr.type == <int>EDJE_EXTERNAL_PARAM_TYPE_BOOL:
323 p = ExternalParamInfoBool() 323 p = ExternalParamInfoBool()
324 elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE: 324 elif ptr.type == <int>EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
325 p = ExternalParamInfoChoice() 325 p = ExternalParamInfoChoice()
326 else: 326 else:
327 msg = "Don't know how to convert parameter %s of type %s" % \ 327 msg = "Don't know how to convert parameter %s of type %s" % \
diff --git a/efl/edje/efl.edje_message.pxi b/efl/edje/efl.edje_message.pxi
index 6191c56..106297f 100644
--- a/efl/edje/efl.edje_message.pxi
+++ b/efl/edje/efl.edje_message.pxi
@@ -345,29 +345,29 @@ cdef Message MessageStringFloatSet_from_ptr(void *msg):
345 345
346cdef Message Message_from_type(Edje_Message_Type type, int id, void *msg): 346cdef Message Message_from_type(Edje_Message_Type type, int id, void *msg):
347 cdef Message m 347 cdef Message m
348 if type == EDJE_MESSAGE_NONE: 348 if type == <int>EDJE_MESSAGE_NONE:
349 return None 349 return None
350 elif type == EDJE_MESSAGE_SIGNAL: 350 elif type == <int>EDJE_MESSAGE_SIGNAL:
351 m = MessageSignal() 351 m = MessageSignal()
352 elif type == EDJE_MESSAGE_STRING: 352 elif type == <int>EDJE_MESSAGE_STRING:
353 m = MessageString_from_ptr(msg) 353 m = MessageString_from_ptr(msg)
354 elif type == EDJE_MESSAGE_INT: 354 elif type == <int>EDJE_MESSAGE_INT:
355 m = MessageInt_from_ptr(msg) 355 m = MessageInt_from_ptr(msg)
356 elif type == EDJE_MESSAGE_FLOAT: 356 elif type == <int>EDJE_MESSAGE_FLOAT:
357 m = MessageFloat_from_ptr(msg) 357 m = MessageFloat_from_ptr(msg)
358 elif type == EDJE_MESSAGE_STRING_SET: 358 elif type == <int>EDJE_MESSAGE_STRING_SET:
359 m = MessageStringSet_from_ptr(msg) 359 m = MessageStringSet_from_ptr(msg)
360 elif type == EDJE_MESSAGE_INT_SET: 360 elif type == <int>EDJE_MESSAGE_INT_SET:
361 m = MessageIntSet_from_ptr(msg) 361 m = MessageIntSet_from_ptr(msg)
362 elif type == EDJE_MESSAGE_FLOAT_SET: 362 elif type == <int>EDJE_MESSAGE_FLOAT_SET:
363 m = MessageFloatSet_from_ptr(msg) 363 m = MessageFloatSet_from_ptr(msg)
364 elif type == EDJE_MESSAGE_STRING_INT: 364 elif type == <int>EDJE_MESSAGE_STRING_INT:
365 m = MessageStringInt_from_ptr(msg) 365 m = MessageStringInt_from_ptr(msg)
366 elif type == EDJE_MESSAGE_STRING_FLOAT: 366 elif type == <int>EDJE_MESSAGE_STRING_FLOAT:
367 m = MessageStringFloat_from_ptr(msg) 367 m = MessageStringFloat_from_ptr(msg)
368 elif type == EDJE_MESSAGE_STRING_INT_SET : 368 elif type == <int>EDJE_MESSAGE_STRING_INT_SET :
369 m = MessageStringIntSet_from_ptr(msg) 369 m = MessageStringIntSet_from_ptr(msg)
370 elif type == EDJE_MESSAGE_STRING_FLOAT_SET : 370 elif type == <int>EDJE_MESSAGE_STRING_FLOAT_SET :
371 m = MessageStringFloatSet_from_ptr(msg) 371 m = MessageStringFloatSet_from_ptr(msg)
372 372
373 m._type = type 373 m._type = type
diff --git a/efl/edje/efl.edje_object.pxi b/efl/edje/efl.edje_object.pxi
index 1f8fdb7..b8ff7b2 100644
--- a/efl/edje/efl.edje_object.pxi
+++ b/efl/edje/efl.edje_object.pxi
@@ -810,19 +810,19 @@ cdef class Edje(Object):
810 810
811 p.name = c_param 811 p.name = c_param
812 p.type = edje_object_part_external_param_type_get(self.obj, c_part, c_param) 812 p.type = edje_object_part_external_param_type_get(self.obj, c_part, c_param)
813 if p.type >= EDJE_EXTERNAL_PARAM_TYPE_MAX: 813 if p.type >= <int>EDJE_EXTERNAL_PARAM_TYPE_MAX:
814 return None 814 return None
815 815
816 if not edje_object_part_external_param_get(self.obj, c_part, &p): 816 if not edje_object_part_external_param_get(self.obj, c_part, &p):
817 return None 817 return None
818 if p.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL: 818 if p.type == <int>EDJE_EXTERNAL_PARAM_TYPE_BOOL:
819 return bool(p.i) 819 return bool(p.i)
820 elif p.type == EDJE_EXTERNAL_PARAM_TYPE_INT: 820 elif p.type == <int>EDJE_EXTERNAL_PARAM_TYPE_INT:
821 return p.i 821 return p.i
822 elif p.type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: 822 elif p.type == <int>EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
823 return p.d 823 return p.d
824 elif p.type == EDJE_EXTERNAL_PARAM_TYPE_STRING or \ 824 elif p.type == <int>EDJE_EXTERNAL_PARAM_TYPE_STRING or \
825 p.type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE: 825 p.type == <int>EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
826 return _ctouni(p.s) 826 return _ctouni(p.s)
827 827
828 def part_box_append(self, part, Object obj): 828 def part_box_append(self, part, Object obj):