diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-01 11:14:15 -0400 |
---|---|---|
committer | Arun Thondapu <arunkumar.thondapu@in.ibm.com> | 2012-08-03 22:58:20 +0530 |
commit | 195c35fb4aaf6777b97d64fa53ba79208d6d54ee (patch) | |
tree | 632df079706f08fc234f5b8c8926b6e352e30723 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk | |
parent | 165a14baa4f28638048d0b616f73e1b86413e4a2 (diff) | |
download | eclipse.platform.swt-195c35fb4aaf6777b97d64fa53ba79208d6d54ee.tar.gz eclipse.platform.swt-195c35fb4aaf6777b97d64fa53ba79208d6d54ee.tar.xz eclipse.platform.swt-195c35fb4aaf6777b97d64fa53ba79208d6d54ee.zip |
Use gtk_widget_get_allocation in newer GTK+
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
5 files changed, 56 insertions, 2 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 266b466b85..8098b20651 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 @@ -18308,6 +18308,28 @@ JNIEXPORT void JNICALL OS_NATIVE(gdk_1threads_1set_1lock_1functions) } #endif +#ifndef NO_gtk_1widget_1get_1allocation +JNIEXPORT void JNICALL OS_NATIVE(gtk_1widget_1get_1allocation) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + GtkAllocation _arg1, *lparg1=NULL; + OS_NATIVE_ENTER(env, that, gtk_1widget_1get_1allocation_FUNC); + if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail; +/* + gtk_widget_get_allocation(arg0, (GtkAllocation *)lparg1); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_allocation) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, GtkAllocation *))fp)(arg0, (GtkAllocation *)lparg1); + } + } +fail: + if (arg1 && lparg1) setGtkAllocationFields(env, arg1, lparg1); + OS_NATIVE_EXIT(env, that, gtk_1widget_1get_1allocation_FUNC); +} +#endif + #ifndef NO_localeconv_1decimal_1point JNIEXPORT jintLong JNICALL OS_NATIVE(localeconv_1decimal_1point) (JNIEnv *env, jclass that) 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 67b65566a5..12e59d11e7 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 @@ -202,6 +202,7 @@ #define gtk_window_set_opacity_LIB LIB_GTK #define gtk_window_set_skip_taskbar_hint_LIB LIB_GTK #define gtk_widget_is_composited_LIB LIB_GTK +#define gtk_widget_get_allocation_LIB LIB_GTK #define gtk_widget_get_tooltip_text_LIB LIB_GTK #define gtk_widget_has_default_LIB LIB_GTK #define gtk_widget_set_tooltip_text_LIB LIB_GTK @@ -382,15 +383,27 @@ #ifndef GTK_OBJECT_FLAGS #define GTK_OBJECT_FLAGS(arg0) 0 #endif +#if GTK_CHECK_VERSION(2,18,0) +#define GTK_WIDGET_HEIGHT(arg0) 0 +#else #define GTK_WIDGET_HEIGHT(arg0) (arg0)->allocation.height +#endif #define GTK_WIDGET_SET_HEIGHT(arg0, arg1) (arg0)->allocation.height = arg1 #ifndef GTK_WIDGET_MAPPED #define GTK_WIDGET_MAPPED(arg0) 0 #endif +#if GTK_CHECK_VERSION(2,18,0) +#define GTK_WIDGET_WIDTH(arg0) 0 +#else #define GTK_WIDGET_WIDTH(arg0) (arg0)->allocation.width +#endif #define GTK_WIDGET_SET_WIDTH(arg0, arg1) (arg0)->allocation.width = arg1 #define GTK_WIDGET_WINDOW(arg0) (arg0)->window +#if GTK_CHECK_VERSION(2,18,0) +#define GTK_WIDGET_X(arg0) 0 +#else #define GTK_WIDGET_X(arg0) (arg0)->allocation.x +#endif #define GTK_WIDGET_SET_X(arg0, arg1) (arg0)->allocation.x = arg1 #define GTK_ENTRY_IM_CONTEXT(arg0) (arg0)->im_context #define GTK_TEXTVIEW_IM_CONTEXT(arg0) (arg0)->im_context @@ -405,7 +418,11 @@ #else #define GTK_TOOLTIPS_GET_TIP_TEXT(arg0) (arg0)->tip_text #endif +#if GTK_CHECK_VERSION(2,18,0) +#define GTK_WIDGET_Y(arg0) 0 +#else #define GTK_WIDGET_Y(arg0) ((GtkWidget *)arg0)->allocation.y +#endif #define GTK_WIDGET_SET_Y(arg0, arg1) (arg0)->allocation.y = arg1 #define GTK_WIDGET_REQUISITION_WIDTH(arg0) (arg0)->requisition.width #define GTK_WIDGET_REQUISITION_HEIGHT(arg0) (arg0)->requisition.height 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 579ba0029a..ee9407c878 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 = 1329; -int OS_nativeFunctionCallCount[1329]; +int OS_nativeFunctionCount = 1330; +int OS_nativeFunctionCallCount[1330]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -1446,6 +1446,7 @@ char * OS_nativeFunctionNames[] = { "gdk_1threads_1init", "gdk_1threads_1leave", "gdk_1threads_1set_1lock_1functions", + "gtk_1widget_1get_1allocation", "localeconv_1decimal_1point", #ifndef JNI64 "memmove__ILorg_eclipse_swt_internal_gtk_GInterfaceInfo_2I", 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 b0e3596a81..942c86578a 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 @@ -1454,6 +1454,7 @@ typedef enum { gdk_1threads_1init_FUNC, gdk_1threads_1leave_FUNC, gdk_1threads_1set_1lock_1functions_FUNC, + gtk_1widget_1get_1allocation_FUNC, localeconv_1decimal_1point_FUNC, #ifndef JNI64 memmove__ILorg_eclipse_swt_internal_gtk_GInterfaceInfo_2I_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 1b09c73484..4e9374deaf 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 @@ -12269,6 +12269,19 @@ public static final int /*long*/ gtk_widget_get_parent_window(int /*long*/ widge lock.unlock(); } } +/** + * @method flags=dynamic + * @param allocation cast=(GtkAllocation *),flags=no_in + * */ +public static final native void gtk_widget_get_allocation (int /*long*/ widget, GtkAllocation allocation); +public static final void _gtk_widget_get_allocation (int /*long*/ widget, int /*long*/ allocation) { + lock.lock(); + try { + _gtk_widget_get_allocation (widget, allocation); + } finally { + lock.unlock(); + } +} /** @param widget cast=(GtkWidget *) */ public static final native int /*long*/ _gtk_widget_get_style(int /*long*/ widget); public static final int /*long*/ gtk_widget_get_style(int /*long*/ widget) { |