[Xcb-commit] 2 commits - xcb-util

Vincent Torri doursse at kemper.freedesktop.org
Thu Jul 27 23:43:06 PDT 2006


 xcb-util/icccm/icccm.c     |   46 +++++++++++++++++++++++++++------------------
 xcb-util/icccm/xcb_icccm.h |    6 +++++
 2 files changed, 34 insertions(+), 18 deletions(-)

New commits:
diff-tree 6b34033ca16051daadb09314de57ae914a0c3a14 (from parents)
Merge: a202c062f0d9ccb41e51954b325f86d9cb41960d 252f529445c8f2a956992da5f764e18f8b218a81
Author: TORRI Vincent <torri at doursse.(none)>
Date:   Fri Jul 28 08:42:45 2006 +0200

    Merge branch 'master' of git+ssh://doursse@git.freedesktop.org/git/xcb

diff-tree a202c062f0d9ccb41e51954b325f86d9cb41960d (from 6ac2cc7df885dc50dc97147f9798d4fc08e4fd94)
Author: TORRI Vincent <torri at doursse.(none)>
Date:   Fri Jul 28 08:34:28 2006 +0200

    add AllocWMHints and SetWMHints functions. Remove trailing spaces. Fix an indentation

diff --git a/xcb-util/icccm/icccm.c b/xcb-util/icccm/icccm.c
index 18716f2..f8d55f3 100644
--- a/xcb-util/icccm/icccm.c
+++ b/xcb-util/icccm/icccm.c
@@ -161,7 +161,7 @@ SizeHintsGetIncrease (SizeHints *hints,
 
 void
 SizeHintsGetMinAspect (SizeHints *hints,
-		       INT32     *min_aspect_num, 
+		       INT32     *min_aspect_num,
 		       INT32     *min_aspect_den)
 {
         *min_aspect_num = hints->min_aspect_num;
@@ -170,7 +170,7 @@ SizeHintsGetMinAspect (SizeHints *hints,
 
 void
 SizeHintsGetMaxAspect (SizeHints *hints,
-		       INT32     *max_aspect_num, 
+		       INT32     *max_aspect_num,
 		       INT32     *max_aspect_den)
 {
         *max_aspect_num = hints->max_aspect_num;
@@ -412,9 +412,9 @@ SizeHintsSetWinGravity (SizeHints *hints
 
 void
 SetWMSizeHints (XCBConnection *c,
-		XCBWINDOW       window,
-		XCBATOM         property,
-		SizeHints      *hints)
+		XCBWINDOW      window,
+		XCBATOM        property,
+		SizeHints     *hints)
 {
 	XCBChangeProperty(c, XCBPropModeReplace, window, property, WM_SIZE_HINTS, 32, sizeof(*hints) / 4, hints);
 }
@@ -428,14 +428,14 @@ GetWMSizeHints (XCBConnection *c,
 {
         XCBGetPropertyCookie cookie;
 	XCBGetPropertyRep   *rep;
-	
+
 	cookie = XCBGetProperty (c, 0, window,
 				 property, WM_SIZE_HINTS,
 				 0L, 18); /* NumPropSizeElements = 18 (ICCCM version 1) */
 	rep = XCBGetPropertyReply (c, cookie, 0);
 	if (!rep)
 	        return 0;
-	
+
 	if ((rep->type.xid == WM_SIZE_HINTS.xid) &&
 	    ((rep->format == 8)  ||
 	     (rep->format == 16) ||
@@ -444,7 +444,7 @@ GetWMSizeHints (XCBConnection *c,
 	{
                 char *prop;
 	        long  length;
-		
+
 		length = XCBGetPropertyValueLength (rep);
 		/* FIXME: in GetProp.c of xcl, one move the memory.
 		 * Should we do that too ? */
@@ -452,8 +452,8 @@ GetWMSizeHints (XCBConnection *c,
 		memcpy(prop, XCBGetPropertyValue (rep), length);
 		prop[length] = '\0';
 		hints = (SizeHints *)strdup (prop);
-		
-		*supplied = (USPosition | USSize   | 
+
+		*supplied = (USPosition | USSize   |
 			     PPosition  | PSize    |
 			     PMinSize   | PMaxSize |
 			     PResizeInc | PAspect);
@@ -466,15 +466,15 @@ GetWMSizeHints (XCBConnection *c,
 			hints->win_gravity = 0;
 		}
 		hints->flags &= (*supplied);	/* get rid of unwanted bits */
-		
+
 		free (rep);
-		
+
 		return 1;
 	}
-	
+
 	hints = NULL;
 	free (rep);
-	
+
 	return 0;
 }
 
@@ -528,6 +528,12 @@ typedef enum {
                        IconWindowHint| IconPositionHint | IconMaskHint   | \
                        WindowGroupHint)
 
+WMHints *
+AllocWMHints()
+{
+	return calloc(1, sizeof(WMHints));
+}
+
 BOOL
 WMHintsGetInput(WMHints *hints)
 {
@@ -693,9 +699,13 @@ WMHintsSetWindowGroup(WMHints *hints, XC
         hints->flags |= XCBWMWindowGroupHint;
 }
 
-
-
-
+void
+SetWMHints (XCBConnection *c,
+            XCBWINDOW      window,
+            WMHints       *hints)
+{
+	XCBChangeProperty(c, XCBPropModeReplace, window, WM_HINTS, WM_HINTS, 32, sizeof(*hints) / 4, hints);
+}
 
 WMHints *
 GetWMHints (XCBConnection *c,
@@ -780,7 +790,7 @@ GetWMProtocols (XCBConnection *c,
 	    (rep->format == 32))
 	{
 	        int length;
-		
+
 		length = XCBGetPropertyValueLength(rep);
 		*list_len = length;
 		*list = (XCBATOM *)malloc(sizeof(XCBATOM) * length);
diff --git a/xcb-util/icccm/xcb_icccm.h b/xcb-util/icccm/xcb_icccm.h
index 17918c2..90d4464 100644
--- a/xcb-util/icccm/xcb_icccm.h
+++ b/xcb-util/icccm/xcb_icccm.h
@@ -168,6 +168,8 @@ typedef enum {
     XCBWMIconicState    = 3
 } XCBWMState;
 
+WMHints *AllocWMHints();
+
 BOOL      WMHintsGetInput       (WMHints *hints);
 XCBPIXMAP WMHintsGetIconPixmap  (WMHints *hints);
 XCBPIXMAP WMHintsGetIconMask    (WMHints *hints);
@@ -198,6 +200,10 @@ void WMHintsSetIconMask    (WMHints *hin
 void WMHintsSetIconWindow  (WMHints *hints, XCBWINDOW icon_window);
 void WMHintsSetWindowGroup (WMHints *hints, XCBWINDOW window_group);
 
+void SetWMHints (XCBConnection *c,
+                 XCBWINDOW      window,
+                 WMHints       *hints);
+
 WMHints *GetWMHints (XCBConnection *c,
 		     XCBWINDOW      window);
 


More information about the xcb-commit mailing list