summaryrefslogtreecommitdiff
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
parent649075412d868b4fc51b368a67c7acc2385dfe79 (diff)
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 @@
1
2cdef extern from "Elementary.h":
3 int elm_init(int argc, char **argv)
4 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 @@
1
2
3cimport elm_add
4
5def elm_run():
6 elm_add.elm_run()
7
8
9def elm_init(argv):
10 cdef void *p
11# s = " ".join(argv)
12# cdef char *cstr
13# cdef char **p_cstr
14# cstr = <char*>s
15# print "cstr = ", cstr
16# c_csrt = <char**>cstr
17# print "p_cstr[0] = ", p_cstr[0]
18 p = NULL
19 return <int>(elm_add.elm_init(len(argv), NULL))
20
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":
70 Eina_Bool eo_class_do(Eo_Class *klass, ...) 70 Eina_Bool eo_class_do(Eo_Class *klass, ...)
71 71
72 72
73cdef extern from "Elementary.h":
74 int elm_init(int argc, char **argv)
75 void elm_run()
76
77
78cdef class EoDefault: 73cdef class EoDefault:
79 cdef Eo *eo 74 cdef Eo *eo
80 cdef object name 75 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
18def init(): 18def init():
19 return bool(eodefault.eo_init()) 19 return bool(eodefault.eo_init())
20 20
21def elem_run():
22 eodefault.elm_run()
23
24def py_elm_init(argv):
25 cdef void *p
26# s = " ".join(argv)
27# cdef char *cstr
28# cdef char **p_cstr
29# cstr = <char*>s
30# print "cstr = ", cstr
31# c_csrt = <char**>cstr
32# print "p_cstr[0] = ", p_cstr[0]
33 p = NULL
34 return <int>(eodefault.elm_init(len(argv), NULL))
35
36######################################################### 21#########################################################
37 22
38cdef Eo *_eo_instance_get(EoDefault pyobj): 23cdef 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 @@
1# -*- coding: UTF-8 -*- 1# -*- coding: UTF-8 -*-
2import sys 2import sys
3 3
4from base.eodefault import py_elm_init, elem_run
5from eobase import EoBase 4from eobase import EoBase
6from evas.py2.evas_py import ElwWin, ElwBox, ElwButton, ElwBoxedbutton, ExEvasObject 5from evas.py2.evas_py import ElwWin, ElwBox, ElwButton, ElwBoxedbutton, ExEvasObject
6from evas.py2.evas_py import elm_run, elm_init
7 7
8 8
9lst = [56, "elm", 56.76] 9lst = [56, "elm", 56.76]
10 10
11print "Initializing Elementary..." 11print "Initializing Elementary..."
12print "Init res:", py_elm_init(sys.argv) 12print "Init res:", elm_init(sys.argv)
13print "" 13print ""
14 14
15global_obj = None 15global_obj = None
@@ -145,9 +145,9 @@ ba.elw_button_text_set("(B) ADD cb")
145cb_obj5 = (cb_clicked, lst) 145cb_obj5 = (cb_clicked, lst)
146print cb_obj5 146print cb_obj5
147ba.event_callback_priority_add(ElwButton.CLICKED, 0, cb_obj5) 147ba.event_callback_priority_add(ElwButton.CLICKED, 0, cb_obj5)
148ba.event_callback_del(ElwButton.CLICKED, cb_obj5) 148#ba.event_callback_del(ElwButton.CLICKED, cb_obj5)
149 149
150print "Running Elementary..." 150print "Running Elementary..."
151 151
152elem_run() 152elm_run()
153 153