diff options
author | Alexander Kurtakov <akurtako@redhat.com> | 2012-10-16 10:46:31 +0300 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2012-10-16 10:46:31 +0300 |
commit | 801ec1483559446c0d86f80fed29f2453a706def (patch) | |
tree | c3dec3f3e692925364a1d3b43ad0df35765d4922 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse | |
parent | a3e032800e98721779dad6898ea6e135501045b9 (diff) | |
download | eclipse.platform.swt-801ec1483559446c0d86f80fed29f2453a706def.tar.gz eclipse.platform.swt-801ec1483559446c0d86f80fed29f2453a706def.tar.xz eclipse.platform.swt-801ec1483559446c0d86f80fed29f2453a706def.zip |
Remove Gtk 2.2-2.4 checks.
Now that we require 2.6.0+ it makes no sense to clutter the code with
useless checks.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse')
6 files changed, 6 insertions, 23 deletions
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 c473b56e38..62388650ba 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 @@ -291,7 +291,7 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } long /*int*/ display = 0; - if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0) && OS.gdk_display_supports_cursor_color(display = OS.gdk_display_get_default ())) { + if (OS.gdk_display_supports_cursor_color(display = OS.gdk_display_get_default ())) { int width = source.width; int height = source.height; PaletteData palette = source.palette; 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 5b2db7b453..2279e00e2a 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 @@ -652,9 +652,7 @@ void createLayout() { if (OS.GTK_VERSION < OS.VERSION(2, 6, 0)) { OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system()); } - if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) { - OS.pango_layout_set_auto_dir(layout, false); - } + OS.pango_layout_set_auto_dir(layout, false); } void disposeLayout() { 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 5202b30295..7a8aa4392f 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 @@ -4207,7 +4207,6 @@ void setOrientation (boolean create) { */ public void setOrientation (int orientation) { checkWidget (); - if (OS.GTK_VERSION < OS.VERSION (2, 4, 0)) return; int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT; if ((orientation & flags) == 0 || (orientation & flags) == flags) return; style &= ~flags; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index 35659415f7..caa548bff9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -1030,7 +1030,6 @@ public void setOrientation (int orientation) { } void _setOrientation (int orientation) { - if (OS.GTK_VERSION < OS.VERSION (2, 4, 0)) return; int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT; if ((orientation & flags) == 0 || (orientation & flags) == flags) return; style &= ~flags; 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 713587b523..8e348d69a7 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 @@ -217,7 +217,7 @@ void createHandle (int index) { OS.gtk_container_add (fixedHandle, scrolledHandle); OS.gtk_container_add (scrolledHandle, handle); OS.gtk_text_view_set_editable (handle, (style & SWT.READ_ONLY) == 0); - if ((style & SWT.WRAP) != 0) OS.gtk_text_view_set_wrap_mode (handle, OS.GTK_VERSION < OS.VERSION (2, 4, 0) ? OS.GTK_WRAP_WORD : OS.GTK_WRAP_WORD_CHAR); + if ((style & SWT.WRAP) != 0) OS.gtk_text_view_set_wrap_mode (handle, OS.GTK_WRAP_WORD_CHAR); int hsp = (style & SWT.H_SCROLL) != 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER; int vsp = (style & SWT.V_SCROLL) != 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER; OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp); 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 6ba97d92db..7e9c2e761a 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 @@ -269,16 +269,7 @@ void createHandle (int index) { state |= HANDLE; handle = OS.gtk_tooltips_new (); if (handle == 0) error (SWT.ERROR_NO_HANDLES); - /* - * Bug in Solaris-GTK. Invoking gtk_tooltips_force_window() - * can cause a crash in older versions of GTK. The fix is - * to avoid this call if the GTK version is older than 2.2.x. - * The call is to be avoided on GTK versions newer than 2.12.0 - * where it's deprecated. - */ - if (OS.GTK_VERSION >= OS.VERSION (2, 2, 1)) { - OS.gtk_tooltips_force_window (handle); - } + OS.gtk_tooltips_force_window (handle); OS.g_object_ref (handle); g_object_ref_sink (handle); } @@ -791,9 +782,7 @@ public void setMessage (String string) { if (message.length () != 0) { byte [] buffer = Converter.wcsToMbcs (null, message, true); layoutMessage = OS.gtk_widget_create_pango_layout (handle, buffer); - if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { - OS.pango_layout_set_auto_dir (layoutMessage, false); - } + OS.pango_layout_set_auto_dir (layoutMessage, false); OS.pango_layout_set_wrap (layoutMessage, OS.PANGO_WRAP_WORD_CHAR); } if (gtk_widget_get_visible (handle)) configure (); @@ -822,9 +811,7 @@ public void setText (String string) { if (text.length () != 0) { byte [] buffer = Converter.wcsToMbcs (null, text, true); layoutText = OS.gtk_widget_create_pango_layout (handle, buffer); - if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { - OS.pango_layout_set_auto_dir (layoutText, false); - } + OS.pango_layout_set_auto_dir (layoutText, false); long /*int*/ boldAttr = OS.pango_attr_weight_new (OS.PANGO_WEIGHT_BOLD); PangoAttribute attribute = new PangoAttribute (); OS.memmove (attribute, boldAttr, PangoAttribute.sizeof); |