summaryrefslogtreecommitdiff
path: root/eorepo/eobase.pxi
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-12-17 17:00:29 +0200
committerYakov Goldberg <yakov.g@samsung.com>2012-12-17 17:00:29 +0200
commit27f48694bf3e54d822e3283d608f70462ec3beae (patch)
tree39f8eb1535ae148f0eff2014f5cd5f7888aabd4a /eorepo/eobase.pxi
parente48f50f43fea588337116a195fb8a709e1fcd885 (diff)
parent0f1e177277bcc61a123bfa58e77eeb19a573aee6 (diff)
Release 0.0.2HEADmaster
'eoparser' package, with tools 'eorepo' is provided with base classes
Diffstat (limited to 'eorepo/eobase.pxi')
-rw-r--r--eorepo/eobase.pxi108
1 files changed, 108 insertions, 0 deletions
diff --git a/eorepo/eobase.pxi b/eorepo/eobase.pxi
new file mode 100644
index 0000000..a09fb40
--- /dev/null
+++ b/eorepo/eobase.pxi
@@ -0,0 +1,108 @@
1########################################################
2##
3## generated from from "/home/yakov/xml/base/EoBase.xml"
4##
5########################################################
6
7cimport eobase as eobase
8from eodefault import EoDefault
9
10from cpython cimport Py_INCREF, Py_DECREF
11
12from eorepo.eodefault import pytext_to_utf8
13
14cdef int eobase_sub_id(int sub_id):
15 return eobase.EO_BASE_BASE_ID + sub_id
16
17class EoBase(EoDefault):
18
19 CALLBACK_DEL = <long>eobase.EO_EV_CALLBACK_DEL
20 DEL = <long>eobase.EO_EV_DEL
21 CALLBACK_ADD = <long>eobase.EO_EV_CALLBACK_ADD
22
23 def event_thaw(self):
24 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_THAW))
25
26 def event_freeze(self):
27 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_FREEZE))
28
29 def __init__(self, EoDefault parent):
30 instantiateable = False
31 if not instantiateable:
32 print "Class '%s' is not instantiate-able. Aborting."%(self.__class__.__name__)
33 exit(1)
34
35
36 @staticmethod
37 def event_global_freeze_get():
38 cdef int fcount
39 eodefault.eo_class_do(eobase.eo_base_class_get(), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_GLOBAL_FREEZE_GET), &fcount)
40 fcount_ = <object>fcount
41 return (fcount_)
42
43
44 @staticmethod
45 def event_global_freeze():
46 eodefault.eo_class_do(eobase.eo_base_class_get(), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_GLOBAL_FREEZE))
47
48
49 def data_get(self, object _key):
50 _key = None if _key is None else pytext_to_utf8(_key)
51 cdef char* key = NULL if _key is None else <char*> _key
52 cdef void* data
53 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_DATA_GET), key, &data)
54 data_ = None if data == NULL else <object>data
55 return (data_)
56
57 def event_callback_del(self, long _desc, object _func):
58 cdef Eo_Event_Cb func = <Eo_Event_Cb> eodefault._object_callback
59 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_CALLBACK_DEL), _desc, func, <void*>_func)
60 Py_DECREF(_func)
61
62
63
64
65 def event_freeze_get(self):
66 cdef int fcount
67 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_FREEZE_GET), &fcount)
68 fcount_ = <object>fcount
69 return (fcount_)
70
71 @staticmethod
72 def event_global_thaw():
73 eodefault.eo_class_do(eobase.eo_base_class_get(), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_GLOBAL_THAW))
74
75
76 def data_del(self, object _key):
77 _key = None if _key is None else pytext_to_utf8(_key)
78 cdef char* key = NULL if _key is None else <char*> _key
79 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_DATA_DEL), key)
80
81 def event_callback_call(self, long _desc, object _event_info):
82 cdef long desc = <long> _desc
83 cdef void* event_info = <void*> _event_info
84 cdef unsigned char aborted
85 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_CALLBACK_CALL), desc, event_info, &aborted)
86 aborted_ = <object>aborted
87 return (aborted_)
88
89 def event_callback_priority_add(self, long _desc, int _priority, object _cb):
90 if not callable(_cb[0]):
91 raise TypeError("func must be callable")
92 cdef Eo_Event_Cb cb = <Eo_Event_Cb> eodefault._object_callback
93 Py_INCREF(_cb)
94 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_EVENT_CALLBACK_PRIORITY_ADD), _desc, _priority, cb, <void*>_cb)
95
96
97 def data_set(self, object _key, object _data):
98 _key = pytext_to_utf8(_key)
99 cdef char* key = <char*> _key
100 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_DATA_SET), key, <void*>_data, NULL)
101
102 def _data_set(self, object _key, object _data):
103 _key = pytext_to_utf8(_key)
104 cdef char* key = <char*> _key
105 eodefault.eo_do(eodefault._eo_instance_get(self), eobase_sub_id(eobase.EO_BASE_SUB_ID_DATA_SET), key, <void*>_data, NULL)
106
107
108