summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTORRI Vincent <torri@alf94-3-82-66-248-160.fbx.proxad.net>2007-04-09 08:23:15 +0200
committerTORRI Vincent <torri@alf94-3-82-66-248-160.fbx.proxad.net>2007-04-09 08:23:15 +0200
commit5d4a666b02c03c8b37633810b629a2458e817c27 (patch)
tree27ec97e28501e4ef5372ca79af22a6e5df898801
parent01f367d2d2f487a8db0e2ce28f51b3f183c9e60a (diff)
add _checked version of the _set_ functions
-rw-r--r--icccm/icccm.c88
-rw-r--r--icccm/xcb_icccm.h37
2 files changed, 116 insertions, 9 deletions
diff --git a/icccm/icccm.c b/icccm/icccm.c
index 7c51bdd..cf22a25 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -39,6 +39,16 @@ xcb_get_text_property(xcb_connection_t *c,
/* WM_NAME */
void
+xcb_set_wm_name_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t encoding,
+ uint32_t name_len,
+ const char *name)
+{
+ xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_NAME, encoding, 8, name_len, name);
+}
+
+void
xcb_set_wm_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
@@ -71,6 +81,16 @@ xcb_watch_wm_name (xcb_property_handlers_t *prophs,
/* WM_ICON_NAME */
void
+xcb_set_wm_icon_name_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t encoding,
+ uint32_t name_len,
+ const char *name)
+{
+ xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_ICON_NAME, encoding, 8, name_len, name);
+}
+
+void
xcb_set_wm_icon_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
@@ -103,6 +123,16 @@ xcb_watch_wm_icon_name (xcb_property_handlers_t *prophs,
/* WM_CLIENT_MACHINE */
void
+xcb_set_wm_client_machine_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t encoding,
+ uint32_t name_len,
+ const char *name)
+{
+ xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_CLIENT_MACHINE, encoding, 8, name_len, name);
+}
+
+void
xcb_set_wm_client_machine (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
@@ -468,20 +498,29 @@ xcb_size_hints_set_win_gravity (xcb_size_hints_t *hints,
}
void
-xcb_set_wm_size_hints (xcb_connection_t *c,
- xcb_window_t window,
- xcb_atom_t property,
- xcb_size_hints_t *hints)
+xcb_set_wm_size_hints_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t property,
+ xcb_size_hints_t *hints)
+{
+ xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, property, WM_SIZE_HINTS, 32, sizeof(*hints) / 4, hints);
+}
+
+void
+xcb_set_wm_size_hints (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t property,
+ xcb_size_hints_t *hints)
{
xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, property, WM_SIZE_HINTS, 32, sizeof(*hints) / 4, hints);
}
int
-xcb_get_wm_size_hints (xcb_connection_t *c,
- xcb_window_t window,
- xcb_atom_t property,
- xcb_size_hints_t *hints,
- long *supplied)
+xcb_get_wm_size_hints (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t property,
+ xcb_size_hints_t *hints,
+ long *supplied)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *rep;
@@ -538,6 +577,14 @@ xcb_get_wm_size_hints (xcb_connection_t *c,
/* WM_NORMAL_HINTS */
void
+xcb_set_wm_normal_hints_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_size_hints_t *hints)
+{
+ xcb_set_wm_size_hints_checked(c, window, WM_NORMAL_HINTS, hints);
+}
+
+void
xcb_set_wm_normal_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_size_hints_t *hints)
@@ -757,6 +804,14 @@ xcb_wm_hints_set_window_group(xcb_wm_hints_t *hints, xcb_window_t window_group)
}
void
+xcb_set_wm_hints_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_wm_hints_t *hints)
+{
+ xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_HINTS, WM_HINTS, 32, sizeof(*hints) / 4, hints);
+}
+
+void
xcb_set_wm_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_wm_hints_t *hints)
@@ -808,6 +863,21 @@ xcb_get_wm_hints (xcb_connection_t *c,
/* WM_PROTOCOLS */
void
+xcb_set_wm_protocols_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ uint32_t list_len,
+ xcb_atom_t *list)
+{
+ intern_atom_fast_cookie_t proto;
+ xcb_atom_t WM_PROTOCOLS;
+
+ proto = intern_atom_fast(c, 0, sizeof("WM_PROTOCOLS") - 1, "WM_PROTOCOLS");
+ WM_PROTOCOLS = intern_atom_fast_reply(c, proto, 0);
+
+ xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_PROTOCOLS, ATOM, 32, list_len, list);
+}
+
+void
xcb_set_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t list_len,
diff --git a/icccm/xcb_icccm.h b/icccm/xcb_icccm.h
index 6c0c4df..eafc71b 100644
--- a/icccm/xcb_icccm.h
+++ b/icccm/xcb_icccm.h
@@ -12,6 +12,12 @@ extern "C" {
/* WM_NAME */
+void xcb_set_wm_name_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t encoding,
+ uint32_t name_len,
+ const char *name);
+
void xcb_set_wm_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
@@ -32,6 +38,12 @@ void xcb_watch_wm_name (xcb_property_handlers_t *prophs,
/* WM_ICON_NAME */
+void xcb_set_wm_icon_name_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t encoding,
+ uint32_t name_len,
+ const char *name);
+
void xcb_set_wm_icon_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
@@ -52,6 +64,12 @@ void xcb_watch_wm_icon_name (xcb_property_handlers_t *prophs,
/* WM_CLIENT_MACHINE */
+void xcb_set_wm_client_machine_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t encoding,
+ uint32_t name_len,
+ const char *name);
+
void xcb_set_wm_client_machine (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
@@ -162,6 +180,11 @@ void xcb_size_hints_set_base_size (xcb_size_hints_t *hints,
void xcb_size_hints_set_win_gravity (xcb_size_hints_t *hints,
uint8_t win_gravity);
+void xcb_set_wm_size_hints_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_atom_t property,
+ xcb_size_hints_t *hints);
+
void xcb_set_wm_size_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property,
@@ -175,6 +198,10 @@ int xcb_get_wm_size_hints (xcb_connection_t *c,
/* WM_NORMAL_HINTS */
+void xcb_set_wm_normal_hints_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_size_hints_t *hints);
+
void xcb_set_wm_normal_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_size_hints_t *hints);
@@ -227,6 +254,10 @@ void xcb_wm_hints_set_icon_mask (xcb_wm_hints_t *hints, xcb_pixmap_t icon_mas
void xcb_wm_hints_set_icon_window (xcb_wm_hints_t *hints, xcb_window_t icon_window);
void xcb_wm_hints_set_window_group (xcb_wm_hints_t *hints, xcb_window_t window_group);
+void xcb_set_wm_hints_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ xcb_wm_hints_t *hints);
+
void xcb_set_wm_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_wm_hints_t *hints);
@@ -236,10 +267,16 @@ xcb_wm_hints_t *xcb_get_wm_hints (xcb_connection_t *c,
/* WM_PROTOCOLS */
+void xcb_set_wm_protocols_checked (xcb_connection_t *c,
+ xcb_window_t window,
+ uint32_t list_len,
+ xcb_atom_t *list);
+
void xcb_set_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t list_len,
xcb_atom_t *list);
+
int xcb_get_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t *list_len,