[PATCH 2/2] icccm: allow to set the encoding format for TEXT properties

Arnaud Fontaine ArnaudFontainearnau at debian.org
Mon Mar 22 05:01:05 PDT 2010


---
 icccm/Makefile.am |    2 +-
 icccm/icccm.c     |   48 ++++++++++++++++++++++++++----------------------
 icccm/xcb_icccm.h |   52 ++++++++++++++++++++++++++++++++--------------------
 3 files changed, 59 insertions(+), 43 deletions(-)

diff --git a/icccm/Makefile.am b/icccm/Makefile.am
index da755d4..bd955f0 100644
--- a/icccm/Makefile.am
+++ b/icccm/Makefile.am
@@ -11,7 +11,7 @@ libxcb_icccm_la_SOURCES = icccm.c
 libxcb_icccm_la_CPPFLAGS = $(XCB_CFLAGS) $(XPROTO_CFLAGS) $(XCB_EVENT_CFLAGS) \
 	$(XCB_PROPERTY_CFLAGS)
 libxcb_icccm_la_LIBADD = $(XCB_LIBS) $(XPROTO_LIBS) $(XCB_PROPERTY_LIBS)
-libxcb_icccm_la_LDFLAGS = -version-info 1:0:0
+libxcb_icccm_la_LDFLAGS = -version-info 2:0:0
 
 pkgconfig_DATA = xcb-icccm.pc
 
diff --git a/icccm/icccm.c b/icccm/icccm.c
index 6cd55cc..898ad2b 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -82,19 +82,21 @@ xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop)
 
 xcb_void_cookie_t
 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_atom_t encoding, uint8_t format,
+                        uint32_t name_len, const char *name)
 {
-  return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_NAME,
-				     encoding, 8, name_len, name);
+  return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
+                                     XCB_ATOM_WM_NAME, encoding, format,
+                                     name_len, name);
 }
 
 xcb_void_cookie_t
 xcb_set_wm_name(xcb_connection_t *c, xcb_window_t window, xcb_atom_t encoding,
-                uint32_t name_len, const char *name)
+                uint8_t format, uint32_t name_len, const char *name)
 {
-  return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_NAME,
-			     encoding, 8, name_len, name);
+  return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
+                             XCB_ATOM_WM_NAME, encoding, format, name_len,
+                             name);
 }
 
 xcb_get_property_cookie_t
@@ -131,20 +133,22 @@ xcb_watch_wm_name(xcb_property_handlers_t *prophs, uint32_t long_len,
 
 xcb_void_cookie_t
 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_atom_t encoding, uint8_t format,
+                             uint32_t name_len, const char *name)
 {
   return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
-				     XCB_ATOM_WM_ICON_NAME, encoding, 8, name_len,
-				     name);
+                                     XCB_ATOM_WM_ICON_NAME, encoding, format,
+                                     name_len, name);
 }
 
 xcb_void_cookie_t
 xcb_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window,
-                     xcb_atom_t encoding, uint32_t name_len, const char *name)
+                     xcb_atom_t encoding, uint8_t format, uint32_t name_len,
+                     const char *name)
 {
-  return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_ICON_NAME,
-			     encoding, 8, name_len, name);
+  return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
+                             XCB_ATOM_WM_ICON_NAME, encoding, format,
+                             name_len, name);
 }
 
 xcb_get_property_cookie_t
@@ -182,22 +186,22 @@ xcb_watch_wm_icon_name(xcb_property_handlers_t *prophs, uint32_t long_len,
 
 xcb_void_cookie_t
 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_atom_t encoding, uint8_t format,
+                                  uint32_t name_len, const char *name)
 {
   return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
-				     XCB_ATOM_WM_CLIENT_MACHINE, encoding, 8, name_len,
-				     name);
+                                     XCB_ATOM_WM_CLIENT_MACHINE, encoding,
+                                     format, name_len, name);
 }
 
 xcb_void_cookie_t
 xcb_set_wm_client_machine(xcb_connection_t *c, xcb_window_t window,
-                          xcb_atom_t encoding, uint32_t name_len,
-                          const char *name)
+                          xcb_atom_t encoding, uint8_t format,
+                          uint32_t name_len, const char *name)
 {
   return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
-			     XCB_ATOM_WM_CLIENT_MACHINE, encoding, 8, name_len,
-			     name);
+                             XCB_ATOM_WM_CLIENT_MACHINE, encoding, format,
+                             name_len, name);
 }
 
 xcb_get_property_cookie_t
