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 rendering 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_fork_cb(void *data __UNUSED__)
226 if (_ecore_evas_async_events_fd)
227 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
228 fd = evas_async_events_fd_get();
230 _ecore_evas_async_events_fd =
231 ecore_main_fd_handler_add(fd, ECORE_FD_READ,
232 _ecore_evas_async_events_fd_handler, NULL,
237 ecore_evas_init(void)
241 if (++_ecore_evas_init_count != 1)
242 return _ecore_evas_init_count;
245 return --_ecore_evas_init_count;
250 _ecore_evas_log_dom = eina_log_domain_register
251 ("ecore_evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
252 if(_ecore_evas_log_dom < 0)
254 EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
258 ecore_fork_reset_callback_add(_ecore_evas_fork_cb, NULL);
259 fd = evas_async_events_fd_get();
261 _ecore_evas_async_events_fd =
262 ecore_main_fd_handler_add(fd, ECORE_FD_READ,
263 _ecore_evas_async_events_fd_handler, NULL,
266 ecore_evas_idle_enterer =
267 ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
268 if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
269 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
271 #ifdef BUILD_ECORE_EVAS_EWS
272 _ecore_evas_ews_events_init();
275 _ecore_evas_extn_init();
277 if (getenv("ECORE_EVAS_COMP_NOSYNC"))
278 _ecore_evas_app_comp_sync = 0;
279 return _ecore_evas_init_count;
286 return --_ecore_evas_init_count;
290 ecore_evas_shutdown(void)
292 if (--_ecore_evas_init_count != 0)
293 return _ecore_evas_init_count;
295 while (ecore_evases) _ecore_evas_free(ecore_evases);
297 _ecore_evas_extn_shutdown();
299 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
300 ecore_idle_enterer_del(ecore_evas_idle_enterer);
301 ecore_evas_idle_enterer = NULL;
303 #ifdef BUILD_ECORE_EVAS_X11
304 while (_ecore_evas_x_shutdown());
306 #ifdef BUILD_ECORE_EVAS_WIN32
307 while (_ecore_evas_win32_shutdown());
309 #ifdef BUILD_ECORE_EVAS_FB
310 while (_ecore_evas_fb_shutdown());
312 #ifdef BUILD_ECORE_EVAS_EWS
313 while (_ecore_evas_ews_shutdown());
315 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
316 while (_ecore_evas_buffer_shutdown());
318 #ifdef BUILD_ECORE_EVAS_DIRECTFB
319 while (_ecore_evas_directfb_shutdown());
321 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
322 while (_ecore_evas_wince_shutdown());
325 if (_ecore_evas_async_events_fd)
326 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
328 ecore_fork_reset_callback_del(_ecore_evas_fork_cb, NULL);
330 eina_log_domain_unregister(_ecore_evas_log_dom);
331 _ecore_evas_log_dom = -1;
335 return _ecore_evas_init_count;
339 ecore_evas_app_comp_sync_set(Eina_Bool do_sync)
341 _ecore_evas_app_comp_sync = do_sync;
345 ecore_evas_app_comp_sync_get(void)
347 return _ecore_evas_app_comp_sync;
350 struct ecore_evas_engine {
352 Ecore_Evas *(*constructor)(int x, int y, int w, int h, const char *extra_options);
355 /* inline is just to avoid need to ifdef around it */
356 static inline const char *
357 _ecore_evas_parse_extra_options_str(const char *extra_options, const char *key, char **value)
359 int len = strlen(key);
361 while (extra_options)
365 if (strncmp(extra_options, key, len) != 0)
367 extra_options = strchr(extra_options, ';');
373 extra_options += len;
374 p = strchr(extra_options, ';');
377 len = p - extra_options;
378 *value = malloc(len + 1);
379 memcpy(*value, extra_options, len);
380 (*value)[len] = '\0';
381 extra_options = p + 1;
385 *value = strdup(extra_options);
386 extra_options = NULL;
389 return extra_options;
392 /* inline is just to avoid need to ifdef around it */
393 static inline const char *
394 _ecore_evas_parse_extra_options_uint(const char *extra_options, const char *key, unsigned int *value)
396 int len = strlen(key);
398 while (extra_options)
402 if (strncmp(extra_options, key, len) != 0)
404 extra_options = strchr(extra_options, ';');
410 extra_options += len;
411 *value = strtol(extra_options, NULL, 0);
413 p = strchr(extra_options, ';');
415 extra_options = p + 1;
417 extra_options = NULL;
419 return extra_options;
422 /* inline is just to avoid need to ifdef around it */
423 static inline const char *
424 _ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, unsigned int *parent)
426 _ecore_evas_parse_extra_options_str(extra_options, "display=", disp_name);
427 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", parent);
428 return extra_options;
431 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
433 _ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
435 unsigned int parent = 0;
436 char *disp_name = NULL;
439 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
440 ee = ecore_evas_software_x11_new(disp_name, parent, x, y, w, h);
447 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
449 _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
454 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
455 ee = ecore_evas_cocoa_new(NULL, x, y, w, h);
458 if (ee) ecore_evas_move(ee, x, y);
463 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
465 _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
467 Ecore_X_Window parent = 0;
468 char *disp_name = NULL;
471 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
472 ee = ecore_evas_gl_x11_new(disp_name, parent, x, y, w, h);
479 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
481 _ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
483 Ecore_X_Window parent = 0;
484 char *disp_name = NULL;
487 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
488 ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
495 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
497 _ecore_evas_constructor_software_16_x11(int x, int y, int w, int h, const char *extra_options)
499 Ecore_X_Window parent = 0;
500 char *disp_name = NULL;
503 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
504 ee = ecore_evas_software_x11_16_new(disp_name, parent, x, y, w, h);
511 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
513 _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
516 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
519 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
520 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
521 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
522 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
523 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
525 ee = ecore_evas_sdl_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 = 1, parent = 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 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
615 ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame);
622 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
624 _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
626 char *disp_name = NULL;
627 unsigned int frame = 1, parent = 0;
630 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
631 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
632 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
633 ee = ecore_evas_wayland_egl_new(disp_name, parent, x, y, w, h, frame);
640 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
642 _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
644 return ecore_evas_software_gdi_new(NULL, x, y, w, h);
648 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
650 _ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
652 return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
656 #ifdef BUILD_ECORE_EVAS_DIRECT3D
658 _ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
660 return ecore_evas_direct3d_new(NULL, x, y, w, h);
664 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
666 _ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
668 return ecore_evas_gl_glew_new(NULL, x, y, w, h);
672 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
674 _ecore_evas_constructor_software_16_ddraw(int x, int y, int w, int h, const char *extra_options)
676 return ecore_evas_software_16_ddraw_new(NULL, x, y, w, h);
680 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
682 _ecore_evas_constructor_software_16_wince(int x, int y, int w, int h, const char *extra_options __UNUSED__)
684 return ecore_evas_software_wince_new(NULL, x, y, w, h);
688 _ecore_evas_constructor_software_16_wince_fb(int x, int y, int w, int h, const char *extra_options __UNUSED__)
690 return ecore_evas_software_wince_fb_new(NULL, x, y, w, h);
694 _ecore_evas_constructor_software_16_wince_gapi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
696 return ecore_evas_software_wince_gapi_new(NULL, x, y, w, h);
700 _ecore_evas_constructor_software_16_wince_gdi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
702 return ecore_evas_software_wince_gdi_new(NULL, x, y, w, h);
706 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
708 _ecore_evas_constructor_buffer(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options __UNUSED__)
710 return ecore_evas_buffer_new(w, h);
714 #ifdef BUILD_ECORE_EVAS_EWS
716 _ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_options __UNUSED__)
718 return ecore_evas_ews_new(x, y, w, h);
722 /* note: keep sorted by priority, highest first */
723 static const struct ecore_evas_engine _engines[] = {
725 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
726 {"software_x11", _ecore_evas_constructor_software_x11},
728 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
729 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
731 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
732 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
734 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
735 {"software_16_x11", _ecore_evas_constructor_software_16_x11},
737 #ifdef BUILD_ECORE_EVAS_DIRECTFB
738 {"directfb", _ecore_evas_constructor_directfb},
740 #ifdef BUILD_ECORE_EVAS_FB
741 {"fb", _ecore_evas_constructor_fb},
745 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
746 {"software_gdi", _ecore_evas_constructor_software_gdi},
748 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
749 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
751 #ifdef BUILD_ECORE_EVAS_DIRECT3D
752 {"direct3d", _ecore_evas_constructor_direct3d},
754 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
755 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
757 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
758 {"software_16_ddraw", _ecore_evas_constructor_software_16_ddraw},
760 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
761 {"software_16_wince", _ecore_evas_constructor_software_16_wince},
762 {"software_16_wince_fb", _ecore_evas_constructor_software_16_wince_fb},
763 {"software_16_wince_gapi", _ecore_evas_constructor_software_16_wince_gapi},
764 {"software_16_wince_gdi", _ecore_evas_constructor_software_16_wince_gdi},
768 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
769 {"opengl_cocoa", _ecore_evas_constructor_cocoa},
773 #ifdef BUILD_ECORE_EVAS_PSL1GHT
774 {"psl1ght", _ecore_evas_constructor_psl1ght},
778 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
779 {"wayland_shm", _ecore_evas_constructor_wayland_shm},
782 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
783 {"wayland_egl", _ecore_evas_constructor_wayland_egl},
786 /* Last chance to have a window */
787 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
788 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
791 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
792 {"sdl", _ecore_evas_constructor_sdl},
796 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
797 {"buffer", _ecore_evas_constructor_buffer},
800 #ifdef BUILD_ECORE_EVAS_EWS
801 {"ews", _ecore_evas_constructor_ews},
807 ecore_evas_engines_get(void)
809 const struct ecore_evas_engine *itr;
810 Eina_List *lst = NULL;
812 for (itr = _engines; itr->name; itr++)
813 lst = eina_list_append(lst, itr->name);
819 ecore_evas_engines_free(Eina_List *engines)
821 eina_list_free(engines);
825 _ecore_evas_new_auto_discover(int x, int y, int w, int h, const char *extra_options)
827 const struct ecore_evas_engine *itr;
829 DBG("auto discover engine");
831 for (itr = _engines; itr->constructor; itr++)
833 Ecore_Evas *ee = itr->constructor(x, y, w, h, extra_options);
836 INF("auto discovered '%s'", itr->name);
841 WRN("could not auto discover.");
846 ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
848 const struct ecore_evas_engine *itr;
852 engine_name = getenv("ECORE_EVAS_ENGINE");
854 DBG("no engine_name provided, using ECORE_EVAS_ENGINE='%s'",
858 return _ecore_evas_new_auto_discover(x, y, w, h, extra_options);
860 for (itr = _engines; itr->name; itr++)
861 if (strcmp(itr->name, engine_name) == 0)
863 INF("using engine '%s', extra_options=%s",
864 engine_name, extra_options ? extra_options : "(null)");
865 return itr->constructor(x, y, w, h, extra_options);
868 WRN("unknown engine '%s'", engine_name);
873 ecore_evas_engine_name_get(const Ecore_Evas *ee)
881 ecore_evas_ecore_evas_get(const Evas *e)
883 Ecore_Evas *ee = evas_data_attach_get(e);
884 if (!ee) return NULL;
885 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
887 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_ecore_evas_get");
894 ecore_evas_free(Ecore_Evas *ee)
896 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
898 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
902 _ecore_evas_free(ee);
907 ecore_evas_data_get(const Ecore_Evas *ee, const char *key)
909 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
911 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
912 "ecore_evas_data_get");
916 if (!key) return NULL;
917 if (!ee->data) return NULL;
919 return eina_hash_find(ee->data, key);
923 ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
925 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
927 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
928 "ecore_evas_data_set");
935 eina_hash_del(ee->data, key, NULL);
939 ee->data = eina_hash_string_superfast_new(NULL);
940 eina_hash_add(ee->data, key, data);
944 #define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
948 ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
950 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
952 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
953 "ecore_evas_callback_resize_set");
956 IFC(ee, fn_callback_resize_set) (ee, func);
958 ee->func.fn_resize = func;
962 ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
964 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
966 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
967 "ecore_evas_callback_move_set");
970 IFC(ee, fn_callback_move_set) (ee, func);
972 ee->func.fn_move = func;
976 ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
978 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
980 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
981 "ecore_evas_callback_show_set");
984 IFC(ee, fn_callback_show_set) (ee, func);
986 ee->func.fn_show = func;
990 ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
992 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
994 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
995 "ecore_evas_callback_hide_set");
998 IFC(ee, fn_callback_hide_set) (ee, func);
1000 ee->func.fn_hide = func;
1004 ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1006 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1008 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1009 "ecore_evas_callback_delete_request_set");
1012 IFC(ee, fn_callback_delete_request_set) (ee, func);
1014 ee->func.fn_delete_request = func;
1018 ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1020 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1022 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1023 "ecore_evas_callback_destroy_set");
1026 IFC(ee, fn_callback_destroy_set) (ee, func);
1028 ee->func.fn_destroy = func;
1032 ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1034 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1036 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1037 "ecore_evas_callback_focus_in_set");
1040 IFC(ee, fn_callback_focus_in_set) (ee, func);
1042 ee->func.fn_focus_in = func;
1046 ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1048 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1050 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1051 "ecore_evas_callback_focus_out_set");
1054 IFC(ee, fn_callback_focus_out_set) (ee, func);
1056 ee->func.fn_focus_out = func;
1060 ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1062 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1064 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1065 "ecore_evas_callback_sticky_set");
1068 IFC(ee, fn_callback_sticky_set) (ee, func);
1070 ee->func.fn_sticky = func;
1074 ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1076 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1078 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1079 "ecore_evas_callback_unsticky_set");
1082 IFC(ee, fn_callback_unsticky_set) (ee, func);
1084 ee->func.fn_unsticky = func;
1088 ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1090 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1092 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1093 "ecore_evas_callback_mouse_in_set");
1096 IFC(ee, fn_callback_mouse_in_set) (ee, func);
1098 ee->func.fn_mouse_in = func;
1102 ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1104 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1106 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1107 "ecore_evas_callback_mouse_out_set");
1110 IFC(ee, fn_callback_mouse_out_set) (ee, func);
1112 ee->func.fn_mouse_out = func;
1116 ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1118 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1120 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1121 "ecore_evas_callback_pre_render_set");
1124 IFC(ee, fn_callback_pre_render_set) (ee, func);
1126 ee->func.fn_pre_render = func;
1130 ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1132 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1134 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1135 "ecore_evas_callback_post_render_set");
1138 IFC(ee, fn_callback_post_render_set) (ee, func);
1140 ee->func.fn_post_render = func;
1144 ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1146 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1148 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1149 "ecore_evas_callback_pre_free_set");
1152 ee->func.fn_pre_free = func;
1156 ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1158 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1160 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1161 "ecore_evas_callback_state_change_set");
1164 ee->func.fn_state_change = func;
1168 ecore_evas_get(const Ecore_Evas *ee)
1170 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1172 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1180 ecore_evas_move(Ecore_Evas *ee, int x, int y)
1182 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1184 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1188 if (ee->prop.fullscreen) return;
1189 IFC(ee, fn_move) (ee, x, y);
1194 ecore_evas_managed_move(Ecore_Evas *ee, int x, int y)
1196 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1198 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1202 IFC(ee, fn_managed_move) (ee, x, y);
1207 ecore_evas_resize(Ecore_Evas *ee, int w, int h)
1209 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1211 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1212 "ecore_evas_resize");
1215 if (ee->prop.fullscreen) return;
1218 if ((ee->rotation == 90) || (ee->rotation == 270))
1220 IFC(ee, fn_resize) (ee, h, w);
1225 IFC(ee, fn_resize) (ee, w, h);
1231 ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
1233 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1235 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1236 "ecore_evas_move_resize");
1239 if (ee->prop.fullscreen) return;
1242 if ((ee->rotation == 90) || (ee->rotation == 270))
1244 IFC(ee, fn_move_resize) (ee, x, y, h, w);
1249 IFC(ee, fn_move_resize) (ee, x, y, w, h);
1255 ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1257 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1259 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1260 "ecore_evas_geometry_get");
1263 if ((ee->rotation == 90) || (ee->rotation == 270))
1280 ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1282 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1284 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1285 "ecore_evas_request_geometry_get");
1288 if ((ee->rotation == 90) || (ee->rotation == 270))
1290 if (x) *x = ee->req.x;
1291 if (y) *y = ee->req.y;
1292 if (w) *w = ee->req.h;
1293 if (h) *h = ee->req.w;
1297 if (x) *x = ee->req.x;
1298 if (y) *y = ee->req.y;
1299 if (w) *w = ee->req.w;
1300 if (h) *h = ee->req.h;
1305 ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
1307 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1309 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1310 "ecore_evas_rotation_set");
1314 while (rot < 0) rot += 360;
1315 while (rot >= 360) rot -= 360;
1316 IFC(ee, fn_rotation_set) (ee, rot, 0);
1317 /* make sure everything gets redrawn */
1318 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1319 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1324 ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
1326 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1328 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1329 "ecore_evas_rotation_set");
1333 while (rot < 0) rot += 360;
1334 while (rot >= 360) rot -= 360;
1335 IFC(ee, fn_rotation_set) (ee, rot, 1);
1336 /* make sure everything gets redrawn */
1337 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1338 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1343 ecore_evas_rotation_get(const Ecore_Evas *ee)
1345 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1347 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1348 "ecore_evas_rotation_get");
1351 return ee->rotation;
1355 ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped)
1357 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1359 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1360 "ecore_evas_shaped_set");
1363 IFC(ee, fn_shaped_set) (ee, shaped);
1368 ecore_evas_shaped_get(const Ecore_Evas *ee)
1370 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1372 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1373 "ecore_evas_shaped_get");
1376 return ee->shaped ? EINA_TRUE : EINA_FALSE;
1380 ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha)
1382 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1384 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1385 "ecore_evas_alpha_set");
1388 IFC(ee, fn_alpha_set) (ee, alpha);
1393 ecore_evas_alpha_get(const Ecore_Evas *ee)
1395 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1397 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1398 "ecore_evas_alpha_get");
1401 return ee->alpha ? EINA_TRUE : EINA_FALSE;
1405 ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent)
1407 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1409 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1410 "ecore_evas_transparent_set");
1413 IFC(ee, fn_transparent_set) (ee, transparent);
1418 ecore_evas_transparent_get(const Ecore_Evas *ee)
1420 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1422 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1423 "ecore_evas_transparent_get");
1426 return ee->transparent ? EINA_TRUE : 0;
1430 ecore_evas_show(Ecore_Evas *ee)
1432 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1434 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1438 IFC(ee, fn_show) (ee);
1443 ecore_evas_hide(Ecore_Evas *ee)
1445 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1447 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1451 IFC(ee, fn_hide) (ee);
1456 ecore_evas_visibility_get(const Ecore_Evas *ee)
1458 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1460 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1461 "ecore_evas_visibility_get");
1464 return ee->visible ? 1:0;
1468 ecore_evas_raise(Ecore_Evas *ee)
1470 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1472 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1473 "ecore_evas_raise");
1476 IFC(ee, fn_raise) (ee);
1481 ecore_evas_lower(Ecore_Evas *ee)
1483 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1485 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1486 "ecore_evas_lower");
1489 IFC(ee, fn_lower) (ee);
1494 ecore_evas_activate(Ecore_Evas *ee)
1496 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1498 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1499 "ecore_evas_activate");
1502 IFC(ee, fn_activate) (ee);
1507 ecore_evas_title_set(Ecore_Evas *ee, const char *t)
1509 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1511 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1512 "ecore_evas_title_set");
1515 IFC(ee, fn_title_set) (ee, t);
1520 ecore_evas_title_get(const Ecore_Evas *ee)
1522 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1524 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1525 "ecore_evas_title_get");
1528 return ee->prop.title;
1532 ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
1534 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1536 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1537 "ecore_evas_name_class_set");
1540 IFC(ee, fn_name_class_set) (ee, n, c);
1545 ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c)
1547 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1549 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1550 "ecore_evas_name_class_get");
1553 if (n) *n = ee->prop.name;
1554 if (c) *c = ee->prop.clas;
1558 ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
1560 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1562 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1563 "ecore_evas_size_min_set");
1568 if ((ee->rotation == 90) || (ee->rotation == 270))
1570 IFC(ee, fn_size_min_set) (ee, h, w);
1575 IFC(ee, fn_size_min_set) (ee, w, h);
1581 ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h)
1583 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1585 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1586 "ecore_evas_size_min_get");
1589 if ((ee->rotation == 90) || (ee->rotation == 270))
1591 if (w) *w = ee->prop.min.h;
1592 if (h) *h = ee->prop.min.w;
1596 if (w) *w = ee->prop.min.w;
1597 if (h) *h = ee->prop.min.h;
1602 ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h)
1604 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1606 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1607 "ecore_evas_size_max_set");
1612 if ((ee->rotation == 90) || (ee->rotation == 270))
1614 IFC(ee, fn_size_max_set) (ee, h, w);
1619 IFC(ee, fn_size_max_set) (ee, w, h);
1625 ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h)
1627 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1629 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1630 "ecore_evas_size_max_get");
1633 if ((ee->rotation == 90) || (ee->rotation == 270))
1635 if (w) *w = ee->prop.max.h;
1636 if (h) *h = ee->prop.max.w;
1640 if (w) *w = ee->prop.max.w;
1641 if (h) *h = ee->prop.max.h;
1646 ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h)
1648 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1650 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1651 "ecore_evas_size_base_set");
1656 if ((ee->rotation == 90) || (ee->rotation == 270))
1658 IFC(ee, fn_size_base_set) (ee, h, w);
1663 IFC(ee, fn_size_base_set) (ee, w, h);
1669 ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h)
1671 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1673 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1674 "ecore_evas_size_base_get");
1677 if ((ee->rotation == 90) || (ee->rotation == 270))
1679 if (w) *w = ee->prop.base.h;
1680 if (h) *h = ee->prop.base.w;
1684 if (w) *w = ee->prop.base.w;
1685 if (h) *h = ee->prop.base.h;
1690 ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
1692 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1694 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1695 "ecore_evas_size_step_set");
1700 if ((ee->rotation == 90) || (ee->rotation == 270))
1702 IFC(ee, fn_size_step_set) (ee, h, w);
1707 IFC(ee, fn_size_step_set) (ee, w, h);
1713 ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h)
1715 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1717 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1718 "ecore_evas_size_step_get");
1721 if ((ee->rotation == 90) || (ee->rotation == 270))
1723 if (w) *w = ee->prop.step.h;
1724 if (h) *h = ee->prop.step.w;
1728 if (w) *w = ee->prop.step.w;
1729 if (h) *h = ee->prop.step.h;
1734 ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y)
1736 Evas_Object *obj = NULL;
1738 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1740 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1741 "ecore_evas_cursor_set");
1749 obj = evas_object_image_add(ee->evas);
1750 evas_object_image_file_set(obj, file, NULL);
1751 evas_object_image_size_get(obj, &x, &y);
1752 evas_object_resize(obj, x, y);
1753 evas_object_image_fill_set(obj, 0, 0, x, y);
1756 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
1761 ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
1763 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1765 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1766 "ecore_evas_cursor_set");
1769 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
1774 ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y)
1776 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1778 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1779 "ecore_evas_cursor_get");
1782 if (obj) *obj = ee->prop.cursor.object;
1783 if (layer) *layer = ee->prop.cursor.layer;
1784 if (hot_x) *hot_x = ee->prop.cursor.hot.x;
1785 if (hot_y) *hot_y = ee->prop.cursor.hot.y;
1789 ecore_evas_layer_set(Ecore_Evas *ee, int layer)
1791 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1793 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1794 "ecore_evas_layer_set");
1797 IFC(ee, fn_layer_set) (ee, layer);
1802 ecore_evas_layer_get(const Ecore_Evas *ee)
1804 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1806 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1807 "ecore_evas_layer_get");
1810 return ee->prop.layer;
1814 ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on)
1816 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1818 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1819 "ecore_evas_focus_set");
1822 IFC(ee, fn_focus_set) (ee, on);
1827 ecore_evas_focus_get(const Ecore_Evas *ee)
1829 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1831 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1832 "ecore_evas_focus_get");
1835 return ee->prop.focused ? EINA_TRUE : EINA_FALSE;
1839 ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
1841 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1843 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1844 "ecore_evas_iconified_set");
1847 IFC(ee, fn_iconified_set) (ee, on);
1852 ecore_evas_iconified_get(const Ecore_Evas *ee)
1854 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1856 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1857 "ecore_evas_iconified_get");
1860 return ee->prop.iconified ? EINA_TRUE : EINA_FALSE;
1864 ecore_evas_borderless_set(Ecore_Evas *ee, Eina_Bool on)
1866 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1868 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1869 "ecore_evas_borderless_set");
1872 IFC(ee, fn_borderless_set) (ee, on);
1877 ecore_evas_borderless_get(const Ecore_Evas *ee)
1879 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1881 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1882 "ecore_evas_borderless_get");
1885 return ee->prop.borderless ? EINA_TRUE : EINA_FALSE;
1889 ecore_evas_override_set(Ecore_Evas *ee, Eina_Bool on)
1891 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1893 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1894 "ecore_evas_override_set");
1897 IFC(ee, fn_override_set) (ee, on);
1902 ecore_evas_override_get(const Ecore_Evas *ee)
1904 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1906 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1907 "ecore_evas_override_get");
1910 return ee->prop.override ? EINA_TRUE : EINA_FALSE;
1914 ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on)
1916 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1918 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1919 "ecore_evas_maximized_set");
1922 IFC(ee, fn_maximized_set) (ee, on);
1927 ecore_evas_maximized_get(const Ecore_Evas *ee)
1929 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1931 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1932 "ecore_evas_maximized_get");
1935 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
1939 ecore_evas_profiles_set(Ecore_Evas *ee, const char **profiles, unsigned int num_profiles)
1941 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1943 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1944 "ecore_evas_profiles_set");
1947 IFC(ee, fn_profiles_set) (ee, profiles, num_profiles);
1952 ecore_evas_profile_get(const Ecore_Evas *ee)
1954 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1956 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1957 "ecore_evas_profile_get");
1960 return ee->prop.profile;
1964 ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
1966 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1968 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1969 "ecore_evas_fullscreen_set");
1972 IFC(ee, fn_fullscreen_set) (ee, on);
1977 ecore_evas_fullscreen_get(const Ecore_Evas *ee)
1979 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1981 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1982 "ecore_evas_fullscreen_get");
1985 return ee->prop.fullscreen ? EINA_TRUE : EINA_FALSE;
1989 ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
1991 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1993 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1994 "ecore_evas_avoid_damage_set");
1997 IFC(ee, fn_avoid_damage_set) (ee, on);
2001 EAPI Ecore_Evas_Avoid_Damage_Type
2002 ecore_evas_avoid_damage_get(const Ecore_Evas *ee)
2004 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2006 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2007 "ecore_evas_avoid_damage_get");
2008 return ECORE_EVAS_AVOID_DAMAGE_NONE;
2010 return ee->prop.avoid_damage;
2014 ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn)
2016 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2018 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2019 "ecore_evas_withdrawn_set");
2023 IFC(ee, fn_withdrawn_set) (ee, withdrawn);
2028 ecore_evas_withdrawn_get(const Ecore_Evas *ee)
2030 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2032 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2033 "ecore_evas_withdrawn_get");
2036 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE;
2040 ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky)
2042 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2044 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2045 "ecore_evas_sticky_set");
2049 IFC(ee, fn_sticky_set) (ee, sticky);
2054 ecore_evas_sticky_get(const Ecore_Evas *ee)
2056 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2058 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2059 "ecore_evas_sticky_get");
2062 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
2066 ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group)
2068 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2070 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2075 IFC(ee, fn_window_group_set) (ee, ee_group);
2079 EAPI const Ecore_Evas *
2080 ecore_evas_window_group_get(const Ecore_Evas *ee)
2082 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2084 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2088 return ee->prop.group_ee;
2092 ecore_evas_aspect_set(Ecore_Evas *ee, double aspect)
2094 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2096 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2101 IFC(ee, fn_aspect_set) (ee, aspect);
2106 ecore_evas_aspect_get(const Ecore_Evas *ee)
2108 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2110 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2114 return ee->prop.aspect;
2118 ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent)
2120 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2122 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2127 IFC(ee, fn_urgent_set) (ee, urgent);
2132 ecore_evas_urgent_get(const Ecore_Evas *ee)
2134 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2136 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2140 return ee->prop.urgent ? EINA_TRUE : EINA_FALSE;
2144 ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal)
2146 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2148 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2153 IFC(ee, fn_modal_set) (ee, modal);
2158 ecore_evas_modal_get(const Ecore_Evas *ee)
2160 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2162 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2166 return ee->prop.modal ? EINA_TRUE : EINA_FALSE;
2170 ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand)
2172 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2174 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2179 IFC(ee, fn_demands_attention_set) (ee, demand);
2184 ecore_evas_demand_attention_get(const Ecore_Evas *ee)
2186 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2188 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2192 return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE;
2196 ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip)
2198 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2200 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2205 IFC(ee, fn_focus_skip_set) (ee, skip);
2210 ecore_evas_focus_skip_get(const Ecore_Evas *ee)
2212 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2214 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2218 return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE;
2222 ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
2224 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2226 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2227 "ecore_evas_ignore_events_set");
2231 IFC(ee, fn_ignore_events_set) (ee, ignore);
2236 ecore_evas_ignore_events_get(const Ecore_Evas *ee)
2238 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2240 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2241 "ecore_evas_ignore_events_get");
2244 return ee->ignore_events ? EINA_TRUE : EINA_FALSE;
2248 ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render)
2250 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2252 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2253 "ecore_evas_manual_render_set");
2256 ee->manual_render = manual_render;
2260 ecore_evas_manual_render_get(const Ecore_Evas *ee)
2262 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2264 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2265 "ecore_evas_manual_render_get");
2268 return ee->manual_render ? EINA_TRUE : EINA_FALSE;
2272 ecore_evas_manual_render(Ecore_Evas *ee)
2274 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2276 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2277 "ecore_evas_manual_render");
2280 if (ee->engine.func->fn_render)
2281 ee->engine.func->fn_render(ee);
2285 ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync)
2287 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2289 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2290 "ecore_evas_comp_sync_set");
2293 ee->no_comp_sync = !do_sync;
2297 ecore_evas_comp_sync_get(const Ecore_Evas *ee)
2299 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2301 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2302 "ecore_evas_comp_sync_get");
2305 return !ee->no_comp_sync;
2309 ecore_evas_window_get(const Ecore_Evas *ee)
2311 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2313 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2314 "ecore_evas_window_get");
2318 return ee->prop.window;
2322 ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
2328 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2330 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2331 "ecore_evas_screen_geometry_get");
2335 IFC(ee, fn_screen_geometry_get) (ee, x, y, w, h);
2340 ecore_evas_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
2342 if (xdpi) *xdpi = 0;
2343 if (ydpi) *ydpi = 0;
2344 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2346 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2347 "ecore_evas_screen_geometry_get");
2351 IFC(ee, fn_screen_dpi_get) (ee, xdpi, ydpi);
2356 ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame)
2358 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2360 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_set");
2363 ee->prop.draw_frame = draw_frame;
2367 ecore_evas_draw_frame_get(const Ecore_Evas *ee)
2369 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2371 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_get");
2374 return ee->prop.draw_frame;
2377 /* fps debug calls - for debugging how much time your app actually spends */
2378 /* rendering graphics... :) */
2380 static int _ecore_evas_fps_debug_init_count = 0;
2381 static int _ecore_evas_fps_debug_fd = -1;
2382 unsigned int *_ecore_evas_fps_rendertime_mmap = NULL;
2385 _ecore_evas_fps_debug_init(void)
2390 _ecore_evas_fps_debug_init_count++;
2391 if (_ecore_evas_fps_debug_init_count > 1) return;
2396 tmp = evil_tmpdir_get ();
2397 #endif /* HAVE_EVIL */
2398 snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i", tmp, (int)getpid());
2399 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2400 if (_ecore_evas_fps_debug_fd < 0)
2403 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2405 if (_ecore_evas_fps_debug_fd >= 0)
2407 unsigned int zero = 0;
2408 char *buf2 = (char *)&zero;
2409 ssize_t todo = sizeof(unsigned int);
2413 ssize_t r = write(_ecore_evas_fps_debug_fd, buf2, todo);
2419 else if ((r < 0) && (errno == EINTR))
2423 ERR("could not write to file '%s' fd %d: %s",
2424 buf, _ecore_evas_fps_debug_fd, strerror(errno));
2425 close(_ecore_evas_fps_debug_fd);
2426 _ecore_evas_fps_debug_fd = -1;
2430 _ecore_evas_fps_rendertime_mmap = mmap(NULL, sizeof(unsigned int),
2431 PROT_READ | PROT_WRITE,
2433 _ecore_evas_fps_debug_fd, 0);
2434 if (_ecore_evas_fps_rendertime_mmap == MAP_FAILED)
2435 _ecore_evas_fps_rendertime_mmap = NULL;
2440 _ecore_evas_fps_debug_shutdown(void)
2442 _ecore_evas_fps_debug_init_count--;
2443 if (_ecore_evas_fps_debug_init_count > 0) return;
2444 if (_ecore_evas_fps_debug_fd >= 0)
2448 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2450 if (_ecore_evas_fps_rendertime_mmap)
2452 munmap(_ecore_evas_fps_rendertime_mmap, sizeof(int));
2453 _ecore_evas_fps_rendertime_mmap = NULL;
2455 close(_ecore_evas_fps_debug_fd);
2456 _ecore_evas_fps_debug_fd = -1;
2461 _ecore_evas_fps_debug_rendertime_add(double t)
2463 static double rtime = 0.0;
2464 static double rlapse = 0.0;
2465 static int frames = 0;
2466 static int flapse = 0;
2469 tim = ecore_time_get();
2477 else if ((tim - rlapse) >= 0.5)
2479 printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
2481 (frames - flapse) / (tim - rlapse),
2482 (100.0 * rtime) / (tim - rlapse)
2491 _ecore_evas_register(Ecore_Evas *ee)
2494 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
2495 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2499 _ecore_evas_ref(Ecore_Evas *ee)
2505 _ecore_evas_unref(Ecore_Evas *ee)
2508 if (ee->refcount == 0)
2510 if (ee->deleted) _ecore_evas_free(ee);
2512 else if (ee->refcount < -1)
2513 ERR("Ecore_Evas %p->refcount=%d < 0", ee, ee->refcount);
2517 _ecore_evas_free(Ecore_Evas *ee)
2519 ee->deleted = EINA_TRUE;
2520 if (ee->refcount > 0) return;
2522 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
2523 while (ee->sub_ecore_evas)
2525 _ecore_evas_free(ee->sub_ecore_evas->data);
2527 if (ee->data) eina_hash_free(ee->data);
2529 if (ee->name) free(ee->name);
2531 if (ee->prop.title) free(ee->prop.title);
2532 ee->prop.title = NULL;
2533 if (ee->prop.name) free(ee->prop.name);
2534 ee->prop.name = NULL;
2535 if (ee->prop.clas) free(ee->prop.clas);
2536 ee->prop.clas = NULL;
2537 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2538 ee->prop.cursor.object = NULL;
2539 if (ee->evas) evas_free(ee->evas);
2541 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
2543 if (ee->engine.idle_flush_timer)
2544 ecore_timer_del(ee->engine.idle_flush_timer);
2545 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
2548 ecore_evases = (Ecore_Evas *)eina_inlist_remove
2549 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2555 _ecore_evas_cb_idle_flush(void *data)
2559 ee = (Ecore_Evas *)data;
2560 evas_render_idle_flush(ee->evas);
2561 ee->engine.idle_flush_timer = NULL;
2562 return ECORE_CALLBACK_CANCEL;
2566 _ecore_evas_async_events_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
2568 evas_async_events_process();
2570 return ECORE_CALLBACK_RENEW;
2574 _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2576 if (ee->engine.idle_flush_timer)
2577 ecore_timer_del(ee->engine.idle_flush_timer);
2578 ee->engine.idle_flush_timer = ecore_timer_add(IDLE_FLUSH_TIME,
2579 _ecore_evas_cb_idle_flush,
2584 _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2588 if (ee->prop.cursor.object)
2590 evas_object_show(ee->prop.cursor.object);
2591 if (ee->rotation == 0)
2592 evas_object_move(ee->prop.cursor.object,
2593 x - ee->prop.cursor.hot.x,
2594 y - ee->prop.cursor.hot.y);
2595 else if (ee->rotation == 90)
2596 evas_object_move(ee->prop.cursor.object,
2597 ee->h - y - 1 - ee->prop.cursor.hot.x,
2598 x - ee->prop.cursor.hot.y);
2599 else if (ee->rotation == 180)
2600 evas_object_move(ee->prop.cursor.object,
2601 ee->w - x - 1 - ee->prop.cursor.hot.x,
2602 ee->h - y - 1 - ee->prop.cursor.hot.y);
2603 else if (ee->rotation == 270)
2604 evas_object_move(ee->prop.cursor.object,
2605 y - ee->prop.cursor.hot.x,
2606 ee->w - x - 1 - ee->prop.cursor.hot.y);
2608 if (ee->rotation == 0)
2609 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2610 else if (ee->rotation == 90)
2611 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
2612 else if (ee->rotation == 180)
2613 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
2614 else if (ee->rotation == 270)
2615 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
2619 _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
2622 double radius_x, double radius_y,
2625 double mx, double my,
2626 unsigned int timestamp)
2628 if (ee->rotation == 0)
2629 evas_event_feed_multi_move(ee->evas, device,
2634 angle - ee->rotation,
2637 else if (ee->rotation == 90)
2638 evas_event_feed_multi_move(ee->evas, device,
2643 angle - ee->rotation,
2646 else if (ee->rotation == 180)
2647 evas_event_feed_multi_move(ee->evas, device,
2648 ee->w - x - 1, ee->h - y - 1,
2652 angle - ee->rotation,
2653 ee->w - mx - 1, ee->h - my - 1,
2655 else if (ee->rotation == 270)
2656 evas_event_feed_multi_move(ee->evas, device,
2661 angle - ee->rotation,
2667 _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
2670 double radius_x, double radius_y,
2673 double mx, double my,
2674 Evas_Button_Flags flags,
2675 unsigned int timestamp)
2677 if (ee->rotation == 0)
2678 evas_event_feed_multi_down(ee->evas, device,
2683 angle - ee->rotation,
2685 flags, timestamp, NULL);
2686 else if (ee->rotation == 90)
2687 evas_event_feed_multi_down(ee->evas, device,
2692 angle - ee->rotation,
2694 flags, timestamp, NULL);
2695 else if (ee->rotation == 180)
2696 evas_event_feed_multi_down(ee->evas, device,
2697 ee->w - x - 1, ee->h - y - 1,
2701 angle - ee->rotation,
2702 ee->w - mx - 1, ee->h - my - 1,
2703 flags, timestamp, NULL);
2704 else if (ee->rotation == 270)
2705 evas_event_feed_multi_down(ee->evas, device,
2710 angle - ee->rotation,
2712 flags, timestamp, NULL);
2716 _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
2719 double radius_x, double radius_y,
2722 double mx, double my,
2723 Evas_Button_Flags flags,
2724 unsigned int timestamp)
2726 if (ee->rotation == 0)
2727 evas_event_feed_multi_up(ee->evas, device,
2732 angle - ee->rotation,
2734 flags, timestamp, NULL);
2735 else if (ee->rotation == 90)
2736 evas_event_feed_multi_up(ee->evas, device,
2741 angle - ee->rotation,
2743 flags, timestamp, NULL);
2744 else if (ee->rotation == 180)
2745 evas_event_feed_multi_up(ee->evas, device,
2746 ee->w - x - 1, ee->h - y - 1,
2750 angle - ee->rotation,
2751 ee->w - mx - 1, ee->h - my - 1,
2752 flags, timestamp, NULL);
2753 else if (ee->rotation == 270)
2754 evas_event_feed_multi_up(ee->evas, device,
2759 angle - ee->rotation,
2761 flags, timestamp, NULL);
2765 ecore_evas_ecore_evas_list_get(void)
2768 Eina_List *l = NULL;
2770 EINA_INLIST_FOREACH(ecore_evases, ee)
2772 l = eina_list_append(l, ee);
2779 ecore_evas_input_event_register(Ecore_Evas *ee)
2781 ecore_event_window_register((Ecore_Window)ee, ee, ee->evas,
2782 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
2783 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
2784 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
2785 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
2789 ecore_evas_input_event_unregister(Ecore_Evas *ee)
2791 ecore_event_window_unregister((Ecore_Window)ee);
2794 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined (BUILD_ECORE_EVAS_WAYLAND_EGL)
2796 ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
2799 if (!strcmp(ee->driver, "wayland_shm"))
2801 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2802 _ecore_evas_wayland_shm_resize(ee, location);
2805 else if (!strcmp(ee->driver, "wayland_egl"))
2807 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2808 _ecore_evas_wayland_egl_resize(ee, location);
2814 ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
2817 if (!strcmp(ee->driver, "wayland_shm"))
2819 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2820 _ecore_evas_wayland_shm_move(ee, x, y);
2823 else if (!strcmp(ee->driver, "wayland_egl"))
2825 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2826 _ecore_evas_wayland_egl_move(ee, x, y);
2832 ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
2835 ecore_wl_window_type_set(ee->engine.wl.win, type);
2838 EAPI Ecore_Wl_Window *
2839 ecore_evas_wayland_window_get(const Ecore_Evas *ee)
2841 if (!(!strncmp(ee->driver, "wayland", 7)))
2844 return ee->engine.wl.win;
2848 ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
2850 Ecore_Wl_Window *win;
2852 win = ecore_evas_wayland_window_get(ee);
2853 /* ecore_wl_window_pointer_set(win, ee->engine.wl.buffer, hot_x, hot_y); */
2858 ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
2864 ecore_evas_wayland_move(Ecore_Evas *ee __UNUSED__, int x __UNUSED__, int y __UNUSED__)
2870 ecore_evas_wayland_type_set(Ecore_Evas *ee __UNUSED__, int type __UNUSED__)
2875 EAPI Ecore_Wl_Window *
2876 ecore_evas_wayland_window_get(const Ecore_Evas *ee __UNUSED__)
2882 ecore_evas_wayland_pointer_set(Ecore_Evas *ee __UNUSED__, int hot_x __UNUSED__, int hot_y __UNUSED__)