summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-02 11:57:24 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-02 11:57:24 -0400
commitd5a464227052c1e758c0c2a306ea3e3b832c9dfb (patch)
treefd6e8463e7e190fb86e761103783a8e0e756a898
parent60a6fb6b981ba4a18d6a3abcdade50a4f3068243 (diff)
downloadeclipse.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)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java22
49 files changed, 132 insertions, 131 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
index 23caa3fe27..11f334c245 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
@@ -203,7 +203,7 @@ public static Frame new_Frame (final Composite parent) {
long /*int*/ awtHandle = getAWTHandle(window);
if (awtHandle == 0) return;
long /*int*/ xWindow;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
xWindow = OS.gdk_x11_window_get_xid (OS.gtk_widget_get_window (shell.handle));
} else if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){
xWindow = OS.gdk_x11_drawable_get_xid(OS.gtk_widget_get_window(OS.gtk_widget_get_toplevel(shell.handle)));
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java
index 6b555eaee3..0dca6b0a22 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java
@@ -315,7 +315,7 @@ void dragEnd(long /*int*/ widget, long /*int*/ context){
* NOTE: We believe that it is never an error to ungrab when
* a drag is finished.
*/
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ display = OS.gdk_window_get_display(OS.gtk_widget_get_window(widget));
long /*int*/ device_manager = OS.gdk_display_get_device_manager(display);
long /*int*/ pointer = OS.gdk_device_manager_get_client_pointer(device_manager);
@@ -331,7 +331,7 @@ void dragEnd(long /*int*/ widget, long /*int*/ context){
if (context != 0) {
long /*int*/ dest_window = 0;
int action = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
dest_window = OS.gdk_drag_context_get_dest_window(context);
action = OS.gdk_drag_context_get_selected_action(context);
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
index 8246075242..ea2a3d7b9e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
@@ -747,7 +747,7 @@ boolean setEventData(long /*int*/ context, int x, int y, int time, DNDEvent even
if (context == 0) return false;
long /*int*/ targets = 0;
int actions = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
targets = OS.gdk_drag_context_list_targets(context);
actions = OS.gdk_drag_context_get_actions(context);
} else {
@@ -836,7 +836,7 @@ void updateDragOverHover(long delay, DNDEvent event) {
}
long /*int*/ gdk_window_get_device_position (long /*int*/ window, int[] x, int[] y, int[] mask) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ display = 0;
if( window != 0) {
display = OS.gdk_window_get_display (window);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
index 29aa6e5a42..aee782f2bd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
@@ -83,7 +83,7 @@ public class TableDragSourceEffect extends DragSourceEffect {
//TEMPORARY CODE
if (table.isListening(SWT.EraseItem) || table.isListening (SWT.PaintItem)) return null;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) return null;
+ if (OS.GTK3) return null;
/*
* Bug in GTK. gtk_tree_selection_get_selected_rows() segmentation faults
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
index a8d8ebf03f..d7a7f544bb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
@@ -82,7 +82,7 @@ public class TreeDragSourceEffect extends DragSourceEffect {
//TEMPORARY CODE
if (tree.isListening(SWT.EraseItem) || tree.isListening (SWT.PaintItem)) return null;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) return null;
+ if (OS.GTK3) return null;
/*
* Bug in GTK. gtk_tree_selection_get_selected_rows() segmentation faults
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
index 7dbed4a3f6..a8e70e1654 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
@@ -178,7 +178,7 @@ long /*int*/ getHandle () {
* causing the child of the GtkFixed handle to be resized to 1.
* The workaround is to embed Mozilla into a GtkHBox handle.
*/
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
embedHandle = OS.gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, 0);
OS.gtk_box_set_homogeneous (embedHandle, false);
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java
index 5866c09e2c..2318d0e0d9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java
@@ -138,7 +138,7 @@ public GLCanvas (Composite parent, int style, GLData data) {
glWindow = OS.gdk_window_new (window, attrs, OS.GDK_WA_VISUAL);
OS.gdk_window_set_user_data (glWindow, handle);
if ((style & SWT.NO_BACKGROUND) != 0) OS.gdk_window_set_back_pixmap (window, 0, false);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
xWindow = OS.gdk_x11_window_get_xid (glWindow);
} else {
xWindow = OS.gdk_x11_drawable_get_xid (glWindow);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index ab785a7d27..6c3d182f13 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -608,7 +608,8 @@ public class OS extends C {
public static final byte[] GTK_STOCK_CLEAR = ascii("gtk-clear");
public static final int GTK_VERSION = VERSION(gtk_major_version(), gtk_minor_version(), gtk_micro_version());
- public static final int GLIB_VERSION = VERSION(glib_major_version(), glib_minor_version(), glib_micro_version());
+ public static final int GLIB_VERSION = VERSION(glib_major_version(), glib_minor_version(), glib_micro_version());
+ public static final boolean GTK3 = GTK_VERSION >= VERSION(3, 0, 0);
public static final boolean USE_CAIRO, INIT_CAIRO;
static {
boolean useCairo = false;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
index 7b18bdc34d..510557b8fb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
@@ -221,7 +221,7 @@ int hit(Theme theme, Point position, Rectangle bounds) {
}
void gtk_render_option (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_option (context, cairo, x, y, width, height);
@@ -232,7 +232,7 @@ void gtk_render_option (long /*int*/ style, long /*int*/ window, int state_type,
}
void gtk_render_check(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_check (context, cairo, x, y, width, height);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java
index ec12e88c13..a76558cf15 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java
@@ -124,7 +124,7 @@ int hit(Theme theme, Point position, Rectangle bounds) {
}
void gtk_render_shadow(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_style_context_save(context);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
index c41736b071..c9c8e4910a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
@@ -198,7 +198,7 @@ Rectangle measureText(Theme theme, String text, int flags, GC gc, Rectangle boun
}
void gtk_render_frame (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_frame (context, cairo, x, y, width, height);
@@ -209,7 +209,7 @@ void gtk_render_frame (long /*int*/ style, long /*int*/ window, int state_type,
}
void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_frame (context, cairo, x, y, width, height);
@@ -222,7 +222,7 @@ void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, in
void gtk_render_layout (long /*int*/ style, long /*int*/ window, int state_type, boolean use_text, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, long /*int*/ layout) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_layout (context, cairo, x, y, layout);
@@ -233,7 +233,7 @@ void gtk_render_layout (long /*int*/ style, long /*int*/ window, int state_type,
}
void gtk_render_focus (long /*int*/ style, long /*int*/ window, int state_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_style_context_save (context);
@@ -250,7 +250,7 @@ void gtk_render_focus (long /*int*/ style, long /*int*/ window, int state_type,
}
void gtk_render_arrow(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int arrow_type, boolean fill, int x, int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
double angle = 0;
double size = 0;
switch (arrow_type) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java
index 734df12873..b73432e15c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java
@@ -34,7 +34,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
int expander_size = theme.getWidgetProperty(treeHandle, "expander-size");
int x = bounds.x + expander_size / 2;
int y = bounds.y + expander_size / 2;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (drawable);
long /*int*/ context = OS.gtk_widget_get_style_context (gtkStyle);
OS.gtk_render_expander (context, cairo, bounds.x, bounds.y, expander_size, expander_size);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java
index d13e4c333a..06141da587 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java
@@ -67,7 +67,7 @@ int hit(Theme theme, Point position, Rectangle bounds) {
}
void gtk_render_shadow_gap (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height, int gap_side, int gap_x, int gap_width) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_style_context_save (context);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java
index f18c48934e..046415a963 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java
@@ -59,7 +59,7 @@ int hit(Theme theme, Point position, Rectangle bounds) {
}
void gtk_orientable_set_orientation (long /*int*/ pbar, int orientation) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
switch (orientation) {
case OS.GTK_PROGRESS_BOTTOM_TO_TOP:
OS.gtk_orientable_set_orientation(pbar, OS.GTK_ORIENTATION_VERTICAL);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java
index 8925d453a4..cc60a08114 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java
@@ -66,7 +66,7 @@ int hit(Theme theme, Point position, Rectangle bounds) {
}
void gtk_render_frame_gap (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height, int gap_side, int gap_x, int gap_width) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_frame_gap (context, cairo, context, y, gap_width, height, gap_side, gap_x, gap_x + gap_width);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
index 02bb6672cd..4f99a222f0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
@@ -37,7 +37,7 @@ public Theme(Device device) {
progressHandle = OS.gtk_progress_bar_new();
toolbarHandle = OS.gtk_toolbar_new();
treeHandle = OS.gtk_tree_view_new_with_model(0);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
separatorHandle = OS.gtk_separator_new (OS.GTK_ORIENTATION_VERTICAL);
} else {
separatorHandle = OS.gtk_vseparator_new();
@@ -195,7 +195,7 @@ void transferClipping(GC gc, long /*int*/ style) {
}
}
//TODO implement for GTK3
- if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
+ if (!OS.GTK3) {
long /*int*/ [] curGC = new long /*int*/ [1];
for (int i = 0; i < 5; i++) {
OS.gtk_style_get_fg_gc (style, i, curGC);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java
index f3b4ee27c8..c86aa87c92 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java
@@ -57,7 +57,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
long /*int*/ gtkStyle = OS.gtk_widget_get_style (separatorHandle);
theme.transferClipping(gc, gtkStyle);
if ((parent.style & SWT.VERTICAL) != 0) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (drawable);
long /*int*/ context = OS.gtk_widget_get_style_context (separatorHandle);
OS.gtk_render_line (context, cairo, bounds.x, bounds.y + bounds.height / 2, bounds.x + bounds.width, bounds.y + bounds.height / 2);
@@ -66,7 +66,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
OS.gtk_paint_hline(gtkStyle, drawable, state_type, null, separatorHandle, detail, bounds.x, bounds.x + bounds.width, bounds.y + bounds.height / 2);
}
} else {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (drawable);
long /*int*/ context = OS.gtk_widget_get_style_context (separatorHandle);
OS.gtk_render_line (context, cairo, bounds.x + bounds.width / 2, bounds.y, bounds.x + bounds.width / 2, bounds.y + bounds.height);
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;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java
index fea52ad56f..0eb38d4430 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java
@@ -288,7 +288,7 @@ public int size () {
}
static 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/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 3c19f203cf..6ebf428819 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -606,7 +606,7 @@ void resizeHandle (int width, int height) {
* alignment to fail. The fix is to set the child size to the size
* of the button.
*/
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {
OS.gtk_widget_set_size_request (boxHandle, width, -1);
}
@@ -689,7 +689,7 @@ void _setAlignment (int alignment) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, false, false, 0, OS.GTK_PACK_START);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_START);
} else {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
}
@@ -706,7 +706,7 @@ void _setAlignment (int alignment) {
OS.gtk_misc_set_alignment (labelHandle, 0f, 0.5f);
OS.gtk_misc_set_alignment (imageHandle, 1f, 0.5f);
} else {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
}
@@ -721,7 +721,7 @@ void _setAlignment (int alignment) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, false, false, 0, OS.GTK_PACK_END);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_END);
} else {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
index 642f5f9af8..e8ca3229f1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
@@ -261,7 +261,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
if (isFocus) caret.killFocus ();
long /*int*/ window = paintWindow ();
long /*int*/ visibleRegion;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
visibleRegion = OS.gdk_window_get_visible_region (window);
} else {
visibleRegion = OS.gdk_drawable_get_visible_region (window);
@@ -290,7 +290,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
// GC gc = new GC (this);
// gc.copyArea (x, y, width, height, destX, destY);
// gc.dispose ();
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gdk_window_invalidate_rect (window, copyRect, true);
long /*int*/ cairo = OS.gdk_cairo_create (window);
OS.gdk_cairo_set_source_window (cairo, window, 0, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index e06b3713d2..3523aa223f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -170,7 +170,7 @@ public void add (String string, int index) {
System.arraycopy (items, index, newItems, index + 1, items.length - index);
items = newItems;
byte [] buffer = Converter.wcsToMbcs (null, string, true);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_combo_box_text_insert (handle, index, null, buffer);
} else {
OS.gtk_combo_box_insert_text (handle, index, buffer);
@@ -346,7 +346,7 @@ void clearText () {
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
- if ((style & SWT.READ_ONLY) != 0 || OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if ((style & SWT.READ_ONLY) != 0 || OS.GTK3) {
return computeNativeSize (handle, wHint, hHint, changed);
}
if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
@@ -404,7 +404,7 @@ void createHandle (int index) {
gtk_widget_set_has_window (fixedHandle, true);
long /*int*/ oldList = OS.gtk_window_list_toplevels ();
if ((style & SWT.READ_ONLY) != 0) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
handle = OS.gtk_combo_box_text_new ();
} else {
handle = OS.gtk_combo_box_new_text ();
@@ -413,7 +413,7 @@ void createHandle (int index) {
cellHandle = OS.gtk_bin_get_child (handle);
if (cellHandle == 0) error (SWT.ERROR_NO_HANDLES);
} else {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
handle = OS.gtk_combo_box_text_new_with_entry();
} else {
handle = OS.gtk_combo_box_entry_new_text ();
@@ -421,7 +421,7 @@ void createHandle (int index) {
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
entryHandle = OS.gtk_bin_get_child (handle);
if (entryHandle == 0) error (SWT.ERROR_NO_HANDLES);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
imContext = OS.imContextLast();
}
}
@@ -1055,7 +1055,7 @@ public int getTextHeight () {
checkWidget();
GtkRequisition requisition = new GtkRequisition ();
gtk_widget_size_request (handle, requisition);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
return requisition.height;
} else {
return OS.GTK_WIDGET_REQUISITION_HEIGHT (handle);
@@ -1736,7 +1736,7 @@ public void select (int index) {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
if (entryHandle != 0) OS.gtk_widget_modify_base (entryHandle, 0, color);
if (cellHandle != 0) OS.g_object_set (cellHandle, OS.background_gdk, color, 0);
OS.g_object_set (textRenderer, OS.background_gdk, color, 0);
@@ -1826,7 +1826,7 @@ public void setItem (int index, String string) {
items [index] = string;
byte [] buffer = Converter.wcsToMbcs (null, string, true);
OS.gtk_combo_box_remove_text (handle, index);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_combo_box_text_insert (handle, index, null, buffer);
} else {
OS.gtk_combo_box_insert_text (handle, index, buffer);
@@ -1866,7 +1866,7 @@ public void setItems (String [] items) {
for (int i = 0; i < items.length; i++) {
String string = items [i];
byte [] buffer = Converter.wcsToMbcs (null, string, true);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_combo_box_text_insert (handle, i, null, buffer);
} else {
OS.gtk_combo_box_insert_text (handle, i, buffer);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 83bdf3a5f9..08768703cc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -1138,7 +1138,7 @@ void markLayout (boolean changed, boolean all) {
void moveAbove (long /*int*/ child, long /*int*/ sibling) {
if (child == sibling) return;
long /*int*/ parentHandle = parentingHandle ();
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.swt_fixed_restack (parentHandle, child, sibling, true);
return;
}
@@ -1183,7 +1183,7 @@ void moveBelow (long /*int*/ child, long /*int*/ sibling) {
moveAbove (child, scrolledHandle != 0 ? scrolledHandle : handle);
return;
}
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.swt_fixed_restack (parentHandle, child, sibling, false);
return;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index b8cd146e21..230c85d206 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -165,7 +165,7 @@ boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
if (window == 0) return false;
int orientation = vertical ? OS.GTK_ORIENTATION_HORIZONTAL : OS.GTK_ORIENTATION_VERTICAL;
if ((style & SWT.MIRRORED) != 0) x = getClientWidth () - width - x;
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context(paintHandle);
OS.gtk_render_handle(context, cairo, x, y, width, height);
@@ -230,7 +230,7 @@ void fixStyle (long /*int*/ handle) {
*/
if ((state & BACKGROUND) != 0) return;
if ((state & THEME_BACKGROUND) == 0) return;
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
long /*int*/ childStyle = parent.childStyle ();
if (childStyle != 0) {
GdkColor color = new GdkColor();
@@ -325,7 +325,7 @@ void hookEvents () {
int paintMask = OS.GDK_EXPOSURE_MASK | OS.GDK_VISIBILITY_NOTIFY_MASK;
OS.gtk_widget_add_events (paintHandle, paintMask);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [EXPOSE_EVENT], 0, display.closures [EXPOSE_EVENT_INVERSE], false);
}
@@ -410,7 +410,7 @@ public boolean print (GC gc) {
if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
long /*int*/ topHandle = topHandle ();
OS.gtk_widget_realize (topHandle);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_draw(topHandle, gc.handle);
return true;
}
@@ -682,7 +682,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
Point computeNativeSize (long /*int*/ h, int wHint, int hHint, boolean changed) {
int width = wHint, height = hHint;
- if (wHint == SWT.DEFAULT && hHint == SWT.DEFAULT && OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
+ if (wHint == SWT.DEFAULT && hHint == SWT.DEFAULT && !OS.GTK3) {
GtkRequisition requisition = new GtkRequisition ();
gtk_widget_size_request (h, requisition);
width = OS.GTK_WIDGET_REQUISITION_WIDTH (h);
@@ -851,7 +851,7 @@ void moveHandle (int x, int y) {
*
* NOTE: There is no API in GTK 3 to only set the GTK_VISIBLE bit.
*/
- if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
+ if (!OS.GTK3) {
boolean reset = gtk_widget_get_visible (parentHandle);
gtk_widget_set_visible (parentHandle, false);
OS.gtk_fixed_move (parentHandle, topHandle, x, y);
@@ -2471,7 +2471,7 @@ GdkColor getContextColor () {
}
GdkColor getBgColor () {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
return getContextBackground ();
}
long /*int*/ fontHandle = fontHandle ();
@@ -2482,7 +2482,7 @@ GdkColor getBgColor () {
}
GdkColor getBaseColor () {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
return getContextBackground ();
}
long /*int*/ fontHandle = fontHandle ();
@@ -2588,7 +2588,7 @@ public Font getFont () {
long /*int*/ getFontDescription () {
long /*int*/ fontHandle = fontHandle ();
OS.gtk_widget_realize (fontHandle);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ context = OS.gtk_widget_get_style_context (fontHandle);
return OS.gtk_style_context_get_font(context, OS.GTK_STATE_FLAG_NORMAL);
}
@@ -2615,7 +2615,7 @@ GdkColor getForegroundColor () {
}
GdkColor getFgColor () {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
return getContextColor ();
}
long /*int*/ fontHandle = fontHandle ();
@@ -2630,7 +2630,7 @@ Point getIMCaretPos () {
}
GdkColor getTextColor () {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
return getContextColor ();
}
long /*int*/ fontHandle = fontHandle ();
@@ -2860,7 +2860,7 @@ public boolean getVisible () {
}
Point getThickness (long /*int*/ widget) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
GtkBorder padding = new GtkBorder();
long /*int*/ context = OS.gtk_widget_get_style_context (widget);
OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, padding);
@@ -3857,7 +3857,7 @@ public void setBackground (Color color) {
gdkColor = color.handle;
}
boolean set = false;
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
set = !getBackground().equals(color);
} else {
if (gdkColor == null) {
@@ -3880,7 +3880,7 @@ public void setBackground (Color color) {
}
void setBackgroundColor (long /*int*/ handle, GdkColor color) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
GdkRGBA rgba = null;
double alpha = 1;
if (color == null) {
@@ -3976,7 +3976,7 @@ void setBackgroundPixmap (Image image) {
if (image.pixmap != 0) {
OS.gdk_window_set_back_pixmap (window, image.pixmap, false);
} else if (image.surface != 0) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ pattern = Cairo.cairo_pattern_create_for_surface(image.surface);
if (pattern == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Cairo.cairo_pattern_set_extend(pattern, Cairo.CAIRO_EXTEND_REPEAT);
@@ -4239,7 +4239,7 @@ public void setForeground (Color color) {
gdkColor = color.handle;
}
boolean set = false;
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
set = !getForeground().equals(color);
} else {
if (gdkColor == null) {
@@ -4418,10 +4418,10 @@ public boolean setParent (Composite parent) {
}
long /*int*/ newParent = parent.parentingHandle();
OS.gtk_widget_reparent(topHandle, newParent);
- if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
- OS.gtk_fixed_move (newParent, topHandle, x, y);
- } else {
+ if (OS.GTK3) {
OS.swt_fixed_move (newParent, topHandle, x, y);
+ } else {
+ OS.gtk_fixed_move (newParent, topHandle, x, y);
}
/*
* Restore the original widget size since GTK does not keep it.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index 5705c5c0ae..5ad04507ee 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -1072,7 +1072,7 @@ public void setBackground(Color color) {
void setBackgroundColor (GdkColor color) {
if ((style & SWT.CALENDAR) != 0) {
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.gtk_widget_modify_base(handle, 0, color);
}
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
index 14891b2434..b986ccab8e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -160,7 +160,7 @@ String openChooserDialog () {
if (message.length () > 0) {
byte [] buffer = Converter.wcsToMbcs (null, message, true);
long /*int*/ box = 0;
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
box = OS.gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, 0);
OS.gtk_box_set_homogeneous (box, false);
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index d319ce81d2..b835ee9620 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -935,7 +935,7 @@ void createDisplay (DeviceData data) {
int minor = OS.gtk_minor_version (), micro = OS.gtk_micro_version ();
System.out.println ("***WARNING: Detected: " + major + "." + minor + "." + micro); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
fixed_type = OS.swt_fixed_get_type();
}
if (fixed_type == 0) {
@@ -968,7 +968,7 @@ void createDisplay (DeviceData data) {
if (rendererClassInitProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
}
if (rendererRenderProc == 0) {
- rendererRenderCallback = new Callback (getClass (), "rendererRenderProc", OS.GTK_VERSION >= OS.VERSION(3, 0, 0) ? 6 : 7); //$NON-NLS-1$
+ rendererRenderCallback = new Callback (getClass (), "rendererRenderProc", OS.GTK3 ? 6 : 7); //$NON-NLS-1$
rendererRenderProc = rendererRenderCallback.getAddress ();
if (rendererRenderProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
}
@@ -1032,7 +1032,7 @@ void createDisplay (DeviceData data) {
if (OS.GDK_WINDOWING_X11 ()) {
long /*int*/ xWindow;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
xWindow = OS.gdk_x11_window_get_xid (OS.gtk_widget_get_window (shellHandle));
} else if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){
xWindow = OS.gdk_x11_drawable_get_xid (OS.gtk_widget_get_window (shellHandle));
@@ -2246,7 +2246,7 @@ GdkColor toGdkColor (GdkRGBA rgba, double m) {
}
void initializeSystemColors () {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ tooltipShellHandle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
if (tooltipShellHandle == 0) error (SWT.ERROR_NO_HANDLES);
byte[] gtk_tooltip = Converter.wcsToMbcs (null, "gtk-tooltip", true); //$NON-NLS-1$
@@ -2505,7 +2505,7 @@ void initializeCallbacks () {
signalIds [Widget.ENTER_NOTIFY_EVENT] = OS.g_signal_lookup (OS.enter_notify_event, OS.GTK_TYPE_WIDGET ());
signalIds [Widget.EVENT] = OS.g_signal_lookup (OS.event, OS.GTK_TYPE_WIDGET ());
signalIds [Widget.EVENT_AFTER] = OS.g_signal_lookup (OS.event_after, OS.GTK_TYPE_WIDGET ());
- signalIds [Widget.EXPOSE_EVENT] = OS.g_signal_lookup (OS.GTK_VERSION >= OS.VERSION(3, 0, 0) ? OS.draw : OS.expose_event, OS.GTK_TYPE_WIDGET ());
+ signalIds [Widget.EXPOSE_EVENT] = OS.g_signal_lookup (OS.GTK3 ? OS.draw : OS.expose_event, OS.GTK_TYPE_WIDGET ());
signalIds [Widget.FOCUS] = OS.g_signal_lookup (OS.focus, OS.GTK_TYPE_WIDGET ());
signalIds [Widget.FOCUS_IN_EVENT] = OS.g_signal_lookup (OS.focus_in_event, OS.GTK_TYPE_WIDGET ());
signalIds [Widget.FOCUS_OUT_EVENT] = OS.g_signal_lookup (OS.focus_out_event, OS.GTK_TYPE_WIDGET ());
@@ -2705,7 +2705,7 @@ void initializeSubclasses () {
OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (pangoLayoutClass, OS.pangoLayoutNewProc_CALLBACK(pangoLayoutNewProc));
OS.g_type_class_unref (pangoLayoutClass);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ imContextType = OS.GTK_TYPE_IM_MULTICONTEXT ();
long /*int*/ imContextClass = OS.g_type_class_ref (imContextType);
imContextNewProc = OS.G_OBJECT_CLASS_CONSTRUCTOR (imContextClass);
@@ -3497,7 +3497,7 @@ void releaseDisplay () {
OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (pangoLayoutClass, pangoLayoutNewProc);
OS.g_type_class_unref (pangoLayoutClass);
pangoLayoutNewProc = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ imContextType = OS.PANGO_TYPE_LAYOUT ();
long /*int*/ imContextClass = OS.g_type_class_ref (imContextType);
OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (imContextClass, imContextNewProc);
@@ -4075,7 +4075,7 @@ void showIMWindow (Control control) {
Control widget = control.findBackgroundControl ();
if (widget == null) widget = control;
GdkColor color = widget.getBackgroundColor ();
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
widget.setBackgroundColor (preeditWindow, color);
} else {
OS.gtk_widget_modify_bg (preeditWindow, OS.GTK_STATE_NORMAL, color);
@@ -4087,7 +4087,7 @@ void showIMWindow (Control control) {
Point point = control.toDisplay (control.getIMCaretPos ());
OS.gtk_window_move (preeditWindow, point.x, point.y);
GtkRequisition requisition = new GtkRequisition ();
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_get_preferred_size (preeditLabel, requisition, null);
} else {
OS.gtk_widget_size_request (preeditLabel, requisition);
@@ -4343,7 +4343,7 @@ long /*int*/ signalProc (long /*int*/ gobject, long /*int*/ arg1, long /*int*/ u
long /*int*/ atom = OS.gdk_x11_atom_to_xatom (OS.gdk_atom_intern (name, true));
if (atom == OS.gdk_x11_atom_to_xatom (gdkEvent.atom)) {
long /*int*/ xWindow;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
xWindow = OS.gdk_x11_window_get_xid (OS.gtk_widget_get_window (shellHandle));
} else if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){
xWindow = OS.gdk_x11_drawable_get_xid (OS.gtk_widget_get_window( shellHandle));
@@ -4517,7 +4517,7 @@ long /*int*/ windowTimerProc (long /*int*/ handle) {
}
long /*int*/ gdk_window_get_device_position (long /*int*/ window, int[] x, int[] y, int[] mask) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ display = 0;
if( window != 0) {
display = OS.gdk_window_get_display (window);
@@ -4534,7 +4534,7 @@ long /*int*/ gdk_window_get_device_position (long /*int*/ window, int[] x, int[]
}
long /*int*/ gdk_device_get_window_at_position (int[] win_x, int[] win_y) {
- if (OS.GTK_VERSION >= OS.VERSION(3,0,0)) {
+ if (OS.GTK3) {
long /*int*/ display = OS.gdk_display_get_default ();
long /*int*/ device_manager = OS.gdk_display_get_device_manager (display);
long /*int*/ device = OS.gdk_device_manager_get_client_pointer (device_manager);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
index 839e26cfc8..d834c110bc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
@@ -133,7 +133,7 @@ void createHandle(int index) {
g_object_ref_sink (labelHandle);
clientHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (clientHandle == 0) error (SWT.ERROR_NO_HANDLES);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_override_background_color (clientHandle, 0, new GdkRGBA ());
long /*int*/ region = OS.gdk_region_new ();
OS.gtk_widget_input_shape_combine_region (clientHandle, region);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index aa8ed91938..08eb57f317 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -586,7 +586,7 @@ void showWidget () {
long /*int*/ gtk_separator_new (int orientation) {
long /*int*/ separator = 0;
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
separator = OS.gtk_separator_new (orientation);
} else {
if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 3a1ded6d2f..0caccdd2d4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -1225,7 +1225,7 @@ void selectFocusIndex (int index) {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index 781ee567d4..4f2a77114e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -884,7 +884,7 @@ public void setText (String string) {
long /*int*/ label = OS.gtk_bin_get_child (handle);
if (label != 0 && OS.GTK_IS_LABEL(label)) {
OS.gtk_label_set_text_with_mnemonic (label, buffer);
- if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
+ if (!OS.GTK3) {
if (OS.GTK_IS_ACCEL_LABEL(label)) {
buffer = Converter.wcsToMbcs (null, accelString, true);
long /*int*/ ptr = OS.g_malloc (buffer.length);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index 5c8c5373b6..f37da28325 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -304,7 +304,7 @@ void updateBar (int selection, int minimum, int maximum) {
}
void gtk_orientable_set_orientation (long /*int*/ pbar, int orientation) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
switch (orientation) {
case OS.GTK_PROGRESS_BOTTOM_TO_TOP:
OS.gtk_orientable_set_orientation(pbar, OS.GTK_ORIENTATION_VERTICAL);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
index 5bc20c698c..d7cebd322c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
@@ -365,7 +365,7 @@ public void setSelection (int value) {
long /*int*/ gtk_scale_new (int orientation, long /*int*/ adjustment) {
long /*int*/ scale = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
scale = OS.gtk_scale_new (orientation, adjustment);
} else {
if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index 7c9817f0fa..51f3934cf1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -565,7 +565,7 @@ void bringToTop (boolean force) {
xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
}
long /*int*/ xWindow;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
xWindow = OS.gdk_x11_window_get_xid (window);
} else {
xWindow = OS.gdk_x11_drawable_get_xid (window);
@@ -713,7 +713,7 @@ void createHandle (int index) {
OS.gtk_window_set_title (shellHandle, new byte [1]);
if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
OS.gtk_container_set_border_width (shellHandle, 1);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_override_background_color (shellHandle, OS.GTK_STATE_FLAG_NORMAL, new GdkRGBA());
} else {
GdkColor color = new GdkColor ();
@@ -844,7 +844,7 @@ void hookEvents () {
OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.shellMapProcClosure, false);
OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
OS.g_signal_connect_closure (shellHandle, OS.move_focus, display.closures [MOVE_FOCUS], false);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
long /*int*/ window = gtk_widget_get_window (shellHandle);
OS.gdk_window_add_filter (window, display.filterProc, shellHandle);
} else {
@@ -2485,7 +2485,7 @@ void releaseWidget () {
tooltipsHandle = 0;
if (group != 0) OS.g_object_unref (group);
group = modalGroup = 0;
- if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
+ if (!OS.GTK3) {
long /*int*/ window = gtk_widget_get_window (shellHandle);
OS.gdk_window_remove_filter(window, display.filterProc, shellHandle);
}
@@ -2632,7 +2632,7 @@ void setToolTipText (long /*int*/ rootWidget, long /*int*/ tipWidget, String str
}
void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ cairo = OS.gdk_cairo_create (window);
long /*int*/ context = OS.gtk_widget_get_style_context (style);
OS.gtk_render_frame (context, cairo, x, y, width, height);
@@ -2643,7 +2643,7 @@ void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, in
}
}
long /*int*/ gdk_device_get_window_at_position (int[] win_x, int[] win_y) {
- if (OS.GTK_VERSION >= OS.VERSION(3,0,0)) {
+ if (OS.GTK3) {
long /*int*/ display = OS.gdk_display_get_default ();
long /*int*/ device_manager = OS.gdk_display_get_device_manager (display);
long /*int*/ device = OS.gdk_device_manager_get_client_pointer (device_manager);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
index bfd939a01b..d8da452f0d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
@@ -598,7 +598,7 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i
long /*int*/ gtk_scrollbar_new (int orientation, long /*int*/ adjustment) {
long /*int*/ scrollbar = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
scrollbar = OS.gtk_scrollbar_new (orientation, adjustment);
} else {
if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index 9a0a61ef72..c1588fc89b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -299,7 +299,7 @@ void createHandle (int index) {
OS.gtk_editable_set_editable (handle, (style & SWT.READ_ONLY) == 0);
OS.gtk_entry_set_has_frame (handle, (style & SWT.BORDER) != 0);
OS.gtk_spin_button_set_wrap (handle, (style & SWT.WRAP) != 0);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
imContext = OS.imContextLast();
}
}
@@ -866,7 +866,7 @@ void removeVerifyListener (VerifyListener listener) {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 050cc20801..a61733c7ca 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -227,7 +227,7 @@ void createItem (TabItem item, int index) {
OS.gtk_container_add (boxHandle, labelHandle);
long /*int*/ pageHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (pageHandle == 0) error (SWT.ERROR_NO_HANDLES);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_override_background_color (pageHandle, 0, new GdkRGBA ());
long /*int*/ region = OS.gdk_region_new ();
OS.gtk_widget_input_shape_combine_region (pageHandle, region);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 44b41b790a..81b7123dc7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -2665,7 +2665,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
if ((drawState & SWT.SELECTED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
if ((drawState & SWT.FOCUSED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
if ((drawState & SWT.SELECTED) != 0) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
//TODO draw selection on GTK3
} else {
long /*int*/ style = OS.gtk_widget_get_style (widget);
@@ -2695,7 +2695,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
if (drawForeground != null && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
OS.g_object_set (cell, OS.foreground_gdk, drawForeground, 0);
}
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.call (klass.render, cell, cr, widget, background_area, cell_area, drawFlags);
} else {
OS.call (klass.render, cell, window, widget, background_area, cell_area, expose_area, drawFlags);
@@ -2976,7 +2976,7 @@ void selectFocusIndex (int index) {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 20777f31e6..39ac93ffbf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -1169,7 +1169,7 @@ public void setImage (int index, Image image) {
* are relying on the fact that it is done as part of modifying
* the style.
*/
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
long /*int*/ style = OS.gtk_widget_get_modifier_style (parentHandle);
parent.modifyStyle (parentHandle, style);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index e68d24f1e3..bc4587be52 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -230,7 +230,7 @@ void createHandle (int index) {
if ((style & SWT.RIGHT) != 0) just = OS.GTK_JUSTIFY_RIGHT;
OS.gtk_text_view_set_justification (handle, just);
}
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
imContext = OS.imContextLast();
}
}
@@ -1591,7 +1591,7 @@ void drawMessage (long /*int*/ cr) {
}
GdkColor textColor = new GdkColor ();
GdkColor baseColor = new GdkColor ();
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ styleContext = OS.gtk_widget_get_style_context (handle);
GdkRGBA rgba = new GdkRGBA ();
OS.gtk_style_context_get_color (styleContext, OS.GTK_STATE_FLAG_INSENSITIVE, rgba);
@@ -2070,7 +2070,7 @@ public void selectAll () {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
index 0354d883a3..355da7ed54 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
@@ -252,7 +252,7 @@ void configure () {
OS.gtk_widget_realize(handle);
Region region = new Region (display);
region.add(polyline);
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_shape_combine_region (handle, region.handle);
} else {
long /*int*/ window = gtk_widget_get_window (handle);
@@ -266,7 +266,7 @@ void createHandle (int index) {
state |= HANDLE;
handle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
Color background = display.getSystemColor (SWT.COLOR_INFO_BACKGROUND);
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
GdkColor color = background.handle;
GdkRGBA rgba = new GdkRGBA();
rgba.alpha = 1;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 9b2296d0e7..a92171ff99 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -2655,7 +2655,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
if ((drawState & SWT.SELECTED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
if ((drawState & SWT.FOCUSED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
if ((drawState & SWT.SELECTED) != 0) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
//TODO draw selection on GTK3
} else {
long /*int*/ style = OS.gtk_widget_get_style (widget);
@@ -2685,7 +2685,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
if (drawForeground != null && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
OS.g_object_set (cell, OS.foreground_gdk, drawForeground, 0);
}
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.call (klass.render, cell, cr, widget, background_area, cell_area, drawFlags);
} else {
OS.call (klass.render, cell, window, widget, background_area, cell_area, expose_area, drawFlags);
@@ -2944,7 +2944,7 @@ public void selectAll () {
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index 3f969dbee1..b630d19caa 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -1608,7 +1608,7 @@ public void setImage (int index, Image image) {
* are relying on the fact that it is done as part of modifying
* the style.
*/
- if (OS.GTK_VERSION < OS.VERSION (3, 0, 0)) {
+ if (!OS.GTK3) {
long /*int*/ style = OS.gtk_widget_get_modifier_style (parentHandle);
parent.modifyStyle (parentHandle, style);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index 148aea15f3..fe1916e37a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -1641,7 +1641,7 @@ public void setData (String key, Object value) {
}
void setFontDescription (long /*int*/ widget, long /*int*/ font) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_override_font (widget, font);
} else {
OS.gtk_widget_modify_font (widget, font);
@@ -1653,7 +1653,7 @@ void setForegroundColor (long /*int*/ handle, GdkColor color) {
}
void setForegroundColor (long /*int*/ handle, GdkColor color, boolean setStateActive) {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
GdkRGBA rgba = null;
if (color != null) {
rgba = new GdkRGBA();
@@ -1916,7 +1916,7 @@ void gtk_widget_set_mapped (long /*int*/ widget, boolean mapped) {
}
void gtk_widget_set_visible (long /*int*/ widget, boolean visible) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_set_visible (widget,visible);
} else {
if (visible) {
@@ -1958,7 +1958,7 @@ void gdk_window_get_size (long /*int*/ drawable, int[] width, int[] height) {
long /*int*/ gtk_box_new (int orientation, boolean homogeneous, int spacing) {
long /*int*/ box = 0;
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
box = OS.gtk_box_new (orientation, spacing);
OS.gtk_box_set_homogeneous (box, homogeneous);
} else {
@@ -1972,7 +1972,7 @@ long /*int*/ gtk_box_new (int orientation, boolean homogeneous, int spacing) {
}
int gdk_pointer_grab (long /*int*/ window, int grab_ownership, boolean owner_events, int event_mask, long /*int*/ confine_to, long /*int*/ cursor, int time_) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ display = 0;
if( window != 0) {
display = OS.gdk_window_get_display (window);
@@ -1989,7 +1989,7 @@ int gdk_pointer_grab (long /*int*/ window, int grab_ownership, boolean owner_eve
}
void gdk_pointer_ungrab (long /*int*/ window, int time_) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ display = OS.gdk_window_get_display (window);
long /*int*/ device_manager = OS.gdk_display_get_device_manager (display);
long /*int*/ pointer = OS.gdk_device_manager_get_client_pointer (device_manager);
@@ -2077,7 +2077,7 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ us
case EVENT: return gtk_event (handle, arg0);
case EVENT_AFTER: return gtk_event_after (handle, arg0);
case EXPOSE_EVENT: {
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
return gtk_draw (handle, arg0);
} else {
return gtk_expose_event (handle, arg0);
@@ -2135,7 +2135,7 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ ar
}
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);
@@ -2143,7 +2143,7 @@ void gdk_cursor_unref (long /*int*/ cursor) {
}
long /*int*/ gdk_window_get_device_position (long /*int*/ window, int[] x, int[] y, int[] mask) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
long /*int*/ display = 0;
if( window != 0) {
display = OS.gdk_window_get_display (window);
@@ -2160,7 +2160,7 @@ long /*int*/ gdk_window_get_device_position (long /*int*/ window, int[] x, int[]
}
void gtk_cell_renderer_get_preferred_size (long /*int*/ cell, long /*int*/ widget, int[] width, int[] height) {
- if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ if (OS.GTK3) {
GtkRequisition minimum_size = new GtkRequisition ();
OS.gtk_cell_renderer_get_preferred_size (cell, widget, minimum_size, null);
if (width != null) width [0] = minimum_size.width;
@@ -2171,7 +2171,7 @@ void gtk_cell_renderer_get_preferred_size (long /*int*/ cell, long /*int*/ widge
}
void gtk_widget_get_preferred_size (long /*int*/ widget, GtkRequisition requisition){
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK3) {
OS.gtk_widget_get_preferred_size (widget, requisition, null);
} else {
OS.gtk_widget_size_request (widget, requisition);