summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-09-23 15:57:56 -0700
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-09-23 15:57:56 -0700
commit1b9aeb529b9e076063e2db18fc71da4d2e41b4bf (patch)
tree78220bb42659b1d0cfdebaf959866942926060b7
parent5cce0f2b2252e100f546155f29c44e094c0a9ead (diff)
eldbus_model: Removed a few other constructor
-rw-r--r--src/lib/eldbus/eldbus_model_object.c3
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c37
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.eo21
3 files changed, 49 insertions, 12 deletions
diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c
index a50c848391..3be4638fcc 100644
--- a/src/lib/eldbus/eldbus_model_object.c
+++ b/src/lib/eldbus/eldbus_model_object.c
@@ -537,7 +537,8 @@ _eldbus_model_object_create_children(Eldbus_Model_Object_Data *pd, Eldbus_Object
537 537
538 // TODO: increment reference to keep 'interface' in memory 538 // TODO: increment reference to keep 'interface' in memory
539 Eo *child = eo_add_ref(ELDBUS_MODEL_PROXY_CLASS, NULL, 539 Eo *child = eo_add_ref(ELDBUS_MODEL_PROXY_CLASS, NULL,
540 eldbus_model_proxy_constructor(object, interface)); 540 eldbus_model_proxy_object_set(object),
541 eldbus_model_proxy_interface_set(interface));
541 542
542 pd->children_list = eina_list_append(pd->children_list, child); 543 pd->children_list = eina_list_append(pd->children_list, child);
543 } 544 }
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index 74ac463fb2..b9f175ad1f 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -64,20 +64,47 @@ _eldbus_model_proxy_eo_base_constructor(Eo *obj, Eldbus_Model_Proxy_Data *pd)
64} 64}
65 65
66static void 66static void
67_eldbus_model_proxy_constructor(Eo *obj EINA_UNUSED, 67_eldbus_model_proxy_object_set(Eo *obj EINA_UNUSED,
68 Eldbus_Model_Proxy_Data *pd, 68 Eldbus_Model_Proxy_Data *pd,
69 Eldbus_Object *object, 69 Eldbus_Object *object)
70 const Eldbus_Introspection_Interface *interface)
71{ 70{
72 DBG("(%p)", obj); 71 DBG("(%p)", obj);
73 EINA_SAFETY_ON_NULL_RETURN(object); 72 EINA_SAFETY_ON_NULL_RETURN(object);
74 EINA_SAFETY_ON_NULL_RETURN(interface);
75 73
76 pd->object = eldbus_object_ref(object); 74 pd->object = eldbus_object_ref(object);
75}
76
77static void
78_eldbus_model_proxy_interface_set(Eo *obj EINA_UNUSED,
79 Eldbus_Model_Proxy_Data *pd,
80 const Eldbus_Introspection_Interface *interface)
81{
82 DBG("(%p)", obj);
83
84 EINA_SAFETY_ON_NULL_RETURN(interface);
85
77 pd->name = eina_stringshare_add(interface->name); 86 pd->name = eina_stringshare_add(interface->name);
78 pd->interface = interface; 87 pd->interface = interface;
79} 88}
80 89
90static Eldbus_Object*
91_eldbus_model_proxy_object_get(Eo *obj EINA_UNUSED,
92 Eldbus_Model_Proxy_Data *pd)
93{
94 DBG("(%p)", obj);
95
96 return pd->object;
97}
98
99static const Eldbus_Introspection_Interface*
100_eldbus_model_proxy_interface_get(Eo *obj EINA_UNUSED,
101 Eldbus_Model_Proxy_Data *pd)
102{
103 DBG("(%p)", obj);
104
105 return pd->interface;
106}
107
81static void 108static void
82_eldbus_model_proxy_eo_base_destructor(Eo *obj, Eldbus_Model_Proxy_Data *pd) 109_eldbus_model_proxy_eo_base_destructor(Eo *obj, Eldbus_Model_Proxy_Data *pd)
83{ 110{
diff --git a/src/lib/eldbus/eldbus_model_proxy.eo b/src/lib/eldbus/eldbus_model_proxy.eo
index 2bab11937d..58fb42712e 100644
--- a/src/lib/eldbus/eldbus_model_proxy.eo
+++ b/src/lib/eldbus/eldbus_model_proxy.eo
@@ -1,21 +1,29 @@
1class Eldbus.Model_Proxy (Eo.Base, Efl.Model.Base) { 1class Eldbus.Model_Proxy (Eo.Base, Efl.Model.Base) {
2 legacy_prefix: null; 2 legacy_prefix: null;
3 methods { 3 methods {
4 constructor { 4 @property object {
5 [[Custom Eldbus_Model_Proxy constructor. 5 [[Custom Eldbus_Model_Proxy constructor.
6 6
7 @since 1.16]] 7 @since 1.16]]
8 params { 8 set {}
9 @in object: Eldbus_Object *; [[Eldbus object]] 9 get {}
10 @in interface: const(Eldbus_Introspection_Interface)*; [[The introspected interface]] 10 values {
11 object: Eldbus_Object *; [[Eldbus object]]
11 } 12 }
12 } 13 }
13 @property name { 14 @property name {
14 get {} 15 get {}
15 values { 16 values {
16 value: const(char)*; 17 value: const(char)*;
17 } 18 }
18 } 19 }
20 @property interface {
21 get {}
22 set {}
23 values {
24 interface_: const(Eldbus_Introspection_Interface)*; [[The introspected interface]]
25 }
26 }
19 } 27 }
20 implements { 28 implements {
21 Eo.Base.constructor; 29 Eo.Base.constructor;
@@ -34,6 +42,7 @@ class Eldbus.Model_Proxy (Eo.Base, Efl.Model.Base) {
34 Efl.Model.Base.children_load; 42 Efl.Model.Base.children_load;
35 } 43 }
36 constructors { 44 constructors {
37 .constructor; 45 .object;
46 .interface;
38 } 47 }
39} 48}