diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/ecore/src/lib/ecore_evas/ecore_evas.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_evas/ecore_evas.c | 153 |
1 files changed, 147 insertions, 6 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c index dc42f92..2b04488 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c | |||
@@ -2,14 +2,21 @@ | |||
2 | # include <config.h> | 2 | # include <config.h> |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #include <stdlib.h> | ||
5 | #include <string.h> | 6 | #include <string.h> |
6 | #include <sys/types.h> | 7 | #include <sys/types.h> |
7 | #include <errno.h> | 8 | #include <errno.h> |
9 | #include <sys/stat.h> | ||
10 | #include <fcntl.h> | ||
8 | 11 | ||
9 | #ifndef _MSC_VER | 12 | #ifndef _MSC_VER |
10 | # include <unistd.h> | 13 | # include <unistd.h> |
11 | #endif | 14 | #endif |
12 | 15 | ||
16 | #ifdef HAVE_SYS_MMAN_H | ||
17 | # include <sys/mman.h> | ||
18 | #endif | ||
19 | |||
13 | #ifdef HAVE_EVIL | 20 | #ifdef HAVE_EVIL |
14 | # include <Evil.h> | 21 | # include <Evil.h> |
15 | #endif | 22 | #endif |
@@ -194,6 +201,18 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine) | |||
194 | #else | 201 | #else |
195 | return EINA_FALSE; | 202 | return EINA_FALSE; |
196 | #endif | 203 | #endif |
204 | case ECORE_EVAS_ENGINE_WAYLAND_SHM: | ||
205 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | ||
206 | return EINA_TRUE; | ||
207 | #else | ||
208 | return EINA_FALSE; | ||
209 | #endif | ||
210 | case ECORE_EVAS_ENGINE_WAYLAND_EGL: | ||
211 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | ||
212 | return EINA_TRUE; | ||
213 | #else | ||
214 | return EINA_FALSE; | ||
215 | #endif | ||
197 | default: | 216 | default: |
198 | return EINA_FALSE; | 217 | return EINA_FALSE; |
199 | }; | 218 | }; |
@@ -237,6 +256,8 @@ ecore_evas_init(void) | |||
237 | _ecore_evas_ews_events_init(); | 256 | _ecore_evas_ews_events_init(); |
238 | #endif | 257 | #endif |
239 | 258 | ||
259 | _ecore_evas_extn_init(); | ||
260 | |||
240 | if (getenv("ECORE_EVAS_COMP_NOSYNC")) | 261 | if (getenv("ECORE_EVAS_COMP_NOSYNC")) |
241 | _ecore_evas_app_comp_sync = 0; | 262 | _ecore_evas_app_comp_sync = 0; |
242 | return _ecore_evas_init_count; | 263 | return _ecore_evas_init_count; |
@@ -257,6 +278,8 @@ ecore_evas_shutdown(void) | |||
257 | 278 | ||
258 | while (ecore_evases) _ecore_evas_free(ecore_evases); | 279 | while (ecore_evases) _ecore_evas_free(ecore_evases); |
259 | 280 | ||
281 | _ecore_evas_extn_shutdown(); | ||
282 | |||
260 | if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown(); | 283 | if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown(); |
261 | ecore_idle_enterer_del(ecore_evas_idle_enterer); | 284 | ecore_idle_enterer_del(ecore_evas_idle_enterer); |
262 | ecore_evas_idle_enterer = NULL; | 285 | ecore_evas_idle_enterer = NULL; |
@@ -282,6 +305,7 @@ ecore_evas_shutdown(void) | |||
282 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE | 305 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE |
283 | while (_ecore_evas_wince_shutdown()); | 306 | while (_ecore_evas_wince_shutdown()); |
284 | #endif | 307 | #endif |
308 | |||
285 | if (_ecore_evas_async_events_fd) | 309 | if (_ecore_evas_async_events_fd) |
286 | ecore_main_fd_handler_del(_ecore_evas_async_events_fd); | 310 | ecore_main_fd_handler_del(_ecore_evas_async_events_fd); |
287 | 311 | ||
@@ -577,6 +601,40 @@ _ecore_evas_constructor_psl1ght(int x __UNUSED__, int y __UNUSED__, int w, int h | |||
577 | } | 601 | } |
578 | #endif | 602 | #endif |
579 | 603 | ||
604 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | ||
605 | static Ecore_Evas * | ||
606 | _ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options) | ||
607 | { | ||
608 | char *disp_name = NULL; | ||
609 | unsigned int frame = 0; | ||
610 | Ecore_Evas *ee; | ||
611 | |||
612 | _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); | ||
613 | _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); | ||
614 | ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame); | ||
615 | free(disp_name); | ||
616 | |||
617 | return ee; | ||
618 | } | ||
619 | #endif | ||
620 | |||
621 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | ||
622 | static Ecore_Evas * | ||
623 | _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options) | ||
624 | { | ||
625 | char *disp_name = NULL; | ||
626 | unsigned int frame = 0; | ||
627 | Ecore_Evas *ee; | ||
628 | |||
629 | _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); | ||
630 | _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); | ||
631 | ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame); | ||
632 | free(disp_name); | ||
633 | |||
634 | return ee; | ||
635 | } | ||
636 | #endif | ||
637 | |||
580 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI | 638 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI |
581 | static Ecore_Evas * | 639 | static Ecore_Evas * |
582 | _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options) | 640 | _ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options) |
@@ -714,7 +772,16 @@ static const struct ecore_evas_engine _engines[] = { | |||
714 | {"psl1ght", _ecore_evas_constructor_psl1ght}, | 772 | {"psl1ght", _ecore_evas_constructor_psl1ght}, |
715 | #endif | 773 | #endif |
716 | 774 | ||
717 | /* Last chance to have a window */ | 775 | /* Wayland */ |
776 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | ||
777 | {"wayland_shm", _ecore_evas_constructor_wayland_shm}, | ||
778 | #endif | ||
779 | |||
780 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | ||
781 | {"wayland_egl", _ecore_evas_constructor_wayland_egl}, | ||
782 | #endif | ||
783 | |||
784 | /* Last chance to have a window */ | ||
718 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL | 785 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL |
719 | {"opengl_sdl", _ecore_evas_constructor_opengl_sdl}, | 786 | {"opengl_sdl", _ecore_evas_constructor_opengl_sdl}, |
720 | #endif | 787 | #endif |
@@ -1938,7 +2005,7 @@ ecore_evas_fullscreen_get(const Ecore_Evas *ee) | |||
1938 | * Set whether or not an Ecore_Evas' window should avoid damage | 2005 | * Set whether or not an Ecore_Evas' window should avoid damage |
1939 | * | 2006 | * |
1940 | * @param ee The Ecore_Evas | 2007 | * @param ee The Ecore_Evas |
1941 | * @param The type of the damage management | 2008 | * @param on The type of the damage management |
1942 | * | 2009 | * |
1943 | * This function causes @p ee to be drawn to a pixmap to avoid recalculations. | 2010 | * This function causes @p ee to be drawn to a pixmap to avoid recalculations. |
1944 | * On expose events it will copy from the pixmap to the window. | 2011 | * On expose events it will copy from the pixmap to the window. |
@@ -2008,8 +2075,8 @@ ecore_evas_withdrawn_get(const Ecore_Evas *ee) | |||
2008 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | 2075 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, |
2009 | "ecore_evas_withdrawn_get"); | 2076 | "ecore_evas_withdrawn_get"); |
2010 | return EINA_FALSE; | 2077 | return EINA_FALSE; |
2011 | } else | 2078 | } |
2012 | return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE; | 2079 | return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE; |
2013 | } | 2080 | } |
2014 | 2081 | ||
2015 | /** | 2082 | /** |
@@ -2048,8 +2115,8 @@ ecore_evas_sticky_get(const Ecore_Evas *ee) | |||
2048 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | 2115 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, |
2049 | "ecore_evas_sticky_get"); | 2116 | "ecore_evas_sticky_get"); |
2050 | return EINA_FALSE; | 2117 | return EINA_FALSE; |
2051 | } else | 2118 | } |
2052 | return ee->prop.sticky ? EINA_TRUE : EINA_FALSE; | 2119 | return ee->prop.sticky ? EINA_TRUE : EINA_FALSE; |
2053 | } | 2120 | } |
2054 | 2121 | ||
2055 | EAPI void | 2122 | EAPI void |
@@ -2170,6 +2237,28 @@ ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int | |||
2170 | IFE; | 2237 | IFE; |
2171 | } | 2238 | } |
2172 | 2239 | ||
2240 | EAPI void | ||
2241 | ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame) | ||
2242 | { | ||
2243 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2244 | { | ||
2245 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_set"); | ||
2246 | return; | ||
2247 | } | ||
2248 | ee->prop.draw_frame = draw_frame; | ||
2249 | } | ||
2250 | |||
2251 | EAPI Eina_Bool | ||
2252 | ecore_evas_draw_frame_get(const Ecore_Evas *ee) | ||
2253 | { | ||
2254 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2255 | { | ||
2256 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_get"); | ||
2257 | return EINA_FALSE; | ||
2258 | } | ||
2259 | return ee->prop.draw_frame; | ||
2260 | } | ||
2261 | |||
2173 | /* fps debug calls - for debugging how much time your app actually spends */ | 2262 | /* fps debug calls - for debugging how much time your app actually spends */ |
2174 | /* rendering graphics... :) */ | 2263 | /* rendering graphics... :) */ |
2175 | 2264 | ||
@@ -2586,3 +2675,55 @@ ecore_evas_input_event_unregister(Ecore_Evas *ee) | |||
2586 | { | 2675 | { |
2587 | ecore_event_window_unregister((Ecore_Window)ee); | 2676 | ecore_event_window_unregister((Ecore_Window)ee); |
2588 | } | 2677 | } |
2678 | |||
2679 | #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined (BUILD_ECORE_EVAS_WAYLAND_EGL) | ||
2680 | EAPI void | ||
2681 | ecore_evas_wayland_resize(Ecore_Evas *ee, int location) | ||
2682 | { | ||
2683 | if (!ee) return; | ||
2684 | if (!strcmp(ee->driver, "wayland_shm")) | ||
2685 | { | ||
2686 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | ||
2687 | _ecore_evas_wayland_shm_resize(ee, location); | ||
2688 | #endif | ||
2689 | } | ||
2690 | else if (!strcmp(ee->driver, "wayland_egl")) | ||
2691 | { | ||
2692 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | ||
2693 | _ecore_evas_wayland_egl_resize(ee, location); | ||
2694 | #endif | ||
2695 | } | ||
2696 | } | ||
2697 | |||
2698 | EAPI void | ||
2699 | ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) | ||
2700 | { | ||
2701 | if ((!ee) || (!source)) return; | ||
2702 | if (!ee->engine.wl.surface) return; | ||
2703 | |||
2704 | if (!strcmp(ee->driver, "wayland_shm")) | ||
2705 | { | ||
2706 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | ||
2707 | _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source); | ||
2708 | #endif | ||
2709 | } | ||
2710 | else if (!strcmp(ee->driver, "wayland_egl")) | ||
2711 | { | ||
2712 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | ||
2713 | _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source); | ||
2714 | #endif | ||
2715 | } | ||
2716 | } | ||
2717 | #else | ||
2718 | EAPI void | ||
2719 | ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__) | ||
2720 | { | ||
2721 | |||
2722 | } | ||
2723 | |||
2724 | EAPI void | ||
2725 | ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__) | ||
2726 | { | ||
2727 | |||
2728 | } | ||
2729 | #endif | ||