Add atom for set/get of top shelf geometry.

Fix void function in netwm that was returning a value when it shouldn't.
Remove wasted whitespace.



SVN revision: 44981
This commit is contained in:
Christopher Michael 2010-01-08 16:16:05 +00:00
parent f3fb3dea17
commit 11a9a1badf
7 changed files with 82 additions and 46 deletions

View File

@ -1571,6 +1571,9 @@ EAPI int ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_
EAPI void ecore_x_e_illume_quickpanel_priority_minor_set(Ecore_X_Window win, unsigned int priority); EAPI void ecore_x_e_illume_quickpanel_priority_minor_set(Ecore_X_Window win, unsigned int priority);
EAPI int ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win); EAPI int ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win);
EAPI void ecore_x_e_illume_home_send(Ecore_X_Window win); EAPI void ecore_x_e_illume_home_send(Ecore_X_Window win);
EAPI void ecore_x_e_illume_top_shelf_geometry_set(Ecore_X_Window win, int x, int y, int w, int h);
EAPI int ecore_x_e_illume_top_shelf_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h);
EAPI void ecore_x_xinerama_query_screens_prefetch(void); EAPI void ecore_x_xinerama_query_screens_prefetch(void);
EAPI void ecore_x_xinerama_query_screens_fetch(void); EAPI void ecore_x_xinerama_query_screens_fetch(void);

View File

@ -222,5 +222,6 @@ EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF; EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR; EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR; EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_TOP_SHELF_GEOMETRY;
#endif /* _ECORE_X_ATOMS_H */ #endif /* _ECORE_X_ATOMS_H */

View File

@ -245,3 +245,4 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF = 0; EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR = 0; EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR = 0; EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_TOP_SHELF_GEOMETRY = 0;

View File

@ -237,7 +237,8 @@ _ecore_x_atoms_init(void)
{ "_E_ILLUME_QUICKPANEL_ON", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON }, { "_E_ILLUME_QUICKPANEL_ON", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON },
{ "_E_ILLUME_QUICKPANEL_OFF", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF }, { "_E_ILLUME_QUICKPANEL_OFF", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF },
{ "_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR }, { "_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR },
{ "_E_ILLUME_QUICKPANEL_PRIORITY_MINOR", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR } { "_E_ILLUME_QUICKPANEL_PRIORITY_MINOR", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR },
{ "_E_ILLUME_TOP_SHELF_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_TOP_SHELF_GEOMETRY }
}; };
Atom *atoms; Atom *atoms;
char **names; char **names;

View File

@ -415,3 +415,34 @@ ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win)
return 0; return 0;
return val; return val;
} }
EAPI void
ecore_x_e_illume_top_shelf_geometry_set(Ecore_X_Window win, int x, int y, int w, int h)
{
unsigned int geom[4];
geom[0] = x;
geom[1] = y;
geom[2] = w;
geom[3] = h;
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_TOP_SHELF_GEOMETRY,
geom, 4);
}
EAPI int
ecore_x_e_illume_top_shelf_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h)
{
int ret = 0;
unsigned int geom[4];
ret =
ecore_x_window_prop_card32_get(win,
ECORE_X_ATOM_E_ILLUME_TOP_SHELF_GEOMETRY,
geom, 4);
if (ret != 4) return 0;
if (x) *x = geom[0];
if (y) *y = geom[1];
if (w) *w = geom[2];
if (h) *h = geom[3];
return 1;
}

View File

