diff options
author | Steve Northover <steve> | 2001-12-06 17:04:52 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2001-12-06 17:04:52 +0000 |
commit | bda40c2136397091c0c6b06cbdfc4de3549df904 (patch) | |
tree | 01587f10c6d52cf46c92b94fc7960fe5563df0b4 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x | |
parent | a2e7671578631a2088ff4cd6615b80148c4d645a (diff) | |
download | eclipse.platform.swt-bda40c2136397091c0c6b06cbdfc4de3549df904.tar.gz eclipse.platform.swt-bda40c2136397091c0c6b06cbdfc4de3549df904.tar.xz eclipse.platform.swt-bda40c2136397091c0c6b06cbdfc4de3549df904.zip |
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/library/swt.c | 28 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java | 22 |
2 files changed, 34 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/library/swt.c index 63714d561b..11c92f905f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/library/swt.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/library/swt.c @@ -36,7 +36,7 @@ JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1default_1han fprintf(stderr, "g_log_default_handler"); #endif - g_log_default_handler((gchar *)log_domain, (GLogLevelFlags)log_levels, (gchar *) message, (gpointer) unused_data); + g_log_default_handler((gchar *)log_domain, (GLogLevelFlags)log_levels, (gchar *)message, (gpointer)unused_data); } /* @@ -45,13 +45,23 @@ JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1default_1han * Signature: */ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1set_1handler - (JNIEnv *env, jclass that, jint log_domain, jint log_levels, jint log_func, jint user_data) + (JNIEnv *env, jclass that, jbyteArray log_domain, jint log_levels, jint log_func, jint user_data) { + jint rc; + jbyte *log_domain1 = NULL; + #ifdef DEBUG_CALL_PRINTS fprintf(stderr, "g_log_set_handler"); #endif - return g_log_set_handler((gchar *)log_domain, (GLogLevelFlags)log_levels, (GLogFunc) log_func, (gpointer) user_data); + if (log_domain) { + log_domain1 = (*env)->GetByteArrayElements(env, log_domain, NULL); + } + rc = (jint) g_log_set_handler((gchar *)log_domain1, (GLogLevelFlags)log_levels, (GLogFunc) log_func, (gpointer) user_data); + if (log_domain) { + (*env)->ReleaseByteArrayElements(env, log_domain, log_domain1, 0); + } + return rc; } /* @@ -60,13 +70,21 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1set_1handler * Signature: */ JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_gtk_OS_g_1log_1remove_1handler - (JNIEnv *env, jclass that, jint log_domain, jint handler_id) + (JNIEnv *env, jclass that, jbyteArray log_domain, jint handler_id) { + jbyte *log_domain1 = NULL; + #ifdef DEBUG_CALL_PRINTS fprintf(stderr, "g_log_remove_handler"); #endif - g_log_remove_handler((gchar *)log_domain, handler_id); + if (log_domain) { + log_domain1 = (*env)->GetByteArrayElements(env, log_domain, NULL); + } + g_log_remove_handler((gchar *)log_domain1, handler_id); + if (log_domain) { + (*env)->ReleaseByteArrayElements(env, log_domain, log_domain1, 0); + } } /* diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java index 711634b35a..7d4e535bb9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java @@ -214,15 +214,15 @@ public class OS { public static final int GTK_TOOLBAR_CHILD_RADIOBUTTON = 3; public static final int GTK_TOOLBAR_CHILD_WIDGET = 4; -public static final int G_LOG_FLAG_RECURSION = 1 << 0; -public static final int G_LOG_FLAG_FATAL = 1 << 1; -public static final int G_LOG_LEVEL_ERROR = 1 << 2; -public static final int G_LOG_LEVEL_CRITICAL = 1 << 3; -public static final int G_LOG_LEVEL_WARNING = 1 << 4; -public static final int G_LOG_LEVEL_MESSAGE = 1 << 5; -public static final int G_LOG_LEVEL_INFO = 1 << 6; -public static final int G_LOG_LEVEL_DEBUG = 1 << 7; -public static final int G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL); +//public static final int G_LOG_FLAG_RECURSION = 1 << 0; +//public static final int G_LOG_FLAG_FATAL = 1 << 1; +//public static final int G_LOG_LEVEL_ERROR = 1 << 2; +//public static final int G_LOG_LEVEL_CRITICAL = 1 << 3; +//public static final int G_LOG_LEVEL_WARNING = 1 << 4; +//public static final int G_LOG_LEVEL_MESSAGE = 1 << 5; +//public static final int G_LOG_LEVEL_INFO = 1 << 6; +//public static final int G_LOG_LEVEL_DEBUG = 1 << 7; +//public static final int G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL); public static final native int GTK_WIDGET_FLAGS(int wid); public static final native void GTK_WIDGET_SET_FLAGS(int wid,int flag); @@ -241,8 +241,8 @@ public static final native void gtk_object_unref(int object); public static final native void gtk_object_destroy(int object); public static final native int GTK_WIDGET_TYPE(int wid); public static final native int gtk_label_get_type(); -public static final native int g_log_set_handler(int log_domain, int log_levels, int log_func, int user_data); -public static final native void g_log_remove_handler(int log_domain, int handler_id); +public static final native int g_log_set_handler(byte [] log_domain, int log_levels, int log_func, int user_data); +public static final native void g_log_remove_handler(byte [] log_domain, int handler_id); public static final native void g_log_default_handler(int log_domain, int log_levels, int message, int unused_data); public static final native void g_free(int mem); |