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 renginering engine target has support
73 * @param engine The engine to check support for
74 * @return 1 if the particular engine is supported, 0 if it is not
76 * Query if engine @param engine is supported by ecore_evas. 1 is returned if
77 * it is, and 0 is returned if it is not supported.
80 ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
84 case ECORE_EVAS_ENGINE_SOFTWARE_BUFFER:
85 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
90 case ECORE_EVAS_ENGINE_SOFTWARE_XLIB:
91 #ifdef BUILD_ECORE_EVAS_SOFTWARE_XLIB
96 case ECORE_EVAS_ENGINE_XRENDER_X11:
98 case ECORE_EVAS_ENGINE_OPENGL_X11:
99 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
104 case ECORE_EVAS_ENGINE_SOFTWARE_XCB:
105 #ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
110 case ECORE_EVAS_ENGINE_XRENDER_XCB:
112 case ECORE_EVAS_ENGINE_SOFTWARE_GDI:
113 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
118 case ECORE_EVAS_ENGINE_SOFTWARE_DDRAW:
119 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
124 case ECORE_EVAS_ENGINE_DIRECT3D:
125 #ifdef BUILD_ECORE_EVAS_DIRECT3D
130 case ECORE_EVAS_ENGINE_OPENGL_GLEW:
131 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
136 case ECORE_EVAS_ENGINE_SOFTWARE_SDL:
137 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
142 case ECORE_EVAS_ENGINE_OPENGL_SDL:
143 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
148 case ECORE_EVAS_ENGINE_DIRECTFB:
149 #ifdef BUILD_ECORE_EVAS_DIRECTFB
154 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
155 #ifdef BUILD_ECORE_EVAS_FB
161 case ECORE_EVAS_ENGINE_SOFTWARE_8_X11:
162 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
168 case ECORE_EVAS_ENGINE_SOFTWARE_16_X11:
169 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
174 case ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW:
175 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
180 case ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE:
181 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
186 case ECORE_EVAS_ENGINE_OPENGL_COCOA:
187 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
192 case ECORE_EVAS_ENGINE_EWS:
193 #ifdef BUILD_ECORE_EVAS_EWS
198 case ECORE_EVAS_ENGINE_PSL1GHT:
199 #ifdef BUILD_ECORE_EVAS_PSL1GHT
204 case ECORE_EVAS_ENGINE_WAYLAND_SHM:
205 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
210 case ECORE_EVAS_ENGINE_WAYLAND_EGL:
211 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
222 ecore_evas_init(void)
226 if (++_ecore_evas_init_count != 1)
227 return _ecore_evas_init_count;
230 return --_ecore_evas_init_count;
235 _ecore_evas_log_dom = eina_log_domain_register
236 ("ecore_evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
237 if(_ecore_evas_log_dom < 0)
239 EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
243 fd = evas_async_events_fd_get();
245 _ecore_evas_async_events_fd = ecore_main_fd_handler_add(fd,
247 _ecore_evas_async_events_fd_handler, NULL,
250 ecore_evas_idle_enterer =
251 ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
252 if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
253 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
255 #ifdef BUILD_ECORE_EVAS_EWS
256 _ecore_evas_ews_events_init();
259 _ecore_evas_extn_init();
261 if (getenv("ECORE_EVAS_COMP_NOSYNC"))
262 _ecore_evas_app_comp_sync = 0;
263 return _ecore_evas_init_count;
270 return --_ecore_evas_init_count;
274 ecore_evas_shutdown(void)
276 if (--_ecore_evas_init_count != 0)
277 return _ecore_evas_init_count;
279 while (ecore_evases) _ecore_evas_free(ecore_evases);
281 _ecore_evas_extn_shutdown();
283 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
284 ecore_idle_enterer_del(ecore_evas_idle_enterer);
285 ecore_evas_idle_enterer = NULL;
287 #ifdef BUILD_ECORE_EVAS_X11
288 while (_ecore_evas_x_shutdown());
290 #ifdef BUILD_ECORE_EVAS_WIN32
291 while (_ecore_evas_win32_shutdown());
293 #ifdef BUILD_ECORE_EVAS_FB
294 while (_ecore_evas_fb_shutdown());
296 #ifdef BUILD_ECORE_EVAS_EWS
297 while (_ecore_evas_ews_shutdown());
299 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
300 while (_ecore_evas_buffer_shutdown());
302 #ifdef BUILD_ECORE_EVAS_DIRECTFB
303 while (_ecore_evas_directfb_shutdown());
305 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
306 while (_ecore_evas_wince_shutdown());
309 if (_ecore_evas_async_events_fd)
310 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
312 eina_log_domain_unregister(_ecore_evas_log_dom);
313 _ecore_evas_log_dom = -1;
317 return _ecore_evas_init_count;
321 ecore_evas_app_comp_sync_set(Eina_Bool do_sync)
323 _ecore_evas_app_comp_sync = do_sync;
327 ecore_evas_app_comp_sync_get(void)
329 return _ecore_evas_app_comp_sync;
332 struct ecore_evas_engine {
334 Ecore_Evas *(*constructor)(int x, int y, int w, int h, const char *extra_options);
337 /* inline is just to avoid need to ifdef around it */
338 static inline const char *
339 _ecore_evas_parse_extra_options_str(const char *extra_options, const char *key, char **value)
341 int len = strlen(key);
343 while (extra_options)
347 if (strncmp(extra_options, key, len) != 0)
349 extra_options = strchr(extra_options, ';');
355 extra_options += len;
356 p = strchr(extra_options, ';');
359 len = p - extra_options;
360 *value = malloc(len + 1);
361 memcpy(*value, extra_options, len);
362 (*value)[len] = '\0';
363 extra_options = p + 1;
367 *value = strdup(extra_options);
368 extra_options = NULL;
371 return extra_options;
374 /* inline is just to avoid need to ifdef around it */
375 static inline const char *
376 _ecore_evas_parse_extra_options_uint(const char *extra_options, const char *key, unsigned int *value)
378 int len = strlen(key);
380 while (extra_options)
384 if (strncmp(extra_options, key, len) != 0)
386 extra_options = strchr(extra_options, ';');
392 extra_options += len;
393 *value = strtol(extra_options, NULL, 0);
395 p = strchr(extra_options, ';');
397 extra_options = p + 1;
399 extra_options = NULL;
401 return extra_options;
404 /* inline is just to avoid need to ifdef around it */
405 static inline const char *
406 _ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, unsigned int *parent)
408 _ecore_evas_parse_extra_options_str(extra_options, "display=", disp_name);
409 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", parent);
410 return extra_options;
413 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
415 _ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
417 unsigned int parent = 0;
418 char *disp_name = NULL;
421 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
422 ee = ecore_evas_software_x11_new(disp_name, parent, x, y, w, h);
429 #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
431 _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
436 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
437 ee = ecore_evas_cocoa_new(NULL, x, y, w, h);
440 if (ee) ecore_evas_move(ee, x, y);
445 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
447 _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
449 Ecore_X_Window parent = 0;
450 char *disp_name = NULL;
453 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
454 ee = ecore_evas_gl_x11_new(disp_name, parent, x, y, w, h);
461 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
463 _ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
465 Ecore_X_Window parent = 0;
466 char *disp_name = NULL;
469 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
470 ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
477 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
479 _ecore_evas_constructor_software_16_x11(int x, int y, int w, int h, const char *extra_options)
481 Ecore_X_Window parent = 0;
482 char *disp_name = NULL;
485 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
486 ee = ecore_evas_software_x11_16_new(disp_name, parent, x, y, w, h);
493 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
495 _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
498 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
501 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
502 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
503 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
504 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
505 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
507 ee = ecore_evas_sdl_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
514 #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_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
1923 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1925 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1926 "ecore_evas_fullscreen_set");
1929 IFC(ee, fn_fullscreen_set) (ee, on);
1934 ecore_evas_fullscreen_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_fullscreen_get");
1942 return ee->prop.fullscreen ? EINA_TRUE : EINA_FALSE;
1946 ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
1948 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1950 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1951 "ecore_evas_avoid_damage_set");
1954 IFC(ee, fn_avoid_damage_set) (ee, on);
1958 EAPI Ecore_Evas_Avoid_Damage_Type
1959 ecore_evas_avoid_damage_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_avoid_damage_get");
1965 return ECORE_EVAS_AVOID_DAMAGE_NONE;
1967 return ee->prop.avoid_damage;
1971 ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn)
1973 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1975 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1976 "ecore_evas_withdrawn_set");
1980 IFC(ee, fn_withdrawn_set) (ee, withdrawn);
1985 ecore_evas_withdrawn_get(const Ecore_Evas *ee)
1987 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1989 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1990 "ecore_evas_withdrawn_get");
1993 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE;
1997 ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky)
1999 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2001 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2002 "ecore_evas_sticky_set");
2006 IFC(ee, fn_sticky_set) (ee, sticky);
2011 ecore_evas_sticky_get(const Ecore_Evas *ee)
2013 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2015 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2016 "ecore_evas_sticky_get");
2019 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
2023 ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group)
2025 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2027 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2032 IFC(ee, fn_window_group_set) (ee, ee_group);
2036 EAPI const Ecore_Evas *
2037 ecore_evas_window_group_get(const Ecore_Evas *ee)
2039 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2041 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2045 return ee->prop.group_ee;
2049 ecore_evas_aspect_set(Ecore_Evas *ee, double aspect)
2051 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2053 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2058 IFC(ee, fn_aspect_set) (ee, aspect);
2063 ecore_evas_aspect_get(const Ecore_Evas *ee)
2065 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2067 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2071 return ee->prop.aspect;
2075 ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent)
2077 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2079 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2084 IFC(ee, fn_urgent_set) (ee, urgent);
2089 ecore_evas_urgent_get(const Ecore_Evas *ee)
2091 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2093 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2097 return ee->prop.urgent ? EINA_TRUE : EINA_FALSE;
2101 ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal)
2103 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2105 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2110 IFC(ee, fn_modal_set) (ee, modal);
2115 ecore_evas_modal_get(const Ecore_Evas *ee)
2117 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2119 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2123 return ee->prop.modal ? EINA_TRUE : EINA_FALSE;
2127 ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand)
2129 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2131 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2136 IFC(ee, fn_demands_attention_set) (ee, demand);
2141 ecore_evas_demand_attention_get(const Ecore_Evas *ee)
2143 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2145 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2149 return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE;
2153 ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip)
2155 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2157 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2162 IFC(ee, fn_focus_skip_set) (ee, skip);
2167 ecore_evas_focus_skip_get(const Ecore_Evas *ee)
2169 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2171 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2175 return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE;
2179 ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
2181 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2183 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2184 "ecore_evas_ignore_events_set");
2188 IFC(ee, fn_ignore_events_set) (ee, ignore);
2193 ecore_evas_ignore_events_get(const Ecore_Evas *ee)
2195 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2197 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2198 "ecore_evas_ignore_events_get");
2201 return ee->ignore_events ? EINA_TRUE : EINA_FALSE;
2205 ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render)
2207 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2209 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2210 "ecore_evas_manual_render_set");
2213 ee->manual_render = manual_render;
2217 ecore_evas_manual_render_get(const Ecore_Evas *ee)
2219 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2221 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2222 "ecore_evas_manual_render_get");
2225 return ee->manual_render ? EINA_TRUE : EINA_FALSE;
2229 ecore_evas_manual_render(Ecore_Evas *ee)
2231 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2233 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2234 "ecore_evas_manual_render");
2237 if (ee->engine.func->fn_render)
2238 ee->engine.func->fn_render(ee);
2242 ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync)
2244 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2246 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2247 "ecore_evas_comp_sync_set");
2250 ee->no_comp_sync = !do_sync;
2254 ecore_evas_comp_sync_get(const Ecore_Evas *ee)
2256 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2258 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2259 "ecore_evas_comp_sync_get");
2262 return !ee->no_comp_sync;
2266 ecore_evas_window_get(const Ecore_Evas *ee)
2268 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2270 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2271 "ecore_evas_window_get");
2275 return ee->prop.window;
2279 ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
2285 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2287 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2288 "ecore_evas_screen_geometry_get");
2292 IFC(ee, fn_screen_geometry_get) (ee, x, y, w, h);
2297 ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame)
2299 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2301 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_set");
2304 ee->prop.draw_frame = draw_frame;
2308 ecore_evas_draw_frame_get(const Ecore_Evas *ee)
2310 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2312 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_get");
2315 return ee->prop.draw_frame;
2318 /* fps debug calls - for debugging how much time your app actually spends */
2319 /* rendering graphics... :) */
2321 static int _ecore_evas_fps_debug_init_count = 0;
2322 static int _ecore_evas_fps_debug_fd = -1;
2323 unsigned int *_ecore_evas_fps_rendertime_mmap = NULL;
2326 _ecore_evas_fps_debug_init(void)
2331 _ecore_evas_fps_debug_init_count++;
2332 if (_ecore_evas_fps_debug_init_count > 1) return;
2337 tmp = evil_tmpdir_get ();
2338 #endif /* HAVE_EVIL */
2339 snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i", tmp, (int)getpid());
2340 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2341 if (_ecore_evas_fps_debug_fd < 0)
2344 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2346 if (_ecore_evas_fps_debug_fd >= 0)
2348 unsigned int zero = 0;
2349 char *buf2 = (char *)&zero;
2350 ssize_t todo = sizeof(unsigned int);
2354 ssize_t r = write(_ecore_evas_fps_debug_fd, buf2, todo);
2360 else if ((r < 0) && (errno == EINTR))
2364 ERR("could not write to file '%s' fd %d: %s",
2365 buf, _ecore_evas_fps_debug_fd, strerror(errno));
2366 close(_ecore_evas_fps_debug_fd);
2367 _ecore_evas_fps_debug_fd = -1;
2371 _ecore_evas_fps_rendertime_mmap = mmap(NULL, sizeof(unsigned int),
2372 PROT_READ | PROT_WRITE,
2374 _ecore_evas_fps_debug_fd, 0);
2375 if (_ecore_evas_fps_rendertime_mmap == MAP_FAILED)
2376 _ecore_evas_fps_rendertime_mmap = NULL;
2381 _ecore_evas_fps_debug_shutdown(void)
2383 _ecore_evas_fps_debug_init_count--;
2384 if (_ecore_evas_fps_debug_init_count > 0) return;
2385 if (_ecore_evas_fps_debug_fd >= 0)
2389 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2391 if (_ecore_evas_fps_rendertime_mmap)
2393 munmap(_ecore_evas_fps_rendertime_mmap, sizeof(int));
2394 _ecore_evas_fps_rendertime_mmap = NULL;
2396 close(_ecore_evas_fps_debug_fd);
2397 _ecore_evas_fps_debug_fd = -1;
2402 _ecore_evas_fps_debug_rendertime_add(double t)
2404 static double rtime = 0.0;
2405 static double rlapse = 0.0;
2406 static int frames = 0;
2407 static int flapse = 0;
2410 tim = ecore_time_get();
2418 else if ((tim - rlapse) >= 0.5)
2420 printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
2422 (frames - flapse) / (tim - rlapse),
2423 (100.0 * rtime) / (tim - rlapse)
2432 _ecore_evas_register(Ecore_Evas *ee)
2435 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
2436 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2440 _ecore_evas_ref(Ecore_Evas *ee)
2446 _ecore_evas_unref(Ecore_Evas *ee)
2449 if (ee->refcount == 0)
2451 if (ee->deleted) _ecore_evas_free(ee);
2453 else if (ee->refcount < -1)
2454 ERR("Ecore_Evas %p->refcount=%d < 0", ee, ee->refcount);
2458 _ecore_evas_free(Ecore_Evas *ee)
2460 ee->deleted = EINA_TRUE;
2461 if (ee->refcount > 0) return;
2463 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
2464 while (ee->sub_ecore_evas)
2466 _ecore_evas_free(ee->sub_ecore_evas->data);
2468 if (ee->data) eina_hash_free(ee->data);
2470 if (ee->name) free(ee->name);
2472 if (ee->prop.title) free(ee->prop.title);
2473 ee->prop.title = NULL;
2474 if (ee->prop.name) free(ee->prop.name);
2475 ee->prop.name = NULL;
2476 if (ee->prop.clas) free(ee->prop.clas);
2477 ee->prop.clas = NULL;
2478 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2479 ee->prop.cursor.object = NULL;
2480 if (ee->evas) evas_free(ee->evas);
2482 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
2484 if (ee->engine.idle_flush_timer)
2485 ecore_timer_del(ee->engine.idle_flush_timer);
2486 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
2489 ecore_evases = (Ecore_Evas *)eina_inlist_remove
2490 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2496 _ecore_evas_cb_idle_flush(void *data)
2500 ee = (Ecore_Evas *)data;
2501 evas_render_idle_flush(ee->evas);
2502 ee->engine.idle_flush_timer = NULL;
2503 return ECORE_CALLBACK_CANCEL;
2507 _ecore_evas_async_events_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
2509 evas_async_events_process();
2511 return ECORE_CALLBACK_RENEW;
2515 _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2517 if (ee->engine.idle_flush_timer)
2518 ecore_timer_del(ee->engine.idle_flush_timer);
2519 ee->engine.idle_flush_timer = ecore_timer_add(IDLE_FLUSH_TIME,
2520 _ecore_evas_cb_idle_flush,
2525 _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2529 if (ee->prop.cursor.object)
2531 evas_object_show(ee->prop.cursor.object);
2532 if (ee->rotation == 0)
2533 evas_object_move(ee->prop.cursor.object,
2534 x - ee->prop.cursor.hot.x,
2535 y - ee->prop.cursor.hot.y);
2536 else if (ee->rotation == 90)
2537 evas_object_move(ee->prop.cursor.object,
2538 ee->h - y - 1 - ee->prop.cursor.hot.x,
2539 x - ee->prop.cursor.hot.y);
2540 else if (ee->rotation == 180)
2541 evas_object_move(ee->prop.cursor.object,
2542 ee->w - x - 1 - ee->prop.cursor.hot.x,
2543 ee->h - y - 1 - ee->prop.cursor.hot.y);
2544 else if (ee->rotation == 270)
2545 evas_object_move(ee->prop.cursor.object,
2546 y - ee->prop.cursor.hot.x,
2547 ee->w - x - 1 - ee->prop.cursor.hot.y);
2549 if (ee->rotation == 0)
2550 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2551 else if (ee->rotation == 90)
2552 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
2553 else if (ee->rotation == 180)
2554 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
2555 else if (ee->rotation == 270)
2556 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
2560 _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
2563 double radius_x, double radius_y,
2566 double mx, double my,
2567 unsigned int timestamp)
2569 if (ee->rotation == 0)
2570 evas_event_feed_multi_move(ee->evas, device,
2575 angle - ee->rotation,
2578 else if (ee->rotation == 90)
2579 evas_event_feed_multi_move(ee->evas, device,
2584 angle - ee->rotation,
2587 else if (ee->rotation == 180)
2588 evas_event_feed_multi_move(ee->evas, device,
2589 ee->w - x - 1, ee->h - y - 1,
2593 angle - ee->rotation,
2594 ee->w - mx - 1, ee->h - my - 1,
2596 else if (ee->rotation == 270)
2597 evas_event_feed_multi_move(ee->evas, device,
2602 angle - ee->rotation,
2608 _ecore_evas_mouse_multi_down_process(Ecore_Evas *ee, int device,
2611 double radius_x, double radius_y,
2614 double mx, double my,
2615 Evas_Button_Flags flags,
2616 unsigned int timestamp)
2618 if (ee->rotation == 0)
2619 evas_event_feed_multi_down(ee->evas, device,
2624 angle - ee->rotation,
2626 flags, timestamp, NULL);
2627 else if (ee->rotation == 90)
2628 evas_event_feed_multi_down(ee->evas, device,
2633 angle - ee->rotation,
2635 flags, timestamp, NULL);
2636 else if (ee->rotation == 180)
2637 evas_event_feed_multi_down(ee->evas, device,
2638 ee->w - x - 1, ee->h - y - 1,
2642 angle - ee->rotation,
2643 ee->w - mx - 1, ee->h - my - 1,
2644 flags, timestamp, NULL);
2645 else if (ee->rotation == 270)
2646 evas_event_feed_multi_down(ee->evas, device,
2651 angle - ee->rotation,
2653 flags, timestamp, NULL);
2657 _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
2660 double radius_x, double radius_y,
2663 double mx, double my,
2664 Evas_Button_Flags flags,
2665 unsigned int timestamp)
2667 if (ee->rotation == 0)
2668 evas_event_feed_multi_up(ee->evas, device,
2673 angle - ee->rotation,
2675 flags, timestamp, NULL);
2676 else if (ee->rotation == 90)
2677 evas_event_feed_multi_up(ee->evas, device,
2682 angle - ee->rotation,
2684 flags, timestamp, NULL);
2685 else if (ee->rotation == 180)
2686 evas_event_feed_multi_up(ee->evas, device,
2687 ee->w - x - 1, ee->h - y - 1,
2691 angle - ee->rotation,
2692 ee->w - mx - 1, ee->h - my - 1,
2693 flags, timestamp, NULL);
2694 else if (ee->rotation == 270)
2695 evas_event_feed_multi_up(ee->evas, device,
2700 angle - ee->rotation,
2702 flags, timestamp, NULL);
2706 ecore_evas_ecore_evas_list_get(void)
2709 Eina_List *l = NULL;
2711 EINA_INLIST_FOREACH(ecore_evases, ee)
2713 l = eina_list_append(l, ee);
2720 ecore_evas_input_event_register(Ecore_Evas *ee)
2722 ecore_event_window_register((Ecore_Window)ee, ee, ee->evas,
2723 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
2724 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
2725 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
2726 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
2730 ecore_evas_input_event_unregister(Ecore_Evas *ee)
2732 ecore_event_window_unregister((Ecore_Window)ee);
2735 #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined (BUILD_ECORE_EVAS_WAYLAND_EGL)
2737 ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
2740 if (!strcmp(ee->driver, "wayland_shm"))
2742 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2743 _ecore_evas_wayland_shm_resize(ee, location);
2746 else if (!strcmp(ee->driver, "wayland_egl"))
2748 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2749 _ecore_evas_wayland_egl_resize(ee, location);
2755 ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
2758 if (!strcmp(ee->driver, "wayland_shm"))
2760 #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2761 _ecore_evas_wayland_shm_move(ee, x, y);
2764 else if (!strcmp(ee->driver, "wayland_egl"))
2766 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2767 _ecore_evas_wayland_egl_move(ee, x, y);
2773 ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
2776 ecore_wl_window_type_set(ee->engine.wl.win, type);
2779 EAPI Ecore_Wl_Window *
2780 ecore_evas_wayland_window_get(const Ecore_Evas *ee)
2782 if (!(!strncmp(ee->driver, "wayland", 7)))
2785 return ee->engine.wl.win;
2789 ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
2791 Ecore_Wl_Window *win;
2793 win = ecore_evas_wayland_window_get(ee);
2794 /* ecore_wl_window_pointer_set(win, ee->engine.wl.buffer, hot_x, hot_y); */
2799 ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
2805 ecore_evas_wayland_move(Ecore_Evas *ee __UNUSED__, int x __UNUSED__, int y __UNUSED__)
2811 ecore_evas_wayland_type_set(Ecore_Evas *ee __UNUSED__, int type __UNUSED__)
2816 EAPI Ecore_Wl_Window *
2817 ecore_evas_wayland_window_get(const Ecore_Evas *ee __UNUSED__)
2823 ecore_evas_wayland_pointer_set(Ecore_Evas *ee __UNUSED__, int hot_x __UNUSED__, int hot_y __UNUSED__)