Eolian: Updates to follow changes in Eo

This commit is contained in:
Kai Huuhko 2015-03-27 04:54:30 +02:00
parent 8ba060b80f
commit 02fa82441f
6 changed files with 48 additions and 20 deletions

View File

@ -29,7 +29,7 @@ from efl2.c_eo cimport Eo as Eo, eo_init, eo_shutdown, eo_del, eo_do, \
eo_parent_get, eo_parent_set, Eo_Event_Description, \
eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \
eo_event_global_freeze, eo_event_global_thaw, \
eo_event_global_freeze_count_get, eo_add_ref
eo_event_global_freeze_count_get, eo_add_ref, eo_do_ret
cimport efl2.eo.enums as enums
@ -56,9 +56,9 @@ def shutdown():
init()
def event_global_freeze_count_get():
cdef int fcount
fcount = <int>eo_do(<const Eo *>eo_base_class_get(),
eo_event_global_freeze_count_get())
cdef int fcount = 0
eo_do_ret(<const Eo *>eo_base_class_get(), fcount,
eo_event_global_freeze_count_get())
return fcount
def event_global_freeze():
@ -101,7 +101,7 @@ cdef void _object_mapping_unregister(char *name):
cdef api object object_from_instance(Eo *obj):
""" Create a python object from a C Eo object pointer. """
cdef:
void *data
void *data = NULL
_Eo o
const char *cls_name = eo_class_name_get(eo_class_get(obj))
type cls
@ -110,7 +110,7 @@ cdef api object object_from_instance(Eo *obj):
if obj == NULL:
return None
data = eo_do(obj, eo_key_data_get("python-eo"))
eo_do_ret(obj, data, eo_key_data_get("python-eo"))
if data != NULL:
EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN,
"Returning a Python object instance for Eo of type %s.", cls_name)
@ -289,7 +289,7 @@ cdef class _Eo(object):
def __repr__(self):
cdef Eo *parent = NULL
if self.obj != NULL:
parent = <Eo *>eo_do(self.obj, eo_parent_get())
eo_do_ret(self.obj, parent, eo_parent_get())
return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % (
type(self).__name__,
<uintptr_t><void *>self,
@ -356,7 +356,8 @@ cdef class _Eo(object):
:rtype: :class:`Eo`
"""
cdef Eo *parent = <Eo *>eo_do(self.obj, eo_parent_get())
cdef Eo *parent = NULL
eo_do_ret(self.obj, parent, eo_parent_get())
return object_from_instance(parent)
def event_freeze(self):
@ -374,7 +375,8 @@ cdef class _Eo(object):
:rtype: int
"""
cdef int fcount = <int>eo_do(self.obj, eo_event_freeze_count_get())
cdef int fcount = 0
eo_do_ret(self.obj, fcount, eo_event_freeze_count_get())
return fcount
def event_callback_add(self, event_name, func):

View File

@ -115,16 +115,19 @@ def conv_cls_name(cls):
else:
s = cls.name.split("_")
if len(s) > 1:
lib_name = s[0]
lib_name = s[0].lower()
name = "_".join(s[1:])
if name[0].isdigit():
name = lib_name + name
else:
lib_name = s
lib_name = s.lower()
name = s
if name[0].isdigit():
name = "A" + name
lib_name = lib_name.replace("elm", "elementary")
lib_name = "efl2." + lib_name
return lib_name, name

View File

@ -173,7 +173,7 @@ class PyxGenerator(Generator):
self.write(")")
self.dedent()
self.write("_eo_do_end(&self.obj)")
self.write("_eo_do_end()")
class Function(object):
@ -651,15 +651,15 @@ class Class(object):
inherits.append("_Eo")
continue
lib_name, name = conv_cls_name(i_cls)
inherits.append("_" + name)
inherits.append("%s._%s" % (lib_name, name))
else:
log.warn("Inherited class %s is unknown" % (i))
log.error("Inherited class %s is unknown" % (i))
i = i.rpartition(".")[2]
inherits.append("_" + i)
if len(inherits) > 1:
log.error(
"Multiple inheritance is not supported in extension classes.\n"
"Class: %r" % (self.c_name)
"Class: %r inherits: %r" % (self.c_name, inherits)
)
return

View File

@ -26,9 +26,10 @@ cdef extern from "Eo.h":
####################################################################
# Structures
#
ctypedef struct Eo
ctypedef struct _Eo_Opaque
ctypedef _Eo_Opaque Eo
ctypedef struct Eo_Class
ctypedef Eo Eo_Class
ctypedef struct Eo_Event_Description:
const char *name
@ -65,7 +66,8 @@ cdef extern from "Eo.h":
void eo_wref_add(Eo **wref)
void *eo_do(Eo *obj, ...)
void eo_do(Eo *obj, ...)
void *eo_do_ret(Eo *obj, ...)
const Eo_Class *eo_base_class_get()
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":
void eo_event_callback_del(const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data)
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)
void _eo_do_end(const Eo **ojb)
void _eo_do_end()

