16 #ifdef HAVE_SYS_MMAN_H
17 # include <sys/mman.h>
25 #include "ecore_private.h"
26 #include "Ecore_Input.h"
28 #include "ecore_evas_private.h"
29 #include "Ecore_Evas.h"
31 Eina_Bool _ecore_evas_app_comp_sync = 1;
32 int _ecore_evas_log_dom = -1;
33 static int _ecore_evas_init_count = 0;
34 static Ecore_Fd_Handler *_ecore_evas_async_events_fd = NULL;
35 static Eina_Bool _ecore_evas_async_events_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
37 static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
38 static Ecore_Evas *ecore_evases = NULL;
39 static int _ecore_evas_fps_debug = 0;
42 _ecore_evas_idle_enter(void *data __UNUSED__)
49 if (!ecore_evases) return ECORE_CALLBACK_RENEW;
50 if (_ecore_evas_fps_debug)
52 t1 = ecore_time_get();
54 EINA_INLIST_FOREACH(ecore_evases, ee)
56 if (!ee->manual_render)
58 if (ee->engine.func->fn_render)
59 rend |= ee->engine.func->fn_render(ee);
62 if (_ecore_evas_fps_debug)
64 t2 = ecore_time_get();
66 _ecore_evas_fps_debug_rendertime_add(t2 - t1);
68 return ECORE_CALLBACK_RENEW;
72 * Query if a particular renginering engine target has support
73 * @param engine The engine to check support for
74 * @return 1 if the particular engine is supported, 0 if it is not
76 * Query if engine @param engine is supported by ecore_evas. 1 is returned if
77 * it is, and 0 is returned if it is not supported.
80 ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
84 case ECORE_EVAS_ENGINE_SOFTWARE_BUFFER:
85 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
90 case ECORE_EVAS_ENGINE_SOFTWARE_XLIB:
91 #ifdef BUILD_ECORE_EVAS_SOFTWARE_XLIB
96 case ECORE_EVAS_ENGINE_XRENDER_X11:
98 case ECORE_EVAS_ENGINE_OPENGL_X11:
99 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
104 case ECORE_EVAS_ENGINE_SOFTWARE_XCB:
105 #ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
110 case ECORE_EVAS_ENGINE_XRENDER_XCB:
112 case ECORE_EVAS_ENGINE_SOFTWARE_GDI:
113 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
118 case ECORE_EVAS_ENGINE_SOFTWARE_DDRAW:
119 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
124 case ECORE_EVAS_ENGINE_DIRECT3D:
125 #ifdef BUILD_ECORE_EVAS_DIRECT3D
130 case ECORE_EVAS_ENGINE_OPENGL_GLEW:
131 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
136 case ECORE_EVAS_ENGINE_SOFTWARE_SDL:
137 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
142 case ECORE_EVAS_ENGINE_OPENGL_SDL:
143 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
148 case ECORE_EVAS_ENGINE_DIRECTFB:
149 #ifdef BUILD_ECORE_EVAS_DIRECTFB
154 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
155 #ifdef BUILD_ECORE_EVAS_FB
161 case ECORE_EVAS_ENGINE_SOFTWARE_8_X11:
162 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
168 case ECORE_EVAS_ENGINE_SOFTWARE_16_X11:
169 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
174 case ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW:
175 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
180 case ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE:
181 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
186 case ECORE_EVAS_ENGINE_OPENGL_COCOA:
187 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
192 case ECORE_EVAS_ENGINE_EWS:
193 #ifdef BUILD_ECORE_EVAS_EWS
198 case ECORE_EVAS_ENGINE_PSL1GHT:
199 #ifdef BUILD_ECORE_EVAS_PSL1GHT
204 case ECORE_EVAS_ENGINE_WAYLAND_SHM:
205 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
210 case ECORE_EVAS_ENGINE_WAYLAND_EGL:
211 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
222 ecore_evas_init(void)
226 if (++_ecore_evas_init_count != 1)
227 return _ecore_evas_init_count;
230 return --_ecore_evas_init_count;
235 _ecore_evas_log_dom = eina_log_domain_register
236 ("ecore_evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
237 if(_ecore_evas_log_dom < 0)
239 EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
243 fd = evas_async_events_fd_get();
245 _ecore_evas_async_events_fd = ecore_main_fd_handler_add(fd,
247 _ecore_evas_async_events_fd_handler, NULL,
250 ecore_evas_idle_enterer =
251 ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
252 if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
253 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
255 #ifdef BUILD_ECORE_EVAS_EWS
256 _ecore_evas_ews_events_init();
259 _ecore_evas_extn_init();
261 if (getenv("ECORE_EVAS_COMP_NOSYNC"))
262 _ecore_evas_app_comp_sync = 0;
263 return _ecore_evas_init_count;
270 return --_ecore_evas_init_count;
274 ecore_evas_shutdown(void)
276 if (--_ecore_evas_init_count != 0)
277 return _ecore_evas_init_count;
279 while (ecore_evases) _ecore_evas_free(ecore_evases);
281 _ecore_evas_extn_shutdown();
283 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
284 ecore_idle_enterer_del(ecore_evas_idle_enterer);
285 ecore_evas_idle_enterer = NULL;
287 #ifdef BUILD_ECORE_EVAS_X11
288 while (_ecore_evas_x_shutdown());
290 #ifdef BUILD_ECORE_EVAS_WIN32
291 while (_ecore_evas_win32_shutdown());
293 #ifdef BUILD_ECORE_EVAS_FB
294 while (_ecore_evas_fb_shutdown());
296 #ifdef BUILD_ECORE_EVAS_EWS
297 while (_ecore_evas_ews_shutdown());
299 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
300 while (_ecore_evas_buffer_shutdown());
302 #ifdef BUILD_ECORE_EVAS_DIRECTFB
303 while (_ecore_evas_directfb_shutdown());
305 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
306 while (_ecore_evas_wince_shutdown());
309 if (_ecore_evas_async_events_fd)
310 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
312 eina_log_domain_unregister(_ecore_evas_log_dom);
313 _ecore_evas_log_dom = -1;
317 return _ecore_evas_init_count;
321 ecore_evas_app_comp_sync_set(Eina_Bool do_sync)
323 _ecore_evas_app_comp_sync = do_sync;
327 ecore_evas_app_comp_sync_get(void)
329 return _ecore_evas_app_comp_sync;
332 struct ecore_evas_engine {
334 Ecore_Evas *(*constructor)(int x, int y, int w, int h, const char *extra_options);
337 /* inline is just to avoid need to ifdef around it */
338 static inline const char *
339 _ecore_evas_parse_extra_options_str(const char *extra_options, const char *key, char **value)
341 int len = strlen(key);
343 while (extra_options)
347 if (strncmp(extra_options, key, len) != 0)
349 extra_options = strchr(extra_options, ';');
355 extra_options += len;
356 p = strchr(extra_options, ';');
359 len = p - extra_options;
360 *value = malloc(len + 1);
361 memcpy(*value, extra_options, len);
362 (*value)[len] = '\0';
363 extra_options = p + 1;
367 *value = strdup(extra_options);
368 extra_options = NULL;
371 return extra_options;
374 /* inline is just to avoid need to ifdef around it */
375 static inline const char *
376 _ecore_evas_parse_extra_options_uint(const char *extra_options, const char *key, unsigned int *value)
378 int len = strlen(key);
380 while (extra_options)
384 if (strncmp(extra_options, key, len) != 0)
386 extra_options = strchr(extra_options, ';');
392 extra_options += len;
393 *value = strtol(extra_options, NULL, 0);
395 p = strchr(extra_options, ';');
397 extra_options = p + 1;
399 extra_options = NULL;
401 return extra_options;
404 /* inline is just to avoid need to ifdef around it */
405 static inline const char *
406 _ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, unsigned int *parent)
408 _ecore_evas_parse_extra_options_str(extra_options, "display=", disp_name);
409 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", parent);
410 return extra_options;
413 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
415 _ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
417 unsigned int parent = 0;
418 char *disp_name = NULL;
421 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
422 ee = ecore_evas_software_x11_new(disp_name, parent, x, y, w, h);
429 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
431 _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
436 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
437 ee = ecore_evas_cocoa_new(NULL, x, y, w, h);
440 if (ee) ecore_evas_move(ee, x, y);
445 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
447 _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
449 Ecore_X_Window parent = 0;
450 char *disp_name = NULL;
453 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
454 ee = ecore_evas_gl_x11_new(disp_name, parent, x, y, w, h);
461 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
463 _ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
465 Ecore_X_Window parent = 0;
466 char *disp_name = NULL;
469 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
470 ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
477 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
479 _ecore_evas_constructor_software_16_x11(int x, int y, int w, int h, const char *extra_options)
481 Ecore_X_Window parent = 0;
482 char *disp_name = NULL;
485 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
486 ee = ecore_evas_software_x11_16_new(disp_name, parent, x, y, w, h);
493 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
495 _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
498 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
501 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
502 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
503 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
504 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
505 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
507 ee = ecore_evas_sdl_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
514 _ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
517 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
520 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
521 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
522 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
523 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
525 ee = ecore_evas_sdl16_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
532 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
534 _ecore_evas_constructor_opengl_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
537 unsigned int fullscreen = 0, noframe = 0;
540 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
541 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
542 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
544 ee = ecore_evas_gl_sdl_new(name, w, h, fullscreen, noframe);
551 #ifdef BUILD_ECORE_EVAS_DIRECTFB
553 _ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
556 char *disp_name = NULL;
557 unsigned int windowed = 1;
559 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
560 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
562 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
569 #ifdef BUILD_ECORE_EVAS_FB
571 _ecore_evas_constructor_fb(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
574 char *disp_name = NULL;
575 unsigned int rotation = 0;
577 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
578 _ecore_evas_parse_extra_options_uint(extra_options, "rotation=", &rotation);
580 ee = ecore_evas_fb_new(disp_name, rotation, w, h);
588 #ifdef BUILD_ECORE_EVAS_PSL1GHT
590 _ecore_evas_constructor_psl1ght(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
595 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
596 ee = ecore_evas_psl1ght_new(name, w, h);
599 if (ee) ecore_evas_move(ee, x, y);
604 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
606 _ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
608 char *disp_name = NULL;
609 unsigned int frame = 0;
612 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
613 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
614 ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame);
621 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
623 _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
625 char *disp_name = NULL;
626 unsigned int frame = 0;
629 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
630 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
631 ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame);
638 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
640 _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
642 return ecore_evas_software_gdi_new(NULL, x, y, w, h);
646 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
648 _ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
650 return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
654 #ifdef BUILD_ECORE_EVAS_DIRECT3D
656 _ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
658 return ecore_evas_direct3d_new(NULL, x, y, w, h);
662 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
664 _ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
666 return ecore_evas_gl_glew_new(NULL, x, y, w, h);
670 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
672 _ecore_evas_constructor_software_16_ddraw(int x, int y, int w, int h, const char *extra_options)
674 return ecore_evas_software_16_ddraw_new(NULL, x, y, w, h);
678 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
680 _ecore_evas_constructor_software_16_wince(int x, int y, int w, int h, const char *extra_options __UNUSED__)
682 return ecore_evas_software_wince_new(NULL, x, y, w, h);
686 _ecore_evas_constructor_software_16_wince_fb(int x, int y, int w, int h, const char *extra_options __UNUSED__)
688 return ecore_evas_software_wince_fb_new(NULL, x, y, w, h);
692 _ecore_evas_constructor_software_16_wince_gapi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
694 return ecore_evas_software_wince_gapi_new(NULL, x, y, w, h);
698 _ecore_evas_constructor_software_16_wince_gdi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
700 return ecore_evas_software_wince_gdi_new(NULL, x, y, w, h);
704 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
706 _ecore_evas_constructor_buffer(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options __UNUSED__)
708 return ecore_evas_buffer_new(w, h);
712 #ifdef BUILD_ECORE_EVAS_EWS
714 _ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_options __UNUSED__)
716 return ecore_evas_ews_new(x, y, w, h);
720 /* note: keep sorted by priority, highest first */
721 static const struct ecore_evas_engine _engines[] = {
723 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
724 {"software_x11", _ecore_evas_constructor_software_x11},
726 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
727 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
729 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
730 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
732 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
733 {"software_16_x11", _ecore_evas_constructor_software_16_x11},
735 #ifdef BUILD_ECORE_EVAS_DIRECTFB
736 {"directfb", _ecore_evas_constructor_directfb},
738 #ifdef BUILD_ECORE_EVAS_FB
739 {"fb", _ecore_evas_constructor_fb},
743 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
744 {"software_gdi", _ecore_evas_constructor_software_gdi},
746 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
747 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
749 #ifdef BUILD_ECORE_EVAS_DIRECT3D
750 {"direct3d", _ecore_evas_constructor_direct3d},
752 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
753 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
755 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
756 {"software_16_ddraw", _ecore_evas_constructor_software_16_ddraw},
758 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
759 {"software_16_wince", _ecore_evas_constructor_software_16_wince},
760 {"software_16_wince_fb", _ecore_evas_constructor_software_16_wince_fb},
761 {"software_16_wince_gapi", _ecore_evas_constructor_software_16_wince_gapi},
762 {"software_16_wince_gdi", _ecore_evas_constructor_software_16_wince_gdi},
766 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
767 {"opengl_cocoa", _ecore_evas_constructor_cocoa},
771 #ifdef BUILD_ECORE_EVAS_PSL1GHT
772 {"psl1ght", _ecore_evas_constructor_psl1ght},
776 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
777 {"wayland_shm", _ecore_evas_constructor_wayland_shm},
780 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
781 {"wayland_egl", _ecore_evas_constructor_wayland_egl},
784 /* Last chance to have a window */
785 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
786 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
789 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
790 {"sdl", _ecore_evas_constructor_sdl},
791 {"software_16_sdl", _ecore_evas_constructor_sdl16},
795 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
796 {"buffer", _ecore_evas_constructor_buffer},
799 #ifdef BUILD_ECORE_EVAS_EWS
800 {"ews", _ecore_evas_constructor_ews},
806 ecore_evas_engines_get(void)
808 const struct ecore_evas_engine *itr;
809 Eina_List *lst = NULL;
811 for (itr = _engines; itr->name; itr++)
812 lst = eina_list_append(lst, itr->name);
818 ecore_evas_engines_free(Eina_List *engines)
820 eina_list_free(engines);
824 _ecore_evas_new_auto_discover(int x, int y, int w, int h, const char *extra_options)
826 const struct ecore_evas_engine *itr;
828 DBG("auto discover engine");
830 for (itr = _engines; itr->constructor; itr++)
832 Ecore_Evas *ee = itr->constructor(x, y, w, h, extra_options);
835 INF("auto discovered '%s'", itr->name);
840 WRN("could not auto discover.");
845 ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
847 const struct ecore_evas_engine *itr;
851 engine_name = getenv("ECORE_EVAS_ENGINE");
853 DBG("no engine_name provided, using ECORE_EVAS_ENGINE='%s'",
857 return _ecore_evas_new_auto_discover(x, y, w, h, extra_options);
859 for (itr = _engines; itr->name; itr++)
860 if (strcmp(itr->name, engine_name) == 0)
862 INF("using engine '%s', extra_options=%s",
863 engine_name, extra_options ? extra_options : "(null)");
864 return itr->constructor(x, y, w, h, extra_options);
867 WRN("unknown engine '%s'", engine_name);
872 ecore_evas_engine_name_get(const Ecore_Evas *ee)
880 ecore_evas_ecore_evas_get(const Evas *e)
882 Ecore_Evas *ee = evas_data_attach_get(e);
883 if (!ee) return NULL;
884 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
886 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_ecore_evas_get");
893 ecore_evas_free(Ecore_Evas *ee)
895 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
897 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
901 _ecore_evas_free(ee);
906 ecore_evas_data_get(const Ecore_Evas *ee, const char *key)
908 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
910 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
911 "ecore_evas_data_get");
915 if (!key) return NULL;
916 if (!ee->data) return NULL;
918 return eina_hash_find(ee->data, key);
922 ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
924 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
926 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
927 "ecore_evas_data_set");
934 eina_hash_del(ee->data, key, NULL);
938 ee->data = eina_hash_string_superfast_new(NULL);
939 eina_hash_add(ee->data, key, data);
943 #define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
947 ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
949 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
951 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
952 "ecore_evas_callback_resize_set");
955 IFC(ee, fn_callback_resize_set) (ee, func);
957 ee->func.fn_resize = func;
961 ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
963 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
965 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
966 "ecore_evas_callback_move_set");
969 IFC(ee, fn_callback_move_set) (ee, func);
971 ee->func.fn_move = func;
975 ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
977 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
979 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
980 "ecore_evas_callback_show_set");
983 IFC(ee, fn_callback_show_set) (ee, func);
985 ee->func.fn_show = func;
989 ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
991 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
993 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
994 "ecore_evas_callback_hide_set");
997 IFC(ee, fn_callback_hide_set) (ee, func);
999 ee->func.fn_hide = func;
1003 ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1005 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1007 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1008 "ecore_evas_callback_delete_request_set");
1011 IFC(ee, fn_callback_delete_request_set) (ee, func);
1013 ee->func.fn_delete_request = func;
1017 ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1019 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1021 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1022 "ecore_evas_callback_destroy_set");
1025 IFC(ee, fn_callback_destroy_set) (ee, func);
1027 ee->func.fn_destroy = func;
1031 ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1033 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1035 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1036 "ecore_evas_callback_focus_in_set");
1039 IFC(ee, fn_callback_focus_in_set) (ee, func);
1041 ee->func.fn_focus_in = func;
1045 ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1047 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1049 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1050 "ecore_evas_callback_focus_out_set");
1053 IFC(ee, fn_callback_focus_out_set) (ee, func);
1055 ee->func.fn_focus_out = func;
1059 ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1061 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1063 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1064 "ecore_evas_callback_sticky_set");
1067 IFC(ee, fn_callback_sticky_set) (ee, func);
1069 ee->func.fn_sticky = func;
1073 ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1075 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1077 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1078 "ecore_evas_callback_unsticky_set");
1081 IFC(ee, fn_callback_unsticky_set) (ee, func);
1083 ee->func.fn_unsticky = func;
1087 ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1089 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1091 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1092 "ecore_evas_callback_mouse_in_set");
1095 IFC(ee, fn_callback_mouse_in_set) (ee, func);
1097 ee->func.fn_mouse_in = func;
1101 ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1103 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1105 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1106 "ecore_evas_callback_mouse_out_set");
1109 IFC(ee, fn_callback_mouse_out_set) (ee, func);
1111 ee->func.fn_mouse_out = func;
1115 ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1117 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1119 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1120 "ecore_evas_callback_pre_render_set");
1123 IFC(ee, fn_callback_pre_render_set) (ee, func);
1125 ee->func.fn_pre_render = func;
1129 ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1131 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1133 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1134 "ecore_evas_callback_post_render_set");
1137 IFC(ee, fn_callback_post_render_set) (ee, func);
1139 ee->func.fn_post_render = func;
1143 ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1145 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1147 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1148 "ecore_evas_callback_pre_free_set");
1151 ee->func.fn_pre_free = func;
1155 * Get an Ecore_Evas's Evas
1156 * @param ee The Ecore_Evas whose Evas you wish to get
1157 * @return The Evas wrapped by @p ee
1159 * This function returns the Evas contained within @p ee.
1162 ecore_evas_get(const Ecore_Evas *ee)
1164 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1166 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1174 ecore_evas_move(Ecore_Evas *ee, int x, int y)
1176 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1178 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1182 if (ee->prop.fullscreen) return;
1183 IFC(ee, fn_move) (ee, x, y);
1188 * Provide Managed move co-ordinates for an Ecore_Evas
1189 * @param ee The Ecore_Evas to move
1190 * @param x The x coordinate to set as the managed location
1191 * @param y The y coordinate to set as the managed location
1193 * This sets the managed geometry position of the @p ee to (@p x, @p y)
1196 ecore_evas_managed_move(Ecore_Evas *ee, int x, int y)
1198 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1200 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1204 IFC(ee, fn_managed_move) (ee, x, y);
1209 ecore_evas_resize(Ecore_Evas *ee, int w, int h)
1211 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1213 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1214 "ecore_evas_resize");
1217 if (ee->prop.fullscreen) return;
1220 if ((ee->rotation == 90) || (ee->rotation == 270))
1222 IFC(ee, fn_resize) (ee, h, w);
1227 IFC(ee, fn_resize) (ee, w, h);
1233 ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
1235 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1237 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1238 "ecore_evas_move_resize");
1241 if (ee->prop.fullscreen) return;
1244 if ((ee->rotation == 90) || (ee->rotation == 270))
1246 IFC(ee, fn_move_resize) (ee, x, y, h, w);
1251 IFC(ee, fn_move_resize) (ee, x, y, w, h);
1257 ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1259 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1261 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1262 "ecore_evas_geometry_get");
1265 if ((ee->rotation == 90) || (ee->rotation == 270))
1282 ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1284 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1286 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1287 "ecore_evas_request_geometry_get");
1290 if ((ee->rotation == 90) || (ee->rotation == 270))
1292 if (x) *x = ee->req.x;
1293 if (y) *y = ee->req.y;
1294 if (w) *w = ee->req.h;
1295 if (h) *h = ee->req.w;
1299 if (x) *x = ee->req.x;
1300 if (y) *y = ee->req.y;
1301 if (w) *w = ee->req.w;
1302 if (h) *h = ee->req.h;
1307 ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
1309 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1311 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1312 "ecore_evas_rotation_set");
1316 while (rot < 0) rot += 360;
1317 while (rot >= 360) rot -= 360;
1318 IFC(ee, fn_rotation_set) (ee, rot, 0);
1319 /* make sure everything gets redrawn */
1320 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1321 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1326 ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
1328 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1330 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1331 "ecore_evas_rotation_set");
1335 while (rot < 0) rot += 360;
1336 while (rot >= 360) rot -= 360;
1337 IFC(ee, fn_rotation_set) (ee, rot, 1);
1338 /* make sure everything gets redrawn */
1339 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1340 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1345 ecore_evas_rotation_get(const Ecore_Evas *ee)
1347 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1349 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1350 "ecore_evas_rotation_get");
1353 return ee->rotation;
1357 * Set whether an Ecore_Evas is shaped or not.
1358 * @param ee The Ecore_Evas to shape
1359 * @param shaped EINA_TRUE to shape, EINA_FALSE to not
1361 * This function allows one to make an Ecore_Evas shaped to the contents of the
1362 * evas. If @p shaped is EINA_TRUE, @p ee will be transparent in parts of the evas that
1363 * contain no objects. If @p shaped is EINA_FALSE, then @p ee will be rectangular, and
1364 * and parts with no data will show random framebuffer artifacting. For
1365 * non-shaped Ecore_Evases, it is recommend to cover the entire evas with a
1366 * background object.
1369 ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped)
1371 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1373 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1374 "ecore_evas_shaped_set");
1377 IFC(ee, fn_shaped_set) (ee, shaped);
1382 * Query whether an Ecore_Evas is shaped or not.
1383 * @param ee The Ecore_Evas to query.
1384 * @return EINA_TRUE if shaped, EINA_FALSE if not.
1386 * This function returns EINA_TRUE if @p ee is shaped, and EINA_FALSE if not.
1389 ecore_evas_shaped_get(const Ecore_Evas *ee)
1391 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1393 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1394 "ecore_evas_shaped_get");
1397 return ee->shaped ? EINA_TRUE : EINA_FALSE;
1401 ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha)
1403 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1405 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1406 "ecore_evas_alpha_set");
1409 IFC(ee, fn_alpha_set) (ee, alpha);
1414 ecore_evas_alpha_get(const Ecore_Evas *ee)
1416 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1418 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1419 "ecore_evas_alpha_get");
1422 return ee->alpha ? EINA_TRUE : EINA_FALSE;
1426 ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent)
1428 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1430 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1431 "ecore_evas_transparent_set");
1434 IFC(ee, fn_transparent_set) (ee, transparent);
1439 ecore_evas_transparent_get(const Ecore_Evas *ee)
1441 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1443 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1444 "ecore_evas_transparent_get");
1447 return ee->transparent ? EINA_TRUE : 0;
1451 ecore_evas_show(Ecore_Evas *ee)
1453 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1455 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1459 IFC(ee, fn_show) (ee);
1464 ecore_evas_hide(Ecore_Evas *ee)
1466 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1468 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1472 IFC(ee, fn_hide) (ee);
1477 ecore_evas_visibility_get(const Ecore_Evas *ee)
1479 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1481 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1482 "ecore_evas_visibility_get");
1485 return ee->visible ? 1:0;
1489 ecore_evas_raise(Ecore_Evas *ee)
1491 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1493 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1494 "ecore_evas_raise");
1497 IFC(ee, fn_raise) (ee);
1502 ecore_evas_lower(Ecore_Evas *ee)
1504 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1506 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1507 "ecore_evas_lower");
1510 IFC(ee, fn_lower) (ee);
1515 * Activate (set focus to, via the window manager) an Ecore_Evas' window.
1516 * @param ee The Ecore_Evas to activate.
1518 * This functions activates the Ecore_Evas.
1521 ecore_evas_activate(Ecore_Evas *ee)
1523 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1525 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1526 "ecore_evas_activate");
1529 IFC(ee, fn_activate) (ee);
1534 ecore_evas_title_set(Ecore_Evas *ee, const char *t)
1536 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1538 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1539 "ecore_evas_title_set");
1542 IFC(ee, fn_title_set) (ee, t);
1547 ecore_evas_title_get(const Ecore_Evas *ee)
1549 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1551 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1552 "ecore_evas_title_get");
1555 return ee->prop.title;
1559 ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
1561 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1563 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1564 "ecore_evas_name_class_set");
1567 IFC(ee, fn_name_class_set) (ee, n, c);
1572 ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c)
1574 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1576 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1577 "ecore_evas_name_class_get");
1580 if (n) *n = ee->prop.name;
1581 if (c) *c = ee->prop.clas;
1585 ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
1587 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1589 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1590 "ecore_evas_size_min_set");
1595 if ((ee->rotation == 90) || (ee->rotation == 270))
1597 IFC(ee, fn_size_min_set) (ee, h, w);
1602 IFC(ee, fn_size_min_set) (ee, w, h);
1608 ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h)
1610 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1612 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1613 "ecore_evas_size_min_get");
1616 if ((ee->rotation == 90) || (ee->rotation == 270))
1618 if (w) *w = ee->prop.min.h;
1619 if (h) *h = ee->prop.min.w;
1623 if (w) *w = ee->prop.min.w;
1624 if (h) *h = ee->prop.min.h;
1629 ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h)
1631 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1633 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1634 "ecore_evas_size_max_set");
1639 if ((ee->rotation == 90) || (ee->rotation == 270))
1641 IFC(ee, fn_size_max_set) (ee, h, w);
1646 IFC(ee, fn_size_max_set) (ee, w, h);
1652 ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h)
1654 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1656 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1657 "ecore_evas_size_max_get");
1660 if ((ee->rotation == 90) || (ee->rotation == 270))
1662 if (w) *w = ee->prop.max.h;
1663 if (h) *h = ee->prop.max.w;
1667 if (w) *w = ee->prop.max.w;
1668 if (h) *h = ee->prop.max.h;
1673 ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h)
1675 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1677 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1678 "ecore_evas_size_base_set");
1683 if ((ee->rotation == 90) || (ee->rotation == 270))
1685 IFC(ee, fn_size_base_set) (ee, h, w);
1690 IFC(ee, fn_size_base_set) (ee, w, h);
1696 ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h)
1698 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1700 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1701 "ecore_evas_size_base_get");
1704 if ((ee->rotation == 90) || (ee->rotation == 270))
1706 if (w) *w = ee->prop.base.h;
1707 if (h) *h = ee->prop.base.w;
1711 if (w) *w = ee->prop.base.w;
1712 if (h) *h = ee->prop.base.h;
1717 ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
1719 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1721 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1722 "ecore_evas_size_step_set");
1727 if ((ee->rotation == 90) || (ee->rotation == 270))
1729 IFC(ee, fn_size_step_set) (ee, h, w);
1734 IFC(ee, fn_size_step_set) (ee, w, h);
1740 ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h)
1742 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1744 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1745 "ecore_evas_size_step_get");
1748 if ((ee->rotation == 90) || (ee->rotation == 270))
1750 if (w) *w = ee->prop.step.h;
1751 if (h) *h = ee->prop.step.w;
1755 if (w) *w = ee->prop.step.w;
1756 if (h) *h = ee->prop.step.h;
1761 ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y)
1763 Evas_Object *obj = NULL;
1765 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1767 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1768 "ecore_evas_cursor_set");
1776 obj = evas_object_image_add(ee->evas);
1777 evas_object_image_file_set(obj, file, NULL);
1778 evas_object_image_size_get(obj, &x, &y);
1779 evas_object_resize(obj, x, y);
1780 evas_object_image_fill_set(obj, 0, 0, x, y);
1783 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
1788 ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
1790 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1792 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1793 "ecore_evas_cursor_set");
1796 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
1801 ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y)
1803 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1805 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1806 "ecore_evas_cursor_get");
1809 if (obj) *obj = ee->prop.cursor.object;
1810 if (layer) *layer = ee->prop.cursor.layer;
1811 if (hot_x) *hot_x = ee->prop.cursor.hot.x;
1812 if (hot_y) *hot_y = ee->prop.cursor.hot.y;
1816 ecore_evas_layer_set(Ecore_Evas *ee, int layer)
1818 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1820 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1821 "ecore_evas_layer_set");
1824 IFC(ee, fn_layer_set) (ee, layer);
1829 ecore_evas_layer_get(const Ecore_Evas *ee)
1831 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1833 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1834 "ecore_evas_layer_get");
1837 return ee->prop.layer;
1841 ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on)
1843 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1845 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1846 "ecore_evas_focus_set");
1849 IFC(ee, fn_focus_set) (ee, on);
1854 ecore_evas_focus_get(const Ecore_Evas *ee)
1856 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1858 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1859 "ecore_evas_focus_get");
1862 return ee->prop.focused ? EINA_TRUE : EINA_FALSE;
1866 ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
1868 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1870 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1871 "ecore_evas_iconified_set");
1874 IFC(ee, fn_iconified_set) (ee, on);
1879 ecore_evas_iconified_get(const Ecore_Evas *ee)
1881 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1883 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1884 "ecore_evas_iconified_get");
1887 return ee->prop.iconified ? EINA_TRUE : EINA_FALSE;
1891 ecore_evas_borderless_set(Ecore_Evas *ee, Eina_Bool on)
1893 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1895 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1896 "ecore_evas_borderless_set");
1899 IFC(ee, fn_borderless_set) (ee, on);
1904 ecore_evas_borderless_get(const Ecore_Evas *ee)
1906 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1908 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1909 "ecore_evas_borderless_get");
1912 return ee->prop.borderless ? EINA_TRUE : EINA_FALSE;
1916 * Tell the WM whether or not to ignore an Ecore_Evas' window
1917 * @param ee The Ecore_Evas
1918 * @param on EINA_TRUE to ignore, EINA_FALSE to not.
1920 * This function causes the window manager to ignore @p ee if @p on is EINA_TRUE,
1921 * or not ignore @p ee if @p on is EINA_FALSE.
1924 ecore_evas_override_set(Ecore_Evas *ee, Eina_Bool on)
1926 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1928 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1929 "ecore_evas_override_set");
1932 IFC(ee, fn_override_set) (ee, on);
1937 * Query whether an Ecore_Evas' window is overridden or not
1938 * @param ee The Ecore_Evas to set
1939 * @return EINA_TRUE if @p ee is overridden, EINA_FALSE if not.
1943 ecore_evas_override_get(const Ecore_Evas *ee)
1945 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1947 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1948 "ecore_evas_override_get");
1951 return ee->prop.override ? EINA_TRUE : EINA_FALSE;
1955 ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on)
1957 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1959 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1960 "ecore_evas_maximized_set");
1963 IFC(ee, fn_maximized_set) (ee, on);
1968 ecore_evas_maximized_get(const Ecore_Evas *ee)
1970 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1972 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1973 "ecore_evas_maximized_get");
1976 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
1980 ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
1982 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1984 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1985 "ecore_evas_fullscreen_set");
1988 IFC(ee, fn_fullscreen_set) (ee, on);
1993 ecore_evas_fullscreen_get(const Ecore_Evas *ee)
1995 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1997 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1998 "ecore_evas_fullscreen_get");
2001 return ee->prop.fullscreen ? EINA_TRUE : EINA_FALSE;
2005 * Set whether or not an Ecore_Evas' window should avoid damage
2007 * @param ee The Ecore_Evas
2008 * @param The type of the damage management
2010 * This function causes @p ee to be drawn to a pixmap to avoid recalculations.
2011 * On expose events it will copy from the pixmap to the window.
2014 ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
2016 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2018 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2019 "ecore_evas_avoid_damage_set");
2022 IFC(ee, fn_avoid_damage_set) (ee, on);
2027 * Query whether an Ecore_Evas' window avoids damage or not
2028 * @param ee The Ecore_Evas to set
2029 * @return The type of the damage management
2032 EAPI Ecore_Evas_Avoid_Damage_Type
2033 ecore_evas_avoid_damage_get(const Ecore_Evas *ee)
2035 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2037 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2038 "ecore_evas_avoid_damage_get");
2039 return ECORE_EVAS_AVOID_DAMAGE_NONE;
2041 return ee->prop.avoid_damage;
2045 * Set the withdrawn state of an Ecore_Evas' window.
2046 * @param ee The Ecore_Evas whose window's withdrawn state is set.
2047 * @param withdrawn The Ecore_Evas window's new withdrawn state.
2051 ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn)
2053 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2055 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2056 "ecore_evas_withdrawn_set");
2060 IFC(ee, fn_withdrawn_set) (ee, withdrawn);
2065 * Returns the withdrawn state of an Ecore_Evas' window.
2066 * @param ee The Ecore_Evas whose window's withdrawn state is returned.
2067 * @return The Ecore_Evas window's withdrawn state.
2071 ecore_evas_withdrawn_get(const Ecore_Evas *ee)
2073 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2075 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2076 "ecore_evas_withdrawn_get");
2079 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE;
2083 * Set the sticky state of an Ecore_Evas window.
2085 * @param ee The Ecore_Evas whose window's sticky state is set.
2086 * @param sticky The Ecore_Evas window's new sticky state.
2090 ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky)
2092 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2094 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2095 "ecore_evas_sticky_set");
2099 IFC(ee, fn_sticky_set) (ee, sticky);
2104 * Returns the sticky state of an Ecore_Evas' window.
2106 * @param ee The Ecore_Evas whose window's sticky state is returned.
2107 * @return The Ecore_Evas window's sticky state.
2111 ecore_evas_sticky_get(const Ecore_Evas *ee)
2113 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2115 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2116 "ecore_evas_sticky_get");
2119 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
2123 ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
2125 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2127 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2128 "ecore_evas_ignore_events_set");
2132 IFC(ee, fn_ignore_events_set) (ee, ignore);
2137 ecore_evas_ignore_events_get(const Ecore_Evas *ee)
2139 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2141 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2142 "ecore_evas_ignore_events_get");
2145 return ee->ignore_events ? EINA_TRUE : EINA_FALSE;
2149 ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render)
2151 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2153 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2154 "ecore_evas_manual_render_set");
2157 ee->manual_render = manual_render;
2161 ecore_evas_manual_render_get(const Ecore_Evas *ee)
2163 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2165 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2166 "ecore_evas_manual_render_get");
2169 return ee->manual_render ? EINA_TRUE : EINA_FALSE;
2173 ecore_evas_manual_render(Ecore_Evas *ee)
2175 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2177 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2178 "ecore_evas_manual_render");
2181 if (ee->engine.func->fn_render)
2182 ee->engine.func->fn_render(ee);
2186 ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync)
2188 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2190 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2191 "ecore_evas_comp_sync_set");
2194 ee->no_comp_sync = !do_sync;
2198 ecore_evas_comp_sync_get(const Ecore_Evas *ee)
2200 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2202 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2203 "ecore_evas_comp_sync_get");
2206 return !ee->no_comp_sync;
2210 ecore_evas_window_get(const Ecore_Evas *ee)
2212 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2214 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2215 "ecore_evas_window_get");
2219 return ee->prop.window;
2223 ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
2229 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2231 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2232 "ecore_evas_screen_geometry_get");
2236 IFC(ee, fn_screen_geometry_get) (ee, x, y, w, h);
2241 ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame)
2243 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2245 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_set");
2248 ee->prop.draw_frame = draw_frame;
2252 ecore_evas_draw_frame_get(const Ecore_Evas *ee)
2254 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2256 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_get");
2259 return ee->prop.draw_frame;
2262 /* fps debug calls - for debugging how much time your app actually spends */
2263 /* rendering graphics... :) */
2265 static int _ecore_evas_fps_debug_init_count = 0;
2266 static int _ecore_evas_fps_debug_fd = -1;
2267 unsigned int *_ecore_evas_fps_rendertime_mmap = NULL;
2270 _ecore_evas_fps_debug_init(void)
2275 _ecore_evas_fps_debug_init_count++;
2276 if (_ecore_evas_fps_debug_init_count > 1) return;
2281 tmp = evil_tmpdir_get ();
2282 #endif /* HAVE_EVIL */
2283 snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i", tmp, (int)getpid());
2284 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2285 if (_ecore_evas_fps_debug_fd < 0)
2288 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2290 if (_ecore_evas_fps_debug_fd >= 0)
2292 unsigned int zero = 0;
2293 char *buf2 = (char *)&zero;
2294 ssize_t todo = sizeof(unsigned int);
2298 ssize_t r = write(_ecore_evas_fps_debug_fd, buf2, todo);
2304 else if ((r < 0) && (errno == EINTR))
2308 ERR("could not write to file '%s' fd %d: %s",
2309 buf, _ecore_evas_fps_debug_fd, strerror(errno));
2310 close(_ecore_evas_fps_debug_fd);
2311 _ecore_evas_fps_debug_fd = -1;
2315 _ecore_evas_fps_rendertime_mmap = mmap(NULL, sizeof(unsigned int),
2316 PROT_READ | PROT_WRITE,
2318 _ecore_evas_fps_debug_fd, 0);
2319 if (_ecore_evas_fps_rendertime_mmap == MAP_FAILED)
2320 _ecore_evas_fps_rendertime_mmap = NULL;
2325 _ecore_evas_fps_debug_shutdown(void)
2327 _ecore_evas_fps_debug_init_count--;
2328 if (_ecore_evas_fps_debug_init_count > 0) return;
2329 if (_ecore_evas_fps_debug_fd >= 0)
2333 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2335 if (_ecore_evas_fps_rendertime_mmap)
2337 munmap(_ecore_evas_fps_rendertime_mmap, sizeof(int));
2338 _ecore_evas_fps_rendertime_mmap = NULL;
2340 close(_ecore_evas_fps_debug_fd);
2341 _ecore_evas_fps_debug_fd = -1;
2346 _ecore_evas_fps_debug_rendertime_add(double t)
2348 static double rtime = 0.0;
2349 static double rlapse = 0.0;
2350 static int frames = 0;
2351 static int flapse = 0;
2354 tim = ecore_time_get();
2362 else if ((tim - rlapse) >= 0.5)
2364 printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
2366 (frames - flapse) / (tim - rlapse),
2367 (100.0 * rtime) / (tim - rlapse)
2376 _ecore_evas_register(Ecore_Evas *ee)
2379 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
2380 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2384 _ecore_evas_ref(Ecore_Evas *ee)
2390 _ecore_evas_unref(Ecore_Evas *ee)
2393 if (ee->refcount == 0)
2395 if (ee->deleted) _ecore_evas_free(ee);
2397 else if (ee->refcount < -1)
2398 ERR("Ecore_Evas %p->refcount=%d < 0", ee, ee->refcount);
2402 _ecore_evas_free(Ecore_Evas *ee)
2404 ee->deleted = EINA_TRUE;
2405 if (ee->refcount > 0) return;
2407 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
2408 while (ee->sub_ecore_evas)
2410 _ecore_evas_free(ee->sub_ecore_evas->data);
2412 if (ee->data) eina_hash_free(ee->data);
2414 if (ee->name) free(ee->name);
2416 if (ee->prop.title) free(ee->prop.title);
2417 ee->prop.title = NULL;
2418 if (ee->prop.name) free(ee->prop.name);
2419 ee->prop.name = NULL;
2420 if (ee->prop.clas) free(ee->prop.clas);
2421 ee->prop.clas = NULL;
2422 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2423 ee->prop.cursor.object = NULL;
2424 if (ee->evas) evas_free(ee->evas);
2426 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
2428 if (ee->engine.idle_flush_timer)
2429 ecore_timer_del(ee->engine.idle_flush_timer);
2430 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
2433 ecore_evases = (Ecore_Evas *)eina_inlist_remove
2434 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2440 _ecore_evas_cb_idle_flush(void *data)
2444 ee = (Ecore_Evas *)data;
2445 evas_render_idle_flush(ee->evas);
2446 ee->engine.idle_flush_timer = NULL;
2447 return ECORE_CALLBACK_CANCEL;
2451 _ecore_evas_async_events_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
2453 evas_async_events_process();
2455 return ECORE_CALLBACK_RENEW;
2459 _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2461 if (ee->engine.idle_flush_timer)
2462 ecore_timer_del(ee->engine.idle_flush_timer);
2463 ee->engine.idle_flush_timer = ecore_timer_add(IDLE_FLUSH_TIME,
2464 _ecore_evas_cb_idle_flush,
2469 _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2473 if (ee->prop.cursor.object)
2475 evas_object_show(ee->prop.cursor.object);
2476 if (ee->rotation == 0)
2477 evas_object_move(ee->prop.cursor.object,
2478 x - ee->prop.cursor.hot.x,
2479 y - ee->prop.cursor.hot.y);
2480 else if (ee->rotation == 90)
2481 evas_object_move(ee->prop.cursor.object,
2482 ee->h - y - 1 - ee->prop.cursor.hot.x,
2483 x - ee->prop.cursor.hot.y);
2484 else if (ee->rotation == 180)
2485 evas_object_move(ee->prop.cursor.object,
2486 ee->w - x - 1 - ee->prop.cursor.hot.x,
2487 ee->h - y - 1 - ee->prop.cursor.hot.y);
2488 else if (ee->rotation == 270)
2489 evas_object_move(ee->prop.cursor.object,
2490 y - ee->prop.cursor.hot.x,
2491 ee->w - x - 1 - ee->prop.cursor.hot.y);
2493 if (ee->rotation == 0)
2494 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2495 else if (ee->rotation == 90)
2496 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
2497 else if (ee->rotation == 180)
2498 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
2499 else if (ee->rotation == 270)
2500 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
2504 _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
2507 double radius_x, double radius_y,
2510 double mx, double my,
2511 unsigned int timestamp)
2513 if (ee->rotation == 0)
2514 evas_event_feed_multi_move(ee->evas, device,
2519 angle - ee->rotation,
2522 else if (ee->rotation == 90)
2523 evas_event_feed_multi_move(ee->evas, device,
2528 angle - ee->rotation,
2531 else if (ee->rotation == 180)
2532 evas_event_feed_multi_move(ee->evas, device,
2533 ee->w - x - 1, ee->h - y - 1,
2537 angle - ee->rotation,
2538 ee->w - mx - 1, ee->h - my - 1,
2540 else if (ee->rotation == 270)
2541 evas_event_feed_multi_move(ee->evas, device,
2546 angle - ee->rotation,
2552 _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
2555 double radius_x, double radius_y,
2558 double mx, double my,
2559 Evas_Button_Flags flags,
2560 unsigned int timestamp)
2562 if (ee->rotation == 0)
2563 evas_event_feed_multi_down(ee->evas, device,
2568 angle - ee->rotation,
2570 flags, timestamp, NULL);
2571 else if (ee->rotation == 90)
2572 evas_event_feed_multi_down(ee->evas, device,
2577 angle - ee->rotation,
2579 flags, timestamp, NULL);
2580 else if (ee->rotation == 180)
2581 evas_event_feed_multi_down(ee->evas, device,
2582 ee->w - x - 1, ee->h - y - 1,
2586 angle - ee->rotation,
2587 ee->w - mx - 1, ee->h - my - 1,
2588 flags, timestamp, NULL);
2589 else if (ee->rotation == 270)
2590 evas_event_feed_multi_down(ee->evas, device,
2595 angle - ee->rotation,
2597 flags, timestamp, NULL);
2601 _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
2604 double radius_x, double radius_y,
2607 double mx, double my,
2608 Evas_Button_Flags flags,
2609 unsigned int timestamp)
2611 if (ee->rotation == 0)
2612 evas_event_feed_multi_up(ee->evas, device,
2617 angle - ee->rotation,
2619 flags, timestamp, NULL);
2620 else if (ee->rotation == 90)
2621 evas_event_feed_multi_up(ee->evas, device,
2626 angle - ee->rotation,
2628 flags, timestamp, NULL);
2629 else if (ee->rotation == 180)
2630 evas_event_feed_multi_up(ee->evas, device,
2631 ee->w - x - 1, ee->h - y - 1,
2635 angle - ee->rotation,
2636 ee->w - mx - 1, ee->h - my - 1,
2637 flags, timestamp, NULL);
2638 else if (ee->rotation == 270)
2639 evas_event_feed_multi_up(ee->evas, device,
2644 angle - ee->rotation,
2646 flags, timestamp, NULL);
2650 ecore_evas_ecore_evas_list_get(void)
2653 Eina_List *l = NULL;
2655 EINA_INLIST_FOREACH(ecore_evases, ee)
2657 l = eina_list_append(l, ee);
2664 ecore_evas_input_event_register(Ecore_Evas *ee)
2666 ecore_event_window_register((Ecore_Window)ee, ee, ee->evas,
2667 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
2668 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
2669 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
2670 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
2674 ecore_evas_input_event_unregister(Ecore_Evas *ee)
2676 ecore_event_window_unregister((Ecore_Window)ee);