From 5b7eba51e8d92bbdd5955b604ab1ea8c05cf7849 Mon Sep 17 00:00:00 2001 From: raster Date: Mon, 20 Jun 2011 06:58:33 +0000 Subject: [PATCH] From: Ulrich Eckhardt Subject: [E-devel] XRender engine causes ecore build failure while building ecore. The problem is that this engine was removed from evas but not yet completely from ecore. I was on IRC with Vincent Torri (vtorri) and Daniel Juyung Seo (SeoZ) and the consensus was to remove the code for the XRender engines, both the Xlib and XCB versions. There is a switch over the different engine types, where there are still a few places left where XRender is handled, grep for "xrender" or "XRENDER" and you will find them. The question is whether to just return NULL in order to signal that this engine is not supported or to remove the whole thing. The latter could break binary compatibility, therefore I left those stubs in. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@60502 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 5 + configure.ac | 24 +- src/lib/ecore_evas/Makefile.am | 4 +- src/lib/ecore_evas/ecore_evas.c | 30 --- src/lib/ecore_evas/ecore_evas_private.h | 8 - src/lib/ecore_evas/ecore_evas_x.c | 406 +------------------------------- 6 files changed, 11 insertions(+), 466 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb9bff9..082443d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -229,3 +229,8 @@ * ecore_con_server_timeout_get/set now applies to client-type servers +2011-06-20 Ulrich Eckhardt + + * Removed support for evas xrender engine from ecore-evas as + it is not a deprecated engine in evas and no longer needs support. + diff --git a/configure.ac b/configure.ac index d689ee8..74dc0ec 100644 --- a/configure.ac +++ b/configure.ac @@ -146,12 +146,10 @@ want_ecore_x_input="yes" want_ecore_evas="yes" want_ecore_evas_software_buffer="yes" want_ecore_evas_software_x11="no" -want_ecore_evas_xrender_x11="no" want_ecore_evas_opengl_x11="no" want_ecore_evas_software_16_x11="no" want_ecore_evas_software_8_x11="no" want_ecore_evas_software_xcb="no" -want_ecore_evas_xrender_xcb="no" want_ecore_evas_software_gdi="no" want_ecore_evas_software_ddraw="no" want_ecore_evas_direct3d="no" @@ -208,12 +206,10 @@ case "$host_os" in want_ecore_imf="yes" want_ecore_x="yes" want_ecore_evas_software_x11="yes" - want_ecore_evas_xrender_x11="yes" want_ecore_evas_opengl_x11="yes" want_ecore_evas_software_16_x11="yes" want_ecore_evas_software_8_x11="yes" want_ecore_evas_software_xcb="yes" - want_ecore_evas_xrender_xcb="yes" want_ecore_evas_software_sdl="yes" want_ecore_evas_gl_sdl="yes" want_ecore_evas_directfb="yes" @@ -1277,13 +1273,6 @@ if test "x$have_ecore_evas_software_x11" = "xyes" ; then fi fi -# ecore_evas_xrender_x11 - -ECORE_EVAS_CHECK_MODULE([xrender-x11], - [${want_ecore_evas_xrender_x11}], - [XRender Xlib], - [${have_ecore_x_xlib}]) - # ecore_evas_opengl_x11 ECORE_EVAS_CHECK_MODULE([opengl-x11], @@ -1304,20 +1293,11 @@ ECORE_EVAS_CHECK_MODULE([software-8-x11], $have_ecore_x_xcb) -# ecore_evas_xrender_xcb - -ECORE_EVAS_CHECK_MODULE([xrender-xcb], - [${want_ecore_evas_xrender_xcb}], - [XRender XCB], - [${ecore_evas_xcb_deps}]) - if test "x$have_ecore_evas_software_x11" = "xyes" -o \ - "x$have_ecore_evas_xrender_x11" = "xyes" -o \ "x$have_ecore_evas_opengl_x11" = "xyes" -o \ "x$have_ecore_evas_software_8_x11" = "xyes" -o \ "x$have_ecore_evas_software_16_x11" = "xyes" -o \ - "x$have_ecore_evas_software_xcb" = "xyes" -o \ - "x$have_ecore_evas_xrender_xcb" = "xyes"; then + "x$have_ecore_evas_software_xcb" = "xyes"; then AC_DEFINE(BUILD_ECORE_EVAS_X11, 1, [Support for X Window Engines in Ecore_Evas]) requirements_ecore_evas="ecore-x >= 1.0.0 ${requirements_ecore_evas}" fi @@ -1581,9 +1561,7 @@ if test "x${have_ecore_evas}" = "xyes" ; then else echo " Software X11...............: $have_ecore_evas_software_x11" fi - echo " XRender X11................: $have_ecore_evas_xrender_x11" echo " OpenGL X11.................: $have_ecore_evas_opengl_x11" - echo " XRender XCB................: $have_ecore_evas_xrender_xcb" echo " Software GDI...............: $have_ecore_evas_software_gdi" echo " Software DirectDraw........: $have_ecore_evas_software_ddraw" echo " Direct3D...................: $have_ecore_evas_direct3d" diff --git a/src/lib/ecore_evas/Makefile.am b/src/lib/ecore_evas/Makefile.am index 946472b..aca5c04 100644 --- a/src/lib/ecore_evas/Makefile.am +++ b/src/lib/ecore_evas/Makefile.am @@ -1,8 +1,8 @@ MAINTAINERCLEANFILES = Makefile.in if BUILD_ECORE_X -ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x @x_cflags@ @XRENDER_CFLAGS@ @XCB_CFLAGS@ @XCB_RENDER_CFLAGS@ -ECORE_X_LIB = $(top_builddir)/src/lib/ecore_x/libecore_x.la @x_libs@ @XRENDER_LIBS@ @XCB_LIBS@ @XCB_RENDER_LIBS@ +ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x @x_cflags@ @XCB_CFLAGS@ +ECORE_X_LIB = $(top_builddir)/src/lib/ecore_x/libecore_x.la @x_libs@ @XCB_LIBS@ else ECORE_X_INC = ECORE_X_LIB = diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index f5e65ec..46f88f1 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -86,11 +86,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine) return 0; #endif case ECORE_EVAS_ENGINE_XRENDER_X11: -#ifdef BUILD_ECORE_EVAS_XRENDER_X11 - return 1; -#else return 0; -#endif case ECORE_EVAS_ENGINE_OPENGL_X11: #ifdef BUILD_ECORE_EVAS_OPENGL_X11 return 1; @@ -104,11 +100,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine) return 0; #endif case ECORE_EVAS_ENGINE_XRENDER_XCB: -#ifdef BUILD_ECORE_EVAS_XRENDER_XCB - return 1; -#else return 0; -#endif case ECORE_EVAS_ENGINE_SOFTWARE_GDI: #ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI return 1; @@ -419,22 +411,6 @@ _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_opti } #endif -#ifdef BUILD_ECORE_EVAS_XRENDER_X11 -static Ecore_Evas * -_ecore_evas_constructor_xrender_x11(int x, int y, int w, int h, const char *extra_options) -{ - unsigned int parent = 0; - char *disp_name = NULL; - Ecore_Evas *ee; - - _ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent); - ee = ecore_evas_xrender_x11_new(disp_name, parent, x, y, w, h); - free(disp_name); - - return ee; -} -#endif - #ifdef BUILD_ECORE_EVAS_OPENGL_X11 static Ecore_Evas * _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options) @@ -662,12 +638,6 @@ static const struct ecore_evas_engine _engines[] = { #ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11 {"software_8_x11", _ecore_evas_constructor_software_8_x11}, #endif -#ifdef BUILD_ECORE_EVAS_XRENDER_X11 - {"xrender_x11", _ecore_evas_constructor_xrender_x11}, -#endif -#ifdef BUILD_ECORE_EVAS_XRENDER_XCB - {"xrender_xcb", _ecore_evas_constructor_xrender_x11}, -#endif #ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11 {"software_16_x11", _ecore_evas_constructor_software_16_x11}, #endif diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 080e530..2ab7b03 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -31,10 +31,6 @@ # ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB # include # endif -# ifdef BUILD_ECORE_EVAS_XRENDER_XCB -# include -# include -# endif # ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11 # include # endif @@ -45,10 +41,6 @@ # ifdef BUILD_ECORE_EVAS_SOFTWARE_XLIB # include # endif -# ifdef BUILD_ECORE_EVAS_XRENDER_X11 -# include -# include -# endif # ifdef BUILD_ECORE_EVAS_OPENGL_X11 # include # endif diff --git a/src/lib/ecore_evas/ecore_evas_x.c b/src/lib/ecore_evas/ecore_evas_x.c index 591a210..7961533 100644 --- a/src/lib/ecore_evas/ecore_evas_x.c +++ b/src/lib/ecore_evas/ecore_evas_x.c @@ -13,11 +13,9 @@ #else # undef BUILD_ECORE_EVAS_OPENGL_X11 # undef BUILD_ECORE_EVAS_SOFTWARE_X11 -# undef BUILD_ECORE_EVAS_XRENDER_X11 #endif #ifndef HAVE_ECORE_X_XCB -# undef BUILD_ECORE_EVAS_XRENDER_XCB # undef BUILD_ECORE_EVAS_SOFTWARE_XCB #endif @@ -508,36 +506,6 @@ _ecore_evas_x_resize_shape(Ecore_Evas *ee) } #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ } - else if (!strcmp(ee->driver, "xrender_x11")) - { -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) - Evas_Engine_Info_XRender_X11 *einfo; - - einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(ee->evas); - if (einfo) - { - unsigned int foreground; - Ecore_X_GC gc; - - if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask); - ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1); - foreground = 0; - gc = ecore_x_gc_new(ee->engine.x.mask, - ECORE_X_GC_VALUE_MASK_FOREGROUND, - &foreground); - ecore_x_drawable_rectangle_fill(ee->engine.x.mask, gc, - 0, 0, ee->w, ee->h); - ecore_x_gc_free(gc); - einfo->info.mask = ee->engine.x.mask; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); - } - evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); - - } -#endif /* BUILD_ECORE_EVAS_XRENDER_X11 || BUILD_ECORE_EVAS_XRENDER_XCB */ - } else if (!strcmp(ee->driver, "software_16_x11")) { #if BUILD_ECORE_EVAS_SOFTWARE_16_X11 @@ -1597,7 +1565,6 @@ static void _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) { if (ee->rotation == rotation) return; - if (!strcmp(ee->driver, "xrender_x11")) return; if (!strcmp(ee->driver, "opengl_x11")) { #ifdef BUILD_ECORE_EVAS_OPENGL_X11 @@ -1700,52 +1667,6 @@ _ecore_evas_x_shaped_set(Ecore_Evas *ee, int shaped) } #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ } - else if (!strcmp(ee->driver, "xrender_x11")) - { -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) - Evas_Engine_Info_XRender_X11 *einfo; - - ee->shaped = shaped; - einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(ee->evas); - if (einfo) - { - if (ee->shaped) - { - unsigned int foreground; - Ecore_X_GC gc; - - if (!ee->engine.x.mask) - ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1); - foreground = 0; - gc = ecore_x_gc_new(ee->engine.x.mask, - ECORE_X_GC_VALUE_MASK_FOREGROUND, - &foreground); - ecore_x_drawable_rectangle_fill(ee->engine.x.mask, gc, - 0, 0, ee->w, ee->h); - ecore_x_gc_free(gc); - einfo->info.mask = ee->engine.x.mask; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); - } - evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); - ecore_x_window_shape_input_mask_set(ee->prop.window, 0); - } - else - { - if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask); - ee->engine.x.mask = 0; - einfo->info.mask = 0; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); - } - ecore_x_window_shape_mask_set(ee->prop.window, 0); - ecore_x_window_shape_input_mask_set(ee->prop.window, 0); - } - } -#endif /* BUILD_ECORE_EVAS_XRENDER_X11 || BUILD_ECORE_EVAS_XRENDER_XCB */ - } else if (!strcmp(ee->driver, "software_16_x11")) { #if BUILD_ECORE_EVAS_SOFTWARE_16_X11 @@ -2068,100 +1989,6 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) // putenv((char*)"DESKTOP_STARTUP_ID="); } } - else if (!strcmp(ee->driver, "xrender_x11")) - { -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) - Evas_Engine_Info_XRender_X11 *einfo; - - einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(ee->evas); - if (!einfo) return; - if (!ecore_x_composite_query()) return; - - ee->shaped = 0; - ee->alpha = alpha; - ecore_x_window_free(ee->prop.window); - ecore_event_window_unregister(ee->prop.window); - if (ee->alpha) - { - if (ee->prop.override) - ee->prop.window = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); - else - ee->prop.window = ecore_x_window_argb_new(ee->engine.x.win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); - if (!ee->engine.x.mask) - ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->req.w, ee->req.h, 1); - } - else - { - if (ee->prop.override) - ee->prop.window = ecore_x_window_override_new(ee->engine.x.win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); - else - ee->prop.window = ecore_x_window_new(ee->engine.x.win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); - if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask); - ee->engine.x.mask = 0; - ecore_x_window_shape_input_mask_set(ee->prop.window, 0); - } - - einfo->info.destination_alpha = alpha; - -# ifdef BUILD_ECORE_EVAS_XRENDER_XCB - cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->prop.window); - reply_attr = xcb_get_window_attributes_reply(ecore_x_connection_get(), cookie_attr, NULL); - - einfo->info.visual = reply_attr->visual; - free(reply_attr); -# else - XGetWindowAttributes(ecore_x_display_get(), ee->prop.window, &att); - einfo->info.visual = att.visual; -# endif /* ! BUILD_ECORE_EVAS_XRENDER_XCB */ - -// if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask); -// ee->engine.x.mask = 0; - einfo->info.mask = ee->engine.x.mask; - einfo->info.drawable = ee->prop.window; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); - } - evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h); - ecore_x_window_shape_mask_set(ee->prop.window, 0); - ecore_x_input_multi_select(ee->prop.window); - ecore_event_window_register(ee->prop.window, ee, ee->evas, - (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, - (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, - (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, - (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); - if (ee->prop.borderless) - ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless); - if (ee->visible) ecore_x_window_show(ee->prop.window); - if (ee->prop.focused) ecore_x_window_focus(ee->prop.window); - if (ee->prop.title) - { - ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); - ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); - } - ecore_x_icccm_hints_set(ee->prop.window, - 1 /* accepts_focus */, - ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, - 0 /* icon_pixmap */, - 0 /* icon_mask */, - 0 /* icon_window */, - 0 /* window_group */, - 0 /* is_urgent */); - _ecore_evas_x_group_leader_update(ee); - ecore_x_window_defaults_set(ee->prop.window); - _ecore_evas_x_protocols_set(ee); - _ecore_evas_x_sync_set(ee); -#endif /* BUILD_ECORE_EVAS_XRENDER_X11 || BUILD_ECORE_EVAS_XRENDER_XCB */ - if (getenv("DESKTOP_STARTUP_ID")) - { - ecore_x_netwm_startup_id_set(ee->prop.window, - getenv("DESKTOP_STARTUP_ID")); - /* NB: on linux this may simply empty the env as opposed to completely - * unset it to being empty - unsure as solartis libc crashes looking - * for the '=' char */ - // putenv((char*)"DESKTOP_STARTUP_ID="); - } - } else if (!strcmp(ee->driver, "software_16_x11")) { #if BUILD_ECORE_EVAS_SOFTWARE_16_X11 @@ -2682,19 +2509,6 @@ _ecore_evas_x_reinit_win(Ecore_Evas *ee) } #endif } - else if (!strcmp(ee->driver, "xrender_x11")) - { -#ifdef BUILD_ECORE_EVAS_XRENDER_X11 - Evas_Engine_Info_XRender_X11 *einfo; - - einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(ee->evas); - if (einfo) - { - einfo->info.drawable = ee->prop.window; - evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); - } -#endif - } else if (!strcmp(ee->driver, "opengl_x11")) { #ifdef BUILD_ECORE_EVAS_OPENGL_X11 @@ -2744,7 +2558,6 @@ _ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on) { if (ee->prop.avoid_damage == on) return; if (!strcmp(ee->driver, "opengl_x11")) return; - if (!strcmp(ee->driver, "xrender_x11")) return; if (!strcmp(ee->driver, "software_x11")) { @@ -2998,7 +2811,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func = * ecore_x_init in 2 functions and suppress some round trips. */ -#if defined (BUILD_ECORE_EVAS_SOFTWARE_X11) || defined (BUILD_ECORE_EVAS_OPENGL_X11) || defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) || defined (BUILD_ECORE_EVAS_SOFTWARE_16_X11) || defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11) +#if defined (BUILD_ECORE_EVAS_SOFTWARE_X11) || defined (BUILD_ECORE_EVAS_OPENGL_X11) || defined (BUILD_ECORE_EVAS_SOFTWARE_16_X11) || defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11) static void _ecore_evas_x_flush_pre(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__) { @@ -3691,269 +3504,56 @@ ecore_evas_gl_x11_pre_post_swap_callback_set(const Ecore_Evas *ee __UNUSED__, vo /** * To be documented. * - * FIXME: To be fixed. + * FIXME: To be fixed or maybe removed rather? */ -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) -EAPI Ecore_Evas * -ecore_evas_xrender_x11_new(const char *disp_name, Ecore_X_Window parent, - int x, int y, int w, int h) -{ - Evas_Engine_Info_XRender_X11 *einfo; - Ecore_Evas *ee; - int rmethod; - - rmethod = evas_render_method_lookup("xrender_x11"); - if (!rmethod) return NULL; - if (!ecore_x_init(disp_name)) return NULL; - ee = calloc(1, sizeof(Ecore_Evas)); - if (!ee) return NULL; - - ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS); - - _ecore_evas_x_init(); - - ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func; - - ee->driver = "xrender_x11"; - if (disp_name) ee->name = strdup(disp_name); - - if (w < 1) w = 1; - if (h < 1) h = 1; - ee->x = x; - ee->y = y; - ee->w = w; - ee->h = h; - ee->req.x = ee->x; - ee->req.y = ee->y; - ee->req.w = ee->w; - ee->req.h = ee->h; - - ee->prop.max.w = 32767; - ee->prop.max.h = 32767; - ee->prop.layer = 4; - ee->prop.request_pos = 0; - ee->prop.sticky = 0; - ee->engine.x.state.sticky = 0; - - /* init evas here */ - ee->evas = evas_new(); - evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _ecore_evas_x_flush_pre, ee); - evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _ecore_evas_x_flush_post, ee); - evas_data_attach_set(ee->evas, ee); - evas_output_method_set(ee->evas, rmethod); - evas_output_size_set(ee->evas, w, h); - evas_output_viewport_set(ee->evas, 0, 0, w, h); - - ee->engine.x.win_root = parent; - ee->prop.window = ecore_x_window_new(parent, x, y, w, h); - if (getenv("DESKTOP_STARTUP_ID")) - { - ecore_x_netwm_startup_id_set(ee->prop.window, - getenv("DESKTOP_STARTUP_ID")); - /* NB: on linux this may simply empty the env as opposed to completely - * unset it to being empty - unsure as solartis libc crashes looking - * for the '=' char */ -// putenv((char*)"DESKTOP_STARTUP_ID="); - } - einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(ee->evas); - if (einfo) - { -# ifdef BUILD_ECORE_EVAS_XRENDER_XCB - xcb_screen_iterator_t iter; - xcb_screen_t *screen; - - /* FIXME: this is inefficient as its a round trip */ - screen = ecore_x_default_screen_get(); - iter = xcb_setup_roots_iterator (xcb_get_setup (ecore_x_connection_get())); - if (iter.rem > 1) - { - xcb_get_geometry_cookie_t cookie; - xcb_get_geometry_reply_t *reply; - Ecore_X_Window *roots; - int num; - uint8_t i; - - num = 0; - cookie = xcb_get_geometry_unchecked(ecore_x_connection_get(), parent); - roots = ecore_x_window_root_list(&num); - if (roots) - { - reply = xcb_get_geometry_reply(ecore_x_connection_get(), cookie, NULL); - - if (reply) - { - for (i = 0; i < num; xcb_screen_next (&iter), i++) - { - if (reply->root == roots[i]) - { - screen = iter.data; - break; - } - } - free(reply); - } - free(roots); - } - else - { - reply = xcb_get_geometry_reply(ecore_x_connection_get(), cookie, NULL); - if (reply) free(reply); - } - } - einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XCB; - einfo->info.connection = ecore_x_connection_get(); - einfo->info.screen = screen; - einfo->info.visual = screen->root_visual; -# elif BUILD_ECORE_EVAS_XRENDER_X11 - int screen; - - /* FIXME: this is inefficient as its a round trip */ - screen = DefaultScreen(ecore_x_display_get()); - if (ScreenCount(ecore_x_display_get()) > 1) - { - Ecore_X_Window *roots; - int num, i; - - num = 0; - roots = ecore_x_window_root_list(&num); - if (roots) - { - XWindowAttributes at; - - if (XGetWindowAttributes(ecore_x_display_get(), - parent, &at)) - { - for (i = 0; i < num; i++) - { - if (at.root == roots[i]) - { - screen = i; - break; - } - } - } - free(roots); - } - } - einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XLIB; - einfo->info.connection = ecore_x_display_get(); - einfo->info.screen = NULL; - einfo->info.visual = DefaultVisual(ecore_x_display_get(), screen); -# endif /* BUILD_ECORE_EVAS_XRENDER_(XCB|X11) */ - einfo->info.drawable = ee->prop.window; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver); - ecore_evas_free(ee); - return NULL; - } - } - - ecore_x_icccm_hints_set(ee->prop.window, - 1 /* accepts_focus */, - ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, - 0 /* icon_pixmap */, - 0 /* icon_mask */, - 0 /* icon_window */, - 0 /* window_group */, - 0 /* is_urgent */); - _ecore_evas_x_group_leader_set(ee); - ecore_x_window_defaults_set(ee->prop.window); - _ecore_evas_x_protocols_set(ee); - _ecore_evas_x_sync_set(ee); - - ee->engine.func->fn_render = _ecore_evas_x_render; - _ecore_evas_register(ee); - ecore_x_input_multi_select(ee->prop.window); - ecore_event_window_register(ee->prop.window, ee, ee->evas, - (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, - (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, - (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, - (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); - return ee; -} -#else EAPI Ecore_Evas * ecore_evas_xrender_x11_new(const char *disp_name __UNUSED__, Ecore_X_Window parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) { return NULL; } -#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */ /** * To be documented. * - * FIXME: To be fixed. + * FIXME: To be fixed or maybe removed rather? */ -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) -EAPI Ecore_X_Window -ecore_evas_xrender_x11_window_get(const Ecore_Evas *ee) -{ - return (Ecore_X_Window) ecore_evas_window_get(ee); -} -#else EAPI Ecore_X_Window ecore_evas_xrender_x11_window_get(const Ecore_Evas *ee __UNUSED__) { return 0; } -#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */ /** * To be documented. * * FIXME: To be fixed. */ -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) -EAPI void -ecore_evas_xrender_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on) -{ - ee->engine.x.direct_resize = on; -} -#else EAPI void ecore_evas_xrender_x11_direct_resize_set(Ecore_Evas *ee __UNUSED__, Eina_Bool on __UNUSED__) { } -#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */ /** * To be documented. * * FIXME: To be fixed. */ -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) -EAPI Eina_Bool -ecore_evas_xrender_x11_direct_resize_get(const Ecore_Evas *ee) -{ - return ee->engine.x.direct_resize; -} -#else EAPI Eina_Bool ecore_evas_xrender_x11_direct_resize_get(const Ecore_Evas *ee __UNUSED__) { return 0; } -#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */ /** * To be documented. * * FIXME: To be fixed. */ -#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB) -EAPI void -ecore_evas_xrender_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win) -{ - ecore_evas_software_x11_extra_event_window_add(ee, win); -} -#else EAPI void ecore_evas_xrender_x11_extra_event_window_add(Ecore_Evas *ee __UNUSED__, Ecore_X_Window win __UNUSED__) { } -#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */ /** * To be documented. -- 2.7.4