Added WinWorkstation>>hdcForGC to obtains a HDC handle for given gcID. jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 23 Feb 2016 22:55:32 +0000
branchjv
changeset 7161 12542983c1ea
parent 7160 8f9d12cabaec
child 7164 619a1da4c7b1
Added WinWorkstation>>hdcForGC to obtains a HDC handle for given gcID. This handle then could be passed to some other code that may need it. As of now, the only user of this is Cairo which need it in order to create a surface on a window.
WinWorkstation.st
--- a/WinWorkstation.st	Tue Feb 23 22:53:06 2016 +0000
+++ b/WinWorkstation.st	Tue Feb 23 22:55:32 2016 +0000
@@ -8183,7 +8183,9 @@
      given GC"
 %{
     if (__isExternalAddressLike(gcId)) {
-        RETURN ( __MKEXTERNALADDRESS (_getDC ( _GCDATA(gcId) ) ) );
+    	HDC dc = _getDC ( _GCDATA(gcId) );
+    	_GCDATA(gcId)->doNotCacheOrRelease = 1;
+        RETURN ( __MKEXTERNALADDRESS ( dc ) );
     }	
 %}.
     self primitiveFailed.