summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-03-27 04:54:30 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2015-03-27 05:00:08 +0200
commit02fa82441f85c3b9279c19d66171652dfded6787 (patch)
treedade8ce29fcda6891cb51aaaa3627e1cc380e7cd
parent8ba060b80f60cfe3e8c6e5575c4dd6ea4d167429 (diff)
Eolian: Updates to follow changes in Eodevs/kuuko/eolian
-rw-r--r--efl2/eo/efl2.eo.pyx20
-rw-r--r--eolian/converters.py7
-rwxr-xr-xeolian/generator.py8
-rw-r--r--include/efl2.c_eo.pxd10
-rw-r--r--include/efl2.evas.enums.pxd15
-rw-r--r--include/efl2.evas.pxd8
6 files changed, 48 insertions, 20 deletions
diff --git a/efl2/eo/efl2.eo.pyx b/efl2/eo/efl2.eo.pyx
index a606044..97625e8 100644
--- a/efl2/eo/efl2.eo.pyx
+++ b/efl2/eo/efl2.eo.pyx
@@ -29,7 +29,7 @@ from efl2.c_eo cimport Eo as Eo, eo_init, eo_shutdown, eo_del, eo_do, \
29 eo_parent_get, eo_parent_set, Eo_Event_Description, \ 29 eo_parent_get, eo_parent_set, Eo_Event_Description, \
30 eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \ 30 eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \
31 eo_event_global_freeze, eo_event_global_thaw, \ 31 eo_event_global_freeze, eo_event_global_thaw, \
32 eo_event_global_freeze_count_get, eo_add_ref 32 eo_event_global_freeze_count_get, eo_add_ref, eo_do_ret
33 33
34cimport efl2.eo.enums as enums 34cimport efl2.eo.enums as enums
35 35
@@ -56,9 +56,9 @@ def shutdown():
56init() 56init()
57 57
58def event_global_freeze_count_get(): 58def event_global_freeze_count_get():
59 cdef int fcount 59 cdef int fcount = 0
60 fcount = <int>eo_do(<const Eo *>eo_base_class_get(), 60 eo_do_ret(<const Eo *>eo_base_class_get(), fcount,
61 eo_event_global_freeze_count_get()) 61 eo_event_global_freeze_count_get())
62 return fcount 62 return fcount
63 63
64def event_global_freeze(): 64def event_global_freeze():
@@ -101,7 +101,7 @@ cdef void _object_mapping_unregister(char *name):
101cdef api object object_from_instance(Eo *obj): 101cdef api object object_from_instance(Eo *obj):
102 """ Create a python object from a C Eo object pointer. """ 102 """ Create a python object from a C Eo object pointer. """
103 cdef: 103 cdef:
104 void *data 104 void *data = NULL
105 _Eo o 105 _Eo o
106 const char *cls_name = eo_class_name_get(eo_class_get(obj)) 106 const char *cls_name = eo_class_name_get(eo_class_get(obj))
107 type cls 107 type cls
@@ -110,7 +110,7 @@ cdef api object object_from_instance(Eo *obj):
110 if obj == NULL: 110 if obj == NULL:
111 return None 111 return None
112 112
113 data = eo_do(obj, eo_key_data_get("python-eo")) 113 eo_do_ret(obj, data, eo_key_data_get("python-eo"))
114 if data != NULL: 114 if data != NULL:
115 EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, 115 EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN,
116 "Returning a Python object instance for Eo of type %s.", cls_name) 116 "Returning a Python object instance for Eo of type %s.", cls_name)
@@ -289,7 +289,7 @@ cdef class _Eo(object):
289 def __repr__(self): 289 def __repr__(self):
290 cdef Eo *parent = NULL 290 cdef Eo *parent = NULL
291 if self.obj != NULL: 291 if self.obj != NULL:
292 parent = <Eo *>eo_do(self.obj, eo_parent_get()) 292 eo_do_ret(self.obj, parent, eo_parent_get())
293 return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % ( 293 return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % (
294 type(self).__name__, 294 type(self).__name__,
295 <uintptr_t><void *>self, 295 <uintptr_t><void *>self,
@@ -356,7 +356,8 @@ cdef class _Eo(object):
356 :rtype: :class:`Eo` 356 :rtype: :class:`Eo`
357 357
358 """ 358 """
359 cdef Eo *parent = <Eo *>eo_do(self.obj, eo_parent_get()) 359 cdef Eo *parent = NULL
360 eo_do_ret(self.obj, parent, eo_parent_get())
360 return object_from_instance(parent) 361 return object_from_instance(parent)
361 362
362 def event_freeze(self): 363 def event_freeze(self):
@@ -374,7 +375,8 @@ cdef class _Eo(object):
374 :rtype: int 375 :rtype: int
375 376
376 """ 377 """
377 cdef int fcount = <int>eo_do(self.obj, eo_event_freeze_count_get()) 378 cdef int fcount = 0
379 eo_do_ret(self.obj, fcount, eo_event_freeze_count_get())
378 return fcount 380 return fcount
379 381
380 def event_callback_add(self, event_name, func): 382 def event_callback_add(self, event_name, func):
diff --git a/eolian/converters.py b/eolian/converters.py
index cab4cd5..4b55ddf 100644
--- a/eolian/converters.py
+++ b/eolian/converters.py
@@ -115,16 +115,19 @@ def conv_cls_name(cls):
115 else: 115 else:
116 s = cls.name.split("_") 116 s = cls.name.split("_")
117 if len(s) > 1: 117 if len(s) > 1:
118 lib_name = s[0] 118 lib_name = s[0].lower()
119 name = "_".join(s[1:]) 119 name = "_".join(s[1:])
120 if name[0].isdigit(): 120 if name[0].isdigit():
121 name = lib_name + name 121 name = lib_name + name
122 else: 122 else:
123 lib_name = s 123 lib_name = s.lower()
124 name = s 124 name = s
125 if name[0].isdigit(): 125 if name[0].isdigit():
126 name = "A" + name 126 name = "A" + name
127 127
128 lib_name = lib_name.replace("elm", "elementary")
129 lib_name = "efl2." + lib_name
130
128 return lib_name, name 131 return lib_name, name
129 132
130 133
diff --git a/eolian/generator.py b/eolian/generator.py
index cbf07da..8506fb7 100755
--- a/eolian/generator.py
+++ b/eolian/generator.py
@@ -173,7 +173,7 @@ class PyxGenerator(Generator):
173 self.write(")") 173 self.write(")")
174 self.dedent() 174 self.dedent()
175 175
176 self.write("_eo_do_end(&self.obj)") 176 self.write("_eo_do_end()")
177 177
178 178
179class Function(object): 179class Function(object):
@@ -651,15 +651,15 @@ class Class(object):
651 inherits.append("_Eo") 651 inherits.append("_Eo")
652 continue 652 continue
653 lib_name, name = conv_cls_name(i_cls) 653 lib_name, name = conv_cls_name(i_cls)
654 inherits.append("_" + name) 654 inherits.append("%s._%s" % (lib_name, name))
655 else: 655 else:
656 log.warn("Inherited class %s is unknown" % (i)) 656 log.error("Inherited class %s is unknown" % (i))
657 i = i.rpartition(".")[2] 657 i = i.rpartition(".")[2]
658 inherits.append("_" + i) 658 inherits.append("_" + i)
659 if len(inherits) > 1: 659 if len(inherits) > 1:
660 log.error( 660 log.error(
661 "Multiple inheritance is not supported in extension classes.\n" 661 "Multiple inheritance is not supported in extension classes.\n"
662 "Class: %r" % (self.c_name) 662 "Class: %r inherits: %r" % (self.c_name, inherits)
663 ) 663 )
664 return 664 return
665 665
diff --git a/include/efl2.c_eo.pxd b/include/efl2.c_eo.pxd
index 6a02ff9..fd077da 100644
--- a/include/efl2.c_eo.pxd
+++ b/include/efl2.c_eo.pxd
@@ -26,9 +26,10 @@ cdef extern from "Eo.h":
26 #################################################################### 26 ####################################################################
27 # Structures 27 # Structures
28 # 28 #
29 ctypedef struct Eo 29 ctypedef struct _Eo_Opaque
30 ctypedef _Eo_Opaque Eo
30 31
31 ctypedef struct Eo_Class 32 ctypedef Eo Eo_Class
32 33
33 ctypedef struct Eo_Event_Description: 34 ctypedef struct Eo_Event_Description:
34 const char *name 35 const char *name
@@ -65,7 +66,8 @@ cdef extern from "Eo.h":
65 66
66 void eo_wref_add(Eo **wref) 67 void eo_wref_add(Eo **wref)
67 68
68 void *eo_do(Eo *obj, ...) 69 void eo_do(Eo *obj, ...)
70 void *eo_do_ret(Eo *obj, ...)
69 const Eo_Class *eo_base_class_get() 71 const Eo_Class *eo_base_class_get()
70 72
71 void eo_key_data_set(const char *key, const void *data, eo_key_data_free_func free_func) 73 void eo_key_data_set(const char *key, const void *data, eo_key_data_free_func free_func)
@@ -93,4 +95,4 @@ cdef extern from "Eo.h":
93 void eo_event_callback_del(const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data) 95 void eo_event_callback_del(const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data)
94 96
95 Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, const char *file, const char *func, int line) 97 Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, const char *file, const char *func, int line)
96 void _eo_do_end(const Eo **ojb) 98 void _eo_do_end()
diff --git a/include/efl2.evas.enums.pxd b/include/efl2.evas.enums.pxd
index 396a492..9a7f63b 100644
--- a/include/efl2.evas.enums.pxd
+++ b/include/efl2.evas.enums.pxd
@@ -284,3 +284,18 @@ cdef extern from "Evas.h":
284 EVAS_TEXTGRID_FONT_STYLE_NORMAL # Normal style 284 EVAS_TEXTGRID_FONT_STYLE_NORMAL # Normal style
285 EVAS_TEXTGRID_FONT_STYLE_BOLD # Bold style 285 EVAS_TEXTGRID_FONT_STYLE_BOLD # Bold style
286 EVAS_TEXTGRID_FONT_STYLE_ITALIC # Oblique style 286 EVAS_TEXTGRID_FONT_STYLE_ITALIC # Oblique style
287
288
289 ctypedef enum Evas_Axis_Label:
290 EVAS_AXIS_LABEL_UNKNOWN # Axis containing unknown (or not yet representable) data. Range: Unbounded. Unit: Undefined. @since 1.13 */
291 EVAS_AXIS_LABEL_X # Position along physical X axis; not window relative. Range: Unbounded. Unit: Undefined. @since 1.13 */
292 EVAS_AXIS_LABEL_Y # Position along physical Y axis; not window relative. Range: Unbounded. Unit: Undefined. @since 1.13 */
293 EVAS_AXIS_LABEL_PRESSURE # Force applied to tool tip. Range: [0.0, 1.0]. Unit: Unitless. @since 1.13 */
294 EVAS_AXIS_LABEL_DISTANCE # Relative distance along physical Z axis. Range: [0.0, 1.0]. Unit: Unitless @since 1.13 */
295 EVAS_AXIS_LABEL_AZIMUTH # Angle of tool about the Z axis from positive X axis. Range: [-PI, PI]. Unit: Radians. @since 1.13 */
296 EVAS_AXIS_LABEL_TILT # Angle of tool about plane of sensor from positive Z axis. Range: [0.0, PI]. Unit: Radians. @since 1.13 */
297 EVAS_AXIS_LABEL_TWIST # Rotation of tool about its major axis from its "natural" position. Range: [-PI, PI] Unit: Radians. @since 1.13 */
298 EVAS_AXIS_LABEL_TOUCH_WIDTH_MAJOR # Length of contact ellipse along AZIMUTH. Range: Unbounded: Unit: Same as EVAS_AXIS_LABEL_{X,Y}. @since 1.13 */
299 EVAS_AXIS_LABEL_TOUCH_WIDTH_MINOR # Length of contact ellipse perpendicular to AZIMUTH. Range: Unbounded. Unit: Same as EVAS_AXIS_LABEL_{X,Y}. @since 1.13 */
300 EVAS_AXIS_LABEL_TOOL_WIDTH_MAJOR # Length of tool ellipse along AZIMUTH. Range: Unbounded. Unit: Same as EVAS_AXIS_LABEL_{X,Y}. @since 1.13 */
301 EVAS_AXIS_LABEL_TOOL_WIDTH_MINOR # Length of tool ellipse perpendicular to AZIMUTH. Range: Unbounded. Unit: Same as EVAS_AXIS_LABEL_{X,Y}. @since 1.13 */
diff --git a/include/efl2.evas.pxd b/include/efl2.evas.pxd
index 9329fd9..82151a2 100644
--- a/include/efl2.evas.pxd
+++ b/include/efl2.evas.pxd
@@ -25,7 +25,8 @@ from efl2.evas.enums cimport Evas_Event_Flags, Evas_Button_Flags, \
25 Evas_Textgrid_Palette, Evas_Textgrid_Font_Style, \ 25 Evas_Textgrid_Palette, Evas_Textgrid_Font_Style, \
26 Evas_Fill_Spread, Evas_Image_Scale_Hint, Evas_Image_Content_Hint, \ 26 Evas_Fill_Spread, Evas_Image_Scale_Hint, Evas_Image_Content_Hint, \
27 Evas_Image_Animated_Loop_Hint, Evas_Object_Table_Homogeneous_Mode, \ 27 Evas_Image_Animated_Loop_Hint, Evas_Object_Table_Homogeneous_Mode, \
28 Evas_Display_Mode, Evas_BiDi_Direction, Evas_Touch_Point_State 28 Evas_Display_Mode, Evas_BiDi_Direction, Evas_Touch_Point_State, \
29 Evas_Axis_Label
29 30
30cdef extern from "Evas.h": 31cdef extern from "Evas.h":
31 #################################################################### 32 ####################################################################
@@ -255,6 +256,11 @@ cdef extern from "Evas.h":
255 Evas_Event_Flags event_flags 256 Evas_Event_Flags event_flags
256 Evas_Device *dev 257 Evas_Device *dev
257 258
259 cdef struct _Evas_Axis:
260 Evas_Axis_Label label
261 double value
262 ctypedef _Evas_Axis Evas_Axis
263
258 ctypedef struct Evas_Object_Box_Option: 264 ctypedef struct Evas_Object_Box_Option:
259 Evas_Object *obj 265 Evas_Object *obj
260 266