From: Alexander Kerner <alexander.kerner@googlemail.com>
Subject: [E-devel] 8bpp xcb evas engine Hi all, I've implemented the 8bpp grayscale evas engine. It is based on the 16bpp engine. It would be nice if someone could review the code and maybe commit into svn. The patches against evas and ecore are attached. SVN revision: 50561
This commit is contained in:
parent
0ec2a33a22
commit
ba10bce434
|
@ -145,6 +145,7 @@ 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"
|
||||
|
@ -209,6 +210,7 @@ case "$host_os" in
|
|||
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"
|
||||
|
@ -1198,6 +1200,12 @@ ECORE_EVAS_CHECK_MODULE([software-16-x11],
|
|||
[Software Xlib 16 bits],
|
||||
[${have_ecore_x_xlib}])
|
||||
|
||||
ECORE_EVAS_CHECK_MODULE([software-8-x11],
|
||||
[$want_ecore_evas_software_8_x11],
|
||||
[Software 8bit X11],
|
||||
$have_ecore_x_xcb)
|
||||
|
||||
|
||||
# ecore_evas_xrender_xcb
|
||||
|
||||
ECORE_EVAS_CHECK_MODULE([xrender-xcb],
|
||||
|
@ -1208,6 +1216,7 @@ ECORE_EVAS_CHECK_MODULE([xrender-xcb],
|
|||
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
|
||||
|
@ -1491,6 +1500,7 @@ if test "x${have_ecore_evas}" = "xyes" ; then
|
|||
echo " OpenGL SDL.................: $have_ecore_evas_opengl_sdl"
|
||||
echo " DirectFB...................: $have_ecore_evas_directfb"
|
||||
echo " Software Framebuffer.......: $have_ecore_evas_fb"
|
||||
echo " Software 8bit grayscale XCB: $have_ecore_evas_software_8_x11"
|
||||
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"
|
||||
|
|
|
@ -84,6 +84,7 @@ typedef enum _Ecore_Evas_Engine_Type
|
|||
ECORE_EVAS_ENGINE_SOFTWARE_SDL,
|
||||
ECORE_EVAS_ENGINE_DIRECTFB,
|
||||
ECORE_EVAS_ENGINE_SOFTWARE_FB,
|
||||
ECORE_EVAS_ENGINE_SOFTWARE_8_X11,
|
||||
ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
|
||||
ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
|
||||
ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
|
||||
|
@ -170,6 +171,13 @@ EAPI void ecore_evas_xrender_x11_direct_resize_set(Ecore_Evas *ee, in
|
|||
EAPI int ecore_evas_xrender_x11_direct_resize_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_xrender_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
|
||||
|
||||
EAPI Ecore_Evas *ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
|
||||
EAPI Ecore_X_Window ecore_evas_software_x11_8_window_get(const Ecore_Evas *ee);
|
||||
EAPI Ecore_X_Window ecore_evas_software_x11_8_subwindow_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_software_x11_8_direct_resize_set(Ecore_Evas *ee, int on);
|
||||
EAPI int ecore_evas_software_x11_8_direct_resize_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_software_x11_8_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win);
|
||||
|
||||
EAPI Ecore_Evas *ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
|
||||
EAPI Ecore_X_Window ecore_evas_software_x11_16_window_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_software_x11_16_direct_resize_set(Ecore_Evas *ee, int on);
|
||||
|
|
|
@ -158,6 +158,13 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
|
|||
return 0;
|
||||
#endif
|
||||
|
||||
case ECORE_EVAS_ENGINE_SOFTWARE_8_X11:
|
||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
case ECORE_EVAS_ENGINE_SOFTWARE_16_X11:
|
||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
|
||||
return 1;
|
||||
|
@ -443,6 +450,22 @@ _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
static Ecore_Evas *
|
||||
_ecore_evas_constructor_software_8_x11(int x, int y, int w, int h, const char *extra_options)
|
||||
{
|
||||
Ecore_X_Window parent = 0;
|
||||
char *disp_name = NULL;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
_ecore_evas_parse_extra_options_x(extra_options, &disp_name, &parent);
|
||||
ee = ecore_evas_software_x11_8_new(disp_name, parent, x, y, w, h);
|
||||
free(disp_name);
|
||||
|
||||
return ee;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
|
||||
static Ecore_Evas *
|
||||
_ecore_evas_constructor_software_16_x11(int x, int y, int w, int h, const char *extra_options)
|
||||
|
@ -641,6 +664,9 @@ static const struct ecore_evas_engine _engines[] = {
|
|||
#ifdef BUILD_ECORE_EVAS_XRENDER_XCB
|
||||
{"xrender_xcb", _ecore_evas_constructor_xrender_x11},
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
{"software_8_x11", _ecore_evas_constructor_software_8_x11},
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
|
||||
{"software_16_x11", _ecore_evas_constructor_software_16_x11},
|
||||
#endif
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
# include <xcb/render.h>
|
||||
# include <Evas_Engine_XRender_X11.h>
|
||||
# endif
|
||||
# ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
# include <Evas_Engine_Software_8_X11.h>
|
||||
# endif
|
||||
# endif
|
||||
# ifdef HAVE_ECORE_X_XLIB
|
||||
# include <X11/Xlib.h>
|
||||
|
|
|
@ -494,6 +494,35 @@ _ecore_evas_x_resize_shape(Ecore_Evas *ee)
|
|||
# endif /* XXX no shaped window support for software_16_x11 */
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
|
||||
}
|
||||
if (!strcmp(ee->driver, "software_8_x11"))
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
Evas_Engine_Info_Software_8_X11 *einfo;
|
||||
|
||||
einfo = (Evas_Engine_Info_Software_8_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_SOFTWARE_8_X11 */
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: we need to make this work for all the states, not just sticky */
|
||||
|
@ -1513,6 +1542,18 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
|
|||
(ee, rotation, resize, (Evas_Engine_Info *)einfo);
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
|
||||
}
|
||||
else if (!strcmp(ee->driver, "software_8_x11"))
|
||||
{
|
||||
#if BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
Evas_Engine_Info_Software_8_X11 *einfo;
|
||||
|
||||
einfo = (Evas_Engine_Info_Software_8_X11 *)evas_engine_info_get(ee->evas);
|
||||
if (!einfo) return;
|
||||
einfo->info.rotation = rotation;
|
||||
_ecore_evas_x_rotation_set_internal
|
||||
(ee, rotation, resize, (Evas_Engine_Info *)einfo);
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1648,7 +1689,49 @@ _ecore_evas_x_shaped_set(Ecore_Evas *ee, int shaped)
|
|||
# endif /* XXX no shaped window support for software_16_x11 */
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
|
||||
}
|
||||
if (!strcmp(ee->driver, "software_8_x11"))
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
Evas_Engine_Info_Software_8_X11 *einfo;
|
||||
|
||||
einfo = (Evas_Engine_Info_Software_8_X11 *)evas_engine_info_get(ee->evas);
|
||||
ee->shaped = shaped;
|
||||
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;
|
||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||
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_SOFTWARE_8_X11 */
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME, round trip */
|
||||
|
@ -2044,6 +2127,94 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
|
|||
// putenv((char*)"DESKTOP_STARTUP_ID=");
|
||||
}
|
||||
}
|
||||
else if (!strcmp(ee->driver, "software_8_x11"))
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
Evas_Engine_Info_Software_8_X11 *einfo;
|
||||
|
||||
einfo = (Evas_Engine_Info_Software_8_X11 *)evas_engine_info_get(ee->evas);
|
||||
if (!einfo) 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;
|
||||
|
||||
cookie_geom = xcb_get_geometry_unchecked(ecore_x_connection_get(), ee->prop.window);
|
||||
cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->prop.window);
|
||||
|
||||
reply_geom = xcb_get_geometry_reply(ecore_x_connection_get(), cookie_geom, NULL);
|
||||
reply_attr = xcb_get_window_attributes_reply(ecore_x_connection_get(), cookie_attr, NULL);
|
||||
einfo->info.visual = xcb_visualtype_get(ecore_x_default_screen_get(), reply_attr->visual);
|
||||
einfo->info.colormap = reply_attr->colormap;
|
||||
einfo->info.depth = reply_geom->depth;
|
||||
free(reply_geom);
|
||||
free(reply_attr);
|
||||
|
||||
// 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);
|
||||
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_protocols_set(ee);
|
||||
_ecore_evas_x_sync_set(ee);
|
||||
|
||||
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=");
|
||||
}
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2552,6 +2723,63 @@ _ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on)
|
|||
}
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
|
||||
}
|
||||
else if (!strcmp(ee->driver, "software_8_x11"))
|
||||
{
|
||||
#if BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
Evas_Engine_Info_Software_8_X11 *einfo;
|
||||
|
||||
ee->prop.avoid_damage = on;
|
||||
einfo = (Evas_Engine_Info_Software_8_X11 *)evas_engine_info_get(ee->evas);
|
||||
if (einfo)
|
||||
{
|
||||
if (ee->prop.avoid_damage)
|
||||
{
|
||||
ee->engine.x.pmap = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, einfo->info.depth);
|
||||
ee->engine.x.gc = ecore_x_gc_new(ee->engine.x.pmap, 0, NULL);
|
||||
einfo->info.drawable = ee->engine.x.pmap;
|
||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||
{
|
||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||
}
|
||||
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
||||
else
|
||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||
if (ee->prop.avoid_damage == ECORE_EVAS_AVOID_DAMAGE_BUILT_IN)
|
||||
{
|
||||
ee->engine.x.using_bg_pixmap = 1;
|
||||
ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
|
||||
ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
|
||||
}
|
||||
if (ee->engine.x.direct_resize)
|
||||
{
|
||||
/* Turn this off for now
|
||||
ee->engine.x.using_bg_pixmap = 1;
|
||||
ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
|
||||
*/
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ee->engine.x.pmap) ecore_x_pixmap_free(ee->engine.x.pmap);
|
||||
if (ee->engine.x.gc) ecore_x_gc_free(ee->engine.x.gc);
|
||||
if (ee->engine.x.using_bg_pixmap)
|
||||
{
|
||||
ecore_x_window_pixmap_set(ee->prop.window, 0);
|
||||
ee->engine.x.using_bg_pixmap = 0;
|
||||
ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
|
||||
}
|
||||
ee->engine.x.pmap = 0;
|
||||
ee->engine.x.gc = 0;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -2631,7 +2859,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
|
|||
* ecore_x_init in 2 functions and supress 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)
|
||||
#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)
|
||||
static void
|
||||
_ecore_evas_x_flush_pre(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -3796,3 +4024,305 @@ ecore_evas_software_x11_16_extra_event_window_add(Ecore_Evas *ee __UNUSED__, Eco
|
|||
{
|
||||
}
|
||||
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
|
||||
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
EAPI Ecore_Evas *
|
||||
ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
Evas_Engine_Info_Software_8_X11 *einfo;
|
||||
Ecore_Evas *ee;
|
||||
int argb = 0;
|
||||
int rmethod;
|
||||
static int redraw_debug = -1;
|
||||
|
||||
rmethod = evas_render_method_lookup("software_8_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 = "software_8_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;
|
||||
// if (parent != 0)
|
||||
// {
|
||||
// /* FIXME: round trip in ecore_x_window_argb_get */
|
||||
// if (ecore_x_window_argb_get(parent))
|
||||
// {
|
||||
// ee->engine.x.win = ecore_x_window_argb_new(parent, x, y, w, h);
|
||||
// argb = 1;
|
||||
// }
|
||||
// else
|
||||
// ee->engine.x.win = ecore_x_window_new(parent, x, y, w, h);
|
||||
// }
|
||||
// else
|
||||
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_Software_8_X11 *)evas_engine_info_get(ee->evas);
|
||||
if (einfo)
|
||||
{
|
||||
xcb_screen_iterator_t iter;
|
||||
xcb_screen_t *screen;
|
||||
|
||||
/* FIXME: this is inefficient as its a round trip */
|
||||
//einfo->info.backend = 1;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (redraw_debug < 0)
|
||||
{
|
||||
if (getenv("REDRAW_DEBUG"))
|
||||
redraw_debug = atoi(getenv("REDRAW_DEBUG"));
|
||||
else
|
||||
redraw_debug = 0;
|
||||
}
|
||||
einfo->info.connection = ecore_x_connection_get();
|
||||
einfo->info.screen = screen;
|
||||
einfo->info.drawable = ee->prop.window;
|
||||
if (argb)
|
||||
{
|
||||
/* FIXME: round trip */
|
||||
xcb_get_geometry_cookie_t cookie_geom;
|
||||
xcb_get_window_attributes_cookie_t cookie_attr;
|
||||
xcb_get_geometry_reply_t *reply_geom;
|
||||
xcb_get_window_attributes_reply_t *reply_attr;
|
||||
|
||||
cookie_geom = xcb_get_geometry_unchecked(ecore_x_connection_get(), ee->prop.window);
|
||||
cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->prop.window);
|
||||
|
||||
reply_geom = xcb_get_geometry_reply(ecore_x_connection_get(), cookie_geom, NULL);
|
||||
reply_attr = xcb_get_window_attributes_reply(ecore_x_connection_get(), cookie_attr, NULL);
|
||||
if (reply_attr && reply_geom)
|
||||
{
|
||||
einfo->info.visual = xcb_visualtype_get(ecore_x_default_screen_get(), reply_attr->visual);
|
||||
einfo->info.colormap = reply_attr->colormap;
|
||||
einfo->info.depth = reply_geom->depth;
|
||||
einfo->info.destination_alpha = 1;
|
||||
free(reply_geom);
|
||||
free(reply_attr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xcb_screen_t *screen;
|
||||
|
||||
screen = ecore_x_default_screen_get();
|
||||
einfo->info.visual = xcb_visualtype_get(screen, screen->root_visual);
|
||||
einfo->info.colormap = screen->default_colormap;
|
||||
einfo->info.depth = screen->root_depth;
|
||||
einfo->info.destination_alpha = 0;
|
||||
}
|
||||
einfo->info.rotation = 0;
|
||||
einfo->info.debug = redraw_debug;
|
||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||
{
|
||||
WRN("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 */);
|
||||
|
||||
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);
|
||||
|
||||
return ee;
|
||||
#else
|
||||
return NULL;
|
||||
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_8_X11 */
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
EAPI Ecore_X_Window
|
||||
ecore_evas_software_x11_8_window_get(const Ecore_Evas *ee)
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
return (Ecore_X_Window) ecore_evas_window_get(ee);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
EAPI Ecore_X_Window
|
||||
ecore_evas_software_x11_8_subwindow_get(const Ecore_Evas *ee)
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
return (Ecore_X_Window) ecore_evas_window_get(ee);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_evas_software_x11_8_direct_resize_set(Ecore_Evas *ee, int on)
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
ee->engine.x.direct_resize = on;
|
||||
if (ee->prop.avoid_damage)
|
||||
{
|
||||
if (ee->engine.x.direct_resize)
|
||||
{
|
||||
/* turn this off for now
|
||||
ee->engine.x.using_bg_pixmap = 1;
|
||||
ecore_x_window_pixmap_set(ee->engine.x.win, ee->engine.x.pmap);
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/* turn this off too- bg pixmap is controlled by avoid damage directly
|
||||
ee->engine.x.using_bg_pixmap = 0;
|
||||
ecore_x_window_pixmap_set(ee->engine.x.win, 0);
|
||||
ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
|
||||
*/
|
||||
}
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
EAPI int
|
||||
ecore_evas_software_x11_8_direct_resize_get(const Ecore_Evas *ee)
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
return ee->engine.x.direct_resize;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_evas_software_x11_8_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win)
|
||||
{
|
||||
#if defined (BUILD_ECORE_EVAS_SOFTWARE_8_X11)
|
||||
Ecore_X_Window *winp;
|
||||
|
||||
winp = malloc(sizeof(Ecore_X_Window));
|
||||
if (winp)
|
||||
{
|
||||
*winp = win;
|
||||
ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp);
|
||||
ecore_x_input_multi_select(win);
|
||||
ecore_event_window_register(win, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb) _ecore_evas_mouse_move_process);
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue