diff options
author | Kevin Barnes <krbarnes> | 2008-04-16 15:39:37 +0000 |
---|---|---|
committer | Kevin Barnes <krbarnes> | 2008-04-16 15:39:37 +0000 |
commit | 8ba79ad7bd6d588e3bd10eca6f841cfe90f97343 (patch) | |
tree | bfe8726284e3c53b3806d7e4937b6f1b6fdf5d64 /bundles/org.eclipse.swt/Eclipse SWT PI | |
parent | 4f3682c5934d9310f45bf2a66eb2031ddf908938 (diff) | |
download | eclipse.platform.swt-8ba79ad7bd6d588e3bd10eca6f841cfe90f97343.tar.gz eclipse.platform.swt-8ba79ad7bd6d588e3bd10eca6f841cfe90f97343.tar.xz eclipse.platform.swt-8ba79ad7bd6d588e3bd10eca6f841cfe90f97343.zip |
219133 - printer.getDPI() returns 72x72
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
4 files changed, 40 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c index 14ace69e4a..0194ee19fc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c @@ -10335,6 +10335,22 @@ fail: } #endif +#ifndef NO_PMPrinterGetOutputResolution +JNIEXPORT jint JNICALL OS_NATIVE(PMPrinterGetOutputResolution) + (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2) +{ + PMResolution _arg2, *lparg2=NULL; + jint rc = 0; + OS_NATIVE_ENTER(env, that, PMPrinterGetOutputResolution_FUNC); + if (arg2) if ((lparg2 = getPMResolutionFields(env, arg2, &_arg2)) == NULL) goto fail; + rc = (jint)PMPrinterGetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution *)lparg2); +fail: + if (arg2 && lparg2) setPMResolutionFields(env, arg2, lparg2); + OS_NATIVE_EXIT(env, that, PMPrinterGetOutputResolution_FUNC); + return rc; +} +#endif + #ifndef NO_PMRelease JNIEXPORT jint JNICALL OS_NATIVE(PMRelease) (JNIEnv *env, jclass that, jint arg0) @@ -10473,6 +10489,22 @@ JNIEXPORT jint JNICALL OS_NATIVE(PMSessionError) } #endif +#ifndef NO_PMSessionGetCurrentPrinter +JNIEXPORT jint JNICALL OS_NATIVE(PMSessionGetCurrentPrinter) + (JNIEnv *env, jclass that, jint 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_PMSessionGetDestinationType JNIEXPORT jint JNICALL OS_NATIVE(PMSessionGetDestinationType) (JNIEnv *env, jclass that, jint arg0, jint arg1, jshortArray arg2) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c index 53d1618978..09b7ba5d13 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 965; -int OS_nativeFunctionCallCount[965]; +int OS_nativeFunctionCount = 967; +int OS_nativeFunctionCallCount[967]; char * OS_nativeFunctionNames[] = { "AECoerceDesc", "AECountItems", @@ -718,6 +718,7 @@ char * OS_nativeFunctionNames[] = { "PMGetLastPage", "PMGetPageRange", "PMGetResolution", + "PMPrinterGetOutputResolution", "PMRelease", "PMSessionBeginDocumentNoDialog", "PMSessionBeginPageNoDialog", @@ -728,6 +729,7 @@ char * OS_nativeFunctionNames[] = { "PMSessionEndDocumentNoDialog", "PMSessionEndPageNoDialog", "PMSessionError", + "PMSessionGetCurrentPrinter", "PMSessionGetDestinationType", "PMSessionGetGraphicsContext", "PMSessionPageSetupDialog", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h index 18ba91e335..ca35b1c28f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h @@ -726,6 +726,7 @@ typedef enum { PMGetLastPage_FUNC, PMGetPageRange_FUNC, PMGetResolution_FUNC, + PMPrinterGetOutputResolution_FUNC, PMRelease_FUNC, PMSessionBeginDocumentNoDialog_FUNC, PMSessionBeginPageNoDialog_FUNC, @@ -736,6 +737,7 @@ typedef enum { PMSessionEndDocumentNoDialog_FUNC, PMSessionEndPageNoDialog_FUNC, PMSessionError_FUNC, + PMSessionGetCurrentPrinter_FUNC, PMSessionGetDestinationType_FUNC, PMSessionGetGraphicsContext_FUNC, PMSessionPageSetupDialog_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java index f4592100d5..02b127bf10 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java @@ -1727,6 +1727,7 @@ public static final native int PMGetFirstPage(int printSettings, int[] first); public static final native int PMGetJobNameCFString(int printSettings, int[] name); public static final native int PMGetLastPage(int printSettings, int[] last); public static final native int PMGetPageRange(int printSettings, int[] minPage, int[] maxPage); +public static final native int PMPrinterGetOutputResolution(int i, int printSettings, PMResolution resolution); public static final native int PMRelease(int printManagerObject); public static final native int PMGetResolution(int pageFormat, PMResolution resolution); public static final native int PMSessionBeginDocumentNoDialog(int printSession, int printSettings, int pageFormat); @@ -1738,6 +1739,7 @@ public static final native int PMSessionDefaultPrintSettings(int printSession, i public static final native int PMSessionEndDocumentNoDialog(int printSession); public static final native int PMSessionEndPageNoDialog(int printSession); public static final native int PMSessionError(int printSession); +public static final native int PMSessionGetCurrentPrinter(int printSession, int[] printer); public static final native int PMSessionGetDestinationType(int printSession, int printSettings, short[] destTypeP); public static final native int PMSessionGetGraphicsContext(int printSession, int graphicsType, int[] graphicsContext); public static final native int PMSessionPageSetupDialog(int printSession, int pageFormat, boolean[] result); |