summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-09-23 15:49:50 -0700
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-09-23 15:49:50 -0700
commit5cce0f2b2252e100f546155f29c44e094c0a9ead (patch)
tree3b50c9b526c9fce4f2c55e9fb7f0eae96f4e6298
parent6732e02838a73735ca1e04bedb2e7a59b561a81b (diff)
eldbus_model: Removed a few constructors
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.c63
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.eo87
-rw-r--r--src/lib/eldbus/eldbus_model_method.c43
-rw-r--r--src/lib/eldbus/eldbus_model_method.eo22
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c6
-rw-r--r--src/lib/eldbus/eldbus_model_signal.c41
-rw-r--r--src/lib/eldbus/eldbus_model_signal.eo19
7 files changed, 207 insertions, 74 deletions
diff --git a/src/lib/eldbus/eldbus_model_arguments.c b/src/lib/eldbus/eldbus_model_arguments.c
index 3329b081bc..cc82a20cb8 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -45,21 +45,64 @@ _eldbus_model_arguments_eo_base_constructor(Eo *obj, Eldbus_Model_Arguments_Data
45} 45}
46 46
47static void 47static void
48_eldbus_model_arguments_constructor(Eo *obj EINA_UNUSED, 48_eldbus_model_arguments_arguments_set(Eo *obj EINA_UNUSED,
49 Eldbus_Model_Arguments_Data *pd, 49 Eldbus_Model_Arguments_Data *pd,
50 Eldbus_Proxy *proxy, 50 const Eina_List *arguments)
51 const char *name, 51{
52 const Eina_List *arguments) 52 DBG("(%p)", obj);
53
54 pd->arguments = arguments;
55}
56
57static const Eina_List*
58_eldbus_model_arguments_arguments_get(Eo *obj EINA_UNUSED,
59 Eldbus_Model_Arguments_Data *pd)
60{
61 DBG("(%p)", obj);
62
63 return pd->arguments;
64}
65
66static void
67_eldbus_model_arguments_proxy_set(Eo *obj EINA_UNUSED,
68 Eldbus_Model_Arguments_Data *pd,
69 Eldbus_Proxy *proxy)
53{ 70{
54 DBG("(%p)", obj); 71 DBG("(%p)", obj);
55 EINA_SAFETY_ON_NULL_RETURN(proxy); 72 EINA_SAFETY_ON_NULL_RETURN(proxy);
56 EINA_SAFETY_ON_NULL_RETURN(name);
57 73
58 pd->proxy = eldbus_proxy_ref(proxy); 74 pd->proxy = eldbus_proxy_ref(proxy);
59 pd->arguments = arguments; 75}
76
77static Eldbus_Proxy*
78_eldbus_model_arguments_proxy_get(Eo *obj EINA_UNUSED,
79 Eldbus_Model_Arguments_Data *pd)
80{
81 DBG("(%p)", obj);
82
83 return pd->proxy;
84}
85
86static void
87_eldbus_model_arguments_name_set(Eo *obj EINA_UNUSED,
88 Eldbus_Model_Arguments_Data *pd,
89 const char *name)
90{
91 DBG("(%p)", obj);
92 EINA_SAFETY_ON_NULL_RETURN(name);
93
60 pd->name = eina_stringshare_add(name); 94 pd->name = eina_stringshare_add(name);
61} 95}
62 96
97static const char*
98_eldbus_model_arguments_name_get(Eo *obj EINA_UNUSED,
99 Eldbus_Model_Arguments_Data *pd)
100{
101 DBG("(%p)", obj);
102
103 return pd->name;
104}
105
63static void 106static void
64_eldbus_model_arguments_eo_base_destructor(Eo *obj, Eldbus_Model_Arguments_Data *pd) 107_eldbus_model_arguments_eo_base_destructor(Eo *obj, Eldbus_Model_Arguments_Data *pd)
65{ 108{
@@ -257,12 +300,6 @@ _eldbus_model_arguments_efl_model_base_children_load(Eo *obj, Eldbus_Model_Argum
257 efl_model_load_set(pd->obj, &pd->load, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); 300 efl_model_load_set(pd->obj, &pd->load, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN);
258} 301}
259 302
260static const char *
261_eldbus_model_arguments_name_get(Eo *obj EINA_UNUSED, Eldbus_Model_Arguments_Data *pd)
262{
263 return pd->name;
264}
265
266static void 303static void
267_eldbus_model_arguments_unload(Eldbus_Model_Arguments_Data *pd) 304_eldbus_model_arguments_unload(Eldbus_Model_Arguments_Data *pd)
268{ 305{
diff --git a/src/lib/eldbus/eldbus_model_arguments.eo b/src/lib/eldbus/eldbus_model_arguments.eo
index 64f39f9ce2..c2c78bf777 100644
--- a/src/lib/eldbus/eldbus_model_arguments.eo
+++ b/src/lib/eldbus/eldbus_model_arguments.eo
@@ -1,40 +1,53 @@
1class Eldbus.Model_Arguments (Eo.Base, Efl.Model.Base) { 1class Eldbus.Model_Arguments (Eo.Base, Efl.Model.Base) {
2 legacy_prefix: null; 2 legacy_prefix: null;
3 methods { 3 methods {
4 constructor { 4 @property proxy {
5 [[Custom Eldbus_Model_Arguments constructor. 5 [[Custom Eldbus_Model_Arguments constructor.
6 6
7 @since 1.16]] 7 @since 1.16]]
8 params { 8 set {}
9 @in proxy: Eldbus_Proxy*; [[Eldbus proxy]] 9 get {}
10 @in name: const(char)*; [[Name]] 10 values {
11 @in arguments: const(Eina_List)*; [[The introspected arguments]] 11 proxy: Eldbus_Proxy*; [[Eldbus proxy]]
12 } 12 }
13 } 13 }
14 @property name { 14 @property arguments {
15 get {} 15 [[Custom Eldbus_Model_Arguments constructor.
16 values { 16
17 value: const(char)*; 17 @since 1.16]]
18 } 18 set {}
19 } 19 get {}
20 } 20 values {
21 implements { 21 arguments: const(list<Eldbus_Introspection_Argument*>)* @optional; [[The introspected arguments]]
22 Eo.Base.constructor; 22 }
23 Eo.Base.destructor; 23 }
24 Efl.Model.Base.properties.get; 24 @property name {
25 Efl.Model.Base.properties_load; 25 get {}
26 Efl.Model.Base.property.set; 26 set {}
27 Efl.Model.Base.property.get; 27 values {
28 Efl.Model.Base.load; 28 value: const(char)*;
29 Efl.Model.Base.load_status.get; 29 }
30 Efl.Model.Base.unload; 30 }
31 Efl.Model.Base.child_add; 31 }
32 Efl.Model.Base.child_del; 32 implements {
33 Efl.Model.Base.children_slice.get; 33 Eo.Base.constructor;
34 Efl.Model.Base.children_count.get; 34 Eo.Base.destructor;
35 Efl.Model.Base.children_load; 35 Efl.Model.Base.properties.get;
36 } 36 Efl.Model.Base.properties_load;
37 constructors { 37 Efl.Model.Base.property.set;
38 .constructor; 38 Efl.Model.Base.property.get;
39 } 39 Efl.Model.Base.load;
40 Efl.Model.Base.load_status.get;
41 Efl.Model.Base.unload;
42 Efl.Model.Base.child_add;
43 Efl.Model.Base.child_del;
44 Efl.Model.Base.children_slice.get;
45 Efl.Model.Base.children_count.get;
46 Efl.Model.Base.children_load;
47 }
48 constructors {
49 .proxy;
50 .name;
51 .arguments @optional;
52 }
40} 53}
diff --git a/src/lib/eldbus/eldbus_model_method.c b/src/lib/eldbus/eldbus_model_method.c
index 0f4e88b7cf..03911c0671 100644
--- a/src/lib/eldbus/eldbus_model_method.c
+++ b/src/lib/eldbus/eldbus_model_method.c
@@ -28,17 +28,50 @@ _eldbus_model_method_eo_base_constructor(Eo *obj, Eldbus_Model_Method_Data *pd)
28} 28}
29 29
30static void 30static void
31_eldbus_model_method_constructor(Eo *obj EINA_UNUSED, 31_eldbus_model_method_proxy_set(Eo *obj EINA_UNUSED,
32 Eldbus_Model_Method_Data *pd, 32 Eldbus_Model_Method_Data *pd EINA_UNUSED,
33 Eldbus_Proxy *proxy, 33 Eldbus_Proxy *proxy)
34 const Eldbus_Introspection_Method *method)
35{ 34{
36 DBG("(%p)", obj); 35 DBG("(%p)", obj);
37 EINA_SAFETY_ON_NULL_RETURN(proxy); 36 EINA_SAFETY_ON_NULL_RETURN(proxy);
37
38 eo_do(obj, eldbus_model_arguments_proxy_set(proxy));
39}
40
41static void
42_eldbus_model_method_method_set(Eo *obj EINA_UNUSED,
43 Eldbus_Model_Method_Data *pd,
44 const Eldbus_Introspection_Method *method)
45{
46 DBG("(%p)", obj);
47
38 EINA_SAFETY_ON_NULL_RETURN(method); 48 EINA_SAFETY_ON_NULL_RETURN(method);
39 eo_do_super(obj, MY_CLASS, eldbus_model_arguments_constructor(proxy, method->name, method->arguments));
40 49
41 pd->method = method; 50 pd->method = method;
51 eo_do(obj,
52 eldbus_model_arguments_name_set(method->name),
53 eldbus_model_arguments_set(method->arguments));
54}
55
56static Eldbus_Proxy*
57_eldbus_model_method_proxy_get(Eo *obj EINA_UNUSED,
58 Eldbus_Model_Method_Data *pd EINA_UNUSED)
59{
60 DBG("(%p)", obj);
61
62 Eldbus_Proxy* p = NULL;
63 eo_do_super(obj, MY_CLASS, p = eldbus_model_arguments_proxy_get());
64
65 return p;
66}
67
68static const Eldbus_Introspection_Method *
69_eldbus_model_method_method_get(Eo *obj EINA_UNUSED,
70 Eldbus_Model_Method_Data *pd)
71{
72 DBG("(%p)", obj);
73
74 return pd->method;
42} 75}
43 76
44static Efl_Model_Load_Status 77static Efl_Model_Load_Status
diff --git a/src/lib/eldbus/eldbus_model_method.eo b/src/lib/eldbus/eldbus_model_method.eo
index 8b9d71411f..334d750090 100644
--- a/src/lib/eldbus/eldbus_model_method.eo
+++ b/src/lib/eldbus/eldbus_model_method.eo
@@ -1,13 +1,21 @@
1class Eldbus.Model_Method (Eldbus.Model_Arguments) { 1class Eldbus.Model_Method (Eldbus.Model_Arguments) {
2 legacy_prefix: null; 2 legacy_prefix: null;
3 methods { 3 methods {
4 constructor { 4 // @property proxy {
5 [[Custom Eldbus_Model_Method constructor. 5 // [[Custom Eldbus_Model_Method constructor.
6 6
7 @since 1.16]] 7 // @since 1.16]]
8 params { 8 // get {}
9 @in proxy: Eldbus_Proxy*; [[Eldbus proxy]] 9 // set {}
10 @in method: const(Eldbus_Introspection_Method)*; [[The introspected method]] 10 // values {
11 // proxy: Eldbus_Proxy*; [[Eldbus proxy]]
12 // }
13 // }
14 @property method {
15 get {}
16 set {}
17 values {
18 method: const(Eldbus_Introspection_Method)*; [[The introspected method]]
11 } 19 }
12 } 20 }
13 call { 21 call {
@@ -26,7 +34,7 @@ class Eldbus.Model_Method (Eldbus.Model_Arguments) {
26 Eo.Base.constructor; 34 Eo.Base.constructor;
27 } 35 }
28 constructors { 36 constructors {
29 .constructor; 37 .method;
30 } 38 }
31 events { 39 events {
32 successful,call; [[Event dispatched for a successful method call.]] 40 successful,call; [[Event dispatched for a successful method call.]]
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index 36b50fd960..74ac463fb2 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -322,7 +322,8 @@ _eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *pd)
322 INF("(%p) Creating method child: bus = %s, path = %s, method = %s::%s", pd->obj, bus, path, interface_name, method_name); 322 INF("(%p) Creating method child: bus = %s, path = %s, method = %s::%s", pd->obj, bus, path, interface_name, method_name);
323 323
324 Eo *child = eo_add(ELDBUS_MODEL_METHOD_CLASS, NULL, 324 Eo *child = eo_add(ELDBUS_MODEL_METHOD_CLASS, NULL,
325 eldbus_model_method_constructor(pd->proxy, method)); 325 eldbus_model_arguments_proxy_set(pd->proxy),
326 eldbus_model_method_set(method));
326 327
327 pd->children_list = eina_list_append(pd->children_list, child); 328 pd->children_list = eina_list_append(pd->children_list, child);
328 } 329 }
@@ -350,7 +351,8 @@ _eldbus_model_proxy_create_signals_children(Eldbus_Model_Proxy_Data *pd)
350 DBG("(%p) Creating signal child: bus = %s, path = %s, signal = %s::%s", pd->obj, bus, path, interface_name, signal_name); 351 DBG("(%p) Creating signal child: bus = %s, path = %s, signal = %s::%s", pd->obj, bus, path, interface_name, signal_name);
351 352
352 Eo *child = eo_add(ELDBUS_MODEL_SIGNAL_CLASS, NULL, 353 Eo *child = eo_add(ELDBUS_MODEL_SIGNAL_CLASS, NULL,
353 eldbus_model_signal_constructor(pd->proxy, signal)); 354 eldbus_model_signal_proxy_set(pd->proxy),
355 eldbus_model_signal_set(signal));
354 356
355 pd->children_list = eina_list_append(pd->children_list, child); 357 pd->children_list = eina_list_append(pd->children_list, child);
356 } 358 }
diff --git a/src/lib/eldbus/eldbus_model_signal.c b/src/lib/eldbus/eldbus_model_signal.c
index 2c4f6dbdd3..7bab6f3269 100644
--- a/src/lib/eldbus/eldbus_model_signal.c
+++ b/src/lib/eldbus/eldbus_model_signal.c
@@ -28,17 +28,48 @@ _eldbus_model_signal_eo_base_constructor(Eo *obj, Eldbus_Model_Signal_Data *pd)
28} 28}
29 29
30static void 30static void
31_eldbus_model_signal_constructor(Eo *obj EINA_UNUSED, 31_eldbus_model_signal_proxy_set(Eo *obj EINA_UNUSED,
32 Eldbus_Model_Signal_Data *pd, 32 Eldbus_Model_Signal_Data *pd EINA_UNUSED,
33 Eldbus_Proxy *proxy, 33 Eldbus_Proxy *proxy)
34 const Eldbus_Introspection_Signal *signal)
35{ 34{
36 DBG("(%p)", obj); 35 DBG("(%p)", obj);
37 EINA_SAFETY_ON_NULL_RETURN(proxy); 36 EINA_SAFETY_ON_NULL_RETURN(proxy);
37
38 eo_do_super(obj, MY_CLASS, eldbus_model_arguments_proxy_set(proxy));
39}
40
41static Eldbus_Proxy*
42_eldbus_model_signal_proxy_get(Eo *obj EINA_UNUSED,
43 Eldbus_Model_Signal_Data *pd EINA_UNUSED)
44{
45 DBG("(%p)", obj);
46 Eldbus_Proxy* p = NULL;
47
48 eo_do_super(obj, MY_CLASS, p = eldbus_model_arguments_proxy_get());
49
50 return p;
51}
52
53static void
54_eldbus_model_signal_signal_set(Eo *obj EINA_UNUSED,
55 Eldbus_Model_Signal_Data *pd,
56 const Eldbus_Introspection_Signal *signal)
57{
58 DBG("(%p)", obj);
59
38 EINA_SAFETY_ON_NULL_RETURN(signal); 60 EINA_SAFETY_ON_NULL_RETURN(signal);
39 eo_do_super(obj, MY_CLASS, eldbus_model_arguments_constructor(proxy, signal->name, signal->arguments));
40 61
41 pd->signal = signal; 62 pd->signal = signal;
63 eo_do(obj,
64 eldbus_model_arguments_name_set(signal->name),
65 eldbus_model_arguments_set(signal->arguments));
66}
67
68static const Eldbus_Introspection_Signal*
69_eldbus_model_signal_signal_get(Eo *obj EINA_UNUSED,
70 Eldbus_Model_Signal_Data *pd)
71{
72 return pd->signal;
42} 73}
43 74
44static void 75static void
diff --git a/src/lib/eldbus/eldbus_model_signal.eo b/src/lib/eldbus/eldbus_model_signal.eo
index 237b149dbe..473c64ec4e 100644
--- a/src/lib/eldbus/eldbus_model_signal.eo
+++ b/src/lib/eldbus/eldbus_model_signal.eo
@@ -1,13 +1,21 @@
1class Eldbus.Model_Signal (Eldbus.Model_Arguments) { 1class Eldbus.Model_Signal (Eldbus.Model_Arguments) {
2 legacy_prefix: null; 2 legacy_prefix: null;
3 methods { 3 methods {
4 constructor { 4 @property proxy {
5 [[Custom Eldbus_Model_Signal constructor. 5 [[Custom Eldbus_Model_Signal constructor.
6 6
7 @since 1.16]] 7 @since 1.16]]
8 params { 8 set {}
9 @in proxy: Eldbus_Proxy*; [[Eldbus proxy]] 9 get {}
10 @in signal: const(Eldbus_Introspection_Signal)*; [[The introspected method]] 10 values {
11 proxy: Eldbus_Proxy*; [[Eldbus proxy]]
12 }
13 }
14 @property signal {
15 set {}
16 get {}
17 values {
18 signal: const(Eldbus_Introspection_Signal)*; [[The introspected method]]
11 } 19 }
12 } 20 }
13 } 21 }
@@ -18,6 +26,7 @@ class Eldbus.Model_Signal (Eldbus.Model_Arguments) {
18 Efl.Model.Base.unload; 26 Efl.Model.Base.unload;
19 } 27 }
20 constructors { 28 constructors {
21 .constructor; 29 .proxy;
30 .signal;
22 } 31 }
23} 32}