View File

@ -284,3 +284,18 @@ cdef extern from "Evas.h":
EVAS_TEXTGRID_FONT_STYLE_NORMAL # Normal style
EVAS_TEXTGRID_FONT_STYLE_BOLD # Bold style
EVAS_TEXTGRID_FONT_STYLE_ITALIC # Oblique style
ctypedef enum Evas_Axis_Label:
EVAS_AXIS_LABEL_UNKNOWN # Axis containing unknown (or not yet representable) data. Range: Unbounded. Unit: Undefined. @since 1.13 */
EVAS_AXIS_LABEL_X # Position along physical X axis; not window relative. Range: Unbounded. Unit: Undefined. @since 1.13 */
EVAS_AXIS_LABEL_Y # Position along physical Y axis; not window relative. Range: Unbounded. Unit: Undefined. @since 1.13 */
EVAS_AXIS_LABEL_PRESSURE # Force applied to tool tip. Range: [0.0, 1.0]. Unit: Unitless. @since 1.13 */
EVAS_AXIS_LABEL_DISTANCE # Relative distance along physical Z axis. Range: [0.0, 1.0]. Unit: Unitless @since 1.13 */
EVAS_AXIS_LABEL_AZIMUTH # Angle of tool about the Z axis from positive X axis. Range: [-PI, PI]. Unit: Radians. @since 1.13 */
EVAS_AXIS_LABEL_TILT # Angle of tool about plane of sensor from positive Z axis. Range: [0.0, PI]. Unit: Radians. @since 1.13 */
EVAS_AXIS_LABEL_TWIST # Rotation of tool about its major axis from its "natural" position. Range: [-PI, PI] Unit: Radians. @since 1.13 */
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 */
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 */
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 */
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 */

View File

@ -25,7 +25,8 @@ from efl2.evas.enums cimport Evas_Event_Flags, Evas_Button_Flags, \
Evas_Textgrid_Palette, Evas_Textgrid_Font_Style, \
Evas_Fill_Spread, Evas_Image_Scale_Hint, Evas_Image_Content_Hint, \
Evas_Image_Animated_Loop_Hint, Evas_Object_Table_Homogeneous_Mode, \
Evas_Display_Mode, Evas_BiDi_Direction, Evas_Touch_Point_State
Evas_Display_Mode, Evas_BiDi_Direction, Evas_Touch_Point_State, \
Evas_Axis_Label
cdef extern from "Evas.h":
####################################################################
@ -255,6 +256,11 @@ cdef extern from "Evas.h":
Evas_Event_Flags event_flags
Evas_Device *dev
cdef struct _Evas_Axis:
Evas_Axis_Label label
double value
ctypedef _Evas_Axis Evas_Axis
ctypedef struct Evas_Object_Box_Option:
Evas_Object *obj