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 particualr 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("Ecore_Evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
215 if(_ecore_evas_log_dom < 0)
217 EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
221 fd = evas_async_events_fd_get();
223 _ecore_evas_async_events_fd = ecore_main_fd_handler_add(fd,
225 _ecore_evas_async_events_fd_handler, NULL,
228 ecore_evas_idle_enterer =
229 ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
230 if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
231 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
233 return _ecore_evas_init_count;
240 return --_ecore_evas_init_count;
244 * Shut down the Evas system.
245 * @return 0 if ecore evas is fully shut down, or > 0 if it still needs to be shut down
247 * This closes the Evas wrapper system down. Shut down Evas and Ecore libraries.
250 ecore_evas_shutdown(void)
252 if (--_ecore_evas_init_count != 0)
253 return _ecore_evas_init_count;
255 while (ecore_evases) _ecore_evas_free(ecore_evases);
257 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
258 ecore_idle_enterer_del(ecore_evas_idle_enterer);
259 ecore_evas_idle_enterer = NULL;
261 #ifdef BUILD_ECORE_EVAS_X11
262 while (_ecore_evas_x_shutdown());
264 #ifdef BUILD_ECORE_EVAS_WIN32
265 while (_ecore_evas_win32_shutdown());
267 #ifdef BUILD_ECORE_EVAS_FB
268 while (_ecore_evas_fb_shutdown());
270 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
271 while (_ecore_evas_buffer_shutdown());
273 #ifdef BUILD_ECORE_EVAS_DIRECTFB
274 while (_ecore_evas_directfb_shutdown());
276 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
277 while (_ecore_evas_wince_shutdown());
279 if (_ecore_evas_async_events_fd)
280 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
282 eina_log_domain_unregister(_ecore_evas_log_dom);
283 _ecore_evas_log_dom = -1;
287 return _ecore_evas_init_count;
290 int _ecore_evas_app_comp_sync = 1;
293 ecore_evas_app_comp_sync_set(int do_sync)
295 _ecore_evas_app_comp_sync = do_sync;
299 ecore_evas_app_comp_sync_get(void)
301 return _ecore_evas_app_comp_sync;
304 struct ecore_evas_engine {
306 Ecore_Evas *(*constructor)(int x, int y, int w, int h, const char *extra_options);
309 /* inline is just to avoid need to ifdef around it */
310 static inline const char *
311 _ecore_evas_parse_extra_options_str(const char *extra_options, const char *key, char **value)
313 int len = strlen(key);
315 while (extra_options)
319 if (strncmp(extra_options, key, len) != 0)
321 extra_options = strchr(extra_options, ';');
327 extra_options += len;
328 p = strchr(extra_options, ';');
331 len = p - extra_options;
332 *value = malloc(len + 1);
333 memcpy(*value, extra_options, len);
334 (*value)[len] = '\0';
335 extra_options = p + 1;
339 *value = strdup(extra_options);
340 extra_options = NULL;
343 return extra_options;
346 /* inline is just to avoid need to ifdef around it */
347 static inline const char *
348 _ecore_evas_parse_extra_options_uint(const char *extra_options, const char *key, unsigned int *value)
350 int len = strlen(key);
352 while (extra_options)
356 if (strncmp(extra_options, key, len) != 0)
358 extra_options = strchr(extra_options, ';');
364 extra_options += len;
365 *value = strtol(extra_options, NULL, 0);
367 p = strchr(extra_options, ';');
369 extra_options = p + 1;
371 extra_options = NULL;
373 return extra_options;
376 /* inline is just to avoid need to ifdef around it */
377 static inline const char *
378 _ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, unsigned int *parent)
380 _ecore_evas_parse_extra_options_str(extra_options, "display=", disp_name);
381 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", parent);
382 return extra_options;
385 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
387 _ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
389 unsigned int parent = 0;
390 char *disp_name = NULL;
393 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
394 ee = ecore_evas_software_x11_new(disp_name, parent, x, y, w, h);
401 #ifdef BUILD_ECORE_EVAS_COCOA
403 _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
408 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
409 ee = ecore_evas_cocoa_new(name, w, h);
412 if (ee) ecore_evas_move(ee, x, y);
417 #ifdef BUILD_ECORE_EVAS_XRENDER_X11
419 _ecore_evas_constructor_xrender_x11(int x, int y, int w, int h, const char *extra_options)
421 unsigned int parent = 0;
422 char *disp_name = NULL;
425 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
426 ee = ecore_evas_xrender_x11_new(disp_name, parent, x, y, w, h);
433 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
435 _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
437 Ecore_X_Window parent = 0;
438 char *disp_name = NULL;
441 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
442 ee = ecore_evas_gl_x11_new(disp_name, parent, x, y, w, h);
449 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
451 _ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
453 Ecore_X_Window parent = 0;
454 char *disp_name = NULL;
457 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
458 ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
465 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
467 _ecore_evas_constructor_software_16_x11(int x, int y, int w, int h, const char *extra_options)
469 Ecore_X_Window parent = 0;
470 char *disp_name = NULL;
473 _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
474 ee = ecore_evas_software_x11_16_new(disp_name, parent, x, y, w, h);
481 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
483 _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
486 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
489 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
490 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
491 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
492 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
494 ee = ecore_evas_sdl_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
501 _ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
504 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
507 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
508 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
509 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
510 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
512 ee = ecore_evas_sdl16_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
519 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
521 _ecore_evas_constructor_opengl_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
524 unsigned int fullscreen = 0, noframe = 0;
527 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
528 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
529 _ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
531 ee = ecore_evas_gl_sdl_new(name, w, h, fullscreen, noframe);
538 #ifdef BUILD_ECORE_EVAS_DIRECTFB
540 _ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
543 char *disp_name = NULL;
544 unsigned int windowed = 1;
546 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
547 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
549 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
556 #ifdef BUILD_ECORE_EVAS_FB
558 _ecore_evas_constructor_fb(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
561 char *disp_name = NULL;
562 unsigned int rotation = 0;
564 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
565 _ecore_evas_parse_extra_options_uint(extra_options, "rotation=", &rotation);
567 ee = ecore_evas_fb_new(disp_name, rotation, w, h);
574 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
576 _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
578 return ecore_evas_software_gdi_new(NULL, x, y, w, h);
582 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
584 _ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
586 return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
590 #ifdef BUILD_ECORE_EVAS_DIRECT3D
592 _ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
594 return ecore_evas_direct3d_new(NULL, x, y, w, h);
598 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
600 _ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
602 return ecore_evas_gl_glew_new(NULL, x, y, w, h);
606 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
608 _ecore_evas_constructor_software_16_ddraw(int x, int y, int w, int h, const char *extra_options)
610 return ecore_evas_software_16_ddraw_new(NULL, x, y, w, h);
614 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
616 _ecore_evas_constructor_software_16_wince(int x, int y, int w, int h, const char *extra_options __UNUSED__)
618 return ecore_evas_software_wince_new(NULL, x, y, w, h);
622 _ecore_evas_constructor_software_16_wince_fb(int x, int y, int w, int h, const char *extra_options __UNUSED__)
624 return ecore_evas_software_wince_fb_new(NULL, x, y, w, h);
628 _ecore_evas_constructor_software_16_wince_gapi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
630 return ecore_evas_software_wince_gapi_new(NULL, x, y, w, h);
634 _ecore_evas_constructor_software_16_wince_gdi(int x, int y, int w, int h, const char *extra_options __UNUSED__)
636 return ecore_evas_software_wince_gdi_new(NULL, x, y, w, h);
640 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
642 _ecore_evas_constructor_buffer(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options __UNUSED__)
644 return ecore_evas_buffer_new(w, h);
648 /* note: keep sorted by priority, highest first */
649 static const struct ecore_evas_engine _engines[] = {
651 #ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
652 {"software_x11", _ecore_evas_constructor_software_x11},
654 #ifdef BUILD_ECORE_EVAS_XRENDER_X11
655 {"xrender_x11", _ecore_evas_constructor_xrender_x11},
657 #ifdef BUILD_ECORE_EVAS_OPENGL_X11
658 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
660 #ifdef BUILD_ECORE_EVAS_XRENDER_XCB
661 {"xrender_xcb", _ecore_evas_constructor_xrender_x11},
663 #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
664 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
666 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
667 {"software_16_x11", _ecore_evas_constructor_software_16_x11},
669 #ifdef BUILD_ECORE_EVAS_DIRECTFB
670 {"directfb", _ecore_evas_constructor_directfb},
672 #ifdef BUILD_ECORE_EVAS_FB
673 {"fb", _ecore_evas_constructor_fb},
677 #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
678 {"software_gdi", _ecore_evas_constructor_software_gdi},
680 #ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
681 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
683 #ifdef BUILD_ECORE_EVAS_DIRECT3D
684 {"direct3d", _ecore_evas_constructor_direct3d},
686 #ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
687 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
689 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW
690 {"software_16_ddraw", _ecore_evas_constructor_software_16_ddraw},
692 #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
693 {"software_16_wince", _ecore_evas_constructor_software_16_wince},
694 {"software_16_wince_fb", _ecore_evas_constructor_software_16_wince_fb},
695 {"software_16_wince_gapi", _ecore_evas_constructor_software_16_wince_gapi},
696 {"software_16_wince_gdi", _ecore_evas_constructor_software_16_wince_gdi},
700 #ifdef BUILD_ECORE_EVAS_COCOA
701 {"cocoa", _ecore_evas_constructor_cocoa},
704 /* Last chance to have a window */
705 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
706 {"sdl", _ecore_evas_constructor_sdl},
707 {"software_16_sdl", _ecore_evas_constructor_sdl16},
710 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
711 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
715 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
716 {"buffer", _ecore_evas_constructor_buffer},
722 * Returns a list of supported engines names.
724 * @return newly allocated list with engines names. Engines names
725 * strings are internal and should be considered constants, do not
726 * free them, to avoid problems use ecore_evas_engines_free()
729 ecore_evas_engines_get(void)
731 const struct ecore_evas_engine *itr;
732 Eina_List *lst = NULL;
734 for (itr = _engines; itr->name; itr++)
735 lst = eina_list_append(lst, itr->name);
741 * Free list returned by ecore_evas_engines_get()
744 ecore_evas_engines_free(Eina_List *engines)
746 eina_list_free(engines);
750 _ecore_evas_new_auto_discover(int x, int y, int w, int h, const char *extra_options)
752 const struct ecore_evas_engine *itr;
754 DBG("auto discover engine");
756 for (itr = _engines; itr->constructor; itr++)
758 Ecore_Evas *ee = itr->constructor(x, y, w, h, extra_options);
761 INF("auto discovered '%s'", itr->name);
766 WRN("could not auto discover.");
771 * Creates a new Ecore_Evas based on engine name and common parameters.
773 * @param engine_name engine name as returned by
774 * ecore_evas_engines_get() or NULL to use environment variable
775 * ECORE_EVAS_ENGINE, that can be undefined and in this case
776 * this call will try to find the first working engine.
777 * @param x horizontal position of window (not supported in all engines)
778 * @param y vertical position of window (not supported in all engines)
779 * @param w width of window
780 * @param h height of window
781 * @param extra_options string with extra parameter, dependent on engines
782 * or NULL. String is usually in the form: 'key1=value1;key2=value2'.
783 * Pay attention that when getting that from shell commands, most
784 * consider ';' as the command terminator, so you need to escape
787 * @return Ecore_Evas instance or NULL if creation failed.
790 ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
792 const struct ecore_evas_engine *itr;
796 engine_name = getenv("ECORE_EVAS_ENGINE");
798 DBG("no engine_name provided, using ECORE_EVAS_ENGINE='%s'",
802 return _ecore_evas_new_auto_discover(x, y, w, h, extra_options);
804 for (itr = _engines; itr->name; itr++)
805 if (strcmp(itr->name, engine_name) == 0)
807 INF("using engine '%s', extra_options=%s",
808 engine_name, extra_options ? extra_options : "(null)");
809 return itr->constructor(x, y, w, h, extra_options);
812 WRN("unknown engine '%s'", engine_name);
817 * Get the engine name used by this engine.
819 * should return one of the values in ecore_evas_engines_get(), usually
820 * acceptable by ecore_evas_new().
823 ecore_evas_engine_name_get(const Ecore_Evas *ee)
831 * Return the Ecore_Evas for this Evas
833 * @param e The Evas to get the Ecore_Evas from
834 * @return The Ecore_Evas that holds this Evas
837 ecore_evas_ecore_evas_get(const Evas *e)
839 return evas_data_attach_get(e);
844 * @param ee The Ecore_Evas to free
846 * This frees up any memory used by the Ecore_Evas.
849 ecore_evas_free(Ecore_Evas *ee)
851 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
853 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
857 _ecore_evas_free(ee);
862 * Retrieve user data associated with an Ecore_Evas.
863 * @param ee The Ecore_Evas to retrieve the user data from.
864 * @param key The key which the user data to be retrieved is associated with.
866 * This function retrieves user specific data that has been stored within an
867 * Ecore_Evas structure with ecore_evas_data_set().
869 * @returns NULL on error or no data found, A pointer to the user data on
872 * @see ecore_evas_data_set
875 ecore_evas_data_get(const Ecore_Evas *ee, const char *key)
877 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
879 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
880 "ecore_evas_data_get");
884 if (!key) return NULL;
885 if (!ee->data) return NULL;
887 return eina_hash_find(ee->data, key);
891 * Store user data in an Ecore_Evas structure.
893 * @param ee The Ecore_Evas to store the user data in.
894 * @param key A unique string to associate the user data against. Cannot
896 * @param data A pointer to the user data to store.
898 * This function associates the @p data with a @p key which is stored by
899 * the Ecore_Evas @p ee. Be aware that a call to ecore_evas_free() will
900 * not free any memory for the associated user data, this is the responsibility
903 * @see ecore_evas_free
906 ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
908 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
910 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
911 "ecore_evas_data_set");
918 eina_hash_del(ee->data, key, NULL);
922 ee->data = eina_hash_string_superfast_new(NULL);
923 eina_hash_add(ee->data, key, data);
927 #define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
931 * Set a callback for Ecore_Evas resize events.
932 * @param ee The Ecore_Evas to set callbacks on
933 * @param func The function to call
935 * A call to this function will set a callback on an Ecore_Evas, causing
936 * @p func to be called whenever @p ee is resized.
939 ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
941 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
943 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
944 "ecore_evas_callback_resize_set");
947 IFC(ee, fn_callback_resize_set) (ee, func);
949 ee->func.fn_resize = func;
953 * Set a callback for Ecore_Evas move events.
954 * @param ee The Ecore_Evas to set callbacks on
955 * @param func The function to call
957 * A call to this function will set a callback on an Ecore_Evas, causing
958 * @p func to be called whenever @p ee is moved.
961 ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
963 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
965 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
966 "ecore_evas_callback_move_set");
969 IFC(ee, fn_callback_move_set) (ee, func);
971 ee->func.fn_move = func;
975 * Set a callback for Ecore_Evas show events.
976 * @param ee The Ecore_Evas to set callbacks on
977 * @param func The function to call
979 * A call to this function will set a callback on an Ecore_Evas, causing
980 * @p func to be called whenever @p ee is shown.
983 ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
985 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
987 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
988 "ecore_evas_callback_show_set");
991 IFC(ee, fn_callback_show_set) (ee, func);
993 ee->func.fn_show = func;
997 * Set a callback for Ecore_Evas hide events.
998 * @param ee The Ecore_Evas to set callbacks on
999 * @param func The function to call
1001 * A call to this function will set a callback on an Ecore_Evas, causing
1002 * @p func to be called whenever @p ee is hidden.
1005 ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1007 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1009 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1010 "ecore_evas_callback_hide_set");
1013 IFC(ee, fn_callback_hide_set) (ee, func);
1015 ee->func.fn_hide = func;
1019 * Set a callback for Ecore_Evas delete request events.
1020 * @param ee The Ecore_Evas to set callbacks on
1021 * @param func The function to call
1023 * A call to this function will set a callback on an Ecore_Evas, causing
1024 * @p func to be called whenever @p ee gets a delete request.
1027 ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1029 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1031 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1032 "ecore_evas_callback_delete_request_set");
1035 IFC(ee, fn_callback_delete_request_set) (ee, func);
1037 ee->func.fn_delete_request = func;
1041 * Set a callback for Ecore_Evas destroy events.
1042 * @param ee The Ecore_Evas to set callbacks on
1043 * @param func The function to call
1045 * A call to this function will set a callback on an Ecore_Evas, causing
1046 * @p func to be called whenever @p ee is destroyed.
1049 ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1051 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1053 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1054 "ecore_evas_callback_destroy_set");
1057 IFC(ee, fn_callback_destroy_set) (ee, func);
1059 ee->func.fn_destroy = func;
1063 * Set a callback for Ecore_Evas focus in events.
1064 * @param ee The Ecore_Evas to set callbacks on
1065 * @param func The function to call
1067 * A call to this function will set a callback on an Ecore_Evas, causing
1068 * @p func to be called whenever @p ee gets focus.
1071 ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1073 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1075 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1076 "ecore_evas_callback_focus_in_set");
1079 IFC(ee, fn_callback_focus_in_set) (ee, func);
1081 ee->func.fn_focus_in = func;
1085 * Set a callback for Ecore_Evas focus out events.
1086 * @param ee The Ecore_Evas to set callbacks on
1087 * @param func The function to call
1089 * A call to this function will set a callback on an Ecore_Evas, causing
1090 * @p func to be called whenever @p ee loses focus.
1093 ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1095 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1097 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1098 "ecore_evas_callback_focus_out_set");
1101 IFC(ee, fn_callback_focus_out_set) (ee, func);
1103 ee->func.fn_focus_out = func;
1107 * Set a callback for Ecore_Evas sticky events.
1108 * @param ee The Ecore_Evas to set callbacks on
1109 * @param func The function to call
1111 * A call to this function will set a callback on an Ecore_Evas, causing
1112 * @p func to be called whenever @p ee becomes sticky.
1115 ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1117 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1119 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1120 "ecore_evas_callback_sticky_set");
1123 IFC(ee, fn_callback_sticky_set) (ee, func);
1125 ee->func.fn_sticky = func;
1129 * Set a callback for Ecore_Evas un-sticky events.
1130 * @param ee The Ecore_Evas to set callbacks on
1131 * @param func The function to call
1133 * A call to this function will set a callback on an Ecore_Evas, causing
1134 * @p func to be called whenever @p ee becomes un-sticky.
1137 ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1139 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1141 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1142 "ecore_evas_callback_unsticky_set");
1145 IFC(ee, fn_callback_unsticky_set) (ee, func);
1147 ee->func.fn_unsticky = func;
1151 * Set a callback for Ecore_Evas mouse in events.
1152 * @param ee The Ecore_Evas to set callbacks on
1153 * @param func The function to call
1155 * A call to this function will set a callback on an Ecore_Evas, causing
1156 * @p func to be called whenever the mouse enters @p ee.
1159 ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1161 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1163 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1164 "ecore_evas_callback_mouse_in_set");
1167 IFC(ee, fn_callback_mouse_in_set) (ee, func);
1169 ee->func.fn_mouse_in = func;
1173 * Set a callback for Ecore_Evas mouse out events.
1174 * @param ee The Ecore_Evas to set callbacks on
1175 * @param func The function to call
1177 * A call to this function will set a callback on an Ecore_Evas, causing
1178 * @p func to be called whenever the mouse leaves @p ee.
1181 ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1183 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1185 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1186 "ecore_evas_callback_mouse_out_set");
1189 IFC(ee, fn_callback_mouse_out_set) (ee, func);
1191 ee->func.fn_mouse_out = func;
1195 * Set a callback for Ecore_Evas mouse pre render events.
1196 * @param ee The Ecore_Evas to set callbacks on
1197 * @param func The function to call
1199 * A call to this function will set a callback on an Ecore_Evas, causing
1200 * @p func to be called just before the evas in @p ee is rendered.
1203 ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1205 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1207 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1208 "ecore_evas_callback_pre_render_set");
1211 IFC(ee, fn_callback_pre_render_set) (ee, func);
1213 ee->func.fn_pre_render = func;
1217 * Set a callback for Ecore_Evas mouse post render events.
1218 * @param ee The Ecore_Evas to set callbacks on
1219 * @param func The function to call
1221 * A call to this function will set a callback on an Ecore_Evas, causing
1222 * @p func to be called just after the evas in @p ee is rendered.
1225 ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1227 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1229 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1230 "ecore_evas_callback_post_render_set");
1233 IFC(ee, fn_callback_post_render_set) (ee, func);
1235 ee->func.fn_post_render = func;
1239 * Set a callback for Ecore_Evas pre-free event.
1240 * @param ee The Ecore_Evas to set callbacks on
1241 * @param func The function to call
1243 * A call to this function will set a callback on an Ecore_Evas, causing
1244 * @p func to be called just before the instance @p ee is freed.
1247 ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1249 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1251 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1252 "ecore_evas_callback_pre_free_set");
1255 ee->func.fn_pre_free = func;
1259 * Get an Ecore_Evas's Evas
1260 * @param ee The Ecore_Evas whose Evas you wish to get
1261 * @return The Evas wrapped by @p ee
1263 * This function returns the Evas contained within @p ee.
1266 ecore_evas_get(const Ecore_Evas *ee)
1268 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1270 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1278 * Move an Ecore_Evas
1279 * @param ee The Ecore_Evas to move
1280 * @param x The x coordinate to move to
1281 * @param y The y coordinate to move to
1283 * This moves @p ee to the screen coordinates (@p x, @p y)
1286 ecore_evas_move(Ecore_Evas *ee, int x, int y)
1288 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1290 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1294 if (ee->prop.fullscreen) return;
1295 IFC(ee, fn_move) (ee, x, y);
1300 * Provide Managed move co-ordinates for an Ecore_Evas
1301 * @param ee The Ecore_Evas to move
1302 * @param x The x coordinate to set as the managed location
1303 * @param y The y coordinate to set as the managed location
1305 * This sets the managed geometry position of the @p ee to (@p x, @p y)
1308 ecore_evas_managed_move(Ecore_Evas *ee, int x, int y)
1310 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1312 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1316 IFC(ee, fn_managed_move) (ee, x, y);
1321 * Resize an Ecore_Evas
1322 * @param ee The Ecore_Evas to move
1323 * @param w The w coordinate to resize to
1324 * @param h The h coordinate to resize to
1326 * This resizes @p ee to @p w x @p h
1329 ecore_evas_resize(Ecore_Evas *ee, int w, int h)
1331 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1333 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1334 "ecore_evas_resize");
1337 if (ee->prop.fullscreen) return;
1340 if ((ee->rotation == 90) || (ee->rotation == 270))
1342 IFC(ee, fn_resize) (ee, h, w);
1347 IFC(ee, fn_resize) (ee, w, h);
1353 * Resize an Ecore_Evas
1354 * @param ee The Ecore_Evas to move
1355 * @param x The x coordinate to move to
1356 * @param y The y coordinate to move to
1357 * @param w The w coordinate to resize to
1358 * @param h The h coordinate to resize to
1360 * This moves @p ee to the screen coordinates (@p x, @p y) and resizes
1361 * it to @p w x @p h.
1365 ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
1367 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1369 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1370 "ecore_evas_move_resize");
1373 if (ee->prop.fullscreen) return;
1376 if ((ee->rotation == 90) || (ee->rotation == 270))
1378 IFC(ee, fn_move_resize) (ee, x, y, h, w);
1383 IFC(ee, fn_move_resize) (ee, x, y, w, h);
1389 * Get the geometry of an Ecore_Evas
1390 * @param ee The Ecore_Evas whose geometry y
1391 * @param x A pointer to an int to place the x coordinate in
1392 * @param y A pointer to an int to place the y coordinate in
1393 * @param w A pointer to an int to place the w size in
1394 * @param h A pointer to an int to place the h size in
1396 * This function takes four pointers to (already allocated) ints, and places
1397 * the geometry of @p ee in them.
1401 * ecore_evas_geometry_get(ee, &x, &y, &w, &h);
1406 ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
1408 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1410 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1411 "ecore_evas_geometry_get");
1414 if ((ee->rotation == 90) || (ee->rotation == 270))
1431 * Set the rotation of an Ecore_Evas' window
1433 * @param ee The Ecore_Evas
1434 * @param rot the angle (in degrees) of rotation.
1436 * The allowed values of @p rot depend on the engine being used. Most only
1437 * allow multiples of 90.
1440 ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
1442 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1444 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1445 "ecore_evas_rotation_set");
1449 while (rot < 0) rot += 360;
1450 while (rot >= 360) rot -= 360;
1451 IFC(ee, fn_rotation_set) (ee, rot, 0);
1452 /* make sure everything gets redrawn */
1453 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1454 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1459 * Set the rotation of an Ecore_Evas' window
1461 * @param ee The Ecore_Evas
1462 * @param rot the angle (in degrees) of rotation.
1464 * The allowed values of @p rot depend on the engine being used. Most only
1465 * allow multiples of 90.
1468 ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
1470 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1472 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1473 "ecore_evas_rotation_set");
1477 while (rot < 0) rot += 360;
1478 while (rot >= 360) rot -= 360;
1479 IFC(ee, fn_rotation_set) (ee, rot, 1);
1480 /* make sure everything gets redrawn */
1481 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1482 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
1487 * Set the rotation of an Ecore_Evas' window
1489 * @param ee The Ecore_Evas
1490 * @return the angle (in degrees) of rotation.
1494 ecore_evas_rotation_get(const Ecore_Evas *ee)
1496 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1498 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1499 "ecore_evas_rotation_get");
1502 return ee->rotation;
1506 * Set whether an Ecore_Evas is shaped or not.
1507 * @param ee The Ecore_Evas to shape
1508 * @param shaped 1 to shape, 0 to not
1510 * This function allows one to make an Ecore_Evas shaped to the contents of the
1511 * evas. If @p shaped is 1, @p ee will be transparent in parts of the evas that
1512 * contain no objects. If @p shaped is 0, then @p ee will be rectangular, and
1513 * and parts with no data will show random framebuffer artifacting. For
1514 * non-shaped Ecore_Evases, it is recommend to cover the entire evas with a
1515 * background object.
1518 ecore_evas_shaped_set(Ecore_Evas *ee, int shaped)
1520 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1522 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1523 "ecore_evas_shaped_set");
1526 IFC(ee, fn_shaped_set) (ee, shaped);
1531 * Query whether an Ecore_Evas is shaped or not.
1532 * @param ee The Ecore_Evas to query.
1533 * @return 1 if shaped, 0 if not.
1535 * This function returns 1 if @p ee is shaped, and 0 if not.
1538 ecore_evas_shaped_get(const Ecore_Evas *ee)
1540 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1542 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1543 "ecore_evas_shaped_get");
1546 return ee->shaped ? 1:0;
1550 * Set whether an Ecore_Evas has an alpha channel or not.
1551 * @param ee The Ecore_Evas to shape
1552 * @param alpha 1 to enable the alpha channel, 0 to disable it
1554 * This function allows you to make an Ecore_Evas translucent using an
1555 * alpha channel. See ecore_evas_shaped_set() for details. The difference
1556 * between a shaped window and a window with an alpha channel is that an
1557 * alpha channel supports multiple levels of transpararency, as opposed to
1558 * the 1 bit transparency of a shaped window (a pixel is either opaque, or
1559 * it's transparent).
1562 ecore_evas_alpha_set(Ecore_Evas *ee, int alpha)
1564 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1566 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1567 "ecore_evas_alpha_set");
1570 IFC(ee, fn_alpha_set) (ee, alpha);
1575 * Query whether an Ecore_Evas has an alpha channel.
1576 * @param ee The Ecore_Evas to query.
1577 * @return 1 if ee has an alpha channel, 0 if it does not.
1579 * This function returns 1 if @p ee has an alpha channel, and 0 if
1583 ecore_evas_alpha_get(const Ecore_Evas *ee)
1585 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1587 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1588 "ecore_evas_alpha_get");
1591 return ee->alpha ? 1:0;
1595 * Set whether an Ecore_Evas has an transparent window or not.
1596 * @param ee The Ecore_Evas to shape
1597 * @param transparent 1 to enable the transparent window, 0 to disable it
1599 * This function allows you to make an Ecore_Evas translucent using an
1600 * alpha channel. See ecore_evas_shaped_set() for details. The difference
1601 * between a shaped window and a window with an alpha channel is that an
1602 * alpha channel supports multiple levels of transpararency, as opposed to
1603 * the 1 bit transparency of a shaped window (a pixel is either opaque, or
1604 * it's transparent).
1607 ecore_evas_transparent_set(Ecore_Evas *ee, int transparent)
1609 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1611 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1612 "ecore_evas_transparent_set");
1615 IFC(ee, fn_transparent_set) (ee, transparent);
1620 * Query whether an Ecore_Evas has an alpha channel.
1621 * @param ee The Ecore_Evas to query.
1622 * @return 1 if ee has an alpha channel, 0 if it does not.
1624 * This function returns 1 if @p ee has an alpha channel, and 0 if
1628 ecore_evas_transparent_get(const Ecore_Evas *ee)
1630 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1632 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1633 "ecore_evas_transparent_get");
1636 return ee->transparent ? 1:0;
1640 * Show an Ecore_Evas' window
1641 * @param ee The Ecore_Evas to show.
1643 * This function makes @p ee visible.
1646 ecore_evas_show(Ecore_Evas *ee)
1648 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1650 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1654 IFC(ee, fn_show) (ee);
1659 * Hide an Ecore_Evas' window
1660 * @param ee The Ecore_Evas to show.
1662 * This function makes @p ee hidden.
1665 ecore_evas_hide(Ecore_Evas *ee)
1667 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1669 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1673 IFC(ee, fn_hide) (ee);
1678 * Query whether an Ecore_Evas' window is visible or not.
1679 * @param ee The Ecore_Evas to query.
1680 * @return 1 if visible, 0 if not.
1682 * This function queries @p ee and returns 1 if it is visible, and 0 if not.
1685 ecore_evas_visibility_get(const Ecore_Evas *ee)
1687 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1689 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1690 "ecore_evas_visibility_get");
1693 return ee->visible ? 1:0;
1697 * Raise and Ecore_Evas' window.
1698 * @param ee The Ecore_Evas to raise.
1700 * This functions raises the Ecore_Evas to the front.
1703 ecore_evas_raise(Ecore_Evas *ee)
1705 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1707 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1708 "ecore_evas_raise");
1711 IFC(ee, fn_raise) (ee);
1716 * Lower an Ecore_Evas' window.
1717 * @param ee The Ecore_Evas to raise.
1719 * This functions lowers the Ecore_Evas to the back.
1722 ecore_evas_lower(Ecore_Evas *ee)
1724 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1726 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1727 "ecore_evas_lower");
1730 IFC(ee, fn_lower) (ee);
1735 * Activate (set focus to, via the window manager) an Ecore_Evas' window.
1736 * @param ee The Ecore_Evas to activate.
1738 * This functions activates the Ecore_Evas.
1741 ecore_evas_activate(Ecore_Evas *ee)
1743 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1745 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1746 "ecore_evas_activate");
1749 IFC(ee, fn_activate) (ee);
1754 * Set the title of an Ecore_Evas' window
1755 * @param ee The Ecore_Evas whose title you wish to set.
1756 * @param t The title
1758 * This function sets the title of @p ee to @p t.
1761 ecore_evas_title_set(Ecore_Evas *ee, const char *t)
1763 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1765 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1766 "ecore_evas_title_set");
1769 IFC(ee, fn_title_set) (ee, t);
1774 * Get the title of an Ecore_Evas' window
1775 * @param ee The Ecore_Evas whose title you wish to get.
1776 * @return The title of @p ee.
1778 * This function returns the title of @p ee.
1781 ecore_evas_title_get(const Ecore_Evas *ee)
1783 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1785 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1786 "ecore_evas_title_get");
1789 return ee->prop.title;
1793 * Set the name and class of an Ecore_Evas' window
1794 * @param ee the Ecore_Evas
1796 * @param c the class
1798 * This function sets the name of @p ee to @p n, and its class to @p c.
1801 ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
1803 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1805 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1806 "ecore_evas_name_class_set");
1809 IFC(ee, fn_name_class_set) (ee, n, c);
1814 * Get the name and class of an Ecore_Evas' window
1815 * @p ee The Ecore_Evas to query
1816 * @p n A pointer to a string to place the name in.
1817 * @p c A pointer to a string to place the class in.
1819 * This function gets puts the name of @p ee into @p n, and its class into
1823 ecore_evas_name_class_get(const Ecore_Evas *ee, const char **n, const char **c)
1825 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1827 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1828 "ecore_evas_name_class_get");
1831 if (n) *n = ee->prop.name;
1832 if (c) *c = ee->prop.clas;
1836 * Set the min size of an Ecore_Evas' window
1837 * @param ee The Ecore_Evas to set
1838 * @param w The minimum width
1839 * @param h The minimum height
1841 * This function sets the minimum size of @p ee to @p w x @p h.
1844 ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
1846 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1848 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1849 "ecore_evas_size_min_set");
1854 if ((ee->rotation == 90) || (ee->rotation == 270))
1856 IFC(ee, fn_size_min_set) (ee, h, w);
1861 IFC(ee, fn_size_min_set) (ee, w, h);
1867 * Get the min size of an Ecore_Evas' window
1868 * @param ee The Ecore_Evas to set
1869 * @param w A pointer to an int to place the min width in.
1870 * @param h A pointer to an int to place the min height in.
1872 * This function puts the minimum size of @p ee into @p w and @p h.
1875 ecore_evas_size_min_get(const Ecore_Evas *ee, int *w, int *h)
1877 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1879 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1880 "ecore_evas_size_min_get");
1883 if ((ee->rotation == 90) || (ee->rotation == 270))
1885 if (w) *w = ee->prop.min.h;
1886 if (h) *h = ee->prop.min.w;
1890 if (w) *w = ee->prop.min.w;
1891 if (h) *h = ee->prop.min.h;
1896 * Set the max size of an Ecore_Evas' window
1897 * @param ee The Ecore_Evas to set
1898 * @param w The maximum width
1899 * @param h The maximum height
1901 * This function sets the maximum size of @p ee to @p w x @p h.
1904 ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h)
1906 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1908 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1909 "ecore_evas_size_max_set");
1914 if ((ee->rotation == 90) || (ee->rotation == 270))
1916 IFC(ee, fn_size_max_set) (ee, h, w);
1921 IFC(ee, fn_size_max_set) (ee, w, h);
1927 * Get the max size of an Ecore_Evas' window
1928 * @param ee The Ecore_Evas to set
1929 * @param w A pointer to an int to place the max width in.
1930 * @param h A pointer to an int to place the max height in.
1932 * This function puts the maximum size of @p ee into @p w and @p h.
1935 ecore_evas_size_max_get(const Ecore_Evas *ee, int *w, int *h)
1937 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1939 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1940 "ecore_evas_size_max_get");
1943 if ((ee->rotation == 90) || (ee->rotation == 270))
1945 if (w) *w = ee->prop.max.h;
1946 if (h) *h = ee->prop.max.w;
1950 if (w) *w = ee->prop.max.w;
1951 if (h) *h = ee->prop.max.h;
1956 * Set the base size of an Ecore_Evas' window
1957 * @param ee The Ecore_Evas to set
1958 * @param w The base width
1959 * @param h The base height
1961 * This function sets the base size of @p ee to @p w x @p h.
1964 ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h)
1966 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1968 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1969 "ecore_evas_size_base_set");
1974 if ((ee->rotation == 90) || (ee->rotation == 270))
1976 IFC(ee, fn_size_base_set) (ee, h, w);
1981 IFC(ee, fn_size_base_set) (ee, w, h);
1987 * Get the base size of an Ecore_Evas' window
1988 * @param ee The Ecore_Evas to set
1989 * @param w A pointer to an int to place the base width in.
1990 * @param h A pointer to an int to place the base height in.
1992 * This function puts the base size of @p ee into @p w and @p h.
1995 ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h)
1997 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1999 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2000 "ecore_evas_size_base_get");
2003 if ((ee->rotation == 90) || (ee->rotation == 270))
2005 if (w) *w = ee->prop.base.h;
2006 if (h) *h = ee->prop.base.w;
2010 if (w) *w = ee->prop.base.w;
2011 if (h) *h = ee->prop.base.h;
2016 * Set the step size of an Ecore_Evas
2017 * @param ee The Ecore_Evas to set
2018 * @param w The step width
2019 * @param h The step height
2021 * This function sets the step size of @p ee to @p w x @p h. This limits the
2022 * size of an Ecore_Evas to always being an integer multiple of the step size.
2025 ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
2027 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2029 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2030 "ecore_evas_size_step_set");
2035 if ((ee->rotation == 90) || (ee->rotation == 270))
2037 IFC(ee, fn_size_step_set) (ee, h, w);
2042 IFC(ee, fn_size_step_set) (ee, w, h);
2048 * Get the step size of an Ecore_Evas' window
2049 * @param ee The Ecore_Evas to set
2050 * @param w A pointer to an int to place the step width in.
2051 * @param h A pointer to an int to place the step height in.
2053 * This function puts the step size of @p ee into @p w and @p h.
2056 ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h)
2058 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2060 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2061 "ecore_evas_size_step_get");
2064 if ((ee->rotation == 90) || (ee->rotation == 270))
2066 if (w) *w = ee->prop.step.h;
2067 if (h) *h = ee->prop.step.w;
2071 if (w) *w = ee->prop.step.w;
2072 if (h) *h = ee->prop.step.h;
2077 * Set the cursor of an Ecore_Evas
2078 * @param ee The Ecore_Evas
2079 * @param file The path to an image file for the cursor
2081 * @param hot_x The x coordinate of the cursor's hot spot
2082 * @param hot_y The y coordinate of the cursor's hot spot
2084 * This function makes the mouse cursor over @p ee be the image specified by
2085 * @p file. The actual point within the image that the mouse is at is specified
2086 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
2087 * corner of the cursor image.
2090 ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y)
2092 Evas_Object *obj = NULL;
2094 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2096 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2097 "ecore_evas_cursor_set");
2105 obj = evas_object_image_add(ee->evas);
2106 evas_object_image_file_set(obj, file, NULL);
2107 evas_object_image_size_get(obj, &x, &y);
2108 evas_object_resize(obj, x, y);
2109 evas_object_image_fill_set(obj, 0, 0, x, y);
2112 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
2117 * Set the cursor of an Ecore_Evas
2118 * @param ee The Ecore_Evas
2119 * @param obj The Evas_Object for the cursor
2121 * @param hot_x The x coordinate of the cursor's hot spot
2122 * @param hot_y The y coordinate of the cursor's hot spot
2124 * This function makes the mouse cursor over @p ee be the image specified by
2125 * @p file. The actual point within the image that the mouse is at is specified
2126 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
2127 * corner of the cursor image.
2130 ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
2132 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2134 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2135 "ecore_evas_cursor_set");
2138 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y);
2143 * Get information about an Ecore_Evas' cursor
2144 * @param ee The Ecore_Evas to set
2145 * @param obj A pointer to an Evas_Object to place the cursor Evas_Object.
2146 * @param layer A pointer to an int to place the cursor's layer in..
2147 * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in.
2148 * @param hot_y A pointer to an int to place the cursor's hot_y coordinate in.
2150 * This function queries information about an Ecore_Evas' cursor.
2153 ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y)
2155 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2157 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2158 "ecore_evas_cursor_get");
2161 if (obj) *obj = ee->prop.cursor.object;
2162 if (layer) *layer = ee->prop.cursor.layer;
2163 if (hot_x) *hot_x = ee->prop.cursor.hot.x;
2164 if (hot_y) *hot_y = ee->prop.cursor.hot.y;
2168 * Set the layer of an Ecore_Evas' window
2169 * @param ee The Ecore_Evas
2170 * @param layer The layer to put @p ee on.
2172 * This function moves @p ee to the layer @p layer.
2175 ecore_evas_layer_set(Ecore_Evas *ee, int layer)
2177 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2179 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2180 "ecore_evas_layer_set");
2183 IFC(ee, fn_layer_set) (ee, layer);
2188 * Get the layer of an Ecore_Evas' window
2189 * @param ee The Ecore_Evas to set
2190 * @return the layer @p ee's window is on.
2194 ecore_evas_layer_get(const Ecore_Evas *ee)
2196 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2198 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2199 "ecore_evas_layer_get");
2202 return ee->prop.layer;
2206 * Set the focus of an Ecore_Evas' window
2207 * @param ee The Ecore_Evas
2208 * @param on 1 for focus, 0 to defocus.
2210 * This function focuses @p ee if @p on is 1, or defocuses @p ee if @p on is 0.
2213 ecore_evas_focus_set(Ecore_Evas *ee, int on)
2215 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2217 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2218 "ecore_evas_focus_set");
2221 IFC(ee, fn_focus_set) (ee, on);
2226 * Query whether an Ecore_Evas' window is focused or not
2227 * @param ee The Ecore_Evas to set
2228 * @return 1 if @p ee if focused, 0 if not.
2232 ecore_evas_focus_get(const Ecore_Evas *ee)
2234 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2236 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2237 "ecore_evas_focus_get");
2240 return ee->prop.focused ? 1:0;
2244 * Iconify or uniconify an Ecore_Evas' window
2245 * @param ee The Ecore_Evas
2246 * @param on 1 to iconify, 0 to uniconify.
2248 * This function iconifies @p ee if @p on is 1, or uniconifies @p ee if @p on
2252 ecore_evas_iconified_set(Ecore_Evas *ee, int on)
2254 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2256 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2257 "ecore_evas_iconified_set");
2260 IFC(ee, fn_iconified_set) (ee, on);
2265 * Query whether an Ecore_Evas' window is iconified or not
2266 * @param ee The Ecore_Evas to set
2267 * @return 1 if @p ee is iconified, 0 if not.
2271 ecore_evas_iconified_get(const Ecore_Evas *ee)
2273 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2275 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2276 "ecore_evas_iconified_get");
2279 return ee->prop.iconified ? 1:0;
2283 * Set whether an Ecore_Evas' window is borderless or not
2284 * @param ee The Ecore_Evas
2285 * @param on 1 for borderless, 0 for bordered.
2287 * This function makes @p ee borderless if @p on is 1, or bordered if @p on
2291 ecore_evas_borderless_set(Ecore_Evas *ee, int on)
2293 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2295 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2296 "ecore_evas_borderless_set");
2299 IFC(ee, fn_borderless_set) (ee, on);
2304 * Query whether an Ecore_Evas' window is borderless or not
2305 * @param ee The Ecore_Evas to set
2306 * @return 1 if @p ee is borderless, 0 if not.
2310 ecore_evas_borderless_get(const Ecore_Evas *ee)
2312 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2314 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2315 "ecore_evas_borderless_get");
2318 return ee->prop.borderless ? 1:0;
2322 * Tell the WM whether or not to ignore an Ecore_Evas' window
2323 * @param ee The Ecore_Evas
2324 * @param on 1 to ignore, 0 to not.
2326 * This function causes the window manager to ignore @p ee if @p on is 1,
2327 * or not ignore @p ee if @p on is 0.
2330 ecore_evas_override_set(Ecore_Evas *ee, int on)
2332 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2334 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2335 "ecore_evas_override_set");
2338 IFC(ee, fn_override_set) (ee, on);
2343 * Query whether an Ecore_Evas' window is overridden or not
2344 * @param ee The Ecore_Evas to set
2345 * @return 1 if @p ee is overridden, 0 if not.
2349 ecore_evas_override_get(const Ecore_Evas *ee)
2351 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2353 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2354 "ecore_evas_override_get");
2357 return ee->prop.override ? 1:0;
2361 * Maximize (or unmaximize) an Ecore_Evas' window
2362 * @param ee The Ecore_Evas
2363 * @param on 1 to maximize, 0 to unmaximize.
2365 * This function maximizes @p ee if @p on is 1, or unmaximizes @p ee
2369 ecore_evas_maximized_set(Ecore_Evas *ee, int on)
2371 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2373 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2374 "ecore_evas_maximized_set");
2377 IFC(ee, fn_maximized_set) (ee, on);
2382 * Query whether an Ecore_Evas' window is maximized or not
2383 * @param ee The Ecore_Evas to set
2384 * @return 1 if @p ee is maximized, 0 if not.
2388 ecore_evas_maximized_get(const Ecore_Evas *ee)
2390 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2392 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2393 "ecore_evas_maximized_get");
2396 return ee->prop.maximized ? 1:0;
2400 * Set whether or not an Ecore_Evas' window is fullscreen
2401 * @param ee The Ecore_Evas
2402 * @param on 1 fullscreen, 0 not.
2404 * This function causes @p ee to be fullscreen if @p on is 1,
2405 * or not if @p on is 0.
2408 ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
2410 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2412 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2413 "ecore_evas_fullscreen_set");
2416 IFC(ee, fn_fullscreen_set) (ee, on);
2421 * Query whether an Ecore_Evas' window is fullscreen or not
2422 * @param ee The Ecore_Evas to set
2423 * @return 1 if @p ee is fullscreen, 0 if not.
2427 ecore_evas_fullscreen_get(const Ecore_Evas *ee)
2429 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2431 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2432 "ecore_evas_fullscreen_get");
2435 return ee->prop.fullscreen ? 1:0;
2439 * Set whether or not an Ecore_Evas' window should avoid damage
2441 * @param ee The Ecore_Evas
2442 * @param on 1 to avoid damage, 0 to not
2444 * This function causes @p ee to be drawn to a pixmap to avoid recalculations.
2445 * On expose events it will copy from the pixmap to the window.
2448 ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
2450 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2452 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2453 "ecore_evas_avoid_damage_set");
2456 IFC(ee, fn_avoid_damage_set) (ee, on);
2461 * Query whether an Ecore_Evas' window avoids damage or not
2462 * @param ee The Ecore_Evas to set
2463 * @return 1 if @p ee avoids damage, 0 if not.
2466 EAPI Ecore_Evas_Avoid_Damage_Type
2467 ecore_evas_avoid_damage_get(const Ecore_Evas *ee)
2469 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2471 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2472 "ecore_evas_avoid_damage_get");
2475 return ee->prop.avoid_damage;
2479 * Set the withdrawn state of an Ecore_Evas' window.
2480 * @param ee The Ecore_Evas whose window's withdrawn state is set.
2481 * @param withdrawn The Ecore_Evas window's new withdrawn state.
2485 ecore_evas_withdrawn_set(Ecore_Evas *ee, int withdrawn)
2487 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2489 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2490 "ecore_evas_withdrawn_set");
2494 IFC(ee, fn_withdrawn_set) (ee, withdrawn);
2499 * Returns the withdrawn state of an Ecore_Evas' window.
2500 * @param ee The Ecore_Evas whose window's withdrawn state is returned.
2501 * @return The Ecore_Evas window's withdrawn state.
2505 ecore_evas_withdrawn_get(const Ecore_Evas *ee)
2507 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2509 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2510 "ecore_evas_withdrawn_get");
2513 return ee->prop.withdrawn ? 1:0;
2517 * Set the sticky state of an Ecore_Evas window.
2519 * @param ee The Ecore_Evas whose window's sticky state is set.
2520 * @param sticky The Ecore_Evas window's new sticky state.
2524 ecore_evas_sticky_set(Ecore_Evas *ee, int sticky)
2526 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2528 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2529 "ecore_evas_sticky_set");
2533 IFC(ee, fn_sticky_set) (ee, sticky);
2538 * Returns the sticky state of an Ecore_Evas' window.
2540 * @param ee The Ecore_Evas whose window's sticky state is returned.
2541 * @return The Ecore_Evas window's sticky state.
2545 ecore_evas_sticky_get(const Ecore_Evas *ee)
2547 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2549 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2550 "ecore_evas_sticky_get");
2553 return ee->prop.sticky ? 1:0;
2557 * Set if this evas should ignore events
2559 * @param ee The Ecore_Evas whose window's to ignore events.
2560 * @param ignore The Ecore_Evas new ignore state.
2564 ecore_evas_ignore_events_set(Ecore_Evas *ee, int ignore)
2566 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2568 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2569 "ecore_evas_ignore_events_set");
2573 IFC(ee, fn_ignore_events_set) (ee, ignore);
2578 * Returns the ignore state of an Ecore_Evas' window.
2580 * @param ee The Ecore_Evas whose window's ignore events state is returned.
2581 * @return The Ecore_Evas window's ignore state.
2585 ecore_evas_ignore_events_get(const Ecore_Evas *ee)
2587 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2589 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2590 "ecore_evas_ignore_events_get");
2593 return ee->ignore_events ? 1 : 0;
2597 ecore_evas_manual_render_set(Ecore_Evas *ee, int manual_render)
2599 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2601 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2602 "ecore_evas_manual_render_set");
2605 ee->manual_render = manual_render;
2609 ecore_evas_manual_render_get(const Ecore_Evas *ee)
2611 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2613 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2614 "ecore_evas_manual_render_get");
2617 return ee->manual_render ? 1 : 0;
2621 ecore_evas_manual_render(Ecore_Evas *ee)
2623 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2625 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2626 "ecore_evas_manual_render");
2629 if (ee->engine.func->fn_render)
2630 ee->engine.func->fn_render(ee);
2634 ecore_evas_comp_sync_set(Ecore_Evas *ee, int do_sync)
2636 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2638 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2639 "ecore_evas_comp_sync_set");
2642 ee->no_comp_sync = !do_sync;
2646 ecore_evas_comp_sync_get(const Ecore_Evas *ee)
2648 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2650 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2651 "ecore_evas_comp_sync_get");
2654 return !ee->no_comp_sync;
2658 ecore_evas_window_get(const Ecore_Evas *ee)
2660 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2662 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2663 "ecore_evas_window_get");
2667 return ee->prop.window;
2670 /* fps debug calls - for debugging how much time your app actually spends */
2671 /* rendering graphics... :) */
2673 static int _ecore_evas_fps_debug_init_count = 0;
2674 static int _ecore_evas_fps_debug_fd = -1;
2675 unsigned int *_ecore_evas_fps_rendertime_mmap = NULL;
2678 _ecore_evas_fps_debug_init(void)
2682 _ecore_evas_fps_debug_init_count++;
2683 if (_ecore_evas_fps_debug_init_count > 1) return;
2684 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2685 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2686 if (_ecore_evas_fps_debug_fd < 0)
2689 _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
2691 if (_ecore_evas_fps_debug_fd >= 0)
2693 unsigned int zero = 0;
2694 char *buf = (char *)&zero;
2695 ssize_t todo = sizeof(unsigned int);
2699 ssize_t r = write(_ecore_evas_fps_debug_fd, buf, todo);
2705 else if ((r < 0) && (errno == EINTR))
2709 ERR("could not write to file '%s' fd %d: %s",
2710 buf, _ecore_evas_fps_debug_fd, strerror(errno));
2711 close(_ecore_evas_fps_debug_fd);
2712 _ecore_evas_fps_debug_fd = -1;
2716 _ecore_evas_fps_rendertime_mmap = mmap(NULL, sizeof(unsigned int),
2717 PROT_READ | PROT_WRITE,
2719 _ecore_evas_fps_debug_fd, 0);
2720 if (_ecore_evas_fps_rendertime_mmap == MAP_FAILED)
2721 _ecore_evas_fps_rendertime_mmap = NULL;
2726 _ecore_evas_fps_debug_shutdown(void)
2728 _ecore_evas_fps_debug_init_count--;
2729 if (_ecore_evas_fps_debug_init_count > 0) return;
2730 if (_ecore_evas_fps_debug_fd >= 0)
2734 snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
2736 if (_ecore_evas_fps_rendertime_mmap)
2738 munmap(_ecore_evas_fps_rendertime_mmap, sizeof(int));
2739 _ecore_evas_fps_rendertime_mmap = NULL;
2741 close(_ecore_evas_fps_debug_fd);
2742 _ecore_evas_fps_debug_fd = -1;
2747 _ecore_evas_fps_debug_rendertime_add(double t)
2749 static double rtime = 0.0;
2750 static double rlapse = 0.0;
2751 static int frames = 0;
2752 static int flapse = 0;
2755 tim = ecore_time_get();
2763 else if ((tim - rlapse) >= 0.1)
2765 printf("%.6f \t", tim);
2766 printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
2768 (frames - flapse) / (tim - rlapse),
2769 (100.0 * rtime) / (tim - rlapse)
2779 _ecore_evas_register(Ecore_Evas *ee)
2782 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
2783 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2787 _ecore_evas_free(Ecore_Evas *ee)
2789 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
2790 while (ee->sub_ecore_evas)
2792 _ecore_evas_free(ee->sub_ecore_evas->data);
2794 if (ee->data) eina_hash_free(ee->data);
2796 if (ee->name) free(ee->name);
2798 if (ee->prop.title) free(ee->prop.title);
2799 ee->prop.title = NULL;
2800 if (ee->prop.name) free(ee->prop.name);
2801 ee->prop.name = NULL;
2802 if (ee->prop.clas) free(ee->prop.clas);
2803 ee->prop.clas = NULL;
2804 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2805 ee->prop.cursor.object = NULL;
2806 if (ee->evas) evas_free(ee->evas);
2808 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
2810 if (ee->engine.idle_flush_timer)
2811 ecore_timer_del(ee->engine.idle_flush_timer);
2812 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
2815 ecore_evases = (Ecore_Evas *)eina_inlist_remove
2816 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
2822 _ecore_evas_cb_idle_flush(void *data)
2826 ee = (Ecore_Evas *)data;
2827 evas_render_idle_flush(ee->evas);
2828 ee->engine.idle_flush_timer = NULL;
2829 return ECORE_CALLBACK_CANCEL;
2833 _ecore_evas_async_events_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
2835 evas_async_events_process();
2837 return ECORE_CALLBACK_RENEW;
2841 _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2843 if (ee->engine.idle_flush_timer)
2844 ecore_timer_del(ee->engine.idle_flush_timer);
2845 ee->engine.idle_flush_timer = ecore_timer_add(IDLE_FLUSH_TIME,
2846 _ecore_evas_cb_idle_flush,
2851 _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2855 if (ee->prop.cursor.object)
2857 evas_object_show(ee->prop.cursor.object);
2858 if (ee->rotation == 0)
2859 evas_object_move(ee->prop.cursor.object,
2860 x - ee->prop.cursor.hot.x,
2861 y - ee->prop.cursor.hot.y);
2862 else if (ee->rotation == 90)
2863 evas_object_move(ee->prop.cursor.object,
2864 ee->h - y - 1 - ee->prop.cursor.hot.x,
2865 x - ee->prop.cursor.hot.y);
2866 else if (ee->rotation == 180)
2867 evas_object_move(ee->prop.cursor.object,
2868 ee->w - x - 1 - ee->prop.cursor.hot.x,
2869 ee->h - y - 1 - ee->prop.cursor.hot.y);
2870 else if (ee->rotation == 270)
2871 evas_object_move(ee->prop.cursor.object,
2872 y - ee->prop.cursor.hot.x,
2873 ee->w - x - 1 - ee->prop.cursor.hot.y);
2875 if (ee->rotation == 0)
2876 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2877 else if (ee->rotation == 90)
2878 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
2879 else if (ee->rotation == 180)
2880 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
2881 else if (ee->rotation == 270)
2882 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
2886 * Get a list of all the ecore_evases.
2888 * The returned list of ecore evases is only valid until the canvases are
2889 * destroyed (and should not be cached for instance).
2890 * The list can be free by just deleting the list.
2892 * @return A list of ecore_evases.
2895 ecore_evas_ecore_evas_list_get(void){
2897 Eina_List *l = NULL;
2899 EINA_INLIST_FOREACH(ecore_evases, ee)
2901 l = eina_list_append(l, ee);