diff dwt/graphics/GC.d @ 21:4f9c0fea3440

Path
author Frank Benoit <benoit@tionex.de>
date Mon, 07 Jan 2008 09:11:15 +0100
parents b73b14942338
children bc06000c0816
line wrap: on
line diff
--- a/dwt/graphics/GC.d	Mon Jan 07 08:07:46 2008 +0100
+++ b/dwt/graphics/GC.d	Mon Jan 07 09:11:15 2008 +0100
@@ -12,11 +12,6 @@
 
 import dwt.graphics.Image;
 
-class GC{
-    void drawImage(Image, int, int, int, int, int, int, int, int ){}
-    void dispose(){}
-}
-/+++
 
 import dwt.internal.cairo.Cairo;
 import dwt.internal.gtk.OS;
@@ -24,6 +19,7 @@
 import dwt.internal.Converter;
 import dwt.internal.Compatibility;
 import dwt.SWT;
+import dwt.graphics.Color;
 import dwt.graphics.Drawable;
 import dwt.graphics.Resource;
 import dwt.graphics.Device;
@@ -32,14 +28,43 @@
 import dwt.graphics.GCData;
 import dwt.graphics.Image;
 import dwt.graphics.ImageData;
-import dwt.graphics.Path;
+//import dwt.graphics.Path;
 import dwt.graphics.Pattern;
 import dwt.graphics.Point;
 import dwt.graphics.RGB;
 import dwt.graphics.Rectangle;
 import dwt.graphics.Region;
 import dwt.graphics.Resource;
-import dwt.graphics.Transform;
+//import dwt.graphics.Transform;
+
+import dwt.internal.gtk.c.cairotypes;
+
+class GC{
+    void drawImage(Image, int, int, int, int, int, int, int, int ){}
+    void dispose(){}
+    bool isDisposed(){ return false; }
+    static void setCairoPatternColor(cairo_pattern_t * pattern, int offset, Color c, int alpha) {}
+    static void addCairoString(cairo_t* cairo, char[] str, float x, float y, Font font) {}
+    void initCairo() {}
+    void checkGC (int mask) {}
+        const static int FOREGROUND = 1 << 0;
+    const static int BACKGROUND = 1 << 1;
+    const static int FONT = 1 << 2;
+    const static int LINE_STYLE = 1 << 3;
+    const static int LINE_CAP = 1 << 4;
+    const static int LINE_JOIN = 1 << 5;
+    const static int LINE_WIDTH = 1 << 6;
+    const static int LINE_MITERLIMIT = 1 << 7;
+    const static int BACKGROUND_BG = 1 << 8;
+    const static int DRAW_OFFSET = 1 << 9;
+    const static int DRAW = FOREGROUND | LINE_WIDTH | LINE_STYLE  | LINE_CAP  | LINE_JOIN | LINE_MITERLIMIT | DRAW_OFFSET;
+    const static int FILL = BACKGROUND;
+
+
+    GCData data;
+}
+
+/+++
 
 /**
  * Class <code>GC</code> is where all of the drawing capabilities that are
@@ -177,7 +202,7 @@
 	if (device.tracking) device.new_Object(this);
 }
 
-static void addCairoString(int /*long*/ cairo, String string, float x, float y, Font font) {
+static void addCairoString(cairo_t* cairo, String string, float x, float y, Font font) {
 	byte[] buffer = Converter.wcsToMbcs(null, string, true);
 	if (OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
 		int /*long*/ layout = OS.pango_cairo_create_layout(cairo);
@@ -3065,7 +3090,7 @@
 	Cairo.cairo_clip(cairo);
 }
 
-static void setCairoPatternColor(int /*long*/ pattern, int offset, Color c, int alpha) {
+static void setCairoPatternColor( cairo_pattern_t* pattern, int offset, Color c, int alpha) {
 	GdkColor color = c.handle;
 	double aa = (alpha & 0xFF) / (double)0xFF;
 	double red = ((color.red & 0xFFFF) / (double)0xFFFF);