diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2008-10-21 16:35:41 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2008-10-21 16:35:41 +0000 |
commit | 17626bb4006c2b379949211755989336dfbcdaa3 (patch) | |
tree | f47791b4491cdfc06a9992a2364ebc123ddfe6f5 /legacy/emotion | |
parent | 465b76a017e229e3587b9e2d9c88c4932860157a (diff) |
Remove Evas List from Emotion.
SVN revision: 36943
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/bin/emotion_test_main.c | 107 | ||||
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 1 |
2 files changed, 37 insertions, 71 deletions
diff --git a/legacy/emotion/src/bin/emotion_test_main.c b/legacy/emotion/src/bin/emotion_test_main.c index 98980886f3..1cd2048aa4 100644 --- a/legacy/emotion/src/bin/emotion_test_main.c +++ b/legacy/emotion/src/bin/emotion_test_main.c | |||
@@ -45,7 +45,7 @@ static Evas *evas = NULL; | |||
45 | static int startw = 800; | 45 | static int startw = 800; |
46 | static int starth = 600; | 46 | static int starth = 600; |
47 | 47 | ||
48 | static Evas_List *video_objs = NULL; | 48 | static Eina_List *video_objs = NULL; |
49 | static Emotion_Vis vis = EMOTION_VIS_NONE; | 49 | static Emotion_Vis vis = EMOTION_VIS_NONE; |
50 | 50 | ||
51 | static int | 51 | static int |
@@ -162,7 +162,7 @@ main_signal_exit(void *data, int ev_type, void *ev) | |||
162 | { | 162 | { |
163 | printf("del obj!\n"); | 163 | printf("del obj!\n"); |
164 | evas_object_del(video_objs->data); | 164 | evas_object_del(video_objs->data); |
165 | video_objs = evas_list_remove_list(video_objs, video_objs); | 165 | video_objs = eina_list_remove_list(video_objs, video_objs); |
166 | printf("done\n"); | 166 | printf("done\n"); |
167 | } | 167 | } |
168 | return 1; | 168 | return 1; |
@@ -199,21 +199,19 @@ bg_resize(Evas_Coord w, Evas_Coord h) | |||
199 | static void | 199 | static void |
200 | broadcast_event(Emotion_Event ev) | 200 | broadcast_event(Emotion_Event ev) |
201 | { | 201 | { |
202 | Evas_List *l; | 202 | Eina_List *l; |
203 | Evas_Object *obj; | ||
203 | 204 | ||
204 | for (l = video_objs; l; l = l->next) | 205 | EINA_LIST_FOREACH(video_objs, l, obj) |
205 | { | 206 | emotion_object_event_simple_send(obj, ev); |
206 | Evas_Object *obj; | ||
207 | |||
208 | obj = l->data; | ||
209 | emotion_object_event_simple_send(obj, ev); | ||
210 | } | ||
211 | } | 207 | } |
212 | 208 | ||
213 | static void | 209 | static void |
214 | bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info) | 210 | bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info) |
215 | { | 211 | { |
216 | Evas_Event_Key_Down *ev; | 212 | Evas_Event_Key_Down *ev; |
213 | Eina_List *l; | ||
214 | Evas_Object *o; | ||
217 | 215 | ||
218 | ev = (Evas_Event_Key_Down *)event_info; | 216 | ev = (Evas_Event_Key_Down *)event_info; |
219 | if (!strcmp(ev->keyname, "Escape")) | 217 | if (!strcmp(ev->keyname, "Escape")) |
@@ -258,77 +256,48 @@ bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info) | |||
258 | broadcast_event(EMOTION_EVENT_10); | 256 | broadcast_event(EMOTION_EVENT_10); |
259 | else if (!strcmp(ev->keyname, "bracketleft")) | 257 | else if (!strcmp(ev->keyname, "bracketleft")) |
260 | { | 258 | { |
261 | Evas_List *l; | 259 | EINA_LIST_FOREACH(video_objs, l, o) |
262 | 260 | emotion_object_audio_volume_set(o, emotion_object_audio_volume_get(o) - 0.1); | |
263 | for (l = video_objs; l; l = l->next) | ||
264 | { | ||
265 | Evas_Object *obj; | ||
266 | |||
267 | obj = l->data; | ||
268 | emotion_object_audio_volume_set(obj, emotion_object_audio_volume_get(obj) - 0.1); | ||
269 | } | ||
270 | } | 261 | } |
271 | else if (!strcmp(ev->keyname, "bracketright")) | 262 | else if (!strcmp(ev->keyname, "bracketright")) |
272 | { | 263 | { |
273 | Evas_List *l; | 264 | EINA_LIST_FOREACH(video_objs, l, o) |
274 | 265 | emotion_object_audio_volume_set(o, emotion_object_audio_volume_get(o) + 0.1); | |
275 | for (l = video_objs; l; l = l->next) | ||
276 | { | ||
277 | Evas_Object *obj; | ||
278 | |||
279 | obj = l->data; | ||
280 | emotion_object_audio_volume_set(obj, emotion_object_audio_volume_get(obj) + 0.1); | ||
281 | } | ||
282 | } | 266 | } |
283 | else if (!strcmp(ev->keyname, "v")) | 267 | else if (!strcmp(ev->keyname, "v")) |
284 | { | 268 | { |
285 | Evas_List *l; | 269 | EINA_LIST_FOREACH(video_objs, l, o) |
286 | |||
287 | for (l = video_objs; l; l = l->next) | ||
288 | { | 270 | { |
289 | Evas_Object *obj; | 271 | if (emotion_object_video_mute_get(o)) |
290 | 272 | emotion_object_video_mute_set(o, 0); | |
291 | obj = l->data; | ||
292 | if (emotion_object_video_mute_get(obj)) | ||
293 | emotion_object_video_mute_set(obj, 0); | ||
294 | else | 273 | else |
295 | emotion_object_video_mute_set(obj, 1); | 274 | emotion_object_video_mute_set(o, 1); |
296 | } | 275 | } |
297 | } | 276 | } |
298 | else if (!strcmp(ev->keyname, "a")) | 277 | else if (!strcmp(ev->keyname, "a")) |
299 | { | 278 | { |
300 | Evas_List *l; | 279 | EINA_LIST_FOREACH(video_objs, l, o) |
301 | |||
302 | for (l = video_objs; l; l = l->next) | ||
303 | { | 280 | { |
304 | Evas_Object *obj; | 281 | if (emotion_object_audio_mute_get(o)) |
305 | |||
306 | obj = l->data; | ||
307 | if (emotion_object_audio_mute_get(obj)) | ||
308 | { | 282 | { |
309 | emotion_object_audio_mute_set(obj, 0); | 283 | emotion_object_audio_mute_set(o, 0); |
310 | printf("unmute\n"); | 284 | printf("unmute\n"); |
311 | } | 285 | } |
312 | else | 286 | else |
313 | { | 287 | { |
314 | emotion_object_audio_mute_set(obj, 1); | 288 | emotion_object_audio_mute_set(o, 1); |
315 | printf("mute\n"); | 289 | printf("mute\n"); |
316 | } | 290 | } |
317 | } | 291 | } |
318 | } | 292 | } |
319 | else if (!strcmp(ev->keyname, "i")) | 293 | else if (!strcmp(ev->keyname, "i")) |
320 | { | 294 | { |
321 | Evas_List *l; | 295 | EINA_LIST_FOREACH(video_objs, l, o) |
322 | |||
323 | for (l = video_objs; l; l = l->next) | ||
324 | { | 296 | { |
325 | Evas_Object *obj; | 297 | printf("audio channels: %i\n", emotion_object_audio_channel_count(o)); |
326 | 298 | printf("video channels: %i\n", emotion_object_video_channel_count(o)); | |
327 | obj = l->data; | 299 | printf("spu channels: %i\n", emotion_object_spu_channel_count(o)); |
328 | printf("audio channels: %i\n", emotion_object_audio_channel_count(obj)); | 300 | printf("seekable: %i\n", emotion_object_seekable_get(o)); |
329 | printf("video channels: %i\n", emotion_object_video_channel_count(obj)); | ||
330 | printf("spu channels: %i\n", emotion_object_spu_channel_count(obj)); | ||
331 | printf("seekable: %i\n", emotion_object_seekable_get(obj)); | ||
332 | } | 301 | } |
333 | } | 302 | } |
334 | else if (!strcmp(ev->keyname, "f")) | 303 | else if (!strcmp(ev->keyname, "f")) |
@@ -372,34 +341,29 @@ bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info) | |||
372 | { | 341 | { |
373 | printf("del obj!\n"); | 342 | printf("del obj!\n"); |
374 | evas_object_del(video_objs->data); | 343 | evas_object_del(video_objs->data); |
375 | video_objs = evas_list_remove_list(video_objs, video_objs); | 344 | video_objs = eina_list_remove_list(video_objs, video_objs); |
376 | printf("done\n"); | 345 | printf("done\n"); |
377 | } | 346 | } |
378 | } | 347 | } |
379 | else if (!strcmp(ev->keyname, "z")) | 348 | else if (!strcmp(ev->keyname, "z")) |
380 | { | 349 | { |
381 | Evas_List *l; | ||
382 | |||
383 | vis = (vis + 1) % EMOTION_VIS_LAST; | 350 | vis = (vis + 1) % EMOTION_VIS_LAST; |
384 | printf("new visualization: %d\n", vis); | 351 | printf("new visualization: %d\n", vis); |
385 | 352 | ||
386 | 353 | EINA_LIST_FOREACH(video_objs, l, o) | |
387 | for (l = video_objs; l; l = l->next) | ||
388 | { | 354 | { |
389 | Evas_Object *obj; | ||
390 | Evas_Bool supported; | 355 | Evas_Bool supported; |
391 | 356 | ||
392 | obj = l->data; | 357 | supported = emotion_object_vis_supported(o, vis); |
393 | supported = emotion_object_vis_supported(obj, vis); | ||
394 | if (supported) | 358 | if (supported) |
395 | emotion_object_vis_set(obj, vis); | 359 | emotion_object_vis_set(o, vis); |
396 | else | 360 | else |
397 | { | 361 | { |
398 | const char *file; | 362 | const char *file; |
399 | 363 | ||
400 | file = emotion_object_file_get(obj); | 364 | file = emotion_object_file_get(o); |
401 | printf("object %p (%s) does not support visualization %d\n", | 365 | printf("object %p (%s) does not support visualization %d\n", |
402 | obj, file, vis); | 366 | o, file, vis); |
403 | } | 367 | } |
404 | } | 368 | } |
405 | } | 369 | } |
@@ -772,7 +736,7 @@ init_video_object(char *module_filename, char *filename) | |||
772 | /* end basic video setup. all the rest here is just to be fancy */ | 736 | /* end basic video setup. all the rest here is just to be fancy */ |
773 | 737 | ||
774 | 738 | ||
775 | video_objs = evas_list_append(video_objs, o); | 739 | video_objs = eina_list_append(video_objs, o); |
776 | 740 | ||
777 | emotion_object_size_get(o, &iw, &ih); | 741 | emotion_object_size_get(o, &iw, &ih); |
778 | w = iw; h = ih; | 742 | w = iw; h = ih; |
@@ -845,10 +809,11 @@ enter_idle(void *data) | |||
845 | static int | 809 | static int |
846 | check_positions(void *data) | 810 | check_positions(void *data) |
847 | { | 811 | { |
848 | const Evas_List *lst; | 812 | const Eina_List *lst; |
813 | Evas_Object *o; | ||
849 | 814 | ||
850 | for (lst = video_objs; lst != NULL; lst = lst->next) | 815 | EINA_LIST_FOREACH(video_objs, lst, o) |
851 | video_obj_time_changed(lst->data, evas_object_smart_parent_get(lst->data)); | 816 | video_obj_time_changed(data, evas_object_smart_parent_get(o)); |
852 | 817 | ||
853 | return !!video_objs; | 818 | return !!video_objs; |
854 | } | 819 | } |
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index 62d99e2d59..a49acb4245 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -140,6 +140,7 @@ _emotion_module_close(Emotion_Video_Module *mod, void *video) | |||
140 | void (*module_close) (Emotion_Video_Module *module, void *); | 140 | void (*module_close) (Emotion_Video_Module *module, void *); |
141 | 141 | ||
142 | plugin = mod->plugin; | 142 | plugin = mod->plugin; |
143 | fprintf(stderr, "%p\n", plugin); | ||
143 | module_close = ecore_plugin_symbol_get(mod->plugin, "module_close"); | 144 | module_close = ecore_plugin_symbol_get(mod->plugin, "module_close"); |
144 | if ((module_close) && (video)) module_close(mod, video); | 145 | if ((module_close) && (video)) module_close(mod, video); |
145 | /* FIXME: we can't go dlclosing here as a thread still may be running from | 146 | /* FIXME: we can't go dlclosing here as a thread still may be running from |