aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c855
1 files changed, 488 insertions, 367 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
index 4f2605ba00..bf2e04086a 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
@@ -10,12 +10,24 @@
#endif
/* local function prototypes */
-static Ecore_X_Window _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w, int h, uint8_t override_redirect, uint8_t save_under);
-static Ecore_X_Window _ecore_xcb_window_at_xy_get(Ecore_X_Window base, int bx, int by, int x, int y, Ecore_X_Window *skip, int skip_num);
-static int _ecore_xcb_window_modifiers_get(unsigned int state);
+static Ecore_X_Window _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h,
+ uint8_t override_redirect,
+ uint8_t save_under);
+static Ecore_X_Window _ecore_xcb_window_at_xy_get(Ecore_X_Window base,
+ int bx,
+ int by,
+ int x,
+ int y,
+ Ecore_X_Window *skip,
+ int skip_num);
+static int _ecore_xcb_window_modifiers_get(unsigned int state);
static xcb_visualtype_t *_ecore_xcb_window_find_visual_by_id(xcb_visualid_t id);
#ifdef ECORE_XCB_XPRINT
-static xcb_screen_t *_ecore_xcb_window_screen_of_display(int screen);
+static xcb_screen_t *_ecore_xcb_window_screen_of_display(int screen);
#endif
/* local variables */
@@ -27,7 +39,9 @@ int _ecore_xcb_button_grabs_num = 0;
int _ecore_xcb_key_grabs_num = 0;
Ecore_X_Window *_ecore_xcb_button_grabs = NULL;
Ecore_X_Window *_ecore_xcb_key_grabs = NULL;
-Eina_Bool (*_ecore_xcb_window_grab_replay_func)(void *data, int type, void *event);
+Eina_Bool (*_ecore_xcb_window_grab_replay_func)(void *data,
+ int type,
+ void *event);
void *_ecore_xcb_window_grab_replay_data;
/**
@@ -47,8 +61,12 @@ void *_ecore_xcb_window_grab_replay_data;
* @return The new window handle.
* @ingroup Ecore_X_Window_Create_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
+EAPI Ecore_X_Window
+ecore_x_window_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Ecore_X_Window win;
uint32_t mask, mask_list[9];
@@ -60,9 +78,9 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
/* NB: Order here is very important due to xcb_cw_t enum */
- mask = (XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY |
- XCB_CW_WIN_GRAVITY | XCB_CW_BACKING_STORE |
- XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK |
+ mask = (XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY |
+ XCB_CW_WIN_GRAVITY | XCB_CW_BACKING_STORE |
+ XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK |
XCB_CW_DONT_PROPAGATE);
mask_list[0] = XCB_BACK_PIXMAP_NONE;
@@ -72,25 +90,25 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
mask_list[4] = XCB_BACKING_STORE_NOT_USEFUL;
mask_list[5] = 0;
mask_list[6] = 0;
- mask_list[7] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
- XCB_EVENT_MASK_BUTTON_PRESS |
- XCB_EVENT_MASK_BUTTON_RELEASE |
- XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
- XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
- XCB_EVENT_MASK_VISIBILITY_CHANGE |
- XCB_EVENT_MASK_STRUCTURE_NOTIFY |
- XCB_EVENT_MASK_FOCUS_CHANGE |
- XCB_EVENT_MASK_PROPERTY_CHANGE |
+ mask_list[7] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
+ XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_RELEASE |
+ XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
+ XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
+ XCB_EVENT_MASK_VISIBILITY_CHANGE |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_FOCUS_CHANGE |
+ XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_COLOR_MAP_CHANGE);
mask_list[8] = XCB_EVENT_MASK_NO_EVENT;
win = xcb_generate_id(_ecore_xcb_conn);
- xcb_create_window(_ecore_xcb_conn, XCB_COPY_FROM_PARENT,
- win, parent, x, y, w, h, 0,
- XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ xcb_create_window(_ecore_xcb_conn, XCB_COPY_FROM_PARENT,
+ win, parent, x, y, w, h, 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
XCB_COPY_FROM_PARENT, mask, mask_list);
- if (parent == ((xcb_screen_t *)_ecore_xcb_screen)->root)
+ if (parent == ((xcb_screen_t *)_ecore_xcb_screen)->root)
ecore_x_window_defaults_set(win);
return win;
@@ -107,8 +125,12 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
* @return The new window handle.
* @ingroup Ecore_X_Window_Create_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
+EAPI Ecore_X_Window
+ecore_x_window_override_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Ecore_X_Window win;
uint32_t mask, mask_list[9];
@@ -120,9 +142,9 @@ ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
/* NB: Order here is very important due to xcb_cw_t enum */
- mask = (XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY |
- XCB_CW_WIN_GRAVITY | XCB_CW_BACKING_STORE |
- XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK |
+ mask = (XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY |
+ XCB_CW_WIN_GRAVITY | XCB_CW_BACKING_STORE |
+ XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK |
XCB_CW_DONT_PROPAGATE);
mask_list[0] = XCB_BACK_PIXMAP_NONE;
@@ -132,22 +154,22 @@ ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
mask_list[4] = XCB_BACKING_STORE_NOT_USEFUL;
mask_list[5] = 1;
mask_list[6] = 0;
- mask_list[7] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
- XCB_EVENT_MASK_BUTTON_PRESS |
- XCB_EVENT_MASK_BUTTON_RELEASE |
- XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
- XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
- XCB_EVENT_MASK_VISIBILITY_CHANGE |
- XCB_EVENT_MASK_STRUCTURE_NOTIFY |
- XCB_EVENT_MASK_FOCUS_CHANGE |
- XCB_EVENT_MASK_PROPERTY_CHANGE |
+ mask_list[7] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
+ XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_RELEASE |
+ XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
+ XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
+ XCB_EVENT_MASK_VISIBILITY_CHANGE |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_FOCUS_CHANGE |
+ XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_COLOR_MAP_CHANGE);
mask_list[8] = XCB_EVENT_MASK_NO_EVENT;
win = xcb_generate_id(_ecore_xcb_conn);
- xcb_create_window(_ecore_xcb_conn, XCB_COPY_FROM_PARENT,
- win, parent, x, y, w, h, 0,
- XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ xcb_create_window(_ecore_xcb_conn, XCB_COPY_FROM_PARENT,
+ win, parent, x, y, w, h, 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
XCB_COPY_FROM_PARENT, mask, mask_list);
return win;
@@ -164,8 +186,12 @@ ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
* @return The new window.
* @ingroup Ecore_X_Window_Create_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_input_new(Ecore_X_Window parent, int x, int y, int w, int h)
+EAPI Ecore_X_Window
+ecore_x_window_input_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Ecore_X_Window win;
uint32_t mask, mask_list[3];
@@ -177,26 +203,26 @@ ecore_x_window_input_new(Ecore_X_Window parent, int x, int y, int w, int h)
parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
/* NB: Order here is very important due to xcb_cw_t enum */
- mask = (XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK |
+ mask = (XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK |
XCB_CW_DONT_PROPAGATE);
mask_list[0] = 1;
- mask_list[1] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
- XCB_EVENT_MASK_BUTTON_PRESS |
- XCB_EVENT_MASK_BUTTON_RELEASE |
- XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
- XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
- XCB_EVENT_MASK_VISIBILITY_CHANGE |
- XCB_EVENT_MASK_STRUCTURE_NOTIFY |
- XCB_EVENT_MASK_FOCUS_CHANGE |
- XCB_EVENT_MASK_PROPERTY_CHANGE |
+ mask_list[1] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
+ XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_RELEASE |
+ XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
+ XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
+ XCB_EVENT_MASK_VISIBILITY_CHANGE |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_FOCUS_CHANGE |
+ XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_COLOR_MAP_CHANGE);
mask_list[2] = XCB_EVENT_MASK_NO_EVENT;
win = xcb_generate_id(_ecore_xcb_conn);
- xcb_create_window(_ecore_xcb_conn, XCB_COPY_FROM_PARENT,
- win, parent, x, y, w, h, 0,
- XCB_WINDOW_CLASS_INPUT_ONLY,
+ xcb_create_window(_ecore_xcb_conn, XCB_COPY_FROM_PARENT,
+ win, parent, x, y, w, h, 0,
+ XCB_WINDOW_CLASS_INPUT_ONLY,
XCB_COPY_FROM_PARENT, mask, mask_list);
return win;
@@ -213,8 +239,12 @@ ecore_x_window_input_new(Ecore_X_Window parent, int x, int y, int w, int h)
* @return The new window handle.
* @ingroup Ecore_X_Window_Create_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_manager_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
+EAPI Ecore_X_Window
+ecore_x_window_manager_argb_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Ecore_X_Window win = 0;
@@ -236,8 +266,12 @@ ecore_x_window_manager_argb_new(Ecore_X_Window parent, int x, int y, int w, int
* @return The new window handle.
* @ingroup Ecore_X_Window_Create_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
+EAPI Ecore_X_Window
+ecore_x_window_argb_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Ecore_X_Window win = 0;
@@ -259,8 +293,12 @@ ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
* @return The new window handle.
* @ingroup Ecore_X_Window_Create_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_override_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
+EAPI Ecore_X_Window
+ecore_x_window_override_argb_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Ecore_X_Window win = 0;
@@ -282,43 +320,43 @@ ecore_x_window_override_argb_new(Ecore_X_Window parent, int x, int y, int w, int
* @param win The given window.
* @ingroup Ecore_X_Window_Destroy_Group
*/
-EAPI void
-ecore_x_window_free(Ecore_X_Window win)
+EAPI void
+ecore_x_window_free(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (win)
+ if (win)
{
/* xcb_destroy_notify_event_t ev; */
/* Ecore_X_Window root; */
- /* if (xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn)).rem == 1) */
- /* root = ((xcb_screen_t *)_ecore_xcb_screen)->root; */
- /* else */
- /* { */
- /* xcb_get_geometry_cookie_t cookie; */
- /* xcb_get_geometry_reply_t *reply; */
+ /* if (xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn)).rem == 1) */
+ /* root = ((xcb_screen_t *)_ecore_xcb_screen)->root; */
+ /* else */
+ /* { */
+ /* xcb_get_geometry_cookie_t cookie; */
+ /* xcb_get_geometry_reply_t *reply; */
- /* cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, win); */
- /* reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL); */
- /* if (!reply) return; */
- /* root = reply->root; */
- /* free(reply); */
- /* } */
+ /* cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, win); */
+ /* reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL); */
+ /* if (!reply) return; */
+ /* root = reply->root; */
+ /* free(reply); */
+ /* } */
- /* memset(&ev, 0, sizeof(xcb_destroy_notify_event_t)); */
+ /* memset(&ev, 0, sizeof(xcb_destroy_notify_event_t)); */
- /* ev.response_type = XCB_DESTROY_NOTIFY; */
- /* ev.window = win; */
- /* ev.event = root; */
+ /* ev.response_type = XCB_DESTROY_NOTIFY; */
+ /* ev.window = win; */
+ /* ev.event = root; */
- /* xcb_send_event(_ecore_xcb_conn, 0, root, */
- /* XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | */
- /* XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, */
- /* (const char *)&ev); */
+ /* xcb_send_event(_ecore_xcb_conn, 0, root, */
+ /* XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | */
+ /* XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, */
+ /* (const char *)&ev); */
- xcb_destroy_window(_ecore_xcb_conn, win);
+ xcb_destroy_window(_ecore_xcb_conn, win);
// ecore_x_flush();
}
}
@@ -328,20 +366,28 @@ ecore_x_window_free(Ecore_X_Window win)
* @param win The given window.
* @ingroup Ecore_X_Window_Destroy_Group
*/
-EAPI void
-ecore_x_window_delete_request_send(Ecore_X_Window win)
+EAPI void
+ecore_x_window_delete_request_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
- ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
- XCB_EVENT_MASK_NO_EVENT,
- ECORE_X_ATOM_WM_DELETE_WINDOW,
+ ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
+ XCB_EVENT_MASK_NO_EVENT,
+ ECORE_X_ATOM_WM_DELETE_WINDOW,
XCB_CURRENT_TIME, 0, 0, 0);
}
-EAPI void
-ecore_x_window_configure(Ecore_X_Window win, Ecore_X_Window_Configure_Mask mask, int x, int y, int w, int h, int border_width, Ecore_X_Window sibling, int stack_mode)
+EAPI void
+ecore_x_window_configure(Ecore_X_Window win,
+ Ecore_X_Window_Configure_Mask mask,
+ int x,
+ int y,
+ int w,
+ int h,
+ int border_width,
+ Ecore_X_Window sibling,
+ int stack_mode)
{
uint16_t vmask = 0;
uint32_t vlist[7];
@@ -352,43 +398,43 @@ ecore_x_window_configure(Ecore_X_Window win, Ecore_X_Window_Configure_Mask mask,
if (!win) return;
- if (mask & XCB_CONFIG_WINDOW_X)
+ if (mask & XCB_CONFIG_WINDOW_X)
{
vmask |= XCB_CONFIG_WINDOW_X;
vlist[i++] = x;
}
- if (mask & XCB_CONFIG_WINDOW_Y)
+ if (mask & XCB_CONFIG_WINDOW_Y)
{
vmask |= XCB_CONFIG_WINDOW_Y;
vlist[i++] = y;
}
- if (mask & XCB_CONFIG_WINDOW_WIDTH)
+ if (mask & XCB_CONFIG_WINDOW_WIDTH)
{
vmask |= XCB_CONFIG_WINDOW_WIDTH;
vlist[i++] = w;
}
- if (mask & XCB_CONFIG_WINDOW_HEIGHT)
+ if (mask & XCB_CONFIG_WINDOW_HEIGHT)
{
vmask |= XCB_CONFIG_WINDOW_HEIGHT;
vlist[i++] = h;
}
- if (mask & XCB_CONFIG_WINDOW_BORDER_WIDTH)
+ if (mask & XCB_CONFIG_WINDOW_BORDER_WIDTH)
{
vmask |= XCB_CONFIG_WINDOW_BORDER_WIDTH;
vlist[i++] = border_width;
}
- if (mask & XCB_CONFIG_WINDOW_SIBLING)
+ if (mask & XCB_CONFIG_WINDOW_SIBLING)
{
vmask |= XCB_CONFIG_WINDOW_SIBLING;
vlist[i++] = sibling;
}
- if (mask & XCB_CONFIG_WINDOW_STACK_MODE)
+ if (mask & XCB_CONFIG_WINDOW_STACK_MODE)
{
vmask |= XCB_CONFIG_WINDOW_STACK_MODE;
vlist[i++] = stack_mode;
}
- xcb_configure_window(_ecore_xcb_conn, win, vmask,
+ xcb_configure_window(_ecore_xcb_conn, win, vmask,
(const uint32_t *)&vlist);
// ecore_x_flush();
}
@@ -410,8 +456,10 @@ ecore_x_window_configure(Ecore_X_Window win, Ecore_X_Window_Configure_Mask mask,
* @param y Y position.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI void
-ecore_x_window_move(Ecore_X_Window win, int x, int y)
+EAPI void
+ecore_x_window_move(Ecore_X_Window win,
+ int x,
+ int y)
{
uint32_t list[2], mask;
@@ -424,7 +472,7 @@ ecore_x_window_move(Ecore_X_Window win, int x, int y)
list[0] = x;
list[1] = y;
- xcb_configure_window(_ecore_xcb_conn, win, mask,
+ xcb_configure_window(_ecore_xcb_conn, win, mask,
(const uint32_t *)&list);
// ecore_x_flush();
}
@@ -436,8 +484,10 @@ ecore_x_window_move(Ecore_X_Window win, int x, int y)
* @param h New height of the window.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI void
-ecore_x_window_resize(Ecore_X_Window win, int w, int h)
+EAPI void
+ecore_x_window_resize(Ecore_X_Window win,
+ int w,
+ int h)
{
uint32_t list[2], mask;
@@ -452,7 +502,7 @@ ecore_x_window_resize(Ecore_X_Window win, int w, int h)
list[0] = w;
list[1] = h;
- xcb_configure_window(_ecore_xcb_conn, win, mask,
+ xcb_configure_window(_ecore_xcb_conn, win, mask,
(const uint32_t *)&list);
// ecore_x_flush();
}
@@ -466,8 +516,12 @@ ecore_x_window_resize(Ecore_X_Window win, int w, int h)
* @param h New height of the window.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI void
-ecore_x_window_move_resize(Ecore_X_Window win, int x, int y, int w, int h)
+EAPI void
+ecore_x_window_move_resize(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
uint32_t list[4], mask;
@@ -478,14 +532,14 @@ ecore_x_window_move_resize(Ecore_X_Window win, int x, int y, int w, int h)
if (w < 1) w = 1;
if (h < 1) h = 1;
- mask = (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
+ mask = (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT);
list[0] = x;
list[1] = y;
list[2] = w;
list[3] = h;
- xcb_configure_window(_ecore_xcb_conn, win, mask,
+ xcb_configure_window(_ecore_xcb_conn, win, mask,
(const uint32_t *)&list);
// ecore_x_flush();
}
@@ -496,8 +550,8 @@ ecore_x_window_move_resize(Ecore_X_Window win, int x, int y, int w, int h)
* @return Width of the border of @p win.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI int
-ecore_x_window_border_width_get(Ecore_X_Window win)
+EAPI int
+ecore_x_window_border_width_get(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -511,8 +565,9 @@ ecore_x_window_border_width_get(Ecore_X_Window win)
* @param width The new border width.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI void
-ecore_x_window_border_width_set(Ecore_X_Window win, int border_width)
+EAPI void
+ecore_x_window_border_width_set(Ecore_X_Window win,
+ int border_width)
{
uint32_t list;
@@ -523,7 +578,7 @@ ecore_x_window_border_width_set(Ecore_X_Window win, int border_width)
list = border_width;
- xcb_configure_window(_ecore_xcb_conn, win,
+ xcb_configure_window(_ecore_xcb_conn, win,
XCB_CONFIG_WINDOW_BORDER_WIDTH, &list);
// ecore_x_flush();
}
@@ -539,15 +594,15 @@ ecore_x_window_border_width_set(Ecore_X_Window win, int border_width)
* @param win The window to raise.
* @ingroup Ecore_X_Window_Z_Order_Group
*/
-EAPI void
-ecore_x_window_raise(Ecore_X_Window win)
+EAPI void
+ecore_x_window_raise(Ecore_X_Window win)
{
uint32_t list[] = { XCB_STACK_MODE_ABOVE };
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- xcb_configure_window(_ecore_xcb_conn, win,
+ xcb_configure_window(_ecore_xcb_conn, win,
XCB_CONFIG_WINDOW_STACK_MODE, list);
// ecore_x_flush();
}
@@ -557,15 +612,15 @@ ecore_x_window_raise(Ecore_X_Window win)
* @param win The window to lower.
* @ingroup Ecore_X_Window_Z_Order_Group
*/
-EAPI void
-ecore_x_window_lower(Ecore_X_Window win)
+EAPI void
+ecore_x_window_lower(Ecore_X_Window win)
{
uint32_t list[] = { XCB_STACK_MODE_BELOW };
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- xcb_configure_window(_ecore_xcb_conn, win,
+ xcb_configure_window(_ecore_xcb_conn, win,
XCB_CONFIG_WINDOW_STACK_MODE, list);
// ecore_x_flush();
}
@@ -575,8 +630,8 @@ ecore_x_window_lower(Ecore_X_Window win)
* @param win The given window.
* @return Depth of the window.
*/
-EAPI int
-ecore_x_window_depth_get(Ecore_X_Window win)
+EAPI int
+ecore_x_window_depth_get(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -598,8 +653,8 @@ ecore_x_window_depth_get(Ecore_X_Window win)
* @param win The given window.
* @ingroup Ecore_X_Window_Properties_Groups
*/
-EAPI void
-ecore_x_window_defaults_set(Ecore_X_Window win)
+EAPI void
+ecore_x_window_defaults_set(Ecore_X_Window win)
{
char buff[MAXHOSTNAMELEN], **argv;
int argc;
@@ -611,8 +666,8 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
gethostname(buff, MAXHOSTNAMELEN);
buff[MAXHOSTNAMELEN - 1] = '\0';
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
- ECORE_X_ATOM_WM_CLIENT_MACHINE, ECORE_X_ATOM_STRING,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
+ ECORE_X_ATOM_WM_CLIENT_MACHINE, ECORE_X_ATOM_STRING,
8, strlen(buff), buff);
pid = getpid();
@@ -636,13 +691,13 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
* @param win The window to show.
* @ingroup Ecore_X_Window_Visibility
*/
-EAPI void
-ecore_x_window_show(Ecore_X_Window win)
+EAPI void
+ecore_x_window_show(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (win)
+ if (win)
xcb_map_window(_ecore_xcb_conn, win);
}
@@ -654,20 +709,20 @@ ecore_x_window_show(Ecore_X_Window win)
* @param win The window to hide.
* @ingroup Ecore_X_Window_Visibility
*/
-EAPI void
-ecore_x_window_hide(Ecore_X_Window win)
+EAPI void
+ecore_x_window_hide(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (win)
+ if (win)
{
xcb_unmap_notify_event_t ev;
Ecore_X_Window root;
if (xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn)).rem == 1)
root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
- else
+ else
{
xcb_get_geometry_cookie_t cookie;
xcb_get_geometry_reply_t *reply;
@@ -686,9 +741,9 @@ ecore_x_window_hide(Ecore_X_Window win)
ev.event = root;
ev.from_configure = 0;
- xcb_send_event(_ecore_xcb_conn, 0, root,
- (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
- XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT),
+ xcb_send_event(_ecore_xcb_conn, 0, root,
+ (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT),
(const char *)&ev);
xcb_unmap_window(_ecore_xcb_conn, win);
@@ -707,15 +762,15 @@ ecore_x_window_hide(Ecore_X_Window win)
* @param win The window to focus.
* @ingroup Ecore_X_Window_Focus_Functions
*/
-EAPI void
-ecore_x_window_focus(Ecore_X_Window win)
+EAPI void
+ecore_x_window_focus(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
- xcb_set_input_focus(_ecore_xcb_conn,
+ xcb_set_input_focus(_ecore_xcb_conn,
XCB_INPUT_FOCUS_PARENT, win, XCB_CURRENT_TIME);
// ecore_x_flush();
}
@@ -726,8 +781,9 @@ ecore_x_window_focus(Ecore_X_Window win)
* @param t When to set the focus to the window.
* @ingroup Ecore_X_Window_Focus_Functions
*/
-EAPI void
-ecore_x_window_focus_at_time(Ecore_X_Window win, Ecore_X_Time time)
+EAPI void
+ecore_x_window_focus_at_time(Ecore_X_Window win,
+ Ecore_X_Time time)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -751,21 +807,25 @@ ecore_x_window_focus_at_time(Ecore_X_Window win, Ecore_X_Time time)
* @param y Y position within new parent window.
* @ingroup Ecore_X_Window_Parent_Group
*/
-EAPI void
-ecore_x_window_reparent(Ecore_X_Window win, Ecore_X_Window parent, int x, int y)
+EAPI void
+ecore_x_window_reparent(Ecore_X_Window win,
+ Ecore_X_Window parent,
+ int x,
+ int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (parent == 0)
+ if (parent == 0)
parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
xcb_reparent_window(_ecore_xcb_conn, win, parent, x, y);
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap)
+EAPI void
+ecore_x_window_pixmap_set(Ecore_X_Window win,
+ Ecore_X_Pixmap pixmap)
{
uint32_t list;
@@ -774,7 +834,7 @@ ecore_x_window_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap)
list = pixmap;
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_BACK_PIXMAP, &list);
// ecore_x_flush();
}
@@ -786,8 +846,11 @@ ecore_x_window_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap)
* @param g green value (0...65536, 16 bits)
* @param b blue value (0...65536, 16 bits)
*/
-EAPI void
-ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short red, unsigned short green, unsigned short blue)
+EAPI void
+ecore_x_window_background_color_set(Ecore_X_Window win,
+ unsigned short red,
+ unsigned short green,
+ unsigned short blue)
{
xcb_alloc_color_cookie_t cookie;
xcb_alloc_color_reply_t *reply;
@@ -796,22 +859,23 @@ ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short red, unsi
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- cookie =
- xcb_alloc_color_unchecked(_ecore_xcb_conn,
- ((xcb_screen_t *)_ecore_xcb_screen)->default_colormap,
+ cookie =
+ xcb_alloc_color_unchecked(_ecore_xcb_conn,
+ ((xcb_screen_t *)_ecore_xcb_screen)->default_colormap,
red, green, blue);
reply = xcb_alloc_color_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return;
list = reply->pixel;
free(reply);
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_BACK_PIXEL, &list);
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity gravity)
+EAPI void
+ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
+ Ecore_X_Gravity gravity)
{
uint32_t list;
@@ -820,13 +884,14 @@ ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity gravity)
list = gravity;
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_BIT_GRAVITY, &list);
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity gravity)
+EAPI void
+ecore_x_window_gravity_set(Ecore_X_Window win,
+ Ecore_X_Gravity gravity)
{
uint32_t list;
@@ -835,13 +900,14 @@ ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity gravity)
list = gravity;
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_WIN_GRAVITY, &list);
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_override_set(Ecore_X_Window win, Eina_Bool override)
+EAPI void
+ecore_x_window_override_set(Ecore_X_Window win,
+ Eina_Bool override)
{
uint32_t list;
@@ -850,7 +916,7 @@ ecore_x_window_override_set(Ecore_X_Window win, Eina_Bool override)
list = override;
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_OVERRIDE_REDIRECT, &list);
// ecore_x_flush();
}
@@ -860,8 +926,9 @@ ecore_x_window_override_set(Ecore_X_Window win, Eina_Bool override)
*
* FIXME: To be fixed.
*/
-EAPI void
-ecore_x_window_cursor_show(Ecore_X_Window win, Eina_Bool show)
+EAPI void
+ecore_x_window_cursor_show(Ecore_X_Window win,
+ Eina_Bool show)
{
uint32_t list = 0;
@@ -870,7 +937,7 @@ ecore_x_window_cursor_show(Ecore_X_Window win, Eina_Bool show)
if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
- if (!show)
+ if (!show)
{
Ecore_X_Cursor cursor;
Ecore_X_Pixmap p, m;
@@ -886,32 +953,33 @@ ecore_x_window_cursor_show(Ecore_X_Window win, Eina_Bool show)
xcb_change_gc(_ecore_xcb_conn, gc, XCB_GC_FOREGROUND, &list);
point.x = 0;
point.y = 0;
- xcb_poly_point(_ecore_xcb_conn, XCB_COORD_MODE_ORIGIN,
+ xcb_poly_point(_ecore_xcb_conn, XCB_COORD_MODE_ORIGIN,
win, gc, 1, &point);
xcb_free_gc(_ecore_xcb_conn, gc);
cursor = xcb_generate_id(_ecore_xcb_conn);
- xcb_create_cursor(_ecore_xcb_conn, cursor,
+ xcb_create_cursor(_ecore_xcb_conn, cursor,
p, m, 0, 0, 0, 0, 0, 0, 0, 0);
list = cursor;
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_CURSOR, &list);
xcb_free_cursor(_ecore_xcb_conn, cursor);
xcb_free_pixmap(_ecore_xcb_conn, m);
xcb_free_pixmap(_ecore_xcb_conn, p);
}
- else
+ else
{
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_CURSOR, &list);
}
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_cursor_set(Ecore_X_Window win, Ecore_X_Cursor cursor)
+EAPI void
+ecore_x_window_cursor_set(Ecore_X_Window win,
+ Ecore_X_Cursor cursor)
{
uint32_t list;
@@ -924,38 +992,38 @@ ecore_x_window_cursor_set(Ecore_X_Window win, Ecore_X_Cursor cursor)
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_container_manage(Ecore_X_Window win)
+EAPI void
+ecore_x_window_container_manage(Ecore_X_Window win)
{
uint32_t list;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- list = (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
+ list = (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY);
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_EVENT_MASK, &list);
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_client_manage(Ecore_X_Window win)
+EAPI void
+ecore_x_window_client_manage(Ecore_X_Window win)
{
uint32_t list;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- list = (XCB_EVENT_MASK_VISIBILITY_CHANGE |
- XCB_EVENT_MASK_FOCUS_CHANGE |
- XCB_EVENT_MASK_PROPERTY_CHANGE |
- XCB_EVENT_MASK_COLOR_MAP_CHANGE |
- XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ list = (XCB_EVENT_MASK_VISIBILITY_CHANGE |
+ XCB_EVENT_MASK_FOCUS_CHANGE |
+ XCB_EVENT_MASK_PROPERTY_CHANGE |
+ XCB_EVENT_MASK_COLOR_MAP_CHANGE |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY |
XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY);
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_EVENT_MASK, &list);
#ifdef ECORE_XCB_SHAPE
@@ -964,38 +1032,38 @@ ecore_x_window_client_manage(Ecore_X_Window win)
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_sniff(Ecore_X_Window win)
+EAPI void
+ecore_x_window_sniff(Ecore_X_Window win)
{
uint32_t list;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- list = (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
+ list = (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
XCB_EVENT_MASK_PROPERTY_CHANGE);
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_EVENT_MASK, &list);
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_client_sniff(Ecore_X_Window win)
+EAPI void
+ecore_x_window_client_sniff(Ecore_X_Window win)
{
uint32_t list;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- list = (XCB_EVENT_MASK_VISIBILITY_CHANGE |
- XCB_EVENT_MASK_STRUCTURE_NOTIFY |
- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
- XCB_EVENT_MASK_FOCUS_CHANGE |
- XCB_EVENT_MASK_PROPERTY_CHANGE |
+ list = (XCB_EVENT_MASK_VISIBILITY_CHANGE |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_FOCUS_CHANGE |
+ XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_COLOR_MAP_CHANGE);
- xcb_change_window_attributes(_ecore_xcb_conn, win,
+ xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_EVENT_MASK, &list);
#ifdef ECORE_XCB_SHAPE
xcb_shape_select_input(_ecore_xcb_conn, win, EINA_TRUE);
@@ -1003,8 +1071,12 @@ ecore_x_window_client_sniff(Ecore_X_Window win)
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_area_clear(Ecore_X_Window win, int x, int y, int w, int h)
+EAPI void
+ecore_x_window_area_clear(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -1013,8 +1085,12 @@ ecore_x_window_area_clear(Ecore_X_Window win, int x, int y, int w, int h)
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_area_expose(Ecore_X_Window win, int x, int y, int w, int h)
+EAPI void
+ecore_x_window_area_expose(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -1023,8 +1099,8 @@ ecore_x_window_area_expose(Ecore_X_Window win, int x, int y, int w, int h)
// ecore_x_flush();
}
-EAPI void
-ecore_x_window_save_set_add(Ecore_X_Window win)
+EAPI void
+ecore_x_window_save_set_add(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -1032,8 +1108,8 @@ ecore_x_window_save_set_add(Ecore_X_Window win)
xcb_change_save_set(_ecore_xcb_conn, XCB_SET_MODE_INSERT, win);
}
-EAPI void
-ecore_x_window_save_set_del(Ecore_X_Window win)
+EAPI void
+ecore_x_window_save_set_del(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -1046,8 +1122,8 @@ ecore_x_window_save_set_del(Ecore_X_Window win)
* @return The window that has focus.
* @ingroup Ecore_X_Window_Focus_Functions
*/
-EAPI Ecore_X_Window
-ecore_x_window_focus_get(void)
+EAPI Ecore_X_Window
+ecore_x_window_focus_get(void)
{
xcb_get_input_focus_cookie_t cookie;
xcb_get_input_focus_reply_t *reply;
@@ -1064,8 +1140,8 @@ ecore_x_window_focus_get(void)
return focus;
}
-EAPI int
-ecore_x_window_argb_get(Ecore_X_Window win)
+EAPI int
+ecore_x_window_argb_get(Ecore_X_Window win)
{
uint8_t ret = 0;
#ifdef ECORE_XCB_RENDER
@@ -1088,8 +1164,8 @@ ecore_x_window_argb_get(Ecore_X_Window win)
return ret;
}
-EAPI Eina_Bool
-ecore_x_window_manage(Ecore_X_Window win)
+EAPI Eina_Bool
+ecore_x_window_manage(Ecore_X_Window win)
{
xcb_get_window_attributes_cookie_t cookie;
xcb_get_window_attributes_reply_t *reply;
@@ -1106,22 +1182,22 @@ ecore_x_window_manage(Ecore_X_Window win)
ecore_x_sync(); // needed
- list = (XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
- XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_RESIZE_REDIRECT |
- XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
- XCB_EVENT_MASK_STRUCTURE_NOTIFY |
- XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
+ list = (XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
+ XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_RESIZE_REDIRECT |
+ XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
reply->your_event_mask);
free(reply);
- change_cookie = xcb_change_window_attributes(_ecore_xcb_conn, win,
+ change_cookie = xcb_change_window_attributes(_ecore_xcb_conn, win,
XCB_CW_EVENT_MASK, &list);
ecore_x_sync(); // needed
err = xcb_request_check(_ecore_xcb_conn, change_cookie);
- if (err)
+ if (err)
{
_ecore_xcb_error_handle(err);
free(err);
@@ -1131,8 +1207,9 @@ ecore_x_window_manage(Ecore_X_Window win)
return EINA_TRUE;
}
-EAPI Eina_Bool
-ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes *att_ret)
+EAPI Eina_Bool
+ecore_x_window_attributes_get(Ecore_X_Window win,
+ Ecore_X_Window_Attributes *att_ret)
{
xcb_get_window_attributes_cookie_t cookie;
xcb_get_window_attributes_reply_t *reply;
@@ -1154,13 +1231,13 @@ ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes *att
if (reply->map_state == XCB_MAP_STATE_VIEWABLE)
att_ret->viewable = EINA_TRUE;
- if (reply->override_redirect)
+ if (reply->override_redirect)
att_ret->override = EINA_TRUE;
if (reply->_class == XCB_WINDOW_CLASS_INPUT_ONLY)
att_ret->input_only = EINA_TRUE;
- if (reply->save_under)
+ if (reply->save_under)
att_ret->save_under = EINA_TRUE;
att_ret->event_mask.mine = reply->your_event_mask;
@@ -1213,8 +1290,10 @@ ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes *att
* @param h Pointer to an integer into which the height is to be stored.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI void
-ecore_x_window_size_get(Ecore_X_Window win, int *width, int *height)
+EAPI void
+ecore_x_window_size_get(Ecore_X_Window win,
+ int *width,
+ int *height)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -1228,28 +1307,29 @@ ecore_x_window_size_get(Ecore_X_Window win, int *width, int *height)
* @param win The given window.
* @param ignore if to ignore
*/
-EAPI void
-ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
+EAPI void
+ecore_x_window_ignore_set(Ecore_X_Window win,
+ int ignore)
{
int i = 0, j = 0, count = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (ignore)
+ if (ignore)
{
- if (ignore_list)
+ if (ignore_list)
{
- for (i = 0; i < ignore_num; i++)
+ for (i = 0; i < ignore_num; i++)
if (win == ignore_list[i]) return;
- ignore_list =
+ ignore_list =
realloc(ignore_list, (ignore_num + 1) * sizeof(Ecore_X_Window));
if (!ignore_list) return;
ignore_list[ignore_num++] = win;
}
- else
+ else
{
ignore_num = 0;
ignore_list = malloc(sizeof(Ecore_X_Window));
@@ -1257,24 +1337,24 @@ ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
ignore_list[ignore_num++] = win;
}
}
- else
+ else
{
if (!ignore_list) return;
- for (count = ignore_num, i = 0, j = 0; i < count; i++)
+ for (count = ignore_num, i = 0, j = 0; i < count; i++)
{
if (win != ignore_list[i])
ignore_list[j++] = ignore_list[i];
else
ignore_num--;
}
- if (ignore_num <= 0)
+ if (ignore_num <= 0)
{
free(ignore_list);
ignore_list = NULL;
return;
}
- ignore_list =
+ ignore_list =
realloc(ignore_list, ignore_num * sizeof(Ecore_X_Window));
}
}
@@ -1285,7 +1365,7 @@ ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
* @return list of windows to ignore
*/
EAPI Ecore_X_Window *
-ecore_x_window_ignore_list(int *num)
+ecore_x_window_ignore_list(int *num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1302,7 +1382,7 @@ ecore_x_window_ignore_list(int *num)
* could not be allocated for the list, or if @p num_ret is @c NULL.
*/
EAPI Ecore_X_Window *
-ecore_x_window_root_list(int *num_ret)
+ecore_x_window_root_list(int *num_ret)
{
xcb_screen_iterator_t iter;
uint8_t i, num;
@@ -1327,54 +1407,54 @@ ecore_x_window_root_list(int *num_ret)
#ifdef ECORE_XCB_XPRINT
ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_x_print_id);
- if ((ext_reply) && (ext_reply->present))
+ if ((ext_reply) && (ext_reply->present))
{
xcb_x_print_print_query_screens_cookie_t cookie;
xcb_x_print_print_query_screens_reply_t *reply;
cookie = xcb_x_print_print_query_screens_unchecked(_ecore_xcb_conn);
- reply =
+ reply =
xcb_x_print_print_query_screens_reply(_ecore_xcb_conn, cookie, NULL);
- if (reply)
+ if (reply)
{
xcb_window_t *screens;
int psnum = 0, overlap = 0, j = 0, k = 0;
psnum = xcb_x_print_print_query_screens_roots_length(reply);
screens = xcb_x_print_print_query_screens_roots(reply);
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++)
{
- for (j = 0; j < psnum; j++)
+ for (j = 0; j < psnum; j++)
{
xcb_screen_t *s;
- if ((s = _ecore_xcb_window_screen_of_display(i)))
+ if ((s = _ecore_xcb_window_screen_of_display(i)))
{
- if (s->root == screens[j])
+ if (s->root == screens[j])
overlap++;
}
}
}
- if (!(roots = malloc((num - overlap)
+ if (!(roots = malloc((num - overlap)
* sizeof(Ecore_X_Window)))) return NULL;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++)
{
Eina_Bool is_print = EINA_FALSE;
- for (j = 0; j < psnum; j++)
+ for (j = 0; j < psnum; j++)
{
xcb_screen_t *s;
- if ((s = _ecore_xcb_window_screen_of_display(i)))
+ if ((s = _ecore_xcb_window_screen_of_display(i)))
{
- if (s->root == screens[j])
+ if (s->root == screens[j])
{
is_print = EINA_TRUE;
break;
}
}
}
- if (!is_print)
+ if (!is_print)
{
xcb_screen_t *s;
@@ -1388,29 +1468,29 @@ ecore_x_window_root_list(int *num_ret)
if (num_ret) *num_ret = k;
free(reply);
}
- else
+ else
{
/* Fallback to default method */
- iter =
- xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
- if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
- if (num_ret) *num_ret = num;
- for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
- roots[i] = iter.data->root;
+ iter =
+ xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
+ if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
+ if (num_ret) *num_ret = num;
+ for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
+ roots[i] = iter.data->root;
}
}
- else
+ else
{
/* Fallback to default method */
- iter =
- xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
- if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
- if (num_ret) *num_ret = num;
- for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
- roots[i] = iter.data->root;
+ iter =
+ xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
+ if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
+ if (num_ret) *num_ret = num;
+ for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
+ roots[i] = iter.data->root;
}
#else
- iter =
+ iter =
xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
if (num_ret) *num_ret = num;
@@ -1422,7 +1502,8 @@ ecore_x_window_root_list(int *num_ret)
}
EAPI Ecore_X_Window *
-ecore_x_window_children_get(Ecore_X_Window win, int *num)
+ecore_x_window_children_get(Ecore_X_Window win,
+ int *num)
{
xcb_query_tree_cookie_t cookie;
xcb_query_tree_reply_t *reply;
@@ -1437,16 +1518,16 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
if (!reply) return NULL;
if (num) *num = reply->children_len;
- if (reply->children_len > 0)
+ if (reply->children_len > 0)
{
windows = malloc(sizeof(Ecore_X_Window) * reply->children_len);
- if (windows)
+ if (windows)
{
unsigned int i = 0;
xcb_window_t *w;
w = xcb_query_tree_children(reply);
- for (i = 0; i < reply->children_len; i++)
+ for (i = 0; i < reply->children_len; i++)
windows[i] = w[i];
}
}
@@ -1461,8 +1542,8 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
* @return The root window of @p win
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_root_get(Ecore_X_Window win)
+EAPI Ecore_X_Window
+ecore_x_window_root_get(Ecore_X_Window win)
{
xcb_get_geometry_cookie_t gcookie;
xcb_get_geometry_reply_t *greply;
@@ -1480,8 +1561,8 @@ ecore_x_window_root_get(Ecore_X_Window win)
return window;
}
-EAPI Ecore_X_Window
-ecore_x_window_root_first_get(void)
+EAPI Ecore_X_Window
+ecore_x_window_root_first_get(void)
{
return ((xcb_screen_t *)_ecore_xcb_screen)->root;
}
@@ -1502,8 +1583,12 @@ ecore_x_window_root_first_get(void)
* @param h Pointer to an integer in which the height is to be stored.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI void
-ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h)
+EAPI void
+ecore_x_window_geometry_get(Ecore_X_Window win,
+ int *x,
+ int *y,
+ int *w,
+ int *h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -1519,8 +1604,9 @@ ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h)
* @return The window at that position.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_at_xy_get(int x, int y)
+EAPI Ecore_X_Window
+ecore_x_window_at_xy_get(int x,
+ int y)
{
Ecore_X_Window root, win = 0;
@@ -1544,8 +1630,11 @@ ecore_x_window_at_xy_get(int x, int y)
* @return The window at that position.
* @ingroup Ecore_X_Window_Geometry_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_at_xy_with_skip_get(int x, int y, Ecore_X_Window *skip, int skip_num)
+EAPI Ecore_X_Window
+ecore_x_window_at_xy_with_skip_get(int x,
+ int y,
+ Ecore_X_Window *skip,
+ int skip_num)
{
Ecore_X_Window root, win = 0;
@@ -1561,8 +1650,10 @@ ecore_x_window_at_xy_with_skip_get(int x, int y, Ecore_X_Window *skip, int skip_
return win ? win : root;
}
-EAPI Ecore_X_Window
-ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y)
+EAPI Ecore_X_Window
+ecore_x_window_at_xy_begin_get(Ecore_X_Window begin,
+ int x,
+ int y)
{
Ecore_X_Window win = 0;
@@ -1582,8 +1673,8 @@ ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y)
* @return The parent window of @p win.
* @ingroup Ecore_X_Window_Parent_Group
*/
-EAPI Ecore_X_Window
-ecore_x_window_parent_get(Ecore_X_Window win)
+EAPI Ecore_X_Window
+ecore_x_window_parent_get(Ecore_X_Window win)
{
xcb_query_tree_cookie_t cookie;
xcb_query_tree_reply_t *reply;
@@ -1608,8 +1699,8 @@ ecore_x_window_parent_get(Ecore_X_Window win)
* @return 1 if the window is visible, otherwise 0.
* @ingroup Ecore_X_Window_Visibility_Group
*/
-EAPI int
-ecore_x_window_visible_get(Ecore_X_Window win)
+EAPI int
+ecore_x_window_visible_get(Ecore_X_Window win)
{
xcb_get_window_attributes_cookie_t cookie;
xcb_get_window_attributes_reply_t *reply;
@@ -1622,15 +1713,19 @@ ecore_x_window_visible_get(Ecore_X_Window win)
reply = xcb_get_window_attributes_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return EINA_FALSE;
- if (reply->map_state == XCB_MAP_STATE_VIEWABLE)
+ if (reply->map_state == XCB_MAP_STATE_VIEWABLE)
ret = EINA_TRUE;
free(reply);
return ret;
}
-EAPI void
-ecore_x_window_button_grab(Ecore_X_Window win, int button, Ecore_X_Event_Mask mask, int mod, int any_mod)
+EAPI void
+ecore_x_window_button_grab(Ecore_X_Window win,
+ int button,
+ Ecore_X_Event_Mask mask,
+ int mod,
+ int any_mod)
{
int i = 0;
uint16_t m, locks[8], ev;
@@ -1657,13 +1752,13 @@ ecore_x_window_button_grab(Ecore_X_Window win, int button, Ecore_X_Event_Mask ma
locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
ev = mask;
- for (i = 0; i < 8; i++)
- xcb_grab_button(_ecore_xcb_conn, 0, win, ev,
- XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
+ for (i = 0; i < 8; i++)
+ xcb_grab_button(_ecore_xcb_conn, 0, win, ev,
+ XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
XCB_NONE, XCB_NONE, b, m | locks[i]);
_ecore_xcb_button_grabs_num++;
- t = realloc(_ecore_xcb_button_grabs,
+ t = realloc(_ecore_xcb_button_grabs,
_ecore_xcb_button_grabs_num * sizeof(Ecore_X_Window));
if (!t) return;
@@ -1671,8 +1766,11 @@ ecore_x_window_button_grab(Ecore_X_Window win, int button, Ecore_X_Event_Mask ma
_ecore_xcb_button_grabs[_ecore_xcb_button_grabs_num - 1] = win;
}
-EAPI void
-ecore_x_window_button_ungrab(Ecore_X_Window win, int button, int mod, int any_mod)
+EAPI void
+ecore_x_window_button_ungrab(Ecore_X_Window win,
+ int button,
+ int mod,
+ int any_mod)
{
int i = 0;
uint16_t m = 0, locks[8];
@@ -1702,8 +1800,11 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, int button, int mod, int any_mo
_ecore_xcb_sync_magic_send(1, win);
}
-EAPI void
-ecore_x_window_key_grab(Ecore_X_Window win, const char *key, int mod, int any_mod)
+EAPI void
+ecore_x_window_key_grab(Ecore_X_Window win,
+ const char *key,
+ int mod,
+ int any_mod)
{
xcb_keycode_t keycode = XCB_NO_SYMBOL;
uint16_t m = 0, locks[8];
@@ -1729,18 +1830,21 @@ ecore_x_window_key_grab(Ecore_X_Window win, const char *key, int mod, int any_mo
locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
for (i = 0; i < 8; i++)
- xcb_grab_key(_ecore_xcb_conn, 0, win, m | locks[i],
- keycode, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC);
+ xcb_grab_key(_ecore_xcb_conn, 0, win, m | locks[i],
+ keycode, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC);
_ecore_xcb_key_grabs_num++;
- t = realloc(_ecore_xcb_key_grabs,
+ t = realloc(_ecore_xcb_key_grabs,
_ecore_xcb_key_grabs_num * sizeof(Ecore_X_Window));
if (!t) return;
_ecore_xcb_key_grabs = t;
_ecore_xcb_key_grabs[_ecore_xcb_key_grabs_num - 1] = win;
}
-EAPI void
-ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key, int mod, int any_mod)
+EAPI void
+ecore_x_window_key_ungrab(Ecore_X_Window win,
+ const char *key,
+ int mod,
+ int any_mod)
{
xcb_keycode_t keycode = XCB_NO_SYMBOL;
uint16_t m = 0, locks[8];
@@ -1771,15 +1875,15 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key, int mod, int any_
}
/* local functions */
-Ecore_X_Window
-_ecore_xcb_window_root_of_screen_get(int screen)
+Ecore_X_Window
+_ecore_xcb_window_root_of_screen_get(int screen)
{
xcb_screen_iterator_t iter;
CHECK_XCB_CONN;
iter = xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
for (; iter.rem; --screen, xcb_screen_next(&iter))
- if (screen == 0)
+ if (screen == 0)
{
xcb_screen_t *s;
@@ -1789,8 +1893,14 @@ _ecore_xcb_window_root_of_screen_get(int screen)
return 0;
}
-static Ecore_X_Window
-_ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w, int h, uint8_t override_redirect, uint8_t save_under)
+static Ecore_X_Window
+_ecore_xcb_window_argb_internal_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h,
+ uint8_t override_redirect,
+ uint8_t save_under)
{
Ecore_X_Window win = 0;
#ifdef ECORE_XCB_RENDER
@@ -1807,16 +1917,16 @@ _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w,
if (parent == 0)
parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
- vis =
+ vis =
_ecore_xcb_render_find_visual_id(XCB_RENDER_PICT_TYPE_DIRECT, EINA_TRUE);
colormap = xcb_generate_id(_ecore_xcb_conn);
- xcb_create_colormap(_ecore_xcb_conn, XCB_COLORMAP_ALLOC_NONE,
+ xcb_create_colormap(_ecore_xcb_conn, XCB_COLORMAP_ALLOC_NONE,
colormap, parent, vis);
value_mask = (XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY |
- XCB_CW_WIN_GRAVITY | XCB_CW_BACKING_STORE |
- XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER |
+ XCB_CW_WIN_GRAVITY | XCB_CW_BACKING_STORE |
+ XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER |
XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE | XCB_CW_COLORMAP);
value_list[0] = XCB_BACK_PIXMAP_NONE;
@@ -1827,13 +1937,13 @@ _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w,
value_list[5] = override_redirect;
value_list[6] = save_under;
value_list[7] = (XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
- XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_PRESS |
XCB_EVENT_MASK_BUTTON_RELEASE |
XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
- XCB_EVENT_MASK_VISIBILITY_CHANGE |
+ XCB_EVENT_MASK_VISIBILITY_CHANGE |
XCB_EVENT_MASK_STRUCTURE_NOTIFY |
- XCB_EVENT_MASK_FOCUS_CHANGE |
+ XCB_EVENT_MASK_FOCUS_CHANGE |
XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_COLOR_MAP_CHANGE);
value_list[8] = XCB_EVENT_MASK_NO_EVENT;
@@ -1841,7 +1951,7 @@ _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w,
win = xcb_generate_id(_ecore_xcb_conn);
xcb_create_window(_ecore_xcb_conn, 32, win, parent, x, y, w, h, 0,
- XCB_WINDOW_CLASS_INPUT_OUTPUT, vis, value_mask,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, vis, value_mask,
value_list);
xcb_free_colormap(_ecore_xcb_conn, colormap);
@@ -1853,8 +1963,14 @@ _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w,
return win;
}
-static Ecore_X_Window
-_ecore_xcb_window_at_xy_get(Ecore_X_Window base, int bx, int by, int x, int y, Ecore_X_Window *skip, int skip_num)
+static Ecore_X_Window
+_ecore_xcb_window_at_xy_get(Ecore_X_Window base,
+ int bx,
+ int by,
+ int x,
+ int y,
+ Ecore_X_Window *skip,
+ int skip_num)
{
xcb_query_tree_cookie_t cookie;
xcb_query_tree_reply_t *reply;
@@ -1881,17 +1997,17 @@ _ecore_xcb_window_at_xy_get(Ecore_X_Window base, int bx, int by, int x, int y, E
num = reply->children_len;
windows = xcb_query_tree_children(reply);
- for (i = (num - 1); i >= 0; --i)
+ for (i = (num - 1); i >= 0; --i)
{
skipit = EINA_FALSE;
- if (skip)
+ if (skip)
{
int j = 0;
- for (j = 0; j < skip_num; j++)
+ for (j = 0; j < skip_num; j++)
{
- if (windows[i] == skip[j])
+ if (windows[i] == skip[j])
{
skipit = EINA_TRUE;
goto onward;
@@ -1899,14 +2015,14 @@ _ecore_xcb_window_at_xy_get(Ecore_X_Window base, int bx, int by, int x, int y, E
}
}
onward:
- if (!skipit)
+ if (!skipit)
{
Ecore_X_Window child = 0;
- child =
- _ecore_xcb_window_at_xy_get(windows[i],
+ child =
+ _ecore_xcb_window_at_xy_get(windows[i],
wx, wy, x, y, skip, skip_num);
- if (child)
+ if (child)
{
if (reply) free(reply);
return child;
@@ -1918,8 +2034,8 @@ onward:
return base;
}
-Ecore_X_Visual
-_ecore_xcb_window_visual_get(Ecore_X_Window win)
+Ecore_X_Visual
+_ecore_xcb_window_visual_get(Ecore_X_Window win)
{
xcb_get_window_attributes_cookie_t cookie;
xcb_get_window_attributes_reply_t *reply;
@@ -1936,17 +2052,17 @@ _ecore_xcb_window_visual_get(Ecore_X_Window win)
return visual;
}
-void
-_ecore_xcb_window_button_grab_remove(Ecore_X_Window win)
+void
+_ecore_xcb_window_button_grab_remove(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (_ecore_xcb_button_grabs_num > 0)
+ if (_ecore_xcb_button_grabs_num > 0)
{
int i = 0, shuffle = 0;
- for (i = 0; i < _ecore_xcb_button_grabs_num; i++)
+ for (i = 0; i < _ecore_xcb_button_grabs_num; i++)
{
if (shuffle)
_ecore_xcb_button_grabs[i - 1] = _ecore_xcb_button_grabs[i];
@@ -1955,19 +2071,19 @@ _ecore_xcb_window_button_grab_remove(Ecore_X_Window win)
shuffle = 1;
}
- if (shuffle)
+ if (shuffle)
{
Ecore_X_Window *t;
_ecore_xcb_button_grabs_num--;
- if (_ecore_xcb_button_grabs_num <= 0)
+ if (_ecore_xcb_button_grabs_num <= 0)
{
free(_ecore_xcb_button_grabs);
_ecore_xcb_button_grabs = NULL;
return;
}
- t = realloc(_ecore_xcb_button_grabs,
+ t = realloc(_ecore_xcb_button_grabs,
_ecore_xcb_button_grabs_num * sizeof(Ecore_X_Window));
if (!t) return;
_ecore_xcb_button_grabs = t;
@@ -1975,17 +2091,17 @@ _ecore_xcb_window_button_grab_remove(Ecore_X_Window win)
}
}
-void
-_ecore_xcb_window_key_grab_remove(Ecore_X_Window win)
+void
+_ecore_xcb_window_key_grab_remove(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- if (_ecore_xcb_key_grabs_num > 0)
+ if (_ecore_xcb_key_grabs_num > 0)
{
int i = 0, shuffle = 0;
- for (i = 0; i < _ecore_xcb_key_grabs_num; i++)
+ for (i = 0; i < _ecore_xcb_key_grabs_num; i++)
{
if (shuffle)
_ecore_xcb_key_grabs[i - 1] = _ecore_xcb_key_grabs[i];
@@ -1994,19 +2110,19 @@ _ecore_xcb_window_key_grab_remove(Ecore_X_Window win)
shuffle = 1;
}
- if (shuffle)
+ if (shuffle)
{
Ecore_X_Window *t;
_ecore_xcb_key_grabs_num--;
- if (_ecore_xcb_key_grabs_num <= 0)
+ if (_ecore_xcb_key_grabs_num <= 0)
{
free(_ecore_xcb_key_grabs);
_ecore_xcb_key_grabs = NULL;
return;
}
- t = realloc(_ecore_xcb_key_grabs,
+ t = realloc(_ecore_xcb_key_grabs,
_ecore_xcb_key_grabs_num * sizeof(Ecore_X_Window));
if (!t) return;
_ecore_xcb_key_grabs = t;
@@ -2014,35 +2130,39 @@ _ecore_xcb_window_key_grab_remove(Ecore_X_Window win)
}
}
-void
-_ecore_xcb_window_grab_allow_events(Ecore_X_Window event_win, Ecore_X_Window child_win, int type, void *event, Ecore_X_Time timestamp)
+void
+_ecore_xcb_window_grab_allow_events(Ecore_X_Window event_win,
+ Ecore_X_Window child_win,
+ int type,
+ void *event,
+ Ecore_X_Time timestamp)
{
int i = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- for (i = 0; i < _ecore_xcb_button_grabs_num; i++)
+ for (i = 0; i < _ecore_xcb_button_grabs_num; i++)
{
- if ((_ecore_xcb_button_grabs[i] == event_win) ||
- (_ecore_xcb_button_grabs[i] == child_win))
+ if ((_ecore_xcb_button_grabs[i] == event_win) ||
+ (_ecore_xcb_button_grabs[i] == child_win))
{
Eina_Bool replay = EINA_FALSE;
- if (_ecore_xcb_window_grab_replay_func)
+ if (_ecore_xcb_window_grab_replay_func)
{
- replay =
- _ecore_xcb_window_grab_replay_func(_ecore_xcb_window_grab_replay_data,
+ replay =
+ _ecore_xcb_window_grab_replay_func(_ecore_xcb_window_grab_replay_data,
type, event);
}
- if (replay)
+ if (replay)
{
- xcb_allow_events(_ecore_xcb_conn,
+ xcb_allow_events(_ecore_xcb_conn,
XCB_ALLOW_REPLAY_POINTER, timestamp);
}
- else
+ else
{
- xcb_allow_events(_ecore_xcb_conn,
+ xcb_allow_events(_ecore_xcb_conn,
XCB_ALLOW_ASYNC_POINTER, timestamp);
}
break;
@@ -2050,43 +2170,43 @@ _ecore_xcb_window_grab_allow_events(Ecore_X_Window event_win, Ecore_X_Window chi
}
}
-static int
-_ecore_xcb_window_modifiers_get(unsigned int state)
+static int
+_ecore_xcb_window_modifiers_get(unsigned int state)
{
int xmodifiers = 0;
if (state & ECORE_EVENT_MODIFIER_SHIFT)
- xmodifiers |= ECORE_X_MODIFIER_SHIFT;
+ xmodifiers |= ECORE_X_MODIFIER_SHIFT;
if (state & ECORE_EVENT_MODIFIER_CTRL)
- xmodifiers |= ECORE_X_MODIFIER_CTRL;
+ xmodifiers |= ECORE_X_MODIFIER_CTRL;
if (state & ECORE_EVENT_MODIFIER_ALT)
- xmodifiers |= ECORE_X_MODIFIER_ALT;
+ xmodifiers |= ECORE_X_MODIFIER_ALT;
if (state & ECORE_EVENT_MODIFIER_WIN)
- xmodifiers |= ECORE_X_MODIFIER_WIN;
+ xmodifiers |= ECORE_X_MODIFIER_WIN;
if (state & ECORE_EVENT_LOCK_SCROLL)
- xmodifiers |= ECORE_X_LOCK_SCROLL;
+ xmodifiers |= ECORE_X_LOCK_SCROLL;
if (state & ECORE_EVENT_LOCK_NUM)
- xmodifiers |= ECORE_X_LOCK_NUM;
+ xmodifiers |= ECORE_X_LOCK_NUM;
if (state & ECORE_EVENT_LOCK_CAPS)
- xmodifiers |= ECORE_X_LOCK_CAPS;
+ xmodifiers |= ECORE_X_LOCK_CAPS;
if (state & ECORE_EVENT_LOCK_SHIFT)
- xmodifiers |= ECORE_X_LOCK_SHIFT;
+ xmodifiers |= ECORE_X_LOCK_SHIFT;
return xmodifiers;
}
static xcb_visualtype_t *
-_ecore_xcb_window_find_visual_by_id(xcb_visualid_t id)
+_ecore_xcb_window_find_visual_by_id(xcb_visualid_t id)
{
xcb_depth_iterator_t diter;
xcb_visualtype_iterator_t viter;
CHECK_XCB_CONN;
diter = xcb_screen_allowed_depths_iterator(_ecore_xcb_screen);
- for (; diter.rem; xcb_depth_next(&diter))
+ for (; diter.rem; xcb_depth_next(&diter))
{
viter = xcb_depth_visuals_iterator(diter.data);
- for (; viter.rem; xcb_visualtype_next(&viter))
+ for (; viter.rem; xcb_visualtype_next(&viter))
{
if (viter.data->visual_id == id)
return viter.data;
@@ -2097,7 +2217,7 @@ _ecore_xcb_window_find_visual_by_id(xcb_visualid_t id)
#ifdef ECORE_XCB_XPRINT
static xcb_screen_t *
-_ecore_xcb_window_screen_of_display(int screen)
+_ecore_xcb_window_screen_of_display(int screen)
{
xcb_screen_iterator_t iter;
@@ -2109,4 +2229,5 @@ _ecore_xcb_window_screen_of_display(int screen)
return NULL;
}
+
#endif