diff --git a/icccm/xcb_icccm.h b/icccm/xcb_icccm.h
index 9112b46..9c4daa7 100644
--- a/icccm/xcb_icccm.h
+++ b/icccm/xcb_icccm.h
@@ -119,21 +119,23 @@ void xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop);
  * @param c The connection to the X server.
  * @param window Window X identifier.
  * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type.
+ * @param format Encoding format.
  * @param name_len Length of name value to set.
  * @param name Name value to set.
  */
 xcb_void_cookie_t 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_window_t window,
+                                          xcb_atom_t encoding,
+                                          uint8_t format,
+                                          uint32_t name_len,
+                                          const char *name);
 
 /**
  * @see xcb_set_wm_name_checked()
  */
 xcb_void_cookie_t xcb_set_wm_name(xcb_connection_t *c, xcb_window_t window,
-				  xcb_atom_t encoding, uint32_t name_len,
-				  const char *name);
+                                  xcb_atom_t encoding, uint8_t format,
+                                  uint32_t name_len, const char *name);
 
 /**
  * @brief Deliver a GetProperty request to the X server for WM_NAME.
@@ -181,19 +183,26 @@ uint8_t xcb_watch_wm_name(xcb_property_handlers_t *prophs, uint32_t long_len,
  * @param c The connection to the X server.
  * @param window Window X identifier.
  * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type.
+ * @param format Encoding format.
  * @param name_len Length of name value to set.
  * @param name Name value to set.
  */
-xcb_void_cookie_t 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_void_cookie_t xcb_set_wm_icon_name_checked(xcb_connection_t *c,
+                                               xcb_window_t window,
+                                               xcb_atom_t encoding,
+                                               uint8_t format,
+                                               uint32_t name_len,
+                                               const char *name);
 
 /**
  * @see xcb_set_wm_icon_name_checked()
  */
-xcb_void_cookie_t xcb_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window,
-				       xcb_atom_t encoding, uint32_t name_len,
-				       const char *name);
+xcb_void_cookie_t xcb_set_wm_icon_name(xcb_connection_t *c,
+                                       xcb_window_t window,
+                                       xcb_atom_t encoding,
+                                       uint8_t format,
+                                       uint32_t name_len,
+                                       const char *name);
 
 /**
  * @brief Send request to get WM_ICON_NAME property of a window.
@@ -243,23 +252,26 @@ uint8_t xcb_watch_wm_icon_name(xcb_property_handlers_t *prophs,
  * @param c The connection to the X server.
  * @param window Window X identifier.
  * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type.
+ * @param format Encoding format.
  * @param name_len Length of name value to set.
  * @param name Name value to set.
  */
 xcb_void_cookie_t 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_window_t window,
+                                                    xcb_atom_t encoding,
+                                                    uint8_t format,
+                                                    uint32_t name_len,
+                                                    const char *name);
 
 /**
  * @see xcb_set_wm_client_machine_checked()
  */
 xcb_void_cookie_t xcb_set_wm_client_machine(xcb_connection_t *c,
-					    xcb_window_t window,
-					    xcb_atom_t encoding,
-					    uint32_t name_len,
-					    const char *name);
+                                            xcb_window_t window,
+                                            xcb_atom_t encoding,
+                                            uint8_t format,
+                                            uint32_t name_len,
+                                            const char *name);
 
 /**
  * @brief Send request to get WM_CLIENT_MACHINE property of a window.
-- 
1.7.0


--=-=-=--


More information about the Xcb mailing list