[Xcb-commit] icccm

Vincent Torri doursse at kemper.freedesktop.org
Sun Apr 8 23:23:51 PDT 2007


 icccm/icccm.c     |   88 ++++++++++++++++++++++++++++++++++++++++++++++++------
 icccm/xcb_icccm.h |   37 ++++++++++++++++++++++
 2 files changed, 116 insertions(+), 9 deletions(-)

New commits:
diff-tree 5d4a666b02c03c8b37633810b629a2458e817c27 (from 01f367d2d2f487a8db0e2ce28f51b3f183c9e60a)
Author: TORRI Vincent <torri at alf94-3-82-66-248-160.fbx.proxad.net>
Date:   Mon Apr 9 08:23:15 2007 +0200

    add _checked version of the _set_ functions

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 *
 /* 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
 /* 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_han
 /* 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
 }
 
 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 
 /* 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_hin
 }
 
 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_han
 
 /* 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_propert
 
 /* 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 
 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        
 
 /* 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_
 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_co
 
 /* 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,


More information about the xcb-commit mailing list