harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apavle...@apache.org
Subject svn commit: r593524 [2/2] - in /harmony/enhanced/classlib/trunk/modules/print/src/main: java/windows/org/apache/harmony/x/print/ native/print/windows/
Date Fri, 09 Nov 2007 13:45:46 GMT
Added: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/devmode_struct_wrapper.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/devmode_struct_wrapper.h?rev=593524&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/devmode_struct_wrapper.h
(added)
+++ harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/devmode_struct_wrapper.h
Fri Nov  9 05:45:45 2007
@@ -0,0 +1,342 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+#include <jni.h>
+
+#ifndef _Included_org_apache_harmony_x_print_DevmodeStructWrapper
+#define _Included_org_apache_harmony_x_print_DevmodeStructWrapper
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_ORIENTATION
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_ORIENTATION 1L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_PAPERSIZE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_PAPERSIZE 2L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_PAPERLENGTH
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_PAPERLENGTH 4L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_PAPERWIDTH
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_PAPERWIDTH 8L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_SCALE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_SCALE 16L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_COPIES
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_COPIES 256L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_DEFAULTSOURCE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_DEFAULTSOURCE 512L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_PRINTQUALITY
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_PRINTQUALITY 1024L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_COLOR
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_COLOR 2048L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_DUPLEX
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_DUPLEX 4096L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_YRESOLUTION
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_YRESOLUTION 8192L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_TTOPTION
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_TTOPTION 16384L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DM_COLLATE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DM_COLLATE 32768L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMORIENT_PORTRAIT
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMORIENT_PORTRAIT 1L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMORIENT_LANDSCAPE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMORIENT_LANDSCAPE 2L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMRES_HIGH
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMRES_HIGH -4L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMRES_MEDIUM
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMRES_MEDIUM -3L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMRES_DRAFT
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMRES_DRAFT -1L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMDUP_SIMPLEX
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMDUP_SIMPLEX 1L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMDUP_VERTICAL
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMDUP_VERTICAL 2L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMDUP_HORIZONTAL
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMDUP_HORIZONTAL 3L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLLATE_FALSE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLLATE_FALSE 0L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLLATE_TRUE
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLLATE_TRUE 1L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLOR_MONOCHROME
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLOR_MONOCHROME 1L
+#undef org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLOR_COLOR
+#define org_apache_harmony_x_print_DevmodeStructWrapper_DMCOLOR_COLOR 2L
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmDeviceName
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmDeviceName
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmFields
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmFields
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmOrientation
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmOrientation
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmOrientation
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmOrientation
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmPaperSize
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmPaperSize
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmPaperSize
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmPaperSize
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmPaperLength
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmPaperLength
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmPaperLength
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmPaperLength
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmPaperWidth
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmPaperWidth
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmPaperWidth
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmPaperWidth
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmScale
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmScale
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmScale
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmScale
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmCopies
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmCopies
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmCopies
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmCopies
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmDefaultSource
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmDefaultSource
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmDefaultSource
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmDefaultSource
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmPrintQuality
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmPrintQuality
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmPrintQuality
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmPrintQuality
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmColor
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmColor
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmColor
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmColor
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmDuplex
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmDuplex
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmDuplex
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmDuplex
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmYResolution
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmYResolution
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmYResolution
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmYResolution
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmTTOption
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmTTOption
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmTTOption
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmTTOption
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    getDmCollate
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_getDmCollate
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    setDmCollate
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_setDmCollate
+  (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class:     org_apache_harmony_x_print_DevmodeStructWrapper
+ * Method:    releaseStruct
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_DevmodeStructWrapper_releaseStruct
+  (JNIEnv *, jclass, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class org_apache_harmony_x_print_DevmodeStructWrapper_CustomPaper */
+
+#ifndef _Included_org_apache_harmony_x_print_DevmodeStructWrapper_CustomPaper
+#define _Included_org_apache_harmony_x_print_DevmodeStructWrapper_CustomPaper
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class org_apache_harmony_x_print_DevmodeStructWrapper_Paper */
+
+#ifndef _Included_org_apache_harmony_x_print_DevmodeStructWrapper_Paper
+#define _Included_org_apache_harmony_x_print_DevmodeStructWrapper_Paper
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class org_apache_harmony_x_print_DevmodeStructWrapper_StdPaper */
+
+#ifndef _Included_org_apache_harmony_x_print_DevmodeStructWrapper_StdPaper
+#define _Included_org_apache_harmony_x_print_DevmodeStructWrapper_StdPaper
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif

Propchange: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/devmode_struct_wrapper.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/makefile?rev=593524&r1=593523&r2=593524&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/makefile Fri
Nov  9 05:45:45 2007
@@ -30,7 +30,9 @@
   -I$(SHAREDSUB)\include
 
 BUILDFILES = print.obj \
-ui.obj
+ui.obj \
+win_printer_factory.obj \
+devmode_struct_wrapper.obj
 
 VIRTFILES = $(LIBBASE).res
 SYSLIBFILES = ws2_32.lib Iphlpapi.lib

Added: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.c?rev=593524&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.c
(added)
+++ harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.c
Fri Nov  9 05:45:45 2007
@@ -0,0 +1,434 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+#include "win_printer_factory.h"
+#include <windows.h>
+#include <stdio.h>
+
+// Cast pointer to jlong
+#define PCAST(p) (jlong) (signed long) p
+// Cast jlong to pointer
+#define JCAST(jlongVal, type) (type) (unsigned long) jlongVal
+#define TOHDC(jlongVal) JCAST(jlongVal, HDC)
+
+// ----------------   Error handlers   -----------------------
+static char * getFileName(const char * path) {
+	char * p = (char *) (path + strlen(path));
+
+	for (; p > path; *p--) {
+		if ((*p == '/') || (*p == '\\')) {
+			p++;
+			return p;
+		}
+	}
+
+	return NULL;
+}
+
+static void handleError(const char * func, const char * file, unsigned line,
+		JNIEnv * env, char * msg) {
+	const char * format = "%s(%s:%i): %s";
+	char buff[512];
+
+	sprintf(buff, format, func, getFileName(file), line, msg);
+	(*env)->ThrowNew(env, (*env)->FindClass(env, "javax/print/PrintException"), buff);
+}
+
+static void handleLastError(const char * func, const char * file,
+		unsigned line, JNIEnv * env) {
+	char * msg;
+
+	FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+	FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+	MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *) &msg, 0, NULL);
+
+	handleError(func, file, line, env, msg);
+}
+
+// ----------------   Auxiliary functions   -----------------
+
+static void * getPrinterInfo(HANDLE handle, DWORD level) {
+	void * info;
+	DWORD size;
+
+	// Calculate buffer size
+	GetPrinterW(handle, level, NULL, 0, &size);
+	info = calloc(1, size);
+
+	if (info == NULL) {
+		SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+		return NULL;
+	}
+
+	if (!GetPrinterW(handle, level, (LPBYTE) info, size, &size)) {
+		return NULL;
+	}
+
+	return info;
+}
+
+static DWORD getPrinterCapabilities(JNIEnv * env, jlong handle, WORD query,
+		void * output) {
+	DWORD result;
+	PRINTER_INFO_2W * info = (PRINTER_INFO_2W *) getPrinterInfo(JCAST(handle, HANDLE), 2);
+
+	if (info == NULL) {
+		SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		return -1;
+	}
+
+	result = DeviceCapabilitiesW((*info).pPrinterName, (*info).pPortName, query, output, NULL);
+	free(info);
+	return result;
+}
+
+// ----------------   JNI functions   -----------------------
+
+JNIEXPORT jstring JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getDefaultPrinterName(JNIEnv
* env, jclass c) {
+	DWORD len = 1024;
+	unsigned short buff[1024];
+	jstring name;
+	BOOL result = GetDefaultPrinterW(buff, &len);
+
+	if (!result) {
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+	} else if (result == ERROR_FILE_NOT_FOUND) {
+		handleError(__FUNCTION__,__FILE__ , __LINE__, env, "No default printer");
+	} else if (result == ERROR_INSUFFICIENT_BUFFER) {
+		handleError(__FUNCTION__,__FILE__ , __LINE__, env, "Printer name is too long");
+	} else {
+		name = (*env)->NewString(env, buff, len - 1);
+	}
+
+	return name;
+}
+
+JNIEXPORT jobjectArray JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getConnectedPrinterNames(JNIEnv
* env, jclass c) {
+	DWORD i;
+	DWORD cbNeeded;
+	DWORD cReturned;
+	PRINTER_INFO_4W * printers;
+	jobjectArray result;
+
+	// Compute buffer size
+	EnumPrintersW(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4,
+			NULL, 0, &cbNeeded, &cReturned);
+
+	if (cbNeeded == 0) {
+		handleError(__FUNCTION__,__FILE__ , __LINE__, env, "Unknown buffer size");
+		return NULL;
+	}
+
+	printers = (PRINTER_INFO_4W *) calloc(1, cbNeeded);
+
+	if (printers == NULL) {
+		SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		return NULL;
+	}
+
+	if (EnumPrintersW(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4,
+					(LPBYTE) printers, cbNeeded, &cbNeeded, &cReturned)) {
+		result = (*env)->NewObjectArray(env, cReturned,
+				(*env)->FindClass(env, "java/lang/String"), NULL);
+
+		for (i = 0; i < cReturned; i++) {
+			(*env)->SetObjectArrayElement(env, result, i,
+					(*env)->NewString(env, printers[i].pPrinterName,
+							wcslen(printers[i].pPrinterName)));
+		}
+	} else {
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+	}
+
+	free(printers);
+	return result;
+}
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterHandle(JNIEnv
* env, jclass c, jstring jprinterName) {
+	HANDLE handle;
+	const unsigned short * printerName = (*env)->GetStringChars(env, jprinterName, NULL);
+
+	if (!OpenPrinterW((unsigned short *) printerName, &handle, NULL)) {
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+	}
+
+	(*env)->ReleaseStringChars(env, jprinterName, printerName);
+	return PCAST(handle);
+}
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_releasePrinterHandle(JNIEnv
* env, jclass c, jlong handle) {
+	if (!ClosePrinter(JCAST(handle, HANDLE))) {
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+	}
+}
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterProps(JNIEnv
* env, jclass c, jstring jprinterName, jlong handle) {
+	DEVMODEW * dm;
+	const unsigned short * printerName = (*env)->GetStringChars(env, jprinterName, NULL);
+	unsigned long dmSize = DocumentPropertiesW(NULL, JCAST(handle, HANDLE),
+			(unsigned short *) printerName, NULL, NULL, 0);
+
+	if (dmSize < 0) {
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		(*env)->ReleaseStringChars(env, jprinterName, printerName);
+		return 0;
+	}
+
+	dm = calloc(1, dmSize);
+
+	if (dm == NULL) {
+		SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		return 0;
+	}
+
+	if (DocumentPropertiesW(NULL, JCAST(handle, HANDLE),
+					(unsigned short *) printerName, dm, NULL, DM_OUT_BUFFER) != IDOK) {
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		return 0;
+	}
+
+	(*env)->ReleaseStringChars(env, jprinterName, printerName);
+	return PCAST(dm);
+}
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterDC(JNIEnv
* env, jclass c, jstring jprinterName, jlong pDevMode) {
+	const unsigned short * printerName = (*env)->GetStringChars(env, jprinterName, NULL);
+	HDC pdc = CreateDCW(L"WINSPOOL", printerName, NULL, JCAST(pDevMode, DEVMODEW *));
+
+	(*env)->ReleaseStringChars(env, jprinterName, printerName);
+
+	if (pdc == NULL) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return 0;
+	}
+
+	return PCAST(pdc);
+}
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_releasePrinterDC(JNIEnv
* env, jclass c, jlong pdc) {
+	if (!DeleteDC(TOHDC(pdc))) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_startDoc(JNIEnv
* env, jclass c, jlong pdc, jstring jdocName, jstring jfilePath) {
+	jint jobId;
+	DOCINFOW docInfo = {0};
+
+	docInfo.cbSize = sizeof(docInfo);
+	docInfo.lpszDocName = (*env)->GetStringChars(env, jdocName, NULL);
+
+	if (jfilePath != NULL) {
+		docInfo.lpszOutput = (*env)->GetStringChars(env, jfilePath, NULL);
+	}
+
+	if ((jobId = (jint) StartDocW(TOHDC(pdc), &docInfo)) <= 0) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+
+	(*env)->ReleaseStringChars(env, jdocName, docInfo.lpszDocName);
+
+	if (jfilePath != NULL) {
+		(*env)->ReleaseStringChars(env, jdocName, docInfo.lpszOutput);
+	}
+
+	return jobId;
+}
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_endDoc(JNIEnv *
env, jclass c, jlong pdc) {
+	if (EndDoc(TOHDC(pdc)) <= 0) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+}
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_startPage(JNIEnv
* env, jclass c, jlong pdc) {
+	if (StartPage(TOHDC(pdc)) <= 0) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+}
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_endPage(JNIEnv *
env, jclass c, jlong pdc) {
+	if (EndPage(TOHDC(pdc)) <= 0) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getQueuedJobs(JNIEnv
* env, jclass c, jlong handle) {
+	jint result;
+	PRINTER_INFO_2W * info = (PRINTER_INFO_2W *) getPrinterInfo(JCAST(handle, HANDLE), 2);
+
+	if (info == NULL) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return 0;
+	}
+
+	result = (jint) (*info).cJobs;
+	free(info);
+
+	return result;
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPixelsPerInchX(JNIEnv
* env, jclass c, jlong pdc) {
+	return GetDeviceCaps(TOHDC(pdc), LOGPIXELSX);
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPixelsPerInchY(JNIEnv
* env, jclass c, jlong pdc) {
+	return GetDeviceCaps(TOHDC(pdc), LOGPIXELSY);
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPaperPhysicalWidth(JNIEnv
* env, jclass c, jlong pdc) {
+	return GetDeviceCaps(TOHDC(pdc), PHYSICALWIDTH);
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPaperPhysicalHeight(JNIEnv
* env, jclass c, jlong pdc) {
+	return GetDeviceCaps(TOHDC(pdc), PHYSICALHEIGHT);
+}
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterStatus(JNIEnv
* env, jclass c, jlong handle) {
+	jlong result;
+	PRINTER_INFO_2W * info = (PRINTER_INFO_2W *) getPrinterInfo(JCAST(handle, HANDLE), 2);
+
+	if (info == NULL) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return 0;
+	}
+
+	result = PCAST((*info).Status);
+	free(info);
+	return result;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_isColorPrintingSupported(JNIEnv
* env, jclass c, jlong handle) {
+	int result = getPrinterCapabilities(env, handle, DC_COLORDEVICE, NULL);
+
+	if(result == -1) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return JNI_FALSE;
+	} else if(result == 1) {
+		return JNI_TRUE;
+	}
+	return JNI_FALSE;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_isCollatingSupported(JNIEnv
* env, jclass c, jlong handle) {
+	if(getPrinterCapabilities(env, handle, DC_COLLATE, NULL) == 1) {
+		return JNI_TRUE;
+	}
+	return JNI_FALSE;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_isDuplexSupported(JNIEnv
* env, jclass c, jlong handle) {
+	if(getPrinterCapabilities(env, handle, DC_DUPLEX, NULL) == 1) {
+		return JNI_TRUE;
+	}
+	return JNI_FALSE;
+}
+
+JNIEXPORT jintArray JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getSupportedPaperSizes(JNIEnv
* env, jclass c, jlong handle) {
+	jintArray result;
+	POINT * points;
+	jint paper[2];
+	unsigned i;
+	DWORD size = getPrinterCapabilities(env, handle, DC_PAPERSIZE, NULL);
+
+	if ((signed long) size == -1) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return NULL;
+	}
+
+	result = (*env)->NewIntArray(env, size * 2);
+	points = (POINT *) calloc(sizeof(POINT), size);
+
+	if ((result == NULL) || (points == NULL)) {
+		SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		return NULL;
+	}
+
+	if (getPrinterCapabilities(env, handle, DC_PAPERSIZE, points) == -1) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return NULL;
+	}
+
+	for(i = 0; i < size; i++) {
+		paper[0] = (jint) points[i].x;
+		paper[1] = (jint) points[i].y;
+		(*env)->SetIntArrayRegion(env, result, i*2, 2, paper);
+	}
+
+	free(points);
+	return result;
+}
+
+JNIEXPORT jintArray JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getSupportedResolutions(JNIEnv
* env, jclass c, jlong handle) {
+	jintArray result;
+	jint * resolutions;
+	LONG * buff;
+	unsigned i;
+	DWORD size = getPrinterCapabilities(env, handle, DC_ENUMRESOLUTIONS, NULL);
+
+	if ((signed long) size == -1) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return NULL;
+	}
+
+	size *=2;
+	result = (*env)->NewIntArray(env, size);
+	buff = (LONG *) calloc(sizeof(LONG), size);
+	resolutions = (jint *) calloc(sizeof(jint), size);
+
+	if ((result == NULL) || (buff == NULL) || (resolutions == NULL)) {
+		SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+		handleLastError(__FUNCTION__,__FILE__ , __LINE__, env);
+		return NULL;
+	}
+
+	if (getPrinterCapabilities(env, handle, DC_ENUMRESOLUTIONS, buff) == -1) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+		return NULL;
+	}
+
+	for(i = 0; i < size; i++) {
+		resolutions[i] = (jint) buff[i];
+	}
+
+	(*env)->SetIntArrayRegion(env, result, 0, size, resolutions);
+	free(buff);
+	free(resolutions);
+	return result;
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getLandscapeOrientationDegree(JNIEnv
* env, jclass c, jlong handle) {
+	return getPrinterCapabilities(env, handle, DC_ORIENTATION, NULL);
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getMaxNumberOfCopies(JNIEnv
* env, jclass c, jlong handle) {
+	jint result = getPrinterCapabilities(env, handle, DC_COPIES, NULL);
+
+	if (result == -1) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+	return result;
+}
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_cancelPrinterJob(JNIEnv
*env , jclass c, jlong handle, jint jobId) {
+	if (!SetJobW(JCAST(handle, HANDLE), (DWORD) jobId, 0, NULL, JOB_CONTROL_DELETE)) {
+		handleLastError(__FUNCTION__, __FILE__, __LINE__, env);
+	}
+}

Propchange: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.h?rev=593524&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.h
(added)
+++ harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.h
Fri Nov  9 05:45:45 2007
@@ -0,0 +1,277 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+#include <jni.h>
+
+#ifndef _Included_org_apache_harmony_x_print_WinPrinterFactory
+#define _Included_org_apache_harmony_x_print_WinPrinterFactory
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAUSED
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAUSED 1L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_ERROR
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_ERROR 2L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PENDING_DELETION
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PENDING_DELETION 4L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAPER_JAM
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAPER_JAM 8L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAPER_OUT
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAPER_OUT 16L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_MANUAL_FEED
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_MANUAL_FEED 32L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAPER_PROBLEM
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAPER_PROBLEM 64L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_OFFLINE
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_OFFLINE 128L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_IO_ACTIVE
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_IO_ACTIVE 256L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_BUSY
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_BUSY 512L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PRINTING
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PRINTING 1024L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_OUTPUT_BIN_FULL
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_OUTPUT_BIN_FULL 2048L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_NOT_AVAILABLE
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_NOT_AVAILABLE 4096L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_WAITING
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_WAITING 8192L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PROCESSING
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PROCESSING 16384L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_INITIALIZING
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_INITIALIZING 32768L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_WARMING_UP
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_WARMING_UP 65536L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_TONER_LOW
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_TONER_LOW 131072L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_NO_TONER
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_NO_TONER 262144L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAGE_PUNT
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_PAGE_PUNT 524288L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_USER_INTERVENTION
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_USER_INTERVENTION 1048576L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_OUT_OF_MEMORY
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_OUT_OF_MEMORY 2097152L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_DOOR_OPEN
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_DOOR_OPEN 4194304L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_SERVER_UNKNOWN
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_SERVER_UNKNOWN 8388608L
+#undef org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_POWER_SAVE
+#define org_apache_harmony_x_print_WinPrinterFactory_PRINTER_STATUS_POWER_SAVE 16777216L
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getDefaultPrinterName
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getDefaultPrinterName
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getConnectedPrinterNames
+ * Signature: ()[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getConnectedPrinterNames
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPrinterHandle
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterHandle
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    releasePrinterHandle
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_releasePrinterHandle
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPrinterProps
+ * Signature: (Ljava/lang/String;J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterProps
+  (JNIEnv *, jclass, jstring, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPrinterDC
+ * Signature: (Ljava/lang/String;J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterDC
+  (JNIEnv *, jclass, jstring, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    releasePrinterDC
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_releasePrinterDC
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    startDoc
+ * Signature: (JLjava/lang/String;Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_startDoc
+  (JNIEnv *, jclass, jlong, jstring, jstring);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    endDoc
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_endDoc
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    startPage
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_startPage
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    endPage
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_endPage
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getQueuedJobs
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getQueuedJobs
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPixelsPerInchX
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPixelsPerInchX
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPixelsPerInchY
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPixelsPerInchY
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPaperPhysicalWidth
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPaperPhysicalWidth
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPaperPhysicalHeight
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPaperPhysicalHeight
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getPrinterStatus
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getPrinterStatus
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    isColorPrintingSupported
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_isColorPrintingSupported
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    isCollatingSupported
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_isCollatingSupported
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    isDuplexSupported
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_isDuplexSupported
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getSupportedPaperSizes
+ * Signature: (J)[I
+ */
+JNIEXPORT jintArray JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getSupportedPaperSizes
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getSupportedResolutions
+ * Signature: (J)[I
+ */
+JNIEXPORT jintArray JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getSupportedResolutions
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getLandscapeOrientationDegree
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getLandscapeOrientationDegree
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    getMaxNumberOfCopies
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_getMaxNumberOfCopies
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_apache_harmony_x_print_WinPrinterFactory
+ * Method:    cancelPrinterJob
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_x_print_WinPrinterFactory_cancelPrinterJob
+  (JNIEnv *, jclass, jlong, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Propchange: harmony/enhanced/classlib/trunk/modules/print/src/main/native/print/windows/win_printer_factory.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message