Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2001-09-04 11:54:11 -0400
committerSilenio Quarti2001-09-04 11:54:11 -0400
commit4510458698a44cfe0ebb614544242955fbc20f7a (patch)
tree3abf251ed2feead5995d917b6ddd72b6cf400d4b /bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
parenta2b9bca1b2547b13d86917552eeb3b52c207b9e4 (diff)
downloadeclipse.platform.swt-4510458698a44cfe0ebb614544242955fbc20f7a.tar.gz
eclipse.platform.swt-4510458698a44cfe0ebb614544242955fbc20f7a.tar.xz
eclipse.platform.swt-4510458698a44cfe0ebb614544242955fbc20f7a.zip
ssq -codepage work
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c492
1 files changed, 489 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
index 3caada3798..feab06591d 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
@@ -15,6 +15,9 @@
#include <stdio.h>
#include <assert.h>
+#include <langinfo.h>
+#include <iconv.h>
+#include <stdlib.h>
JNIEXPORT int JNICALL Java_org_eclipse_swt_internal_motif_OS_getSharedLibraryMajorVersionNumber
(JNIEnv *env, jclass that)
@@ -5315,8 +5318,9 @@ JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_motif_OS_XmWidgetGetDis
* Method: XmbLookupString
* Signature: (ILorg/eclipse/swt/internal/motif/XInputEvent;[BI[I[I)I
*/
+/*
JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmbLookupString
- (JNIEnv *env, jclass that, jint widget, jobject event, jbyteArray string, jint size, jintArray keysym, jintArray status)
+ (JNIEnv *env, jclass that, jint ic, jobject event, jbyteArray string, jint size, jintArray keysym, jintArray status)
{
DECL_GLOB(pGlob)
XEvent xEvent, *lpxEvent=NULL;
@@ -5339,11 +5343,11 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmbLookupString
if (status)
status1 = (*env)->GetIntArrayElements(env, status, NULL);
- rc = (jint)XmImMbLookupString((Widget)widget, (XKeyPressedEvent *)lpxEvent, (char *)string1, size, (KeySym *)keysym1, (int *)status1);
+ rc = (jint)XmbLookupString((XIC)ic, (XKeyPressedEvent *)lpxEvent, (char *)string1, size, (KeySym *)keysym1, (int *)status1);
#ifdef PRINT_FAILED_RCODES
if (rc == 0)
- fprintf(stderr, "XmImMbLookupString: call failed rc = %d\n", rc);
+ fprintf(stderr, "XmbLookupString: call failed rc = %d\n", rc);
#endif
if (event) {
@@ -5357,6 +5361,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmbLookupString
(*env)->ReleaseIntArrayElements(env, status, status1, 0);
return rc;
}
+*/
/*
* Class: org_eclipse_swt_internal_motif_OS
@@ -8134,3 +8139,484 @@ JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XtRemoveInput
XtRemoveInput((XtInputId)id);
}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImGetXIC
+ * Signature: (II[II)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImGetXIC
+ (JNIEnv *env, jclass that, jint widget, jint input_policy, jintArray args, jint num_args)
+{
+ jint *args1=NULL;
+ jint rc;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImGetXIC\n");
+#endif
+ if (args)
+ args1 = (*env)->GetIntArrayElements(env, args, NULL);
+ rc = (jint) XmImGetXIC((Widget)widget, (XmInputPolicy)input_policy, (ArgList)args1, num_args);
+ if (args)
+ (*env)->ReleaseIntArrayElements(env, args, args1, 0);
+
+ return rc;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImGetXIM
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImGetXIM
+ (JNIEnv *env, jclass that, jint widget)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImGetXIM\n");
+#endif
+
+ return (jint) XmImGetXIM((Widget)widget);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImRegister
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImRegister
+ (JNIEnv *env, jclass that, jint widget, jint reserved)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImRegister\n");
+#endif
+
+ XmImRegister((Widget)widget, reserved);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImSetFocusValues
+ * Signature: (I[II)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImSetFocusValues
+ (JNIEnv *env, jclass that, jint widget, jintArray args, jint num_args)
+{
+ jint *args1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImSetFocusValues\n");
+#endif
+ if (args)
+ args1 = (*env)->GetIntArrayElements(env, args, NULL);
+ XmImSetFocusValues((Widget)widget, (ArgList)args1, num_args);
+ if (args)
+ (*env)->ReleaseIntArrayElements(env, args, args1, 0);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImVaSetFocusValues
+ * Signature: (IIIIIIIIII)I
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImVaSetFocusValues
+ (JNIEnv *env, jclass that, jint widget, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jint arg9)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImVaSetFocusValues\n");
+#endif
+ XmImVaSetFocusValues((Widget)widget, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImSetValues
+ * Signature: (I[II)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImSetValues
+ (JNIEnv *env, jclass that, jint widget, jintArray args, jint num_args)
+{
+ jint *args1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImSetValues\n");
+#endif
+ if (args)
+ args1 = (*env)->GetIntArrayElements(env, args, NULL);
+ XmImSetValues((Widget)widget, (ArgList)args1, num_args);
+ if (args)
+ (*env)->ReleaseIntArrayElements(env, args, args1, 0);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImUnregister
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImUnregister
+ (JNIEnv *env, jclass that, jint widget)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImUnregister\n");
+#endif
+
+ XmImUnregister((Widget)widget);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XmImUnsetFocus
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmImUnsetFocus
+ (JNIEnv *env, jclass that, jint widget)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XmImUnsetFocus\n");
+#endif
+
+ XmImUnsetFocus((Widget)widget);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XCreateIC
+ * Signature: (IIIIIIII)I
+ */
+/*
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XCreateIC
+ (JNIEnv *env, jclass that, jint im, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XCreateIC\n");
+#endif
+
+ return (jint)XCreateIC((XIM)im, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XSetICValues
+ * Signature: (IIII)I
+ */
+/*
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XSetICValues
+ (JNIEnv *env, jclass that, jint ic, jint arg1, jint arg2, jint arg3)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XSetICValues\n");
+#endif
+
+ return (jint)XSetICValues((XIC)ic, arg1, arg2, arg3);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XGetICValues
+ * Signature: (IIII)I
+ */
+/*
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XGetICValues
+ (JNIEnv *env, jclass that, jint ic, jint arg1, jint arg2, jint arg3)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XGetICValues\n");
+#endif
+
+ return (jint)XGetICValues((XIC)ic, arg1, arg2, arg3);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XSetICFocus
+ * Signature: (I)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XSetICFocus
+ (JNIEnv *env, jclass that, jint ic)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XSetICFocus\n");
+#endif
+
+ XSetICFocus((XIC)ic);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XUnsetICFocus
+ * Signature: (I)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XUnsetICFocus
+ (JNIEnv *env, jclass that, jint ic)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XUnsetICFocus\n");
+#endif
+
+ XUnsetICFocus((XIC)ic);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XGetIMValues
+ * Signature: (IIII)I
+ */
+/*
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XGetIMValues
+ (JNIEnv *env, jclass that, jint im, jint arg1, jint arg2, jint arg3)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XGetIMValues\n");
+#endif
+
+ return (jint)XGetIMValues((XIM)im, arg1, arg2, arg3);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: memmove
+ * Signature: (I[SI)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_memmove__I_3SI
+ (JNIEnv *env, jclass that, jint dest, jshortArray src, jint count)
+{
+ jshort *src1;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__I_3SI\n");
+#endif
+
+ /* don't do anything if src pointer is NULL */
+ if (src) {
+ src1 = (*env)->GetShortArrayElements(env, src, NULL);
+ memmove((void *)dest, (void *)src1, count);
+ (*env)->ReleaseShortArrayElements(env, src, src1, 0);
+ }
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: nl_langinfo
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_nl_1langinfo
+ (JNIEnv *env, jclass that, jint item)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "nl_langinfo\n");
+#endif
+
+ return (jint)nl_langinfo(item);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: iconv_open
+ * Signature: ([B[B)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_iconv_1open
+ (JNIEnv *env, jclass that, jbyteArray tocode, jbyteArray fromcode)
+{
+ jbyte *tocode1=NULL, *fromcode1=NULL;
+ jint result;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "iconv_open\n");
+#endif
+ if (tocode)
+ tocode1 = (*env)->GetByteArrayElements(env, tocode, NULL);
+ if (fromcode)
+ fromcode1 = (*env)->GetByteArrayElements(env, fromcode, NULL);
+ result = (jint)iconv_open(tocode1, fromcode1);
+ if (tocode)
+ (*env)->ReleaseByteArrayElements(env, tocode, tocode1, 0);
+ if (fromcode)
+ (*env)->ReleaseByteArrayElements(env, fromcode, fromcode1, 0);
+
+ return result;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: iconv_close
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_iconv_1close
+ (JNIEnv *env, jclass that, jint cd)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "iconv_close\n");
+#endif
+
+ return (jint)iconv_close((iconv_t)cd);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: iconv
+ * Signature: (I[BI[BI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_iconv
+ (JNIEnv *env, jclass that, jint cd, jintArray inBuf, jintArray inBytesLeft, jintArray outBuf, jintArray outBytesLeft)
+{
+ jint *inBuf1=NULL, *outBuf1=NULL, *inBytesLeft1=NULL, *outBytesLeft1=NULL;
+ jint result;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "iconv\n");
+#endif
+ if (inBuf)
+ inBuf1 = (*env)->GetIntArrayElements(env, inBuf, NULL);
+ if (outBuf)
+ outBuf1 = (*env)->GetIntArrayElements(env, outBuf, NULL);
+ if (inBytesLeft)
+ inBytesLeft1 = (*env)->GetIntArrayElements(env, inBytesLeft, NULL);
+ if (outBytesLeft)
+ outBytesLeft1 = (*env)->GetIntArrayElements(env, outBytesLeft, NULL);
+ result = (jint)iconv((iconv_t)cd, (void *)inBuf1, (size_t *)inBytesLeft1, (char **)outBuf1, (size_t *)outBytesLeft1);
+ if (inBuf)
+ (*env)->ReleaseIntArrayElements(env, inBuf, inBuf1, 0);
+ if (outBuf)
+ (*env)->ReleaseIntArrayElements(env, outBuf, outBuf1, 0);
+ if (inBytesLeft)
+ (*env)->ReleaseIntArrayElements(env, inBytesLeft, inBytesLeft1, 0);
+ if (outBytesLeft)
+ (*env)->ReleaseIntArrayElements(env, outBytesLeft, outBytesLeft1, 0);
+ return result;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: MB_1CUR_1MAX
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_MB_1CUR_1MAX
+ (JNIEnv *env, jclass that)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "MB_1CUR_1MAX\n");
+#endif
+
+ return (jint)MB_CUR_MAX;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: memmove
+ * Signature: ([CII)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_memmove___3CII
+ (JNIEnv *env, jclass that, jcharArray dest, jint src, jint count)
+{
+ jchar *dest1;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove___3CII\n");
+#endif
+
+ if (dest) {
+ dest1 = (*env)->GetCharArrayElements(env, dest, NULL);
+ memmove((void *)dest1, (void *)src, count);
+ (*env)->ReleaseCharArrayElements(env, dest, dest1, 0);
+ }
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: memmove
+ * Signature: (I[CI)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_memmove__I_3CI
+ (JNIEnv *env, jclass that, jint dest, jcharArray src, jint count)
+{
+ jchar *src1;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__I_3CI\n");
+#endif
+
+ if (src) {
+ int i;
+ unsigned char *dest1 = (unsigned char *)dest;
+ src1 = (*env)->GetCharArrayElements(env, src, NULL);
+ memmove((void *)dest, (void *)src1, count);
+ (*env)->ReleaseCharArrayElements(env, src, src1, 0);
+ }
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XCreateFontSet
+ * Signature: (I[B[I[I[I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XCreateFontSet
+ (JNIEnv *env, jclass that, jint display, jbyteArray base_font_name_list, jintArray missing_charset_list_return, jintArray missing_charset_count_return, jintArray def_string_return)
+{
+ jbyte *base_font_name_list1=NULL;
+ jint *missing_charset_list_return1=NULL, *missing_charset_count_return1=NULL, *def_string_return1=NULL;
+ jint result;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XCreateFontSet\n");
+#endif
+ if (base_font_name_list)
+ base_font_name_list1 = (*env)->GetByteArrayElements(env, base_font_name_list, NULL);
+ if (missing_charset_list_return)
+ missing_charset_list_return1 = (*env)->GetIntArrayElements(env, missing_charset_list_return, NULL);
+ if (missing_charset_count_return)
+ missing_charset_count_return1 = (*env)->GetIntArrayElements(env, missing_charset_count_return, NULL);
+ if (def_string_return)
+ def_string_return1 = (*env)->GetIntArrayElements(env, def_string_return, NULL);
+ result = (jint)XCreateFontSet((Display *)display, (char *)base_font_name_list1, (char ***)missing_charset_list_return1, (int *)missing_charset_count_return1, (char **)def_string_return1);
+ if (base_font_name_list)
+ (*env)->ReleaseByteArrayElements(env, base_font_name_list, base_font_name_list1, 0);
+ if (missing_charset_list_return)
+ (*env)->ReleaseIntArrayElements(env, missing_charset_list_return, missing_charset_list_return1, 0);
+ if (missing_charset_count_return)
+ (*env)->ReleaseIntArrayElements(env, missing_charset_count_return, missing_charset_count_return1, 0);
+ if (def_string_return)
+ (*env)->ReleaseIntArrayElements(env, def_string_return, def_string_return1, 0);
+ return result;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: XLocaleOfFontSet
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XLocaleOfFontSet
+ (JNIEnv *env, jclass that, jint fontSet)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "XLocaleOfFontSet\n");
+#endif
+
+ return (jint)XLocaleOfFontSet((XFontSet)fontSet);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_motif_OS
+ * Method: setlocale
+ * Signature: (I[B)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_setlocale
+ (JNIEnv *env, jclass that, int category, jbyteArray locale)
+{
+ jbyte *locale1=NULL;
+ jint rc;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "setlocale\n");
+#endif
+
+ if (locale)
+ locale1 = (*env)->GetByteArrayElements(env, locale, NULL);
+ rc = (jint) setlocale(category, (char *)locale1);
+ if (locale)
+ (*env)->ReleaseByteArrayElements(env, locale, locale1, 0);
+
+ return rc;
+} \ No newline at end of file

Back to the top