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 = 0;
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_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 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
516 _ecore_evas_constructor_opengl_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
519 unsigned int fullscreen = 0, noframe = 0;
522 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
523 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
524 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
526 ee = ecore_evas_gl_sdl_new(name, w, h, fullscreen, noframe);
533 #ifdef BUILD_ECORE_EVAS_DIRECTFB
535 _ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
538 char *disp_name = NULL;
539 unsigned int windowed = 1;
541 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
542 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
544 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
551 #ifdef BUILD_ECORE_EVAS_FB
553 _ecore_evas_constructor_fb(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
556 char *disp_name = NULL;
557 unsigned int rotation = 0;
559 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
560 _ecore_evas_parse_extra_options_uint(extra_options, "rotation=", &rotation);
562 ee = ecore_evas_fb_new(disp_name, rotation, w, h);
570 #ifdef BUILD_ECORE_EVAS_PSL1GHT
572 _ecore_evas_constructor_psl1ght(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
577 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
578 ee = ecore_evas_psl1ght_new(name, w, h);
581 if (ee) ecore_evas_move(ee, x, y);
586 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
588 _ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
590 char *disp_name = NULL;
591 unsigned int frame = 0, parent = 0;
594 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
595 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
596 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
597 ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame);
604 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
606 _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
608 char *disp_name = NULL;
609 unsigned int frame = 0, 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_egl_new(disp_name, parent, x, y, w, h, frame);
622 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
624 _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
626 return ecore_evas_software_gdi_new(NULL, x, y, w, h);
630 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
632 _ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
634 return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
638 #ifdef BUILD_ECORE_EVAS_DIRECT3D
640 _ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
642 return ecore_evas_direct3d_new(NULL, x, y, w, h);
646 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
648 _ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
650 return ecore_evas_gl_glew_new(NULL, x, y, w, h);
654 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
656 _ecore_evas_constructor_software_16_ddraw(int x, int y, int w, int h, const char *extra_options)
658 return ecore_evas_software_16_ddraw_new(NULL, x, y, w, h);
662 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
664 _ecore_evas_constructor_software_16_wince(int x, int y, int w, int h, const char *extra_options __UNUSED__)
666 return ecore_evas_software_wince_new(NULL, x, y, w, h);
670 _ecore_evas_constructor_software_16_wince_fb(int x, int y, int w, int h, const char *extra_options __UNUSED__)
672 return ecore_evas_software_wince_fb_new(NULL, x, y, w, h);
676 _ecore_evas_constructor_software_16_wince_gapi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
678 return ecore_evas_software_wince_gapi_new(NULL, x, y, w, h);
682 _ecore_evas_constructor_software_16_wince_gdi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
684 return ecore_evas_software_wince_gdi_new(NULL, x, y, w, h);
688 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
690 _ecore_evas_constructor_buffer(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options __UNUSED__)
692 return ecore_evas_buffer_new(w, h);
696 #ifdef BUILD_ECORE_EVAS_EWS
698 _ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_options __UNUSED__)
700 return ecore_evas_ews_new(x, y, w, h);
704 /* note: keep sorted by priority, highest first */
705 static const struct ecore_evas_engine _engines[] = {
707 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
708 {"software_x11", _ecore_evas_constructor_software_x11},
710 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
711 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
713 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
714 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
716 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
717 {"software_16_x11", _ecore_evas_constructor_software_16_x11},
719 #ifdef BUILD_ECORE_EVAS_DIRECTFB
720 {"directfb", _ecore_evas_constructor_directfb},
722 #ifdef BUILD_ECORE_EVAS_FB
723 {"fb", _ecore_evas_constructor_fb},
727 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
728 {"software_gdi", _ecore_evas_constructor_software_gdi},
730 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
731 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
733 #ifdef BUILD_ECORE_EVAS_DIRECT3D
734 {"direct3d", _ecore_evas_constructor_direct3d},
736 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
737 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
739 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
740 {"software_16_ddraw", _ecore_evas_constructor_software_16_ddraw},
742 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
743 {"software_16_wince", _ecore_evas_constructor_software_16_wince},
744 {"software_16_wince_fb", _ecore_evas_constructor_software_16_wince_fb},
745 {"software_16_wince_gapi", _ecore_evas_constructor_software_16_wince_gapi},
746 {"software_16_wince_gdi", _ecore_evas_constructor_software_16_wince_gdi},
750 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
751 {"opengl_cocoa", _ecore_evas_constructor_cocoa},
755 #ifdef BUILD_ECORE_EVAS_PSL1GHT
756 {"psl1ght", _ecore_evas_constructor_psl1ght},
760 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
761 {"wayland_shm", _ecore_evas_constructor_wayland_shm},
764 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
765 {"wayland_egl", _ecore_evas_constructor_wayland_egl},
768 /* Last chance to have a window */
769 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
770 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
773 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
774 {"sdl", _ecore_evas_constructor_sdl},
778 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
779 {"buffer", _ecore_evas_constructor_buffer},
782 #ifdef BUILD_ECORE_EVAS_EWS
783 {"ews", _ecore_evas_constructor_ews},
789 ecore_evas_engines_get(void)
791 const struct ecore_evas_engine *itr;
792 Eina_List *lst = NULL;
794 for (itr = _engines; itr->name; itr++)
795 lst = eina_list_append(lst, itr->name);
801 ecore_evas_engines_free(Eina_List *engines)
803 eina_list_free(engines);
807 _ecore_evas_new_auto_discover(int x, int y, int w, int h, const char *extra_options)
809 const struct ecore_evas_engine *itr;
811 DBG("auto discover engine");
813 for (itr = _engines; itr->constructor; itr++)
815 Ecore_Evas *ee = itr->constructor(x, y, w, h, extra_options);
818 INF("auto discovered '%s'", itr->name);
823 WRN("could not auto discover.");
828 ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
830 const struct ecore_evas_engine *itr;
834 engine_name = getenv("ECORE_EVAS_ENGINE");
836 DBG("no engine_name provided, using ECORE_EVAS_ENGINE='%s'",
840 return _ecore_evas_new_auto_discover(x, y, w, h, extra_options);
842 for (itr = _engines; itr->name; itr++)
843 if (strcmp(itr->name, engine_name) == 0)
845 INF("using engine '%s', extra_options=%s",
846 engine_name, extra_options ? extra_options : "(null)");
847 return itr->constructor(x, y, w, h, extra_options);
850 WRN("unknown engine '%s'", engine_name);
855 ecore_evas_engine_name_get(const Ecore_Evas *ee)
863 ecore_evas_ecore_evas_get(const Evas *e)
865 Ecore_Evas *ee = evas_data_attach_get(e);
866 if (!ee) return NULL;
867 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
869 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_ecore_evas_get");
876 ecore_evas_free(Ecore_Evas *ee)
878 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
880 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
884 _ecore_evas_free(ee);
889 ecore_evas_data_get(const Ecore_Evas *ee, const char *key)
891 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
893 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
894 "ecore_evas_data_get");
898 if (!key) return NULL;
899 if (!ee->data) return NULL;
901 return eina_hash_find(ee->data, key);
905 ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
907 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
909 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
910 "ecore_evas_data_set");
917 eina_hash_del(ee->data, key, NULL);
921 ee->data = eina_hash_string_superfast_new(NULL);
922 eina_hash_add(ee->data, key, data);
926 #define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
930 ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
932 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
934 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
935 "ecore_evas_callback_resize_set");
938 IFC(ee, fn_callback_resize_set) (ee, func);
940 ee->func.fn_resize = func;
944 ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
946 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
948 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
949 "ecore_evas_callback_move_set");
952 IFC(ee, fn_callback_move_set) (ee, func);
954 ee->func.fn_move = func;
958 ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
960 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
962 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
963 "ecore_evas_callback_show_set");
966 IFC(ee, fn_callback_show_set) (ee, func);
968 ee->func.fn_show = func;
972 ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
974 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
976 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
977 "ecore_evas_callback_hide_set");
980 IFC(ee, fn_callback_hide_set) (ee, func);
982 ee->func.fn_hide = func;
986 ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
988 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
990 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
991 "ecore_evas_callback_delete_request_set");
994 IFC(ee, fn_callback_delete_request_set) (ee, func);
996 ee->func.fn_delete_request = func;
1000 ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1002 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1004 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1005 "ecore_evas_callback_destroy_set");
1008 IFC(ee, fn_callback_destroy_set) (ee, func);
1010 ee->func.fn_destroy = func;
1014 ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1016 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1018 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1019 "ecore_evas_callback_focus_in_set");
1022 IFC(ee, fn_callback_focus_in_set) (ee, func);
1024 ee->func.fn_focus_in = func;
1028 ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1030 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1032 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1033 "ecore_evas_callback_focus_out_set");
1036 IFC(ee, fn_callback_focus_out_set) (ee, func);
1038 ee->func.fn_focus_out = func;
1042 ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1044 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1046 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1047 "ecore_evas_callback_sticky_set");
1050 IFC(ee, fn_callback_sticky_set) (ee, func);
1052 ee->func.fn_sticky = func;
1056 ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1058 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1060 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1061 "ecore_evas_callback_unsticky_set");
1064 IFC(ee, fn_callback_unsticky_set) (ee, func);
1066 ee->func.fn_unsticky = func;
1070 ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1072 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1074 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1075 "ecore_evas_callback_mouse_in_set");
1078 IFC(ee, fn_callback_mouse_in_set) (ee, func);
1080 ee->func.fn_mouse_in = func;
1084 ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1086 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1088 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1089 "ecore_evas_callback_mouse_out_set");
1092 IFC(ee, fn_callback_mouse_out_set) (ee, func);
1094 ee->func.fn_mouse_out = func;
1098 ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1100 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1102 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1103 "ecore_evas_callback_pre_render_set");
1106 IFC(ee, fn_callback_pre_render_set) (ee, func);
1108 ee->func.fn_pre_render = func;
1112 ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1114 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1116 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1117 "ecore_evas_callback_post_render_set");
1120 IFC(ee, fn_callback_post_render_set) (ee, func);
1122 ee->func.fn_post_render = func;
1126 ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1128 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1130 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1131 "ecore_evas_callback_pre_free_set");
1134 ee->func.fn_pre_free = func;
1138 ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1140 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1142 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1143 "ecore_evas_callback_state_change_set");
1146 ee->func.fn_state_change = func;
1150 ecore_evas_get(const Ecore_Evas *ee)
1152 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1154 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1162 ecore_evas_move(Ecore_Evas *ee, int x, int y)
1164 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1166 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1170 if (ee->prop.fullscreen) return;
1171 IFC(ee, fn_move) (ee, x, y);
1176 ecore_evas_managed_move(Ecore_Evas *ee, int x, int y)
1178 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1180 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1184 IFC(ee, fn_managed_move) (ee, x, y);
1189 ecore_evas_resize(Ecore_Evas *ee, int w, int h)
1191 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1193 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1194 "ecore_evas_resize");
1197 if (ee->prop.fullscreen) return;
1200 if ((ee->rotation == 90) || (ee->rotation == 270))
1202 IFC(ee, fn_resize) (ee, h, w);
1207 IFC(ee, fn_resize) (ee, w, h);
1213 ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
1215 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1217 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1218 "ecore_evas_move_resize");
1221 if (ee->prop.fullscreen) return;
1224 if ((ee->rotation == 90) || (ee->rotation == 270))
1226 IFC(ee, fn_move_resize) (ee, x, y, h, w);
1231 IFC(ee, fn_move_resize) (ee, x, y, w, h);
1237 ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1239 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1241 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1242 "ecore_evas_geometry_get");
1245 if ((ee->rotation == 90) || (ee->rotation == 270))
1262 ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1264 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1266 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1267 "ecore_evas_request_geometry_get");
1270 if ((ee->rotation == 90) || (ee->rotation == 270))
1272 if (x) *x = ee->req.x;
1273 if (y) *y = ee->req.y;
1274 if (w) *w = ee->req.h;
1275 if (h) *h = ee->req.w;
1279 if (x) *x = ee->req.x;
1280 if (y) *y = ee->req.y;
1281 if (w) *w = ee->req.w;
1282 if (h) *h = ee->req.h;
1287 ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
1289 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1291 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1292 "ecore_evas_rotation_set");
1296 while (rot < 0) rot += 360;
1297 while (rot >= 360) rot -= 360;
1298 IFC(ee, fn_rotation_set) (ee, rot, 0);
1299 /* make sure everything gets redrawn */
1300 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1301 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1306 ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
1308 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1310 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1311 "ecore_evas_rotation_set");
1315 while (rot < 0) rot += 360;
1316 while (rot >= 360) rot -= 360;
1317 IFC(ee, fn_rotation_set) (ee, rot, 1);
1318 /* make sure everything gets redrawn */
1319 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1320 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1325 ecore_evas_rotation_get(const Ecore_Evas *ee)
1327 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1329 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1330 "ecore_evas_rotation_get");
1333 return ee->rotation;
1337 ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped)
1339 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1341 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1342 "ecore_evas_shaped_set");
1345 IFC(ee, fn_shaped_set) (ee, shaped);
1350 ecore_evas_shaped_get(const Ecore_Evas *ee)
1352 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1354 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1355 "ecore_evas_shaped_get");
1358 return ee->shaped ? EINA_TRUE : EINA_FALSE;
1362 ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha)
1364 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1366 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1367 "ecore_evas_alpha_set");
1370 IFC(ee, fn_alpha_set) (ee, alpha);
1375 ecore_evas_alpha_get(const Ecore_Evas *ee)
1377 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1379 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1380 "ecore_evas_alpha_get");
1383 return ee->alpha ? EINA_TRUE : EINA_FALSE;
1387 ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent)
1389 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1391 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1392 "ecore_evas_transparent_set");
1395 IFC(ee, fn_transparent_set) (ee, transparent);
1400 ecore_evas_transparent_get(const Ecore_Evas *ee)
1402 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1404 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1405 "ecore_evas_transparent_get");
1408 return ee->transparent ? EINA_TRUE : 0;
1412 ecore_evas_show(Ecore_Evas *ee)
1414 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1416 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1420 IFC(ee, fn_show) (ee);
1425 ecore_evas_hide(Ecore_Evas *ee)
1427 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1429 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1433 IFC(ee, fn_hide) (ee);
1438 ecore_evas_visibility_get(const Ecore_Evas *ee)
1440 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1442 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1443 "ecore_evas_visibility_get");
1446 return ee->visible ? 1:0;
1450 ecore_evas_raise(Ecore_Evas *ee)
1452 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1454 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1455 "ecore_evas_raise");
1458 IFC(ee, fn_raise) (ee);
1463 ecore_evas_lower(Ecore_Evas *ee)
1465 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1467 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1468 "ecore_evas_lower");
1471 IFC(ee, fn_lower) (ee);
1476 ecore_evas_activate(Ecore_Evas *ee)
1478 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1480 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1481 "ecore_evas_activate");
1484 IFC(ee, fn_activate) (ee);
1489 ecore_evas_title_set(Ecore_Evas *ee, const char *t)
1491 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1493 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1494 "ecore_evas_title_set");
1497 IFC(ee, fn_title_set) (ee, t);
1502 ecore_evas_title_get(const Ecore_Evas *ee)
1504 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1506 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1507 "ecore_evas_title_get");
1510 return ee->prop.title;
1514 ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
1516 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1518 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1519 "ecore_evas_name_class_set");
1522 IFC(ee, fn_name_class_set) (ee, n, c);
1527 ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c)
1529 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1531 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1532 "ecore_evas_name_class_get");
1535 if (n) *n = ee->prop.name;
1536 if (c) *c = ee->prop.clas;
1540 ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
1542 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1544 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1545 "ecore_evas_size_min_set");
1550 if ((ee->rotation == 90) || (ee->rotation == 270))
1552 IFC(ee, fn_size_min_set) (ee, h, w);
1557 IFC(ee, fn_size_min_set) (ee, w, h);
1563 ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h)
1565 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1567 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1568 "ecore_evas_size_min_get");
1571 if ((ee->rotation == 90) || (ee->rotation == 270))
1573 if (w) *w = ee->prop.min.h;
1574 if (h) *h = ee->prop.min.w;
1578 if (w) *w = ee->prop.min.w;
1579 if (h) *h = ee->prop.min.h;
1584 ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h)
1586 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1588 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1589 "ecore_evas_size_max_set");
1594 if ((ee->rotation == 90) || (ee->rotation == 270))
1596 IFC(ee, fn_size_max_set) (ee, h, w);
1601 IFC(ee, fn_size_max_set) (ee, w, h);
1607 ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h)
1609 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1611 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1612 "ecore_evas_size_max_get");
1615 if ((ee->rotation == 90) || (ee->rotation == 270))
1617 if (w) *w = ee->prop.max.h;
1618 if (h) *h = ee->prop.max.w;
1622 if (w) *w = ee->prop.max.w;
1623 if (h) *h = ee->prop.max.h;
1628 ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h)
1630 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1632 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1633 "ecore_evas_size_base_set");
1638 if ((ee->rotation == 90) || (ee->rotation == 270))
1640 IFC(ee, fn_size_base_set) (ee, h, w);
1645 IFC(ee, fn_size_base_set) (ee, w, h);
1651 ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h)
1653 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1655 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1656 "ecore_evas_size_base_get");
1659 if ((ee->rotation == 90) || (ee->rotation == 270))
1661 if (w) *w = ee->prop.base.h;
1662 if (h) *h = ee->prop.base.w;
1666 if (w) *w = ee->prop.base.w;
1667 if (h) *h = ee->prop.base.h;
1672 ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
1674 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1676 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1677 "ecore_evas_size_step_set");
1682 if ((ee->rotation == 90) || (ee->rotation == 270))
1684 IFC(ee, fn_size_step_set) (ee, h, w);
1689 IFC(ee, fn_size_step_set) (ee, w, h);
1695 ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h)
1697 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1699 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1700 "ecore_evas_size_step_get");
1703 if ((ee->rotation == 90) || (ee->rotation == 270))
1705 if (w) *w = ee->prop.step.h;
1706 if (h) *h = ee->prop.step.w;
1710 if (w) *w = ee->prop.step.w;
1711 if (h) *h = ee->prop.step.h;
1716 ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y)
1718 Evas_Object *obj = NULL;
1720 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1722 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1723 "ecore_evas_cursor_set");
1731 obj = evas_object_image_add(ee->evas);
1732 evas_object_image_file_set(obj, file, NULL);
1733 evas_object_image_size_get(obj, &x, &y);
1734 evas_object_resize(obj, x, y);
1735 evas_object_image_fill_set(obj, 0, 0, x, y);
1738 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
1743 ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
1745 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1747 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1748 "ecore_evas_cursor_set");
1751 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
1756 ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y)
1758 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1760 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1761 "ecore_evas_cursor_get");
1764 if (obj) *obj = ee->prop.cursor.object;
1765 if (layer) *layer = ee->prop.cursor.layer;
1766 if (hot_x) *hot_x = ee->prop.cursor.hot.x;
1767 if (hot_y) *hot_y = ee->prop.cursor.hot.y;
1771 ecore_evas_layer_set(Ecore_Evas *ee, int layer)
1773 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1775 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1776 "ecore_evas_layer_set");
1779 IFC(ee, fn_layer_set) (ee, layer);
1784 ecore_evas_layer_get(const Ecore_Evas *ee)
1786 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1788 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1789 "ecore_evas_layer_get");
1792 return ee->prop.layer;
1796 ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on)
1798 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1800 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1801 "ecore_evas_focus_set");
1804 IFC(ee, fn_focus_set) (ee, on);
1809 ecore_evas_focus_get(const Ecore_Evas *ee)
1811 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1813 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1814 "ecore_evas_focus_get");
1817 return ee->prop.focused ? EINA_TRUE : EINA_FALSE;
1821 ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
1823 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1825 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1826 "ecore_evas_iconified_set");
1829 IFC(ee, fn_iconified_set) (ee, on);
1834 ecore_evas_iconified_get(const Ecore_Evas *ee)
1836 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1838 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1839 "ecore_evas_iconified_get");
1842 return ee->prop.iconified ? EINA_TRUE : EINA_FALSE;
1846 ecore_evas_borderless_set(Ecore_Evas *ee, Eina_Bool on)
1848 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1850 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1851 "ecore_evas_borderless_set");
1854 IFC(ee, fn_borderless_set) (ee, on);
1859 ecore_evas_borderless_get(const Ecore_Evas *ee)
1861 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1863 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1864 "ecore_evas_borderless_get");
1867 return ee->prop.borderless ? EINA_TRUE : EINA_FALSE;
1871 ecore_evas_override_set(Ecore_Evas *ee, Eina_Bool on)
1873 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1875 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1876 "ecore_evas_override_set");
1879 IFC(ee, fn_override_set) (ee, on);
1884 ecore_evas_override_get(const Ecore_Evas *ee)
1886 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1888 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1889 "ecore_evas_override_get");
1892 return ee->prop.override ? EINA_TRUE : EINA_FALSE;
1896 ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on)
1898 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1900 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1901 "ecore_evas_maximized_set");
1904 IFC(ee, fn_maximized_set) (ee, on);
1909 ecore_evas_maximized_get(const Ecore_Evas *ee)
1911 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1913 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1914 "ecore_evas_maximized_get");
1917 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
1921 ecore_evas_profiles_set(Ecore_Evas *ee, const char **profiles, unsigned int num_profiles)
1923 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1925 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1926 "ecore_evas_profiles_set");
1929 IFC(ee, fn_profiles_set) (ee, profiles, num_profiles);
1934 ecore_evas_profile_get(const Ecore_Evas *ee)
1936 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1938 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1939 "ecore_evas_profile_get");
1942 return ee->prop.profile;
1946 ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
1948 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1950 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1951 "ecore_evas_fullscreen_set");
1954 IFC(ee, fn_fullscreen_set) (ee, on);
1959 ecore_evas_fullscreen_get(const Ecore_Evas *ee)
1961 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1963 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1964 "ecore_evas_fullscreen_get");
1967 return ee->prop.fullscreen ? EINA_TRUE : EINA_FALSE;
1971 ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
1973 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1975 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1976 "ecore_evas_avoid_damage_set");
1979 IFC(ee, fn_avoid_damage_set) (ee, on);
1983 EAPI Ecore_Evas_Avoid_Damage_Type
1984 ecore_evas_avoid_damage_get(const Ecore_Evas *ee)
1986 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1988 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1989 "ecore_evas_avoid_damage_get");
1990 return ECORE_EVAS_AVOID_DAMAGE_NONE;
1992 return ee->prop.avoid_damage;
1996 ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn)
1998 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2000 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2001 "ecore_evas_withdrawn_set");
2005 IFC(ee, fn_withdrawn_set) (ee, withdrawn);
2010 ecore_evas_withdrawn_get(const Ecore_Evas *ee)
2012 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2014 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2015 "ecore_evas_withdrawn_get");
2018 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE;
2022 ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky)
2024 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2026 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2027 "ecore_evas_sticky_set");
2031 IFC(ee, fn_sticky_set) (ee, sticky);
2036 ecore_evas_sticky_get(const Ecore_Evas *ee)
2038 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2040 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2041 "ecore_evas_sticky_get");
2044 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
2048 ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group)
2050 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2052 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2057 IFC(ee, fn_window_group_set) (ee, ee_group);
2061 EAPI const Ecore_Evas *
2062 ecore_evas_window_group_get(const Ecore_Evas *ee)
2064 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2066 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2070 return ee->prop.group_ee;
2074 ecore_evas_aspect_set(Ecore_Evas *ee, double aspect)
2076 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2078 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2083 IFC(ee, fn_aspect_set) (ee, aspect);
2088 ecore_evas_aspect_get(const Ecore_Evas *ee)
2090 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2092 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2096 return ee->prop.aspect;
2100 ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent)
2102 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2104 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2109 IFC(ee, fn_urgent_set) (ee, urgent);
2114 ecore_evas_urgent_get(const Ecore_Evas *ee)
2116 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2118 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2122 return ee->prop.urgent ? EINA_TRUE : EINA_FALSE;
2126 ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal)
2128 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2130 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2135 IFC(ee, fn_modal_set) (ee, modal);
2140 ecore_evas_modal_get(const Ecore_Evas *ee)
2142 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2144 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2148 return ee->prop.modal ? EINA_TRUE : EINA_FALSE;
2152 ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand)
2154 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2156 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2161 IFC(ee, fn_demands_attention_set) (ee, demand);
2166 ecore_evas_demand_attention_get(const Ecore_Evas *ee)
2168 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2170 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2174 return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE;
2178 ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip)
2180 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2182 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2187 IFC(ee, fn_focus_skip_set) (ee, skip);
2192 ecore_evas_focus_skip_get(const Ecore_Evas *ee)
2194 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2196 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2200 return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE;
2204 ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
2206 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2208 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2209 "ecore_evas_ignore_events_set");
2213 IFC(ee, fn_ignore_events_set) (ee, ignore);
2218 ecore_evas_ignore_events_get(const Ecore_Evas *ee)
2220 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2222 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2223 "ecore_evas_ignore_events_get");
2226 return ee->ignore_events ? EINA_TRUE : EINA_FALSE;
2230 ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render)
2232 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2234 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2235 "ecore_evas_manual_render_set");
2238 ee->manual_render = manual_render;
2242 ecore_evas_manual_render_get(const Ecore_Evas *ee)
2244 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2246 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2247 "ecore_evas_manual_render_get");
2250 return ee->manual_render ? EINA_TRUE : EINA_FALSE;
2254 ecore_evas_manual_render(Ecore_Evas *ee)
2256 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2258 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2259 "ecore_evas_manual_render");
2262 if (ee->engine.func->fn_render)
2263 ee->engine.func->fn_render(ee);
2267 ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync)
2269 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2271 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2272 "ecore_evas_comp_sync_set");
2275 ee->no_comp_sync = !do_sync;
2279 ecore_evas_comp_sync_get(const Ecore_Evas *ee)
2281 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2283 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2284 "ecore_evas_comp_sync_get");
2287 return !ee->no_comp_sync;
2291 ecore_evas_window_get(const Ecore_Evas *ee)
2293 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2295 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2296 "ecore_evas_window_get");
2300 return ee->prop.window;
2304 ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
2310 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2312 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2313 "ecore_evas_screen_geometry_get");
2317 IFC(ee, fn_screen_geometry_get) (ee, x, y, w, h);
2322 ecore_evas_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
2324 if (xdpi) *xdpi = 0;
2325 if (ydpi) *ydpi = 0;
2326 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2328 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2329 "ecore_evas_screen_geometry_get");
2333 IFC(ee, fn_screen_dpi_get) (ee, xdpi, ydpi);
2338 ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame)
2340 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2342 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_set");
2345 ee->prop.draw_frame = draw_frame;
2349 ecore_evas_draw_frame_get(const Ecore_Evas *ee)
2351 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2353 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_get");
2356 return ee->prop.draw_frame;
2359 /* fps debug calls - for debugging how much time your app actually spends */
2360 /* rendering graphics... :) */
2362 static int _ecore_evas_fps_debug_init_count = 0;
2363 static int _ecore_evas_fps_debug_fd = -1;
2364 unsigned int *_ecore_evas_fps_rendertime_mmap = NULL;
2367 _ecore_evas_fps_debug_init(void)
2372 _ecore_evas_fps_debug_init_count++;
2373 if (_ecore_evas_fps_debug_init_count > 1) return;
2378 tmp = evil_tmpdir_get ();
2379 #endif /* HAVE_EVIL */
2380 snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i", tmp, (int)getpid());
2381 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2382 if (_ecore_evas_fps_debug_fd < 0)
2385 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2387 if (_ecore_evas_fps_debug_fd >= 0)
2389 unsigned int zero = 0;
2390 char *buf2 = (char *)&zero;
2391 ssize_t todo = sizeof(unsigned int);
2395 ssize_t r = write(_ecore_evas_fps_debug_fd, buf2, todo);
2401 else if ((r < 0) && (errno == EINTR))
2405 ERR("could not write to file '%s' fd %d: %s",
2406 buf, _ecore_evas_fps_debug_fd, strerror(errno));
2407 close(_ecore_evas_fps_debug_fd);
2408 _ecore_evas_fps_debug_fd = -1;
2412 _ecore_evas_fps_rendertime_mmap = mmap(NULL, sizeof(unsigned int),
2413 PROT_READ | PROT_WRITE,
2415 _ecore_evas_fps_debug_fd, 0);
2416 if (_ecore_evas_fps_rendertime_mmap == MAP_FAILED)
2417 _ecore_evas_fps_rendertime_mmap = NULL;
2422 _ecore_evas_fps_debug_shutdown(void)
2424 _ecore_evas_fps_debug_init_count--;
2425 if (_ecore_evas_fps_debug_init_count > 0) return;
2426 if (_ecore_evas_fps_debug_fd >= 0)
2430 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2432 if (_ecore_evas_fps_rendertime_mmap)
2434 munmap(_ecore_evas_fps_rendertime_mmap, sizeof(int));
2435 _ecore_evas_fps_rendertime_mmap = NULL;
2437 close(_ecore_evas_fps_debug_fd);
2438 _ecore_evas_fps_debug_fd = -1;
2443 _ecore_evas_fps_debug_rendertime_add(double t)
2445 static double rtime = 0.0;
2446 static double rlapse = 0.0;
2447 static int frames = 0;
2448 static int flapse = 0;
2451 tim = ecore_time_get();
2459 else if ((tim - rlapse) >= 0.5)
2461 printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
2463 (frames - flapse) / (tim - rlapse),
2464 (100.0 * rtime) / (tim - rlapse)
2473 _ecore_evas_register(Ecore_Evas *ee)
2476 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
2477 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2481 _ecore_evas_ref(Ecore_Evas *ee)
2487 _ecore_evas_unref(Ecore_Evas *ee)
2490 if (ee->refcount == 0)
2492 if (ee->deleted) _ecore_evas_free(ee);
2494 else if (ee->refcount < -1)
2495 ERR("Ecore_Evas %p->refcount=%d < 0", ee, ee->refcount);
2499 _ecore_evas_free(Ecore_Evas *ee)
2501 ee->deleted = EINA_TRUE;
2502 if (ee->refcount > 0) return;
2504 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
2505 while (ee->sub_ecore_evas)
2507 _ecore_evas_free(ee->sub_ecore_evas->data);
2509 if (ee->data) eina_hash_free(ee->data);
2511 if (ee->name) free(ee->name);
2513 if (ee->prop.title) free(ee->prop.title);
2514 ee->prop.title = NULL;
2515 if (ee->prop.name) free(ee->prop.name);
2516 ee->prop.name = NULL;
2517 if (ee->prop.clas) free(ee->prop.clas);
2518 ee->prop.clas = NULL;
2519 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2520 ee->prop.cursor.object = NULL;
2521 if (ee->evas) evas_free(ee->evas);
2523 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
2525 if (ee->engine.idle_flush_timer)
2526 ecore_timer_del(ee->engine.idle_flush_timer);
2527 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
2530 ecore_evases = (Ecore_Evas *)eina_inlist_remove
2531 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2537 _ecore_evas_cb_idle_flush(void *data)
2541 ee = (Ecore_Evas *)data;
2542 evas_render_idle_flush(ee->evas);
2543 ee->engine.idle_flush_timer = NULL;
2544 return ECORE_CALLBACK_CANCEL;
2548 _ecore_evas_async_events_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
2550 evas_async_events_process();
2552 return ECORE_CALLBACK_RENEW;
2556 _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2558 if (ee->engine.idle_flush_timer)
2559 ecore_timer_del(ee->engine.idle_flush_timer);
2560 ee->engine.idle_flush_timer = ecore_timer_add(IDLE_FLUSH_TIME,
2561 _ecore_evas_cb_idle_flush,
2566 _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2570 if (ee->prop.cursor.object)
2572 evas_object_show(ee->prop.cursor.object);
2573 if (ee->rotation == 0)
2574 evas_object_move(ee->prop.cursor.object,
2575 x - ee->prop.cursor.hot.x,
2576 y - ee->prop.cursor.hot.y);
2577 else if (ee->rotation == 90)
2578 evas_object_move(ee->prop.cursor.object,
2579 ee->h - y - 1 - ee->prop.cursor.hot.x,
2580 x - ee->prop.cursor.hot.y);
2581 else if (ee->rotation == 180)
2582 evas_object_move(ee->prop.cursor.object,
2583 ee->w - x - 1 - ee->prop.cursor.hot.x,
2584 ee->h - y - 1 - ee->prop.cursor.hot.y);
2585 else if (ee->rotation == 270)
2586 evas_object_move(ee->prop.cursor.object,
2587 y - ee->prop.cursor.hot.x,
2588 ee->w - x - 1 - ee->prop.cursor.hot.y);
2590 if (ee->rotation == 0)
2591 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2592 else if (ee->rotation == 90)
2593 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
2594 else if (ee->rotation == 180)
2595 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
2596 else if (ee->rotation == 270)
2597 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
2601 _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
2604 double radius_x, double radius_y,
2607 double mx, double my,
2608 unsigned int timestamp)
2610 if (ee->rotation == 0)
2611 evas_event_feed_multi_move(ee->evas, device,
2616 angle - ee->rotation,
2619 else if (ee->rotation == 90)
2620 evas_event_feed_multi_move(ee->evas, device,
2625 angle - ee->rotation,
2628 else if (ee->rotation == 180)
2629 evas_event_feed_multi_move(ee->evas, device,
2630 ee->w - x - 1, ee->h - y - 1,
2634 angle - ee->rotation,
2635 ee->w - mx - 1, ee->h - my - 1,
2637 else if (ee->rotation == 270)
2638 evas_event_feed_multi_move(ee->evas, device,
2643 angle - ee->rotation,
2649 _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
2652 double radius_x, double radius_y,
2655 double mx, double my,
2656 Evas_Button_Flags flags,
2657 unsigned int timestamp)
2659 if (ee->rotation == 0)
2660 evas_event_feed_multi_down(ee->evas, device,
2665 angle - ee->rotation,
2667 flags, timestamp, NULL);
2668 else if (ee->rotation == 90)
2669 evas_event_feed_multi_down(ee->evas, device,
2674 angle - ee->rotation,
2676 flags, timestamp, NULL);
2677 else if (ee->rotation == 180)
2678 evas_event_feed_multi_down(ee->evas, device,
2679 ee->w - x - 1, ee->h - y - 1,
2683 angle - ee->rotation,
2684 ee->w - mx - 1, ee->h - my - 1,
2685 flags, timestamp, NULL);
2686 else if (ee->rotation == 270)
2687 evas_event_feed_multi_down(ee->evas, device,
2692 angle - ee->rotation,
2694 flags, timestamp, NULL);
2698 _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
2701 double radius_x, double radius_y,
2704 double mx, double my,
2705 Evas_Button_Flags flags,
2706 unsigned int timestamp)
2708 if (ee->rotation == 0)
2709 evas_event_feed_multi_up(ee->evas, device,
2714 angle - ee->rotation,
2716 flags, timestamp, NULL);
2717 else if (ee->rotation == 90)
2718 evas_event_feed_multi_up(ee->evas, device,
2723 angle - ee->rotation,
2725 flags, timestamp, NULL);
2726 else if (ee->rotation == 180)
2727 evas_event_feed_multi_up(ee->evas, device,
2728 ee->w - x - 1, ee->h - y - 1,
2732 angle - ee->rotation,
2733 ee->w - mx - 1, ee->h - my - 1,
2734 flags, timestamp, NULL);
2735 else if (ee->rotation == 270)
2736 evas_event_feed_multi_up(ee->evas, device,
2741 angle - ee->rotation,
2743 flags, timestamp, NULL);
2747 ecore_evas_ecore_evas_list_get(void)
2750 Eina_List *l = NULL;
2752 EINA_INLIST_FOREACH(ecore_evases, ee)
2754 l = eina_list_append(l, ee);
2761 ecore_evas_input_event_register(Ecore_Evas *ee)
2763 ecore_event_window_register((Ecore_Window)ee, ee, ee->evas,
2764 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
2765 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
2766 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
2767 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
2771 ecore_evas_input_event_unregister(Ecore_Evas *ee)
2773 ecore_event_window_unregister((Ecore_Window)ee);
2776 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined (BUILD_ECORE_EVAS_WAYLAND_EGL)
2778 ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
2781 if (!strcmp(ee->driver, "wayland_shm"))
2783 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2784 _ecore_evas_wayland_shm_resize(ee, location);
2787 else if (!strcmp(ee->driver, "wayland_egl"))
2789 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2790 _ecore_evas_wayland_egl_resize(ee, location);
2796 ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
2799 if (!strcmp(ee->driver, "wayland_shm"))
2801 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2802 _ecore_evas_wayland_shm_move(ee, x, y);
2805 else if (!strcmp(ee->driver, "wayland_egl"))
2807 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2808 _ecore_evas_wayland_egl_move(ee, x, y);
2814 ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
2817 ecore_wl_window_type_set(ee->engine.wl.win, type);
2820 EAPI Ecore_Wl_Window *
2821 ecore_evas_wayland_window_get(const Ecore_Evas *ee)
2823 if (!(!strncmp(ee->driver, "wayland", 7)))
2826 return ee->engine.wl.win;
2830 ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
2832 Ecore_Wl_Window *win;
2834 win = ecore_evas_wayland_window_get(ee);
2835 /* ecore_wl_window_pointer_set(win, ee->engine.wl.buffer, hot_x, hot_y); */
2840 ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
2846 ecore_evas_wayland_move(Ecore_Evas *ee __UNUSED__, int x __UNUSED__, int y __UNUSED__)
2852 ecore_evas_wayland_type_set(Ecore_Evas *ee __UNUSED__, int type __UNUSED__)
2857 EAPI Ecore_Wl_Window *
2858 ecore_evas_wayland_window_get(const Ecore_Evas *ee __UNUSED__)
2864 ecore_evas_wayland_pointer_set(Ecore_Evas *ee __UNUSED__, int hot_x __UNUSED__, int hot_y __UNUSED__)