XWorkstation.st
changeset 4480 3e1449309dfa
parent 4478 fb57ec7d7cc4
child 4527 8f1a6deabb5e
--- a/XWorkstation.st	Thu Feb 09 17:09:32 2006 +0100
+++ b/XWorkstation.st	Thu Feb 09 17:16:27 2006 +0100
@@ -10,6 +10,8 @@
  hereby transferred.
 "
 
+'From Smalltalk/X, Version:5.2.7 on 09-02-2006 at 17:05:03'                     !
+
 "{ Package: 'stx:libview' }"
 
 DeviceWorkstation subclass:#XWorkstation
@@ -10783,7 +10785,7 @@
 !
 
 mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos
-	      width:w height:h minExtent:minExt maxExtent:maxExt
+              width:w height:h minExtent:minExt maxExtent:maxExt
 
     <context: #return>
 
@@ -10792,26 +10794,29 @@
      Needed for restart, to allow recreating a view as iconified,
      and to collaps/expand windows."
 
-    |wicon wiconId wiconView wiconViewId wlabel minW minH maxW maxH|
+    |wicon wiconId iconMaskId wiconView wiconViewId wlabel minW minH maxW maxH|
 
     aBoolean ifTrue:[
-	wicon := aView icon.
-	wicon notNil ifTrue:[
-	    wiconId := wicon id
-	].
-	wiconView := aView iconView.
-	wiconView notNil ifTrue:[
-	    wiconViewId := wiconView id
-	].
-	wlabel := aView label.
+        wicon := aView icon.
+        wicon notNil ifTrue:[
+            wiconId := wicon id.
+            wicon mask notNil ifTrue:[
+                iconMaskId := wicon mask id.
+            ].
+        ].
+        wiconView := aView iconView.
+        wiconView notNil ifTrue:[
+            wiconViewId := wiconView id
+        ].
+        wlabel := aView label.
     ].
     minExt notNil ifTrue:[
-	minW := minExt x.
-	minH := minExt y.
+        minW := minExt x.
+        minH := minExt y.
     ].
     maxExt notNil ifTrue:[
-	maxW := maxExt x.
-	maxH := maxExt y.
+        maxW := maxExt x.
+        maxH := maxExt y.
     ].
 %{
 
@@ -10821,88 +10826,91 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	Display *dpy = myDpy;
-
-	win = __WindowVal(aWindowId);
-
-	szhints.flags = 0;
-	if (__bothSmallInteger(xPos, yPos)) {
-	    szhints.x = __intVal(xPos);
-	    szhints.y = __intVal(yPos);
-	    szhints.flags |= USPosition;
-	}
-	if (__bothSmallInteger(w, h)) {
-	    szhints.width = __intVal(w);
-	    szhints.height = __intVal(h);
-	    szhints.flags |= USSize;
-	}
-	if (__bothSmallInteger(minW, minH)) {
-	    szhints.flags |= PMinSize;
-	    szhints.min_width = __intVal(minW);
-	    szhints.min_height = __intVal(minH);
-	}
-	if (__bothSmallInteger(maxW, maxH)) {
-	    szhints.flags |= PMaxSize;
-	    szhints.max_width = __intVal(maxW);
-	    szhints.max_height = __intVal(maxH);
-	}
-
-	if (aBoolean == true) {
-	    char *windowName;
-	    Pixmap iconBitmap = (Pixmap)0;
-	    Window iconWindow;
-
-	    if (__isExternalAddress(wiconId))
-		iconBitmap = __PixmapVal(wiconId);
-	    else
-		iconBitmap = (Pixmap)0;
-
-	    if (__isExternalAddress(wiconViewId))
-		iconWindow = __WindowVal(wiconViewId);
-	    else
-		iconWindow = (Window)0;
-
-	    if (__isString(wlabel) || __isSymbol(wlabel))
-		windowName = (char *) __stringVal(wlabel);
-	    else
-		windowName = "";
-
-	    if (iconBitmap || windowName) {
-		ENTER_XLIB();
-		XSetStandardProperties(dpy, win,
-					windowName, windowName,
-					iconBitmap,
-					0, 0, &szhints);
-		LEAVE_XLIB();
-	    }
-
-	    wmhints.flags = 0;
-	    if (iconBitmap) {
-		wmhints.flags |= IconPixmapHint;
-		wmhints.icon_pixmap = iconBitmap;
-	    }
-	    if (iconWindow) {
-		wmhints.flags |= IconWindowHint;
-		wmhints.icon_window = iconWindow;
-	    }
-
-	    wmhints.initial_state = IconicState;
-	    wmhints.flags |= StateHint;
-	    ENTER_XLIB();
-	    XSetWMHints(dpy, win, &wmhints);
-	    LEAVE_XLIB();
-	}
-
-	if (szhints.flags) {
-	    ENTER_XLIB();
-	    XSetNormalHints(dpy, win, &szhints);
-	    LEAVE_XLIB();
-	}
-
-	ENTER_XLIB();
-	XMapWindow(dpy, win);
-	LEAVE_XLIB();
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        win = __WindowVal(aWindowId);
+
+        szhints.flags = 0;
+        if (__bothSmallInteger(xPos, yPos)) {
+            szhints.x = __intVal(xPos);
+            szhints.y = __intVal(yPos);
+            szhints.flags |= USPosition;
+        }
+        if (__bothSmallInteger(w, h)) {
+            szhints.width = __intVal(w);
+            szhints.height = __intVal(h);
+            szhints.flags |= USSize;
+        }
+        if (__bothSmallInteger(minW, minH)) {
+            szhints.flags |= PMinSize;
+            szhints.min_width = __intVal(minW);
+            szhints.min_height = __intVal(minH);
+        }
+        if (__bothSmallInteger(maxW, maxH)) {
+            szhints.flags |= PMaxSize;
+            szhints.max_width = __intVal(maxW);
+            szhints.max_height = __intVal(maxH);
+        }
+
+        if (aBoolean == true) {
+            char *windowName = "";
+            Pixmap iconBitmap = (Pixmap)0;
+            Pixmap iconMask = (Pixmap)0;
+            Window iconWindow = (Window)0;
+
+            if (__isExternalAddress(wiconId))
+                iconBitmap = __PixmapVal(wiconId);
+
+            if (__isExternalAddress(iconMaskId)) {
+                iconMask = __PixmapVal(iconMaskId);
+            }
+
+            if (__isExternalAddress(wiconViewId))
+                iconWindow = __WindowVal(wiconViewId);
+
+            if (__isString(wlabel) || __isSymbol(wlabel))
+                windowName = (char *) __stringVal(wlabel);
+
+            if (iconBitmap || windowName) {
+                ENTER_XLIB();
+                XSetStandardProperties(dpy, win,
+                                        windowName, windowName,
+                                        iconBitmap,
+                                        0, 0, &szhints);
+                LEAVE_XLIB();
+            }
+
+            wmhints.flags = 0;
+            if (iconBitmap) {
+                wmhints.flags |= IconPixmapHint;
+                wmhints.icon_pixmap = iconBitmap;
+            }
+            if (iconMask) {
+                wmhints.flags |= IconMaskHint;
+                wmhints.icon_mask = iconMask;
+            }
+            if (iconWindow) {
+                wmhints.flags |= IconWindowHint;
+                wmhints.icon_window = iconWindow;
+            }
+
+            wmhints.initial_state = IconicState;
+            wmhints.flags |= StateHint;
+            ENTER_XLIB();
+            XSetWMHints(dpy, win, &wmhints);
+            LEAVE_XLIB();
+        }
+
+        if (szhints.flags) {
+            ENTER_XLIB();
+            XSetNormalHints(dpy, win, &szhints);
+            LEAVE_XLIB();
+        }
+
+        ENTER_XLIB();
+        XMapWindow(dpy, win);
+        LEAVE_XLIB();
+        RETURN ( self );
     }
 %}.
     self primitiveFailedOrClosedConnection
@@ -11924,7 +11932,7 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.483 2006-02-01 19:39:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.484 2006-02-09 16:16:27 stefan Exp $'
 ! !
 
 XWorkstation initialize!