diff options
author | rdowdall <> | 2007-04-11 19:49:11 +0000 |
---|---|---|
committer | rdowdall <> | 2007-04-11 19:49:11 +0000 |
commit | 47dffaeca98d0281611922b95c2dc30f68ec71af (patch) | |
tree | 2fa55bd322812f3ddc34cd4e7713bfce4e074697 | |
parent | a45d3db1e1b77648ecea191319e6cbf320ed909d (diff) | |
download | eclipse.platform.swt-47dffaeca98d0281611922b95c2dc30f68ec71af.tar.gz eclipse.platform.swt-47dffaeca98d0281611922b95c2dc30f68ec71af.tar.xz eclipse.platform.swt-47dffaeca98d0281611922b95c2dc30f68ec71af.zip |
Updated the PtWebClientData_t class to PtWebClient2Data_t class as per the directions outlined in the QNX help documentation for PtWebClient.
The is to fix bug 177401 in the eclipse bug list.
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Browser/photon/org/eclipse/swt/browser/Voyager.java | 8 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os.c | 17 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.c | 4 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_stats.h | 4 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.c | 68 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.h | 20 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebClient2Data_t.java (renamed from bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebClientData_t.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebDataReqCallback_t.java | 4 |
9 files changed, 61 insertions, 72 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/photon/org/eclipse/swt/browser/Voyager.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/photon/org/eclipse/swt/browser/Voyager.java index f64e31b935..028b38a167 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/photon/org/eclipse/swt/browser/Voyager.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/photon/org/eclipse/swt/browser/Voyager.java @@ -241,7 +241,7 @@ int Pt_CB_WEB_DATA_REQ(int info) { OS.memmove(cbinfo_t, info, PtCallbackInfo_t.sizeof); PtWebDataReqCallback_t dataReq = new PtWebDataReqCallback_t(); OS.memmove(dataReq, cbinfo_t.cbdata, PtWebDataReqCallback_t.sizeof); - PtWebClientData_t clientData = new PtWebClientData_t(); + PtWebClient2Data_t clientData = new PtWebClient2Data_t(); clientData.type = dataReq.type; clientData.data = 0; String data = null; @@ -276,9 +276,9 @@ int Pt_CB_WEB_DATA_REQ(int info) { OS.memmove(clientData.data, buffer, buffer.length); clientData.length = buffer.length - 1; } - System.arraycopy(dataReq.url, 0, clientData.url, 0, dataReq.url.length); - int ptr = OS.malloc(PtWebClientData_t.sizeof); - OS.memmove(ptr, clientData, PtWebClientData_t.sizeof); + dataReq.url = clientData.url; + int ptr = OS.malloc(PtWebClient2Data_t.sizeof); + OS.memmove(ptr, clientData, PtWebClient2Data_t.sizeof); OS.PtSetResource(webHandle, OS.Pt_ARG_WEB_DATA, clientData.data, ptr); OS.free(ptr); if (clientData.data != 0) OS.free(clientData.data); 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 a03d72a09a..8e2f76a775 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -3521,16 +3521,17 @@ fail: } #endif -#ifndef NO_memmove__ILorg_eclipse_swt_internal_photon_PtWebClientData_1t_2I -JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_photon_PtWebClientData_1t_2I) +#ifndef NO_memmove__ILorg_eclipse_swt_internal_photon_PtWebClient2Data_1t_2I +JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_photon_PtWebClient2Data_1t_2I) (JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2) { - PtWebClientData_t _arg1, *lparg1=NULL; - OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_photon_PtWebClientData_1t_2I_FUNC); - if (arg1) if ((lparg1 = getPtWebClientData_tFields(env, arg1, &_arg1)) == NULL) goto fail; - memmove((void *)arg0, (const void *)lparg1, (size_t)arg2); + PtWebClient2Data_t _arg1, *lparg1=NULL; + OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_photon_PtWebClient2Data_1t_2I_FUNC); + if (arg1) if ((lparg1 = getPtWebClient2Data_tFields(env, arg1, &_arg1)) == NULL) goto fail; + memmove(arg0, lparg1, arg2); fail: - OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_photon_PtWebClientData_1t_2I_FUNC); + if (arg1 && lparg1) setPtWebClient2Data_tFields(env, arg1, lparg1); + OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_photon_PtWebClient2Data_1t_2I_FUNC); } #endif 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 a9a934e995..e38d002c16 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -271,7 +271,7 @@ char * OS_nativeFunctionNames[] = { "memmove__ILorg_eclipse_swt_internal_photon_PhRect_1t_2I", "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__ILorg_eclipse_swt_internal_photon_PtWebClient2Data_1t_2I", "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", 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 e4dbe25938..6175587f2d 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -279,7 +279,7 @@ typedef enum { memmove__ILorg_eclipse_swt_internal_photon_PhRect_1t_2I_FUNC, 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__ILorg_eclipse_swt_internal_photon_PtWebClient2Data_1t_2I_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, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.c index 5e05e9501e..3d43e007f1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1480,49 +1480,43 @@ void setPtTextCallback_tFields(JNIEnv *env, jobject lpObject, PtTextCallback_t * } #endif -#ifndef NO_PtWebClientData_t -typedef struct PtWebClientData_t_FID_CACHE { +#ifndef NO_PtWebClient2Data_t +typedef struct PtWebClient2Data_t_FID_CACHE { int cached; jclass clazz; jfieldID type, url, length, data; -} PtWebClientData_t_FID_CACHE; +} PtWebClient2Data_t_FID_CACHE; -PtWebClientData_t_FID_CACHE PtWebClientData_tFc; +PtWebClient2Data_t_FID_CACHE PtWebClient2Data_tFc; -void cachePtWebClientData_tFields(JNIEnv *env, jobject lpObject) +void cachePtWebClient2Data_tFields(JNIEnv *env, jobject lpObject) { - if (PtWebClientData_tFc.cached) return; - PtWebClientData_tFc.clazz = (*env)->GetObjectClass(env, lpObject); - PtWebClientData_tFc.type = (*env)->GetFieldID(env, PtWebClientData_tFc.clazz, "type", "I"); - PtWebClientData_tFc.url = (*env)->GetFieldID(env, PtWebClientData_tFc.clazz, "url", "[B"); - PtWebClientData_tFc.length = (*env)->GetFieldID(env, PtWebClientData_tFc.clazz, "length", "I"); - PtWebClientData_tFc.data = (*env)->GetFieldID(env, PtWebClientData_tFc.clazz, "data", "I"); - PtWebClientData_tFc.cached = 1; + if (PtWebClient2Data_tFc.cached) return; + PtWebClient2Data_tFc.clazz = (*env)->GetObjectClass(env, lpObject); + PtWebClient2Data_tFc.type = (*env)->GetFieldID(env, PtWebClient2Data_tFc.clazz, "type", "I"); + PtWebClient2Data_tFc.url = (*env)->GetFieldID(env, PtWebClient2Data_tFc.clazz, "url", "I"); + PtWebClient2Data_tFc.length = (*env)->GetFieldID(env, PtWebClient2Data_tFc.clazz, "length", "I"); + PtWebClient2Data_tFc.data = (*env)->GetFieldID(env, PtWebClient2Data_tFc.clazz, "data", "I"); + PtWebClient2Data_tFc.cached = 1; } -PtWebClientData_t *getPtWebClientData_tFields(JNIEnv *env, jobject lpObject, PtWebClientData_t *lpStruct) +PtWebClient2Data_t *getPtWebClient2Data_tFields(JNIEnv *env, jobject lpObject, PtWebClient2Data_t *lpStruct) { - if (!PtWebClientData_tFc.cached) cachePtWebClientData_tFields(env, lpObject); - lpStruct->type = (*env)->GetIntField(env, lpObject, PtWebClientData_tFc.type); - { - jbyteArray lpObject1 = (jbyteArray)(*env)->GetObjectField(env, lpObject, PtWebClientData_tFc.url); - (*env)->GetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->url), (jbyte *)lpStruct->url); - } - lpStruct->length = (*env)->GetIntField(env, lpObject, PtWebClientData_tFc.length); - lpStruct->data = (char *)(*env)->GetIntField(env, lpObject, PtWebClientData_tFc.data); + if (!PtWebClient2Data_tFc.cached) cachePtWebClient2Data_tFields(env, lpObject); + lpStruct->type = (*env)->GetIntField(env, lpObject, PtWebClient2Data_tFc.type); + lpStruct->url = (*env)->GetIntField(env, lpObject, PtWebClient2Data_tFc.url); + lpStruct->length = (*env)->GetIntField(env, lpObject, PtWebClient2Data_tFc.length); + lpStruct->data = (*env)->GetIntField(env, lpObject, PtWebClient2Data_tFc.data); return lpStruct; } -void setPtWebClientData_tFields(JNIEnv *env, jobject lpObject, PtWebClientData_t *lpStruct) +void setPtWebClient2Data_tFields(JNIEnv *env, jobject lpObject, PtWebClient2Data_t *lpStruct) { - if (!PtWebClientData_tFc.cached) cachePtWebClientData_tFields(env, lpObject); - (*env)->SetIntField(env, lpObject, PtWebClientData_tFc.type, (jint)lpStruct->type); - { - jbyteArray lpObject1 = (jbyteArray)(*env)->GetObjectField(env, lpObject, PtWebClientData_tFc.url); - (*env)->SetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->url), (jbyte *)lpStruct->url); - } - (*env)->SetIntField(env, lpObject, PtWebClientData_tFc.length, (jint)lpStruct->length); - (*env)->SetIntField(env, lpObject, PtWebClientData_tFc.data, (jint)lpStruct->data); + if (!PtWebClient2Data_tFc.cached) cachePtWebClient2Data_tFields(env, lpObject); + (*env)->SetIntField(env, lpObject, PtWebClient2Data_tFc.type, (jint)lpStruct->type); + (*env)->SetIntField(env, lpObject, PtWebClient2Data_tFc.url, (jint)lpStruct->url); + (*env)->SetIntField(env, lpObject, PtWebClient2Data_tFc.length, (jint)lpStruct->length); + (*env)->SetIntField(env, lpObject, PtWebClient2Data_tFc.data, (jint)lpStruct->data); } #endif @@ -1541,7 +1535,7 @@ void cachePtWebDataReqCallback_tFields(JNIEnv *env, jobject lpObject) PtWebDataReqCallback_tFc.clazz = (*env)->GetObjectClass(env, lpObject); PtWebDataReqCallback_tFc.type = (*env)->GetFieldID(env, PtWebDataReqCallback_tFc.clazz, "type", "I"); PtWebDataReqCallback_tFc.length = (*env)->GetFieldID(env, PtWebDataReqCallback_tFc.clazz, "length", "I"); - PtWebDataReqCallback_tFc.url = (*env)->GetFieldID(env, PtWebDataReqCallback_tFc.clazz, "url", "[B"); + PtWebDataReqCallback_tFc.url = (*env)->GetFieldID(env, PtWebDataReqCallback_tFc.clazz, "url", "I"); PtWebDataReqCallback_tFc.cached = 1; } @@ -1550,10 +1544,7 @@ PtWebDataReqCallback_t *getPtWebDataReqCallback_tFields(JNIEnv *env, jobject lpO if (!PtWebDataReqCallback_tFc.cached) cachePtWebDataReqCallback_tFields(env, lpObject); lpStruct->type = (*env)->GetIntField(env, lpObject, PtWebDataReqCallback_tFc.type); lpStruct->length = (*env)->GetIntField(env, lpObject, PtWebDataReqCallback_tFc.length); - { - jbyteArray lpObject1 = (jbyteArray)(*env)->GetObjectField(env, lpObject, PtWebDataReqCallback_tFc.url); - (*env)->GetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->url), (jbyte *)lpStruct->url); - } + lpStruct->url = (*env)->GetIntField(env, lpObject, PtWebDataReqCallback_tFc.url); return lpStruct; } @@ -1562,10 +1553,7 @@ void setPtWebDataReqCallback_tFields(JNIEnv *env, jobject lpObject, PtWebDataReq if (!PtWebDataReqCallback_tFc.cached) cachePtWebDataReqCallback_tFields(env, lpObject); (*env)->SetIntField(env, lpObject, PtWebDataReqCallback_tFc.type, (jint)lpStruct->type); (*env)->SetIntField(env, lpObject, PtWebDataReqCallback_tFc.length, (jint)lpStruct->length); - { - jbyteArray lpObject1 = (jbyteArray)(*env)->GetObjectField(env, lpObject, PtWebDataReqCallback_tFc.url); - (*env)->SetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->url), (jbyte *)lpStruct->url); - } + (*env)->SetIntField(env, lpObject, PtWebDataReqCallback_tFc.url, (jint)lpStruct->url); } #endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.h index e0fa5db7ce..edf1190f13 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_structs.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -311,16 +311,16 @@ void setPtTextCallback_tFields(JNIEnv *env, jobject lpObject, PtTextCallback_t * #define PtTextCallback_t_sizeof() 0 #endif -#ifndef NO_PtWebClientData_t -void cachePtWebClientData_tFields(JNIEnv *env, jobject lpObject); -PtWebClientData_t *getPtWebClientData_tFields(JNIEnv *env, jobject lpObject, PtWebClientData_t *lpStruct); -void setPtWebClientData_tFields(JNIEnv *env, jobject lpObject, PtWebClientData_t *lpStruct); -#define PtWebClientData_t_sizeof() sizeof(PtWebClientData_t) +#ifndef NO_PtWebClient2Data_t +void cachePtWebClient2Data_tFields(JNIEnv *env, jobject lpObject); +PtWebClient2Data_t *getPtWebClient2Data_tFields(JNIEnv *env, jobject lpObject, PtWebClient2Data_t *lpStruct); +void setPtWebClient2Data_tFields(JNIEnv *env, jobject lpObject, PtWebClient2Data_t *lpStruct); +#define PtWebClient2Data_t_sizeof() sizeof(PtWebClient2Data_t) #else -#define cachePtWebClientData_tFields(a,b) -#define getPtWebClientData_tFields(a,b,c) NULL -#define setPtWebClientData_tFields(a,b,c) -#define PtWebClientData_t_sizeof() 0 +#define cachePtWebClient2Data_tFields(a,b) +#define getPtWebClient2Data_tFields(a,b,c) NULL +#define setPtWebClient2Data_tFields(a,b,c) +#define PtWebClient2Data_t_sizeof() 0 #endif #ifndef NO_PtWebDataReqCallback_t 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 91a8329a09..756d7402d9 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 @@ -825,7 +825,7 @@ public static final native void memmove(PtWebStatusCallback_t dest, int src, int public static final native void memmove(PtWebDataReqCallback_t dest, int src, int size); 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 memmove(int dest, PtWebClient2Data_t src, int size); public static final native int strdup(int string); public static final native int uname(utsname udata); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebClientData_t.java b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebClient2Data_t.java index c522324466..d534a1c0f4 100644..100755 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebClientData_t.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebClient2Data_t.java @@ -10,10 +10,10 @@ *******************************************************************************/ package org.eclipse.swt.internal.photon; -public class PtWebClientData_t { +public class PtWebClient2Data_t { public int type; - public byte[] url = new byte[OS.MAX_URL_LENGTH]; + public int url; public int length; public int data; - public static final int sizeof = OS.MAX_URL_LENGTH + 12; + public static final int sizeof = 16; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebDataReqCallback_t.java b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebDataReqCallback_t.java index 9f2661a60d..badb9ce0b9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebDataReqCallback_t.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebDataReqCallback_t.java @@ -13,6 +13,6 @@ package org.eclipse.swt.internal.photon; public class PtWebDataReqCallback_t { public int type; public int length; - public byte[] url = new byte[OS.MAX_URL_LENGTH]; - public static final int sizeof = OS.MAX_URL_LENGTH + 8; + public int url; + public static final int sizeof = 12; } |