Cairo__Surface.st
changeset 45 8ee53c41a084
parent 43 1006839761af
child 47 061f23d91383
--- a/Cairo__Surface.st	Tue Feb 23 16:40:59 2016 +0000
+++ b/Cairo__Surface.st	Fri Feb 19 14:25:58 2016 +0000
@@ -49,6 +49,12 @@
     "Modified: / 28-12-2014 / 22:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+newWin32WithHDC: hdc
+    ^ CPrimitives cairo_win32_surface_create:hdc
+
+    "Created: / 19-02-2016 / 12:07:29 / jv"
+!
+
 newXlibWithDisplay:dpy drawable:drawable visual:visual width:width height:height 
     ^ CPrimitives 
         cairo_xlib_surface_create:dpy
@@ -72,9 +78,16 @@
         surface setView: aView.
         ^ surface.
     ].
+    (aView device platformName = 'WIN32') ifTrue:[
+        aView gcId isNil ifTrue:[ 
+            aView initGC
+        ].
+        ^ self newWin32WithHDC: (aView device hdcForGC: aView gcId)
+    ].
     self error: 'Unsupported plarform'
 
     "Created: / 13-02-2016 / 23:47:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-02-2016 / 12:11:20 / jv"
 ! !
 
 !Surface class methodsFor:'accessing'!