diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-29 13:42:21 -0400 |
---|---|---|
committer | Arun Thondapu <arunkumar.thondapu@in.ibm.com> | 2012-09-12 22:48:49 +0530 |
commit | 21331182885d36e87fd7aa26872a15a6f6734271 (patch) | |
tree | db8f497de54b793b2211eb3c87d6063b605e33f7 /bundles/org.eclipse.swt/Eclipse SWT Theme | |
parent | e146916783f37aa41636cc83669e5f610cf7343a (diff) | |
download | eclipse.platform.swt-21331182885d36e87fd7aa26872a15a6f6734271.tar.gz eclipse.platform.swt-21331182885d36e87fd7aa26872a15a6f6734271.tar.xz eclipse.platform.swt-21331182885d36e87fd7aa26872a15a6f6734271.zip |
Bug 388369 Use gtk_separator_new () in GTK+3
This patch replaces old GTK2 API methods gtk_vseparator_new () and
gtk_hseparator_new () with GTK+ 3 API method gtk_separator_new() and
makes old 2 methods dynamic
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java | 16 |
1 files changed, 15 insertions, 1 deletions
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 1357fb9c9e..569bd5b822 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); - separatorHandle = OS.gtk_vseparator_new(); + separatorHandle = gtk_separator_new (OS.GTK_ORIENTATION_VERTICAL); labelHandle = OS.gtk_label_new(null); OS.gtk_container_add (fixedHandle, labelHandle); OS.gtk_container_add (fixedHandle, frameHandle); @@ -215,4 +215,18 @@ void transferClipping(GC gc, int /*long*/ style) { OS.gdk_region_destroy(clipping); } } + +int /*long*/ gtk_separator_new (int orientation) { + int /*long*/ separator = 0; + if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + separator = OS.gtk_separator_new (orientation); + } else { + if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) { + separator = OS.gtk_hseparator_new (); + } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) { + separator = OS.gtk_vseparator_new (); + } + } + return separator; +} } |