Ecore_Evas: Fixes for working with the xcb engine. Fix some

formatting. Fix dst_rect being uninitialized. Remove 'prefetch &
fetch' calls as they are not used in the new xcb stuffs.



SVN revision: 61379
This commit is contained in:
Christopher Michael 2011-07-14 15:40:53 +00:00
parent c19fc42875
commit da03bd6e66
3 changed files with 112 additions and 131 deletions

View File

@ -67,7 +67,6 @@ $(ECORE_WIN32_INC) \
$(ECORE_SDL_INC) \
$(ECORE_WINCE_INC) \
@EVAS_CFLAGS@ \
@XCB_CFLAGS@ \
@EINA_CFLAGS@ \
@EVIL_CFLAGS@

View File

@ -14,42 +14,41 @@
#endif
#include <Evas.h>
#include <Ecore.h>
#include <ecore_private.h>
#include <Ecore_Input.h>
#include <Ecore_Input_Evas.h>
#define ECORE_MAGIC_EVAS 0x76543211
#ifndef BUILD_ECORE_DIRECTFB
# undef BUILD_ECORE_EVAS_DIRECTFB
#endif
#ifdef BUILD_ECORE_EVAS_X11
# include "Ecore_X.h"
# include <Ecore_X.h>
# include <Ecore_X_Atoms.h>
# ifdef HAVE_ECORE_X_XCB
# include <xcb/xcb.h>
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
# include <Evas_Engine_Software_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>
# include <X11/Xutil.h>
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XLIB
# include <Evas_Engine_Software_X11.h>
# endif
# ifdef BUILD_ECORE_EVAS_OPENGL_X11
# include <Evas_Engine_GL_X11.h>
# endif
# ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
# include <Evas_Engine_Software_16_X11.h>
# endif
# endif
#endif
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
# include <Evas_Engine_Software_X11.h>
#endif
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
# include <Evas_Engine_GL_X11.h>
#endif
#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
# include <Evas_Engine_Software_8_X11.h>
#endif
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_X11
# include <Evas_Engine_Software_16_X11.h>
#endif
#ifdef BUILD_ECORE_EVAS_FB
# include <Evas_Engine_FB.h>
#endif
@ -125,60 +124,60 @@ extern int _ecore_evas_log_dom;
typedef struct _Ecore_Evas Ecore_Evas;
#endif
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
struct _Ecore_Evas_Engine_Func
{
void (*fn_free) (Ecore_Evas *ee);
void (*fn_callback_resize_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_move_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_show_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_hide_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_delete_request_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_destroy_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_focus_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_focus_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_sticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_unsticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_move) (Ecore_Evas *ee, int x, int y);
void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
void (*fn_resize) (Ecore_Evas *ee, int w, int h);
void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize);
void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
void (*fn_show) (Ecore_Evas *ee);
void (*fn_hide) (Ecore_Evas *ee);
void (*fn_raise) (Ecore_Evas *ee);
void (*fn_lower) (Ecore_Evas *ee);
void (*fn_activate) (Ecore_Evas *ee);
void (*fn_title_set) (Ecore_Evas *ee, const char *t);
void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c);
void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h);
void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h);
void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h);
void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h);
void (*fn_object_cursor_set) (Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
void (*fn_layer_set) (Ecore_Evas *ee, int layer);
void (*fn_focus_set) (Ecore_Evas *ee, int on);
void (*fn_iconified_set) (Ecore_Evas *ee, int on);
void (*fn_borderless_set) (Ecore_Evas *ee, int on);
void (*fn_override_set) (Ecore_Evas *ee, int on);
void (*fn_maximized_set) (Ecore_Evas *ee, int on);
void (*fn_fullscreen_set) (Ecore_Evas *ee, int on);
void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
void (*fn_free) (Ecore_Evas *ee);
void (*fn_callback_resize_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_move_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_show_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_hide_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_delete_request_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_destroy_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_focus_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_focus_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_sticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_unsticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void (*fn_move) (Ecore_Evas *ee, int x, int y);
void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
void (*fn_resize) (Ecore_Evas *ee, int w, int h);
void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize);
void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
void (*fn_show) (Ecore_Evas *ee);
void (*fn_hide) (Ecore_Evas *ee);
void (*fn_raise) (Ecore_Evas *ee);
void (*fn_lower) (Ecore_Evas *ee);
void (*fn_activate) (Ecore_Evas *ee);
void (*fn_title_set) (Ecore_Evas *ee, const char *t);
void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c);
void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h);
void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h);
void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h);
void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h);
void (*fn_object_cursor_set) (Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
void (*fn_layer_set) (Ecore_Evas *ee, int layer);
void (*fn_focus_set) (Ecore_Evas *ee, int on);
void (*fn_iconified_set) (Ecore_Evas *ee, int on);
void (*fn_borderless_set) (Ecore_Evas *ee, int on);
void (*fn_override_set) (Ecore_Evas *ee, int on);
void (*fn_maximized_set) (Ecore_Evas *ee, int on);
void (*fn_fullscreen_set) (Ecore_Evas *ee, int on);
void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
int (*fn_render) (Ecore_Evas *ee);
void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
int (*fn_render) (Ecore_Evas *ee);
void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
};
struct _Ecore_Evas_Engine
@ -186,7 +185,8 @@ struct _Ecore_Evas_Engine
Ecore_Evas_Engine_Func *func;
#ifdef BUILD_ECORE_EVAS_X11
struct {
struct
{
Ecore_X_Window win_root;
Eina_List *win_extra;
Ecore_X_Pixmap pmap;

View File

@ -1,24 +1,4 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <string.h>
#include <Ecore.h>
#include <Ecore_Input.h>
#include <Ecore_Input_Evas.h>
#ifdef BUILD_ECORE_EVAS_X11
# include <Ecore_X.h>
# include <Ecore_X_Atoms.h>
#else
# undef BUILD_ECORE_EVAS_OPENGL_X11
# undef BUILD_ECORE_EVAS_SOFTWARE_X11
#endif
#ifndef HAVE_ECORE_X_XCB
# undef BUILD_ECORE_EVAS_SOFTWARE_XCB
#endif
#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
@ -124,17 +104,17 @@ _ecore_evas_x_sync_clear(Ecore_Evas *ee)
static xcb_visualtype_t *
xcb_visualtype_get(xcb_screen_t *screen, xcb_visualid_t visual)
{
xcb_depth_iterator_t iter_depth;
xcb_depth_iterator_t iter_depth;
if (!screen) return NULL;
iter_depth = xcb_screen_allowed_depths_iterator(screen);
for (; iter_depth.rem; xcb_depth_next (&iter_depth))
for (; iter_depth.rem; xcb_depth_next(&iter_depth))
{
xcb_visualtype_iterator_t iter_vis;
iter_vis = xcb_depth_visuals_iterator(iter_depth.data);
for (; iter_vis.rem; --screen, xcb_visualtype_next (&iter_vis))
for (; iter_vis.rem; --screen, xcb_visualtype_next(&iter_vis))
{
if (visual == iter_vis.data->visual_id)
return iter_vis.data;
@ -146,9 +126,6 @@ xcb_visualtype_get(xcb_screen_t *screen, xcb_visualid_t visual)
#endif /* HAVE_ECORE_X_XCB */
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
# ifdef HAVE_ECORE_X_XCB
/* noop */
# else
static Ecore_X_Window
_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, int override, int argb, const int *opt)
{
@ -264,7 +241,6 @@ _ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y,
}
return win;
}
#endif /* HAVE_ECORE_X_XCB */
#endif
static int
@ -573,12 +549,7 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
{
unsigned int i, num;
Ecore_X_Window_State *state;
int sticky;
#ifdef HAVE_ECORE_X_XCB
ecore_x_netwm_window_state_get_prefetch(e->win);
#endif /* HAVE_ECORE_X_XCB */
sticky = 0;
int sticky = 0;
/* TODO: we need to move those to the end, with if statements */
ee->engine.x.state.modal = 0;
@ -592,9 +563,6 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
ee->engine.x.state.above = 0;
ee->engine.x.state.below = 0;
#ifdef HAVE_ECORE_X_XCB
ecore_x_netwm_window_state_get_fetch();
#endif /* HAVE_ECORE_X_XCB */
ecore_x_netwm_window_state_get(e->win, &state, &num);
if (state)
{
@ -645,9 +613,6 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
}
free(state);
}
#ifdef HAVE_ECORE_X_XCB
ecore_xcb_reply_free();
#endif /* HAVE_ECORE_X_XCB */
if (ee->prop.sticky && !sticky)
{
@ -1084,10 +1049,6 @@ _ecore_evas_x_event_window_hide(void *data __UNUSED__, int type __UNUSED__, void
static void
_ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee)
{
# ifdef HAVE_ECORE_X_XCB
ecore_x_icccm_size_pos_hints_get_prefetch(ee->prop.window);
ecore_x_icccm_size_pos_hints_get_fetch();
# endif /* HAVE_ECORE_X_XCB */
ecore_x_icccm_size_pos_hints_set(ee->prop.window,
ee->prop.request_pos /*request_pos */,
ECORE_X_GRAVITY_NW /* gravity */,
@ -1101,9 +1062,6 @@ _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee)
ee->prop.step.h /* step_y */,
0 /* min_aspect */,
0 /* max_aspect */);
# ifdef HAVE_ECORE_X_XCB
ecore_xcb_reply_free();
# endif /* HAVE_ECORE_X_XCB */
}
/* FIXME, should be in idler */
@ -1758,13 +1716,13 @@ static void
_ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
{
# ifdef HAVE_ECORE_X_XCB
xcb_get_geometry_cookie_t cookie_geom;
xcb_get_geometry_cookie_t cookie_geom;
xcb_get_window_attributes_cookie_t cookie_attr;
xcb_get_geometry_reply_t *reply_geom;
xcb_get_geometry_reply_t *reply_geom;
xcb_get_window_attributes_reply_t *reply_attr;
#else
XWindowAttributes att;
#endif /* ! HAVE_ECORE_X_XCB */
#endif
if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha)))
return;
@ -1896,14 +1854,14 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
{
ee->prop.window = _ecore_evas_x_gl_window_new
(ee, ee->engine.x.win_root,
ee->req.x, ee->req.y, ee->req.w, ee->req.h,
ee->prop.override, 1, NULL);
ee->req.x, ee->req.y, ee->req.w, ee->req.h,
ee->prop.override, 1, NULL);
}
else
ee->prop.window = _ecore_evas_x_gl_window_new
(ee, ee->engine.x.win_root,
ee->req.x, ee->req.y, ee->req.w, ee->req.h,
ee->prop.override, ee->alpha, NULL);
ee->req.x, ee->req.y, ee->req.w, ee->req.h,
ee->prop.override, ee->alpha, NULL);
}
else
ee->prop.window = _ecore_evas_x_gl_window_new
@ -4186,7 +4144,7 @@ ecore_evas_x11_leader_default_set(Ecore_Evas *ee)
static Eina_Bool
_ecore_evas_x11_convert_rectangle_with_angle(Ecore_Evas *ee, Ecore_X_Rectangle *dst_rect, Ecore_X_Rectangle *src_rect)
{
if (!src_rect || !dst_rect) return 0;
if ((!src_rect) || (!dst_rect)) return 0;
if (ee->rotation == 0)
{
@ -4245,13 +4203,21 @@ ecore_evas_x11_shape_input_rectangle_set(Ecore_Evas *ee, int x, int y, int w, in
src_rect.width = w;
src_rect.height = h;
dst_rect.x = 0;
dst_rect.y = 0;
dst_rect.width = 0;
dst_rect.height = 0;
ret = _ecore_evas_x11_convert_rectangle_with_angle(ee, &dst_rect, &src_rect);
if (!ee->engine.x.win_shaped_input)
ee->engine.x.win_shaped_input = ecore_x_window_override_new(ee->engine.x.win_root, 0, 0, 1, 1);
ee->engine.x.win_shaped_input = ecore_x_window_override_new(ee->engine.x.win_root,
0, 0, 1, 1);
if (ret)
ecore_x_window_shape_input_rectangle_set(ee->engine.x.win_shaped_input, dst_rect.x, dst_rect.y, dst_rect.width, dst_rect.height);
ecore_x_window_shape_input_rectangle_set(ee->engine.x.win_shaped_input,
dst_rect.x, dst_rect.y,
dst_rect.width, dst_rect.height);
#else
return;
ee = NULL;
@ -4282,13 +4248,21 @@ ecore_evas_x11_shape_input_rectangle_add(Ecore_Evas *ee, int x, int y, int w, in
src_rect.width = w;
src_rect.height = h;
dst_rect.x = 0;
dst_rect.y = 0;
dst_rect.width = 0;
dst_rect.height = 0;
ret = _ecore_evas_x11_convert_rectangle_with_angle(ee, &dst_rect, &src_rect);
if (!ee->engine.x.win_shaped_input)
ee->engine.x.win_shaped_input = ecore_x_window_override_new(ee->engine.x.win_root, 0, 0, 1, 1);
ee->engine.x.win_shaped_input = ecore_x_window_override_new(ee->engine.x.win_root,
0, 0, 1, 1);
if (ret)
ecore_x_window_shape_input_rectangle_add(ee->engine.x.win_shaped_input, dst_rect.x, dst_rect.y, dst_rect.width, dst_rect.height);
ecore_x_window_shape_input_rectangle_add(ee->engine.x.win_shaped_input,
dst_rect.x, dst_rect.y,
dst_rect.width, dst_rect.height);
#else
return;
ee = NULL;
@ -4319,13 +4293,21 @@ ecore_evas_x11_shape_input_rectangle_subtract(Ecore_Evas *ee, int x, int y, int
src_rect.width = w;
src_rect.height = h;
dst_rect.x = 0;
dst_rect.y = 0;
dst_rect.width = 0;
dst_rect.height = 0;
ret = _ecore_evas_x11_convert_rectangle_with_angle(ee, &dst_rect, &src_rect);
if (!ee->engine.x.win_shaped_input)
ee->engine.x.win_shaped_input = ecore_x_window_override_new(ee->engine.x.win_root, 0, 0, 1, 1);
ee->engine.x.win_shaped_input = ecore_x_window_override_new(ee->engine.x.win_root,
0, 0, 1, 1);
if (ret)
ecore_x_window_shape_input_rectangle_subtract(ee->engine.x.win_shaped_input, dst_rect.x, dst_rect.y, dst_rect.width, dst_rect.height);
ecore_x_window_shape_input_rectangle_subtract(ee->engine.x.win_shaped_input,
dst_rect.x, dst_rect.y,
dst_rect.width, dst_rect.height);
#else
return;
ee = NULL;