Win32: Added #dcGetClipBoxForGC: mainly for debugging purposes jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 02 Apr 2016 14:17:33 +0100
branchjv
changeset 7252 3c580d36b5b8
parent 7251 9f5e7ff7c729
child 7253 1b427e95d77c
Win32: Added #dcGetClipBoxForGC: mainly for debugging purposes It return result of GetClipBox() WinAPI.
WinWorkstation.st
--- a/WinWorkstation.st	Mon Mar 28 00:38:27 2016 +0100
+++ b/WinWorkstation.st	Sat Apr 02 14:17:33 2016 +0100
@@ -2072,7 +2072,7 @@
 		    }
 		    goto again;
 		}
-		/* fail evtl. später ändern und in st verzögert aufrufen
+		/* fail evtl. spter ndern und in st verzgert aufrufen
 		*/
 		console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
 	    }
@@ -8079,6 +8079,41 @@
     self removeKnownView:aView withId:aWindowId
 !
 
+dcGetClipBoxForGC: gcId
+	"Return clipping box for given device context (as  #(left top right bottom) ). "
+
+	| error |
+%{
+    if (__isExternalAddress(gcId)) {	
+        struct gcData *gc = _GCDATA(gcId);
+        HDC hDC;
+        RECT clipbox;
+        OBJ arr;
+        if (! gc->_hDC) {
+            hDC = _getDC(gc);            
+            gc->_hDC = hDC;
+        } else {
+            hDC = gc->_hDC;
+        }
+        clipbox.left = -1;
+        clipbox.top = -1;
+        clipbox.right = -1;
+        clipbox.bottom = -1;
+        GetClipBox(hDC, &clipbox);
+        arr = __ARRAY_NEW_INT(4);
+        __ArrayInstPtr(arr)->a_element[0] = __MKSMALLINT(clipbox.left);
+        __ArrayInstPtr(arr)->a_element[1] = __MKSMALLINT(clipbox.top);
+        __ArrayInstPtr(arr)->a_element[2] = __MKSMALLINT(clipbox.right);
+        __ArrayInstPtr(arr)->a_element[3] = __MKSMALLINT(clipbox.bottom);
+        RETURN ( arr );
+
+    }
+    error = @symbol(BadArg1);
+    err:;    
+%}.
+	^ self primitiveFailed: error
+!
+
 dcLockForGC:gcId
     "Locks and return a device context for given GC.
      Returned DeviceContext is associated with given GC and it's
@@ -19042,7 +19077,7 @@
     }
 %}
     "
-     (StandardSystemView new label:'äöü') open
+     (StandardSystemView new label:'') open
     "
 !