Welcome EWS - Ecore+Evas Single Process Windowing System.

EWS is a new Ecor_Evas engine that builds on top of other engines. It
will create a backing store Ecore_Evas and ecore_evas_ews_new()
windows are created in it as images, but transparent to the outside
users (similar to buffer's ecore_evas_object_image_new()).

It provides a basic windowing system, with a known background object
that can be changed to your pleasure, and issue Ecore_Events to notify
of new windows and changes like movement, etc. Then you can write a
simple window manager based on it. (See example, Elementary will
contain one as well).

Backing store is determined by your best engine (as in
ecore_evas_new()) or specified with ecore_evas_ews_engine_set() or
environment variable $ECORE_EVAS_EWS (format:
engine-namey:w:h:options). The size can be set with
ecore_evas_ews_setup().



SVN revision: 63848
This commit is contained in:
Gustavo Sverzut Barbieri 2011-10-05 22:11:00 +00:00
parent 98b3d37f90
commit 163272dc48
16 changed files with 1878 additions and 31 deletions

View File

@ -162,6 +162,7 @@ want_ecore_evas_gl_sdl="no"
want_ecore_evas_directfb="no"
want_ecore_evas_fb="no"
want_ecore_evas_software_16_wince="no"
want_ecore_evas_ews="yes"
# ecore_imf modules
want_ecore_imf_xim="no"
@ -1697,6 +1698,13 @@ ECORE_EVAS_CHECK_MODULE([software-16-wince],
[${have_ecore_wince}],
[requirements_ecore_evas="ecore-wince >= 1.0.0 ${requirements_ecore_evas}"])
# ecore_evas_ews
ECORE_EVAS_CHECK_MODULE_FULL([ews], [software-buffer],
[${want_ecore_evas_ews}],
[Ecore Evas Single Process Windowing System],
[yes], [])
### install and build examples
EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
@ -1913,6 +1921,7 @@ if test "x${have_ecore_evas}" = "xyes" ; then
echo " Software 16bit X11.........: $have_ecore_evas_software_16_x11"
echo " Software 16bit DirectDraw..: $have_ecore_evas_software_16_ddraw"
echo " Software 16bit WinCE.......: $have_ecore_evas_software_16_wince"
echo " Sing.Proc. Windowing System: $have_ecore_evas_ews"
fi
echo
echo " Tests................: ${enable_tests}"

View File

@ -48,19 +48,19 @@ m4_popdef([UP])
m4_popdef([DOWN])
])
dnl use: ECORE_EVAS_CHECK_MODULE(foo-bar, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([ECORE_EVAS_CHECK_MODULE],
dnl use: ECORE_EVAS_CHECK_MODULE_FULL(foo-bar, evas-module, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([ECORE_EVAS_CHECK_MODULE_FULL],
[
m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
have_ecore_evas_[]m4_defn([DOWN])="no"
want_module="$2"
want_module="$3"
AC_ARG_ENABLE(ecore-evas-$1,
[AC_HELP_STRING(
[--enable-ecore-evas-$1],
[enable $3 support in the ecore_evas module.])],
[enable $4 support in the ecore_evas module.])],
[
if test "x${enableval}" = "xyes" ; then
want_module="yes"
@ -70,24 +70,28 @@ AC_ARG_ENABLE(ecore-evas-$1,
],
[])
AC_MSG_CHECKING([whether ecore_evas $3 support is to be built])
AC_MSG_CHECKING([whether ecore_evas $4 support is to be built])
AC_MSG_RESULT([${want_module}])
if test "x$4" = "xyes" -a \
if test "x$5" = "xyes" -a \
"x$have_ecore_evas" = "xyes" -a \
"x$want_module" = "xyes" ; then
PKG_CHECK_EXISTS([evas-$1],
PKG_CHECK_EXISTS([evas-$2],
[
AC_DEFINE([BUILD_ECORE_EVAS_]m4_defn([UP]), [1], [Support for $3 Engine in Ecore_Evas])
AC_DEFINE([BUILD_ECORE_EVAS_]m4_defn([UP]), [1], [Support for $4 Engine in Ecore_Evas])
have_ecore_evas_[]m4_defn([DOWN])="yes"
])
fi
AC_MSG_CHECKING([whether ecore_evas $3 support is built])
AC_MSG_CHECKING([whether ecore_evas $4 support is built])
AC_MSG_RESULT([$have_ecore_evas_]m4_defn([DOWN]))
AS_IF([test "x$have_ecore_evas_[]m4_defn([DOWN])" = "xyes"], [$5], [$6])
AS_IF([test "x$have_ecore_evas_[]m4_defn([DOWN])" = "xyes"], [$6], [$7])
m4_popdef([UP])
m4_popdef([DOWN])
])
dnl use: ECORE_EVAS_CHECK_MODULE(foo-bar, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([ECORE_EVAS_CHECK_MODULE],
[ECORE_EVAS_CHECK_MODULE_FULL([$1], [$1], [$2], [$3], [$4], [$5], [$6])])

View File

@ -53,7 +53,8 @@ SRCS = \
ecore_evas_object_example.c \
ecore_evas_basics_example.c \
ecore_evas_buffer_example_01.c \
ecore_evas_buffer_example_02.c
ecore_evas_buffer_example_02.c \
ecore_evas_ews_example.c
EXTRA_DIST = $(SRCS) \
$(srcdir)/red.png
@ -89,7 +90,8 @@ pkglib_PROGRAMS += \
ecore_evas_object_example \
ecore_evas_basics_example \
ecore_evas_buffer_example_01 \
ecore_evas_buffer_example_02
ecore_evas_buffer_example_02 \
ecore_evas_ews_example
ecore_con_lookup_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la
ecore_con_url_headers_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la

View File

@ -0,0 +1,253 @@
/**
* Ecore example illustrating the ews of ecore evas usage.
*
* You'll need at least one Evas engine built for it (excluding the
* buffer one). See stdout/stderr for output.
*
* @verbatim
* gcc -o ecore_evas_ews_example ecore_evas_ews_example.c `pkg-config --libs --cflags ecore-evas`
* @endverbatim
*/
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
static Eina_Bool
_wm_win_add(void *data, int type, void *event_info)
{
Ecore_Evas *ee = event_info;
printf("WM: new window=%p\n", ee);
return EINA_TRUE;
}
static Eina_Bool
_wm_win_move(void *data, int type, void *event_info)
{
Ecore_Evas *ee = event_info;
int x, y;
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
printf("WM: window=%p moved to %d,%d\n", ee, x, y);
return EINA_TRUE;
}
static Eina_Bool
_wm_win_resize(void *data, int type, void *event_info)
{
Ecore_Evas *ee = event_info;
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
printf("WM: window=%p resized to %dx%d\n", ee, w, h);
return EINA_TRUE;
}
static Eina_Bool
_wm_win_show(void *data, int type, void *event_info)
{
Ecore_Evas *ee = event_info;
printf("WM: show window=%p\n", ee);
return EINA_TRUE;
}
static void
optional_ews_window_manager_setup(void)
{
ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_ADD, _wm_win_add, NULL);
ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_MOVE, _wm_win_move, NULL);
ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_RESIZE, _wm_win_resize, NULL);
ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_SHOW, _wm_win_show, NULL);
/* one may use any known unique identifier, like an app function pointer */
ecore_evas_ews_manager_set(optional_ews_window_manager_setup);
}
static void
optional_ews_setup(void)
{
Evas_Object *bg;
Evas *e;
ecore_evas_ews_setup(0, 0, 800, 600); /* "screen" size */
e = ecore_evas_ews_evas_get(); /* forces "screen" to be allocated */
bg = evas_object_rectangle_add(e);
evas_object_color_set(bg, 128, 32, 32, 255);
ecore_evas_ews_background_set(bg);
}
static Eina_Bool
_stdin_cb(void *data, Ecore_Fd_Handler *handler)
{
const Eina_List *l;
Ecore_Evas *ee;
char c = getchar();
if (c == EOF)
{
ecore_main_loop_quit();
return EINA_FALSE;
}
switch (c) {
case 'h':
printf("hide all windows\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_hide(ee);
break;
case 's':
printf("show all windows\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_show(ee);
break;
case 'l':
printf("move all windows left\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
{
int x, y;
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
ecore_evas_move(ee, x - 10, y);
}
break;
case 'r':
printf("move all windows right\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
{
int x, y;
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
ecore_evas_move(ee, x + 10, y);
}
break;
case 't':
printf("move all windows top\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
{
int x, y;
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
ecore_evas_move(ee, x, y - 10);
}
break;
case 'b':
printf("move all windows bottom\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
{
int x, y;
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
ecore_evas_move(ee, x, y + 10);
}
break;
case 'S':
printf("make all windows smaller\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
{
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
ecore_evas_resize(ee, w - 10, h - 10);
}
break;
case 'B':
printf("make all windows bigger\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
{
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
ecore_evas_resize(ee, w + 10, h + 10);
}
break;
case 'm':
printf("make all windows unmaximized\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_maximized_set(ee, EINA_FALSE);
break;
case 'M':
printf("make all windows maximized\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_maximized_set(ee, EINA_TRUE);
break;
case 'i':
printf("make all windows uniconified\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_iconified_set(ee, EINA_FALSE);
break;
case 'I':
printf("make all windows iconified\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_iconified_set(ee, EINA_TRUE);
break;
case 'f':
printf("make all windows unfullscreen\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_fullscreen_set(ee, EINA_FALSE);
break;
case 'F':
printf("make all windows fullscreen\n");
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
ecore_evas_fullscreen_set(ee, EINA_TRUE);
break;
case 'q':
printf("quit\n");
ecore_main_loop_quit();
break;
default:
if (!isspace(c))
printf("Unknown command: %c\n", c);
}
return ECORE_CALLBACK_RENEW;
}
static void
_on_delete(Ecore_Evas *ee)
{
free(ecore_evas_data_get(ee, "key"));
ecore_main_loop_quit();
}
int
main(void)
{
Ecore_Evas *ee;
Evas *canvas;
Evas_Object *bg;
if (ecore_evas_init() <= 0)
return 1;
optional_ews_setup();
optional_ews_window_manager_setup();
/* everything should look similar to ecore_evas_basic_example */
ee = ecore_evas_ews_new(0, 0, 200, 200);
ecore_evas_title_set(ee, "Ecore Evas EWS Example");
ecore_evas_show(ee);
ecore_evas_data_set(ee, "key", strdup("hello"));
ecore_evas_callback_delete_request_set(ee, _on_delete);
printf("Using %s engine!\n", ecore_evas_engine_name_get(ee));
canvas = ecore_evas_get(ee);
if(ecore_evas_ecore_evas_get(canvas) == ee)
printf("Everything is sane!\n");
bg = evas_object_rectangle_add(canvas);
evas_object_color_set(bg, 0, 0, 255, 255);
evas_object_resize(bg, 200, 200);
evas_object_show(bg);
ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
/* moving the window should move it in the screen */
ecore_evas_move(ee, 50, 50);
ecore_main_fd_handler_add(STDIN_FILENO,
ECORE_FD_READ | ECORE_FD_ERROR,
_stdin_cb,
NULL, NULL, NULL);
ecore_main_loop_begin();
ecore_evas_free(ee);
ecore_evas_shutdown();
return 0;
}

View File

@ -79,6 +79,7 @@ extern "C" {
#define HAVE_ECORE_EVAS_COCOA 1
#define HAVE_ECORE_EVAS_SDL 1
#define HAVE_ECORE_EVAS_WINCE 1
#define HAVE_ECORE_EVAS_EWS 1
typedef enum _Ecore_Evas_Engine_Type
{
@ -100,7 +101,8 @@ typedef enum _Ecore_Evas_Engine_Type
ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
ECORE_EVAS_ENGINE_OPENGL_SDL
ECORE_EVAS_ENGINE_OPENGL_SDL,
ECORE_EVAS_ENGINE_EWS
} Ecore_Evas_Engine_Type;
typedef enum _Ecore_Evas_Avoid_Damage_Type
@ -734,6 +736,56 @@ EAPI Ecore_Evas *ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc
*/
EAPI const void *ecore_evas_buffer_pixels_get(Ecore_Evas *ee);
/**
* @brief Create a new @c Ecore_Evas canvas bound to the Evas
* @b ews (Ecore + Evas Single Process Windowing System) engine
*
* EWS is a simple single process windowing system. The backing store
* is also an @c Ecore_Evas that can be setup with
* ecore_evas_ews_setup() and retrieved with
* ecore_evas_ews_ecore_evas_get(). It will allow window management
* using events prefixed with @c ECORE_EVAS_EVENT_EWS_.
*
* The EWS windows (returned by this function or
* ecore_evas_new("ews"...)) will all be software buffer windows
* automatic rendered to the backing store.
*
* @param x horizontal position of window, in pixels
* @param y vertical position of window, in pixels
* @param w The width of the canvas, in pixels
* @param h The height of the canvas, in pixels
* @return A new @c Ecore_Evas instance or @c NULL, on failure
*
* @see ecore_evas_ews_setup()
* @see ecore_evas_ews_ecore_evas_get()
*
* @since 1.1
*/
EAPI Ecore_Evas *ecore_evas_ews_new(int x, int y, int w, int h);
/**
* Returns the backing store image object that represents the given
* window in EWS.
*
* @note This should not be modified anyhow, but may be helpful to
* determine stacking and geometry of it for window managers
* that decorate windows.
*
* @see ecore_evas_ews_manager_set()
* @see ecore_evas_ews_evas_get()
* @since 1.1
*/
EAPI Evas_Object *ecore_evas_ews_backing_store_get(const Ecore_Evas *ee);
/**
* Calls the window to be deleted (freed), but can let user decide to
* forbid it by using ecore_evas_callback_delete_request_set()
*
* @since 1.1
*/
EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee);
/**
* @brief Create an Evas image object with image data <b>bound to an
* own, internal @c Ecore_Evas canvas wrapper<b>
@ -1422,6 +1474,122 @@ EAPI void ecore_evas_x11_shape_input_empty(Ecore_Evas *ee);
EAPI void ecore_evas_x11_shape_input_reset(Ecore_Evas *ee);
EAPI void ecore_evas_x11_shape_input_apply(Ecore_Evas *ee);
/**
* @defgroup Ecore_Evas_Ews Ecore_Evas Single Process Windowing System.
*
* These are global scope functions to manage the EWS to be used by
* ecore_evas_ews_new().
*
* @since 1.1
* @{
*/
/**
* Sets the engine to be used by the backing store engine.
*
* @return EINA_TRUE on success, EINA_FALSE if ews is already in use.
* @since 1.1
*/
EAPI Eina_Bool ecore_evas_ews_engine_set(const char *engine, const char *options);
/**
* Reconfigure the backing store used.
* @since 1.1
*/
EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h);
/**
* Return the internal backing store in use.
*
* @note this will foced it to be created, making future calls to
* ecore_evas_ews_engine_set() void.
*
* @see ecore_evas_ews_evas_get()
* @since 1.1
*/
EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void);
/**
* Return the internal backing store in use.
*
* @note this will foced it to be created, making future calls to
* ecore_evas_ews_engine_set() void.
*
* @see ecore_evas_ews_ecore_evas_get()
* @since 1.1
*/
EAPI Evas *ecore_evas_ews_evas_get(void);
/**
* Get the current background.
*/
EAPI Evas_Object *ecore_evas_ews_background_get(void);
/**
* Set the current background, must be created at evas ecore_evas_ews_evas_get()
*
* It will be kept at lowest layer (EVAS_LAYER_MIN) and below
* everything else. You can set any object, default is a black
* rectangle.
*
* @note previous object will be deleted!
*/
EAPI void ecore_evas_ews_background_set(Evas_Object *o);
/**
* Return all Ecore_Evas* created by EWS.
*
* @note do not change the returned list or its contents.
* @since 1.1
*/
EAPI const Eina_List *ecore_evas_ews_children_get(void);
/**
* Set the identifier of the manager taking care of internal windows.
*
* The ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE event is issued. Consider
* handling it to know if you should stop handling events yourself
* (ie: another manager took over)
*
* @param manager any unique identifier address.
*
* @see ecore_evas_ews_manager_get()
* @since 1.1
*/
EAPI void ecore_evas_ews_manager_set(const void *manager);
/**
* Get the identifier of the manager taking care of internal windows.
*
* @return the value set by ecore_evas_ews_manager_set()
* @since 1.1
*/
EAPI const void *ecore_evas_ews_manager_get(void);
EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed */
EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created */
EAPI extern int ECORE_EVAS_EWS_EVENT_DEL; /**< window was deleted, pointer is already invalid but may be used as reference for further cleanup work. */
EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized */
EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved */
EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible */
EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden */
EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused */
EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus */
EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised */
EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered */
EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated */
EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed */
EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed */
EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed */
EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed */
EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) */
/**
* @}
*/
/**
* @}
*/

View File

@ -85,7 +85,8 @@ ecore_evas_buffer.c \
ecore_evas_directfb.c \
ecore_evas_win32.c \
ecore_evas_sdl.c \
ecore_evas_wince.c
ecore_evas_wince.c \
ecore_evas_ews.c
libecore_evas_la_LIBADD = \
$(ECORE_X_LIB) \

View File

@ -181,6 +181,14 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
#else
return EINA_FALSE;
#endif
case ECORE_EVAS_ENGINE_EWS:
#ifdef BUILD_ECORE_EVAS_EWS
return EINA_TRUE;
#else
return EINA_FALSE;
#endif
default:
return EINA_FALSE;
};
@ -220,6 +228,10 @@ ecore_evas_init(void)
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
#ifdef BUILD_ECORE_EVAS_EWS
_ecore_evas_ews_events_init();
#endif
return _ecore_evas_init_count;
shutdown_ecore:
@ -251,6 +263,9 @@ ecore_evas_shutdown(void)
#ifdef BUILD_ECORE_EVAS_FB
while (_ecore_evas_fb_shutdown());
#endif
#ifdef BUILD_ECORE_EVAS_EWS
while (_ecore_evas_ews_shutdown());
#endif
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
while (_ecore_evas_buffer_shutdown());
#endif
@ -614,6 +629,14 @@ _ecore_evas_constructor_buffer(int x __UNUSED__, int y __UNUSED__, int w, int h,
}
#endif
#ifdef BUILD_ECORE_EVAS_EWS
static Ecore_Evas *
_ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_options __UNUSED__)
{
return ecore_evas_ews_new(x, y, w, h);
}
#endif
/* note: keep sorted by priority, highest first */
static const struct ecore_evas_engine _engines[] = {
/* unix */
@ -678,6 +701,10 @@ static const struct ecore_evas_engine _engines[] = {
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
{"buffer", _ecore_evas_constructor_buffer},
#endif
#ifdef BUILD_ECORE_EVAS_EWS
{"ews", _ecore_evas_constructor_ews},
#endif
{NULL, NULL}
};
@ -2212,9 +2239,30 @@ _ecore_evas_register(Ecore_Evas *ee)
(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
}
void
_ecore_evas_ref(Ecore_Evas *ee)
{
ee->refcount++;
}
void
_ecore_evas_unref(Ecore_Evas *ee)
{
ee->refcount--;
if (ee->refcount == 0)
{
if (ee->deleted) _ecore_evas_free(ee);
}
else if (ee->refcount < -1)
ERR("Ecore_Evas %p->refcount=%d < 0", ee, ee->refcount);
}
void
_ecore_evas_free(Ecore_Evas *ee)
{
ee->deleted = EINA_TRUE;
if (ee->refcount > 0) return;
if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
while (ee->sub_ecore_evas)
{

View File

@ -2,6 +2,8 @@
# include <config.h>
#endif
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
#include <Ecore.h>
#include "ecore_private.h"
#include <Ecore_Input.h>
@ -137,6 +139,7 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
return updates ? 1 : rend;
}
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
static void
_ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
{
@ -525,6 +528,7 @@ ecore_evas_buffer_new(int w, int h)
EAPI Ecore_Evas *
ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, int size), void (*free_func) (void *data, void *pix), const void *data)
{
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Evas_Engine_Info_Buffer *einfo;
Ecore_Evas *ee;
@ -651,6 +655,7 @@ ecore_evas_object_ecore_evas_get(Evas_Object *obj)
EAPI Evas_Object *
ecore_evas_object_image_new(Ecore_Evas *ee_target)
{
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Evas_Object *o;
Evas_Engine_Info_Buffer *einfo;

View File

@ -26,14 +26,13 @@ _ecore_evas_directfb_render(Ecore_Evas *ee)
Ecore_Evas *ee2;
int rend = 0;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
{
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
rend |= _ecore_evas_buffer_render(ee2);
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
}
#endif
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
updates = evas_render_updates(ee->evas);
if (updates)

File diff suppressed because it is too large Load Diff

View File

@ -198,19 +198,17 @@ _ecore_evas_fb_render(Ecore_Evas *ee)
{
Eina_List *updates;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Eina_List *ll;
Ecore_Evas *ee2;
#endif
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
{
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
rend |= _ecore_evas_buffer_render(ee2);
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
}
#endif
updates = evas_render_updates(ee->evas);
if (updates)
{

View File

@ -58,7 +58,7 @@
# include "Ecore_DirectFB.h"
#endif
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
# include <Evas_Engine_Buffer.h>
#endif
@ -184,6 +184,7 @@ struct _Ecore_Evas_Engine
{
Ecore_Evas_Engine_Func *func;
/* TODO: UGLY! This should be an union or inheritance! */
#ifdef BUILD_ECORE_EVAS_X11
struct
{
@ -259,6 +260,11 @@ struct _Ecore_Evas_Engine
} state;
} wince;
#endif
#ifdef BUILD_ECORE_EVAS_EWS
struct {
Evas_Object *image;
} ews;
#endif
Ecore_Timer *idle_flush_timer;
};
@ -345,13 +351,19 @@ struct _Ecore_Evas
Ecore_Evas_Engine engine;
Eina_List *sub_ecore_evas;
int refcount;
unsigned char ignore_events : 1;
unsigned char manual_render : 1;
unsigned char registered : 1;
unsigned char no_comp_sync : 1;
unsigned char semi_sync : 1;
unsigned char deleted : 1;
};
void _ecore_evas_ref(Ecore_Evas *ee);
void _ecore_evas_unref(Ecore_Evas *ee);
#ifdef BUILD_ECORE_EVAS_X11
int _ecore_evas_x_shutdown(void);
#endif
@ -371,6 +383,10 @@ int _ecore_evas_win32_shutdown(void);
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
int _ecore_evas_wince_shutdown(void);
#endif
#ifdef BUILD_ECORE_EVAS_EWS
void _ecore_evas_ews_events_init(void);
int _ecore_evas_ews_shutdown(void);
#endif
void _ecore_evas_fps_debug_init(void);
void _ecore_evas_fps_debug_shutdown(void);

View File

@ -119,8 +119,6 @@ static int
_ecore_evas_sdl_render(Ecore_Evas *ee)
{
int rend = 0;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Eina_List *ll;
Ecore_Evas *ee2;
@ -130,7 +128,6 @@ _ecore_evas_sdl_render(Ecore_Evas *ee)
rend |= _ecore_evas_buffer_render(ee2);
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
}
#endif
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);

View File

@ -48,7 +48,6 @@ _ecore_evas_win32_render(Ecore_Evas *ee)
{
int rend = 0;
Eina_List *updates = NULL;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Eina_List *ll;
Ecore_Evas *ee2;
@ -58,7 +57,7 @@ _ecore_evas_win32_render(Ecore_Evas *ee)
rend |= _ecore_evas_buffer_render(ee2);
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
}
#endif
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
if (ee->prop.avoid_damage)
{

View File

@ -46,7 +46,6 @@ _ecore_evas_wince_render(Ecore_Evas *ee)
{
int rend = 0;
Eina_List *updates = NULL;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Eina_List *ll;
Ecore_Evas *ee2;
@ -56,7 +55,7 @@ _ecore_evas_wince_render(Ecore_Evas *ee)
rend |= _ecore_evas_buffer_render(ee2);
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
}
#endif
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
if (ee->prop.avoid_damage)
{

View File

@ -236,8 +236,6 @@ _ecore_evas_x_render(Ecore_Evas *ee)
{
int rend = 0;
Eina_List *updates = NULL;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
Eina_List *ll;
Ecore_Evas *ee2;
@ -252,7 +250,6 @@ _ecore_evas_x_render(Ecore_Evas *ee)
rend |= _ecore_evas_buffer_render(ee2);
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
}
#endif
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
updates = evas_render_updates(ee->evas);