14 #include "ecore_private.h"
15 #include "Ecore_Input.h"
17 #include "ecore_evas_private.h"
18 #include "Ecore_Evas.h"
20 int _ecore_evas_log_dom = -1;
21 static int _ecore_evas_init_count = 0;
22 static Ecore_Fd_Handler *_ecore_evas_async_events_fd = NULL;
23 static Eina_Bool _ecore_evas_async_events_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
25 static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
26 static Ecore_Evas *ecore_evases = NULL;
27 static int _ecore_evas_fps_debug = 0;
30 _ecore_evas_idle_enter(void *data __UNUSED__)
37 if (!ecore_evases) return ECORE_CALLBACK_RENEW;
38 if (_ecore_evas_fps_debug)
40 t1 = ecore_time_get();
42 EINA_INLIST_FOREACH(ecore_evases, ee)
44 if (!ee->manual_render)
46 if (ee->engine.func->fn_render)
47 rend |= ee->engine.func->fn_render(ee);
50 if (_ecore_evas_fps_debug)
52 t2 = ecore_time_get();
54 _ecore_evas_fps_debug_rendertime_add(t2 - t1);
56 return ECORE_CALLBACK_RENEW;
60 * Query if a particular renginering engine target has support
61 * @param engine The engine to check support for
62 * @return 1 if the particular engine is supported, 0 if it is not
64 * Query if engine @param engine is supported by ecore_evas. 1 is returned if
65 * it is, and 0 is returned if it is not supported.
68 ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
72 case ECORE_EVAS_ENGINE_SOFTWARE_BUFFER:
73 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
78 case ECORE_EVAS_ENGINE_SOFTWARE_XLIB:
79 #ifdef BUILD_ECORE_EVAS_SOFTWARE_XLIB
84 case ECORE_EVAS_ENGINE_XRENDER_X11:
85 #ifdef BUILD_ECORE_EVAS_XRENDER_X11
90 case ECORE_EVAS_ENGINE_OPENGL_X11:
91 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
96 case ECORE_EVAS_ENGINE_SOFTWARE_XCB:
97 #ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
102 case ECORE_EVAS_ENGINE_XRENDER_XCB:
103 #ifdef BUILD_ECORE_EVAS_XRENDER_XCB
108 case ECORE_EVAS_ENGINE_SOFTWARE_GDI:
109 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
114 case ECORE_EVAS_ENGINE_SOFTWARE_DDRAW:
115 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
120 case ECORE_EVAS_ENGINE_DIRECT3D:
121 #ifdef BUILD_ECORE_EVAS_DIRECT3D
126 case ECORE_EVAS_ENGINE_OPENGL_GLEW:
127 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
132 case ECORE_EVAS_ENGINE_SOFTWARE_SDL:
133 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
138 case ECORE_EVAS_ENGINE_OPENGL_SDL:
139 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
144 case ECORE_EVAS_ENGINE_DIRECTFB:
145 #ifdef BUILD_ECORE_EVAS_DIRECTFB
150 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
151 #ifdef BUILD_ECORE_EVAS_FB
157 case ECORE_EVAS_ENGINE_SOFTWARE_8_X11:
158 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
164 case ECORE_EVAS_ENGINE_SOFTWARE_16_X11:
165 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
170 case ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW:
171 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
176 case ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE:
177 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
182 case ECORE_EVAS_ENGINE_COCOA:
183 #ifdef BUILD_ECORE_EVAS_COCOA
195 * Init the Evas system.
196 * @return greater than 0 on success, 0 on failure
198 * Set up the Evas wrapper system. Init Evas and Ecore libraries.
201 ecore_evas_init(void)
205 if (++_ecore_evas_init_count != 1)
206 return _ecore_evas_init_count;
209 return --_ecore_evas_init_count;
214 _ecore_evas_log_dom = eina_log_domain_register
215 ("ecore_evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
216 if(_ecore_evas_log_dom < 0)
218 EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
222 fd = evas_async_events_fd_get();
224 _ecore_evas_async_events_fd = ecore_main_fd_handler_add(fd,
226 _ecore_evas_async_events_fd_handler, NULL,
229 ecore_evas_idle_enterer =
230 ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
231 if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
232 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
234 return _ecore_evas_init_count;
241 return --_ecore_evas_init_count;
245 * Shut down the Evas system.
246 * @return 0 if ecore evas is fully shut down, or > 0 if it still needs to be shut down
248 * This closes the Evas wrapper system down. Shut down Evas and Ecore libraries.
251 ecore_evas_shutdown(void)
253 if (--_ecore_evas_init_count != 0)
254 return _ecore_evas_init_count;
256 while (ecore_evases) _ecore_evas_free(ecore_evases);
258 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
259 ecore_idle_enterer_del(ecore_evas_idle_enterer);
260 ecore_evas_idle_enterer = NULL;
262 #ifdef BUILD_ECORE_EVAS_X11
263 while (_ecore_evas_x_shutdown());
265 #ifdef BUILD_ECORE_EVAS_WIN32
266 while (_ecore_evas_win32_shutdown());
268 #ifdef BUILD_ECORE_EVAS_FB
269 while (_ecore_evas_fb_shutdown());
271 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
272 while (_ecore_evas_buffer_shutdown());
274 #ifdef BUILD_ECORE_EVAS_DIRECTFB
275 while (_ecore_evas_directfb_shutdown());
277 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
278 while (_ecore_evas_wince_shutdown());
280 if (_ecore_evas_async_events_fd)
281 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
283 eina_log_domain_unregister(_ecore_evas_log_dom);
284 _ecore_evas_log_dom = -1;
288 return _ecore_evas_init_count;
291 Eina_Bool _ecore_evas_app_comp_sync = 1;
294 ecore_evas_app_comp_sync_set(Eina_Bool do_sync)
296 _ecore_evas_app_comp_sync = do_sync;
300 ecore_evas_app_comp_sync_get(void)
302 return _ecore_evas_app_comp_sync;
305 struct ecore_evas_engine {
307 Ecore_Evas *(*constructor)(int x, int y, int w, int h, const char *extra_options);
310 /* inline is just to avoid need to ifdef around it */
311 static inline const char *
312 _ecore_evas_parse_extra_options_str(const char *extra_options, const char *key, char **value)
314 int len = strlen(key);
316 while (extra_options)
320 if (strncmp(extra_options, key, len) != 0)
322 extra_options = strchr(extra_options, ';');
328 extra_options += len;
329 p = strchr(extra_options, ';');
332 len = p - extra_options;
333 *value = malloc(len + 1);
334 memcpy(*value, extra_options, len);
335 (*value)[len] = '\0';
336 extra_options = p + 1;
340 *value = strdup(extra_options);
341 extra_options = NULL;
344 return extra_options;
347 /* inline is just to avoid need to ifdef around it */
348 static inline const char *
349 _ecore_evas_parse_extra_options_uint(const char *extra_options, const char *key, unsigned int *value)
351 int len = strlen(key);
353 while (extra_options)
357 if (strncmp(extra_options, key, len) != 0)
359 extra_options = strchr(extra_options, ';');
365 extra_options += len;
366 *value = strtol(extra_options, NULL, 0);
368 p = strchr(extra_options, ';');
370 extra_options = p + 1;
372 extra_options = NULL;
374 return extra_options;
377 /* inline is just to avoid need to ifdef around it */
378 static inline const char *
379 _ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, unsigned int *parent)
381 _ecore_evas_parse_extra_options_str(extra_options, "display=", disp_name);
382 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", parent);
383 return extra_options;
386 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
388 _ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
390 unsigned int parent = 0;
391 char *disp_name = NULL;
394 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
395 ee = ecore_evas_software_x11_new(disp_name, parent, x, y, w, h);
402 #ifdef BUILD_ECORE_EVAS_COCOA
404 _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
409 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
410 ee = ecore_evas_cocoa_new(name, w, h);
413 if (ee) ecore_evas_move(ee, x, y);
418 #ifdef BUILD_ECORE_EVAS_XRENDER_X11
420 _ecore_evas_constructor_xrender_x11(int x, int y, int w, int h, const char *extra_options)
422 unsigned int parent = 0;
423 char *disp_name = NULL;
426 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
427 ee = ecore_evas_xrender_x11_new(disp_name, parent, x, y, w, h);
434 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
436 _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
438 Ecore_X_Window parent = 0;
439 char *disp_name = NULL;
442 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
443 ee = ecore_evas_gl_x11_new(disp_name, parent, x, y, w, h);
450 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
452 _ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
454 Ecore_X_Window parent = 0;
455 char *disp_name = NULL;
458 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
459 ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
466 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
468 _ecore_evas_constructor_software_16_x11(int x, int y, int w, int h, const char *extra_options)
470 Ecore_X_Window parent = 0;
471 char *disp_name = NULL;
474 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
475 ee = ecore_evas_software_x11_16_new(disp_name, parent, x, y, w, h);
482 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
484 _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
487 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
490 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
491 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
492 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
493 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
495 ee = ecore_evas_sdl_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
502 _ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
505 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
508 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
509 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
510 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
511 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
513 ee = ecore_evas_sdl16_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
520 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
522 _ecore_evas_constructor_opengl_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
525 unsigned int fullscreen = 0, noframe = 0;
528 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
529 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
530 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
532 ee = ecore_evas_gl_sdl_new(name, w, h, fullscreen, noframe);
539 #ifdef BUILD_ECORE_EVAS_DIRECTFB
541 _ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
544 char *disp_name = NULL;
545 unsigned int windowed = 1;
547 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
548 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
550 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
557 #ifdef BUILD_ECORE_EVAS_FB
559 _ecore_evas_constructor_fb(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
562 char *disp_name = NULL;
563 unsigned int rotation = 0;
565 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
566 _ecore_evas_parse_extra_options_uint(extra_options, "rotation=", &rotation);
568 ee = ecore_evas_fb_new(disp_name, rotation, w, h);
575 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
577 _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
579 return ecore_evas_software_gdi_new(NULL, x, y, w, h);
583 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
585 _ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
587 return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
591 #ifdef BUILD_ECORE_EVAS_DIRECT3D
593 _ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
595 return ecore_evas_direct3d_new(NULL, x, y, w, h);
599 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
601 _ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
603 return ecore_evas_gl_glew_new(NULL, x, y, w, h);
607 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
609 _ecore_evas_constructor_software_16_ddraw(int x, int y, int w, int h, const char *extra_options)
611 return ecore_evas_software_16_ddraw_new(NULL, x, y, w, h);
615 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
617 _ecore_evas_constructor_software_16_wince(int x, int y, int w, int h, const char *extra_options __UNUSED__)
619 return ecore_evas_software_wince_new(NULL, x, y, w, h);
623 _ecore_evas_constructor_software_16_wince_fb(int x, int y, int w, int h, const char *extra_options __UNUSED__)
625 return ecore_evas_software_wince_fb_new(NULL, x, y, w, h);
629 _ecore_evas_constructor_software_16_wince_gapi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
631 return ecore_evas_software_wince_gapi_new(NULL, x, y, w, h);
635 _ecore_evas_constructor_software_16_wince_gdi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
637 return ecore_evas_software_wince_gdi_new(NULL, x, y, w, h);
641 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
643 _ecore_evas_constructor_buffer(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options __UNUSED__)
645 return ecore_evas_buffer_new(w, h);
649 /* note: keep sorted by priority, highest first */
650 static const struct ecore_evas_engine _engines[] = {
652 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
653 {"software_x11", _ecore_evas_constructor_software_x11},
655 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
656 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
658 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
659 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
661 #ifdef BUILD_ECORE_EVAS_XRENDER_X11
662 {"xrender_x11", _ecore_evas_constructor_xrender_x11},
664 #ifdef BUILD_ECORE_EVAS_XRENDER_XCB
665 {"xrender_xcb", _ecore_evas_constructor_xrender_x11},
667 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
668 {"software_16_x11", _ecore_evas_constructor_software_16_x11},
670 #ifdef BUILD_ECORE_EVAS_DIRECTFB
671 {"directfb", _ecore_evas_constructor_directfb},
673 #ifdef BUILD_ECORE_EVAS_FB
674 {"fb", _ecore_evas_constructor_fb},
678 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
679 {"software_gdi", _ecore_evas_constructor_software_gdi},
681 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
682 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
684 #ifdef BUILD_ECORE_EVAS_DIRECT3D
685 {"direct3d", _ecore_evas_constructor_direct3d},
687 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
688 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
690 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
691 {"software_16_ddraw", _ecore_evas_constructor_software_16_ddraw},
693 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
694 {"software_16_wince", _ecore_evas_constructor_software_16_wince},
695 {"software_16_wince_fb", _ecore_evas_constructor_software_16_wince_fb},
696 {"software_16_wince_gapi", _ecore_evas_constructor_software_16_wince_gapi},
697 {"software_16_wince_gdi", _ecore_evas_constructor_software_16_wince_gdi},
701 #ifdef BUILD_ECORE_EVAS_COCOA
702 {"cocoa", _ecore_evas_constructor_cocoa},
705 /* Last chance to have a window */
706 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
707 {"sdl", _ecore_evas_constructor_sdl},
708 {"software_16_sdl", _ecore_evas_constructor_sdl16},
711 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
712 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
716 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
717 {"buffer", _ecore_evas_constructor_buffer},
723 * Returns a list of supported engines names.
725 * @return newly allocated list with engines names. Engines names
726 * strings are internal and should be considered constants, do not
727 * free them, to avoid problems use ecore_evas_engines_free()
730 ecore_evas_engines_get(void)
732 const struct ecore_evas_engine *itr;
733 Eina_List *lst = NULL;
735 for (itr = _engines; itr->name; itr++)
736 lst = eina_list_append(lst, itr->name);
742 * Free list returned by ecore_evas_engines_get()
745 ecore_evas_engines_free(Eina_List *engines)
747 eina_list_free(engines);
751 _ecore_evas_new_auto_discover(int x, int y, int w, int h, const char *extra_options)
753 const struct ecore_evas_engine *itr;
755 DBG("auto discover engine");
757 for (itr = _engines; itr->constructor; itr++)
759 Ecore_Evas *ee = itr->constructor(x, y, w, h, extra_options);
762 INF("auto discovered '%s'", itr->name);
767 WRN("could not auto discover.");
772 * Creates a new Ecore_Evas based on engine name and common parameters.
774 * @param engine_name engine name as returned by
775 * ecore_evas_engines_get() or NULL to use environment variable
776 * ECORE_EVAS_ENGINE, that can be undefined and in this case
777 * this call will try to find the first working engine.
778 * @param x horizontal position of window (not supported in all engines)
779 * @param y vertical position of window (not supported in all engines)
780 * @param w width of window
781 * @param h height of window
782 * @param extra_options string with extra parameter, dependent on engines
783 * or NULL. String is usually in the form: 'key1=value1;key2=value2'.
784 * Pay attention that when getting that from shell commands, most
785 * consider ';' as the command terminator, so you need to escape
788 * @return Ecore_Evas instance or NULL if creation failed.
791 ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
793 const struct ecore_evas_engine *itr;
797 engine_name = getenv("ECORE_EVAS_ENGINE");
799 DBG("no engine_name provided, using ECORE_EVAS_ENGINE='%s'",
803 return _ecore_evas_new_auto_discover(x, y, w, h, extra_options);
805 for (itr = _engines; itr->name; itr++)
806 if (strcmp(itr->name, engine_name) == 0)
808 INF("using engine '%s', extra_options=%s",
809 engine_name, extra_options ? extra_options : "(null)");
810 return itr->constructor(x, y, w, h, extra_options);
813 WRN("unknown engine '%s'", engine_name);
818 * Get the engine name used by this engine.
820 * should return one of the values in ecore_evas_engines_get(), usually
821 * acceptable by ecore_evas_new().
824 ecore_evas_engine_name_get(const Ecore_Evas *ee)
832 * Return the Ecore_Evas for this Evas
834 * @param e The Evas to get the Ecore_Evas from
835 * @return The Ecore_Evas that holds this Evas
838 ecore_evas_ecore_evas_get(const Evas *e)
840 return evas_data_attach_get(e);
845 * @param ee The Ecore_Evas to free
847 * This frees up any memory used by the Ecore_Evas.
850 ecore_evas_free(Ecore_Evas *ee)
852 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
854 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
858 _ecore_evas_free(ee);
863 * Retrieve user data associated with an Ecore_Evas.
864 * @param ee The Ecore_Evas to retrieve the user data from.
865 * @param key The key which the user data to be retrieved is associated with.
867 * This function retrieves user specific data that has been stored within an
868 * Ecore_Evas structure with ecore_evas_data_set().
870 * @returns NULL on error or no data found, A pointer to the user data on
873 * @see ecore_evas_data_set
876 ecore_evas_data_get(const Ecore_Evas *ee, const char *key)
878 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
880 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
881 "ecore_evas_data_get");
885 if (!key) return NULL;
886 if (!ee->data) return NULL;
888 return eina_hash_find(ee->data, key);
892 * Store user data in an Ecore_Evas structure.
894 * @param ee The Ecore_Evas to store the user data in.
895 * @param key A unique string to associate the user data against. Cannot
897 * @param data A pointer to the user data to store.
899 * This function associates the @p data with a @p key which is stored by
900 * the Ecore_Evas @p ee. Be aware that a call to ecore_evas_free() will
901 * not free any memory for the associated user data, this is the responsibility
904 * @see ecore_evas_free
907 ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
909 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
911 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
912 "ecore_evas_data_set");
919 eina_hash_del(ee->data, key, NULL);
923 ee->data = eina_hash_string_superfast_new(NULL);
924 eina_hash_add(ee->data, key, data);
928 #define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
932 * Set a callback for Ecore_Evas resize events.
933 * @param ee The Ecore_Evas to set callbacks on
934 * @param func The function to call
936 * A call to this function will set a callback on an Ecore_Evas, causing
937 * @p func to be called whenever @p ee is resized.
940 ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
942 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
944 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
945 "ecore_evas_callback_resize_set");
948 IFC(ee, fn_callback_resize_set) (ee, func);
950 ee->func.fn_resize = func;
954 * Set a callback for Ecore_Evas move events.
955 * @param ee The Ecore_Evas to set callbacks on
956 * @param func The function to call
958 * A call to this function will set a callback on an Ecore_Evas, causing
959 * @p func to be called whenever @p ee is moved.
962 ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
964 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
966 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
967 "ecore_evas_callback_move_set");
970 IFC(ee, fn_callback_move_set) (ee, func);
972 ee->func.fn_move = func;
976 * Set a callback for Ecore_Evas show events.
977 * @param ee The Ecore_Evas to set callbacks on
978 * @param func The function to call
980 * A call to this function will set a callback on an Ecore_Evas, causing
981 * @p func to be called whenever @p ee is shown.
984 ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
986 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
988 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
989 "ecore_evas_callback_show_set");
992 IFC(ee, fn_callback_show_set) (ee, func);
994 ee->func.fn_show = func;
998 * Set a callback for Ecore_Evas hide events.
999 * @param ee The Ecore_Evas to set callbacks on
1000 * @param func The function to call
1002 * A call to this function will set a callback on an Ecore_Evas, causing
1003 * @p func to be called whenever @p ee is hidden.
1006 ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1008 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1010 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1011 "ecore_evas_callback_hide_set");
1014 IFC(ee, fn_callback_hide_set) (ee, func);
1016 ee->func.fn_hide = func;
1020 * Set a callback for Ecore_Evas delete request events.
1021 * @param ee The Ecore_Evas to set callbacks on
1022 * @param func The function to call
1024 * A call to this function will set a callback on an Ecore_Evas, causing
1025 * @p func to be called whenever @p ee gets a delete request.
1028 ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1030 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1032 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1033 "ecore_evas_callback_delete_request_set");
1036 IFC(ee, fn_callback_delete_request_set) (ee, func);
1038 ee->func.fn_delete_request = func;
1042 * Set a callback for Ecore_Evas destroy events.
1043 * @param ee The Ecore_Evas to set callbacks on
1044 * @param func The function to call
1046 * A call to this function will set a callback on an Ecore_Evas, causing
1047 * @p func to be called whenever @p ee is destroyed.
1050 ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1052 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1054 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1055 "ecore_evas_callback_destroy_set");
1058 IFC(ee, fn_callback_destroy_set) (ee, func);
1060 ee->func.fn_destroy = func;
1064 * Set a callback for Ecore_Evas focus in events.
1065 * @param ee The Ecore_Evas to set callbacks on
1066 * @param func The function to call
1068 * A call to this function will set a callback on an Ecore_Evas, causing
1069 * @p func to be called whenever @p ee gets focus.
1072 ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1074 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1076 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1077 "ecore_evas_callback_focus_in_set");
1080 IFC(ee, fn_callback_focus_in_set) (ee, func);
1082 ee->func.fn_focus_in = func;
1086 * Set a callback for Ecore_Evas focus out events.
1087 * @param ee The Ecore_Evas to set callbacks on
1088 * @param func The function to call
1090 * A call to this function will set a callback on an Ecore_Evas, causing
1091 * @p func to be called whenever @p ee loses focus.
1094 ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1096 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1098 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1099 "ecore_evas_callback_focus_out_set");
1102 IFC(ee, fn_callback_focus_out_set) (ee, func);
1104 ee->func.fn_focus_out = func;
1108 * Set a callback for Ecore_Evas sticky events.
1109 * @param ee The Ecore_Evas to set callbacks on
1110 * @param func The function to call
1112 * A call to this function will set a callback on an Ecore_Evas, causing
1113 * @p func to be called whenever @p ee becomes sticky.
1116 ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1118 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1120 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1121 "ecore_evas_callback_sticky_set");
1124 IFC(ee, fn_callback_sticky_set) (ee, func);
1126 ee->func.fn_sticky = func;
1130 * Set a callback for Ecore_Evas un-sticky events.
1131 * @param ee The Ecore_Evas to set callbacks on
1132 * @param func The function to call
1134 * A call to this function will set a callback on an Ecore_Evas, causing
1135 * @p func to be called whenever @p ee becomes un-sticky.
1138 ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1140 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1142 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1143 "ecore_evas_callback_unsticky_set");
1146 IFC(ee, fn_callback_unsticky_set) (ee, func);
1148 ee->func.fn_unsticky = func;
1152 * Set a callback for Ecore_Evas mouse in events.
1153 * @param ee The Ecore_Evas to set callbacks on
1154 * @param func The function to call
1156 * A call to this function will set a callback on an Ecore_Evas, causing
1157 * @p func to be called whenever the mouse enters @p ee.
1160 ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1162 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1164 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1165 "ecore_evas_callback_mouse_in_set");
1168 IFC(ee, fn_callback_mouse_in_set) (ee, func);
1170 ee->func.fn_mouse_in = func;
1174 * Set a callback for Ecore_Evas mouse out events.
1175 * @param ee The Ecore_Evas to set callbacks on
1176 * @param func The function to call
1178 * A call to this function will set a callback on an Ecore_Evas, causing
1179 * @p func to be called whenever the mouse leaves @p ee.
1182 ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1184 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1186 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1187 "ecore_evas_callback_mouse_out_set");
1190 IFC(ee, fn_callback_mouse_out_set) (ee, func);
1192 ee->func.fn_mouse_out = func;
1196 * Set a callback for Ecore_Evas mouse pre render events.
1197 * @param ee The Ecore_Evas to set callbacks on
1198 * @param func The function to call
1200 * A call to this function will set a callback on an Ecore_Evas, causing
1201 * @p func to be called just before the evas in @p ee is rendered.
1204 ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1206 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1208 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1209 "ecore_evas_callback_pre_render_set");
1212 IFC(ee, fn_callback_pre_render_set) (ee, func);
1214 ee->func.fn_pre_render = func;
1218 * Set a callback for Ecore_Evas mouse post render events.
1219 * @param ee The Ecore_Evas to set callbacks on
1220 * @param func The function to call
1222 * A call to this function will set a callback on an Ecore_Evas, causing
1223 * @p func to be called just after the evas in @p ee is rendered.
1226 ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1228 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1230 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1231 "ecore_evas_callback_post_render_set");
1234 IFC(ee, fn_callback_post_render_set) (ee, func);
1236 ee->func.fn_post_render = func;
1240 * Set a callback for Ecore_Evas pre-free event.
1241 * @param ee The Ecore_Evas to set callbacks on
1242 * @param func The function to call
1244 * A call to this function will set a callback on an Ecore_Evas, causing
1245 * @p func to be called just before the instance @p ee is freed.
1248 ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1250 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1252 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1253 "ecore_evas_callback_pre_free_set");
1256 ee->func.fn_pre_free = func;
1260 * Get an Ecore_Evas's Evas
1261 * @param ee The Ecore_Evas whose Evas you wish to get
1262 * @return The Evas wrapped by @p ee
1264 * This function returns the Evas contained within @p ee.
1267 ecore_evas_get(const Ecore_Evas *ee)
1269 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1271 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1279 * Move an Ecore_Evas
1280 * @param ee The Ecore_Evas to move
1281 * @param x The x coordinate to move to
1282 * @param y The y coordinate to move to
1284 * This moves @p ee to the screen coordinates (@p x, @p y)
1287 ecore_evas_move(Ecore_Evas *ee, int x, int y)
1289 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1291 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1295 if (ee->prop.fullscreen) return;
1296 IFC(ee, fn_move) (ee, x, y);
1301 * Provide Managed move co-ordinates for an Ecore_Evas
1302 * @param ee The Ecore_Evas to move
1303 * @param x The x coordinate to set as the managed location
1304 * @param y The y coordinate to set as the managed location
1306 * This sets the managed geometry position of the @p ee to (@p x, @p y)
1309 ecore_evas_managed_move(Ecore_Evas *ee, int x, int y)
1311 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1313 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1317 IFC(ee, fn_managed_move) (ee, x, y);
1322 * Resize an Ecore_Evas
1323 * @param ee The Ecore_Evas to move
1324 * @param w The w coordinate to resize to
1325 * @param h The h coordinate to resize to
1327 * This resizes @p ee to @p w x @p h
1330 ecore_evas_resize(Ecore_Evas *ee, int w, int h)
1332 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1334 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1335 "ecore_evas_resize");
1338 if (ee->prop.fullscreen) return;
1341 if ((ee->rotation == 90) || (ee->rotation == 270))
1343 IFC(ee, fn_resize) (ee, h, w);
1348 IFC(ee, fn_resize) (ee, w, h);
1354 * Resize an Ecore_Evas
1355 * @param ee The Ecore_Evas to move
1356 * @param x The x coordinate to move to
1357 * @param y The y coordinate to move to
1358 * @param w The w coordinate to resize to
1359 * @param h The h coordinate to resize to
1361 * This moves @p ee to the screen coordinates (@p x, @p y) and resizes
1362 * it to @p w x @p h.
1366 ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
1368 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1370 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1371 "ecore_evas_move_resize");
1374 if (ee->prop.fullscreen) return;
1377 if ((ee->rotation == 90) || (ee->rotation == 270))
1379 IFC(ee, fn_move_resize) (ee, x, y, h, w);
1384 IFC(ee, fn_move_resize) (ee, x, y, w, h);
1390 * Get the geometry of an Ecore_Evas
1391 * @param ee The Ecore_Evas whose geometry y
1392 * @param x A pointer to an int to place the x coordinate in
1393 * @param y A pointer to an int to place the y coordinate in
1394 * @param w A pointer to an int to place the w size in
1395 * @param h A pointer to an int to place the h size in
1397 * This function takes four pointers to (already allocated) ints, and places
1398 * the geometry of @p ee in them.
1402 * ecore_evas_geometry_get(ee, &x, &y, &w, &h);
1407 ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1409 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1411 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1412 "ecore_evas_geometry_get");
1415 if ((ee->rotation == 90) || (ee->rotation == 270))
1432 * Set the rotation of an Ecore_Evas' window
1434 * @param ee The Ecore_Evas
1435 * @param rot the angle (in degrees) of rotation.
1437 * The allowed values of @p rot depend on the engine being used. Most only
1438 * allow multiples of 90.
1441 ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
1443 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1445 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1446 "ecore_evas_rotation_set");
1450 while (rot < 0) rot += 360;
1451 while (rot >= 360) rot -= 360;
1452 IFC(ee, fn_rotation_set) (ee, rot, 0);
1453 /* make sure everything gets redrawn */
1454 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1455 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1460 * Set the rotation of an Ecore_Evas' window
1462 * @param ee The Ecore_Evas
1463 * @param rot the angle (in degrees) of rotation.
1465 * The allowed values of @p rot depend on the engine being used. Most only
1466 * allow multiples of 90.
1469 ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
1471 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1473 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1474 "ecore_evas_rotation_set");
1478 while (rot < 0) rot += 360;
1479 while (rot >= 360) rot -= 360;
1480 IFC(ee, fn_rotation_set) (ee, rot, 1);
1481 /* make sure everything gets redrawn */
1482 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1483 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1488 * Set the rotation of an Ecore_Evas' window
1490 * @param ee The Ecore_Evas
1491 * @return the angle (in degrees) of rotation.
1495 ecore_evas_rotation_get(const Ecore_Evas *ee)
1497 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1499 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1500 "ecore_evas_rotation_get");
1503 return ee->rotation;
1507 * Set whether an Ecore_Evas is shaped or not.
1508 * @param ee The Ecore_Evas to shape
1509 * @param shaped EINA_TRUE to shape, EINA_FALSE to not
1511 * This function allows one to make an Ecore_Evas shaped to the contents of the
1512 * evas. If @p shaped is EINA_TRUE, @p ee will be transparent in parts of the evas that
1513 * contain no objects. If @p shaped is EINA_FALSE, then @p ee will be rectangular, and
1514 * and parts with no data will show random framebuffer artifacting. For
1515 * non-shaped Ecore_Evases, it is recommend to cover the entire evas with a
1516 * background object.
1519 ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped)
1521 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1523 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1524 "ecore_evas_shaped_set");
1527 IFC(ee, fn_shaped_set) (ee, shaped);
1532 * Query whether an Ecore_Evas is shaped or not.
1533 * @param ee The Ecore_Evas to query.
1534 * @return EINA_TRUE if shaped, EINA_FALSE if not.
1536 * This function returns EINA_TRUE if @p ee is shaped, and EINA_FALSE if not.
1539 ecore_evas_shaped_get(const Ecore_Evas *ee)
1541 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1543 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1544 "ecore_evas_shaped_get");
1547 return ee->shaped ? EINA_TRUE : EINA_FALSE;
1551 * Set whether an Ecore_Evas has an alpha channel or not.
1552 * @param ee The Ecore_Evas to shape
1553 * @param alpha EINA_TRUE to enable the alpha channel, EINA_FALSE to disable it
1555 * This function allows you to make an Ecore_Evas translucent using an
1556 * alpha channel. See ecore_evas_shaped_set() for details. The difference
1557 * between a shaped window and a window with an alpha channel is that an
1558 * alpha channel supports multiple levels of transpararency, as opposed to
1559 * the 1 bit transparency of a shaped window (a pixel is either opaque, or
1560 * it's transparent).
1563 ecore_evas_alpha_set(Ecore_Evas *ee, Eina_Bool alpha)
1565 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1567 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1568 "ecore_evas_alpha_set");
1571 IFC(ee, fn_alpha_set) (ee, alpha);
1576 * Query whether an Ecore_Evas has an alpha channel.
1577 * @param ee The Ecore_Evas to query.
1578 * @return EINA_TRUE if ee has an alpha channel, EINA_FALSE if it does not.
1580 * This function returns EINA_TRUE if @p ee has an alpha channel, and EINA_FALSE if
1584 ecore_evas_alpha_get(const Ecore_Evas *ee)
1586 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1588 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1589 "ecore_evas_alpha_get");
1592 return ee->alpha ? EINA_TRUE : EINA_FALSE;
1596 * Set whether an Ecore_Evas has an transparent window or not.
1597 * @param ee The Ecore_Evas to shape
1598 * @param transparent EINA_TRUE to enable the transparent window, EINA_FALSE to disable it
1600 * This function allows you to make an Ecore_Evas translucent using an
1601 * alpha channel. See ecore_evas_shaped_set() for details. The difference
1602 * between a shaped window and a window with an alpha channel is that an
1603 * alpha channel supports multiple levels of transpararency, as opposed to
1604 * the 1 bit transparency of a shaped window (a pixel is either opaque, or
1605 * it's transparent).
1608 ecore_evas_transparent_set(Ecore_Evas *ee, Eina_Bool transparent)
1610 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1612 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1613 "ecore_evas_transparent_set");
1616 IFC(ee, fn_transparent_set) (ee, transparent);
1621 * Query whether an Ecore_Evas has an alpha channel.
1622 * @param ee The Ecore_Evas to query.
1623 * @return EINA_TRUE if ee has an alpha channel, EINA_FALSE if it does not.
1625 * This function returns EINA_TRUE if @p ee has an alpha channel, and EINA_FALSE if
1629 ecore_evas_transparent_get(const Ecore_Evas *ee)
1631 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1633 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1634 "ecore_evas_transparent_get");
1637 return ee->transparent ? EINA_TRUE : 0;
1641 * Show an Ecore_Evas' window
1642 * @param ee The Ecore_Evas to show.
1644 * This function makes @p ee visible.
1647 ecore_evas_show(Ecore_Evas *ee)
1649 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1651 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1655 IFC(ee, fn_show) (ee);
1660 * Hide an Ecore_Evas' window
1661 * @param ee The Ecore_Evas to show.
1663 * This function makes @p ee hidden.
1666 ecore_evas_hide(Ecore_Evas *ee)
1668 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1670 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1674 IFC(ee, fn_hide) (ee);
1679 * Query whether an Ecore_Evas' window is visible or not.
1680 * @param ee The Ecore_Evas to query.
1681 * @return 1 if visible, 0 if not.
1683 * This function queries @p ee and returns 1 if it is visible, and 0 if not.
1686 ecore_evas_visibility_get(const Ecore_Evas *ee)
1688 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1690 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1691 "ecore_evas_visibility_get");
1694 return ee->visible ? 1:0;
1698 * Raise and Ecore_Evas' window.
1699 * @param ee The Ecore_Evas to raise.
1701 * This functions raises the Ecore_Evas to the front.
1704 ecore_evas_raise(Ecore_Evas *ee)
1706 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1708 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1709 "ecore_evas_raise");
1712 IFC(ee, fn_raise) (ee);
1717 * Lower an Ecore_Evas' window.
1718 * @param ee The Ecore_Evas to raise.
1720 * This functions lowers the Ecore_Evas to the back.
1723 ecore_evas_lower(Ecore_Evas *ee)
1725 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1727 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1728 "ecore_evas_lower");
1731 IFC(ee, fn_lower) (ee);
1736 * Activate (set focus to, via the window manager) an Ecore_Evas' window.
1737 * @param ee The Ecore_Evas to activate.
1739 * This functions activates the Ecore_Evas.
1742 ecore_evas_activate(Ecore_Evas *ee)
1744 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1746 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1747 "ecore_evas_activate");
1750 IFC(ee, fn_activate) (ee);
1755 * Set the title of an Ecore_Evas' window
1756 * @param ee The Ecore_Evas whose title you wish to set.
1757 * @param t The title
1759 * This function sets the title of @p ee to @p t.
1762 ecore_evas_title_set(Ecore_Evas *ee, const char *t)
1764 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1766 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1767 "ecore_evas_title_set");
1770 IFC(ee, fn_title_set) (ee, t);
1775 * Get the title of an Ecore_Evas' window
1776 * @param ee The Ecore_Evas whose title you wish to get.
1777 * @return The title of @p ee.
1779 * This function returns the title of @p ee.
1782 ecore_evas_title_get(const Ecore_Evas *ee)
1784 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1786 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1787 "ecore_evas_title_get");
1790 return ee->prop.title;
1794 * Set the name and class of an Ecore_Evas' window
1795 * @param ee the Ecore_Evas
1797 * @param c the class
1799 * This function sets the name of @p ee to @p n, and its class to @p c.
1802 ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
1804 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1806 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1807 "ecore_evas_name_class_set");
1810 IFC(ee, fn_name_class_set) (ee, n, c);
1815 * Get the name and class of an Ecore_Evas' window
1816 * @p ee The Ecore_Evas to query
1817 * @p n A pointer to a string to place the name in.
1818 * @p c A pointer to a string to place the class in.
1820 * This function gets puts the name of @p ee into @p n, and its class into
1824 ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c)
1826 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1828 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1829 "ecore_evas_name_class_get");
1832 if (n) *n = ee->prop.name;
1833 if (c) *c = ee->prop.clas;
1837 * Set the min size of an Ecore_Evas' window
1838 * @param ee The Ecore_Evas to set
1839 * @param w The minimum width
1840 * @param h The minimum height
1842 * This function sets the minimum size of @p ee to @p w x @p h.
1845 ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
1847 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1849 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1850 "ecore_evas_size_min_set");
1855 if ((ee->rotation == 90) || (ee->rotation == 270))
1857 IFC(ee, fn_size_min_set) (ee, h, w);
1862 IFC(ee, fn_size_min_set) (ee, w, h);
1868 * Get the min size of an Ecore_Evas' window
1869 * @param ee The Ecore_Evas to set
1870 * @param w A pointer to an int to place the min width in.
1871 * @param h A pointer to an int to place the min height in.
1873 * This function puts the minimum size of @p ee into @p w and @p h.
1876 ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h)
1878 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1880 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1881 "ecore_evas_size_min_get");
1884 if ((ee->rotation == 90) || (ee->rotation == 270))
1886 if (w) *w = ee->prop.min.h;
1887 if (h) *h = ee->prop.min.w;
1891 if (w) *w = ee->prop.min.w;
1892 if (h) *h = ee->prop.min.h;
1897 * Set the max size of an Ecore_Evas' window
1898 * @param ee The Ecore_Evas to set
1899 * @param w The maximum width
1900 * @param h The maximum height
1902 * This function sets the maximum size of @p ee to @p w x @p h.
1905 ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h)
1907 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1909 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1910 "ecore_evas_size_max_set");
1915 if ((ee->rotation == 90) || (ee->rotation == 270))
1917 IFC(ee, fn_size_max_set) (ee, h, w);
1922 IFC(ee, fn_size_max_set) (ee, w, h);
1928 * Get the max size of an Ecore_Evas' window
1929 * @param ee The Ecore_Evas to set
1930 * @param w A pointer to an int to place the max width in.
1931 * @param h A pointer to an int to place the max height in.
1933 * This function puts the maximum size of @p ee into @p w and @p h.
1936 ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h)
1938 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1940 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1941 "ecore_evas_size_max_get");
1944 if ((ee->rotation == 90) || (ee->rotation == 270))
1946 if (w) *w = ee->prop.max.h;
1947 if (h) *h = ee->prop.max.w;
1951 if (w) *w = ee->prop.max.w;
1952 if (h) *h = ee->prop.max.h;
1957 * Set the base size of an Ecore_Evas' window
1958 * @param ee The Ecore_Evas to set
1959 * @param w The base width
1960 * @param h The base height
1962 * This function sets the base size of @p ee to @p w x @p h.
1965 ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h)
1967 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1969 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1970 "ecore_evas_size_base_set");
1975 if ((ee->rotation == 90) || (ee->rotation == 270))
1977 IFC(ee, fn_size_base_set) (ee, h, w);
1982 IFC(ee, fn_size_base_set) (ee, w, h);
1988 * Get the base size of an Ecore_Evas' window
1989 * @param ee The Ecore_Evas to set
1990 * @param w A pointer to an int to place the base width in.
1991 * @param h A pointer to an int to place the base height in.
1993 * This function puts the base size of @p ee into @p w and @p h.
1996 ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h)
1998 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2000 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2001 "ecore_evas_size_base_get");
2004 if ((ee->rotation == 90) || (ee->rotation == 270))
2006 if (w) *w = ee->prop.base.h;
2007 if (h) *h = ee->prop.base.w;
2011 if (w) *w = ee->prop.base.w;
2012 if (h) *h = ee->prop.base.h;
2017 * Set the step size of an Ecore_Evas
2018 * @param ee The Ecore_Evas to set
2019 * @param w The step width
2020 * @param h The step height
2022 * This function sets the step size of @p ee to @p w x @p h. This limits the
2023 * size of an Ecore_Evas to always being an integer multiple of the step size.
2026 ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
2028 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2030 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2031 "ecore_evas_size_step_set");
2036 if ((ee->rotation == 90) || (ee->rotation == 270))
2038 IFC(ee, fn_size_step_set) (ee, h, w);
2043 IFC(ee, fn_size_step_set) (ee, w, h);
2049 * Get the step size of an Ecore_Evas' window
2050 * @param ee The Ecore_Evas to set
2051 * @param w A pointer to an int to place the step width in.
2052 * @param h A pointer to an int to place the step height in.
2054 * This function puts the step size of @p ee into @p w and @p h.
2057 ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h)
2059 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2061 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2062 "ecore_evas_size_step_get");
2065 if ((ee->rotation == 90) || (ee->rotation == 270))
2067 if (w) *w = ee->prop.step.h;
2068 if (h) *h = ee->prop.step.w;
2072 if (w) *w = ee->prop.step.w;
2073 if (h) *h = ee->prop.step.h;
2078 * Set the cursor of an Ecore_Evas
2079 * @param ee The Ecore_Evas
2080 * @param file The path to an image file for the cursor
2082 * @param hot_x The x coordinate of the cursor's hot spot
2083 * @param hot_y The y coordinate of the cursor's hot spot
2085 * This function makes the mouse cursor over @p ee be the image specified by
2086 * @p file. The actual point within the image that the mouse is at is specified
2087 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
2088 * corner of the cursor image.
2091 ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y)
2093 Evas_Object *obj = NULL;
2095 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2097 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2098 "ecore_evas_cursor_set");
2106 obj = evas_object_image_add(ee->evas);
2107 evas_object_image_file_set(obj, file, NULL);
2108 evas_object_image_size_get(obj, &x, &y);
2109 evas_object_resize(obj, x, y);
2110 evas_object_image_fill_set(obj, 0, 0, x, y);
2113 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
2118 * Set the cursor of an Ecore_Evas
2119 * @param ee The Ecore_Evas
2120 * @param obj The Evas_Object for the cursor
2122 * @param hot_x The x coordinate of the cursor's hot spot
2123 * @param hot_y The y coordinate of the cursor's hot spot
2125 * This function makes the mouse cursor over @p ee be the image specified by
2126 * @p file. The actual point within the image that the mouse is at is specified
2127 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
2128 * corner of the cursor image.
2131 ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
2133 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2135 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2136 "ecore_evas_cursor_set");
2139 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
2144 * Get information about an Ecore_Evas' cursor
2145 * @param ee The Ecore_Evas to set
2146 * @param obj A pointer to an Evas_Object to place the cursor Evas_Object.
2147 * @param layer A pointer to an int to place the cursor's layer in..
2148 * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in.
2149 * @param hot_y A pointer to an int to place the cursor's hot_y coordinate in.
2151 * This function queries information about an Ecore_Evas' cursor.
2154 ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y)
2156 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2158 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2159 "ecore_evas_cursor_get");
2162 if (obj) *obj = ee->prop.cursor.object;
2163 if (layer) *layer = ee->prop.cursor.layer;
2164 if (hot_x) *hot_x = ee->prop.cursor.hot.x;
2165 if (hot_y) *hot_y = ee->prop.cursor.hot.y;
2169 * Set the layer of an Ecore_Evas' window
2170 * @param ee The Ecore_Evas
2171 * @param layer The layer to put @p ee on.
2173 * This function moves @p ee to the layer @p layer.
2176 ecore_evas_layer_set(Ecore_Evas *ee, int layer)
2178 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2180 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2181 "ecore_evas_layer_set");
2184 IFC(ee, fn_layer_set) (ee, layer);
2189 * Get the layer of an Ecore_Evas' window
2190 * @param ee The Ecore_Evas to set
2191 * @return the layer @p ee's window is on.
2195 ecore_evas_layer_get(const Ecore_Evas *ee)
2197 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2199 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2200 "ecore_evas_layer_get");
2203 return ee->prop.layer;
2207 * Set the focus of an Ecore_Evas' window
2208 * @param ee The Ecore_Evas
2209 * @param on EINA_TRUE for focus, EINA_FALSE to defocus.
2211 * This function focuses @p ee if @p on is EINA_TRUE, or defocuses @p ee if @p on is EINA_FALSE.
2214 ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on)
2216 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2218 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2219 "ecore_evas_focus_set");
2222 IFC(ee, fn_focus_set) (ee, on);
2227 * Query whether an Ecore_Evas' window is focused or not
2228 * @param ee The Ecore_Evas to set
2229 * @return EINA_TRUE if @p ee if focused, EINA_FALSE if not.
2233 ecore_evas_focus_get(const Ecore_Evas *ee)
2235 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2237 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2238 "ecore_evas_focus_get");
2241 return ee->prop.focused ? EINA_TRUE : EINA_FALSE;
2245 * Iconify or uniconify an Ecore_Evas' window
2246 * @param ee The Ecore_Evas
2247 * @param on EINA_TRUE to iconify, EINA_FALSE to uniconify.
2249 * This function iconifies @p ee if @p on is EINA_TRUE, or uniconifies @p ee if @p on
2253 ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
2255 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2257 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2258 "ecore_evas_iconified_set");
2261 IFC(ee, fn_iconified_set) (ee, on);
2266 * Query whether an Ecore_Evas' window is iconified or not
2267 * @param ee The Ecore_Evas to set
2268 * @return EINA_TRUE if @p ee is iconified, EINA_FALSE if not.
2272 ecore_evas_iconified_get(const Ecore_Evas *ee)
2274 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2276 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2277 "ecore_evas_iconified_get");
2280 return ee->prop.iconified ? EINA_TRUE : EINA_FALSE;
2284 * Set whether an Ecore_Evas' window is borderless or not
2285 * @param ee The Ecore_Evas
2286 * @param on EINA_TRUE for borderless, EINA_FALSE for bordered.
2288 * This function makes @p ee borderless if @p on is EINA_TRUE, or bordered if @p on
2292 ecore_evas_borderless_set(Ecore_Evas *ee, Eina_Bool on)
2294 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2296 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2297 "ecore_evas_borderless_set");
2300 IFC(ee, fn_borderless_set) (ee, on);
2305 * Query whether an Ecore_Evas' window is borderless or not
2306 * @param ee The Ecore_Evas to set
2307 * @return EINA_TRUE if @p ee is borderless, EINA_FALSE if not.
2311 ecore_evas_borderless_get(const Ecore_Evas *ee)
2313 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2315 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2316 "ecore_evas_borderless_get");
2319 return ee->prop.borderless ? EINA_TRUE : EINA_FALSE;
2323 * Tell the WM whether or not to ignore an Ecore_Evas' window
2324 * @param ee The Ecore_Evas
2325 * @param on EINA_TRUE to ignore, EINA_FALSE to not.
2327 * This function causes the window manager to ignore @p ee if @p on is EINA_TRUE,
2328 * or not ignore @p ee if @p on is EINA_FALSE.
2331 ecore_evas_override_set(Ecore_Evas *ee, Eina_Bool on)
2333 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2335 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2336 "ecore_evas_override_set");
2339 IFC(ee, fn_override_set) (ee, on);
2344 * Query whether an Ecore_Evas' window is overridden or not
2345 * @param ee The Ecore_Evas to set
2346 * @return EINA_TRUE if @p ee is overridden, EINA_FALSE if not.
2350 ecore_evas_override_get(const Ecore_Evas *ee)
2352 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2354 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2355 "ecore_evas_override_get");
2358 return ee->prop.override ? EINA_TRUE : EINA_FALSE;
2362 * Maximize (or unmaximize) an Ecore_Evas' window
2363 * @param ee The Ecore_Evas
2364 * @param on EINA_TRUE to maximize, EINA_FALSE to unmaximize.
2366 * This function maximizes @p ee if @p on is EINA_TRUE, or unmaximizes @p ee
2367 * if @p on is EINA_FALSE.
2370 ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on)
2372 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2374 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2375 "ecore_evas_maximized_set");
2378 IFC(ee, fn_maximized_set) (ee, on);
2383 * Query whether an Ecore_Evas' window is maximized or not
2384 * @param ee The Ecore_Evas to set
2385 * @return EINA_TRUE if @p ee is maximized, EINA_FALSE if not.
2389 ecore_evas_maximized_get(const Ecore_Evas *ee)
2391 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2393 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2394 "ecore_evas_maximized_get");
2397 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
2401 * Set whether or not an Ecore_Evas' window is fullscreen
2402 * @param ee The Ecore_Evas
2403 * @param on EINA_TRUE fullscreen, EINA_FALSE not.
2405 * This function causes @p ee to be fullscreen if @p on is EINA_TRUE,
2406 * or not if @p on is EINA_FALSE.
2409 ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
2411 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2413 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2414 "ecore_evas_fullscreen_set");
2417 IFC(ee, fn_fullscreen_set) (ee, on);
2422 * Query whether an Ecore_Evas' window is fullscreen or not
2423 * @param ee The Ecore_Evas to set
2424 * @return EINA_TRUE if @p ee is fullscreen, EINA_FALSE if not.
2428 ecore_evas_fullscreen_get(const Ecore_Evas *ee)
2430 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2432 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2433 "ecore_evas_fullscreen_get");
2436 return ee->prop.fullscreen ? EINA_TRUE : EINA_FALSE;
2440 * Set whether or not an Ecore_Evas' window should avoid damage
2442 * @param ee The Ecore_Evas
2443 * @param The type of the damage management
2445 * This function causes @p ee to be drawn to a pixmap to avoid recalculations.
2446 * On expose events it will copy from the pixmap to the window.
2449 ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
2451 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2453 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2454 "ecore_evas_avoid_damage_set");
2457 IFC(ee, fn_avoid_damage_set) (ee, on);
2462 * Query whether an Ecore_Evas' window avoids damage or not
2463 * @param ee The Ecore_Evas to set
2464 * @return The type of the damage management
2467 EAPI Ecore_Evas_Avoid_Damage_Type
2468 ecore_evas_avoid_damage_get(const Ecore_Evas *ee)
2470 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2472 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2473 "ecore_evas_avoid_damage_get");
2474 return ECORE_EVAS_AVOID_DAMAGE_NONE;
2476 return ee->prop.avoid_damage;
2480 * Set the withdrawn state of an Ecore_Evas' window.
2481 * @param ee The Ecore_Evas whose window's withdrawn state is set.
2482 * @param withdrawn The Ecore_Evas window's new withdrawn state.
2486 ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool withdrawn)
2488 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2490 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2491 "ecore_evas_withdrawn_set");
2495 IFC(ee, fn_withdrawn_set) (ee, withdrawn);
2500 * Returns the withdrawn state of an Ecore_Evas' window.
2501 * @param ee The Ecore_Evas whose window's withdrawn state is returned.
2502 * @return The Ecore_Evas window's withdrawn state.
2506 ecore_evas_withdrawn_get(const Ecore_Evas *ee)
2508 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2510 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2511 "ecore_evas_withdrawn_get");
2514 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE;
2518 * Set the sticky state of an Ecore_Evas window.
2520 * @param ee The Ecore_Evas whose window's sticky state is set.
2521 * @param sticky The Ecore_Evas window's new sticky state.
2525 ecore_evas_sticky_set(Ecore_Evas *ee, Eina_Bool sticky)
2527 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2529 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2530 "ecore_evas_sticky_set");
2534 IFC(ee, fn_sticky_set) (ee, sticky);
2539 * Returns the sticky state of an Ecore_Evas' window.
2541 * @param ee The Ecore_Evas whose window's sticky state is returned.
2542 * @return The Ecore_Evas window's sticky state.
2546 ecore_evas_sticky_get(const Ecore_Evas *ee)
2548 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2550 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2551 "ecore_evas_sticky_get");
2554 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
2558 * Set if this evas should ignore events
2560 * @param ee The Ecore_Evas whose window's to ignore events.
2561 * @param ignore The Ecore_Evas new ignore state.
2565 ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
2567 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2569 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2570 "ecore_evas_ignore_events_set");
2574 IFC(ee, fn_ignore_events_set) (ee, ignore);
2579 * Returns the ignore state of an Ecore_Evas' window.
2581 * @param ee The Ecore_Evas whose window's ignore events state is returned.
2582 * @return The Ecore_Evas window's ignore state.
2586 ecore_evas_ignore_events_get(const Ecore_Evas *ee)
2588 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2590 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2591 "ecore_evas_ignore_events_get");
2594 return ee->ignore_events ? EINA_TRUE : EINA_FALSE;
2598 ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool manual_render)
2600 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2602 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2603 "ecore_evas_manual_render_set");
2606 ee->manual_render = manual_render;
2610 ecore_evas_manual_render_get(const Ecore_Evas *ee)
2612 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2614 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2615 "ecore_evas_manual_render_get");
2618 return ee->manual_render ? EINA_TRUE : EINA_FALSE;
2622 ecore_evas_manual_render(Ecore_Evas *ee)
2624 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2626 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2627 "ecore_evas_manual_render");
2630 if (ee->engine.func->fn_render)
2631 ee->engine.func->fn_render(ee);
2635 ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync)
2637 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2639 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2640 "ecore_evas_comp_sync_set");
2643 ee->no_comp_sync = !do_sync;
2647 ecore_evas_comp_sync_get(const Ecore_Evas *ee)
2649 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2651 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2652 "ecore_evas_comp_sync_get");
2655 return !ee->no_comp_sync;
2659 ecore_evas_window_get(const Ecore_Evas *ee)
2661 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2663 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2664 "ecore_evas_window_get");
2668 return ee->prop.window;
2671 /* fps debug calls - for debugging how much time your app actually spends */
2672 /* rendering graphics... :) */
2674 static int _ecore_evas_fps_debug_init_count = 0;
2675 static int _ecore_evas_fps_debug_fd = -1;
2676 unsigned int *_ecore_evas_fps_rendertime_mmap = NULL;
2679 _ecore_evas_fps_debug_init(void)
2683 _ecore_evas_fps_debug_init_count++;
2684 if (_ecore_evas_fps_debug_init_count > 1) return;
2685 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2686 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2687 if (_ecore_evas_fps_debug_fd < 0)
2690 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2692 if (_ecore_evas_fps_debug_fd >= 0)
2694 unsigned int zero = 0;
2695 char *buf = (char *)&zero;
2696 ssize_t todo = sizeof(unsigned int);
2700 ssize_t r = write(_ecore_evas_fps_debug_fd, buf, todo);
2706 else if ((r < 0) && (errno == EINTR))
2710 ERR("could not write to file '%s' fd %d: %s",
2711 buf, _ecore_evas_fps_debug_fd, strerror(errno));
2712 close(_ecore_evas_fps_debug_fd);
2713 _ecore_evas_fps_debug_fd = -1;
2717 _ecore_evas_fps_rendertime_mmap = mmap(NULL, sizeof(unsigned int),
2718 PROT_READ | PROT_WRITE,
2720 _ecore_evas_fps_debug_fd, 0);
2721 if (_ecore_evas_fps_rendertime_mmap == MAP_FAILED)
2722 _ecore_evas_fps_rendertime_mmap = NULL;
2727 _ecore_evas_fps_debug_shutdown(void)
2729 _ecore_evas_fps_debug_init_count--;
2730 if (_ecore_evas_fps_debug_init_count > 0) return;
2731 if (_ecore_evas_fps_debug_fd >= 0)
2735 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2737 if (_ecore_evas_fps_rendertime_mmap)
2739 munmap(_ecore_evas_fps_rendertime_mmap, sizeof(int));
2740 _ecore_evas_fps_rendertime_mmap = NULL;
2742 close(_ecore_evas_fps_debug_fd);
2743 _ecore_evas_fps_debug_fd = -1;
2748 _ecore_evas_fps_debug_rendertime_add(double t)
2750 static double rtime = 0.0;
2751 static double rlapse = 0.0;
2752 static int frames = 0;
2753 static int flapse = 0;
2756 tim = ecore_time_get();
2764 else if ((tim - rlapse) >= 0.5)
2766 printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
2768 (frames - flapse) / (tim - rlapse),
2769 (100.0 * rtime) / (tim - rlapse)
2778 _ecore_evas_register(Ecore_Evas *ee)
2781 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
2782 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2786 _ecore_evas_free(Ecore_Evas *ee)
2788 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
2789 while (ee->sub_ecore_evas)
2791 _ecore_evas_free(ee->sub_ecore_evas->data);
2793 if (ee->data) eina_hash_free(ee->data);
2795 if (ee->name) free(ee->name);
2797 if (ee->prop.title) free(ee->prop.title);
2798 ee->prop.title = NULL;
2799 if (ee->prop.name) free(ee->prop.name);
2800 ee->prop.name = NULL;
2801 if (ee->prop.clas) free(ee->prop.clas);
2802 ee->prop.clas = NULL;
2803 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2804 ee->prop.cursor.object = NULL;
2805 if (ee->evas) evas_free(ee->evas);
2807 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
2809 if (ee->engine.idle_flush_timer)
2810 ecore_timer_del(ee->engine.idle_flush_timer);
2811 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
2814 ecore_evases = (Ecore_Evas *)eina_inlist_remove
2815 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2821 _ecore_evas_cb_idle_flush(void *data)
2825 ee = (Ecore_Evas *)data;
2826 evas_render_idle_flush(ee->evas);
2827 ee->engine.idle_flush_timer = NULL;
2828 return ECORE_CALLBACK_CANCEL;
2832 _ecore_evas_async_events_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
2834 evas_async_events_process();
2836 return ECORE_CALLBACK_RENEW;
2840 _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2842 if (ee->engine.idle_flush_timer)
2843 ecore_timer_del(ee->engine.idle_flush_timer);
2844 ee->engine.idle_flush_timer = ecore_timer_add(IDLE_FLUSH_TIME,
2845 _ecore_evas_cb_idle_flush,
2850 _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2854 if (ee->prop.cursor.object)
2856 evas_object_show(ee->prop.cursor.object);
2857 if (ee->rotation == 0)
2858 evas_object_move(ee->prop.cursor.object,
2859 x - ee->prop.cursor.hot.x,
2860 y - ee->prop.cursor.hot.y);
2861 else if (ee->rotation == 90)
2862 evas_object_move(ee->prop.cursor.object,
2863 ee->h - y - 1 - ee->prop.cursor.hot.x,
2864 x - ee->prop.cursor.hot.y);
2865 else if (ee->rotation == 180)
2866 evas_object_move(ee->prop.cursor.object,
2867 ee->w - x - 1 - ee->prop.cursor.hot.x,
2868 ee->h - y - 1 - ee->prop.cursor.hot.y);
2869 else if (ee->rotation == 270)
2870 evas_object_move(ee->prop.cursor.object,
2871 y - ee->prop.cursor.hot.x,
2872 ee->w - x - 1 - ee->prop.cursor.hot.y);
2874 if (ee->rotation == 0)
2875 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2876 else if (ee->rotation == 90)
2877 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
2878 else if (ee->rotation == 180)
2879 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
2880 else if (ee->rotation == 270)
2881 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
2885 * Get a list of all the ecore_evases.
2887 * The returned list of ecore evases is only valid until the canvases are
2888 * destroyed (and should not be cached for instance).
2889 * The list can be free by just deleting the list.
2891 * @return A list of ecore_evases.
2894 ecore_evas_ecore_evas_list_get(void){
2896 Eina_List *l = NULL;
2898 EINA_INLIST_FOREACH(ecore_evases, ee)
2900 l = eina_list_append(l, ee);