summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-02-29 10:18:40 +0000
committerTom Hacohen <tom@stosb.com>2016-02-29 11:33:27 +0000
commite71e6561eeb5f0a10e5b08e44d2977e58bfd682b (patch)
tree72b41e7f6740360d265bbda572da5eb236c2e957 /src/tests/eio
parent56ea371dfb064c28906c7d8344b0c0e03c1d3d4d (diff)
Eo callbacks: Migrate all of the EFL to the new event cb signatures.
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_model_test_file.c24
-rw-r--r--src/tests/eio/eio_model_test_monitor_add.c26
2 files changed, 25 insertions, 25 deletions
diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/eio_model_test_file.c
index c6aa8d8639..56e6dd6ac8 100644
--- a/src/tests/eio/eio_model_test_file.c
+++ b/src/tests/eio/eio_model_test_file.c
@@ -59,9 +59,9 @@ static Eina_Bool
59 } 59 }
60 60
61static Eina_Bool 61static Eina_Bool
62_load_status_cb(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 62_load_status_cb(void *data EINA_UNUSED, const Eo_Event *event)
63{ 63{
64 Efl_Model_Load *st = event_info; 64 Efl_Model_Load *st = event->event_info;
65 printf("Load CHANGE\n"); 65 printf("Load CHANGE\n");
66 66
67 if (st->status & EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN) 67 if (st->status & EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN)
@@ -84,26 +84,26 @@ _load_status_cb(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *des
84 char *str; 84 char *str;
85 85
86 printf("Model is Loaded\n"); 86 printf("Model is Loaded\n");
87 eo_do(obj, status = efl_model_property_get("filename", &value_prop)); 87 eo_do(event->obj, status = efl_model_property_get("filename", &value_prop));
88 str = eina_value_to_string(value_prop); 88 str = eina_value_to_string(value_prop);
89 printf("efl_model_loaded filename %s, status=%d\n", str, status); 89 printf("efl_model_loaded filename %s, status=%d\n", str, status);
90 free(str); 90 free(str);
91 91
92 eo_do(obj, status = efl_model_property_get("size", &value_prop)); 92 eo_do(event->obj, status = efl_model_property_get("size", &value_prop));
93 str = eina_value_to_string(value_prop); 93 str = eina_value_to_string(value_prop);
94 printf("efl_model_loaded size %s, status=%d\n", str, status); 94 printf("efl_model_loaded size %s, status=%d\n", str, status);
95 free(str); 95 free(str);
96 96
97 eo_do(obj, status = efl_model_property_get("mtime", &value_prop)); 97 eo_do(event->obj, status = efl_model_property_get("mtime", &value_prop));
98 str = eina_value_to_string(value_prop); 98 str = eina_value_to_string(value_prop);
99 printf("efl_model_loaded mtime %s, status=%d\n", str, status); 99 printf("efl_model_loaded mtime %s, status=%d\n", str, status);
100 free(str); 100 free(str);
101 101
102 eo_do(obj, efl_model_children_count_get(&total)); 102 eo_do(event->obj, efl_model_children_count_get(&total));
103 printf("efl_model_test count %d\n", (int)total); 103 printf("efl_model_test count %d\n", (int)total);
104 104
105 /**< get full list */ 105 /**< get full list */
106 eo_do(obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor)); 106 eo_do(event->obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor));
107 eina_accessor_free(accessor); 107 eina_accessor_free(accessor);
108 ecore_main_loop_quit(); 108 ecore_main_loop_quit();
109 } 109 }
@@ -111,9 +111,9 @@ _load_status_cb(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *des
111} 111}
112 112
113static Eina_Bool 113static Eina_Bool
114_properties_change_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 114_properties_change_cb(void *data EINA_UNUSED, const Eo_Event *event)
115{ 115{
116 const Efl_Model_Property_Event *evt = (Efl_Model_Property_Event *)event_info; 116 const Efl_Model_Property_Event *evt = (Efl_Model_Property_Event *)event->event_info;
117 const char *prop; 117 const char *prop;
118 Eina_Array_Iterator it; 118 Eina_Array_Iterator it;
119 unsigned int i; 119 unsigned int i;
@@ -135,15 +135,15 @@ _properties_change_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Even
135} 135}
136 136
137static Eina_Bool 137static Eina_Bool
138_children_count_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 138_children_count_cb(void *data EINA_UNUSED, const Eo_Event *event)
139{ 139{
140 unsigned int *len = (unsigned int *)event_info; 140 unsigned int *len = (unsigned int *)event->event_info;
141 unsigned int total; 141 unsigned int total;
142 142
143 fprintf(stdout, "Children count number=%d\n", *len); 143 fprintf(stdout, "Children count number=%d\n", *len);
144 reqs.children = *len; 144 reqs.children = *len;
145 145
146 eo_do(obj, efl_model_children_count_get(&total)); 146 eo_do(event->obj, efl_model_children_count_get(&total));
147 fprintf(stdout, "New total children count number=%d\n", *len); 147 fprintf(stdout, "New total children count number=%d\n", *len);
148 148
149 return EINA_TRUE; 149 return EINA_TRUE;
diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/eio_model_test_monitor_add.c
index a0ad69ef7d..4f26a8e675 100644
--- a/src/tests/eio/eio_model_test_monitor_add.c
+++ b/src/tests/eio/eio_model_test_monitor_add.c
@@ -19,9 +19,9 @@ Eina_Tmpstr* temp_filename = NULL;
19const char* tmpdir = NULL; 19const char* tmpdir = NULL;
20 20
21static Eina_Bool 21static Eina_Bool
22_load_monitor_status_cb(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 22_load_monitor_status_cb(void *data, const Eo_Event *event)
23{ 23{
24 Efl_Model_Load* st = event_info; 24 Efl_Model_Load* st = event->event_info;
25 Eo* parent = data; 25 Eo* parent = data;
26 const Eina_Value* value_prop = NULL; 26 const Eina_Value* value_prop = NULL;
27 const char* str = NULL; 27 const char* str = NULL;
@@ -29,7 +29,7 @@ _load_monitor_status_cb(void *data, Eo *obj, const Eo_Event_Description *desc EI
29 if (!(st->status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES)) 29 if (!(st->status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES))
30 return EINA_TRUE; 30 return EINA_TRUE;
31 31
32 eo_do(obj, efl_model_property_get("path", &value_prop)); 32 eo_do(event->obj, efl_model_property_get("path", &value_prop));
33 fail_if(!value_prop, "ERROR: Cannot get property!\n"); 33 fail_if(!value_prop, "ERROR: Cannot get property!\n");
34 34
35 str = eina_value_to_string(value_prop); 35 str = eina_value_to_string(value_prop);
@@ -38,20 +38,20 @@ _load_monitor_status_cb(void *data, Eo *obj, const Eo_Event_Description *desc EI
38 if(temp_filename && strcmp(str, temp_filename) == 0) 38 if(temp_filename && strcmp(str, temp_filename) == 0)
39 { 39 {
40 fprintf(stderr, "is child that we want\n"); 40 fprintf(stderr, "is child that we want\n");
41 eo_do(obj, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data)); 41 eo_do(event->obj, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data));
42 children_added = EINA_TRUE; 42 children_added = EINA_TRUE;
43 eo_do(parent, efl_model_child_del(obj)); 43 eo_do(parent, efl_model_child_del(event->obj));
44 } 44 }
45 45
46 return EINA_FALSE; 46 return EINA_FALSE;
47} 47}
48 48
49static Eina_Bool 49static Eina_Bool
50_children_removed_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void* event_info EINA_UNUSED) 50_children_removed_cb(void *data EINA_UNUSED, const Eo_Event *event)
51{ 51{
52 if(children_added) 52 if(children_added)
53 { 53 {
54 Efl_Model_Children_Event* evt = event_info; 54 Efl_Model_Children_Event* evt = event->event_info;
55 55
56 Eina_Bool b; 56 Eina_Bool b;
57 eo_do(evt->child, b = efl_model_load_status_get() & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 57 eo_do(evt->child, b = efl_model_load_status_get() & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES);
@@ -73,22 +73,22 @@ _children_removed_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event
73} 73}
74 74
75static Eina_Bool 75static Eina_Bool
76_children_added_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 76_children_added_cb(void *data EINA_UNUSED, const Eo_Event *event)
77{ 77{
78 Efl_Model_Children_Event* evt = event_info; 78 Efl_Model_Children_Event* evt = event->event_info;
79 if (evt == NULL) 79 if (evt == NULL)
80 return EINA_TRUE; 80 return EINA_TRUE;
81 81
82 eo_do(evt->child, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, obj)); 82 eo_do(evt->child, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, event->obj));
83 eo_do(evt->child, efl_model_load()); 83 eo_do(evt->child, efl_model_load());
84 84
85 return EINA_TRUE; 85 return EINA_TRUE;
86} 86}
87 87
88static Eina_Bool 88static Eina_Bool
89_children_count_cb(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 89_children_count_cb(void *data EINA_UNUSED, const Eo_Event *event)
90{ 90{
91 unsigned int *len = event_info; 91 unsigned int *len = event->event_info;
92 Eina_Accessor *accessor; 92 Eina_Accessor *accessor;
93 Efl_Model_Load_Status status; 93 Efl_Model_Load_Status status;
94 Eo *child; 94 Eo *child;
@@ -98,7 +98,7 @@ _children_count_cb(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *
98 fprintf(stderr, "Children count number=%d\n", *len); 98 fprintf(stderr, "Children count number=%d\n", *len);
99 99
100 /**< get full list */ 100 /**< get full list */
101 eo_do(obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor)); 101 eo_do(event->obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor));
102 if(accessor != NULL) 102 if(accessor != NULL)
103 { 103 {
104 EINA_ACCESSOR_FOREACH(accessor, i, child) {} 104 EINA_ACCESSOR_FOREACH(accessor, i, child) {}