Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 161015 Details for
Bug 96394
Printing: get a list of paper formats for a printer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Cumulative patch
Print_complete.txt (text/plain), 161.45 KB, created by
Praveen
on 2010-03-04 14:40:50 EST
(
hide
)
Description:
Cumulative patch
Filename:
MIME Type:
Creator:
Praveen
Created:
2010-03-04 14:40:50 EST
Size:
161.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT PI/cocoa/library/os.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c,v >retrieving revision 1.124 >diff -u -r1.124 os.c >--- Eclipse SWT PI/cocoa/library/os.c 22 Feb 2010 20:48:38 -0000 1.124 >+++ Eclipse SWT PI/cocoa/library/os.c 4 Mar 2010 19:37:24 -0000 >@@ -834,6 +834,30 @@ > } > #endif > >+#ifndef NO_CFArrayGetCount >+JNIEXPORT jintLong JNICALL OS_NATIVE(CFArrayGetCount) >+ (JNIEnv *env, jclass that, jint arg0) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, CFArrayGetCount_FUNC); >+ rc = (jintLong)CFArrayGetCount((CFArrayRef)arg0); >+ OS_NATIVE_EXIT(env, that, CFArrayGetCount_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_CFArrayGetValueAtIndex >+JNIEXPORT jintLong JNICALL OS_NATIVE(CFArrayGetValueAtIndex) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, CFArrayGetValueAtIndex_FUNC); >+ rc = (jintLong)CFArrayGetValueAtIndex((CFArrayRef)arg0, (CFIndex)arg1); >+ OS_NATIVE_EXIT(env, that, CFArrayGetValueAtIndex_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_CFAttributedStringCreate > JNIEXPORT jintLong JNICALL OS_NATIVE(CFAttributedStringCreate) > (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2) >@@ -892,6 +916,38 @@ > } > #endif > >+#ifndef NO_CFNumberCreate >+JNIEXPORT jintLong JNICALL OS_NATIVE(CFNumberCreate) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintArray arg2) >+{ >+ jint *lparg2=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, CFNumberCreate_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jintLong)CFNumberCreate((CFAllocatorRef)arg0, (CFNumberType)arg1, (const void *)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, CFNumberCreate_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_CFNumberGetValue >+JNIEXPORT jboolean JNICALL OS_NATIVE(CFNumberGetValue) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintArray arg2) >+{ >+ jint *lparg2=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, CFNumberGetValue_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jboolean)CFNumberGetValue((CFNumberRef)arg0, (CFNumberType)arg1, (void *)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, CFNumberGetValue_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_CFRange_1sizeof > JNIEXPORT jint JNICALL OS_NATIVE(CFRange_1sizeof) > (JNIEnv *env, jclass that) >@@ -4264,6 +4320,30 @@ > } > #endif > >+#ifndef NO_NSPrintPagesAcross >+JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPagesAcross) >+ (JNIEnv *env, jclass that) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, NSPrintPagesAcross_FUNC); >+ rc = (jintLong)NSPrintPagesAcross; >+ OS_NATIVE_EXIT(env, that, NSPrintPagesAcross_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_NSPrintPagesDown >+JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPagesDown) >+ (JNIEnv *env, jclass that) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, NSPrintPagesDown_FUNC); >+ rc = (jintLong)NSPrintPagesDown; >+ OS_NATIVE_EXIT(env, that, NSPrintPagesDown_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_NSPrintPreviewJob > JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPreviewJob) > (JNIEnv *env, jclass that) >@@ -4276,6 +4356,18 @@ > } > #endif > >+#ifndef NO_NSPrintPrinterName >+JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPrinterName) >+ (JNIEnv *env, jclass that) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, NSPrintPrinterName_FUNC); >+ rc = (jintLong)NSPrintPrinterName; >+ OS_NATIVE_EXIT(env, that, NSPrintPrinterName_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_NSPrintSaveJob > JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintSaveJob) > (JNIEnv *env, jclass that) >@@ -4704,6 +4796,393 @@ > } > #endif > >+#ifndef NO_PMCopyPageFormat >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMCopyPageFormat) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMCopyPageFormat_FUNC); >+ rc = (jintLong)PMCopyPageFormat((PMPageFormat)arg0, (PMPageFormat)arg1); >+ OS_NATIVE_EXIT(env, that, PMCopyPageFormat_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMCreatePageFormatWithPMPaper >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMCreatePageFormatWithPMPaper) >+ (JNIEnv *env, jclass that, jintArray arg0, jintLong arg1) >+{ >+ jint *lparg0=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMCreatePageFormatWithPMPaper_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMCreatePageFormatWithPMPaper((PMPageFormat*)lparg0, (PMPaper)arg1); >+fail: >+ if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, PMCreatePageFormatWithPMPaper_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMCreatePrintSettings >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMCreatePrintSettings) >+ (JNIEnv *env, jclass that, jintArray arg0) >+{ >+ jint *lparg0=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMCreatePrintSettings_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMCreatePrintSettings((PMPrintSettings*)lparg0); >+fail: >+ if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, PMCreatePrintSettings_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMCreateSession >+JNIEXPORT jint JNICALL OS_NATIVE(PMCreateSession) >+ (JNIEnv *env, jclass that, jintArray arg0) >+{ >+ jint *lparg0=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, PMCreateSession_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ rc = (jint)PMCreateSession((PMPrintSession*)lparg0); >+fail: >+ if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, PMCreateSession_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMGetDuplex >+JNIEXPORT void JNICALL OS_NATIVE(PMGetDuplex) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ OS_NATIVE_ENTER(env, that, PMGetDuplex_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ PMGetDuplex((PMPrintSettings)arg0, (PMDuplexMode*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMGetDuplex_FUNC); >+} >+#endif >+ >+#ifndef NO_PMGetPageFormatPaper >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMGetPageFormatPaper) >+ (JNIEnv *env, jclass that, jint arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMGetPageFormatPaper_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMGetPageFormatPaper((PMPageFormat)arg0, (PMPaper*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMGetPageFormatPaper_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPageFormatGetPrinterID >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPageFormatGetPrinterID) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPageFormatGetPrinterID_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPageFormatGetPrinterID((PMPageFormat)arg0, (CFStringRef*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPageFormatGetPrinterID_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperCreateCustom >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperCreateCustom) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jdouble arg3, jdouble arg4, jdoubleArray arg5, jintArray arg6) >+{ >+ jdouble *lparg5=NULL; >+ jint *lparg6=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperCreateCustom_FUNC); >+ if (arg5) if ((lparg5 = (*env)->GetDoubleArrayElements(env, arg5, NULL)) == NULL) goto fail; >+ if (arg6) if ((lparg6 = (*env)->GetIntArrayElements(env, arg6, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPaperCreateCustom((PMPrinter)arg0, (CFStringRef)arg1, (CFStringRef)arg2, (double)arg3, (double)arg4, (const PMPaperMargins*)lparg5, (PMPaper*)lparg6); >+fail: >+ if (arg6 && lparg6) (*env)->ReleaseIntArrayElements(env, arg6, lparg6, 0); >+ if (arg5 && lparg5) (*env)->ReleaseDoubleArrayElements(env, arg5, lparg5, 0); >+ OS_NATIVE_EXIT(env, that, PMPaperCreateCustom_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperCreateLocalizedName >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperCreateLocalizedName) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2) >+{ >+ jint *lparg2=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperCreateLocalizedName_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPaperCreateLocalizedName((PMPaper)arg0, (PMPrinter)arg1, (CFStringRef*)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, PMPaperCreateLocalizedName_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperGetHeight >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetHeight) >+ (JNIEnv *env, jclass that, jintLong arg0, jdoubleArray arg1) >+{ >+ jdouble *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperGetHeight_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPaperGetHeight((PMPaper)arg0, (double*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseDoubleArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPaperGetHeight_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperGetID >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetID) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperGetID_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPaperGetID((PMPaper)arg0, (CFStringRef*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPaperGetID_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperGetName >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetName) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperGetName_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPaperGetName((PMPaper)arg0, (CFStringRef*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPaperGetName_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperGetWidth >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetWidth) >+ (JNIEnv *env, jclass that, jintLong arg0, jdoubleArray arg1) >+{ >+ jdouble *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperGetWidth_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPaperGetWidth((PMPaper)arg0, (double*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseDoubleArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPaperGetWidth_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPaperIsCustom >+JNIEXPORT jboolean JNICALL OS_NATIVE(PMPaperIsCustom) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPaperIsCustom_FUNC); >+ rc = (jboolean)PMPaperIsCustom((PMPaper)arg0); >+ OS_NATIVE_EXIT(env, that, PMPaperIsCustom_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrintSettingsCopyKeys >+JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsCopyKeys) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrintSettingsCopyKeys_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jint)PMPrintSettingsCopyKeys((PMPrintSettings)arg0, (CFArrayRef*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPrintSettingsCopyKeys_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrintSettingsGetValue >+JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsGetValue) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2) >+{ >+ jint *lparg2=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrintSettingsGetValue_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jint)PMPrintSettingsGetValue((PMPrintSettings)arg0, (CFStringRef)arg1, (CFTypeRef*)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, PMPrintSettingsGetValue_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrintSettingsSetValue >+JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsSetValue) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jboolean arg3) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrintSettingsSetValue_FUNC); >+ rc = (jint)PMPrintSettingsSetValue((PMPrintSettings)arg0, (CFStringRef)arg1, (CFTypeRef)arg2, (Boolean)arg3); >+ OS_NATIVE_EXIT(env, that, PMPrintSettingsSetValue_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrinterCreateFromPrinterID >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterCreateFromPrinterID) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrinterCreateFromPrinterID_FUNC); >+ rc = (jintLong)PMPrinterCreateFromPrinterID((CFStringRef)arg0); >+ OS_NATIVE_EXIT(env, that, PMPrinterCreateFromPrinterID_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrinterGetMimeTypes >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetMimeTypes) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2) >+{ >+ jint *lparg2=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrinterGetMimeTypes_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPrinterGetMimeTypes((PMPrinter)arg0, (PMPrintSettings)arg1, (CFArrayRef*)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, PMPrinterGetMimeTypes_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrinterGetName >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetName) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrinterGetName_FUNC); >+ rc = (jintLong)PMPrinterGetName((PMPrinter)arg0); >+ OS_NATIVE_EXIT(env, that, PMPrinterGetName_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrinterGetOutputResolution >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetOutputResolution) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdoubleArray arg2) >+{ >+ jdouble *lparg2=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrinterGetOutputResolution_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPrinterGetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution*)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseDoubleArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, PMPrinterGetOutputResolution_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrinterGetPaperList >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetPaperList) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrinterGetPaperList_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPrinterGetPaperList((PMPrinter)arg0, (CFArrayRef*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMPrinterGetPaperList_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMPrinterSetOutputResolution >+JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterSetOutputResolution) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdoubleArray arg2) >+{ >+ jdouble *lparg2=NULL; >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, PMPrinterSetOutputResolution_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jintLong)PMPrinterSetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution*)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseDoubleArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, PMPrinterSetOutputResolution_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMRelease >+JNIEXPORT jint JNICALL OS_NATIVE(PMRelease) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, PMRelease_FUNC); >+ rc = (jint)PMRelease((PMObject)arg0); >+ OS_NATIVE_EXIT(env, that, PMRelease_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMSessionGetCurrentPrinter >+JNIEXPORT jint JNICALL OS_NATIVE(PMSessionGetCurrentPrinter) >+ (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >+{ >+ jint *lparg1=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, PMSessionGetCurrentPrinter_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jint)PMSessionGetCurrentPrinter((PMPrintSession)arg0, (PMPrinter*)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, PMSessionGetCurrentPrinter_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_PMSetDuplex >+JNIEXPORT void JNICALL OS_NATIVE(PMSetDuplex) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >+{ >+ OS_NATIVE_ENTER(env, that, PMSetDuplex_FUNC); >+ PMSetDuplex((PMPrintSettings)arg0, (PMDuplexMode)arg1); >+ OS_NATIVE_EXIT(env, that, PMSetDuplex_FUNC); >+} >+#endif >+ > #ifndef NO_PtInRgn > JNIEXPORT jboolean JNICALL OS_NATIVE(PtInRgn) > (JNIEnv *env, jclass that, jshortArray arg0, jintLong arg1) >Index: Eclipse SWT PI/cocoa/library/os_stats.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c,v >retrieving revision 1.115 >diff -u -r1.115 os_stats.c >--- Eclipse SWT PI/cocoa/library/os_stats.c 22 Feb 2010 20:48:38 -0000 1.115 >+++ Eclipse SWT PI/cocoa/library/os_stats.c 4 Mar 2010 19:37:26 -0000 >@@ -14,8 +14,8 @@ > > #ifdef NATIVE_STATS > >-int OS_nativeFunctionCount = 552; >-int OS_nativeFunctionCallCount[552]; >+int OS_nativeFunctionCount = 585; >+int OS_nativeFunctionCallCount[585]; > char * OS_nativeFunctionNames[] = { > "ATSFontActivateFromFileReference", > "AcquireRootMenu", >@@ -54,11 +54,15 @@ > "CALLBACK_1titleRectForBounds_1", > "CALLBACK_1view_1stringForToolTip_1point_1userData_1", > "CALLBACK_1webView_1setFrame_1", >+ "CFArrayGetCount", >+ "CFArrayGetValueAtIndex", > "CFAttributedStringCreate", > "CFDataGetBytePtr", > "CFDataGetLength", > "CFDictionaryAddValue", > "CFDictionaryCreateMutable", >+ "CFNumberCreate", >+ "CFNumberGetValue", > "CFRange_1sizeof", > "CFRelease", > "CFRunLoopAddObserver", >@@ -331,7 +335,10 @@ > "NSPrintJobDisposition", > "NSPrintLastPage", > "NSPrintMustCollate", >+ "NSPrintPagesAcross", >+ "NSPrintPagesDown", > "NSPrintPreviewJob", >+ "NSPrintPrinterName", > "NSPrintSaveJob", > "NSPrintSavePath", > "NSPrintScalingFactor", >@@ -366,6 +373,32 @@ > "NewRgn", > "OffsetRgn", > "OpenRgn", >+ "PMCopyPageFormat", >+ "PMCreatePageFormatWithPMPaper", >+ "PMCreatePrintSettings", >+ "PMCreateSession", >+ "PMGetDuplex", >+ "PMGetPageFormatPaper", >+ "PMPageFormatGetPrinterID", >+ "PMPaperCreateCustom", >+ "PMPaperCreateLocalizedName", >+ "PMPaperGetHeight", >+ "PMPaperGetID", >+ "PMPaperGetName", >+ "PMPaperGetWidth", >+ "PMPaperIsCustom", >+ "PMPrintSettingsCopyKeys", >+ "PMPrintSettingsGetValue", >+ "PMPrintSettingsSetValue", >+ "PMPrinterCreateFromPrinterID", >+ "PMPrinterGetMimeTypes", >+ "PMPrinterGetName", >+ "PMPrinterGetOutputResolution", >+ "PMPrinterGetPaperList", >+ "PMPrinterSetOutputResolution", >+ "PMRelease", >+ "PMSessionGetCurrentPrinter", >+ "PMSetDuplex", > "PtInRgn", > "QDRegionToRects", > "RectInRgn", >Index: Eclipse SWT PI/cocoa/library/os_stats.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h,v >retrieving revision 1.115 >diff -u -r1.115 os_stats.h >--- Eclipse SWT PI/cocoa/library/os_stats.h 22 Feb 2010 20:48:38 -0000 1.115 >+++ Eclipse SWT PI/cocoa/library/os_stats.h 4 Mar 2010 19:37:29 -0000 >@@ -62,11 +62,15 @@ > CALLBACK_1titleRectForBounds_1_FUNC, > CALLBACK_1view_1stringForToolTip_1point_1userData_1_FUNC, > CALLBACK_1webView_1setFrame_1_FUNC, >+ CFArrayGetCount_FUNC, >+ CFArrayGetValueAtIndex_FUNC, > CFAttributedStringCreate_FUNC, > CFDataGetBytePtr_FUNC, > CFDataGetLength_FUNC, > CFDictionaryAddValue_FUNC, > CFDictionaryCreateMutable_FUNC, >+ CFNumberCreate_FUNC, >+ CFNumberGetValue_FUNC, > CFRange_1sizeof_FUNC, > CFRelease_FUNC, > CFRunLoopAddObserver_FUNC, >@@ -339,7 +343,10 @@ > NSPrintJobDisposition_FUNC, > NSPrintLastPage_FUNC, > NSPrintMustCollate_FUNC, >+ NSPrintPagesAcross_FUNC, >+ NSPrintPagesDown_FUNC, > NSPrintPreviewJob_FUNC, >+ NSPrintPrinterName_FUNC, > NSPrintSaveJob_FUNC, > NSPrintSavePath_FUNC, > NSPrintScalingFactor_FUNC, >@@ -374,6 +381,32 @@ > NewRgn_FUNC, > OffsetRgn_FUNC, > OpenRgn_FUNC, >+ PMCopyPageFormat_FUNC, >+ PMCreatePageFormatWithPMPaper_FUNC, >+ PMCreatePrintSettings_FUNC, >+ PMCreateSession_FUNC, >+ PMGetDuplex_FUNC, >+ PMGetPageFormatPaper_FUNC, >+ PMPageFormatGetPrinterID_FUNC, >+ PMPaperCreateCustom_FUNC, >+ PMPaperCreateLocalizedName_FUNC, >+ PMPaperGetHeight_FUNC, >+ PMPaperGetID_FUNC, >+ PMPaperGetName_FUNC, >+ PMPaperGetWidth_FUNC, >+ PMPaperIsCustom_FUNC, >+ PMPrintSettingsCopyKeys_FUNC, >+ PMPrintSettingsGetValue_FUNC, >+ PMPrintSettingsSetValue_FUNC, >+ PMPrinterCreateFromPrinterID_FUNC, >+ PMPrinterGetMimeTypes_FUNC, >+ PMPrinterGetName_FUNC, >+ PMPrinterGetOutputResolution_FUNC, >+ PMPrinterGetPaperList_FUNC, >+ PMPrinterSetOutputResolution_FUNC, >+ PMRelease_FUNC, >+ PMSessionGetCurrentPrinter_FUNC, >+ PMSetDuplex_FUNC, > PtInRgn_FUNC, > QDRegionToRects_FUNC, > RectInRgn_FUNC, >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java,v >retrieving revision 1.12 >diff -u -r1.12 NSPrintInfo.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java 1 Jul 2009 14:49:14 -0000 1.12 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java 4 Mar 2010 19:37:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -24,6 +24,14 @@ > super(id); > } > >+public int /*long*/ PMPrintSession() { >+ return OS.objc_msgSend(this.id, OS.sel_PMPrintSession); >+} >+ >+public int /*long*/ PMPrintSettings() { >+ return OS.objc_msgSend(this.id, OS.sel_PMPrintSettings); >+} >+ > public static NSPrinter defaultPrinter() { > int /*long*/ result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_defaultPrinter); > return result != 0 ? new NSPrinter(result) : null; >@@ -45,6 +53,14 @@ > return result == this.id ? this : (result != 0 ? new NSPrintInfo(result) : null); > } > >+public void setPaperName (NSString paperName) { >+ OS.objc_msgSend(this.id, OS.sel_setPaperName, paperName != null ? paperName.id : 0); >+} >+ >+public void setPaperSize (NSSize paperSize) { >+ OS.objc_msgSend(this.id, OS.sel_setPaperSize, paperSize != null ? paperSize : null); >+} >+ > public NSString jobDisposition() { > int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_jobDisposition); > return result != 0 ? new NSString(result) : null; >@@ -60,6 +76,34 @@ > return result; > } > >+public NSString paperName() { >+ int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_paperName); >+ return result != 0 ? new NSString(result) : null; >+} >+ >+public int /*long*/ pmPageFormat() { >+ return OS.objc_msgSend(this.id, OS.sel_pmPageFormat); >+} >+ >+public float bottomMargin () { >+ return OS.objc_msgSend(this.id, OS.sel_bottomMargin); >+} >+ >+public float topMargin () { >+ return OS.objc_msgSend(this.id, OS.sel_topMargin); >+} >+ >+public float leftMargin () { >+ return OS.objc_msgSend(this.id, OS.sel_leftMargin); >+} >+ >+public float rightMargin () { >+ return OS.objc_msgSend(this.id, OS.sel_rightMargin); >+} >+ >+public void updateFromPMPageFormat() { >+ OS.objc_msgSend(this.id, OS.sel_updateFromPMPageFormat); >+} > public NSPrinter printer() { > int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_printer); > return result != 0 ? new NSPrinter(result) : null; >@@ -86,4 +130,8 @@ > return result != 0 ? new NSPrintInfo(result) : null; > } > >+public void updateFromPMPrintSettings() { >+ OS.objc_msgSend(this.id, OS.sel_updateFromPMPrintSettings); >+} >+ > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java,v >retrieving revision 1.309 >diff -u -r1.309 OS.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java 24 Feb 2010 13:00:35 -0000 1.309 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java 4 Mar 2010 19:37:36 -0000 >@@ -674,6 +674,8 @@ > public static final int /*long*/ sel_CGEvent = sel_registerName("CGEvent"); > public static final int /*long*/ sel_DOMDocument = sel_registerName("DOMDocument"); > public static final int /*long*/ sel_IBeamCursor = sel_registerName("IBeamCursor"); >+public static final int /*long*/ sel_PMPrintSettings = sel_registerName("PMPrintSettings"); >+public static final int /*long*/ sel_PMPrintSession = sel_registerName("PMPrintSession"); > public static final int /*long*/ sel_TIFFRepresentation = sel_registerName("TIFFRepresentation"); > public static final int /*long*/ sel_URL = sel_registerName("URL"); > public static final int /*long*/ sel_URLFromPasteboard_ = sel_registerName("URLFromPasteboard:"); >@@ -1200,6 +1202,15 @@ > public static final int /*long*/ sel_itemObjectValueAtIndex_ = sel_registerName("itemObjectValueAtIndex:"); > public static final int /*long*/ sel_itemTitleAtIndex_ = sel_registerName("itemTitleAtIndex:"); > public static final int /*long*/ sel_jobDisposition = sel_registerName("jobDisposition"); >+public static final int /*long*/ sel_setPaperName = sel_registerName("setPaperName:"); >+public static final int /*long*/ sel_setPaperSize = sel_registerName("setPaperSize:"); >+public static final int /*long*/ sel_paperName = sel_registerName("PaperName"); >+public static final int /*long*/ sel_pmPageFormat = sel_registerName("PMPageFormat"); >+public static final int /*long*/ sel_bottomMargin = sel_registerName("bottomMargin"); >+public static final int /*long*/ sel_topMargin = sel_registerName("topMargin"); >+public static final int /*long*/ sel_leftMargin = sel_registerName("leftMargin"); >+public static final int /*long*/ sel_rightMargin = sel_registerName("rightMargin"); >+public static final int /*long*/ sel_updateFromPMPageFormat = sel_registerName("updateFromPMPageFormat"); > public static final int /*long*/ sel_keyCode = sel_registerName("keyCode"); > public static final int /*long*/ sel_keyDown_ = sel_registerName("keyDown:"); > public static final int /*long*/ sel_keyEquivalent = sel_registerName("keyEquivalent"); >@@ -1853,6 +1864,7 @@ > public static final int /*long*/ sel_unmarkText = sel_registerName("unmarkText"); > public static final int /*long*/ sel_unregisterDraggedTypes = sel_registerName("unregisterDraggedTypes"); > public static final int /*long*/ sel_update = sel_registerName("update"); >+public static final int /*long*/ sel_updateFromPMPrintSettings = sel_registerName("updateFromPMPrintSettings"); > public static final int /*long*/ sel_updateTrackingAreas = sel_registerName("updateTrackingAreas"); > public static final int /*long*/ sel_use = sel_registerName("use"); > public static final int /*long*/ sel_useCredential_forAuthenticationChallenge_ = sel_registerName("useCredential:forAuthenticationChallenge:"); >@@ -1936,6 +1948,151 @@ > public static final int /*long*/ sel_yearOfCommonEra = sel_registerName("yearOfCommonEra"); > public static final int /*long*/ sel_zoom_ = sel_registerName("zoom:"); > >+/** >+ * @param printSettings cast=(PMPrintSettings) >+ * @param duplexSetting cast=(PMDuplexMode) >+ * */ >+public static final native void PMSetDuplex(int /*long*/ printSettings, int duplexSetting); >+/** >+ * @param printSettings cast=(PMPrintSettings) >+ * @param duplexSetting cast=(PMDuplexMode*) >+ * */ >+public static final native void PMGetDuplex(int /*long*/ printSettings, int[] duplexSetting); >+/** >+ * @param printSettings cast=(PMPrintSettings) >+ * @param key cast=(CFStringRef) >+ * @param value cast=(CFTypeRef) >+ * @param locked cast=(Boolean) >+ * */ >+public static final native int PMPrintSettingsSetValue(int /*long*/ printSettings, int /*long*/ key, int value, boolean locked); >+/** >+ * @param printSettings cast=(PMPrintSettings) >+ * @param key cast=(CFStringRef) >+ * @param value cast=(CFTypeRef*) >+ * */ >+public static final native int PMPrintSettingsGetValue(int /*long*/ printSettings, int /*long*/ key, int[] value); >+/** >+ * @param printSettings cast=(PMPrintSettings) >+ * @param settingsKeys cast=(CFArrayRef*) >+ */ >+public static final native int PMPrintSettingsCopyKeys(int /*long*/ printSettings, int[] settingsKeys); >+ >+/** @param printSession cast=(PMPrintSession*) */ >+public static final native int PMCreateSession(int[] printSession); >+/** >+ * @param printSession cast=(PMPrintSession) >+ * @param currentPrinter cast=(PMPrinter*) >+ */ >+public static final native int PMSessionGetCurrentPrinter(int /*long*/ printSession, int[] currentPrinter); >+/** >+ * @param printer cast=(PMPrinter) >+ * @param paperList cast=(CFArrayRef*) >+ */ >+public static final native int /*long*/ PMPrinterGetPaperList (int /*long*/ printer, int[] paperList); >+/** @param object cast =(PMObject) */ >+public static final native int PMRelease (int /*long*/ object); >+/** >+ * @param pageFormat cast=(PMPageFormat) >+ * @param printerID cast=(CFStringRef*) >+ */ >+public static final native int /*long*/ PMPageFormatGetPrinterID (int /*long*/ pageFormat, int[] printerID); >+/** >+ * @param pageFormat cast=(PMPageFormat*) >+ * @param paper cast=(PMPaper) >+ */ >+public static final native int /*long*/ PMCreatePageFormatWithPMPaper (int[] pageFormat, int /*long*/ paper); >+/** >+ * @param format cast=(PMPageFormat) >+ * @param paper cast=(PMPaper*) >+ */ >+public static final native int /*long*/ PMGetPageFormatPaper (int/*long*/ format, int[] /*long*/ paper); >+/** >+ * @param paper cast=(PMPaper) >+ * @param paperWidth cast=(double*) >+ */ >+public static final native int /*long*/ PMPaperGetWidth (int /*long*/ paper, double[] paperWidth); >+/** >+ * @param paper cast=(PMPaper) >+ * @param paperHeight cast=(double*) >+ */ >+public static final native int /*long*/ PMPaperGetHeight (int /*long*/ paper, double[] paperHeight); >+/** >+ * @param formatSrc cast=(PMPageFormat) >+ * @param formatDest cast=(PMPageFormat) >+ */ >+public static final native int /*long*/ PMCopyPageFormat (int /*long*/ formatSrc, int /*long*/ formatDest); >+/** >+ * @param paper cast=(PMPaper) >+ * @param paperName cast=(CFStringRef*) >+ */ >+public static final native int /*long*/ PMPaperGetName (int /*long*/ paper, int[] paperName); >+/** >+ * @param printer cast=(PMPrinter) >+ * @param id cast=(CFStringRef) >+ * @param name cast=(CFStringRef) >+ * @param width cast=(double) >+ * @param height cast=(double) >+ * @param margins cast=(const PMPaperMargins*) >+ * @param paperP cast=(PMPaper*) >+ */ >+public static final native int /*long*/ PMPaperCreateCustom (int /*long*/ printer, int /*long*/ id, int /*long*/ name, double width, double height, double[] margins, int[] paperP); >+/** >+ * @param paper cast=(PMPaper) >+ * @param printer cast=(PMPrinter) >+ * @param paperName cast=(CFStringRef*) >+ */ >+public static final native int /*long*/ PMPaperCreateLocalizedName (int /*long*/ paper, int /*long*/ printer, int[] /*long*/ paperName); >+/** @param paper cast=(PMPaper) */ >+public static final native boolean PMPaperIsCustom (int /*long*/ paper); >+/** @param printer cast=(PMPrinter)*/ >+public static final native int /*long*/ PMPrinterGetName (int /*long*/ printer); >+/** >+ * @param paper cast=(PMPaper) >+ * @param paperID cast=(CFStringRef*) >+ */ >+public static final native int /*long*/ PMPaperGetID (int /*long*/ paper, int[] paperID); >+/** >+ * @param printer cast=(PMPrinter) >+ * @param settings cast=(PMPrintSettings) >+ * @param mimeTypes cast=(CFArrayRef*) >+ */ >+public static final native int /*long*/ PMPrinterGetMimeTypes(int /*long*/ printer, int /*long*/ settings, int[] mimeTypes); >+/** >+ * @param printer cast=(PMPrinter) >+ * @param printSettings cast=(PMPrintSettings) >+ * @param resolutionP cast=(PMResolution*) >+ */ >+public static final native int /*long*/ PMPrinterGetOutputResolution(int /*long*/ printer, int /*long*/ printSettings, double[] resolutionP); >+/** >+ * @param printer cast=(PMPrinter) >+ * @param printSettings cast=(PMPrintSettings) >+ * @param resolutionP cast=(PMResolution*) >+ */ >+public static final native int /*long*/ PMPrinterSetOutputResolution(int /*long*/ printer, int /*long*/ printSettings, double[] resolutionP); >+/** @param printerID cast=(CFStringRef) */ >+public static final native int /*long*/ PMPrinterCreateFromPrinterID(int /*long*/ printerID); >+/** @param printSettings cast=(PMPrintSettings*) */ >+public static final native int /*long*/ PMCreatePrintSettings (int[] printSettings); >+/** >+ * @param allocator cast=(CFAllocatorRef) >+ * @param theType cast=(CFNumberType) >+ * @param valuePtr cast=(const void *) >+ */ >+public static final native int /*long*/ CFNumberCreate (int /*long*/ allocator,int theType, int[] valuePtr); >+/** >+ * @param number cast=(CFNumberRef) >+ * @param theType cast=(CFNumberType) >+ * @param valuePtr cast=(void *) >+ */ >+public static final native boolean CFNumberGetValue(int /*long*/ number, int theType, int[] valuePtr); >+/** @param theArray cast=(CFArrayRef) */ >+public static final native int /*long*/ CFArrayGetCount (int theArray); >+/** >+ * @param theArray cast=(CFArrayRef) >+ * @param idx cast=(CFIndex) >+ */ >+public static final native int /*long*/ CFArrayGetValueAtIndex (int /*long*/ theArray, int idx); >+ > /** Constants */ > public static final int NSAlertFirstButtonReturn = 1000; > public static final int NSAlertSecondButtonReturn = 1001; >@@ -2049,6 +2206,7 @@ > public static final int NSPageUpFunctionKey = 63276; > public static final int NSPortraitOrientation = 0; > public static final int NSPrintPanelShowsPageSetupAccessory = 256; >+public static final int NSPrintPanelShowsPrintSelection = 1 << 5; > public static final int NSProgressIndicatorPreferredThickness = 14; > public static final int NSPushOnPushOffButton = 1; > public static final int NSRadioButton = 4; >@@ -2554,9 +2712,18 @@ > public static final native int /*long*/ NSPrintSavePath(); > public static final NSString NSPrintSavePath = new NSString(NSPrintSavePath()); > /** @method flags=const */ >+public static final native int /*long*/ NSPrintPrinterName(); >+public static final NSString NSPrintPrinterName = new NSString(NSPrintPrinterName()); >+/** @method flags=const */ > public static final native int /*long*/ NSPrintScalingFactor(); > public static final NSString NSPrintScalingFactor = new NSString(NSPrintScalingFactor()); > /** @method flags=const */ >+public static final native int /*long*/ NSPrintPagesAcross(); >+public static final NSString NSPrintPagesAcross = new NSString(NSPrintPagesAcross()); >+/** @method flags=const */ >+public static final native int /*long*/ NSPrintPagesDown(); >+public static final NSString NSPrintPagesDown = new NSString(NSPrintPagesDown()); >+/** @method flags=const */ > public static final native int /*long*/ NSPrintSpoolJob(); > public static final NSString NSPrintSpoolJob = new NSString(NSPrintSpoolJob()); > /** @method flags=const */ >Index: Eclipse SWT PI/gtk/library/os.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c,v >retrieving revision 1.291 >diff -u -r1.291 os.c >--- Eclipse SWT PI/gtk/library/os.c 2 Feb 2010 10:56:39 -0000 1.291 >+++ Eclipse SWT PI/gtk/library/os.c 4 Mar 2010 19:37:56 -0000 >@@ -11181,6 +11181,26 @@ > } > #endif > >+#ifndef NO__1gtk_1paper_1size_1get_1paper_1sizes >+JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1paper_1sizes) >+ (JNIEnv *env, jclass that, jboolean arg0) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1paper_1size_1get_1paper_1sizes_FUNC); >+/* >+ rc = (jintLong)gtk_paper_size_get_paper_sizes(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_paper_size_get_paper_sizes) >+ if (fp) { >+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jboolean))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1paper_1size_1get_1paper_1sizes_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO__1gtk_1paper_1size_1get_1ppd_1name > JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1ppd_1name) > (JNIEnv *env, jclass that, jintLong arg0) >@@ -11578,6 +11598,66 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1get_1default_1source >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1default_1source) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1default_1source_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_default_source(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_default_source) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1default_1source_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1get_1duplex >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1duplex) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1duplex_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_duplex(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_duplex) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1duplex_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1get_1media_1type >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1media_1type) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1media_1type_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_media_type(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_media_type) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1media_1type_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1get_1n_1copies > JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1n_1copies) > (JNIEnv *env, jclass that, jintLong arg0) >@@ -11618,6 +11698,26 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1get_1output_1bin >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1output_1bin) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1output_1bin_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_output_bin(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_output_bin) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1output_1bin_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1get_1page_1ranges > JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1page_1ranges) > (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1) >@@ -11722,6 +11822,26 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1get_1quality >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1quality) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1quality_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_quality(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_quality) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1quality_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1get_1resolution > JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution) > (JNIEnv *env, jclass that, jintLong arg0) >@@ -11742,6 +11862,106 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1get_1resolution_1x >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution_1x) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1resolution_1x_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_resolution_x(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_resolution_x) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1resolution_1x_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1get_1resolution_1y >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution_1y) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1resolution_1y_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_resolution_y(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_resolution_y) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1resolution_1y_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1get_1reverse >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1reverse) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_reverse(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_reverse) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1get_1scale >+JNIEXPORT jdouble JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1scale) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jdouble rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1scale_FUNC); >+/* >+ rc = (jdouble)gtk_print_settings_get_scale(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_scale) >+ if (fp) { >+ rc = (jdouble)((jdouble (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1scale_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1get_1use_1color >+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1use_1color) >+ (JNIEnv *env, jclass that, jintLong arg0) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC); >+/* >+ rc = (jint)gtk_print_settings_get_use_color(arg0); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_get_use_color) >+ if (fp) { >+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1new > JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new) > (JNIEnv *env, jclass that) >@@ -11805,6 +12025,68 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1set_1default_1source >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1default_1source) >+ (JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1) >+{ >+ jbyte *lparg1=NULL; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; >+/* >+ gtk_print_settings_set_default_source(arg0, lparg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_default_source) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1); >+ } >+ } >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1set_1duplex >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1duplex) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC); >+/* >+ gtk_print_settings_set_duplex(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_duplex) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1set_1media_1type >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1media_1type) >+ (JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1) >+{ >+ jbyte *lparg1=NULL; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; >+/* >+ gtk_print_settings_set_media_type(arg0, lparg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_media_type) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1); >+ } >+ } >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1set_1n_1copies > JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies) > (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >@@ -11823,6 +12105,24 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1set_1number_1up >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1number_1up) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC); >+/* >+ gtk_print_settings_set_number_up(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_number_up) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1set_1orientation > JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation) > (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >@@ -11841,6 +12141,28 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1set_1output_1bin >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1output_1bin) >+ (JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1) >+{ >+ jbyte *lparg1=NULL; >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; >+/* >+ gtk_print_settings_set_output_bin(arg0, lparg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_output_bin) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1); >+ } >+ } >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1set_1page_1ranges > JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges) > (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2) >@@ -11863,6 +12185,24 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1set_1paper_1size >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1paper_1size) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC); >+/* >+ gtk_print_settings_set_paper_size(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_paper_size) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1print_1settings_1set_1print_1pages > JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages) > (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >@@ -11903,6 +12243,96 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1settings_1set_1quality >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1quality) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1quality_FUNC); >+/* >+ gtk_print_settings_set_quality(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_quality) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1quality_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1set_1resolution_1xy >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1resolution_1xy) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1resolution_1xy_FUNC); >+/* >+ gtk_print_settings_set_resolution_xy(arg0, arg1, arg2); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_resolution_xy) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jint, jint))fp)(arg0, arg1, arg2); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1resolution_1xy_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1set_1reverse >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1reverse) >+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC); >+/* >+ gtk_print_settings_set_reverse(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_reverse) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1set_1scale >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1scale) >+ (JNIEnv *env, jclass that, jintLong arg0, jdouble arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1scale_FUNC); >+/* >+ gtk_print_settings_set_scale(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_scale) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jdouble))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1scale_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1settings_1set_1use_1color >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1use_1color) >+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC); >+/* >+ gtk_print_settings_set_use_color(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_settings_set_use_color) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page > JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page) > (JNIEnv *env, jclass that, jintLong arg0) >@@ -12025,6 +12455,42 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup) >+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC); >+/* >+ gtk_print_unix_dialog_set_embed_page_setup(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_embed_page_setup) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC); >+} >+#endif >+ >+#ifndef NO__1gtk_1print_1unix_1dialog_1set_1has_1selection >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1has_1selection) >+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC); >+/* >+ gtk_print_unix_dialog_set_has_selection(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_has_selection) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities > JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities) > (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) >@@ -12079,6 +12545,24 @@ > } > #endif > >+#ifndef NO__1gtk_1print_1unix_1dialog_1set_1support_1selection >+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1support_1selection) >+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) >+{ >+ OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC); >+/* >+ gtk_print_unix_dialog_set_support_selection(arg0, arg1); >+*/ >+ { >+ LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_support_selection) >+ if (fp) { >+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); >+ } >+ } >+ OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC); >+} >+#endif >+ > #ifndef NO__1gtk_1printer_1get_1backend > JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1printer_1get_1backend) > (JNIEnv *env, jclass that, jintLong arg0) >Index: Eclipse SWT PI/gtk/library/os_custom.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h,v >retrieving revision 1.90 >diff -u -r1.90 os_custom.h >--- Eclipse SWT PI/gtk/library/os_custom.h 21 Jan 2010 19:47:38 -0000 1.90 >+++ Eclipse SWT PI/gtk/library/os_custom.h 4 Mar 2010 19:37:57 -0000 >@@ -150,6 +150,9 @@ > #define gdk_cairo_region_LIB "libgdk-x11-2.0.so.0" > #define gdk_cairo_create_LIB "libgdk-x11-2.0.so.0" > #define gtk_enumerate_printers_LIB "libgtk-x11-2.0.so.0" >+#define gtk_printer_get_backend_LIB "libgtk-x11-2.0.so.0" >+#define gtk_printer_get_name_LIB "libgtk-x11-2.0.so.0" >+#define gtk_printer_is_default_LIB "libgtk-x11-2.0.so.0" > #define gtk_page_setup_get_bottom_margin_LIB "libgtk-x11-2.0.so.0" > #define gtk_page_setup_get_left_margin_LIB "libgtk-x11-2.0.so.0" > #define gtk_page_setup_get_orientation_LIB "libgtk-x11-2.0.so.0" >@@ -177,6 +180,7 @@ > #define gtk_paper_size_new_LIB "libgtk-x11-2.0.so.0" > #define gtk_paper_size_new_custom_LIB "libgtk-x11-2.0.so.0" > #define gtk_paper_size_new_from_ppd_LIB "libgtk-x11-2.0.so.0" >+#define gtk_paper_size_get_paper_sizes_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_job_get_printer_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_job_get_settings_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_job_get_status_LIB "libgtk-x11-2.0.so.0" >@@ -204,6 +208,27 @@ > #define gtk_print_settings_set_page_ranges_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_settings_set_print_pages_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_settings_set_printer_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_number_up_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_scale_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_scale_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_paper_size_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_duplex_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_duplex_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_reverse_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_reverse_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_default_source_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_default_source_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_media_type_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_media_type_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_output_bin_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_output_bin_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_use_color_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_use_color_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_quality_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_quality_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_set_resolution_xy_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_resolution_x_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_settings_get_resolution_y_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_unix_dialog_get_current_page_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_unix_dialog_get_page_setup_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_unix_dialog_get_selected_printer_LIB "libgtk-x11-2.0.so.0" >@@ -213,9 +238,9 @@ > #define gtk_print_unix_dialog_set_manual_capabilities_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_unix_dialog_set_page_setup_LIB "libgtk-x11-2.0.so.0" > #define gtk_print_unix_dialog_set_settings_LIB "libgtk-x11-2.0.so.0" >-#define gtk_printer_get_backend_LIB "libgtk-x11-2.0.so.0" >-#define gtk_printer_get_name_LIB "libgtk-x11-2.0.so.0" >-#define gtk_printer_is_default_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_unix_dialog_set_embed_page_setup_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_unix_dialog_set_has_selection_LIB "libgtk-x11-2.0.so.0" >+#define gtk_print_unix_dialog_set_support_selection_LIB "libgtk-x11-2.0.so.0" > #define FcConfigAppFontAddFile_LIB "libfontconfig.so.1" > > #define g_app_info_create_from_commandline_LIB "libgio-2.0.so.0" >Index: Eclipse SWT PI/gtk/library/os_stats.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c,v >retrieving revision 1.198 >diff -u -r1.198 os_stats.c >--- Eclipse SWT PI/gtk/library/os_stats.c 2 Feb 2010 10:56:40 -0000 1.198 >+++ Eclipse SWT PI/gtk/library/os_stats.c 4 Mar 2010 19:37:58 -0000 >@@ -18,8 +18,8 @@ > > #ifdef NATIVE_STATS > >-int OS_nativeFunctionCount = 1354; >-int OS_nativeFunctionCallCount[1354]; >+int OS_nativeFunctionCount = 1379; >+int OS_nativeFunctionCallCount[1379]; > char * OS_nativeFunctionNames[] = { > #ifndef JNI64 > "Call__IIII", >@@ -889,6 +889,7 @@ > "_1gtk_1paper_1size_1get_1display_1name", > "_1gtk_1paper_1size_1get_1height", > "_1gtk_1paper_1size_1get_1name", >+ "_1gtk_1paper_1size_1get_1paper_1sizes", > "_1gtk_1paper_1size_1get_1ppd_1name", > "_1gtk_1paper_1size_1get_1width", > "_1gtk_1paper_1size_1is_1custom", >@@ -908,31 +909,55 @@ > "_1gtk_1print_1settings_1foreach", > "_1gtk_1print_1settings_1get", > "_1gtk_1print_1settings_1get_1collate", >+ "_1gtk_1print_1settings_1get_1default_1source", >+ "_1gtk_1print_1settings_1get_1duplex", >+ "_1gtk_1print_1settings_1get_1media_1type", > "_1gtk_1print_1settings_1get_1n_1copies", > "_1gtk_1print_1settings_1get_1orientation", >+ "_1gtk_1print_1settings_1get_1output_1bin", > "_1gtk_1print_1settings_1get_1page_1ranges", > "_1gtk_1print_1settings_1get_1paper_1height", > "_1gtk_1print_1settings_1get_1paper_1width", > "_1gtk_1print_1settings_1get_1print_1pages", > "_1gtk_1print_1settings_1get_1printer", >+ "_1gtk_1print_1settings_1get_1quality", > "_1gtk_1print_1settings_1get_1resolution", >+ "_1gtk_1print_1settings_1get_1resolution_1x", >+ "_1gtk_1print_1settings_1get_1resolution_1y", >+ "_1gtk_1print_1settings_1get_1reverse", >+ "_1gtk_1print_1settings_1get_1scale", >+ "_1gtk_1print_1settings_1get_1use_1color", > "_1gtk_1print_1settings_1new", > "_1gtk_1print_1settings_1set", > "_1gtk_1print_1settings_1set_1collate", >+ "_1gtk_1print_1settings_1set_1default_1source", >+ "_1gtk_1print_1settings_1set_1duplex", >+ "_1gtk_1print_1settings_1set_1media_1type", > "_1gtk_1print_1settings_1set_1n_1copies", >+ "_1gtk_1print_1settings_1set_1number_1up", > "_1gtk_1print_1settings_1set_1orientation", >+ "_1gtk_1print_1settings_1set_1output_1bin", > "_1gtk_1print_1settings_1set_1page_1ranges", >+ "_1gtk_1print_1settings_1set_1paper_1size", > "_1gtk_1print_1settings_1set_1print_1pages", > "_1gtk_1print_1settings_1set_1printer", >+ "_1gtk_1print_1settings_1set_1quality", >+ "_1gtk_1print_1settings_1set_1resolution_1xy", >+ "_1gtk_1print_1settings_1set_1reverse", >+ "_1gtk_1print_1settings_1set_1scale", >+ "_1gtk_1print_1settings_1set_1use_1color", > "_1gtk_1print_1unix_1dialog_1get_1current_1page", > "_1gtk_1print_1unix_1dialog_1get_1page_1setup", > "_1gtk_1print_1unix_1dialog_1get_1selected_1printer", > "_1gtk_1print_1unix_1dialog_1get_1settings", > "_1gtk_1print_1unix_1dialog_1new", > "_1gtk_1print_1unix_1dialog_1set_1current_1page", >+ "_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup", >+ "_1gtk_1print_1unix_1dialog_1set_1has_1selection", > "_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities", > "_1gtk_1print_1unix_1dialog_1set_1page_1setup", > "_1gtk_1print_1unix_1dialog_1set_1settings", >+ "_1gtk_1print_1unix_1dialog_1set_1support_1selection", > "_1gtk_1printer_1get_1backend", > "_1gtk_1printer_1get_1name", > "_1gtk_1printer_1is_1default", >Index: Eclipse SWT PI/gtk/library/os_stats.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h,v >retrieving revision 1.199 >diff -u -r1.199 os_stats.h >--- Eclipse SWT PI/gtk/library/os_stats.h 2 Feb 2010 10:56:40 -0000 1.199 >+++ Eclipse SWT PI/gtk/library/os_stats.h 4 Mar 2010 19:37:59 -0000 >@@ -897,6 +897,7 @@ > _1gtk_1paper_1size_1get_1display_1name_FUNC, > _1gtk_1paper_1size_1get_1height_FUNC, > _1gtk_1paper_1size_1get_1name_FUNC, >+ _1gtk_1paper_1size_1get_1paper_1sizes_FUNC, > _1gtk_1paper_1size_1get_1ppd_1name_FUNC, > _1gtk_1paper_1size_1get_1width_FUNC, > _1gtk_1paper_1size_1is_1custom_FUNC, >@@ -916,31 +917,55 @@ > _1gtk_1print_1settings_1foreach_FUNC, > _1gtk_1print_1settings_1get_FUNC, > _1gtk_1print_1settings_1get_1collate_FUNC, >+ _1gtk_1print_1settings_1get_1default_1source_FUNC, >+ _1gtk_1print_1settings_1get_1duplex_FUNC, >+ _1gtk_1print_1settings_1get_1media_1type_FUNC, > _1gtk_1print_1settings_1get_1n_1copies_FUNC, > _1gtk_1print_1settings_1get_1orientation_FUNC, >+ _1gtk_1print_1settings_1get_1output_1bin_FUNC, > _1gtk_1print_1settings_1get_1page_1ranges_FUNC, > _1gtk_1print_1settings_1get_1paper_1height_FUNC, > _1gtk_1print_1settings_1get_1paper_1width_FUNC, > _1gtk_1print_1settings_1get_1print_1pages_FUNC, > _1gtk_1print_1settings_1get_1printer_FUNC, >+ _1gtk_1print_1settings_1get_1quality_FUNC, > _1gtk_1print_1settings_1get_1resolution_FUNC, >+ _1gtk_1print_1settings_1get_1resolution_1x_FUNC, >+ _1gtk_1print_1settings_1get_1resolution_1y_FUNC, >+ _1gtk_1print_1settings_1get_1reverse_FUNC, >+ _1gtk_1print_1settings_1get_1scale_FUNC, >+ _1gtk_1print_1settings_1get_1use_1color_FUNC, > _1gtk_1print_1settings_1new_FUNC, > _1gtk_1print_1settings_1set_FUNC, > _1gtk_1print_1settings_1set_1collate_FUNC, >+ _1gtk_1print_1settings_1set_1default_1source_FUNC, >+ _1gtk_1print_1settings_1set_1duplex_FUNC, >+ _1gtk_1print_1settings_1set_1media_1type_FUNC, > _1gtk_1print_1settings_1set_1n_1copies_FUNC, >+ _1gtk_1print_1settings_1set_1number_1up_FUNC, > _1gtk_1print_1settings_1set_1orientation_FUNC, >+ _1gtk_1print_1settings_1set_1output_1bin_FUNC, > _1gtk_1print_1settings_1set_1page_1ranges_FUNC, >+ _1gtk_1print_1settings_1set_1paper_1size_FUNC, > _1gtk_1print_1settings_1set_1print_1pages_FUNC, > _1gtk_1print_1settings_1set_1printer_FUNC, >+ _1gtk_1print_1settings_1set_1quality_FUNC, >+ _1gtk_1print_1settings_1set_1resolution_1xy_FUNC, >+ _1gtk_1print_1settings_1set_1reverse_FUNC, >+ _1gtk_1print_1settings_1set_1scale_FUNC, >+ _1gtk_1print_1settings_1set_1use_1color_FUNC, > _1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC, > _1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC, > _1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC, > _1gtk_1print_1unix_1dialog_1get_1settings_FUNC, > _1gtk_1print_1unix_1dialog_1new_FUNC, > _1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC, >+ _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC, >+ _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC, > _1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC, > _1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC, > _1gtk_1print_1unix_1dialog_1set_1settings_FUNC, >+ _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC, > _1gtk_1printer_1get_1backend_FUNC, > _1gtk_1printer_1get_1name_FUNC, > _1gtk_1printer_1is_1default_FUNC, >Index: Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java,v >retrieving revision 1.549 >diff -u -r1.549 OS.java >--- Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java 2 Feb 2010 10:56:40 -0000 1.549 >+++ Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java 4 Mar 2010 19:38:11 -0000 >@@ -307,9 +307,11 @@ > public static final int GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5; > public static final int GTK_PRINT_CAPABILITY_GENERATE_PS = 1 << 6; > public static final int GTK_PRINT_CAPABILITY_PREVIEW = 1 << 7; >+ public static final int GTK_PRINT_CAPABILITY_NUMBER_UP = 1 << 8; > public static final int GTK_PRINT_PAGES_ALL = 0; > public static final int GTK_PRINT_PAGES_CURRENT = 1; > public static final int GTK_PRINT_PAGES_RANGES = 2; >+ public static final int GTK_PRINT_PAGES_SELECTION = 3; > public static final int GTK_PROGRESS_CONTINUOUS = 0x0; > public static final int GTK_PROGRESS_DISCRETE = 0x1; > public static final int GTK_PROGRESS_LEFT_TO_RIGHT = 0x0; >@@ -9050,6 +9052,16 @@ > } > } > /** @method flags=dynamic */ >+public static final native int /*long*/ _gtk_paper_size_get_paper_sizes(boolean include_custom); >+public static final int /*long*/ gtk_paper_size_get_paper_sizes(boolean include_custom) { >+ lock.lock(); >+ try { >+ return _gtk_paper_size_get_paper_sizes(include_custom); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ > public static final native int /*long*/ _gtk_print_settings_new(); > public static final int /*long*/ gtk_print_settings_new() { > lock.lock(); >@@ -9163,6 +9175,36 @@ > } > } > /** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_number_up(int /*long*/ settings, int number_up); >+public static final void gtk_print_settings_set_number_up(int /*long*/ settings, int number_up) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_number_up(settings, number_up); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_duplex(int /*long*/ settings, int duplex); >+public static final void gtk_print_settings_set_duplex(int /*long*/ settings, int duplex) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_duplex(settings, duplex); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_duplex(int /*long*/ settings); >+public static final int gtk_print_settings_get_duplex(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_duplex(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ > public static final native int _gtk_print_settings_get_n_copies(int /*long*/ settings); > public static final int gtk_print_settings_get_n_copies(int /*long*/ settings) { > lock.lock(); >@@ -9196,6 +9238,27 @@ > } > } > /** @method flags=dynamic */ >+public static final native double _gtk_print_settings_get_scale(int /*long*/ settings); >+public static final double gtk_print_settings_get_scale(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_scale(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic >+ * @param num_ranges cast=(gdouble)*/ >+public static final native void _gtk_print_settings_set_scale(int /*long*/ settings, double scale); >+public static final void gtk_print_settings_set_scale(int /*long*/ settings, double scale) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_scale(settings, scale); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ > public static final native void _gtk_print_settings_set_print_pages(int /*long*/ settings, int pages); > public static final void gtk_print_settings_set_print_pages(int /*long*/ settings, int pages) { > lock.lock(); >@@ -9218,6 +9281,16 @@ > lock.unlock(); > } > } >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size); >+public static final void gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_paper_size(settings, paper_size); >+ } finally { >+ lock.unlock(); >+ } >+} > /** > * @method flags=dynamic > * @param num_ranges cast=(gint) >@@ -9261,6 +9334,156 @@ > lock.unlock(); > } > } >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_reverse(int /*long*/ settings); >+public static final int gtk_print_settings_get_reverse(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_reverse(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse); >+public static final void gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_reverse(settings, reverse); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_resolution_xy(int /*long*/ settings, int resolution_x, int resolution_y); >+public static final void gtk_print_settings_set_resolution_xy(int /*long*/ settings, int resolution_x, int resolution_y) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_resolution_xy(settings, resolution_x, resolution_y); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_resolution_x(int /*long*/ settings); >+public static final int gtk_print_settings_get_resolution_x(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_resolution_x(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_resolution_y(int /*long*/ settings); >+public static final int gtk_print_settings_get_resolution_y(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_resolution_y(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_default_source(int /*long*/ settings); >+public static final int gtk_print_settings_get_default_source(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_default_source(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_default_source(int /*long*/ settings, byte[] default_source); >+public static final void gtk_print_settings_set_default_source(int /*long*/ settings, byte[] default_source) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_default_source(settings, default_source); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_media_type(int /*long*/ settings); >+public static final int gtk_print_settings_get_media_type(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_media_type(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type); >+public static final void gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_media_type(settings, media_type); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_output_bin(int /*long*/ settings); >+public static final int gtk_print_settings_get_output_bin(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_output_bin(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin); >+public static final void gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_output_bin(settings, output_bin); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_use_color(int /*long*/ settings); >+public static final int gtk_print_settings_get_use_color(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_use_color(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color); >+public static final void gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_use_color(settings, use_color); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native int _gtk_print_settings_get_quality(int /*long*/ settings); >+public static final int gtk_print_settings_get_quality(int /*long*/ settings) { >+ lock.lock(); >+ try { >+ return _gtk_print_settings_get_quality(settings); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_settings_set_quality(int /*long*/ settings, int quality); >+public static final void gtk_print_settings_set_quality(int /*long*/ settings, int quality) { >+ lock.lock(); >+ try { >+ _gtk_print_settings_set_quality(settings, quality); >+ } finally { >+ lock.unlock(); >+ } >+} > /** > * @method flags=dynamic > * @param title cast=(const gchar *) >@@ -9276,6 +9499,16 @@ > } > } > /** @method flags=dynamic */ >+public static final native void _gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed); >+public static final void gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed) { >+ lock.lock(); >+ try { >+ _gtk_print_unix_dialog_set_embed_page_setup(dialog, embed); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ > public static final native void _gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup); > public static final void gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup) { > lock.lock(); >@@ -9286,6 +9519,26 @@ > } > } > /** @method flags=dynamic */ >+public static final native void _gtk_print_unix_dialog_set_has_selection(int /*long*/ dialog, boolean has_selection); >+public static final void gtk_print_unix_dialog_set_has_selection(int /*long*/ dialog, boolean has_selection) { >+ lock.lock(); >+ try { >+ _gtk_print_unix_dialog_set_has_selection(dialog, has_selection); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ >+public static final native void _gtk_print_unix_dialog_set_support_selection(int /*long*/ dialog, boolean support_selection); >+public static final void gtk_print_unix_dialog_set_support_selection(int /*long*/ dialog, boolean support_selection) { >+ lock.lock(); >+ try { >+ _gtk_print_unix_dialog_set_support_selection(dialog, support_selection); >+ } finally { >+ lock.unlock(); >+ } >+} >+/** @method flags=dynamic */ > public static final native int /*long*/ _gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog); > public static final int /*long*/ gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog) { > lock.lock(); >Index: Eclipse SWT PI/win32/library/os.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c,v >retrieving revision 1.180 >diff -u -r1.180 os.c >--- Eclipse SWT PI/win32/library/os.c 2 Mar 2010 22:33:18 -0000 1.180 >+++ Eclipse SWT PI/win32/library/os.c 4 Mar 2010 19:38:26 -0000 >@@ -135,6 +135,18 @@ > } > #endif > >+#ifndef NO_AddForm >+JNIEXPORT jboolean JNICALL OS_NATIVE(AddForm) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLong arg2) >+{ >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, AddForm_FUNC); >+ rc = (jboolean)AddForm((HANDLE)arg0, (DWORD)arg1, (LPBYTE)arg2); >+ OS_NATIVE_EXIT(env, that, AddForm_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_AdjustWindowRectEx > JNIEXPORT jboolean JNICALL OS_NATIVE(AdjustWindowRectEx) > (JNIEnv *env, jclass that, jobject arg0, jint arg1, jboolean arg2, jint arg3) >@@ -2040,6 +2052,44 @@ > } > #endif > >+#ifndef NO_DeviceCapabilitiesA >+JNIEXPORT jint JNICALL OS_NATIVE(DeviceCapabilitiesA) >+ (JNIEnv *env, jclass that, jbyteArray arg0, jbyteArray arg1, jint arg2, jintLong arg3, jintLong arg4) >+{ >+ jbyte *lparg0=NULL; >+ jbyte *lparg1=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, DeviceCapabilitiesA_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jint)DeviceCapabilitiesA((LPCTSTR)lparg0, (LPCTSTR)lparg1, (WORD)arg2, (LPTSTR)arg3, (const DEVMODEA *)arg4); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0); >+ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, DeviceCapabilitiesA_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_DeviceCapabilitiesW >+JNIEXPORT jint JNICALL OS_NATIVE(DeviceCapabilitiesW) >+ (JNIEnv *env, jclass that, jcharArray arg0, jcharArray arg1, jint arg2, jintLong arg3, jintLong arg4) >+{ >+ jchar *lparg0=NULL; >+ jchar *lparg1=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, DeviceCapabilitiesW_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jint)DeviceCapabilitiesW((LPCWSTR)lparg0, (LPCWSTR)lparg1, (WORD)arg2, (LPWSTR)arg3, (const DEVMODEW *)arg4); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0); >+ if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, DeviceCapabilitiesW_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_DispatchMessageA > JNIEXPORT jintLong JNICALL OS_NATIVE(DispatchMessageA) > (JNIEnv *env, jclass that, jobject arg0) >@@ -2072,6 +2122,38 @@ > } > #endif > >+#ifndef NO_DocumentPropertiesA >+JNIEXPORT jint JNICALL OS_NATIVE(DocumentPropertiesA) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jbyteArray arg2, jintLong arg3, jintLong arg4, jint arg5) >+{ >+ jbyte *lparg2=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, DocumentPropertiesA_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jint)DocumentPropertiesA((HWND)arg0, (HANDLE)arg1, (LPTSTR)lparg2, (PDEVMODE)arg3, (PDEVMODE)arg4, (DWORD)arg5); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, DocumentPropertiesA_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_DocumentPropertiesW >+JNIEXPORT jint JNICALL OS_NATIVE(DocumentPropertiesW) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jcharArray arg2, jintLong arg3, jintLong arg4, jint arg5) >+{ >+ jchar *lparg2=NULL; >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, DocumentPropertiesW_FUNC); >+ if (arg2) if ((lparg2 = (*env)->GetCharArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jint)DocumentPropertiesW((HWND)arg0, (HANDLE)arg1, (LPWSTR)lparg2, (PDEVMODEW)arg3, (PDEVMODEW)arg4, (DWORD)arg5); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseCharArrayElements(env, arg2, lparg2, 0); >+ OS_NATIVE_EXIT(env, that, DocumentPropertiesW_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_DragDetect > JNIEXPORT jboolean JNICALL OS_NATIVE(DragDetect) > (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) >@@ -3099,6 +3181,18 @@ > } > #endif > >+#ifndef NO_FORM_1INFO_11_1sizeof >+JNIEXPORT jint JNICALL OS_NATIVE(FORM_1INFO_11_1sizeof) >+ (JNIEnv *env, jclass that) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, FORM_1INFO_11_1sizeof_FUNC); >+ rc = (jint)FORM_INFO_1_sizeof(); >+ OS_NATIVE_EXIT(env, that, FORM_1INFO_11_1sizeof_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_FillPath > JNIEXPORT jboolean JNICALL OS_NATIVE(FillPath) > (JNIEnv *env, jclass that, jintLong arg0) >@@ -3940,6 +4034,44 @@ > } > #endif > >+#ifndef NO_GetDefaultPrinterA >+JNIEXPORT jboolean JNICALL OS_NATIVE(GetDefaultPrinterA) >+ (JNIEnv *env, jclass that, jbyteArray arg0, jintArray arg1) >+{ >+ jbyte *lparg0=NULL; >+ jint *lparg1=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, GetDefaultPrinterA_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jboolean)GetDefaultPrinterA((LPTSTR)lparg0, (LPDWORD)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, GetDefaultPrinterA_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_GetDefaultPrinterW >+JNIEXPORT jboolean JNICALL OS_NATIVE(GetDefaultPrinterW) >+ (JNIEnv *env, jclass that, jcharArray arg0, jintArray arg1) >+{ >+ jchar *lparg0=NULL; >+ jint *lparg1=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, GetDefaultPrinterW_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jboolean)GetDefaultPrinterW((LPWSTR)lparg0, (LPDWORD)lparg1); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, GetDefaultPrinterW_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_GetDesktopWindow > JNIEXPORT jintLong JNICALL OS_NATIVE(GetDesktopWindow) > (JNIEnv *env, jclass that) >@@ -8534,6 +8666,31 @@ > } > #endif > >+#if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I) && defined(JNI64)) >+#ifndef JNI64 >+JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2) >+#else >+JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2) >+#endif >+{ >+ FORM_INFO_1 _arg1, *lparg1=NULL; >+#ifndef JNI64 >+ OS_NATIVE_ENTER(env, that, MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC); >+#else >+ OS_NATIVE_ENTER(env, that, MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC); >+#endif >+ if (arg1) if ((lparg1 = getFORM_INFO_1Fields(env, arg1, &_arg1)) == NULL) goto fail; >+ MoveMemory((PVOID)arg0, lparg1, arg2); >+fail: >+ if (arg1 && lparg1) setFORM_INFO_1Fields(env, arg1, lparg1); >+#ifndef JNI64 >+ OS_NATIVE_EXIT(env, that, MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC); >+#else >+ OS_NATIVE_EXIT(env, that, MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC); >+#endif >+} >+#endif >+ > #if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && defined(JNI64)) > #ifndef JNI64 > JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2) >@@ -11572,6 +11729,50 @@ > } > #endif > >+#ifndef NO_OpenPrinterA >+JNIEXPORT jboolean JNICALL OS_NATIVE(OpenPrinterA) >+ (JNIEnv *env, jclass that, jbyteArray arg0, jintArray arg1, jintArray arg2) >+{ >+ jbyte *lparg0=NULL; >+ jint *lparg1=NULL; >+ jint *lparg2=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, OpenPrinterA_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jboolean)OpenPrinterA((LPTSTR)lparg0, (LPHANDLE)lparg1, (LPPRINTER_DEFAULTS)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, OpenPrinterA_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_OpenPrinterW >+JNIEXPORT jboolean JNICALL OS_NATIVE(OpenPrinterW) >+ (JNIEnv *env, jclass that, jcharArray arg0, jintArray arg1, jintArray arg2) >+{ >+ jchar *lparg0=NULL; >+ jint *lparg1=NULL; >+ jint *lparg2=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, OpenPrinterW_FUNC); >+ if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail; >+ if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; >+ rc = (jboolean)OpenPrinterW((LPWSTR)lparg0, (LPHANDLE)lparg1, (LPPRINTER_DEFAULTSW)lparg2); >+fail: >+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); >+ if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); >+ if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0); >+ OS_NATIVE_EXIT(env, that, OpenPrinterW_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_OpenProcess > JNIEXPORT jintLong JNICALL OS_NATIVE(OpenProcess) > (JNIEnv *env, jclass that, jint arg0, jboolean arg1, jint arg2) >@@ -12014,6 +12215,18 @@ > } > #endif > >+#ifndef NO_RECTL_1sizeof >+JNIEXPORT jint JNICALL OS_NATIVE(RECTL_1sizeof) >+ (JNIEnv *env, jclass that) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, RECTL_1sizeof_FUNC); >+ rc = (jint)RECTL_sizeof(); >+ OS_NATIVE_EXIT(env, that, RECTL_1sizeof_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_RECT_1sizeof > JNIEXPORT jint JNICALL OS_NATIVE(RECT_1sizeof) > (JNIEnv *env, jclass that) >@@ -12579,6 +12792,30 @@ > } > #endif > >+#ifndef NO_ResetDCA >+JNIEXPORT jintLong JNICALL OS_NATIVE(ResetDCA) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, ResetDCA_FUNC); >+ rc = (jintLong)ResetDCA((HDC)arg0, (CONST VOID *)arg1); >+ OS_NATIVE_EXIT(env, that, ResetDCA_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_ResetDCW >+JNIEXPORT jintLong JNICALL OS_NATIVE(ResetDCW) >+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) >+{ >+ jintLong rc = 0; >+ OS_NATIVE_ENTER(env, that, ResetDCW_FUNC); >+ rc = (jintLong)ResetDCW((HDC)arg0, (CONST VOID *)arg1); >+ OS_NATIVE_EXIT(env, that, ResetDCW_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_RestoreDC > JNIEXPORT jboolean JNICALL OS_NATIVE(RestoreDC) > (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >@@ -15631,6 +15868,38 @@ > } > #endif > >+#ifndef NO_SetFormA >+JNIEXPORT jboolean JNICALL OS_NATIVE(SetFormA) >+ (JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jint arg2, jintLong arg3) >+{ >+ jbyte *lparg1=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, SetFormA_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jboolean)SetFormA((HANDLE)arg0, (LPSTR)lparg1, (DWORD)arg2, (LPBYTE)arg3); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, SetFormA_FUNC); >+ return rc; >+} >+#endif >+ >+#ifndef NO_SetFormW >+JNIEXPORT jboolean JNICALL OS_NATIVE(SetFormW) >+ (JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jintLong arg3) >+{ >+ jchar *lparg1=NULL; >+ jboolean rc = 0; >+ OS_NATIVE_ENTER(env, that, SetFormW_FUNC); >+ if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail; >+ rc = (jboolean)SetFormW((HANDLE)arg0, (LPWSTR)lparg1, (DWORD)arg2, (LPBYTE)arg3); >+fail: >+ if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0); >+ OS_NATIVE_EXIT(env, that, SetFormW_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_SetGraphicsMode > JNIEXPORT jint JNICALL OS_NATIVE(SetGraphicsMode) > (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >@@ -18091,6 +18360,16 @@ > } > #endif > >+#ifndef NO_updateNup >+JNIEXPORT void JNICALL OS_NATIVE(updateNup) >+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1) >+{ >+ OS_NATIVE_ENTER(env, that, updateNup_FUNC); >+ updateNup((CONST VOID *)arg0, arg1); >+ OS_NATIVE_EXIT(env, that, updateNup_FUNC); >+} >+#endif >+ > #ifndef NO_wcslen > JNIEXPORT jint JNICALL OS_NATIVE(wcslen) > (JNIEnv *env, jclass that, jintLong arg0) >Index: Eclipse SWT PI/win32/library/os_custom.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h,v >retrieving revision 1.48 >diff -u -r1.48 os_custom.h >--- Eclipse SWT PI/win32/library/os_custom.h 2 Mar 2010 16:42:18 -0000 1.48 >+++ Eclipse SWT PI/win32/library/os_custom.h 4 Mar 2010 19:38:26 -0000 >@@ -82,3 +82,4 @@ > #define SHCreateItemInKnownFolder_LIB "shell32.dll" > #define TransparentBlt_LIB "msimg32.dll" > #define UpdateLayeredWindow_LIB "user32.dll" >+#define updateNup(arg0, arg1) ((PBYTE) (((BYTE *)arg0) + ((LPDEVMODE)arg0)->dmSize))[24] = arg1 >Index: Eclipse SWT PI/win32/library/os_stats.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c,v >retrieving revision 1.134 >diff -u -r1.134 os_stats.c >--- Eclipse SWT PI/win32/library/os_stats.c 2 Mar 2010 22:33:18 -0000 1.134 >+++ Eclipse SWT PI/win32/library/os_stats.c 4 Mar 2010 19:38:29 -0000 >@@ -14,8 +14,8 @@ > > #ifdef NATIVE_STATS > >-int OS_nativeFunctionCount = 1008; >-int OS_nativeFunctionCallCount[1008]; >+int OS_nativeFunctionCount = 1025; >+int OS_nativeFunctionCallCount[1025]; > char * OS_nativeFunctionNames[] = { > "ACCEL_1sizeof", > "ACTCTX_1sizeof", >@@ -24,6 +24,7 @@ > "ActivateKeyboardLayout", > "AddFontResourceExA", > "AddFontResourceExW", >+ "AddForm", > "AdjustWindowRectEx", > "AllowSetForegroundWindow", > "AlphaBlend", >@@ -162,8 +163,12 @@ > "DestroyIcon", > "DestroyMenu", > "DestroyWindow", >+ "DeviceCapabilitiesA", >+ "DeviceCapabilitiesW", > "DispatchMessageA", > "DispatchMessageW", >+ "DocumentPropertiesA", >+ "DocumentPropertiesW", > "DragDetect", > "DragFinish", > "DragQueryFileA", >@@ -222,6 +227,7 @@ > "ExtractIconExA", > "ExtractIconExW", > "FILETIME_1sizeof", >+ "FORM_1INFO_11_1sizeof", > "FillPath", > "FillRect", > "FindWindowA", >@@ -271,6 +277,8 @@ > "GetDIBits", > "GetDateFormatA", > "GetDateFormatW", >+ "GetDefaultPrinterA", >+ "GetDefaultPrinterW", > "GetDesktopWindow", > "GetDeviceCaps", > "GetDialogBaseUnits", >@@ -678,6 +686,11 @@ > "MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I", > #endif > #ifndef JNI64 >+ "MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I", >+#else >+ "MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I", >+#endif >+#ifndef JNI64 > "MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I", > #else > "MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I", >@@ -1159,6 +1172,8 @@ > "OleInitialize", > "OleUninitialize", > "OpenClipboard", >+ "OpenPrinterA", >+ "OpenPrinterW", > "OpenProcess", > "OpenThemeData", > "PAINTSTRUCT_1sizeof", >@@ -1188,6 +1203,7 @@ > "PtInRect", > "PtInRegion", > "REBARBANDINFO_1sizeof", >+ "RECTL_1sizeof", > "RECT_1sizeof", > "RealizePalette", > "RectInRegion", >@@ -1232,6 +1248,8 @@ > "RemovePropA", > "RemovePropW", > "ReplyMessage", >+ "ResetDCA", >+ "ResetDCW", > "RestoreDC", > "RoundRect", > "SAFEARRAYBOUND_1sizeof", >@@ -1651,6 +1669,8 @@ > "SetErrorMode", > "SetFocus", > "SetForegroundWindow", >+ "SetFormA", >+ "SetFormW", > "SetGraphicsMode", > "SetLayeredWindowAttributes", > "SetLayout", >@@ -1912,6 +1932,7 @@ > "WideCharToMultiByte__II_3CI_3BI_3B_3Z", > "WindowFromDC", > "WindowFromPoint", >+ "updateNup", > "wcslen", > }; > >Index: Eclipse SWT PI/win32/library/os_stats.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h,v >retrieving revision 1.134 >diff -u -r1.134 os_stats.h >--- Eclipse SWT PI/win32/library/os_stats.h 2 Mar 2010 22:33:18 -0000 1.134 >+++ Eclipse SWT PI/win32/library/os_stats.h 4 Mar 2010 19:38:30 -0000 >@@ -32,6 +32,7 @@ > ActivateKeyboardLayout_FUNC, > AddFontResourceExA_FUNC, > AddFontResourceExW_FUNC, >+ AddForm_FUNC, > AdjustWindowRectEx_FUNC, > AllowSetForegroundWindow_FUNC, > AlphaBlend_FUNC, >@@ -170,8 +171,12 @@ > DestroyIcon_FUNC, > DestroyMenu_FUNC, > DestroyWindow_FUNC, >+ DeviceCapabilitiesA_FUNC, >+ DeviceCapabilitiesW_FUNC, > DispatchMessageA_FUNC, > DispatchMessageW_FUNC, >+ DocumentPropertiesA_FUNC, >+ DocumentPropertiesW_FUNC, > DragDetect_FUNC, > DragFinish_FUNC, > DragQueryFileA_FUNC, >@@ -230,6 +235,7 @@ > ExtractIconExA_FUNC, > ExtractIconExW_FUNC, > FILETIME_1sizeof_FUNC, >+ FORM_1INFO_11_1sizeof_FUNC, > FillPath_FUNC, > FillRect_FUNC, > FindWindowA_FUNC, >@@ -279,6 +285,8 @@ > GetDIBits_FUNC, > GetDateFormatA_FUNC, > GetDateFormatW_FUNC, >+ GetDefaultPrinterA_FUNC, >+ GetDefaultPrinterW_FUNC, > GetDesktopWindow_FUNC, > GetDeviceCaps_FUNC, > GetDialogBaseUnits_FUNC, >@@ -686,6 +694,11 @@ > MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I_FUNC, > #endif > #ifndef JNI64 >+ MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC, >+#else >+ MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC, >+#endif >+#ifndef JNI64 > MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC, > #else > MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC, >@@ -1167,6 +1180,8 @@ > OleInitialize_FUNC, > OleUninitialize_FUNC, > OpenClipboard_FUNC, >+ OpenPrinterA_FUNC, >+ OpenPrinterW_FUNC, > OpenProcess_FUNC, > OpenThemeData_FUNC, > PAINTSTRUCT_1sizeof_FUNC, >@@ -1196,6 +1211,7 @@ > PtInRect_FUNC, > PtInRegion_FUNC, > REBARBANDINFO_1sizeof_FUNC, >+ RECTL_1sizeof_FUNC, > RECT_1sizeof_FUNC, > RealizePalette_FUNC, > RectInRegion_FUNC, >@@ -1240,6 +1256,8 @@ > RemovePropA_FUNC, > RemovePropW_FUNC, > ReplyMessage_FUNC, >+ ResetDCA_FUNC, >+ ResetDCW_FUNC, > RestoreDC_FUNC, > RoundRect_FUNC, > SAFEARRAYBOUND_1sizeof_FUNC, >@@ -1659,6 +1677,8 @@ > SetErrorMode_FUNC, > SetFocus_FUNC, > SetForegroundWindow_FUNC, >+ SetFormA_FUNC, >+ SetFormW_FUNC, > SetGraphicsMode_FUNC, > SetLayeredWindowAttributes_FUNC, > SetLayout_FUNC, >@@ -1920,5 +1940,6 @@ > WideCharToMultiByte__II_3CI_3BI_3B_3Z_FUNC, > WindowFromDC_FUNC, > WindowFromPoint_FUNC, >+ updateNup_FUNC, > wcslen_FUNC, > } OS_FUNCS; >Index: Eclipse SWT PI/win32/library/os_structs.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c,v >retrieving revision 1.81 >diff -u -r1.81 os_structs.c >--- Eclipse SWT PI/win32/library/os_structs.c 25 Feb 2010 20:37:14 -0000 1.81 >+++ Eclipse SWT PI/win32/library/os_structs.c 4 Mar 2010 19:38:45 -0000 >@@ -1721,6 +1721,58 @@ > } > #endif > >+#ifndef NO_FORM_INFO_1 >+typedef struct FORM_INFO_1_FID_CACHE { >+ int cached; >+ jclass clazz; >+ jfieldID Flags, pName, Size, ImageableArea; >+} FORM_INFO_1_FID_CACHE; >+ >+FORM_INFO_1_FID_CACHE FORM_INFO_1Fc; >+ >+void cacheFORM_INFO_1Fields(JNIEnv *env, jobject lpObject) >+{ >+ if (FORM_INFO_1Fc.cached) return; >+ FORM_INFO_1Fc.clazz = (*env)->GetObjectClass(env, lpObject); >+ FORM_INFO_1Fc.Flags = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "Flags", "I"); >+ FORM_INFO_1Fc.pName = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "pName", I_J); >+ FORM_INFO_1Fc.Size = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "Size", "Lorg/eclipse/swt/internal/win32/SIZE;"); >+ FORM_INFO_1Fc.ImageableArea = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "ImageableArea", "Lorg/eclipse/swt/internal/win32/RECTL;"); >+ FORM_INFO_1Fc.cached = 1; >+} >+ >+FORM_INFO_1 *getFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct) >+{ >+ if (!FORM_INFO_1Fc.cached) cacheFORM_INFO_1Fields(env, lpObject); >+ lpStruct->Flags = (*env)->GetIntField(env, lpObject, FORM_INFO_1Fc.Flags); >+ lpStruct->pName = (LPTSTR)(*env)->GetIntLongField(env, lpObject, FORM_INFO_1Fc.pName); >+ { >+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.Size); >+ if (lpObject1 != NULL) getSIZEFields(env, lpObject1, &lpStruct->Size); >+ } >+ { >+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.ImageableArea); >+ if (lpObject1 != NULL) getRECTLFields(env, lpObject1, &lpStruct->ImageableArea); >+ } >+ return lpStruct; >+} >+ >+void setFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct) >+{ >+ if (!FORM_INFO_1Fc.cached) cacheFORM_INFO_1Fields(env, lpObject); >+ (*env)->SetIntField(env, lpObject, FORM_INFO_1Fc.Flags, (jint)lpStruct->Flags); >+ (*env)->SetIntLongField(env, lpObject, FORM_INFO_1Fc.pName, (jintLong)lpStruct->pName); >+ { >+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.Size); >+ if (lpObject1 != NULL) setSIZEFields(env, lpObject1, &lpStruct->Size); >+ } >+ { >+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.ImageableArea); >+ if (lpObject1 != NULL) setRECTLFields(env, lpObject1, &lpStruct->ImageableArea); >+ } >+} >+#endif >+ > #ifndef NO_GCP_RESULTS > typedef struct GCP_RESULTS_FID_CACHE { > int cached; >@@ -6449,6 +6501,46 @@ > } > #endif > >+#ifndef NO_RECTL >+typedef struct RECTL_FID_CACHE { >+ int cached; >+ jclass clazz; >+ jfieldID left, top, right, bottom; >+} RECTL_FID_CACHE; >+ >+RECTL_FID_CACHE RECTLFc; >+ >+void cacheRECTLFields(JNIEnv *env, jobject lpObject) >+{ >+ if (RECTLFc.cached) return; >+ RECTLFc.clazz = (*env)->GetObjectClass(env, lpObject); >+ RECTLFc.left = (*env)->GetFieldID(env, RECTLFc.clazz, "left", "I"); >+ RECTLFc.top = (*env)->GetFieldID(env, RECTLFc.clazz, "top", "I"); >+ RECTLFc.right = (*env)->GetFieldID(env, RECTLFc.clazz, "right", "I"); >+ RECTLFc.bottom = (*env)->GetFieldID(env, RECTLFc.clazz, "bottom", "I"); >+ RECTLFc.cached = 1; >+} >+ >+RECTL *getRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct) >+{ >+ if (!RECTLFc.cached) cacheRECTLFields(env, lpObject); >+ lpStruct->left = (*env)->GetIntField(env, lpObject, RECTLFc.left); >+ lpStruct->top = (*env)->GetIntField(env, lpObject, RECTLFc.top); >+ lpStruct->right = (*env)->GetIntField(env, lpObject, RECTLFc.right); >+ lpStruct->bottom = (*env)->GetIntField(env, lpObject, RECTLFc.bottom); >+ return lpStruct; >+} >+ >+void setRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct) >+{ >+ if (!RECTLFc.cached) cacheRECTLFields(env, lpObject); >+ (*env)->SetIntField(env, lpObject, RECTLFc.left, (jint)lpStruct->left); >+ (*env)->SetIntField(env, lpObject, RECTLFc.top, (jint)lpStruct->top); >+ (*env)->SetIntField(env, lpObject, RECTLFc.right, (jint)lpStruct->right); >+ (*env)->SetIntField(env, lpObject, RECTLFc.bottom, (jint)lpStruct->bottom); >+} >+#endif >+ > #ifndef NO_SAFEARRAY > typedef struct SAFEARRAY_FID_CACHE { > int cached; >Index: Eclipse SWT PI/win32/library/os_structs.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h,v >retrieving revision 1.66 >diff -u -r1.66 os_structs.h >--- Eclipse SWT PI/win32/library/os_structs.h 25 Feb 2010 20:37:16 -0000 1.66 >+++ Eclipse SWT PI/win32/library/os_structs.h 4 Mar 2010 19:38:47 -0000 >@@ -359,6 +359,18 @@ > #define FILETIME_sizeof() 0 > #endif > >+#ifndef NO_FORM_INFO_1 >+void cacheFORM_INFO_1Fields(JNIEnv *env, jobject lpObject); >+FORM_INFO_1 *getFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct); >+void setFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct); >+#define FORM_INFO_1_sizeof() sizeof(FORM_INFO_1) >+#else >+#define cacheFORM_INFO_1Fields(a,b) >+#define getFORM_INFO_1Fields(a,b,c) NULL >+#define setFORM_INFO_1Fields(a,b,c) >+#define FORM_INFO_1_sizeof() 0 >+#endif >+ > #ifndef NO_GCP_RESULTS > void cacheGCP_RESULTSFields(JNIEnv *env, jobject lpObject); > GCP_RESULTS *getGCP_RESULTSFields(JNIEnv *env, jobject lpObject, GCP_RESULTS *lpStruct); >@@ -1319,6 +1331,18 @@ > #define RECT_sizeof() 0 > #endif > >+#ifndef NO_RECTL >+void cacheRECTLFields(JNIEnv *env, jobject lpObject); >+RECTL *getRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct); >+void setRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct); >+#define RECTL_sizeof() sizeof(RECTL) >+#else >+#define cacheRECTLFields(a,b) >+#define getRECTLFields(a,b,c) NULL >+#define setRECTLFields(a,b,c) >+#define RECTL_sizeof() 0 >+#endif >+ > #ifndef NO_SAFEARRAY > void cacheSAFEARRAYFields(JNIEnv *env, jobject lpObject); > SAFEARRAY *getSAFEARRAYFields(JNIEnv *env, jobject lpObject, SAFEARRAY *lpStruct); >Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FORM_INFO_1.java >=================================================================== >RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FORM_INFO_1.java >diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FORM_INFO_1.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FORM_INFO_1.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,10 @@ >+package org.eclipse.swt.internal.win32; >+ >+ public class FORM_INFO_1 { >+ public int Flags; //DWORD >+ /** @field cast=(LPTSTR) */ >+ public int /*long*/ pName; >+ public SIZE Size = new SIZE(); >+ public RECTL ImageableArea = new RECTL(); >+ public static final int sizeof = OS.FORM_INFO_1_sizeof (); >+} >Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java,v >retrieving revision 1.434 >diff -u -r1.434 OS.java >--- Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java 2 Mar 2010 22:33:18 -0000 1.434 >+++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java 4 Mar 2010 19:38:58 -0000 >@@ -512,6 +512,8 @@ > public static final int DATE_LONGDATE = 0x00000002; > public static final int DATE_SHORTDATE = 0x00000001; > public static final int DATE_YEARMONTH = 0x00000008; //#if(WINVER >= 0x0500) >+ public static final int DC_PAPERS = 2; >+ public static final int DC_PAPERNAMES = 16; > public static final int DCX_CACHE = 0x2; > public static final int DCX_CLIPCHILDREN = 0x8; > public static final int DCX_CLIPSIBLINGS = 0x10; >@@ -545,10 +547,30 @@ > public static final short DMCOLLATE_TRUE = 1; > public static final int DM_SETDEFID = 0x401; > public static final int DM_COLLATE = 0x00008000; >+ public static final int DM_FORMNAME = 0x00010000; >+ public static final int DM_IN_BUFFER = 0x00000002; >+ public static final int DM_SCALE = 0x00000010; >+ public static final int DM_DUPLEX = 0x00001000; >+ public static final int DM_YRESOLUTION = 0x00002000; >+ public static final int DM_PRINTQUALITY = 0x00000400; >+ public static final int DM_NUP = 0x00000040; > public static final int DM_COPIES = 0x00000100; > public static final int DM_ORIENTATION = 0x00000001; >+ public static final int DM_PAPERSIZE = 0x00000002; >+ public static final int DM_PAPERLENGTH = 0x00000004; >+ public static final int DM_PAPERWIDTH = 0x00000008; > public static final short DMORIENT_PORTRAIT = 1; > public static final short DMORIENT_LANDSCAPE = 2; >+ public static final short DMPAPER_LETTER = 1; >+ public static final short DMPAPER_LEGAL = 5; >+ public static final short DMPAPER_USER = 256; >+ public static final short DMPAPER_EXECUTIVE = 7; >+ public static final short DMPAPER_A2 = 66; >+ public static final short DMPAPER_A4 = 9; >+ public static final short DMPAPER_A5 = 11; >+ public static final short DMPAPER_A6 = 70; >+ public static final short DMPAPER_B5 = 34; >+ public static final short DMPAPER_JB5 = 13; > public static final int DSS_DISABLED = 0x20; > public static final int DSTINVERT = 0x550009; > public static final int DST_BITMAP = 0x4; >@@ -661,9 +683,7 @@ > public static final int ETS_READONLY = 6; > public static final int EVENT_OBJECT_FOCUS = 0x8005; > public static final int EVENT_OBJECT_LOCATIONCHANGE = 0x800B; >-// public static final int EVENT_OBJECT_SELECTION = 0x8006; > public static final int EVENT_OBJECT_SELECTIONWITHIN = 0x8009; >-// public static final int EVENT_OBJECT_STATECHANGE = 0x800A; > public static final int EVENT_OBJECT_VALUECHANGE = 0x800E; > public static final short FADF_FIXEDSIZE = 0x10; > public static final short FADF_HAVEVARTYPE = 0x80; >@@ -1290,6 +1310,7 @@ > public static final int PBST_PAUSED = 0x0003; > public static final int PD_ALLPAGES = 0x0; > public static final int PD_COLLATE = 0x10; >+ public static final int PD_NOSELECTION = 0x4; > public static final int PD_PAGENUMS = 0x2; > public static final int PD_PRINTTOFILE = 0x20; > public static final int PD_RETURNDC = 0x100; >@@ -2207,6 +2228,7 @@ > public static final native int DRAWITEMSTRUCT_sizeof (); > public static final native int DROPFILES_sizeof (); > public static final native int DWM_BLURBEHIND_sizeof (); >+public static final native int FORM_INFO_1_sizeof (); > public static final native int EMR_sizeof (); > public static final native int EMREXTCREATEFONTINDIRECTW_sizeof (); > public static final native int EXTLOGFONTW_sizeof (); >@@ -2288,6 +2310,7 @@ > public static final native int PROPERTYKEY_sizeof (); > public static final native int REBARBANDINFO_sizeof (); > public static final native int RECT_sizeof (); >+public static final native int RECTL_sizeof (); > public static final native int SAFEARRAY_sizeof (); > public static final native int SAFEARRAYBOUND_sizeof (); > public static final native int SCRIPT_ANALYSIS_sizeof (); >@@ -2454,11 +2477,30 @@ > return DefWindowProcA (hWnd, Msg, wParam, lParam); > } > >+public static final int DeviceCapabilities (TCHAR pDevice, TCHAR pPort, int fwCapability, int /*long*/ pOutput, int /*long*/ pDevMode) { >+ if (IsUnicode) { >+ char[] pPort1 = pPort == null ? null : pPort.chars; >+ return OS.DeviceCapabilitiesW (pDevice.chars, pPort1, fwCapability, pOutput, pDevMode); >+ } else { >+ byte[] pPort1 = pPort == null ? null : pPort.bytes; >+ return OS.DeviceCapabilitiesA (pDevice.bytes, pPort1, fwCapability, pOutput, pDevMode); >+ } >+} >+ > public static final int /*long*/ DispatchMessage (MSG lpmsg) { > if (IsUnicode) return DispatchMessageW (lpmsg); > return DispatchMessageA (lpmsg); > } > >+public static final int DocumentProperties (int /*long*/ hWnd, int /*long*/ hPrinter, TCHAR pDeviceName, int /*long*/ pDevModeOutput, int /*long*/ pDevModeInput, int fMode) { >+ if (IsUnicode) { >+ char[] pDeviceName1 = pDeviceName == null ? null : pDeviceName.chars; >+ return DocumentPropertiesW (hWnd, hPrinter, pDeviceName1, pDevModeOutput, pDevModeInput, fMode); >+ } >+ byte[] pDeviceName1 = pDeviceName == null ? null : pDeviceName.bytes; >+ return DocumentPropertiesA (hWnd, hPrinter, pDeviceName1, pDevModeOutput, pDevModeInput, fMode); >+} >+ > public static final int DragQueryFile (int /*long*/ hDrop, int iFile, TCHAR lpszFile, int cch) { > if (IsUnicode) { > char [] lpszFile1 = lpszFile == null ? null : lpszFile.chars; >@@ -2610,6 +2652,15 @@ > return GetDateFormatA (Locale, dwFlags, lpDate, lpString1, lpString2, cchDate); > } > >+public static final boolean GetDefaultPrinter (TCHAR pszBuffer, int[] /*long*/ pcchBuffer) { >+ if (IsUnicode) { >+ char[] pszBuffer1 = pszBuffer == null ? null : pszBuffer.chars; >+ return GetDefaultPrinterW(pszBuffer1, pcchBuffer); >+ } >+ byte[] pszBuffer1 = pszBuffer == null ? null : pszBuffer.bytes; >+ return GetDefaultPrinterA(pszBuffer1, pcchBuffer); >+} >+ > public static final int GetKeyNameText (int lParam, TCHAR lpString, int nSize) { > if (IsUnicode) { > char [] lpString1 = lpString == null ? null : lpString.chars; >@@ -3019,6 +3070,15 @@ > } > } > >+public static final boolean OpenPrinter (TCHAR pPrinterName, int[] /*long*/ phPrinter, int[] /*long*/ pDefault) { >+ if (IsUnicode) { >+ char [] pPrinterName1 = pPrinterName == null ? null : pPrinterName.chars; >+ return OpenPrinterW(pPrinterName1, phPrinter, pDefault); >+ } >+ byte [] pPrinterName1 = pPrinterName == null ? null : pPrinterName.bytes; >+ return OpenPrinterA(pPrinterName1, phPrinter, pDefault); >+} >+ > public static final boolean PeekMessage (MSG lpMsg, int /*long*/ hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg) { > if (IsUnicode) return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); > return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); >@@ -3112,6 +3172,13 @@ > return RemovePropA (hWnd, lpString); > } > >+public static final int /*long*/ ResetDC (int /*long*/ hdc, int /*long*/ lpInitData) { >+ if (IsUnicode) { >+ return ResetDCW (hdc, lpInitData); >+ } >+ return ResetDCA (hdc, lpInitData); >+} >+ > public static final int /*long*/ SendMessage (int /*long*/ hWnd, int Msg, int /*long*/ wParam, TCHAR lParam) { > if (IsUnicode) { > char [] lParam1 = lParam == null ? null : lParam.chars; >@@ -3286,6 +3353,14 @@ > return SendMessageA (hWnd, Msg, wParam, lParam); > } > >+public static final boolean SetForm (int /*long*/ hPrinter, TCHAR pFormName, int Level, int /*long*/ pForm) { >+ if (IsUnicode) { >+ return SetFormW(hPrinter, pFormName.chars, Level, pForm); >+ } else { >+ return SetFormA(hPrinter, pFormName.bytes, Level, pForm); >+ } >+} >+ > public static final boolean SetMenuItemInfo (int /*long*/ hMenu, int uItem, boolean fByPosition, MENUITEMINFO lpmii) { > if (IsUnicode) return SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii); > return SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii); >@@ -3616,6 +3691,16 @@ > */ > public static final native int /*long*/ CreateDCW (char [] lpszDriver, char [] lpszDevice, int /*long*/ lpszOutput, int /*long*/ lpInitData); > /** >+ * @param hdc cast=(HDC) >+ * @param lpInitData cast=(CONST VOID *) >+ */ >+public static final native int /*long*/ ResetDCW (int /*long*/ hdc, int /*long*/ lpInitData); >+/** >+ * @param hdc cast=(HDC) >+ * @param lpInitData cast=(CONST VOID *) >+ */ >+public static final native int /*long*/ ResetDCA (int /*long*/ hdc, int /*long*/ lpInitData); >+/** > * @param lpszDriver cast=(LPSTR) > * @param lpszDevice cast=(LPSTR) > * @param lpszOutput cast=(LPSTR) >@@ -3777,6 +3862,22 @@ > public static final native boolean DestroyMenu (int /*long*/ hMenu); > /** @param hWnd cast=(HWND) */ > public static final native boolean DestroyWindow (int /*long*/ hWnd); >+/** >+ * @param pDevice cast=(LPCTSTR) >+ * @param pPort cast=(LPCTSTR) >+ * @param fwCapability cast=(WORD) >+ * @param pOutput cast=(LPTSTR) >+ * @param pDevMode cast=(const DEVMODEA *) >+ */ >+public static native final int DeviceCapabilitiesA (byte[] pDevice, byte[] pPort, int fwCapability, int /*long*/ pOutput, int /*long*/ pDevMode); >+/** >+ * @param pDevice cast=(LPCWSTR) >+ * @param pPort cast=(LPCWSTR) >+ * @param fwCapability cast=(WORD) >+ * @param pOutput cast=(LPWSTR) >+ * @param pDevMode cast=(const DEVMODEW *) >+ */ >+public static native final int DeviceCapabilitiesW (char[] pDevice, char[] pPort, int fwCapability, int /*long*/ pOutput, int /*long*/ pDevMode); > public static final native int /*long*/ DispatchMessageW (MSG lpmsg); > public static final native int /*long*/ DispatchMessageA (MSG lpmsg); > /** @param hdc cast=(HDC) */ >@@ -5012,6 +5113,11 @@ > * @param Destination cast=(PVOID) > * @param Source cast=(CONST VOID *),flags=no_out critical > */ >+public static final native void MoveMemory (int /*long*/ Destination, FORM_INFO_1 form, int Length); >+/** >+ * @param Destination cast=(PVOID) >+ * @param Source cast=(CONST VOID *),flags=no_out critical >+ */ > public static final native void MoveMemory (int /*long*/ Destination, int [] Source, int Length); > /** > * @param Destination cast=(PVOID) >@@ -5775,6 +5881,50 @@ > * @param pwOutGlyphs cast=(WORD*) > */ > public static final native int ScriptGetCMap (int /*long*/ hdc, int /*long*/ psc, char[] pwcChars, int cChars, int dwFlags, short[] pwOutGlyphs); >+ >+/** >+ * @param pszBuffer cast=(LPTSTR) >+ * @param pcchBuffer cast=(LPDWORD) >+ */ >+public static final native boolean GetDefaultPrinterA (byte[] pszBuffer, int[] /*long*/ pcchBuffer); >+/** >+ * @param pszBuffer cast=(LPWSTR) >+ * @param pcchBuffer cast=(LPDWORD) >+ */ >+public static final native boolean GetDefaultPrinterW (char[] pszBuffer, int[] /*long*/ pcchBuffer); >+/** >+ * @param pPrinterName cast=(LPTSTR) >+ * @param phPrinter cast=(LPHANDLE) >+ * @param pDefault cast=(LPPRINTER_DEFAULTS) >+ */ >+public static final native boolean OpenPrinterA (byte[] pPrinterName, int[] /*long*/ phPrinter, int[] /*long*/ pDefault); >+/** >+ * @param pPrinterName cast=(LPWSTR) >+ * @param phPrinter cast=(LPHANDLE) >+ * @param pDefault cast=(LPPRINTER_DEFAULTSW) >+ */ >+public static final native boolean OpenPrinterW (char[] pPrinterName, int[] /*long*/ phPrinter, int[] /*long*/ pDefault); >+/** >+ * @param hPrinter cast=(HANDLE) >+ * @param Level cast=(DWORD) >+ * @param pForm cast=(LPBYTE) >+ */ >+public static final native boolean AddForm (int /*long*/ hPrinter, int Level, int /*long*/ pForm); >+/** >+ * @param hPrinter cast=(HANDLE) >+ * @param pFormName cast=(LPWSTR) >+ * @param Level cast=(DWORD) >+ * @param pForm cast=(LPBYTE) >+ */ >+public static final native boolean SetFormW (int /*long*/ hPrinter, char[] pFormName, int Level, int /*long*/ pForm); >+/** >+ * @param hPrinter cast=(HANDLE) >+ * @param pFormName cast=(LPSTR) >+ * @param Level cast=(DWORD) >+ * @param pForm cast=(LPBYTE) >+ */ >+public static final native boolean SetFormA (int /*long*/ hPrinter, byte[] pFormName, int Level, int /*long*/ pForm); >+ > /** > * @param hdc cast=(HDC) > * @param psc cast=(SCRIPT_CACHE *) >@@ -6292,6 +6442,24 @@ > * @param dwLayout cast=(DWORD) > */ > public static final native int SetLayout (int /*long*/ hdc, int dwLayout); >+/** >+ * @param hWnd cast=(HWND) >+ * @param hPrinter cast=(HANDLE) >+ * @param pDeviceName cast=(LPWSTR) >+ * @param pDevModeOutput cast=(PDEVMODEW) >+ * @param pDevModeInput cast=(PDEVMODEW) >+ * @param fMode cast=(DWORD) >+ */ >+public static final native int DocumentPropertiesW (int /*long*/ hWnd, int /*long*/ hPrinter, char[] pDeviceName, int /*long*/ pDevModeOutput, int /*long*/ pDevModeInput, int fMode); >+/** >+ * @param hWnd cast=(HWND) >+ * @param hPrinter cast=(HANDLE) >+ * @param pDeviceName cast=(LPTSTR) >+ * @param pDevModeOutput cast=(PDEVMODE) >+ * @param pDevModeInput cast=(PDEVMODE) >+ * @param fMode cast=(DWORD) >+ */ >+public static final native int DocumentPropertiesA (int /*long*/ hWnd, int /*long*/ hPrinter, byte[] pDeviceName, int /*long*/ pDevModeOutput, int /*long*/ pDevModeInput, int fMode); > /** @param hdc cast=(HDC) */ > public static final native int SetMapMode (int /*long*/ hdc, int fnMapMode); > /** >@@ -6601,6 +6769,8 @@ > public static final native boolean UpdateLayeredWindow (int /*long*/ hwnd, int /*long*/ hdcDst, POINT pptDst, SIZE psize, int /*long*/ hdcSrc, POINT pptSrc, int crKey, BLENDFUNCTION pblend, int dwFlags); > /** @param hWnd cast=(HWND) */ > public static final native boolean UpdateWindow (int /*long*/ hWnd); >+/** @param ptr cast=(CONST VOID *) */ >+public static final native void updateNup (int /*long*/ ptr, int nup); > /** @param hWnd cast=(HWND) */ > public static final native boolean ValidateRect (int /*long*/ hWnd, RECT lpRect); > /** @param ch cast=(WCHAR) */ >Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/RECTL.java >=================================================================== >RCS file: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/RECTL.java >diff -N Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/RECTL.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/RECTL.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,19 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.swt.internal.win32; >+ >+public class RECTL { >+ public int left; >+ public int top; >+ public int right; >+ public int bottom; >+ public static final int sizeof = OS.RECTL_sizeof (); >+} >Index: Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java,v >retrieving revision 1.23 >diff -u -r1.23 PrintDialog.java >--- Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java 4 Feb 2010 17:28:55 -0000 1.23 >+++ Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java 4 Mar 2010 19:39:01 -0000 >@@ -155,22 +155,104 @@ > PrinterData data = null; > NSPrintPanel panel = NSPrintPanel.printPanel(); > NSPrintInfo printInfo = new NSPrintInfo(NSPrintInfo.sharedPrintInfo().copy()); >- printInfo.setOrientation(printerData.orientation == PrinterData.LANDSCAPE ? OS.NSLandscapeOrientation : OS.NSPortraitOrientation); >- NSMutableDictionary dict = printInfo.dictionary(); >- dict.setValue(NSNumber.numberWithBool(printerData.collate), OS.NSPrintMustCollate); >- dict.setValue(NSNumber.numberWithInt(printerData.copyCount), OS.NSPrintCopies); >+ NSMutableDictionary dict = printInfo.dictionary(); >+ /* Settings */ >+ int /*long*/ pmSettings = printInfo.PMPrintSettings();// Do not release unless retain it >+ /* Duplex setting */ >+ OS.PMSetDuplex(pmSettings, printerData.duplex); >+ /* Updating the pmPrintSettings to printInfo overrides all the setting >+ * values contained in the printInfo dictionary. So, any changes to pmPrintSettings >+ * should be updated initially itself to avoid any accidental overriding. >+ * Similar cast applies to pmPageFormat as well. >+ */ >+ printInfo.updateFromPMPrintSettings(); >+ /* Print to File */ > if (printerData.printToFile) { > dict.setValue(OS.NSPrintSaveJob, OS.NSPrintJobDisposition); >+ if (printerData.fileName != null && printerData.fileName.length() > 0) { >+ dict.setValue(NSString.stringWith(printerData.fileName), OS.NSPrintSavePath); >+ } >+ } else if (printerData.name != null){ >+ dict.setValue(NSString.stringWith(printerData.name), OS.NSPrintPrinterName); > } >- if (printerData.fileName != null && printerData.fileName.length() > 0) { >- dict.setValue(NSString.stringWith(printerData.fileName), OS.NSPrintSavePath); >+ int /*long*/ session = printInfo.PMPrintSession();// Do not release unless retain it >+ int[] pmPrinter = new int[1]; >+ int res = OS.PMSessionGetCurrentPrinter (session, pmPrinter); >+ /* Paper Size Name */ >+ if (printerData.paperSizeName.intern() == PrinterData.PAPER_CUSTOM) { >+ int[] pmPaper = new int[1]; >+ double[] margins = {printInfo.topMargin(), printInfo.leftMargin(), printInfo.bottomMargin(), printInfo.rightMargin()}; >+ String customNameStr = (printerData.customPaperDisplayName != null) ? printerData.customPaperDisplayName : "CustomPaper"; //$NON_NLS-1$ >+ char[] customNameChars = new char[customNameStr.length()]; >+ customNameStr.getChars(0, customNameChars.length, customNameChars, 0); >+ int /*long*/ customNameCFStr = OS.CFStringCreateWithCharacters (0,customNameChars,customNameChars.length); >+ String customIdStr = (printerData.customPaperName != null) ? printerData.customPaperName : "CustomPaper"; //$NON_NLS-1$ >+ char[] customIdChars = new char[customIdStr.length()]; >+ customIdStr.getChars(0, customIdChars.length, customIdChars, 0); >+ int /*long*/ customIdCFStr = OS.CFStringCreateWithCharacters (0,customIdChars,customIdChars.length); >+ >+ int /*long*/ pmPageFormat = printInfo.pmPageFormat();// Do not release unless retain it >+ res = OS.PMPaperCreateCustom (pmPrinter[0], customIdCFStr, customNameCFStr, printerData.customPaperWidth * 72, printerData.customPaperHeight * 72, margins, pmPaper); >+ if (res == OS.noErr) { >+ int[] /*long*/ newPageFormat = new int[1]; >+ OS.PMCreatePageFormatWithPMPaper (newPageFormat, pmPaper[0]); >+ OS.PMCopyPageFormat (newPageFormat[0],pmPageFormat); >+ printInfo.updateFromPMPageFormat(); >+ OS.PMRelease(newPageFormat[0]); >+ } >+ int[] pmPaperName = new int[1]; >+ OS.PMPaperGetName (pmPaper[0], pmPaperName); >+ NSString paperNameStr = new NSString(pmPaperName[0]); >+ printInfo.setPaperName (paperNameStr); >+ >+ OS.CFRelease (customNameCFStr); >+ OS.CFRelease (customIdCFStr); >+ OS.PMRelease (pmPaperName[0]); >+ } else { >+ String[] keys = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4, >+ PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE}; >+ String[] values = {"Legal", "Letter", "iso-a2-envelope", "A4", >+ "A5", "A6", "ISOB5", "JISB5", "Executive"}; //$NON_NLS-1$ >+ int index; >+ for (index = 0; index < keys.length; index++) { >+ if (printerData.paperSizeName.intern() == keys[index].intern()) break; >+ } >+ NSString paperNameStr = (NSString) new NSString().alloc(); >+ if (index < keys.length) { >+ paperNameStr = paperNameStr.initWithString (values[index]); >+ } else { >+ paperNameStr = paperNameStr.initWithString (printerData.paperSizeName); >+ } >+ printInfo.setPaperName (paperNameStr); > } >+ /* Orientation */ >+ printInfo.setOrientation(printerData.orientation == PrinterData.LANDSCAPE ? OS.NSLandscapeOrientation : OS.NSPortraitOrientation); >+ /* Collate */ >+ dict.setValue(NSNumber.numberWithBool(printerData.collate), OS.NSPrintMustCollate); >+ /* Copy count */ >+ dict.setValue(NSNumber.numberWithInt(printerData.copyCount), OS.NSPrintCopies); >+ /* Page Scope */ > dict.setValue(NSNumber.numberWithBool(printerData.scope == PrinterData.ALL_PAGES), OS.NSPrintAllPages); >+ /* Page Range */ > if (printerData.scope == PrinterData.PAGE_RANGE) { > dict.setValue(NSNumber.numberWithInt(printerData.startPage), OS.NSPrintFirstPage); > dict.setValue(NSNumber.numberWithInt(printerData.endPage), OS.NSPrintLastPage); > } >- panel.setOptions(OS.NSPrintPanelShowsPageSetupAccessory | panel.options()); >+ /* Scaling factor value */ >+ dict.setValue(NSNumber.numberWithDouble(printerData.scale/100.0),OS.NSPrintScalingFactor); >+ /* Pages per sheet */ >+ int columns = (int) Math.sqrt(printerData.pagesPerSide); >+ dict.setValue(NSNumber.numberWithInt(columns), OS.NSPrintPagesAcross); >+ dict.setValue(NSNumber.numberWithInt(printerData.pagesPerSide / columns), OS.NSPrintPagesDown); >+ /* Output Resolution */ >+ if (printerData.resolutionX != 0 && printerData.resolutionY != 0) { >+ double[] resolution = {printerData.resolutionX, printerData.resolutionY}; >+ OS.PMPrinterSetOutputResolution(pmPrinter[0], pmSettings, resolution); >+ } >+ /* Set Panel Options */ >+ int panelOptions = (printerData.scope & PrinterData.NO_SELECTION) != 0 ? OS.NSPrintPanelShowsPrintSelection : 0; >+ panelOptions |= OS.NSPrintPanelShowsPageSetupAccessory | panel.options(); >+ panel.setOptions(panelOptions); > Shell parent = getParent(); > Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); > int response; >@@ -208,10 +290,53 @@ > data.endPage = new NSNumber(dict.objectForKey(OS.NSPrintLastPage)).intValue(); > } > data.collate = new NSNumber(dict.objectForKey(OS.NSPrintMustCollate)).intValue() != 0; >- data.collate = false; //TODO: Only set to false if the printer does the collate internally (most printers do) > data.copyCount = new NSNumber(dict.objectForKey(OS.NSPrintCopies)).intValue(); >- data.copyCount = 1; //TODO: Only set to 1 if the printer does the copy internally (most printers do) > data.orientation = printInfo.orientation() == OS.NSLandscapeOrientation ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT; >+ data.scale = new NSNumber(dict.objectForKey(OS.NSPrintScalingFactor)).doubleValue() * 100; >+ /* Pages per Side */ >+ int pagesAcross = new NSNumber(dict.objectForKey(OS.NSPrintPagesAcross)).intValue(); >+ int pagesDown = new NSNumber(dict.objectForKey(OS.NSPrintPagesDown)).intValue(); >+ data.pagesPerSide = pagesAcross * pagesDown; >+ /* Duplex */ >+ int /*long*/ pmPrintSettings = printInfo.PMPrintSettings(); >+ int[] duplexMode = new int[1]; >+ OS.PMGetDuplex (pmPrintSettings, duplexMode); >+ data.duplex = (int) duplexMode[0]; >+ /* Paper Size TODO:// >+ * It appears to be a bug in Mac that at instances, >+ * PaperName might not be recognized as Custom >+ * though it is Custom. >+ */ >+ int /*long*/ pageFormat = printInfo.pmPageFormat(); >+ int[] pmPaper = new int[1]; >+ OS.PMGetPageFormatPaper (pageFormat, pmPaper); >+ if (OS.PMPaperIsCustom (pmPaper[0])) { >+ data.paperSizeName = PrinterData.PAPER_CUSTOM; >+ double[] height = new double[1]; >+ double[] width = new double[1]; >+ OS.PMPaperGetHeight (pmPaper[0], height); >+ OS.PMPaperGetWidth (pmPaper[0], width); >+ data.customPaperHeight = height[0] / 72; >+ data.customPaperWidth = width[0] / 72; >+ int[] pmPaperName = new int[1]; >+ OS.PMPaperGetName (pmPaper[0], pmPaperName); >+ data.customPaperDisplayName = new NSString (pmPaperName[0]).getString(); >+ int[] pmPaperId = new int[1]; >+ OS.PMPaperGetID (pmPaper[0], pmPaperId); >+ data.customPaperName = new NSString (pmPaperId[0]).getString(); >+ } else { >+ int[] /*long*/ pmPaperName = new int[1]; >+ OS.PMPaperGetName (pmPaper[0], pmPaperName); >+ data.paperSizeName = new NSString (pmPaperName[0]).getString(); >+ } >+ /* Resolution */ >+ session = printInfo.PMPrintSession();// Do not release unless retain it >+ OS.PMSessionGetCurrentPrinter(session, pmPrinter); >+ double[] resolution = new double[2]; >+ OS.PMPrinterGetOutputResolution(pmPrinter[0], pmPrintSettings, resolution); >+ data.resolutionX = (int) resolution[0]; >+ data.resolutionY = (int) resolution[1]; >+ > NSData nsData = NSKeyedArchiver.archivedDataWithRootObject(printInfo); > data.otherData = new byte[(int)/*64*/nsData.length()]; > OS.memmove(data.otherData, nsData.bytes(), data.otherData.length); >Index: Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java,v >retrieving revision 1.34 >diff -u -r1.34 Printer.java >--- Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java 15 Sep 2009 14:44:48 -0000 1.34 >+++ Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java 4 Mar 2010 19:39:01 -0000 >@@ -48,6 +48,36 @@ > static final String DRIVER = "Mac"; > > /** >+ * Returns an array of String objects representing all paper >+ * size names supported by printers on the platform. >+ * Note that some platforms return only the paper size names >+ * supported by the default printer. >+ * >+ * @return a string array containing paper size names >+ * >+ * @since 3.6 >+ */ >+public static String[] getPaperNameList () { >+ int[] session = new int[1]; >+ int res = OS.PMCreateSession(session); >+ if (res != OS.noErr) return null; >+ int[] printer = new int[1]; >+ res = OS.PMSessionGetCurrentPrinter(session[0], printer); >+ if (res != OS.noErr) return null; >+ int[] paperList = new int[1]; >+ res = OS.PMPrinterGetPaperList(printer[0], paperList); >+ int count = OS.CFArrayGetCount (paperList[0]); >+ String[] result = new String[count]; >+ for (int i=0; i<count; i++) { >+ int /*long*/ paper = OS.CFArrayGetValueAtIndex (paperList[0],i); >+ int[] paperName = new int[1]; >+ OS.PMPaperGetName (paper, paperName); >+ result[i] = new NSString(paperName[0]).getString(); >+ } >+ return result; >+} >+ >+/** > * Returns an array of <code>PrinterData</code> objects > * representing all available printers. If there are no > * printers, the array will be empty. >Index: Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java,v >retrieving revision 1.25 >diff -u -r1.25 PrinterData.java >--- Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java 20 Jan 2010 13:43:49 -0000 1.25 >+++ Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java 4 Mar 2010 19:39:01 -0000 >@@ -111,6 +111,118 @@ > * @since 3.5 > */ > public int orientation = PORTRAIT; >+ >+ /** >+ * The scaling factor of the page and paper rectangle, >+ * expressed as a percentage by which the printed output >+ * to be scaled. Default value is 100 indicating no scale. >+ * >+ * @since 3.6 >+ */ >+ public double scale = 100;//TODO: double ? int ? >+ >+ /** >+ * The number of logical pages to be tiled on a >+ * physical sheet of paper, whose value can be >+ * expressed either of 1, 2, 4, 6, 9 or 16. >+ * >+ * @since 3.6 >+ */ >+ public int pagesPerSide = 1; >+ >+ /** >+ * specifies a print job that can print either single-sided or >+ * double-sided printing, expressed as one of the following values: >+ * <dl> >+ * <dt><code>DUPLEX_SIMPLEX</code></dt> >+ * <dd>Normal one-sided printing</dd> >+ * <dt><code>DUPLEX_HORIZONTAL</code></dt> >+ * <dd>Duplex printing with page being horizontal</dd> >+ * <dt><code>DUPLEX_VERTICAL</code></dt> >+ * <dd>Duplex printing with page being vertical</dd> >+ * </dl> >+ * >+ * @since 3.6 >+ */ >+ public int duplex = DUPLEX_SIMPLEX; >+ >+ /** >+ * Specifies the name for the paper size used in a >+ * print job, expressed as one of the following values: >+ * <dl> >+ * <dt><code>PAPER_LETTER</code></dt> >+ * <dt><code>PAPER_LEGAL</code></dt> >+ * <dt><code>PAPER_A2</code></dt> >+ * <dt><code>PAPER_A4</code></dt> >+ * <dt><code>PAPER_A5</code></dt> >+ * <dt><code>PAPER_A6</code></dt> >+ * <dt><code>PAPER_B5</code></dt> >+ * <dt><code>PAPER_JB5</code></dt> >+ * <dt><code>PAPER_EXECUTIVE</code></dt> >+ * <dt><code>PAPER_CUSTOM</code></dt> >+ * </dl> >+ * >+ * Also accepts any paper size from the list of available paper size >+ * names returned by method <code>Printer.getPaperSizeList</code>. >+ * >+ * @since 3.6 >+ */ >+ public String paperSizeName = PAPER_A4; >+ >+ /** >+ * The physical height of the custom paper name in inches. >+ * Note that this field is ignored if <code>paperSize</code> >+ * is not specified as <code>PAPER_CUSTOM</code>. >+ * >+ * @since 3.6 >+ */ >+ public double customPaperHeight = 0; >+ >+ /** >+ * The physical width of the custom paper name in inches. >+ * Note that this field is ignored if <code>paperSize</code> >+ * is not specified as <code>PAPER_CUSTOM</code>. >+ * >+ * @since 3.6 >+ */ >+ public double customPaperWidth = 0; >+ >+ /** >+ * The name of the custom paper size. >+ * Note that this field is ignored if <code>paperSize</code> >+ * is not specified as <code>PAPER_CUSTOM</code>. >+ * >+ * @since 3.6 >+ */ >+ public String customPaperName; >+ >+ /** >+ * The human-readable name of the custom paper size to >+ * be displayed in print dialog. Note that this field >+ * is ignored if <code>paperSize</code> is not >+ * specified as <code>PAPER_CUSTOM</code>. >+ * >+ * @since 3.6 >+ */ >+ public String customPaperDisplayName; >+ >+ /** >+ * Specifies the x-resolution in dots-per-inch of the printer. >+ * This configures the print settings to the closest resolution >+ * setting that can be used for destination print job. >+ * >+ * @since 3.6 >+ */ >+ public double resolutionX; >+ >+ /** >+ * Specifies the y-resolution in dots-per-inch of the printer. >+ * This configures the print settings to the closest resolution >+ * setting that can be used for destination print job. >+ * >+ * @since 3.6 >+ */ >+ public double resolutionY;//TODO: double ? int ? > > /** > * <code>scope</code> field value indicating that >@@ -132,6 +244,17 @@ > public static final int SELECTION = 2; > > /** >+ * <code>scope</code> field value indicating that >+ * the print dialog does not allow the user to >+ * print a selection. This must be built by >+ * <em>bitwise OR</em>'ing together with the other >+ * fields. >+ * >+ * @since 3.6 >+ */ >+ public static final int NO_SELECTION = 4; >+ >+ /** > * <code>orientation</code> field value indicating > * portrait paper orientation > * >@@ -148,6 +271,116 @@ > public static final int LANDSCAPE = 2; > > /** >+ * <code>duplex</code> field value indicating >+ * one-sided printing >+ * >+ * @since 3.6 >+ */ >+ public static final int DUPLEX_SIMPLEX = 1; >+ >+ /** >+ * <code>duplex</code> field value indicating >+ * double sided printing on short edge >+ * >+ * @since 3.6 >+ */ >+ public static final int DUPLEX_HORIZONTAL = 2; >+ >+ /** >+ * <code>duplex</code> field value indicating >+ * double sided printing on long edge >+ * >+ * @since 3.6 >+ */ >+ public static final int DUPLEX_VERTICAL = 3; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as LETTER >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_LETTER = "LETTER"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as LEGAL >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_LEGAL = "LEGAL"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as A4 sheet >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_A2 = "A2"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as A4 sheet >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_A4 = "A4"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as A4 sheet >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_A5 = "A5"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as A4 sheet >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_A6 = "A6"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as B5 sheet >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_B5 = "B5"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as JB5 sheet >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_JB5 = "JB5"; >+ >+ /** >+ * <code>paperSize</code> field value indicating >+ * the paper size as EXECUTIVE >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_EXECUTIVE = "EXECUTIVE"; >+ >+ /** >+ * <code>paperSize</code> field value indicating the paper >+ * size as Custom. When this field is specified, the values >+ * for <code>customPaperHeight</code> and <code>customPaperWidth</code> >+ * are required to create a custom paper size and optionally, >+ * <code>customPaperName</code> <code>customPaperDisplayName</code>. >+ * >+ * Note that customPaperHeight and customPaperWidth are ignored >+ * when the field has not specified this value. >+ * >+ * @since 3.6 >+ */ >+ public static final String PAPER_CUSTOM = "CUSTOM"; >+ >+ /** > * private, platform-specific data > * On Windows, this contains a copy of the DEVMODE struct > * returned from the <code>PrintDialog</code>. >@@ -158,7 +391,7 @@ > * This field is not currently used on the X/Window System. > */ > byte [] otherData; >- >+ > /** > * Constructs an instance of this class that can be > * used to print to the default printer. >Index: Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java,v >retrieving revision 1.38 >diff -u -r1.38 PrintDialog.java >--- Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java 4 Feb 2010 17:28:55 -0000 1.38 >+++ Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java 4 Mar 2010 19:39:01 -0000 >@@ -302,8 +302,8 @@ > //TODO: Not currently implemented. May need new API. For now, disable 'Current' in the dialog. (see gtk bug 344519) > OS.gtk_print_unix_dialog_set_current_page(handle, -1); > >- OS.gtk_print_unix_dialog_set_manual_capabilities(handle, >- OS.GTK_PRINT_CAPABILITY_COLLATE | OS.GTK_PRINT_CAPABILITY_COPIES | OS.GTK_PRINT_CAPABILITY_PAGE_SET); >+ OS.gtk_print_unix_dialog_set_manual_capabilities(handle, OS.GTK_PRINT_CAPABILITY_COLLATE | OS.GTK_PRINT_CAPABILITY_COPIES | >+ OS.GTK_PRINT_CAPABILITY_PAGE_SET | OS.GTK_PRINT_CAPABILITY_SCALE | OS.GTK_PRINT_CAPABILITY_NUMBER_UP); > > /* Set state into print dialog settings. */ > int /*long*/ settings = OS.gtk_print_settings_new(); >@@ -312,6 +312,14 @@ > if (printerData.otherData != null) { > Printer.restore(printerData.otherData, settings, page_setup); > } >+ /* display fields for Orientation, Paper size, Selection */ >+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { >+ OS.gtk_print_unix_dialog_set_embed_page_setup(handle, true); >+ OS.gtk_print_unix_dialog_set_support_selection(handle, true); >+ if ((printerData.scope & PrinterData.NO_SELECTION) == 0) { >+ OS.gtk_print_unix_dialog_set_has_selection(handle, true); >+ } >+ } > /* Set values of print_settings and page_setup from PrinterData. */ > switch (printerData.scope) { > case PrinterData.ALL_PAGES: >@@ -325,33 +333,72 @@ > OS.gtk_print_settings_set_page_ranges(settings, pageRange, 1); > break; > case PrinterData.SELECTION: >- //TODO: Not correctly implemented. May need new API. For now, set to ALL. (see gtk bug 344519) >- OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_ALL); >+ OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_SELECTION); > break; > } >- if (printerData.fileName != null) { >- //TODO: Should we look at printToFile, or driver/name for "Print to File", or both? (see gtk bug 345590) >- if (printerData.printToFile) { >- byte [] buffer = Converter.wcsToMbcs (null, printerData.fileName, true); >- OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer); >- } >- if (printerData.driver != null && printerData.name != null) { >- if (printerData.driver.equals("GtkPrintBackendFile") && printerData.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$ >- byte [] buffer = Converter.wcsToMbcs (null, printerData.fileName, true); >- OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer); >- } >- } >- } >+ //TODO: printerData.printToFile always take precedence over printerData.name ? > if (printerData.printToFile) { > byte [] buffer = Converter.wcsToMbcs (null, "Print to File", true); //$NON-NLS-1$ > OS.gtk_print_settings_set_printer(settings, buffer); >+ if (printerData.fileName != null) { >+ buffer = Converter.wcsToMbcs (null, printerData.fileName, true); >+ OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer); >+ } >+ } else if (printerData.name != null){ >+ /* Selecting Printer */ >+ byte [] buffer = Converter.wcsToMbcs (null, printerData.name, true); >+ OS.gtk_print_settings_set_printer(settings, buffer); > } >+ /* Copy Count */ > OS.gtk_print_settings_set_n_copies(settings, printerData.copyCount); >+ /* Collate */ > OS.gtk_print_settings_set_collate(settings, printerData.collate); >+ /* Orientation */ > int orientation = printerData.orientation == PrinterData.LANDSCAPE ? OS.GTK_PAGE_ORIENTATION_LANDSCAPE : OS.GTK_PAGE_ORIENTATION_PORTRAIT; > OS.gtk_print_settings_set_orientation(settings, orientation); > OS.gtk_page_setup_set_orientation(page_setup, orientation); >- >+ /* Paper Size */ >+ int /*long*/ paperSize = 0; >+ if (printerData.paperSizeName == PrinterData.PAPER_CUSTOM) { >+ if (printerData.customPaperName == null) printerData.customPaperName = "CustomPaper"; //$NON-NLS-1$ >+ if (printerData.customPaperDisplayName == null) printerData.customPaperDisplayName = "CustomPaper"; //$NON-NLS-1$ >+ byte [] name = Converter.wcsToMbcs (null, printerData.customPaperName, true); >+ byte [] displayName = Converter.wcsToMbcs (null, printerData.customPaperDisplayName, true); >+ paperSize = OS.gtk_paper_size_new_from_ppd (name, displayName, printerData.customPaperWidth * 72, printerData.customPaperHeight * 72); //It accepts in points..so convert from inch to Points >+ } else { >+ /* >+ * Since there are numerous paper size names, it might not be possible to provide >+ * constant names for all the sizes. So, if the user selects any paperSizeName not >+ * defined in SWT, then we should be able to restore it back when the dialog is opened. >+ */ >+ String[] keys = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4, >+ PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE}; >+ String[] values = {"na_legal", "na_letter", "iso_a2", "iso_a4", >+ "iso_a5", "iso_a6", "iso_b5", "jis_b5", "na_executive"}; //$NON-NLS-1$ >+ int index; >+ for (index = 0; index < keys.length; index++) { >+ if (printerData.paperSizeName.equals(keys[index])) break; >+ } >+ byte [] buffer; >+ if (index < keys.length) { >+ buffer = Converter.wcsToMbcs (null, values[index], true); >+ } else { >+ buffer = Converter.wcsToMbcs (null, printerData.paperSizeName, true); >+ } >+ paperSize = OS.gtk_paper_size_new(buffer); >+ } >+ OS.gtk_page_setup_set_paper_size (page_setup, paperSize); >+ OS.gtk_paper_size_free(paperSize); >+ /* Pages Per Side */ >+ OS.gtk_print_settings_set_number_up (settings, printerData.pagesPerSide); >+ /* Duplex */ >+ OS.gtk_print_settings_set_duplex (settings, printerData.duplex - 1); >+ /* Scale */ >+ OS.gtk_print_settings_set_scale (settings, printerData.scale); >+ /* Resolution */ >+ if (printerData.resolutionX != 0 && printerData.resolutionY != 0) { >+ OS.gtk_print_settings_set_resolution_xy (settings, (int)printerData.resolutionX, (int)printerData.resolutionY); >+ } > OS.gtk_print_unix_dialog_set_settings(handle, settings); > OS.gtk_print_unix_dialog_set_page_setup(handle, page_setup); > OS.g_object_unref(settings); >@@ -408,25 +455,37 @@ > data.startPage = min == Integer.MAX_VALUE ? 1 : min; > data.endPage = max == 0 ? 1 : max; > break; >+ case OS.GTK_PRINT_PAGES_SELECTION: >+ data.scope = PrinterData.SELECTION; >+ break; > case OS.GTK_PRINT_PAGES_CURRENT: > //TODO: Disabled in dialog (see above). This code will not run. (see gtk bug 344519) > data.scope = PrinterData.SELECTION; > data.startPage = data.endPage = OS.gtk_print_unix_dialog_get_current_page(handle); > break; > } >- > data.printToFile = data.name.equals("Print to File"); //$NON-NLS-1$ > if (data.printToFile) { >- int /*long*/ address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI); >- int length = OS.strlen (address); >- byte [] buffer = new byte [length]; >- OS.memmove (buffer, address, length); >- data.fileName = new String (Converter.mbcsToWcs (null, buffer)); >+ data.fileName = getString (OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI)); > } >- > data.copyCount = OS.gtk_print_settings_get_n_copies(settings); > data.collate = OS.gtk_print_settings_get_collate(settings); > data.orientation = OS.gtk_page_setup_get_orientation(page_setup) == OS.GTK_PAGE_ORIENTATION_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT; >+ data.scale = OS.gtk_print_settings_get_scale(settings); >+ data.duplex = OS.gtk_print_settings_get_duplex(settings) + 1; >+ data.resolutionX = OS.gtk_print_settings_get_resolution_x(settings); >+ data.resolutionY = OS.gtk_print_settings_get_resolution_y(settings); >+ >+ int /*long*/ paper_size = OS.gtk_page_setup_get_paper_size(page_setup); >+ if (OS.gtk_paper_size_is_custom(paper_size)) { >+ data.paperSizeName = PrinterData.PAPER_CUSTOM; >+ data.customPaperHeight = OS.gtk_paper_size_get_height (paper_size, OS.GTK_UNIT_INCH); >+ data.customPaperWidth = OS.gtk_paper_size_get_width (paper_size, OS.GTK_UNIT_INCH); >+ data.customPaperName = getString (OS.gtk_paper_size_get_name(paper_size)); >+ data.customPaperDisplayName = getString (OS.gtk_paper_size_get_display_name(paper_size)); >+ } else { >+ data.paperSizeName = getString (OS.gtk_paper_size_get_name(paper_size)); >+ } > > /* Save other print_settings data as key/value pairs in otherData. */ > Callback printSettingsCallback = new Callback(this, "GtkPrintSettingsFunc", 3); //$NON-NLS-1$ >@@ -441,18 +500,19 @@ > /* Save page_setup data as key/value pairs in otherData. > * Note that page_setup properties must be stored and restored in the same order. > */ >- store("orientation", OS.gtk_page_setup_get_orientation(page_setup)); //$NON-NLS-1$ > store("top_margin", OS.gtk_page_setup_get_top_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$ > store("bottom_margin", OS.gtk_page_setup_get_bottom_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$ > store("left_margin", OS.gtk_page_setup_get_left_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$ > store("right_margin", OS.gtk_page_setup_get_right_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$ >- int /*long*/ paper_size = OS.gtk_page_setup_get_paper_size(page_setup); //$NON-NLS-1$ >- storeBytes("paper_size_name", OS.gtk_paper_size_get_name(paper_size)); //$NON-NLS-1$ >- storeBytes("paper_size_display_name", OS.gtk_paper_size_get_display_name(paper_size)); //$NON-NLS-1$ >- storeBytes("paper_size_ppd_name", OS.gtk_paper_size_get_ppd_name(paper_size)); //$NON-NLS-1$ >- store("paper_size_width", OS.gtk_paper_size_get_width(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$ >- store("paper_size_height", OS.gtk_paper_size_get_height(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$ >- store("paper_size_is_custom", OS.gtk_paper_size_is_custom(paper_size)); //$NON-NLS-1$ >+ store ("reverse",OS.gtk_print_settings_get_reverse (settings)); //$NON-NLS-1$ >+ store ("color_mode", OS.gtk_print_settings_get_use_color (settings)); //$NON-NLS-1$ >+ store ("print_quality",OS.gtk_print_settings_get_quality (settings)); //$NON-NLS-1$ >+ if (!data.printToFile) { >+ storeBytes ("paper_source", OS.gtk_print_settings_get_default_source (settings)); //$NON-NLS-1$ >+ storeBytes ("media_type", OS.gtk_print_settings_get_media_type (settings)); //$NON-NLS-1$ >+ storeBytes ("output_bin", OS.gtk_print_settings_get_output_bin (settings)); //$NON-NLS-1$ >+ } >+ > data.otherData = settingsData; > OS.g_object_unref(settings); > printerData = data; >@@ -475,6 +535,13 @@ > return 0; > } > >+String getString (int /*long*/ stringPtr) { >+ int strLength = OS.strlen (stringPtr); >+ byte[] buffer = new byte [strLength]; >+ OS.memmove (buffer, stringPtr, strLength); >+ return new String (Converter.mbcsToWcs (null, buffer)); >+} >+ > void store(String key, int value) { > store(key, String.valueOf(value)); > } >Index: Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java,v >retrieving revision 1.41 >diff -u -r1.41 Printer.java >--- Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java 1 Jul 2009 14:50:53 -0000 1.41 >+++ Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java 4 Mar 2010 19:39:02 -0000 >@@ -67,6 +67,32 @@ > static boolean disablePrinting = System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") != null; //$NON-NLS-1$ > > /** >+ * Returns an array of String objects representing all paper >+ * size names supported by printers on the platform. >+ * Note that the returned paper size names might be the >+ * list supported by only default printer. >+ * >+ * @return a string array containing paper size names >+ * >+ * @since 3.6 >+ */ >+public static String[] getPaperNameList () { >+ int /*long*/ list = OS.gtk_paper_size_get_paper_sizes (true); >+ int count = OS.g_list_length(list); >+ String[] result = new String[count]; >+ for (int i=0; i<count; i++) { >+ int /*long*/ paper = OS.g_list_nth_data(list, i); >+ int /*long*/ paperNamePtr = OS.gtk_paper_size_get_name (paper); >+ int length = OS.strlen (paperNamePtr); >+ byte [] buffer = new byte [length]; >+ OS.memmove (buffer, paperNamePtr, length); >+ result[i] = new String (Converter.mbcsToWcs (null, buffer)); >+ } >+ OS.g_list_free (list); >+ return result; >+} >+ >+/** > * Returns an array of <code>PrinterData</code> objects > * representing all available printers. If there are no > * printers, the array will be empty. >@@ -214,29 +240,16 @@ > /* Retrieve stored page_setup data. > * Note that page_setup properties must be stored (in PrintDialog) and restored (here) in the same order. > */ >- OS.gtk_page_setup_set_orientation(page_setup, restoreInt("orientation")); //$NON-NLS-1$ > OS.gtk_page_setup_set_top_margin(page_setup, restoreDouble("top_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$ > OS.gtk_page_setup_set_bottom_margin(page_setup, restoreDouble("bottom_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$ > OS.gtk_page_setup_set_left_margin(page_setup, restoreDouble("left_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$ > OS.gtk_page_setup_set_right_margin(page_setup, restoreDouble("right_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$ >- byte [] name = restoreBytes("paper_size_name", true); //$NON-NLS-1$ >- byte [] display_name = restoreBytes("paper_size_display_name", true); //$NON-NLS-1$ >- byte [] ppd_name = restoreBytes("paper_size_ppd_name", true); //$NON-NLS-1$ >- double width = restoreDouble("paper_size_width"); //$NON-NLS-1$ >- double height = restoreDouble("paper_size_height"); //$NON-NLS-1$ >- boolean custom = restoreBoolean("paper_size_is_custom"); //$NON-NLS-1$ >- int /*long*/ paper_size = 0; >- if (custom) { >- if (ppd_name.length > 0) { >- paper_size = OS.gtk_paper_size_new_from_ppd(ppd_name, display_name, width, height); >- } else { >- paper_size = OS.gtk_paper_size_new_custom(name, display_name, width, height, OS.GTK_UNIT_MM); >- } >- } else { >- paper_size = OS.gtk_paper_size_new(name); >- } >- OS.gtk_page_setup_set_paper_size(page_setup, paper_size); >- OS.gtk_paper_size_free(paper_size); >+ OS.gtk_print_settings_set_reverse (settings, restoreBoolean("reverse")); //$NON-NLS-1$ >+ OS.gtk_print_settings_set_use_color (settings, restoreBoolean("color_mode")); //$NON-NLS-1$ >+ OS.gtk_print_settings_set_quality (settings, restoreInt("print_quality")); //$NON-NLS-1$ >+ OS.gtk_print_settings_set_default_source (settings, restoreBytes("paper_source",true)); //$NON-NLS-1$ >+ OS.gtk_print_settings_set_media_type (settings, restoreBytes("media_type",true)); //$NON-NLS-1$ >+ OS.gtk_print_settings_set_output_bin (settings, restoreBytes("output_bin",true)); //$NON-NLS-1$ > } > > static DeviceData checkNull (PrinterData data) { >Index: Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java,v >retrieving revision 1.49 >diff -u -r1.49 PrintDialog.java >--- Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java 23 Nov 2009 21:54:12 -0000 1.49 >+++ Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java 4 Mar 2010 19:39:02 -0000 >@@ -121,6 +121,30 @@ > return checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0); > } > >+short[] getPaperSizeList () { >+ short[] resArray = null; >+ int[] pOutput = new int[1]; >+ int paperNamesLen = Printer.getDeviceCapabilities(OS.DC_PAPERS, pOutput); >+ if (paperNamesLen > 0) { >+ resArray = new short[paperNamesLen]; >+ OS.MoveMemory(resArray, pOutput[0], paperNamesLen * 2); >+ if (pOutput[0] != 0) OS.HeapFree(OS.GetProcessHeap(), 0, pOutput[0]); >+ } >+ return resArray; >+} >+ >+short getSystemPaperSize (String paperSize) { >+ if (paperSize == null) return -1; >+ String[] paperList = Printer.getPaperNameList(); >+ int i; >+ for (i=0; i<paperList.length; i++) { >+ if (paperSize.equals(paperList[i])) break; >+ } >+ if (i == paperList.length) return -1; >+ short[] paperSizeNumbers = getPaperSizeList(); >+ return paperSizeNumbers[i]; >+} >+ > /** > * Sets the printer data that will be used when the dialog > * is opened. >@@ -290,7 +314,6 @@ > int style = getStyle(); > int /*long*/ hwndOwner = parent.handle; > int /*long*/ hwndParent = parent.handle; >- > /* > * Feature in Windows. There is no API to set the orientation of a > * file dialog. It is always inherited from the parent. The fix is >@@ -318,7 +341,6 @@ > if (enabled) OS.EnableWindow (hwndParent, false); > } > } >- > PrinterData data = null; > PRINTDLG pd = new PRINTDLG(); > pd.lStructSize = PRINTDLG.sizeof; >@@ -327,7 +349,6 @@ > /* Initialize PRINTDLG fields, including DEVMODE. */ > pd.Flags = OS.PD_RETURNDEFAULT; > if (OS.PrintDlg(pd)) { >- > /* > * If user setup info from a previous print dialog was specified, > * then restore the previous DEVMODE struct. >@@ -341,32 +362,144 @@ > if (pd.hDevMode != 0) OS.GlobalFree(pd.hDevMode); > pd.hDevMode = lpInitData; > } >- > /* Initialize the DEVMODE struct's fields from the printerData. */ > int /*long*/ hMem = pd.hDevMode; > int /*long*/ ptr = OS.GlobalLock(hMem); > DEVMODE devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA (); > OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof()); >+ /* Printer Name */ >+ if (printerData.name != null) { >+ String name = printerData.name; >+ if (OS.IsUnicode) { >+ char[] buffer = new char[32]; >+ name.getChars(0, name.length(), buffer, 0); >+ ((DEVMODEW)devmode).dmDeviceName = buffer; >+ } else { >+ ((DEVMODEA)devmode).dmDeviceName = name.getBytes(); >+ } >+ } >+ /* Orientation */ > devmode.dmFields |= OS.DM_ORIENTATION; > devmode.dmOrientation = printerData.orientation == PrinterData.PORTRAIT ? OS.DMORIENT_PORTRAIT : OS.DMORIENT_LANDSCAPE; >- if (printerData.copyCount != 1) { >- devmode.dmFields |= OS.DM_COPIES; >- devmode.dmCopies = (short)printerData.copyCount; >- } >- if (printerData.collate != false) { >- devmode.dmFields |= OS.DM_COLLATE; >- devmode.dmCollate = OS.DMCOLLATE_TRUE; >+ /* Copy Count */ >+ devmode.dmFields |= OS.DM_COPIES; >+ devmode.dmCopies = (short)printerData.copyCount; >+ /* Collate */ >+ devmode.dmFields |= OS.DM_COLLATE; >+ devmode.dmCollate = OS.DMCOLLATE_TRUE; >+ /*Scale*/ >+ devmode.dmFields |= OS.DM_SCALE; >+ devmode.dmScale = (short)printerData.scale; >+ /* Duplex Mode */ >+ devmode.dmFields |= OS.DM_DUPLEX; >+ devmode.dmDuplex = (short)(printerData.duplex + 1); >+ /* Paper size*/ >+ TCHAR currentPrinter; >+ if (printerData.name == null) { >+ int[] nameLen = new int[1]; >+ OS.GetDefaultPrinter (null, nameLen); >+ currentPrinter = new TCHAR (0,nameLen[0]); >+ OS.GetDefaultPrinter (currentPrinter, nameLen); >+ } else { >+ currentPrinter = new TCHAR(0, printerData.name, true); >+ } >+ int[] /*long*/ printerHandle = new int /*long*/ [1]; >+ OS.OpenPrinter (currentPrinter, printerHandle, null); >+ /* TODO: >+ * Do we need to CreateDC and ResetDC for the changes of >+ * custom paperSize to get reflected in the public devmode >+ * settings ? >+ */ >+/* TCHAR driver1 = new TCHAR(0, "winspool", true); >+ TCHAR name = new TCHAR(0, ((DEVMODEW)devmode).dmDeviceName, true); >+ int long hdc = OS.CreateDC(driver1, name, 0, ptr);*/ >+ if (printerData.paperSizeName.intern() == PrinterData.PAPER_CUSTOM) { >+ devmode.dmFields |= OS.DM_PAPERSIZE | OS.DM_PAPERWIDTH | OS.DM_PAPERLENGTH; >+ devmode.dmPaperSize = OS.DMPAPER_USER; >+ /* Coversion from Inches -to- tenths of mm */ >+ devmode.dmPaperLength = (short)(printerData.customPaperHeight * 25.40 * 10); >+ devmode.dmPaperWidth = (short)(printerData.customPaperWidth * 25.40 * 10); >+ >+ /*TODO: We might need to add a new custom paper size to the existing >+ * set of forms. However, this doesn't work for unknown reasons for now. >+ */ >+ FORM_INFO_1 printForm = new FORM_INFO_1(); >+ printForm.Flags = 0; >+ printForm.Size.cx = (int) printerData.customPaperHeight * 25400; >+ printForm.Size.cy = (int) printerData.customPaperHeight * 25400; >+ printForm.ImageableArea.left = 0; >+ printForm.ImageableArea.top = 0; >+ printForm.ImageableArea.bottom = printForm.Size.cx; >+ printForm.ImageableArea.right = printForm.Size.cy; >+ >+ TCHAR buffer = new TCHAR (0, printerData.customPaperName, true); >+ int byteCount = buffer.length () * TCHAR.sizeof; >+ printForm.pName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); >+ OS.MoveMemory (printForm.pName, buffer, byteCount); >+ >+ int /*long*/ formPtr = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, FORM_INFO_1.sizeof); >+ OS.MoveMemory(formPtr, printForm, FORM_INFO_1.sizeof); >+ boolean addRes = OS.AddForm (printerHandle[0], 1, formPtr); >+ System.out.println("AddForm result:"+addRes); >+ addRes = OS.SetForm (printerHandle[0], buffer, 1, formPtr); >+ System.out.println("SetForm result:"+addRes); >+ } else { >+ devmode.dmFields |= OS.DM_PAPERSIZE; >+ String keys[] = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4, >+ PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE}; >+ short[] values = {OS.DMPAPER_LEGAL, OS.DMPAPER_LETTER, OS.DMPAPER_A2, OS.DMPAPER_A4, >+ OS.DMPAPER_A5, OS.DMPAPER_A6, OS.DMPAPER_B5, OS.DMPAPER_JB5, OS.DMPAPER_EXECUTIVE}; >+ int index; >+ for (index=0; index < keys.length; index++) { >+ if (printerData.paperSizeName.equals(keys[index])) break; >+ } >+ if (index < keys.length) { >+ devmode.dmPaperSize = values [index]; >+ } else { >+ try { >+ devmode.dmPaperSize = Short.parseShort(printerData.paperSizeName); >+ } catch(NumberFormatException nfe) { >+ short paperNumber = getSystemPaperSize (printerData.paperSizeName); >+ if (paperNumber != -1) devmode.dmPaperSize = paperNumber; >+ else devmode.dmPaperSize = OS.DMPAPER_A4; >+ } >+ } >+ } >+ /* Pages Per Side */ >+ if (devmode.dmNup == 1) { >+ devmode.dmFields |= OS.DM_NUP; >+ /*TODO: Currently there is no way of directly >+ * assigning the Nup value. >+ * OS.updateNup(devmode.dmDriverExtra, 4); >+ */ > } >+ /* Resolution */ >+ if (printerData.resolutionX != 0) { >+ devmode.dmFields |= OS.DM_PRINTQUALITY; >+ devmode.dmYResolution = (short) printerData.resolutionY; >+ } >+ if (printerData.resolutionY != 0) { >+ devmode.dmFields |= OS.DM_YRESOLUTION; >+ devmode.dmPrintQuality = (short) printerData.resolutionX; >+ } >+ /* Sync with devmode settings for getting apt values of PaperSize */ > OS.MoveMemory(ptr, devmode, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof()); >+ OS.DocumentProperties(0, printerHandle[0], currentPrinter, 0, ptr, OS.DM_IN_BUFFER); >+ /*OS.ResetDC (hdc, ptr);*/ > OS.GlobalUnlock(hMem); >- >+ > pd.Flags = OS.PD_USEDEVMODECOPIESANDCOLLATE; >- if (printerData.printToFile) pd.Flags |= OS.PD_PRINTTOFILE; > switch (printerData.scope) { > case PrinterData.PAGE_RANGE: pd.Flags |= OS.PD_PAGENUMS; break; > case PrinterData.SELECTION: pd.Flags |= OS.PD_SELECTION; break; > default: pd.Flags |= OS.PD_ALLPAGES; > } >+ if ((printerData.scope & PrinterData.NO_SELECTION) != 0) pd.Flags |= OS.PD_NOSELECTION; >+ String outputFileName = null; >+ if (printerData.printToFile) { >+ pd.Flags |= OS.PD_PRINTTOFILE; >+ if (printerData.fileName != null) outputFileName = printerData.fileName; >+ } > pd.nMinPage = 1; > pd.nMaxPage = -1; > pd.nFromPage = (short) Math.min (0xFFFF, Math.max (1, printerData.startPage)); >@@ -395,7 +528,6 @@ > } > } > } >- > if (success) { > /* Get driver and device from the DEVNAMES struct */ > hMem = pd.hDevNames; >@@ -405,7 +537,7 @@ > short[] offsets = new short[4]; > OS.MoveMemory(offsets, ptr, 2 * offsets.length); > TCHAR buffer = new TCHAR(0, size); >- OS.MoveMemory(buffer, ptr, size); >+ OS.MoveMemory(buffer, ptr, size); > OS.GlobalUnlock(hMem); > if (pd.hDevNames != 0) OS.GlobalFree(pd.hDevNames); > >@@ -416,7 +548,7 @@ > i++; > } > String driver = buffer.toString(driverOffset, i); >- >+ > int deviceOffset = offsets[1]; > i = 0; > while (deviceOffset + i < size) { >@@ -443,7 +575,15 @@ > data.scope = PrinterData.SELECTION; > } > data.printToFile = (pd.Flags & OS.PD_PRINTTOFILE) != 0; >- if (data.printToFile) data.fileName = output; >+ if (data.printToFile) { >+ String fullPath; >+ if (outputFileName != null && !outputFileName.equals("")) { >+ fullPath = outputFileName; >+ } else { >+ fullPath = output; >+ } >+ data.fileName = fullPath; >+ } > data.copyCount = pd.nCopies; > data.collate = (pd.Flags & OS.PD_COLLATE) != 0; > >@@ -455,6 +595,16 @@ > OS.MoveMemory(data.otherData, ptr, size); > devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA (); > OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof()); >+ data.paperSizeName = String.valueOf(devmode.dmPaperSize); >+ if (devmode.dmPaperSize >= 256) { >+ data.paperSizeName = PrinterData.PAPER_CUSTOM; >+ data.customPaperHeight = devmode.dmPaperLength; >+ data.customPaperWidth = devmode.dmPaperWidth; >+ } >+ data.duplex = devmode.dmDuplex - 1; >+ data.scale = devmode.dmScale; >+ data.resolutionX = devmode.dmPrintQuality; >+ data.resolutionY = devmode.dmYResolution; > if ((devmode.dmFields & OS.DM_ORIENTATION) != 0) { > int dmOrientation = devmode.dmOrientation; > data.orientation = dmOrientation == OS.DMORIENT_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT; >Index: Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java,v >retrieving revision 1.48 >diff -u -r1.48 Printer.java >--- Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java 1 Jul 2009 14:50:47 -0000 1.48 >+++ Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java 4 Mar 2010 19:39:02 -0000 >@@ -150,6 +150,61 @@ > return new PrinterData(driver, deviceName); > } > >+/** >+ * Returns an array of String objects representing all >+ * paper size names supported by printer on the platform. >+ * Note that the returned paper size names might be the >+ * list supported by only default printer. >+ * >+ * @return a String array containing paper size names. >+ * >+ * @since 3.6 >+ */ >+public static String[] getPaperNameList () { >+ String[] resArray = null; >+ int[] pOutput = new int[1]; >+ int paperNamesLen = getDeviceCapabilities(OS.DC_PAPERNAMES, pOutput); >+ if (paperNamesLen > 0) { >+ resArray = new String[paperNamesLen]; >+ for (int i=0; i< paperNamesLen; i++) { >+ TCHAR buf = new TCHAR(0, 64); >+ OS.MoveMemory(buf, pOutput[0] + (i * 64 * TCHAR.sizeof), 64); >+ String fullString = String.valueOf(buf); >+ resArray[i] = fullString.substring(0,fullString.indexOf('\0')); >+ } >+ if (pOutput[0] != 0) OS.HeapFree(OS.GetProcessHeap(), 0, pOutput[0]); >+ } >+ return resArray; >+} >+ >+static int getDeviceCapabilities (int capability, int[] pOutput) { >+ int[] nameLen = new int[1]; >+ OS.GetDefaultPrinter (null, nameLen); >+ TCHAR printerName = new TCHAR(0, nameLen[0]); >+ OS.GetDefaultPrinter (printerName, nameLen); >+ >+ int len = OS.DeviceCapabilities (printerName, null, capability, 0, 0); >+ if (len > 0) { >+ int /*long*/ hHeap = OS.GetProcessHeap(); >+ switch (capability) { >+ case OS.DC_PAPERS: >+ pOutput[0] = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, 2 * len); >+ OS.DeviceCapabilities (printerName, null, capability, pOutput[0], 0); >+ break; >+ case OS.DC_PAPERNAMES /* String [] */ : >+ /* >+ * Each paper name string buffer returned is of 64 chars long. If the name >+ * is shorter than 64, then \0 is filled into the buffer, otherwise the >+ * name is truncated at 64 chars. >+ */ >+ pOutput[0] = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof * len * 64); >+ OS.DeviceCapabilities (printerName, null, capability, pOutput[0], 0); >+ break; >+ } >+ } >+ return len; >+} >+ > static DeviceData checkNull (PrinterData data) { > if (data == null) data = new PrinterData(); > if (data.driver == null || data.name == null) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 96394
:
158751
|
158841
|
159788
|
161015
|
161111
|
162862
|
162867