From 11a9a1badf0b68f33863e7206a642af2d223ef83 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Fri, 8 Jan 2010 16:16:05 +0000 Subject: [PATCH] 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 --- legacy/ecore/src/lib/ecore_x/Ecore_X.h | 3 + legacy/ecore/src/lib/ecore_x/Ecore_X_Atoms.h | 1 + .../src/lib/ecore_x/ecore_x_atoms_decl.h | 1 + .../src/lib/ecore_x/xlib/ecore_x_atoms.c | 3 +- legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c | 31 ++++++++ .../src/lib/ecore_x/xlib/ecore_x_icccm.c | 12 +-- .../src/lib/ecore_x/xlib/ecore_x_netwm.c | 77 +++++++++---------- 7 files changed, 82 insertions(+), 46 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index 8b2aee06d2..8c8e026c2d 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -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 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_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_fetch(void); diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X_Atoms.h b/legacy/ecore/src/lib/ecore_x/Ecore_X_Atoms.h index 9fedaa3735..610b464d4b 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X_Atoms.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X_Atoms.h @@ -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_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_TOP_SHELF_GEOMETRY; #endif /* _ECORE_X_ATOMS_H */ diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_atoms_decl.h b/legacy/ecore/src/lib/ecore_x/ecore_x_atoms_decl.h index a90e5cc9cb..2427947ddf 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_atoms_decl.h +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_atoms_decl.h @@ -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_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_TOP_SHELF_GEOMETRY = 0; diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c index 31220a44fb..4532467d6a 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c @@ -237,7 +237,8 @@ _ecore_x_atoms_init(void) { "_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_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; char **names; diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c index 93b5b920e7..cfa37c574d 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c @@ -415,3 +415,34 @@ ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win) return 0; 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; +} diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c index 9bc7bcc39b..c03dd5244e 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c @@ -104,7 +104,7 @@ ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t) EAPI void 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.xconfigure.display = _ecore_x_disp; @@ -443,7 +443,7 @@ ecore_x_icccm_title_set(Ecore_X_Window win, const char *t) free(list[0]); } -EAPI char * +EAPI char * ecore_x_icccm_title_get(Ecore_X_Window win) { XTextProperty xprop; @@ -453,10 +453,10 @@ ecore_x_icccm_title_get(Ecore_X_Window win) { if (xprop.value) { - char **list = NULL; - char *t = NULL; - int num = 0; - int ret; + char **list = NULL; + char *t = NULL; + int num = 0; + int ret; if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING) { diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c index 23edf26c65..48caef6104 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c @@ -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 char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom); #if 0 /* Unused */ -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_process(Ecore_X_Startup_Info *info); +static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data); #endif -static void _ecore_x_netwm_startup_info_free(void *data); +static void _ecore_x_netwm_startup_info_free(void *data); /* * Convenience macros @@ -106,7 +106,7 @@ ecore_x_netwm_supported_set(Ecore_X_Window root, Ecore_X_Atom *supported, int nu EAPI int 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 (supported) *supported = NULL; @@ -141,10 +141,10 @@ EAPI void ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names, unsigned int n_desks) { - char ss[32], *buf; - const char *s; - unsigned int i; - int l, len; + char ss[32], *buf; + const char *s; + unsigned int i; + int l, len; buf = NULL; len = 0; @@ -174,7 +174,7 @@ EAPI void ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width, unsigned int height) { - unsigned int size[2]; + unsigned int size[2]; size[0] = width; size[1] = height; @@ -469,10 +469,10 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right, EAPI int ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num) { - unsigned int *data, *p; - unsigned int *src; - unsigned int len, icons, i; - int num_ret; + unsigned int *data, *p; + unsigned int *src; + unsigned int len, icons, i; + int num_ret; if (num) *num = 0; 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 ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state, unsigned int *num) { - int num_ret, i; - Ecore_X_Atom *atoms; + int num_ret, i; + Ecore_X_Atom *atoms; if (num) *num = 0; 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 ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type) { - int num; - Ecore_X_Atom *atoms = NULL; + int num; + Ecore_X_Atom *atoms = NULL; 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 ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types) { - int num, i; - Ecore_X_Atom *atoms = NULL; + int num, i; + Ecore_X_Atom *atoms = NULL; Ecore_X_Window_Type *atoms2 = NULL; if (types) *types = NULL; @@ -913,8 +913,8 @@ _ecore_x_netwm_action_atom_get(Ecore_X_Action action) EAPI int ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action) { - int num, i, ret = 0; - Ecore_X_Atom *atoms, atom; + int num, i, ret = 0; + Ecore_X_Atom *atoms, atom; num = ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE, &atoms); @@ -940,8 +940,8 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action) 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; + Ecore_X_Atom *set; + unsigned int i; if (!num) { @@ -963,8 +963,8 @@ ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, uns EAPI int ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, unsigned int *num) { - int num_ret, i; - Ecore_X_Atom *atoms; + int num_ret, i; + Ecore_X_Atom *atoms; if (num) *num = 0; 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 ecore_x_netwm_sync_counter_get(Ecore_X_Window win, Ecore_X_Sync_Counter *counter) { - int ret; + int ret; unsigned int tmp; 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 * _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom) { - char *str; - unsigned char *prop_ret; - Atom type_ret; - unsigned long bytes_after, num_ret; - int format_ret; + char *str; + unsigned char *prop_ret; + Atom type_ret; + unsigned long bytes_after, num_ret; + int format_ret; str = NULL; prop_ret = NULL; @@ -1270,8 +1270,8 @@ static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info) { Ecore_X_Event_Startup_Sequence *e; - int event; - char *p; + int event; + char *p; p = strchr(info->buffer, ':'); if (!p) @@ -1344,7 +1344,6 @@ _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) { - while (*data) { int in_quot_sing, in_quot_dbl, escaped; @@ -1513,9 +1512,9 @@ _ecore_x_netwm_startup_info_free(void *data) EAPI int ecore_x_screen_is_composited(int screen) { - Ecore_X_Window win; + Ecore_X_Window win; static Ecore_X_Atom atom = None; - char buf[32]; + char buf[32]; snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen); 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) { static Ecore_X_Atom atom = None; - char buf[32]; - + char buf[32]; + snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen); 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); }