summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eoparser/cparser.py22
-rw-r--r--examples/evas_elem_test.py32
2 files changed, 32 insertions, 22 deletions
diff --git a/eoparser/cparser.py b/eoparser/cparser.py
index 904b912..7f23b05 100644
--- a/eoparser/cparser.py
+++ b/eoparser/cparser.py
@@ -216,7 +216,8 @@ class Cparser(object):
216 for t in ids_and_descs: 216 for t in ids_and_descs:
217 op_id = t[0] #op_id 217 op_id = t[0] #op_id
218 func_name = re.findall("SUB_ID_(.*)", op_id) 218 func_name = re.findall("SUB_ID_(.*)", op_id)
219 op_list.append((op_id, func_name[0].lower())) 219 func_name = func_name[0].lower()
220 op_list.append((op_id, func_name))
220 221
221 op_desc[tup[0]] = op_list 222 op_desc[tup[0]] = op_list
222 223
@@ -334,9 +335,12 @@ class Cparser(object):
334 #and checking if it is in macros list. If not - we forgot to add comment 335 #and checking if it is in macros list. If not - we forgot to add comment
335 #if yes - cutting types from define 336 #if yes - cutting types from define
336 for op, f in op_desc: 337 for op, f in op_desc:
338 found = False
337 for d in defines: 339 for d in defines:
340 # looking for #define elm_obj_flip_get ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GET)
338 o = re.match("#define ([\w]*)\([^\)]*\) %s\(%s\).*"%(b_id_macro, op), d) 341 o = re.match("#define ([\w]*)\([^\)]*\) %s\(%s\).*"%(b_id_macro, op), d)
339 if o != None: 342 if o != None:
343 found = True
340 s_tmp = o.group(1) 344 s_tmp = o.group(1)
341 345
342 if s_tmp not in macros: 346 if s_tmp not in macros:
@@ -369,13 +373,16 @@ class Cparser(object):
369 i += 1 373 i += 1
370 self.cl_data[cl_id][const.FUNCS][f][const.PARAMETERS] = params 374 self.cl_data[cl_id][const.FUNCS][f][const.PARAMETERS] = params
371 self.cl_data[cl_id][const.FUNCS][f][const.C_MACRO] = s_tmp 375 self.cl_data[cl_id][const.FUNCS][f][const.C_MACRO] = s_tmp
376
377 if not found:
378 print "Warning: no API for %s in %s"%(op, self.cl_data[cl_id][const.H_FILE])
379 print "Function won't be added"
380 self.cl_data[cl_id][const.FUNCS].pop(f)
381
372 382
373 383
374 #generating XML 384 #generating XML
375 def build_xml(self, cl_id): 385 def build_xml(self, cl_id):
376 #FIXME: because i don't parse several EO_DEFINE_CLASS in file
377 #if const.C_NAME not in self.cl_data[cl_id]:
378 # return
379 self.cl_data[cl_id][const.XML_FILE] = os.path.join(self.outdir, normalize_names([self.cl_data[cl_id][const.C_NAME]])[0] + ".xml") 386 self.cl_data[cl_id][const.XML_FILE] = os.path.join(self.outdir, normalize_names([self.cl_data[cl_id][const.C_NAME]])[0] + ".xml")
380 387
381 cl_data = self.cl_data[cl_id] 388 cl_data = self.cl_data[cl_id]
@@ -429,10 +436,13 @@ class Cparser(object):
429 for k in cl_data[const.FUNCS]: 436 for k in cl_data[const.FUNCS]:
430 SubElement(op_tag, const.XML_SUB_ID, {const.NAME:cl_data[const.FUNCS][k][const.OP_ID]}) 437 SubElement(op_tag, const.XML_SUB_ID, {const.NAME:cl_data[const.FUNCS][k][const.OP_ID]})
431 438
439 c_macro = cl_data[const.FUNCS][k][const.C_MACRO]
440 #if generating XML not for base class, change func name to avoid name clash
441 func_name = k if cl_id == "EO_BASE_CLASS" else c_macro
432 442
433 m = SubElement(m_tag, const.METHOD, {const.NAME : k, 443 m = SubElement(m_tag, const.METHOD, {const.NAME : func_name,
434 const.OP_ID:cl_data[const.FUNCS][k][const.OP_ID], 444 const.OP_ID:cl_data[const.FUNCS][k][const.OP_ID],
435 const.C_MACRO:cl_data[const.FUNCS][k][const.C_MACRO]}) 445 const.C_MACRO:c_macro})
436 446
437 #defining parameter type 447 #defining parameter type
438 if const.PARAMETERS in cl_data[const.FUNCS][k]: 448 if const.PARAMETERS in cl_data[const.FUNCS][k]:
diff --git a/examples/evas_elem_test.py b/examples/evas_elem_test.py
index efd8eb4..08e7bd1 100644
--- a/examples/evas_elem_test.py
+++ b/examples/evas_elem_test.py
@@ -11,35 +11,35 @@ print "Init res:", py_elm_init(sys.argv)
11print "" 11print ""
12 12
13w1 = ElmWin(None, "my win name", 0) 13w1 = ElmWin(None, "my win name", 0)
14w1.title_set("first_title") 14w1.elm_obj_win_title_set("first_title")
15t = w1.title_get() 15t = w1.elm_obj_win_title_get()
16print "title:", t 16print "title:", t
17w1.size_set(370, 350) 17w1.evas_obj_size_set(370, 350)
18xx,yy = w1.size_get() 18xx,yy = w1.evas_obj_size_get()
19print "size : " , xx, yy 19print "size : " , xx, yy
20w1.visibility_set(1) 20w1.evas_obj_visibility_set(1)
21v = w1.visibility_get() 21v = w1.evas_obj_visibility_get()
22print "v=", v 22print "v=", v
23 23
24bg = ElmBg(w1) 24bg = ElmBg(w1)
25bg.size_hint_weight_set(1.0, 1.0) 25bg.evas_obj_size_hint_weight_set(1.0, 1.0)
26w1.resize_object_add(bg) 26w1.elm_obj_win_resize_object_add(bg)
27bg.visibility_set(1) 27bg.evas_obj_visibility_set(1)
28 28
29 29
30box = ElmBox(w1) 30box = ElmBox(w1)
31box.size_hint_weight_set(1.0, 1.0) 31box.evas_obj_size_hint_weight_set(1.0, 1.0)
32w1.resize_object_add(box) 32w1.elm_obj_win_resize_object_add(box)
33box.visibility_set(1) 33box.evas_obj_visibility_set(1)
34 34
35but = ElmButton(w1) 35but = ElmButton(w1)
36#but.text_set("Button") 36#but.text_set("Button")
37box.pack_end(but) 37box.elm_obj_box_pack_end(but)
38but.visibility_set(1) 38but.evas_obj_visibility_set(1)
39 39
40d = w1.screen_dpi_get() 40d = w1.elm_obj_win_screen_dpi_get()
41print d 41print d
42d = w1.role_get() 42d = w1.elm_obj_win_role_get()
43print d 43print d
44#d = w1.fullscreen_set(1) 44#d = w1.fullscreen_set(1)
45 45