diff --git a/src/xprop.c b/src/xprop.c index 73ff7ba0..9296c039 100644 --- a/src/xprop.c +++ b/src/xprop.c @@ -105,7 +105,7 @@ ex_client_message32_send(EX_Window win, EX_Atom type, */ static void _ex_window_prop32_set(EX_Window win, EX_Atom atom, - EX_Atom type, unsigned int *val, int num) + EX_Atom type, const unsigned int *val, int num) { #if SIZEOF_INT == SIZEOF_LONG XChangeProperty(_ex_disp, win, atom, type, 32, PropModeReplace, @@ -194,7 +194,7 @@ ex_window_prop_del(EX_Window win, EX_Atom atom) */ void ex_window_prop_card32_set(EX_Window win, EX_Atom atom, - unsigned int *val, unsigned int num) + const unsigned int *val, unsigned int num) { _ex_window_prop32_set(win, atom, XA_CARDINAL, val, (int)num); } @@ -389,7 +389,7 @@ _ex_window_prop_string_utf8_get(EX_Window win, EX_Atom atom) */ void ex_window_prop_xid_set(EX_Window win, EX_Atom atom, EX_Atom type, - EX_ID * lst, unsigned int num) + const EX_ID * lst, unsigned int num) { _ex_window_prop32_set(win, atom, type, lst, (int)num); } @@ -481,7 +481,7 @@ ex_window_prop_xid_list_change(EX_Window win, EX_Atom atom, */ void ex_window_prop_atom_set(EX_Window win, EX_Atom atom, - EX_Atom * lst, unsigned int num) + const EX_Atom * lst, unsigned int num) { ex_window_prop_xid_set(win, atom, XA_ATOM, lst, num); } @@ -530,7 +530,7 @@ ex_window_prop_atom_list_change(EX_Window win, EX_Atom atom, */ void ex_window_prop_window_set(EX_Window win, EX_Atom atom, - EX_Window * lst, unsigned int num) + const EX_Window * lst, unsigned int num) { ex_window_prop_xid_set(win, atom, XA_WINDOW, lst, num); } @@ -846,7 +846,7 @@ ex_netwm_desk_count_set(EX_Window root, unsigned int n_desks) } void -ex_netwm_desk_roots_set(EX_Window root, EX_Window * vroots, +ex_netwm_desk_roots_set(EX_Window root, const EX_Window * vroots, unsigned int n_desks) { ex_window_prop_window_set(root, EX_ATOM_NET_VIRTUAL_ROOTS, vroots, n_desks); @@ -902,7 +902,7 @@ ex_netwm_desk_size_set(EX_Window root, unsigned int width, unsigned int height) } void -ex_netwm_desk_workareas_set(EX_Window root, unsigned int *areas, +ex_netwm_desk_workareas_set(EX_Window root, const unsigned int *areas, unsigned int n_desks) { ex_window_prop_card32_set(root, EX_ATOM_NET_WORKAREA, areas, 4 * n_desks); @@ -915,7 +915,7 @@ ex_netwm_desk_current_set(EX_Window root, unsigned int desk) } void -ex_netwm_desk_viewports_set(EX_Window root, unsigned int *origins, +ex_netwm_desk_viewports_set(EX_Window root, const unsigned int *origins, unsigned int n_desks) { ex_window_prop_card32_set(root, EX_ATOM_NET_DESKTOP_VIEWPORT, @@ -937,7 +937,7 @@ ex_netwm_showing_desktop_set(EX_Window root, int on) /* Mapping order */ void -ex_netwm_client_list_set(EX_Window root, EX_Window * p_clients, +ex_netwm_client_list_set(EX_Window root, const EX_Window * p_clients, unsigned int n_clients) { ex_window_prop_window_set(root, EX_ATOM_NET_CLIENT_LIST, @@ -947,7 +947,8 @@ ex_netwm_client_list_set(EX_Window root, EX_Window * p_clients, /* Stacking order */ void ex_netwm_client_list_stacking_set(EX_Window root, - EX_Window * p_clients, unsigned int n_clients) + const EX_Window * p_clients, + unsigned int n_clients) { ex_window_prop_window_set(root, EX_ATOM_NET_CLIENT_LIST_STACKING, p_clients, n_clients); diff --git a/src/xprop.h b/src/xprop.h index c7c0940a..0f3acc43 100644 --- a/src/xprop.h +++ b/src/xprop.h @@ -35,68 +35,53 @@ EX_Atom ex_atom_get(const char *name); void ex_atoms_get(const char *const *names, unsigned int num, EX_Atom * atoms); -int ex_client_message32_send(EX_Window win, - EX_Atom type, - unsigned int mask, - unsigned int d0, - unsigned int d1, - unsigned int d2, +int ex_client_message32_send(EX_Window win, EX_Atom type, + unsigned int mask, unsigned int d0, + unsigned int d1, unsigned int d2, unsigned int d3, unsigned int d4); void ex_window_prop_del(EX_Window win, EX_Atom atom); -void ex_window_prop_card32_set(EX_Window win, - EX_Atom atom, - unsigned int *val, +void ex_window_prop_card32_set(EX_Window win, EX_Atom atom, + const unsigned int *val, unsigned int num); -int ex_window_prop_card32_get(EX_Window win, - EX_Atom atom, +int ex_window_prop_card32_get(EX_Window win, EX_Atom atom, unsigned int *val, unsigned int len); -int ex_window_prop_card32_list_get(EX_Window win, - EX_Atom atom, +int ex_window_prop_card32_list_get(EX_Window win, EX_Atom atom, unsigned int **plst); -void ex_window_prop_xid_set(EX_Window win, - EX_Atom atom, +void ex_window_prop_xid_set(EX_Window win, EX_Atom atom, EX_Atom type, - EX_ID * lst, unsigned int num); -int ex_window_prop_xid_get(EX_Window win, - EX_Atom atom, + const EX_ID * lst, unsigned int num); +int ex_window_prop_xid_get(EX_Window win, EX_Atom atom, EX_Atom type, EX_ID * lst, unsigned int len); -int ex_window_prop_xid_list_get(EX_Window win, - EX_Atom atom, +int ex_window_prop_xid_list_get(EX_Window win, EX_Atom atom, EX_Atom type, EX_ID ** plst); -void ex_window_prop_xid_list_change(EX_Window win, - EX_Atom atom, +void ex_window_prop_xid_list_change(EX_Window win, EX_Atom atom, EX_Atom type, EX_ID item, int op); -void ex_window_prop_atom_set(EX_Window win, - EX_Atom atom, - EX_Atom * val, unsigned int num); -int ex_window_prop_atom_get(EX_Window win, - EX_Atom atom, +void ex_window_prop_atom_set(EX_Window win, EX_Atom atom, + const EX_Atom * val, + unsigned int num); +int ex_window_prop_atom_get(EX_Window win, EX_Atom atom, EX_Atom * val, unsigned int len); -int ex_window_prop_atom_list_get(EX_Window win, - EX_Atom atom, EX_Atom ** plst); -void ex_window_prop_atom_list_change(EX_Window win, - EX_Atom atom, +int ex_window_prop_atom_list_get(EX_Window win, EX_Atom atom, + EX_Atom ** plst); +void ex_window_prop_atom_list_change(EX_Window win, EX_Atom atom, EX_Atom item, int op); -void ex_window_prop_window_set(EX_Window win, - EX_Atom atom, - EX_Window * val, +void ex_window_prop_window_set(EX_Window win, EX_Atom atom, + const EX_Window * val, unsigned int num); -int ex_window_prop_window_get(EX_Window win, - EX_Atom atom, +int ex_window_prop_window_get(EX_Window win, EX_Atom atom, EX_Window * val, unsigned int len); -int ex_window_prop_window_list_get(EX_Window win, - EX_Atom atom, +int ex_window_prop_window_list_get(EX_Window win, EX_Atom atom, EX_Window ** plst); -void ex_window_prop_string_set(EX_Window win, - EX_Atom atom, const char *str); +void ex_window_prop_string_set(EX_Window win, EX_Atom atom, + const char *str); char *ex_window_prop_string_get(EX_Window win, EX_Atom atom); /* Misc. */ @@ -252,7 +237,7 @@ void ex_netwm_wm_identify(EX_Window root, void ex_netwm_desk_count_set(EX_Window root, unsigned int n_desks); void ex_netwm_desk_roots_set(EX_Window root, - EX_Window * vroots, + const EX_Window * vroots, unsigned int n_desks); void ex_netwm_desk_names_set(EX_Window root, const char **names, @@ -261,22 +246,22 @@ void ex_netwm_desk_size_set(EX_Window root, unsigned int width, unsigned int height); void ex_netwm_desk_workareas_set(EX_Window root, - unsigned int *areas, + const unsigned int *areas, unsigned int n_desks); void ex_netwm_desk_current_set(EX_Window root, unsigned int desk); void ex_netwm_desk_viewports_set(EX_Window root, - unsigned int *origins, + const unsigned int *origins, unsigned int n_desks); void ex_netwm_showing_desktop_set(EX_Window root, int on); void ex_netwm_client_list_set(EX_Window root, - EX_Window * p_clients, + const EX_Window * p_clients, unsigned int n_clients); void ex_netwm_client_list_stacking_set(EX_Window root, - EX_Window * - p_clients, unsigned int - n_clients); + const EX_Window * + p_clients, + unsigned int n_clients); void ex_netwm_client_active_set(EX_Window root, EX_Window win); void ex_netwm_name_set(EX_Window win, const char *name); int ex_netwm_name_get(EX_Window win, char **name); @@ -303,10 +288,9 @@ void ex_icccm_state_set_iconic(EX_Window win); void ex_icccm_state_set_normal(EX_Window win); void ex_icccm_state_set_withdrawn(EX_Window win); -void ex_window_prop_string_list_set(EX_Window win, - EX_Atom atom, +void ex_window_prop_string_list_set(EX_Window win, EX_Atom atom, char **lst, int num); -int ex_window_prop_string_list_get(EX_Window win, - EX_Atom atom, char ***plst); +int ex_window_prop_string_list_get(EX_Window win, EX_Atom atom, + char ***plst); #endif /* _XPROP_H_ */