diff options
| author | Alexander Kurtakov | 2011-10-19 09:54:30 +0000 |
|---|---|---|
| committer | Silenio Quarti | 2011-11-25 16:43:03 +0000 |
| commit | 4b6f3d6ef93f821147ed56467d58afcd45e822e5 (patch) | |
| tree | 6437892d6c2676bf395589e4296e01ecbe8770d9 | |
| parent | fc1e32326bc5f902f63c6faf6a297be9ea7b2980 (diff) | |
| download | eclipse.platform.swt-4b6f3d6ef93f821147ed56467d58afcd45e822e5.tar.gz eclipse.platform.swt-4b6f3d6ef93f821147ed56467d58afcd45e822e5.tar.xz eclipse.platform.swt-4b6f3d6ef93f821147ed56467d58afcd45e822e5.zip | |
Bug 364766 - Use gtk_orientable_set_orientation if gtk >= 2.16.0.
6 files changed, 52 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index a8f6e71dbb..cbab2d5893 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -10894,6 +10894,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1object_1sink) } #endif +#ifndef NO__1gtk_1orientable_1set_1orientation +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1orientable_1set_1orientation) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1orientable_1set_1orientation_FUNC); +/* + gtk_orientable_set_orientation(arg0, (GtkOrientation)arg1); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_orientable_set_orientation) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, GtkOrientation))fp)(arg0, (GtkOrientation)arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1orientable_1set_1orientation_FUNC); +} +#endif + #ifndef NO__1gtk_1page_1setup_1get_1bottom_1margin JNIEXPORT jdouble JNICALL OS_NATIVE(_1gtk_1page_1setup_1get_1bottom_1margin) (JNIEnv *env, jclass that, jintLong arg0, jint arg1) @@ -14246,7 +14264,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1toolbar_1set_1orientation) (JNIEnv *env, jclass that, jintLong arg0, jint arg1) { OS_NATIVE_ENTER(env, that, _1gtk_1toolbar_1set_1orientation_FUNC); +/* gtk_toolbar_set_orientation((GtkToolbar *)arg0, (GtkOrientation)arg1); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_toolbar_set_orientation) + if (fp) { + ((void (CALLING_CONVENTION*)(GtkToolbar *, GtkOrientation))fp)((GtkToolbar *)arg0, (GtkOrientation)arg1); + } + } OS_NATIVE_EXIT(env, that, _1gtk_1toolbar_1set_1orientation_FUNC); } #endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h index bcd95f3c5b..46c6d25277 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h @@ -124,6 +124,7 @@ #define gtk_icon_theme_get_default_LIB LIB_GTK #define gtk_menu_shell_set_take_focus_LIB LIB_GTK #define gtk_window_set_keep_below_LIB LIB_GTK +#define gtk_toolbar_set_orientation_LIB LIB_GTK #define gtk_tooltip_trigger_tooltip_query_LIB LIB_GTK #define gtk_tree_selection_count_selected_rows_LIB LIB_GTK #define gtk_tree_selection_get_selected_rows_LIB LIB_GTK @@ -187,6 +188,7 @@ #define gdk_cairo_region_LIB LIB_GDK #define gdk_cairo_create_LIB LIB_GDK #define gtk_enumerate_printers_LIB LIB_GTK +#define gtk_orientable_set_orientation_LIB LIB_GTK #define gtk_page_setup_get_bottom_margin_LIB LIB_GTK #define gtk_page_setup_get_left_margin_LIB LIB_GTK #define gtk_page_setup_get_orientation_LIB LIB_GTK diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 9c68fcfd2f..39e39ce790 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -18,8 +18,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1384; -int OS_nativeFunctionCallCount[1384]; +int OS_nativeFunctionCount = 1385; +int OS_nativeFunctionCallCount[1385]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -887,6 +887,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1notebook_1set_1show_1tabs", "_1gtk_1notebook_1set_1tab_1pos", "_1gtk_1object_1sink", + "_1gtk_1orientable_1set_1orientation", "_1gtk_1page_1setup_1get_1bottom_1margin", "_1gtk_1page_1setup_1get_1left_1margin", "_1gtk_1page_1setup_1get_1orientation", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index ee4922629a..34b6baf4c2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -895,6 +895,7 @@ typedef enum { _1gtk_1notebook_1set_1show_1tabs_FUNC, _1gtk_1notebook_1set_1tab_1pos_FUNC, _1gtk_1object_1sink_FUNC, + _1gtk_1orientable_1set_1orientation_FUNC, _1gtk_1page_1setup_1get_1bottom_1margin_FUNC, _1gtk_1page_1setup_1get_1left_1margin_FUNC, _1gtk_1page_1setup_1get_1orientation_FUNC, 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 6e513a5ae6..2076c5f50c 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 @@ -8610,6 +8610,20 @@ public static final void gtk_object_sink(int /*long*/ object) { lock.unlock(); } } +/** + * @method flags=dynamic + * @param toolbar cast=(GtkOrientable *) + * @param orientation cast=(GtkOrientation) + */ +public static final native void _gtk_orientable_set_orientation(int /*long*/ orientable, int orientation); +public static final void gtk_orientable_set_orientation(int /*long*/ orientable, int orientation) { + lock.lock(); + try { + _gtk_orientable_set_orientation(orientable, orientation); + } finally { + lock.unlock(); + } +} /** @method flags=dynamic */ public static final native int /*long*/ _gtk_page_setup_new (); public static final int /*long*/ gtk_page_setup_new () { @@ -11136,6 +11150,7 @@ public static final int /*long*/ gtk_toolbar_new() { } } /** + * @method flags=dynamic * @param toolbar cast=(GtkToolbar *) * @param orientation cast=(GtkOrientation) */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java index 420ab48cae..3d30124842 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java @@ -98,7 +98,11 @@ public ToolBar (Composite parent, int style) { this.style |= SWT.HORIZONTAL; } int orientation = (style & SWT.VERTICAL) != 0 ? OS.GTK_ORIENTATION_VERTICAL : OS.GTK_ORIENTATION_HORIZONTAL; - OS.gtk_toolbar_set_orientation (handle, orientation); + if (OS.GTK_VERSION < OS.VERSION (2, 16, 0)) { + OS.gtk_toolbar_set_orientation (handle, orientation); + } else { + OS.gtk_orientable_set_orientation(handle, orientation); + } } static int checkStyle (int style) { |
