diff options
author | Grant Gayed <ggayed> | 2007-01-19 18:05:46 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2007-01-19 18:05:46 +0000 |
commit | d16e3234bf6b49749d806c7ce517cfe696d0f788 (patch) | |
tree | 1c65b4bfe715c649df568ba7fba3a0dca35e24cf /bundles/org.eclipse.swt/Eclipse SWT PI/photon | |
parent | 2de0960dd8faf7f3599ce23bdccc45ab7c4111e6 (diff) | |
download | eclipse.platform.swt-d16e3234bf6b49749d806c7ce517cfe696d0f788.tar.gz eclipse.platform.swt-d16e3234bf6b49749d806c7ce517cfe696d0f788.tar.xz eclipse.platform.swt-d16e3234bf6b49749d806c7ce517cfe696d0f788.zip |
add C class
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/photon')
5 files changed, 4 insertions, 161 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/make_qnx.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/make_qnx.mak index c8f0b84d1c..55bcd9eadb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/make_qnx.mak +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/make_qnx.mak @@ -27,7 +27,7 @@ SWT_LIB=lib$(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so CFLAGS = -c -shared -O2 -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_STATS) -w8 $(SWT_DEBUG) -DPHOTON -I$(IVE_HOME)/include LFLAGS = -shared -lph -lphrender -lPtWeb -SWT_OBJS = swt.o os.o os_structs.o os_custom.o os_stats.o callback.o +SWT_OBJS = swt.o c.o c_stats.o os.o os_structs.o os_custom.o os_stats.o callback.o all: $(SWT_LIB) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os.c index fde3fcccb0..244390de18 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os.c @@ -3391,16 +3391,6 @@ JNIEXPORT void JNICALL OS_NATIVE(PtWindowToFront) } #endif -#ifndef NO_free -JNIEXPORT void JNICALL OS_NATIVE(free) - (JNIEnv *env, jclass that, jint arg0) -{ - OS_NATIVE_ENTER(env, that, free_FUNC); - free((void *)arg0); - OS_NATIVE_EXIT(env, that, free_FUNC); -} -#endif - #ifndef NO_getenv JNIEXPORT jint JNICALL OS_NATIVE(getenv) (JNIEnv *env, jclass that, jbyteArray arg0) @@ -3417,28 +3407,6 @@ fail: } #endif -#ifndef NO_malloc -JNIEXPORT jint JNICALL OS_NATIVE(malloc) - (JNIEnv *env, jclass that, jint arg0) -{ - jint rc = 0; - OS_NATIVE_ENTER(env, that, malloc_FUNC); - rc = (jint)malloc((size_t)arg0); - OS_NATIVE_EXIT(env, that, malloc_FUNC); - return rc; -} -#endif - -#ifndef NO_memmove__III -JNIEXPORT void JNICALL OS_NATIVE(memmove__III) - (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2) -{ - OS_NATIVE_ENTER(env, that, memmove__III_FUNC); - memmove((void *)arg0, (const void *)arg1, arg2); - OS_NATIVE_EXIT(env, that, memmove__III_FUNC); -} -#endif - #ifndef NO_memmove__ILorg_eclipse_swt_internal_photon_PgAlpha_1t_2I JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_photon_PgAlpha_1t_2I) (JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2) @@ -3582,34 +3550,6 @@ fail: } #endif -#ifndef NO_memmove__I_3BI -JNIEXPORT void JNICALL OS_NATIVE(memmove__I_3BI) - (JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jint arg2) -{ - jbyte *lparg1=NULL; - OS_NATIVE_ENTER(env, that, memmove__I_3BI_FUNC); - if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; - memmove((void *)arg0, (const void *)lparg1, arg2); -fail: - if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, JNI_ABORT); - OS_NATIVE_EXIT(env, that, memmove__I_3BI_FUNC); -} -#endif - -#ifndef NO_memmove__I_3II -JNIEXPORT void JNICALL OS_NATIVE(memmove__I_3II) - (JNIEnv *env, jclass that, jint arg0, jintArray arg1, jint arg2) -{ - jint *lparg1=NULL; - OS_NATIVE_ENTER(env, that, memmove__I_3II_FUNC); - if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; - memmove((void *)arg0, (const void *)lparg1, arg2); -fail: - if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, JNI_ABORT); - OS_NATIVE_EXIT(env, that, memmove__I_3II_FUNC); -} -#endif - #ifndef NO_memmove__Lorg_eclipse_swt_internal_photon_FontDetails_2II JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_photon_FontDetails_2II) (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2) @@ -3862,20 +3802,6 @@ fail: } #endif -#ifndef NO_memmove___3BII -JNIEXPORT void JNICALL OS_NATIVE(memmove___3BII) - (JNIEnv *env, jclass that, jbyteArray arg0, jint arg1, jint arg2) -{ - jbyte *lparg0=NULL; - OS_NATIVE_ENTER(env, that, memmove___3BII_FUNC); - if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail; - memmove((void *)lparg0, (const void *)arg1, (size_t)arg2); -fail: - if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); - OS_NATIVE_EXIT(env, that, memmove___3BII_FUNC); -} -#endif - #ifndef NO_memmove___3BLorg_eclipse_swt_internal_photon_PhClipHeader_2I JNIEXPORT void JNICALL OS_NATIVE(memmove___3BLorg_eclipse_swt_internal_photon_PhClipHeader_2I) (JNIEnv *env, jclass that, jbyteArray arg0, jobject arg1, jint arg2) @@ -3893,44 +3819,6 @@ fail: } #endif -#ifndef NO_memmove___3III -JNIEXPORT void JNICALL OS_NATIVE(memmove___3III) - (JNIEnv *env, jclass that, jintArray arg0, jint arg1, jint arg2) -{ - jint *lparg0=NULL; - OS_NATIVE_ENTER(env, that, memmove___3III_FUNC); - if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail; - memmove((void *)lparg0, (const void *)arg1, arg2); -fail: - if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0); - OS_NATIVE_EXIT(env, that, memmove___3III_FUNC); -} -#endif - -#ifndef NO_memmove___3SII -JNIEXPORT void JNICALL OS_NATIVE(memmove___3SII) - (JNIEnv *env, jclass that, jshortArray arg0, jint arg1, jint arg2) -{ - jshort *lparg0=NULL; - OS_NATIVE_ENTER(env, that, memmove___3SII_FUNC); - if (arg0) if ((lparg0 = (*env)->GetShortArrayElements(env, arg0, NULL)) == NULL) goto fail; - memmove((void *)lparg0, (const void *)arg1, (size_t)arg2); -fail: - if (arg0 && lparg0) (*env)->ReleaseShortArrayElements(env, arg0, lparg0, 0); - OS_NATIVE_EXIT(env, that, memmove___3SII_FUNC); -} -#endif - -#ifndef NO_memset -JNIEXPORT void JNICALL OS_NATIVE(memset) - (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2) -{ - OS_NATIVE_ENTER(env, that, memset_FUNC); - memset((void *)arg0, arg1, (size_t)arg2); - OS_NATIVE_EXIT(env, that, memset_FUNC); -} -#endif - #ifndef NO_strdup JNIEXPORT jint JNICALL OS_NATIVE(strdup) (JNIEnv *env, jclass that, jint arg0) @@ -3943,18 +3831,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(strdup) } #endif -#ifndef NO_strlen -JNIEXPORT jint JNICALL OS_NATIVE(strlen) - (JNIEnv *env, jclass that, jint arg0) -{ - jint rc = 0; - OS_NATIVE_ENTER(env, that, strlen_FUNC); - rc = (jint)strlen((const char*)arg0); - OS_NATIVE_EXIT(env, that, strlen_FUNC); - return rc; -} -#endif - #ifndef NO_uname JNIEXPORT jint JNICALL OS_NATIVE(uname) (JNIEnv *env, jclass that, jobject arg0) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.c index ebc0bfbf30..e089193017 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.c @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 287; -int OS_nativeFunctionCallCount[287]; +int OS_nativeFunctionCount = 277; +int OS_nativeFunctionCallCount[277]; char * OS_nativeFunctionNames[] = { "PfDecomposeStemToID", "PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2III", @@ -261,10 +261,7 @@ char * OS_nativeFunctionNames[] = { "PtWindowGetState", "PtWindowToBack", "PtWindowToFront", - "free", "getenv", - "malloc", - "memmove__III", "memmove__ILorg_eclipse_swt_internal_photon_PgAlpha_1t_2I", "memmove__ILorg_eclipse_swt_internal_photon_PhArea_1t_2I", "memmove__ILorg_eclipse_swt_internal_photon_PhCursorDef_1t_2I", @@ -276,8 +273,6 @@ char * OS_nativeFunctionNames[] = { "memmove__ILorg_eclipse_swt_internal_photon_PhTile_1t_2I", "memmove__ILorg_eclipse_swt_internal_photon_PtTextCallback_1t_2I", "memmove__ILorg_eclipse_swt_internal_photon_PtWebClientData_1t_2I", - "memmove__I_3BI", - "memmove__I_3II", "memmove__Lorg_eclipse_swt_internal_photon_FontDetails_2II", "memmove__Lorg_eclipse_swt_internal_photon_PgAlpha_1t_2II", "memmove__Lorg_eclipse_swt_internal_photon_PgMap_1t_2II", @@ -296,13 +291,8 @@ char * OS_nativeFunctionNames[] = { "memmove__Lorg_eclipse_swt_internal_photon_PtWebMetaDataCallback_1t_2II", "memmove__Lorg_eclipse_swt_internal_photon_PtWebStatusCallback_1t_2II", "memmove__Lorg_eclipse_swt_internal_photon_PtWebWindowCallback_1t_2II", - "memmove___3BII", "memmove___3BLorg_eclipse_swt_internal_photon_PhClipHeader_2I", - "memmove___3III", - "memmove___3SII", - "memset", "strdup", - "strlen", "uname", }; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.h index 55f951fdcd..4e78f6ebe8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.h @@ -265,10 +265,7 @@ typedef enum { PtWindowGetState_FUNC, PtWindowToBack_FUNC, PtWindowToFront_FUNC, - free_FUNC, getenv_FUNC, - malloc_FUNC, - memmove__III_FUNC, memmove__ILorg_eclipse_swt_internal_photon_PgAlpha_1t_2I_FUNC, memmove__ILorg_eclipse_swt_internal_photon_PhArea_1t_2I_FUNC, memmove__ILorg_eclipse_swt_internal_photon_PhCursorDef_1t_2I_FUNC, @@ -280,8 +277,6 @@ typedef enum { memmove__ILorg_eclipse_swt_internal_photon_PhTile_1t_2I_FUNC, memmove__ILorg_eclipse_swt_internal_photon_PtTextCallback_1t_2I_FUNC, memmove__ILorg_eclipse_swt_internal_photon_PtWebClientData_1t_2I_FUNC, - memmove__I_3BI_FUNC, - memmove__I_3II_FUNC, memmove__Lorg_eclipse_swt_internal_photon_FontDetails_2II_FUNC, memmove__Lorg_eclipse_swt_internal_photon_PgAlpha_1t_2II_FUNC, memmove__Lorg_eclipse_swt_internal_photon_PgMap_1t_2II_FUNC, @@ -300,12 +295,7 @@ typedef enum { memmove__Lorg_eclipse_swt_internal_photon_PtWebMetaDataCallback_1t_2II_FUNC, memmove__Lorg_eclipse_swt_internal_photon_PtWebStatusCallback_1t_2II_FUNC, memmove__Lorg_eclipse_swt_internal_photon_PtWebWindowCallback_1t_2II_FUNC, - memmove___3BII_FUNC, memmove___3BLorg_eclipse_swt_internal_photon_PhClipHeader_2I_FUNC, - memmove___3III_FUNC, - memmove___3SII_FUNC, - memset_FUNC, strdup_FUNC, - strlen_FUNC, uname_FUNC, } OS_FUNCS; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java index fdd42352aa..ba7194691d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java @@ -13,10 +13,7 @@ package org.eclipse.swt.internal.photon; import org.eclipse.swt.internal.*; -public class OS extends Platform { - static { - Library.loadLibrary ("swt"); - } +public class OS extends C { public static final int QNX_MAJOR; public static final int QNX_MINOR; @@ -799,22 +796,14 @@ public static final native int PtWindowFocus(int widget); public static final native int PtWindowGetState(int widget); public static final native void PtWindowToBack(int widget); public static final native void PtWindowToFront(int widget); -public static final native void free(int ptr); public static final native int getenv(byte[] name); -public static final native int malloc(int size); public static final native void memmove(int dest, PhPoint_t src, int size); -public static final native void memmove(int[] dest, int src, int size); -public static final native void memmove(int dest, int[] src, int size); public static final native void memmove(int dest, PhTile_t src, int size); public static final native void memmove(PhTile_t dest, int src, int size); public static final native void memmove(PtCallbackInfo_t dest, int src, int size); public static final native void memmove(PhWindowEvent_t dest, int src, int size); -public static final native void memmove(byte[] dest, int src, int size); -public static final native void memmove(int dest, byte[] src, int size); public static final native void memmove(int dest, PhRect_t src, int size); public static final native void memmove(PhRect_t dest, int src, int size); -public static final native void memmove(short[] dest, int src, int size); -public static final native void memmove(int dest, int src, int size); public static final native void memmove(int dest, PhImage_t src, int size); public static final native void memmove(PhImage_t dest, int src, int size); public static final native void memmove(FontDetails dest, int src, int size); @@ -838,9 +827,7 @@ public static final native void memmove(PtWebDataReqCallback_t dest, int src, in public static final native void memmove(PtWebWindowCallback_t dest, int src, int size); public static final native void memmove(PtWebMetaDataCallback_t dest, int src, int size); public static final native void memmove(int dest, PtWebClientData_t src, int size); -public static final native void memset(int dest, int c, int length); public static final native int strdup(int string); -public static final native int strlen(int string); public static final native int uname(utsname udata); } |