diff options
author | Carolyn MacLeod | 2006-10-30 18:13:36 +0000 |
---|---|---|
committer | Carolyn MacLeod | 2006-10-30 18:13:36 +0000 |
commit | eaeb7bbe46dba500679bc288dadf0f9abee06e5e (patch) | |
tree | 86ced64746c10927c8728ba6161f363b6c4da277 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk | |
parent | a4a164acbb72cc94d3eedf493ed2dca4fdf5a5c1 (diff) | |
download | eclipse.platform.swt-eaeb7bbe46dba500679bc288dadf0f9abee06e5e.tar.gz eclipse.platform.swt-eaeb7bbe46dba500679bc288dadf0f9abee06e5e.tar.xz eclipse.platform.swt-eaeb7bbe46dba500679bc288dadf0f9abee06e5e.zip |
make calendar run on older versions of gtk
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
5 files changed, 41 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 c9252283ca..c29d19557f 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 @@ -5946,6 +5946,32 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1button_1set_1relief) } #endif +#ifndef NO__1gtk_1calendar_1display_1options +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1calendar_1display_1options) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1calendar_1display_1options_FUNC); +/* + gtk_calendar_display_options((GtkCalendar *)arg0, (GtkCalendarDisplayOptions)arg1); +*/ + { + static int initialized = 0; + static void *handle = NULL; + typedef void (*FPTR)(GtkCalendar *, GtkCalendarDisplayOptions); + static FPTR fptr; + if (!initialized) { + if (!handle) handle = dlopen(gtk_calendar_display_options_LIB, RTLD_LAZY); + if (handle) fptr = (FPTR)dlsym(handle, "gtk_calendar_display_options"); + initialized = 1; + } + if (fptr) { + (*fptr)((GtkCalendar *)arg0, (GtkCalendarDisplayOptions)arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1calendar_1display_1options_FUNC); +} +#endif + #ifndef NO__1gtk_1calendar_1get_1date JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1calendar_1get_1date) (JNIEnv *env, jclass that, jint arg0, jintArray arg1, jintArray arg2, jintArray arg3) @@ -17385,3 +17411,4 @@ JNIEXPORT jint JNICALL OS_NATIVE(strlen) return rc; } #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 e5b1630e06..5317befed6 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 @@ -36,6 +36,7 @@ #define XRenderFreePicture_LIB "libXrender.so" #define XRenderSetPictureClipRectangles_LIB "libXrender.so" #define XRenderSetPictureTransform_LIB "libXrender.so" +#define gtk_calendar_display_options_LIB "libgtk-x11-2.0.so.0" #define gtk_calendar_get_date_LIB "libgtk-x11-2.0.so.0" #define gtk_calendar_new_LIB "libgtk-x11-2.0.so.0" #define gtk_calendar_select_day_LIB "libgtk-x11-2.0.so.0" 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 421b9bb43b..c140fd96c0 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 = 1208; -int OS_nativeFunctionCallCount[1208]; +int OS_nativeFunctionCount = 1209; +int OS_nativeFunctionCallCount[1209]; char * OS_nativeFunctionNames[] = { "Call", "GDK_1EVENT_1TYPE", @@ -458,6 +458,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1button_1get_1relief", "_1gtk_1button_1new", "_1gtk_1button_1set_1relief", + "_1gtk_1calendar_1display_1options", "_1gtk_1calendar_1get_1date", "_1gtk_1calendar_1new", "_1gtk_1calendar_1select_1day", 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 f9df8c92c7..b1730b7d52 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 @@ -462,6 +462,7 @@ typedef enum { _1gtk_1button_1get_1relief_FUNC, _1gtk_1button_1new_FUNC, _1gtk_1button_1set_1relief_FUNC, + _1gtk_1calendar_1display_1options_FUNC, _1gtk_1calendar_1get_1date_FUNC, _1gtk_1calendar_1new_FUNC, _1gtk_1calendar_1select_1day_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 63b367eeea..13f6e401f9 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 @@ -3825,6 +3825,15 @@ public static final void gtk_calendar_set_display_options(int /*long*/ calendar, lock.unlock(); } } +public static final native void _gtk_calendar_display_options(int /*long*/ calendar, int flags); +public static final void gtk_calendar_display_options(int /*long*/ calendar, int flags) { + lock.lock(); + try { + _gtk_calendar_display_options(calendar, flags); + } finally { + lock.unlock(); + } +} public static final native void _gtk_calendar_get_date(int /*long*/ calendar, int[] year, int[] month, int[] day); public static final void gtk_calendar_get_date(int /*long*/ calendar, int[] year, int[] month, int[] day) { lock.lock(); |