aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c707
1 files changed, 434 insertions, 273 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
index 6ac8805b34..1d041d3a41 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
@@ -2,43 +2,43 @@
/* local function prototypes */
/* static void _ecore_xcb_netwm_startup_info_free(void *data); */
-static Ecore_X_Atom _ecore_xcb_netwm_window_type_atom_get(Ecore_X_Window_Type type);
+static Ecore_X_Atom _ecore_xcb_netwm_window_type_atom_get(Ecore_X_Window_Type type);
static Ecore_X_Window_Type _ecore_xcb_netwm_window_type_type_get(Ecore_X_Atom atom);
-static Ecore_X_Atom _ecore_xcb_netwm_window_state_atom_get(Ecore_X_Window_State state);
-static Ecore_X_Atom _ecore_xcb_netwm_action_atom_get(Ecore_X_Action action);
+static Ecore_X_Atom _ecore_xcb_netwm_window_state_atom_get(Ecore_X_Window_State state);
+static Ecore_X_Atom _ecore_xcb_netwm_action_atom_get(Ecore_X_Action action);
/* local variables */
//static Eina_Hash *_startup_info = NULL;
/* local structures */
typedef struct _Ecore_Xcb_Startup_Info Ecore_Xcb_Startup_Info;
-struct _Ecore_Xcb_Startup_Info
+struct _Ecore_Xcb_Startup_Info
{
Ecore_X_Window win;
- int init, size;
- char *buffer;
- int length;
+ int init, size;
+ char *buffer;
+ int length;
/* sequence info fields */
- char *id, *name;
- int screen;
- char *bin, *icon;
- int desktop, timestamp;
- char *description, *wmclass;
- int silent;
+ char *id, *name;
+ int screen;
+ char *bin, *icon;
+ int desktop, timestamp;
+ char *description, *wmclass;
+ int silent;
};
-EAPI void
-ecore_x_netwm_init(void)
+EAPI void
+ecore_x_netwm_init(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
-// _startup_info =
+// _startup_info =
// eina_hash_string_superfast_new(_ecore_xcb_netwm_startup_info_free);
}
-EAPI void
-ecore_x_netwm_shutdown(void)
+EAPI void
+ecore_x_netwm_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -46,8 +46,9 @@ ecore_x_netwm_shutdown(void)
// _startup_info = NULL;
}
-EAPI Eina_Bool
-ecore_x_netwm_pid_get(Ecore_X_Window win, int *pid)
+EAPI Eina_Bool
+ecore_x_netwm_pid_get(Ecore_X_Window win,
+ int *pid)
{
uint32_t tmp;
@@ -61,8 +62,9 @@ ecore_x_netwm_pid_get(Ecore_X_Window win, int *pid)
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_pid_set(Ecore_X_Window win, int pid)
+EAPI void
+ecore_x_netwm_pid_set(Ecore_X_Window win,
+ int pid)
{
unsigned int tmp;
@@ -72,8 +74,9 @@ ecore_x_netwm_pid_set(Ecore_X_Window win, int pid)
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_PID, &tmp, 1);
}
-EAPI Eina_Bool
-ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
+EAPI Eina_Bool
+ecore_x_netwm_window_type_get(Ecore_X_Window win,
+ Ecore_X_Window_Type *type)
{
Ecore_X_Atom *atoms;
int num = 0;
@@ -82,8 +85,8 @@ ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
if (type) *type = ECORE_X_WINDOW_TYPE_NORMAL;
- num =
- ecore_x_window_prop_atom_list_get(win,
+ num =
+ ecore_x_window_prop_atom_list_get(win,
ECORE_X_ATOM_NET_WM_WINDOW_TYPE, &atoms);
if ((type) && (num >= 1) && (atoms))
*type = _ecore_xcb_netwm_window_type_type_get(atoms[0]);
@@ -94,8 +97,9 @@ ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
return EINA_FALSE;
}
-EAPI void
-ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type)
+EAPI void
+ecore_x_netwm_window_type_set(Ecore_X_Window win,
+ Ecore_X_Window_Type type)
{
Ecore_X_Atom atom;
@@ -105,8 +109,9 @@ ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type)
ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE, &atom, 1);
}
-EAPI int
-ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
+EAPI int
+ecore_x_netwm_window_types_get(Ecore_X_Window win,
+ Ecore_X_Window_Type **types)
{
int num = 0, i = 0;
Ecore_X_Atom *atoms = NULL;
@@ -115,17 +120,17 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (types) *types = NULL;
- num =
- ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
+ num =
+ ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
&atoms);
- if ((num <= 0) || (!atoms))
+ if ((num <= 0) || (!atoms))
{
if (atoms) free(atoms);
return 0;
}
atoms2 = malloc(num * sizeof(Ecore_X_Window_Type));
- if (!atoms2)
+ if (!atoms2)
{
if (atoms) free(atoms);
return 0;
@@ -135,7 +140,7 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
atoms2[i] = _ecore_xcb_netwm_window_type_type_get(atoms[i]);
if (atoms) free(atoms);
- if (types)
+ if (types)
*types = atoms2;
else
free(atoms2);
@@ -143,41 +148,45 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
return num;
}
-EAPI int
-ecore_x_netwm_name_get(Ecore_X_Window win, char **name)
+EAPI int
+ecore_x_netwm_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (name)
+ if (name)
*name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_NAME);
return 1;
}
-EAPI void
-ecore_x_netwm_name_set(Ecore_X_Window win, const char *name)
+EAPI void
+ecore_x_netwm_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_NAME, name);
}
-EAPI void
-ecore_x_netwm_opacity_set(Ecore_X_Window win, unsigned int opacity)
+EAPI void
+ecore_x_netwm_opacity_set(Ecore_X_Window win,
+ unsigned int opacity)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
+ ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
&opacity, 1);
}
-EAPI Eina_Bool
-ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity)
+EAPI Eina_Bool
+ecore_x_netwm_opacity_get(Ecore_X_Window win,
+ unsigned int *opacity)
{
unsigned int tmp = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
+ if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
&tmp, 1))
return EINA_FALSE;
@@ -186,30 +195,36 @@ ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity)
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check, const char *wm_name)
+EAPI void
+ecore_x_netwm_wm_identify(Ecore_X_Window root,
+ Ecore_X_Window check,
+ const char *wm_name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
+ ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
&check, 1);
- ecore_x_window_prop_window_set(check, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
+ ecore_x_window_prop_window_set(check, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
&check, 1);
ecore_x_window_prop_string_set(check, ECORE_X_ATOM_NET_WM_NAME, wm_name);
ecore_x_window_prop_string_set(root, ECORE_X_ATOM_NET_WM_NAME, wm_name);
}
-EAPI void
-ecore_x_netwm_supported_set(Ecore_X_Window root, Ecore_X_Atom *supported, int num)
+EAPI void
+ecore_x_netwm_supported_set(Ecore_X_Window root,
+ Ecore_X_Atom *supported,
+ int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_atom_set(root, ECORE_X_ATOM_NET_SUPPORTED,
+ ecore_x_window_prop_atom_set(root, ECORE_X_ATOM_NET_SUPPORTED,
supported, num);
}
-EAPI Eina_Bool
-ecore_x_netwm_supported_get(Ecore_X_Window root, Ecore_X_Atom **supported, int *num)
+EAPI Eina_Bool
+ecore_x_netwm_supported_get(Ecore_X_Window root,
+ Ecore_X_Atom **supported,
+ int *num)
{
int num_ret = 0;
@@ -218,8 +233,8 @@ ecore_x_netwm_supported_get(Ecore_X_Window root, Ecore_X_Atom **supported, int *
if (num) *num = 0;
if (supported) *supported = NULL;
- num_ret =
- ecore_x_window_prop_atom_list_get(root, ECORE_X_ATOM_NET_SUPPORTED,
+ num_ret =
+ ecore_x_window_prop_atom_list_get(root, ECORE_X_ATOM_NET_SUPPORTED,
supported);
if (num_ret <= 0) return EINA_FALSE;
if (num) *num = num_ret;
@@ -227,26 +242,31 @@ ecore_x_netwm_supported_get(Ecore_X_Window root, Ecore_X_Atom **supported, int *
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_desk_count_set(Ecore_X_Window root, unsigned int n_desks)
+EAPI void
+ecore_x_netwm_desk_count_set(Ecore_X_Window root,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS,
&n_desks, 1);
}
-EAPI void
-ecore_x_netwm_desk_roots_set(Ecore_X_Window root, Ecore_X_Window *vroots, unsigned int n_desks)
+EAPI void
+ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
+ Ecore_X_Window *vroots,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_VIRTUAL_ROOTS,
+ ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_VIRTUAL_ROOTS,
vroots, n_desks);
}
-EAPI void
-ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names, unsigned int n_desks)
+EAPI void
+ecore_x_netwm_desk_names_set(Ecore_X_Window root,
+ const char **names,
+ unsigned int n_desks)
{
char ss[32], *buf = NULL, *t = NULL;
const char *s;
@@ -261,13 +281,13 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names, unsigned i
if (!s)
{
/* Default to "Desk-<number>" */
- sprintf(ss, "Desk-%d", i);
- s = ss;
+ sprintf(ss, "Desk-%d", i);
+ s = ss;
}
l = strlen(s) + 1;
t = realloc(buf, len + 1);
- if (t)
+ if (t)
{
buf = t;
memcpy(buf + len, s, l);
@@ -276,14 +296,16 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names, unsigned i
}
xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, root,
- ECORE_X_ATOM_NET_DESKTOP_NAMES,
+ ECORE_X_ATOM_NET_DESKTOP_NAMES,
ECORE_X_ATOM_UTF8_STRING, 8, len, (const void *)buf);
// ecore_x_flush();
free(buf);
}
-EAPI void
-ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width, unsigned int height)
+EAPI void
+ecore_x_netwm_desk_size_set(Ecore_X_Window root,
+ unsigned int width,
+ unsigned int height)
{
uint32_t size[2];
@@ -291,21 +313,27 @@ ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width, unsigned in
size[0] = width;
size[1] = height;
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY,
size, 2);
}
-EAPI void
-ecore_x_netwm_desk_viewports_set(Ecore_X_Window root, unsigned int *origins, unsigned int n_desks)
+EAPI void
+ecore_x_netwm_desk_viewports_set(Ecore_X_Window root,
+ unsigned int *origins,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT,
origins, (2 * n_desks));
}
-EAPI void
-ecore_x_netwm_desk_layout_set(Ecore_X_Window root, int orientation, int columns, int rows, int starting_corner)
+EAPI void
+ecore_x_netwm_desk_layout_set(Ecore_X_Window root,
+ int orientation,
+ int columns,
+ int rows,
+ int starting_corner)
{
unsigned int layout[4];
@@ -315,64 +343,74 @@ ecore_x_netwm_desk_layout_set(Ecore_X_Window root, int orientation, int columns,
layout[1] = columns;
layout[2] = rows;
layout[3] = starting_corner;
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_LAYOUT,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_LAYOUT,
layout, 4);
}
-EAPI void
-ecore_x_netwm_desk_workareas_set(Ecore_X_Window root, unsigned int *areas, unsigned int n_desks)
+EAPI void
+ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
+ unsigned int *areas,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas,
4 * n_desks);
}
-EAPI void
-ecore_x_netwm_desk_current_set(Ecore_X_Window root, unsigned int desk)
+EAPI void
+ecore_x_netwm_desk_current_set(Ecore_X_Window root,
+ unsigned int desk)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP,
&desk, 1);
}
-EAPI void
-ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, Eina_Bool on)
+EAPI void
+ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
+ Eina_Bool on)
{
unsigned int val = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
val = ((on) ? 1 : 0);
- ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP,
+ ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP,
&val, 1);
}
-EAPI int
-ecore_x_netwm_startup_id_get(Ecore_X_Window win, char **id)
+EAPI int
+ecore_x_netwm_startup_id_get(Ecore_X_Window win,
+ char **id)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (id)
+ if (id)
{
- *id =
+ *id =
ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_STARTUP_ID);
}
return 1;
}
-EAPI void
-ecore_x_netwm_startup_id_set(Ecore_X_Window win, const char *id)
+EAPI void
+ecore_x_netwm_startup_id_set(Ecore_X_Window win,
+ const char *id)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id);
}
-EAPI void
-ecore_x_netwm_state_request_send(Ecore_X_Window win, Ecore_X_Window root, Ecore_X_Window_State s1, Ecore_X_Window_State s2, Eina_Bool set)
+EAPI void
+ecore_x_netwm_state_request_send(Ecore_X_Window win,
+ Ecore_X_Window root,
+ Ecore_X_Window_State s1,
+ Ecore_X_Window_State s2,
+ Eina_Bool set)
{
xcb_client_message_event_t ev;
@@ -393,21 +431,23 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win, Ecore_X_Window root, Ecore_
ev.data.data32[3] = 1;
ev.data.data32[4] = 0;
- xcb_send_event(_ecore_xcb_conn, 0, root,
- (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev);
+ xcb_send_event(_ecore_xcb_conn, 0, root,
+ (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev);
// ecore_x_flush();
}
-EAPI void
-ecore_x_netwm_window_state_set(Ecore_X_Window win, Ecore_X_Window_State *state, unsigned int num)
+EAPI void
+ecore_x_netwm_window_state_set(Ecore_X_Window win,
+ Ecore_X_Window_State *state,
+ unsigned int num)
{
Ecore_X_Atom *set;
unsigned int i = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!num)
+ if (!num)
{
ecore_x_window_prop_property_del(win, ECORE_X_ATOM_NET_WM_STATE);
return;
@@ -416,15 +456,17 @@ ecore_x_netwm_window_state_set(Ecore_X_Window win, Ecore_X_Window_State *state,
set = malloc(num * sizeof(Ecore_X_Atom));
if (!set) return;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++)
set[i] = _ecore_xcb_netwm_window_state_atom_get(state[i]);
ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_STATE, set, num);
free(set);
}
-EAPI Eina_Bool
-ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state, unsigned int *num)
+EAPI Eina_Bool
+ecore_x_netwm_window_state_get(Ecore_X_Window win,
+ Ecore_X_Window_State **state,
+ unsigned int *num)
{
Ecore_X_Atom *atoms;
int ret = 0;
@@ -434,15 +476,15 @@ ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state,
if (num) *num = 0;
if (state) *state = NULL;
- ret =
+ ret =
ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_STATE, &atoms);
if (ret <= 0) return EINA_FALSE;
- if (state)
+ if (state)
{
*state = malloc(ret * sizeof(Ecore_X_Window_State));
- if (*state)
+ if (*state)
{
int i = 0;
@@ -457,17 +499,21 @@ ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state,
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_client_active_set(Ecore_X_Window root, Ecore_X_Window win)
+EAPI void
+ecore_x_netwm_client_active_set(Ecore_X_Window root,
+ Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_window_set(root,
+ ecore_x_window_prop_window_set(root,
ECORE_X_ATOM_NET_ACTIVE_WINDOW, &win, 1);
}
-EAPI void
-ecore_x_netwm_client_active_request(Ecore_X_Window root, Ecore_X_Window win, int type, Ecore_X_Window current_win)
+EAPI void
+ecore_x_netwm_client_active_request(Ecore_X_Window root,
+ Ecore_X_Window win,
+ int type,
+ Ecore_X_Window current_win)
{
xcb_client_message_event_t ev;
@@ -486,32 +532,36 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root, Ecore_X_Window win, int
ev.data.data32[3] = 0;
ev.data.data32[4] = 0;
- xcb_send_event(_ecore_xcb_conn, 0, root,
- (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev);
+ xcb_send_event(_ecore_xcb_conn, 0, root,
+ (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev);
// ecore_x_flush();
}
-EAPI void
-ecore_x_netwm_client_list_set(Ecore_X_Window root, Ecore_X_Window *p_clients, unsigned int n_clients)
+EAPI void
+ecore_x_netwm_client_list_set(Ecore_X_Window root,
+ Ecore_X_Window *p_clients,
+ unsigned int n_clients)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST,
+ ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST,
p_clients, n_clients);
}
-EAPI void
-ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, Ecore_X_Window *p_clients, unsigned int n_clients)
+EAPI void
+ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root,
+ Ecore_X_Window *p_clients,
+ unsigned int n_clients)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING,
+ ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING,
p_clients, n_clients);
}
-EAPI Eina_Bool
-ecore_x_screen_is_composited(int screen)
+EAPI Eina_Bool
+ecore_x_screen_is_composited(int screen)
{
char buff[32];
xcb_get_selection_owner_cookie_t ocookie;
@@ -524,12 +574,12 @@ ecore_x_screen_is_composited(int screen)
snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
- if (atom == XCB_NONE)
+ if (atom == XCB_NONE)
{
xcb_intern_atom_cookie_t acookie;
xcb_intern_atom_reply_t *areply;
- acookie =
+ acookie =
xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
if (!areply) return EINA_FALSE;
@@ -547,8 +597,9 @@ ecore_x_screen_is_composited(int screen)
return (win != XCB_NONE) ? EINA_TRUE : EINA_FALSE;
}
-EAPI void
-ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
+EAPI void
+ecore_x_screen_is_composited_set(int screen,
+ Ecore_X_Window win)
{
static Ecore_X_Atom atom = XCB_NONE;
char buff[32];
@@ -557,12 +608,12 @@ ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
CHECK_XCB_CONN;
snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
- if (atom == XCB_NONE)
+ if (atom == XCB_NONE)
{
xcb_intern_atom_cookie_t acookie;
xcb_intern_atom_reply_t *areply;
- acookie =
+ acookie =
xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
if (!areply) return;
@@ -570,12 +621,12 @@ ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
free(areply);
}
if (atom == XCB_NONE) return;
- xcb_set_selection_owner(_ecore_xcb_conn, win, atom,
+ xcb_set_selection_owner(_ecore_xcb_conn, win, atom,
_ecore_xcb_events_last_time_get());
}
-EAPI void
-ecore_x_netwm_ping_send(Ecore_X_Window win)
+EAPI void
+ecore_x_netwm_ping_send(Ecore_X_Window win)
{
xcb_client_message_event_t ev;
@@ -594,13 +645,17 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
ev.data.data32[3] = 0;
ev.data.data32[4] = 0;
- xcb_send_event(_ecore_xcb_conn, 0, win,
+ xcb_send_event(_ecore_xcb_conn, 0, win,
XCB_EVENT_MASK_NO_EVENT, (const char *)&ev);
// ecore_x_flush();
}
-EAPI void
-ecore_x_netwm_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb)
+EAPI void
+ecore_x_netwm_frame_size_set(Ecore_X_Window win,
+ int fl,
+ int fr,
+ int ft,
+ int fb)
{
uint32_t frames[4];
@@ -610,19 +665,23 @@ ecore_x_netwm_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb)
frames[1] = fr;
frames[2] = ft;
frames[3] = fb;
- ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_FRAME_EXTENTS,
+ ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_FRAME_EXTENTS,
frames, 4);
}
-EAPI Eina_Bool
-ecore_x_netwm_frame_size_get(Ecore_X_Window win, int *fl, int *fr, int *ft, int *fb)
+EAPI Eina_Bool
+ecore_x_netwm_frame_size_get(Ecore_X_Window win,
+ int *fl,
+ int *fr,
+ int *ft,
+ int *fb)
{
int ret = 0;
unsigned int frames[4];
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_FRAME_EXTENTS,
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_FRAME_EXTENTS,
frames, 4);
if (ret != 4) return EINA_FALSE;
@@ -634,8 +693,9 @@ ecore_x_netwm_frame_size_get(Ecore_X_Window win, int *fl, int *fr, int *ft, int
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_sync_request_send(Ecore_X_Window win, unsigned int serial)
+EAPI void
+ecore_x_netwm_sync_request_send(Ecore_X_Window win,
+ unsigned int serial)
{
xcb_client_message_event_t ev;
@@ -657,27 +717,29 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win, unsigned int serial)
ev.data.data32[3] = 0;
ev.data.data32[4] = 0;
- xcb_send_event(_ecore_xcb_conn, 0, win,
+ xcb_send_event(_ecore_xcb_conn, 0, win,
XCB_EVENT_MASK_NO_EVENT, (const char *)&ev);
// ecore_x_flush();
}
-EAPI void
-ecore_x_netwm_desktop_set(Ecore_X_Window win, unsigned int desk)
+EAPI void
+ecore_x_netwm_desktop_set(Ecore_X_Window win,
+ unsigned int desk)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1);
}
-EAPI Eina_Bool
-ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk)
+EAPI Eina_Bool
+ecore_x_netwm_desktop_get(Ecore_X_Window win,
+ unsigned int *desk)
{
unsigned int tmp = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_DESKTOP,
+ if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_DESKTOP,
&tmp, 1))
return EINA_FALSE;
@@ -686,8 +748,10 @@ ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk)
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_desktop_request_send(Ecore_X_Window win, Ecore_X_Window root, unsigned int desktop)
+EAPI void
+ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
+ Ecore_X_Window root,
+ unsigned int desktop)
{
xcb_client_message_event_t ev;
@@ -704,57 +768,61 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win, Ecore_X_Window root, unsi
ev.type = ECORE_X_ATOM_NET_WM_DESKTOP;
ev.data.data32[0] = desktop;
- xcb_send_event(_ecore_xcb_conn, 0, root,
- (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev);
+ xcb_send_event(_ecore_xcb_conn, 0, root,
+ (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev);
// ecore_x_flush();
}
-EAPI void
-ecore_x_netwm_handled_icons_set(Ecore_X_Window win)
+EAPI void
+ecore_x_netwm_handled_icons_set(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
+ ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
NULL, 0);
}
-EAPI Eina_Bool
-ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
+EAPI Eina_Bool
+ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
+ if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
NULL, 0))
return EINA_FALSE;
return EINA_TRUE;
}
-EAPI int
-ecore_x_netwm_icon_name_get(Ecore_X_Window win, char **name)
+EAPI int
+ecore_x_netwm_icon_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (name)
+ if (name)
{
- *name =
+ *name =
ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_ICON_NAME);
}
return 1;
}
-EAPI void
-ecore_x_netwm_icon_name_set(Ecore_X_Window win, const char *name)
+EAPI void
+ecore_x_netwm_icon_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME, name);
}
-EAPI Eina_Bool
-ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
+EAPI Eina_Bool
+ecore_x_netwm_icons_get(Ecore_X_Window win,
+ Ecore_X_Icon **icon,
+ int *num)
{
int num_ret = 0;
unsigned int i = 0, len = 0, icons = 0;
@@ -765,15 +833,15 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
if (num) *num = 0;
if (icon) *icon = NULL;
- num_ret =
+ num_ret =
ecore_x_window_prop_card32_list_get(win, ECORE_X_ATOM_NET_WM_ICON, &data);
- if ((num_ret <= 0) || (!data))
+ if ((num_ret <= 0) || (!data))
{
if (data) free(data);
return EINA_FALSE;
}
- if (num_ret < 2)
+ if (num_ret < 2)
{
if (data) free(data);
return EINA_FALSE;
@@ -781,11 +849,11 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
icons = 0;
p = data;
- while (p)
+ while (p)
{
len = (p[0] * p[1]);
p += (len + 2);
- if ((p - data) > num_ret)
+ if ((p - data) > num_ret)
{
if (data) free(data);
return EINA_FALSE;
@@ -794,14 +862,14 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
if ((p - data) == num_ret) p = NULL;
}
if (num) *num = icons;
- if (!icon)
+ if (!icon)
{
if (data) free(data);
return EINA_TRUE;
}
*icon = malloc(icons * sizeof(Ecore_X_Icon));
- if (!(*icon))
+ if (!(*icon))
{
if (data) free(data);
return EINA_FALSE;
@@ -809,7 +877,7 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
/* Fetch the icons */
p = data;
- for (i = 0; i < icons; i++)
+ for (i = 0; i < icons; i++)
{
unsigned int *ps, *pd, *pe;
@@ -848,8 +916,12 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int w, int h)
+EAPI void
+ecore_x_netwm_icon_geometry_set(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
unsigned int geom[4];
@@ -859,20 +931,24 @@ ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int w, int h)
geom[1] = y;
geom[2] = w;
geom[3] = h;
- ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON_GEOMETRY,
+ ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON_GEOMETRY,
geom, 4);
}
-EAPI Eina_Bool
-ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h)
+EAPI Eina_Bool
+ecore_x_netwm_icon_geometry_get(Ecore_X_Window win,
+ int *x,
+ int *y,
+ int *w,
+ int *h)
{
int ret = 0;
unsigned int geom[4];
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ret =
- ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_ICON_GEOMETRY,
+ ret =
+ ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_ICON_GEOMETRY,
geom, 4);
if (ret != 4) return EINA_FALSE;
if (x) *x = geom[0];
@@ -883,8 +959,12 @@ ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_strut_set(Ecore_X_Window win, int l, int r, int t, int b)
+EAPI void
+ecore_x_netwm_strut_set(Ecore_X_Window win,
+ int l,
+ int r,
+ int t,
+ int b)
{
unsigned int strut[4];
@@ -897,15 +977,19 @@ ecore_x_netwm_strut_set(Ecore_X_Window win, int l, int r, int t, int b)
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_STRUT, strut, 4);
}
-EAPI Eina_Bool
-ecore_x_netwm_strut_get(Ecore_X_Window win, int *l, int *r, int *t, int *b)
+EAPI Eina_Bool
+ecore_x_netwm_strut_get(Ecore_X_Window win,
+ int *l,
+ int *r,
+ int *t,
+ int *b)
{
unsigned int strut[4];
int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ret =
+ ret =
ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_STRUT, strut, 4);
if (ret != 4) return EINA_FALSE;
@@ -917,8 +1001,20 @@ ecore_x_netwm_strut_get(Ecore_X_Window win, int *l, int *r, int *t, int *b)
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_strut_partial_set(Ecore_X_Window win, int left, int right, int top, int bottom, int left_start_y, int left_end_y, int right_start_y, int right_end_y, int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x)
+EAPI void
+ecore_x_netwm_strut_partial_set(Ecore_X_Window win,
+ int left,
+ int right,
+ int top,
+ int bottom,
+ int left_start_y,
+ int left_end_y,
+ int right_start_y,
+ int right_end_y,
+ int top_start_x,
+ int top_end_x,
+ int bottom_start_x,
+ int bottom_end_x)
{
unsigned int strut[12];
@@ -940,16 +1036,28 @@ ecore_x_netwm_strut_partial_set(Ecore_X_Window win, int left, int right, int top
strut, 12);
}
-EAPI Eina_Bool
-ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom, int *left_start_y, int *left_end_y, int *right_start_y, int *right_end_y, int *top_start_x, int *top_end_x, int *bottom_start_x, int *bottom_end_x)
+EAPI Eina_Bool
+ecore_x_netwm_strut_partial_get(Ecore_X_Window win,
+ int *left,
+ int *right,
+ int *top,
+ int *bottom,
+ int *left_start_y,
+ int *left_end_y,
+ int *right_start_y,
+ int *right_end_y,
+ int *top_start_x,
+ int *top_end_x,
+ int *bottom_start_x,
+ int *bottom_end_x)
{
unsigned int strut[12];
int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ret =
- ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_STRUT_PARTIAL,
+ ret =
+ ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_STRUT_PARTIAL,
strut, 12);
if (ret != 12) return EINA_FALSE;
@@ -969,23 +1077,25 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right, int *
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_user_time_set(Ecore_X_Window win, unsigned int t)
+EAPI void
+ecore_x_netwm_user_time_set(Ecore_X_Window win,
+ unsigned int t)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_USER_TIME, &t, 1);
}
-EAPI Eina_Bool
-ecore_x_netwm_user_time_get(Ecore_X_Window win, unsigned int *t)
+EAPI Eina_Bool
+ecore_x_netwm_user_time_get(Ecore_X_Window win,
+ unsigned int *t)
{
unsigned int tmp;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_USER_TIME,
- &tmp, 1))
+ if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_USER_TIME,
+ &tmp, 1))
return EINA_FALSE;
if (t) *t = tmp;
@@ -993,60 +1103,65 @@ ecore_x_netwm_user_time_get(Ecore_X_Window win, unsigned int *t)
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_visible_name_set(Ecore_X_Window win, const char *name)
+EAPI void
+ecore_x_netwm_visible_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
+ ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
name);
}
-EAPI int
-ecore_x_netwm_visible_name_get(Ecore_X_Window win, char **name)
+EAPI int
+ecore_x_netwm_visible_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (name)
- *name = ecore_x_window_prop_string_get(win,
+ if (name)
+ *name = ecore_x_window_prop_string_get(win,
ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
return 1;
}
-EAPI void
-ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, const char *name)
+EAPI void
+ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
+ ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
name);
}
-EAPI int
-ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win, char **name)
+EAPI int
+ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (name)
+ if (name)
{
- *name =
- ecore_x_window_prop_string_get(win,
+ *name =
+ ecore_x_window_prop_string_get(win,
ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
}
return 1;
}
-EAPI Eina_Bool
-ecore_x_netwm_sync_counter_get(Ecore_X_Window win, Ecore_X_Sync_Counter *counter)
+EAPI Eina_Bool
+ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
+ Ecore_X_Sync_Counter *counter)
{
unsigned int tmp;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
- &tmp, 1))
+ if (!ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
+ &tmp, 1))
return EINA_FALSE;
if (counter) *counter = tmp;
@@ -1054,8 +1169,9 @@ ecore_x_netwm_sync_counter_get(Ecore_X_Window win, Ecore_X_Sync_Counter *counter
return EINA_TRUE;
}
-EAPI Eina_Bool
-ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
+EAPI Eina_Bool
+ecore_x_netwm_allowed_action_isset(Ecore_X_Window win,
+ Ecore_X_Action action)
{
int num = 0, i = 0;
Ecore_X_Atom *atoms, atom;
@@ -1063,15 +1179,15 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- num =
- ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
+ num =
+ ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
&atoms);
if (num <= 0) return EINA_FALSE;
atom = _ecore_xcb_netwm_action_atom_get(action);
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++)
{
- if (atoms[i] == atom)
+ if (atoms[i] == atom)
{
ret = EINA_TRUE;
break;
@@ -1082,8 +1198,10 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
return ret;
}
-EAPI Eina_Bool
-ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, unsigned int *num)
+EAPI Eina_Bool
+ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
+ Ecore_X_Action **action,
+ unsigned int *num)
{
Ecore_X_Atom *atoms;
int num_ret = 0;
@@ -1093,14 +1211,14 @@ ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, un
if (num) *num = 0;
if (action) *action = NULL;
- num_ret =
- ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
+ num_ret =
+ ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
&atoms);
if (num_ret <= 0) return EINA_FALSE;
- if (action)
+ if (action)
{
*action = malloc(num_ret * sizeof(Ecore_X_Action));
- if (*action)
+ if (*action)
{
int i = 0;
@@ -1113,17 +1231,19 @@ ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, un
return EINA_TRUE;
}
-EAPI void
-ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, unsigned int num)
+EAPI void
+ecore_x_netwm_allowed_action_set(Ecore_X_Window win,
+ Ecore_X_Action *action,
+ unsigned int num)
{
Ecore_X_Atom *set;
unsigned int i = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!num)
+ if (!num)
{
- ecore_x_window_prop_property_del(win,
+ ecore_x_window_prop_property_del(win,
ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS);
return;
}
@@ -1134,24 +1254,26 @@ ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, uns
for (i = 0; i < num; i++)
set[i] = _ecore_xcb_netwm_action_atom_get(action[i]);
- ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
+ ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
set, num);
free(set);
}
/* local functions */
-int
-_ecore_xcb_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__, uint8_t data __UNUSED__)
+int
+_ecore_xcb_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
+ uint8_t data __UNUSED__)
{
// TODO: TBD
- return 1;
+ return 1;
}
-int
-_ecore_xcb_netwm_startup_info(Ecore_X_Window win __UNUSED__, uint8_t data __UNUSED__)
+int
+_ecore_xcb_netwm_startup_info(Ecore_X_Window win __UNUSED__,
+ uint8_t data __UNUSED__)
{
// TODO: TBD
- return 1;
+ return 1;
}
/* static void */
@@ -1172,46 +1294,60 @@ _ecore_xcb_netwm_startup_info(Ecore_X_Window win __UNUSED__, uint8_t data __UNUS
/* free(info); */
/* } */
-static Ecore_X_Atom
-_ecore_xcb_netwm_window_type_atom_get(Ecore_X_Window_Type type)
+static Ecore_X_Atom
+_ecore_xcb_netwm_window_type_atom_get(Ecore_X_Window_Type type)
{
- switch (type)
+ switch (type)
{
case ECORE_X_WINDOW_TYPE_DESKTOP:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
+
case ECORE_X_WINDOW_TYPE_DOCK:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK;
+
case ECORE_X_WINDOW_TYPE_TOOLBAR:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
+
case ECORE_X_WINDOW_TYPE_MENU:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU;
+
case ECORE_X_WINDOW_TYPE_UTILITY:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
+
case ECORE_X_WINDOW_TYPE_SPLASH:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
+
case ECORE_X_WINDOW_TYPE_DIALOG:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
+
case ECORE_X_WINDOW_TYPE_NORMAL:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
+
case ECORE_X_WINDOW_TYPE_DROPDOWN_MENU:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
+
case ECORE_X_WINDOW_TYPE_POPUP_MENU:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_POPUP_MENU;
+
case ECORE_X_WINDOW_TYPE_TOOLTIP:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLTIP;
+
case ECORE_X_WINDOW_TYPE_NOTIFICATION:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION;
+
case ECORE_X_WINDOW_TYPE_COMBO:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_COMBO;
+
case ECORE_X_WINDOW_TYPE_DND:
return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DND;
+
default:
return 0;
}
}
-static Ecore_X_Window_Type
-_ecore_xcb_netwm_window_type_type_get(Ecore_X_Atom atom)
+static Ecore_X_Window_Type
+_ecore_xcb_netwm_window_type_type_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP)
return ECORE_X_WINDOW_TYPE_DESKTOP;
@@ -1230,116 +1366,141 @@ _ecore_xcb_netwm_window_type_type_get(Ecore_X_Atom atom)
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL)
return ECORE_X_WINDOW_TYPE_NORMAL;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
- return ECORE_X_WINDOW_TYPE_DROPDOWN_MENU;
+ return ECORE_X_WINDOW_TYPE_DROPDOWN_MENU;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_POPUP_MENU)
- return ECORE_X_WINDOW_TYPE_POPUP_MENU;
+ return ECORE_X_WINDOW_TYPE_POPUP_MENU;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLTIP)
- return ECORE_X_WINDOW_TYPE_TOOLTIP;
+ return ECORE_X_WINDOW_TYPE_TOOLTIP;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION)
- return ECORE_X_WINDOW_TYPE_NOTIFICATION;
+ return ECORE_X_WINDOW_TYPE_NOTIFICATION;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_COMBO)
- return ECORE_X_WINDOW_TYPE_COMBO;
+ return ECORE_X_WINDOW_TYPE_COMBO;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DND)
- return ECORE_X_WINDOW_TYPE_DND;
+ return ECORE_X_WINDOW_TYPE_DND;
else
return ECORE_X_WINDOW_TYPE_UNKNOWN;
}
-static Ecore_X_Atom
-_ecore_xcb_netwm_window_state_atom_get(Ecore_X_Window_State state)
+static Ecore_X_Atom
+_ecore_xcb_netwm_window_state_atom_get(Ecore_X_Window_State state)
{
- switch (state)
+ switch (state)
{
case ECORE_X_WINDOW_STATE_MODAL:
return ECORE_X_ATOM_NET_WM_STATE_MODAL;
+
case ECORE_X_WINDOW_STATE_STICKY:
return ECORE_X_ATOM_NET_WM_STATE_STICKY;
+
case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT:
return ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
+
case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ:
return ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
+
case ECORE_X_WINDOW_STATE_SHADED:
return ECORE_X_ATOM_NET_WM_STATE_SHADED;
+
case ECORE_X_WINDOW_STATE_SKIP_TASKBAR:
return ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR;
+
case ECORE_X_WINDOW_STATE_SKIP_PAGER:
return ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
+
case ECORE_X_WINDOW_STATE_HIDDEN:
return ECORE_X_ATOM_NET_WM_STATE_HIDDEN;
+
case ECORE_X_WINDOW_STATE_FULLSCREEN:
return ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
+
case ECORE_X_WINDOW_STATE_ABOVE:
return ECORE_X_ATOM_NET_WM_STATE_ABOVE;
+
case ECORE_X_WINDOW_STATE_BELOW:
return ECORE_X_ATOM_NET_WM_STATE_BELOW;
+
case ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION:
return ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
+
default:
- return 0;
+ return 0;
}
}
-Ecore_X_Window_State
-_ecore_xcb_netwm_window_state_get(Ecore_X_Atom atom)
+Ecore_X_Window_State
+_ecore_xcb_netwm_window_state_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_NET_WM_STATE_MODAL)
- return ECORE_X_WINDOW_STATE_MODAL;
+ return ECORE_X_WINDOW_STATE_MODAL;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_STICKY)
- return ECORE_X_WINDOW_STATE_STICKY;
+ return ECORE_X_WINDOW_STATE_STICKY;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT)
- return ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
+ return ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
- return ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
+ return ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_SHADED)
- return ECORE_X_WINDOW_STATE_SHADED;
+ return ECORE_X_WINDOW_STATE_SHADED;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR)
- return ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
+ return ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER)
- return ECORE_X_WINDOW_STATE_SKIP_PAGER;
+ return ECORE_X_WINDOW_STATE_SKIP_PAGER;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_HIDDEN)
- return ECORE_X_WINDOW_STATE_HIDDEN;
+ return ECORE_X_WINDOW_STATE_HIDDEN;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN)
- return ECORE_X_WINDOW_STATE_FULLSCREEN;
+ return ECORE_X_WINDOW_STATE_FULLSCREEN;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_ABOVE)
- return ECORE_X_WINDOW_STATE_ABOVE;
+ return ECORE_X_WINDOW_STATE_ABOVE;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_BELOW)
- return ECORE_X_WINDOW_STATE_BELOW;
+ return ECORE_X_WINDOW_STATE_BELOW;
else if (atom == ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
- return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
+ return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
else
- return ECORE_X_WINDOW_STATE_UNKNOWN;
+ return ECORE_X_WINDOW_STATE_UNKNOWN;
}
-static Ecore_X_Atom
-_ecore_xcb_netwm_action_atom_get(Ecore_X_Action action)
+static Ecore_X_Atom
+_ecore_xcb_netwm_action_atom_get(Ecore_X_Action action)
{
switch (action)
{
case ECORE_X_ACTION_MOVE:
return ECORE_X_ATOM_NET_WM_ACTION_MOVE;
+
case ECORE_X_ACTION_RESIZE:
return ECORE_X_ATOM_NET_WM_ACTION_RESIZE;
+
case ECORE_X_ACTION_MINIMIZE:
return ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE;
+
case ECORE_X_ACTION_SHADE:
return ECORE_X_ATOM_NET_WM_ACTION_SHADE;
+
case ECORE_X_ACTION_STICK:
return ECORE_X_ATOM_NET_WM_ACTION_STICK;
+
case ECORE_X_ACTION_MAXIMIZE_HORZ:
return ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ;
+
case ECORE_X_ACTION_MAXIMIZE_VERT:
return ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT;
+
case ECORE_X_ACTION_FULLSCREEN:
return ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN;
+
case ECORE_X_ACTION_CHANGE_DESKTOP:
return ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP;
+
case ECORE_X_ACTION_CLOSE:
return ECORE_X_ATOM_NET_WM_ACTION_CLOSE;
+
case ECORE_X_ACTION_ABOVE:
return ECORE_X_ATOM_NET_WM_ACTION_ABOVE;
+
case ECORE_X_ACTION_BELOW:
return ECORE_X_ATOM_NET_WM_ACTION_BELOW;
+
default:
return 0;
}
}
+