@ -104,7 +104,7 @@ ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t)
EAPI void EAPI void
ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h) ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h)
{ {
XEvent ev; XEvent ev;
ev.type = ConfigureNotify; ev.type = ConfigureNotify;
ev.xconfigure.display = _ecore_x_disp; ev.xconfigure.display = _ecore_x_disp;
@ -443,7 +443,7 @@ ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
free(list[0]); free(list[0]);
} }
EAPI char * EAPI char *
ecore_x_icccm_title_get(Ecore_X_Window win) ecore_x_icccm_title_get(Ecore_X_Window win)
{ {
XTextProperty xprop; XTextProperty xprop;
@ -453,10 +453,10 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
{ {
if (xprop.value) if (xprop.value)
{ {
char **list = NULL; char **list = NULL;
char *t = NULL; char *t = NULL;
int num = 0; int num = 0;
int ret; int ret;
if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING) if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
{ {

View File

@ -48,10 +48,10 @@ struct _Ecore_X_Startup_Info
static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom, const char *str); static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom, const char *str);
static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom); static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom);
#if 0 /* Unused */ #if 0 /* Unused */
static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info); static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info);
static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data); static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data);
#endif #endif
static void _ecore_x_netwm_startup_info_free(void *data); static void _ecore_x_netwm_startup_info_free(void *data);
/* /*
* Convenience macros * Convenience macros
@ -106,7 +106,7 @@ ecore_x_netwm_supported_set(Ecore_X_Window root, Ecore_X_Atom *supported, int nu
EAPI int EAPI int
ecore_x_netwm_supported_get(Ecore_X_Window root, Ecore_X_Atom **supported, int *num) ecore_x_netwm_supported_get(Ecore_X_Window root, Ecore_X_Atom **supported, int *num)
{ {
int num_ret; int num_ret;
if (num) *num = 0; if (num) *num = 0;
if (supported) *supported = NULL; if (supported) *supported = NULL;
@ -141,10 +141,10 @@ EAPI void
ecore_x_netwm_desk_names_set(Ecore_X_Window root, ecore_x_netwm_desk_names_set(Ecore_X_Window root,
const char **names, unsigned int n_desks) const char **names, unsigned int n_desks)
{ {
char ss[32], *buf; char ss[32], *buf;
const char *s; const char *s;
unsigned int i; unsigned int i;
int l, len; int l, len;
buf = NULL; buf = NULL;
len = 0; len = 0;
@ -174,7 +174,7 @@ EAPI void
ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width, ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width,
unsigned int height) unsigned int height)
{ {
unsigned int size[2]; unsigned int size[2];
size[0] = width; size[0] = width;
size[1] = height; size[1] = height;
@ -469,10 +469,10 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right,
EAPI int EAPI int
ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num) ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
{ {
unsigned int *data, *p; unsigned int *data, *p;
unsigned int *src; unsigned int *src;
unsigned int len, icons, i; unsigned int len, icons, i;
int num_ret; int num_ret;
if (num) *num = 0; if (num) *num = 0;
if (icon) *icon = NULL; if (icon) *icon = NULL;
@ -741,8 +741,8 @@ ecore_x_netwm_window_state_set(Ecore_X_Window win, Ecore_X_Window_State *state,
EAPI int EAPI int
ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state, unsigned int *num) ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state, unsigned int *num)
{ {
int num_ret, i; int num_ret, i;
Ecore_X_Atom *atoms; Ecore_X_Atom *atoms;
if (num) *num = 0; if (num) *num = 0;
if (state) *state = NULL; if (state) *state = NULL;
@ -833,8 +833,8 @@ ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type)
EAPI int EAPI int
ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type) ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
{ {
int num; int num;
Ecore_X_Atom *atoms = NULL; Ecore_X_Atom *atoms = NULL;
if (type) *type = ECORE_X_WINDOW_TYPE_NORMAL; if (type) *type = ECORE_X_WINDOW_TYPE_NORMAL;
@ -852,8 +852,8 @@ ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
EAPI int EAPI int
ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types) ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
{ {
int num, i; int num, i;
Ecore_X_Atom *atoms = NULL; Ecore_X_Atom *atoms = NULL;
Ecore_X_Window_Type *atoms2 = NULL; Ecore_X_Window_Type *atoms2 = NULL;
if (types) *types = NULL; if (types) *types = NULL;
@ -913,8 +913,8 @@ _ecore_x_netwm_action_atom_get(Ecore_X_Action action)
EAPI int EAPI int
ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action) ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
{ {
int num, i, ret = 0; int num, i, ret = 0;
Ecore_X_Atom *atoms, atom; Ecore_X_Atom *atoms, atom;
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); &atoms);
@ -940,8 +940,8 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
EAPI void EAPI void
ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, unsigned int num) ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, unsigned int num)
{ {
Ecore_X_Atom *set; Ecore_X_Atom *set;
unsigned int i; unsigned int i;
if (!num) if (!num)
{ {
@ -963,8 +963,8 @@ ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, uns
EAPI int EAPI int
ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, unsigned int *num) ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, unsigned int *num)
{ {
int num_ret, i; int num_ret, i;
Ecore_X_Atom *atoms; Ecore_X_Atom *atoms;
if (num) *num = 0; if (num) *num = 0;
if (action) *action = NULL; if (action) *action = NULL;
@ -1039,7 +1039,7 @@ ecore_x_netwm_frame_size_get(Ecore_X_Window win, int *fl, int *fr, int *ft, int
EAPI int EAPI int
ecore_x_netwm_sync_counter_get(Ecore_X_Window win, Ecore_X_Sync_Counter *counter) ecore_x_netwm_sync_counter_get(Ecore_X_Window win, Ecore_X_Sync_Counter *counter)
{ {
int ret; int ret;
unsigned int tmp; unsigned int tmp;
ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER, ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
@ -1236,11 +1236,11 @@ _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom,
static char * static char *
_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom) _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
{ {
char *str; char *str;
unsigned char *prop_ret; unsigned char *prop_ret;
Atom type_ret; Atom type_ret;
unsigned long bytes_after, num_ret; unsigned long bytes_after, num_ret;
int format_ret; int format_ret;
str = NULL; str = NULL;
prop_ret = NULL; prop_ret = NULL;
@ -1270,8 +1270,8 @@ static int
_ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info) _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
{ {
Ecore_X_Event_Startup_Sequence *e; Ecore_X_Event_Startup_Sequence *e;
int event; int event;
char *p; char *p;
p = strchr(info->buffer, ':'); p = strchr(info->buffer, ':');
if (!p) if (!p)
@ -1344,7 +1344,6 @@ _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
static int static int
_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data) _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
{ {
while (*data) while (*data)
{ {
int in_quot_sing, in_quot_dbl, escaped; int in_quot_sing, in_quot_dbl, escaped;
@ -1513,9 +1512,9 @@ _ecore_x_netwm_startup_info_free(void *data)
EAPI int EAPI int
ecore_x_screen_is_composited(int screen) ecore_x_screen_is_composited(int screen)
{ {
Ecore_X_Window win; Ecore_X_Window win;
static Ecore_X_Atom atom = None; static Ecore_X_Atom atom = None;
char buf[32]; char buf[32];
snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen); snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
if (atom == None) atom = XInternAtom(_ecore_x_disp, buf, True); if (atom == None) atom = XInternAtom(_ecore_x_disp, buf, True);
@ -1530,10 +1529,10 @@ EAPI void
ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win) ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
{ {
static Ecore_X_Atom atom = None; static Ecore_X_Atom atom = None;
char buf[32]; char buf[32];
snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen); snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
if (atom == None) atom = XInternAtom(_ecore_x_disp, buf, True); if (atom == None) atom = XInternAtom(_ecore_x_disp, buf, True);
if (atom == None) return 0; if (atom == None) return;
XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time); XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
} }