summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2012-06-14 20:29:12 +0000
committerKai Huuhko <kai.huuhko@gmail.com>2012-06-14 20:29:12 +0000
commit301cda3a2fb41bce39328ca60998e174b0c1183d (patch)
treef794fb1febd2b3c751f009b0dba4a07271a1c11e
parent85bb36fc5ecc17e8338dd328c534a6319da32ed8 (diff)
python-bindings: Put the metaclass hacks back in, need to make them py3
compatible later. This makes editje work again. SVN revision: 72151
-rw-r--r--edje/edje.c_edje.pyx9
-rw-r--r--edje/edje.c_edje_object.pxi8
2 files changed, 14 insertions, 3 deletions
diff --git a/edje/edje.c_edje.pyx b/edje/edje.c_edje.pyx
index 9335790..b6daf9a 100644
--- a/edje/edje.c_edje.pyx
+++ b/edje/edje.c_edje.pyx
@@ -331,6 +331,15 @@ class EdjeObjectMeta(evas.c_evas.EvasObjectMeta):
331 elif hasattr(val, "edje_text_change_callback"): 331 elif hasattr(val, "edje_text_change_callback"):
332 txt_append(name) 332 txt_append(name)
333 333
334cdef extern from "Python.h":
335 ctypedef struct PyTypeObject:
336 PyTypeObject *ob_type
337
338cdef void _install_metaclass(PyTypeObject *ctype, object metaclass):
339 Py_INCREF(metaclass)
340 ctype.ob_type = <PyTypeObject*>metaclass
341
342
334include "edje.c_edje_message.pxi" 343include "edje.c_edje_message.pxi"
335include "edje.c_edje_external.pxi" 344include "edje.c_edje_external.pxi"
336include "edje.c_edje_object.pxi" 345include "edje.c_edje_object.pxi"
diff --git a/edje/edje.c_edje_object.pxi b/edje/edje.c_edje_object.pxi
index e74b953..4c41ee6 100644
--- a/edje/edje.c_edje_object.pxi
+++ b/edje/edje.c_edje_object.pxi
@@ -139,9 +139,6 @@ cdef public class Edje(evas.c_evas.Object) [object PyEdje, type PyEdje_Type]:
139 ... 139 ...
140 >>> my_edje.message_handler_set(msg_dbg) 140 >>> my_edje.message_handler_set(msg_dbg)
141 """ 141 """
142
143 __metaclass__ = EdjeObjectMeta
144
145 def __cinit__(self, *a, **ka): 142 def __cinit__(self, *a, **ka):
146 self._signal_callbacks = {} 143 self._signal_callbacks = {}
147 144
@@ -1010,4 +1007,9 @@ cdef public class Edje(evas.c_evas.Object) [object PyEdje, type PyEdje_Type]:
1010 "Emit signal with B{emission} and B{source}" 1007 "Emit signal with B{emission} and B{source}"
1011 edje_object_signal_emit(self.obj, emission, source) 1008 edje_object_signal_emit(self.obj, emission, source)
1012 1009
1010cdef extern from "Edje.h": # hack to force type to be known
1011 cdef PyTypeObject PyEdje_Type # hack to install metaclass
1012_install_metaclass(&PyEdje_Type, EdjeObjectMeta)
1013
1014
1013evas.c_evas._object_mapping_register("edje", Edje) 1015evas.c_evas._object_mapping_register("edje", Edje)