summaryrefslogtreecommitdiff
path: root/src/examples/eldbus
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-03-01 18:06:28 +0000
committerTom Hacohen <tom@stosb.com>2016-03-03 09:58:08 +0000
commitf21ade6123b9053fca8d1632644c48525a99d6e0 (patch)
treec5eb0445f471d21365a7a5a7b0ec7d279c11b398 /src/examples/eldbus
parent3faf3f3fc68a839f06b311c35ba020cb25e7c9c4 (diff)
Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL automatically. This commit is *only* the automatic conversion, so it can be easily reverted and re-run.
Diffstat (limited to 'src/examples/eldbus')
-rw-r--r--src/examples/eldbus/dbusmodel.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/examples/eldbus/dbusmodel.c b/src/examples/eldbus/dbusmodel.c
index a3e77e3..b34799b 100644
--- a/src/examples/eldbus/dbusmodel.c
+++ b/src/examples/eldbus/dbusmodel.c
@@ -29,9 +29,8 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model,
29 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status) 29 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status)
30 return EINA_TRUE; 30 return EINA_TRUE;
31 31
32 eo_do(model, 32 name = eldbus_model_proxy_name_get(model);
33 name = eldbus_model_proxy_name_get(), 33 efl_model_properties_get(model, &properties_list);
34 efl_model_properties_get(&properties_list));
35 34
36 printf(" -> %s\n", name); 35 printf(" -> %s\n", name);
37 if (eina_array_count(properties_list)) 36 if (eina_array_count(properties_list))
@@ -39,7 +38,7 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model,
39 38
40 EINA_ARRAY_ITER_NEXT(properties_list, i, property, iterator) 39 EINA_ARRAY_ITER_NEXT(properties_list, i, property, iterator)
41 { 40 {
42 eo_do(model, efl_model_property_get(property, &property_value)); 41 efl_model_property_get(model, property, &property_value);
43 if (property_value) 42 if (property_value)
44 { 43 {
45 prop_str = eina_value_to_string(property_value); 44 prop_str = eina_value_to_string(property_value);
@@ -70,7 +69,7 @@ _event_load_status_cb(void *data EINA_UNUSED, Eo *model,
70 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status) 69 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status)
71 return EINA_TRUE; 70 return EINA_TRUE;
72 71
73 eo_do(model, efl_model_children_count_get(&children_count)); 72 efl_model_children_count_get(model, &children_count);
74 if (children_count == 0) 73 if (children_count == 0)
75 { 74 {
76 printf("Don't find Interfaces\n"); 75 printf("Don't find Interfaces\n");
@@ -78,12 +77,12 @@ _event_load_status_cb(void *data EINA_UNUSED, Eo *model,
78 return EINA_FALSE; 77 return EINA_FALSE;
79 } 78 }
80 79
81 eo_do(model, efl_model_children_slice_get(0, 0, &accessor)); 80 efl_model_children_slice_get(model, 0, 0, &accessor);
82 printf("\nInterfaces:\n"); 81 printf("\nInterfaces:\n");
83 EINA_ACCESSOR_FOREACH(accessor, i, child) 82 EINA_ACCESSOR_FOREACH(accessor, i, child)
84 { 83 {
85 eo_do(child, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_interface_load_status_cb, NULL)); 84 eo_event_callback_add(child, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_interface_load_status_cb, NULL);
86 eo_do(child, efl_model_load()); 85 efl_model_load(child);
87 } 86 }
88 87
89 return EINA_FALSE; 88 return EINA_FALSE;
@@ -103,17 +102,14 @@ main(int argc, char **argv EINA_UNUSED)
103 if (argc > 1) bus = argv[1]; 102 if (argc > 1) bus = argv[1];
104 if (argc > 2) path = argv[2]; 103 if (argc > 2) path = argv[2];
105 104
106 root = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, 105 root = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, bus, path));
107 eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION,
108 NULL, EINA_FALSE, bus, path));
109 106
110 eo_do(root, 107 eo_event_callback_add(root, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL);
111 eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL), 108 efl_model_load(root);
112 efl_model_load());
113 109
114 ecore_main_loop_begin(); 110 ecore_main_loop_begin();
115 111
116 eo_do(root, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL)); 112 eo_event_callback_del(root, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL);
117 113
118 eo_unref(root); 114 eo_unref(root);
119} 115}