diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-29 11:13:23 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-08-29 11:13:23 -0400 |
commit | 4bdac05ae8eee391095a93c6f563c8900c32be2f (patch) | |
tree | 6e7491aec693c7b52303089d93e7c6f058f2c597 | |
parent | 742806238aa69633cd6fc8812a666523c4c7585d (diff) | |
download | eclipse.platform.swt-4bdac05ae8eee391095a93c6f563c8900c32be2f.tar.gz eclipse.platform.swt-4bdac05ae8eee391095a93c6f563c8900c32be2f.tar.xz eclipse.platform.swt-4bdac05ae8eee391095a93c6f563c8900c32be2f.zip |
Use gtk_scale_new() in Gtk+3gtk3_scale_new
6 files changed, 80 insertions, 6 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 90c1ebac16..557ba544aa 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 @@ -9469,7 +9469,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1hscale_1new) { jintLong rc = 0; OS_NATIVE_ENTER(env, that, _1gtk_1hscale_1new_FUNC); +/* rc = (jintLong)gtk_hscale_new((GtkAdjustment *)arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_hscale_new) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkAdjustment *))fp)((GtkAdjustment *)arg0); + } + } OS_NATIVE_EXIT(env, that, _1gtk_1hscale_1new_FUNC); return rc; } @@ -12317,6 +12325,26 @@ fail: } #endif +#ifndef NO__1gtk_1scale_1new +JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1scale_1new) + (JNIEnv *env, jclass that, jint arg0, jintLong arg1) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1scale_1new_FUNC); +/* + rc = (jintLong)gtk_scale_new((GtkOrientation)arg0, (GtkAdjustment *)arg1); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_scale_new) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkOrientation, GtkAdjustment *))fp)((GtkOrientation)arg0, (GtkAdjustment *)arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1scale_1new_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1scale_1set_1digits JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1scale_1set_1digits) (JNIEnv *env, jclass that, jintLong arg0, jint arg1) @@ -15395,7 +15423,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1vscale_1new) { jintLong rc = 0; OS_NATIVE_ENTER(env, that, _1gtk_1vscale_1new_FUNC); +/* rc = (jintLong)gtk_vscale_new((GtkAdjustment *)arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_vscale_new) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkAdjustment *))fp)((GtkAdjustment *)arg0); + } + } OS_NATIVE_EXIT(env, that, _1gtk_1vscale_1new_FUNC); return rc; } 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 09073e9c3e..bcb12f683d 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 @@ -187,6 +187,9 @@ #define gdk_pixbuf_render_to_drawable_LIB LIB_GDK #define gtk_scrolled_window_get_hscrollbar_LIB LIB_GTK #define gtk_scrolled_window_get_vscrollbar_LIB LIB_GTK +#define gtk_scale_new_LIB LIB_GTK +#define gtk_hscale_new_LIB LIB_GTK +#define gtk_vscale_new_LIB LIB_GTK #define gtk_status_icon_get_geometry_LIB LIB_GTK #define gtk_status_icon_get_visible_LIB LIB_GTK #define gtk_status_icon_new_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 119f1c66aa..7b81c8725e 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 = 1335; -int OS_nativeFunctionCallCount[1335]; +int OS_nativeFunctionCount = 1336; +int OS_nativeFunctionCallCount[1336]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -938,6 +938,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1rc_1style_1set_1color_1flags", "_1gtk_1rc_1style_1set_1fg", "_1gtk_1rc_1style_1set_1text", + "_1gtk_1scale_1new", "_1gtk_1scale_1set_1digits", "_1gtk_1scale_1set_1draw_1value", "_1gtk_1scrolled_1window_1add_1with_1viewport", 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 20250dbe2b..c1b03292b7 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 @@ -946,6 +946,7 @@ typedef enum { _1gtk_1rc_1style_1set_1color_1flags_FUNC, _1gtk_1rc_1style_1set_1fg_FUNC, _1gtk_1rc_1style_1set_1text_FUNC, + _1gtk_1scale_1new_FUNC, _1gtk_1scale_1set_1digits_FUNC, _1gtk_1scale_1set_1draw_1value_FUNC, _1gtk_1scrolled_1window_1add_1with_1viewport_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 c2310b7878..bb5484f54b 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 @@ -7129,7 +7129,10 @@ public static final int /*long*/ gtk_hbox_new(boolean homogeneous, int spacing) lock.unlock(); } } -/** @param adjustment cast=(GtkAdjustment *) */ +/** + * @method flags=dynamic + * @param adjustment cast=(GtkAdjustment *) + */ public static final native int /*long*/ _gtk_hscale_new(int /*long*/ adjustment); public static final int /*long*/ gtk_hscale_new(int /*long*/ adjustment) { lock.lock(); @@ -7139,6 +7142,20 @@ public static final int /*long*/ gtk_hscale_new(int /*long*/ adjustment) { lock.unlock(); } } +/** + * @method flags=dynamic + * @param orientation cast=(GtkOrientation) + * @param adjustment cast=(GtkAdjustment *) + */ +public static final native int /*long*/ _gtk_scale_new(int orientation, int /*long*/ adjustment); +public static final int /*long*/ gtk_scale_new(int orientation, int /*long*/ adjustment) { + lock.lock(); + try { + return _gtk_scale_new(orientation, adjustment); + } finally { + lock.unlock(); + } +} /** @param adjustment cast=(GtkAdjustment *) */ public static final native int /*long*/ _gtk_hscrollbar_new(int /*long*/ adjustment); public static final int /*long*/ gtk_hscrollbar_new(int /*long*/ adjustment) { @@ -12046,7 +12063,10 @@ public static final void gtk_viewport_set_shadow_type(int /*long*/ viewport, int lock.unlock(); } } -/** @param adjustment cast=(GtkAdjustment *) */ +/** + * @method flags=dynamic + * @param adjustment cast=(GtkAdjustment *) + */ public static final native int /*long*/ _gtk_vscale_new(int /*long*/ adjustment); public static final int /*long*/ gtk_vscale_new(int /*long*/ adjustment) { lock.lock(); 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 79d7416dd9..2218cbcf9e 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 @@ -129,9 +129,9 @@ void createHandle (int index) { int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0); if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES); if ((style & SWT.HORIZONTAL) != 0) { - handle = OS.gtk_hscale_new (hAdjustment); + handle = gtk_scale_new (OS.GTK_ORIENTATION_HORIZONTAL, hAdjustment); } else { - handle = OS.gtk_vscale_new (hAdjustment); + handle = gtk_scale_new (OS.GTK_ORIENTATION_VERTICAL, hAdjustment); } if (handle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_container_add (fixedHandle, handle); @@ -373,4 +373,17 @@ public void setSelection (int value) { OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); } +int /*long*/ gtk_scale_new (int orientation, int /*long*/ adjustment) { + int /*long*/ scale = 0; + if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + scale = OS.gtk_scale_new (orientation, adjustment); + } else { + if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) { + scale = OS.gtk_hscale_new (adjustment); + } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) { + scale = OS.gtk_vscale_new (adjustment); + } + } + return scale; +} } |