aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-12-06 19:53:16 +0200
committerYakov Goldberg <yakov.g@samsung.com>2012-12-06 19:53:16 +0200
commit4884084fbf61c6446c90bc9d8eec6018789942c1 (patch)
tree61857bb7221fce2eae6d55b9d9b332b2c8d91e46
parentDeveloper's README added (diff)
downloadeo_bindings-4884084fbf61c6446c90bc9d8eec6018789942c1.tar.gz
Adding elm_init additional funcs
Sometimes some additional functions like elm_init(), elm_run() are needes. These functions are not introspectable. So they must be added manually. To do this user must provide definitions in *.pxd *.pxi files. And include *.pxi into generated 'module_name.pyx' file. Changes: 'elm_init()', 'elm_run()' removed from eodefault. 'elm_add.pxi', 'elm_add.pxd' added to eo_py folder Examples updated Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
-rw-r--r--eo_py/elm_add.pxd4
-rw-r--r--eo_py/elm_add.pxi20
-rw-r--r--eo_py/eodefault.pxd5
-rw-r--r--eo_py/eodefault.pyx15
-rw-r--r--examples/evas_test2.py8
5 files changed, 28 insertions, 24 deletions
diff --git a/eo_py/elm_add.pxd b/eo_py/elm_add.pxd
new file mode 100644
index 0000000..dcc5d57
--- /dev/null
+++ b/eo_py/elm_add.pxd
@@ -0,0 +1,4 @@
+
+cdef extern from "Elementary.h":
+ int elm_init(int argc, char **argv)
+ void elm_run()
diff --git a/eo_py/elm_add.pxi b/eo_py/elm_add.pxi
new file mode 100644
index 0000000..0d16713
--- /dev/null
+++ b/eo_py/elm_add.pxi
@@ -0,0 +1,20 @@
+
+
+cimport elm_add
+
+def elm_run():
+ elm_add.elm_run()
+
+
+def elm_init(argv):
+ cdef void *p
+# s = " ".join(argv)
+# cdef char *cstr
+# cdef char **p_cstr
+# cstr = <char*>s
+# print "cstr = ", cstr
+# c_csrt = <char**>cstr
+# print "p_cstr[0] = ", p_cstr[0]
+ p = NULL
+ return <int>(elm_add.elm_init(len(argv), NULL))
+
diff --git a/eo_py/eodefault.pxd b/eo_py/eodefault.pxd
index 8978cea..2f3aadc 100644
--- a/eo_py/eodefault.pxd
+++ b/eo_py/eodefault.pxd
@@ -70,11 +70,6 @@ cdef extern from "Eo.h":
Eina_Bool eo_class_do(Eo_Class *klass, ...)
-cdef extern from "Elementary.h":
- int elm_init(int argc, char **argv)
- void elm_run()
-
-
cdef class EoDefault:
cdef Eo *eo
cdef object name
diff --git a/eo_py/eodefault.pyx b/eo_py/eodefault.pyx
index 2a9ac00..0842514 100644
--- a/eo_py/eodefault.pyx
+++ b/eo_py/eodefault.pyx
@@ -18,21 +18,6 @@ CALLBACK_STOP = 12345
def init():
return bool(eodefault.eo_init())
-def elem_run():
- eodefault.elm_run()
-
-def py_elm_init(argv):
- cdef void *p
-# s = " ".join(argv)
-# cdef char *cstr
-# cdef char **p_cstr
-# cstr = <char*>s
-# print "cstr = ", cstr
-# c_csrt = <char**>cstr
-# print "p_cstr[0] = ", p_cstr[0]
- p = NULL
- return <int>(eodefault.elm_init(len(argv), NULL))
-
#########################################################
cdef Eo *_eo_instance_get(EoDefault pyobj):
diff --git a/examples/evas_test2.py b/examples/evas_test2.py
index 4f3080e..e9a64cf 100644
--- a/examples/evas_test2.py
+++ b/examples/evas_test2.py
@@ -1,15 +1,15 @@
# -*- coding: UTF-8 -*-
import sys
-from base.eodefault import py_elm_init, elem_run
from eobase import EoBase
from evas.py2.evas_py import ElwWin, ElwBox, ElwButton, ElwBoxedbutton, ExEvasObject
+from evas.py2.evas_py import elm_run, elm_init
lst = [56, "elm", 56.76]
print "Initializing Elementary..."
-print "Init res:", py_elm_init(sys.argv)
+print "Init res:", elm_init(sys.argv)
print ""
global_obj = None
@@ -145,9 +145,9 @@ ba.elw_button_text_set("(B) ADD cb")
cb_obj5 = (cb_clicked, lst)
print cb_obj5
ba.event_callback_priority_add(ElwButton.CLICKED, 0, cb_obj5)
-ba.event_callback_del(ElwButton.CLICKED, cb_obj5)
+#ba.event_callback_del(ElwButton.CLICKED, cb_obj5)
print "Running Elementary..."
-elem_run()
+elm_run()