diff options
author | Silenio Quarti | 2003-10-06 17:24:22 +0000 |
---|---|---|
committer | Silenio Quarti | 2003-10-06 17:24:22 +0000 |
commit | 4dccb2e0a0b101906318585148eb97fd02e25bff (patch) | |
tree | 8f443b07dc051b35818fbe5863caf98280532cea | |
parent | b87d89fa378565220a1d44aae261a05e4cd68227 (diff) | |
download | eclipse.platform.swt-4dccb2e0a0b101906318585148eb97fd02e25bff.tar.gz eclipse.platform.swt-4dccb2e0a0b101906318585148eb97fd02e25bff.tar.xz eclipse.platform.swt-4dccb2e0a0b101906318585148eb97fd02e25bff.zip |
fixing return value (objects)
5 files changed, 42 insertions, 39 deletions
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 d986789e0d..def570f81e 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 @@ -30,16 +30,16 @@ JNIEXPORT jint JNICALL OS_NATIVE(PfDecomposeStemToID) #endif #ifndef NO_PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2III -JNIEXPORT jobject JNICALL OS_NATIVE(PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2III) +JNIEXPORT jint JNICALL OS_NATIVE(PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2III) (JNIEnv *env, jclass that, jobject arg0, jobject arg1, jint arg2, jint arg3, jint arg4) { PhRect_t _arg0, *lparg0=NULL; PhPoint_t _arg1, *lparg1=NULL; - jobject rc; + jint rc; NATIVE_ENTER(env, that, "PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2III\n") if (arg0) lparg0 = getPhRect_tFields(env, arg0, &_arg0); if (arg1) lparg1 = getPhPoint_tFields(env, arg1, &_arg1); - rc = (jobject)PfExtentText(lparg0, lparg1, (const char *)arg2, (const char *)arg3, arg4); + rc = (jint)PfExtentText(lparg0, lparg1, (const char *)arg2, (const char *)arg3, arg4); if (arg1) setPhPoint_tFields(env, arg1, lparg1); if (arg0) setPhRect_tFields(env, arg0, lparg0); NATIVE_EXIT(env, that, "PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2III\n") @@ -48,20 +48,20 @@ JNIEXPORT jobject JNICALL OS_NATIVE(PfExtentText__Lorg_eclipse_swt_internal_phot #endif #ifndef NO_PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2_3B_3BI -JNIEXPORT jobject JNICALL OS_NATIVE(PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2_3B_3BI) +JNIEXPORT jint JNICALL OS_NATIVE(PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2_3B_3BI) (JNIEnv *env, jclass that, jobject arg0, jobject arg1, jbyteArray arg2, jbyteArray arg3, jint arg4) { PhRect_t _arg0, *lparg0=NULL; PhPoint_t _arg1, *lparg1=NULL; jbyte *lparg2=NULL; jbyte *lparg3=NULL; - jobject rc; + jint rc; NATIVE_ENTER(env, that, "PfExtentText__Lorg_eclipse_swt_internal_photon_PhRect_1t_2Lorg_eclipse_swt_internal_photon_PhPoint_1t_2_3B_3BI\n") if (arg0) lparg0 = getPhRect_tFields(env, arg0, &_arg0); if (arg1) lparg1 = getPhPoint_tFields(env, arg1, &_arg1); if (arg2) lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL); if (arg3) lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL); - rc = (jobject)PfExtentText(lparg0, lparg1, (const char *)lparg2, (const char *)lparg3, arg4); + rc = (jint)PfExtentText(lparg0, lparg1, (const char *)lparg2, (const char *)lparg3, arg4); if (arg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0); if (arg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0); if (arg1) setPhPoint_tFields(env, arg1, lparg1); @@ -72,20 +72,20 @@ JNIEXPORT jobject JNICALL OS_NATIVE(PfExtentText__Lorg_eclipse_swt_internal_phot #endif #ifndef NO_PfExtentWideText -JNIEXPORT jobject JNICALL OS_NATIVE(PfExtentWideText) +JNIEXPORT jint JNICALL OS_NATIVE(PfExtentWideText) (JNIEnv *env, jclass that, jobject arg0, jobject arg1, jbyteArray arg2, jcharArray arg3, jint arg4) { PhRect_t _arg0, *lparg0=NULL; PhPoint_t _arg1, *lparg1=NULL; jbyte *lparg2=NULL; jchar *lparg3=NULL; - jobject rc; + jint rc; NATIVE_ENTER(env, that, "PfExtentWideText\n") if (arg0) lparg0 = getPhRect_tFields(env, arg0, &_arg0); if (arg1) lparg1 = getPhPoint_tFields(env, arg1, &_arg1); if (arg2) lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL); if (arg3) lparg3 = (*env)->GetCharArrayElements(env, arg3, NULL); - rc = (jobject)PfExtentWideText(lparg0, lparg1, (const char *)lparg2, (const uint16_t *)lparg3, arg4); + rc = (jint)PfExtentWideText(lparg0, lparg1, (const char *)lparg2, (const uint16_t *)lparg3, arg4); if (arg3) (*env)->ReleaseCharArrayElements(env, arg3, lparg3, 0); if (arg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0); if (arg1) setPhPoint_tFields(env, arg1, lparg1); @@ -143,6 +143,24 @@ JNIEXPORT jint JNICALL OS_NATIVE(PfFreeFont) } #endif +#ifndef NO_PfGenerateFontName +JNIEXPORT jint JNICALL OS_NATIVE(PfGenerateFontName) + (JNIEnv *env, jclass that, jbyteArray arg0, jint arg1, jint arg2, jbyteArray arg3) +{ + jbyte *lparg0=NULL; + jbyte *lparg3=NULL; + jint rc; + NATIVE_ENTER(env, that, "PfGenerateFontName\n") + if (arg0) lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL); + if (arg3) lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL); + rc = (jint)PfGenerateFontName((char const *)lparg0, arg1, arg2, (char *)lparg3); + if (arg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0); + if (arg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); + NATIVE_EXIT(env, that, "PfGenerateFontName\n") + return rc; +} +#endif + #ifndef NO_PfLoadMetrics JNIEXPORT jint JNICALL OS_NATIVE(PfLoadMetrics) (JNIEnv *env, jclass that, jbyteArray arg0) @@ -469,20 +487,20 @@ JNIEXPORT jint JNICALL OS_NATIVE(PgDrawText) #endif #ifndef NO_PgExtentMultiText -JNIEXPORT jobject JNICALL OS_NATIVE(PgExtentMultiText) +JNIEXPORT jint JNICALL OS_NATIVE(PgExtentMultiText) (JNIEnv *env, jclass that, jobject arg0, jobject arg1, jbyteArray arg2, jbyteArray arg3, jint arg4, jint arg5) { PhRect_t _arg0, *lparg0=NULL; PhPoint_t _arg1, *lparg1=NULL; jbyte *lparg2=NULL; jbyte *lparg3=NULL; - jobject rc; + jint rc; NATIVE_ENTER(env, that, "PgExtentMultiText\n") if (arg0) lparg0 = getPhRect_tFields(env, arg0, &_arg0); if (arg1) lparg1 = getPhPoint_tFields(env, arg1, &_arg1); if (arg2) lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL); if (arg3) lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL); - rc = (jobject)PgExtentMultiText((PhRect_t *)lparg0, (PhPoint_t *)lparg1, (char *)lparg2, (char *)lparg3, arg4, arg5); + rc = (jint)PgExtentMultiText((PhRect_t *)lparg0, (PhPoint_t *)lparg1, (char *)lparg2, (char *)lparg3, arg4, arg5); if (arg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0); if (arg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0); if (arg1) setPhPoint_tFields(env, arg1, lparg1); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_custom.c index d0606a77c5..a7bd3c9d21 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_custom.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/os_custom.c @@ -22,24 +22,6 @@ #define PtClippedBlit PtClippedBlit_ #endif -#ifndef NO_PfGenerateFontName -JNIEXPORT jbyteArray JNICALL OS_NATIVE(PfGenerateFontName) - (JNIEnv *env, jclass that, jbyteArray arg0, jint arg1, jint arg2, jbyteArray arg3) -{ - jbyte *lparg0=NULL; - jbyte *lparg3=NULL; - jbyteArray rc; - NATIVE_ENTER(env, that, "PfGenerateFontName\n") - if (arg0) lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL); - if (arg3) lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL); - rc = (jbyteArray)PfGenerateFontName((char const *)lparg0, arg1, arg2, (char *)lparg3); - if (arg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); - if (arg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0); - NATIVE_EXIT(env, that, "PfGenerateFontName\n") - return rc == NULL ? NULL : arg3; -} -#endif - #ifndef NO_PhGetTile JNIEXPORT jint JNICALL OS_NATIVE(PhGetTile) (JNIEnv *env, jclass that) 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 06d5232a48..3558202ff9 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 @@ -328,6 +328,7 @@ public class OS { public static final int Pt_ARG_OUTLINE_COLOR = 0x7e6; public static final int Pt_ARG_PAGE_INCREMENT = 0x714d; public static final int Pt_ARG_PG_CURRENT_INDEX = 0xfa05; + public static final int Pt_ARG_PG_FLAGS = 64 * 1000; public static final int Pt_ARG_PG_PANEL_TITLES = 0xfa02; public static final int Pt_ARG_POS = 0x3ef; public static final int Pt_ARG_REGION_FLAGS = 0x3a9b; @@ -449,6 +450,7 @@ public class OS { public static final int Pt_N_OF_MANY = 0x0; public static final int Pt_ONE_OF_MANY = 0x1; public static final int Pt_PG_INVALID = 0xffff; + public static final int Pt_PG_SELECTOR_ON_BOTTOM = 0x0001; public static final int Pt_PROCESS = 0x0; public static final int Pt_RESIZE_XY_BITS = 0x3f00000; public static final int Pt_RESIZE_X_ALWAYS = 0x800000; @@ -509,14 +511,14 @@ public class OS { /** Natives */ public static final native int PfDecomposeStemToID(byte[] pkszStem); -public static final native org.eclipse.swt.internal.photon.PhRect_t PfExtentText(PhRect_t extent, PhPoint_t pos, int font, int str, int len); -public static final native org.eclipse.swt.internal.photon.PhRect_t PfExtentText(PhRect_t extent, PhPoint_t pos, byte[] font, byte[] str, int len); -public static final native org.eclipse.swt.internal.photon.PhRect_t PfExtentWideText(PhRect_t extent, PhPoint_t pos, byte[] font, char[] str, int len); +public static final native int PfExtentText(PhRect_t extent, PhPoint_t pos, int font, int str, int len); +public static final native int PfExtentText(PhRect_t extent, PhPoint_t pos, byte[] font, byte[] str, int len); +public static final native int PfExtentWideText(PhRect_t extent, PhPoint_t pos, byte[] font, char[] str, int len); public static final native int PfFontDescription(int ptsID); public static final native int PfFontFlags(int ptsID); public static final native int PfFontSize(int ptsID); public static final native int PfFreeFont(int ptsID); -public static final native byte[] PfGenerateFontName(byte[] pkucDescription, int kuiFlags, int kuiSize, byte[] pucBuff); +public static final native int PfGenerateFontName(byte[] pkucDescription, int kuiFlags, int kuiSize, byte[] pucBuff); public static final native int PfLoadMetrics(byte[] font); public static final native int PfQueryFontInfo(byte[] font, FontQueryInfo info); public static final native int PfQueryFonts(int symbol, int flags, int list, int n); @@ -538,7 +540,7 @@ public static final native int PgDrawPolygon(short[] ptr, int num, PhPoint_t pos public static final native int PgDrawRoundRect(PhRect_t rect, PhPoint_t radii, int flags); public static final native int PgDrawTImage(int ptr, int type, PhPoint_t pos, PhDim_t size, int bpl, int tag, int TransPtr, int TransBPl); public static final native int PgDrawText(byte[] ptr, int len, PhPoint_t pos, int flags); -public static final native org.eclipse.swt.internal.photon.PhRect_t PgExtentMultiText(PhRect_t extent, PhPoint_t pos, byte[] font, byte[] str, int n, int linespacing); +public static final native int PgExtentMultiText(PhRect_t extent, PhPoint_t pos, byte[] font, byte[] str, int n, int linespacing); public static final native int PgFlush(); public static final native int PgGetVideoMode(PgDisplaySettings_t settings); public static final native int PgGetVideoModeInfo(short mode_number, PgVideoModeInfo_t mode_info); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Font.java index 2a35ee4611..7895994ba8 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Font.java @@ -228,7 +228,7 @@ void init(Device device, String name, int height, int style, byte[] stem) { if ((style & SWT.BOLD) != 0) osStyle |= OS.PF_STYLE_BOLD; if ((style & SWT.ITALIC) != 0) osStyle |= OS.PF_STYLE_ITALIC; byte[] buffer = new byte[OS.MAX_FONT_TAG]; - handle = OS.PfGenerateFontName(description, osStyle, height, buffer); + if (OS.PfGenerateFontName(description, osStyle, height, buffer) != 0) handle = buffer; if (handle == null) { byte[] defaultFont = device.systemFont; int fontID = OS.PfDecomposeStemToID(defaultFont); @@ -238,7 +238,7 @@ void init(Device device, String name, int height, int style, byte[] stem) { byte[] defaultFontName = new byte[length + 1]; OS.memmove(defaultFontName, desc, length); OS.PfFreeFont(fontID); - handle = OS.PfGenerateFontName(defaultFontName, osStyle, height, buffer); + if (OS.PfGenerateFontName(defaultFontName, osStyle, height, buffer) != 0) handle = buffer; } if (handle == null) handle = defaultFont; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/FontDialog.java index 829ed1319a..9c7c75f754 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/FontDialog.java @@ -150,8 +150,9 @@ public FontData open () { int osStyle = 0, style = fontData.getStyle(); if ((style & SWT.BOLD) != 0) osStyle |= OS.PF_STYLE_BOLD; if ((style & SWT.ITALIC) != 0) osStyle |= OS.PF_STYLE_ITALIC; - int size = fontData.getHeight(); - font = OS.PfGenerateFontName(description, osStyle, size, new byte[OS.MAX_FONT_TAG]); + int size = fontData.getHeight(); + byte [] buffer = new byte[OS.MAX_FONT_TAG]; + if (OS.PfGenerateFontName(description, osStyle, size, buffer) != 0) font = buffer; } fontData = null; } |