summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAlexander Kurtakov2011-10-19 05:54:30 (EDT)
committer Silenio Quarti2011-11-25 11:43:03 (EST)
commit4b6f3d6ef93f821147ed56467d58afcd45e822e5 (patch)
tree6437892d6c2676bf395589e4296e01ecbe8770d9
parentfc1e32326bc5f902f63c6faf6a297be9ea7b2980 (diff)
downloadeclipse.platform.swt-4b6f3d6ef93f821147ed56467d58afcd45e822e5.zip
eclipse.platform.swt-4b6f3d6ef93f821147ed56467d58afcd45e822e5.tar.gz
eclipse.platform.swt-4b6f3d6ef93f821147ed56467d58afcd45e822e5.tar.bz2
Bug 364766 - Use gtk_orientable_set_orientation if gtk >= 2.16.0.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java6
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 a8f6e71..cbab2d5 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 bcd95f3..46c6d25 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 9c68fcf..39e39ce 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 ee49226..34b6baf 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 6e513a5..2076c5f 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 420ab48..3d30124 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) {