summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-12-05 18:44:52 +0200
committerYakov Goldberg <yakov.g@samsung.com>2012-12-05 18:44:52 +0200
commit649075412d868b4fc51b368a67c7acc2385dfe79 (patch)
treebc16616cb20be40698635279dbabaea899bba7f4
parent8192b8156246ca4b4f709fedbe771b5ec000d0d7 (diff)
Developer's README added
Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
-rw-r--r--DEV_README60
1 files changed, 60 insertions, 0 deletions
diff --git a/DEV_README b/DEV_README
new file mode 100644
index 0000000..3e8a315
--- /dev/null
+++ b/DEV_README
@@ -0,0 +1,60 @@
1
2
3
4Callbacks in Python.
5 Issues:
6 Pass data to callback.
7 Add callback to Evas_Object
8
9 Description:
10 All callbacks are added to Eo object on registered event in this/parent class.
11 To add callback EoBase.event_callback_priority_add() is used.
12 Callback can be added for introspected events.
13
14 Adding callback:
15
16 func(obj, data)
17
18 cb_obj = (func, data)
19 py_obj.event_callback_priority_add(class.EVENT_ID, 0, cb_obj)
20 py_obj.event_callback_del(class.EVENT_ID, cb_obj)
21
22 it's also possible to add callback like this:
23
24 py_obj.event_callback_priority_add(class.EVENT_ID, 0, (func, data))
25
26 reference of (func, data) object is incremented,
27 so callback will be called properly.
28 But it won't be possible to delete it.
29
30 What's going on inside:
31 Proxy _callback() function(eo signature) is added to real C
32 object for desired event; Py cb_obj is set as data.
33 When event occurs, _callback() is called with data; Py func and data are fetched
34 and Py cb is called.
35
36 Maybe it's not the best idea to add data like this, but the idea
37 is to give Eo as much work as possible.
38 So no internal lists are managed to pass and keep
39 callback data as (*args **kwargs).
40
41
42 Adding callbacks to Evas_Object:
43 In C callbacks are added with evas_object_event_callback_add(),
44 which is not in eo indrospection at all.
45 Evas Events are also not in introspection scope,
46 because they are not added to Eo objects.
47
48 Issue:
49 What to do with Evas events?
50 It's possible to add stuff manually:
51 - define extern evas_object_event_callback_add()
52 - define extern event's enum
53 - define public event_add/del funcs for class
54
55
56
57
58
59
60