diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-11-02 11:57:24 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-11-02 11:57:24 -0400 |
commit | d5a464227052c1e758c0c2a306ea3e3b832c9dfb (patch) | |
tree | fd6e8463e7e190fb86e761103783a8e0e756a898 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics | |
parent | 60a6fb6b981ba4a18d6a3abcdade50a4f3068243 (diff) | |
download | eclipse.platform.swt-d5a464227052c1e758c0c2a306ea3e3b832c9dfb.tar.gz eclipse.platform.swt-d5a464227052c1e758c0c2a306ea3e3b832c9dfb.tar.xz eclipse.platform.swt-d5a464227052c1e758c0c2a306ea3e3b832c9dfb.zip |
add OS.GTK3 flag and use everywhere instead of VERSION(3,0,0)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics')
6 files changed, 14 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java index b660245a1c..ba73a1fa85 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java @@ -117,7 +117,7 @@ void destroy() { device.gdkColors[pixel] = null; } } - if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (!OS.GTK3) { long /*int*/ colormap = OS.gdk_colormap_get_system(); OS.gdk_colormap_free_colors(colormap, handle, 1); } @@ -246,7 +246,7 @@ void init(int red, int green, int blue) { gdkColor.red = (short)((red & 0xFF) | ((red & 0xFF) << 8)); gdkColor.green = (short)((green & 0xFF) | ((green & 0xFF) << 8)); gdkColor.blue = (short)((blue & 0xFF) | ((blue & 0xFF) << 8)); - if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (!OS.GTK3) { long /*int*/ colormap = OS.gdk_colormap_get_system(); if (!OS.gdk_colormap_alloc_color(colormap, gdkColor, true, true)) { /* Allocate black. */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java index 0851a44fe6..7d0ac926b8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java @@ -437,7 +437,7 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { } long /*int*/ createCursor(byte[] sourceData, byte[] maskData, int width, int height, int hotspotX, int hotspotY, boolean reverse) { - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK3) { for (int i = 0; i < sourceData.length; i++) { byte s = sourceData[i]; sourceData[i] = (byte)(((s & 0x80) >> 7) | @@ -593,7 +593,7 @@ public String toString () { } void gdk_cursor_unref (long /*int*/ cursor) { - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK3) { OS.g_object_unref (cursor); } else { OS.gdk_cursor_unref(cursor); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java index 035a6e4705..9e09522916 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java @@ -660,7 +660,7 @@ protected void init () { /* Initialize the system font slot */ long /*int*/ defaultFont; - if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) { + if (OS.GTK3) { long /*int*/ context = OS.gtk_widget_get_style_context (shellHandle); defaultFont = OS.gtk_style_context_get_font (context, OS.GTK_STATE_FLAG_NORMAL); } else { @@ -824,7 +824,7 @@ protected void release () { systemFont = null; if (gdkColors != null) { - if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (!OS.GTK3) { long /*int*/ colormap = OS.gdk_colormap_get_system(); for (int i = 0; i < gdkColors.length; i++) { GdkColor color = gdkColors [i]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java index 5e56b2e158..085b4c1e92 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java @@ -581,7 +581,7 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d Cairo.cairo_restore(handle); if (paint) { long /*int*/ visibleRegion; - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK3) { visibleRegion = OS.gdk_window_get_visible_region (drawable); } else { visibleRegion = OS.gdk_drawable_get_visible_region (drawable); @@ -786,7 +786,7 @@ public void drawFocus(int x, int y, int width, int height) { long /*int*/ cairo = data.cairo; if (cairo != 0) { checkGC(FOREGROUND); - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK3) { long /*int*/ context = OS.gtk_widget_get_style_context(data.device.shellHandle); OS.gtk_render_focus(context, cairo, x, y, width, height); } else { @@ -3317,7 +3317,7 @@ static void setCairoPatternColor(long /*int*/ pattern, int offset, Color c, int void setCairoClip(long /*int*/ damageRgn, long /*int*/ clipRgn) { long /*int*/ cairo = data.cairo; - if (OS.GTK_VERSION >= OS.VERSION(2,18,0) && data.drawable != 0 && OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (OS.GTK_VERSION >= OS.VERSION(2,18,0) && data.drawable != 0 && !OS.GTK3) { OS.gdk_cairo_reset_clip(cairo, data.drawable); } else { Cairo.cairo_reset_clip(cairo); @@ -4210,7 +4210,7 @@ public String toString () { } long /*int*/ gdk_pixbuf_get_from_window(long /*int*/ dest, long /*int*/ src, int src_x, int src_y, int dest_x, int dest_y, int width, int height) { - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK3) { return OS.gdk_pixbuf_get_from_window (dest, src_x, src_y, width, height); } else { long /*int*/ cmap = OS.gdk_colormap_get_system(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java index 52cfb4159a..c5956eb029 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java @@ -871,7 +871,7 @@ long /*int*/ createMask(ImageData image, boolean copy) { void createSurface() { if (surface != 0) return; /* There is no pixmaps in GTK 3. */ - if ((OS.GTK_VERSION >= OS.VERSION(3, 0, 0))) return; + if (OS.GTK3) return; /* Generate the mask if necessary. */ if (transparentPixel != -1) createMask(); int[] w = new int[1], h = new int[1]; @@ -1690,7 +1690,7 @@ public String toString () { } long /*int*/ gdk_pixbuf_get_from_window(long /*int*/ dest, long /*int*/ src, long /*int*/ cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) { - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK3) { return OS.gdk_pixbuf_get_from_window (dest, src_x, src_y, width, height); } else { return OS.gdk_pixbuf_get_from_drawable (dest, src, cmap, src_x, src_y, dest_x, dest_y, width, height); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java index 482e1b4c02..7ac0d994ad 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java @@ -86,7 +86,7 @@ Region(Device device, long /*int*/ handle) { } static long /*int*/ gdk_region_polygon(int[] pointArray, int npoints, int fill_rule) { - if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (!OS.GTK3) { return OS.gdk_region_polygon(pointArray, npoints, fill_rule); } //TODO this does not perform well and could fail if the polygon is too big @@ -124,7 +124,7 @@ static long /*int*/ gdk_region_polygon(int[] pointArray, int npoints, int fill_r } static void gdk_region_get_rectangles(long /*int*/ region, long /*int*/[] rectangles, int[] n_rectangles) { - if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (!OS.GTK3) { OS.gdk_region_get_rectangles (region, rectangles, n_rectangles); return; } |