summaryrefslogtreecommitdiff
path: root/platform/windows/gsprint
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows/gsprint')
-rw-r--r--platform/windows/gsprint/dllmain.cpp19
-rw-r--r--platform/windows/gsprint/gsprint.cpp73
-rw-r--r--platform/windows/gsprint/gsprint.h12
3 files changed, 0 insertions, 104 deletions
diff --git a/platform/windows/gsprint/dllmain.cpp b/platform/windows/gsprint/dllmain.cpp
deleted file mode 100644
index bfaa6519..00000000
--- a/platform/windows/gsprint/dllmain.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// dllmain.cpp : Defines the entry point for the DLL application.
-#include <windows.h>
-
-BOOL APIENTRY DllMain( HMODULE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
diff --git a/platform/windows/gsprint/gsprint.cpp b/platform/windows/gsprint/gsprint.cpp
deleted file mode 100644
index 4f4a3924..00000000
--- a/platform/windows/gsprint/gsprint.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// gsprint.cpp : Defines the exported functions for the DLL application.
-//
-#include "gsprint.h"
-#include "stdlib.h"
-
-#define FAIL -1
-
-/* Code to handle the special device properties window as well as make sure
- * that the values are maintained when we leave */
-SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *hptr, void *printername, bool show_win)
-{
- HWND hWnd = (HWND)hptr;
- HANDLE hPrinter = NULL;
- LPDEVMODE pDevMode;
- DWORD dwNeeded, dwRet;
- wchar_t *output = NULL;
-
- int lenA = lstrlenA((char*)printername);
- int lenW = ::MultiByteToWideChar(CP_ACP, 0, (char*)printername, lenA, NULL, 0);
- if (lenW > 0)
- {
- output = new wchar_t[lenW + 1];
- if (output == NULL)
- return -1;
- ::MultiByteToWideChar(CP_ACP, 0, (char*)printername, lenA, output, lenW);
- output[lenW] = 0;
- }
- else
- return FAIL;
-
- if (!OpenPrinter(output, &hPrinter, NULL))
- {
- delete[] output;
- return FAIL;
- }
-
- /* First get the size needed */
- dwNeeded = DocumentProperties(hWnd, hPrinter, output, NULL, NULL, 0);
- pDevMode = (LPDEVMODE)malloc(dwNeeded);
- if (pDevMode == NULL)
- {
- delete[] output;
- ClosePrinter(hPrinter);
- return FAIL;
- }
-
- /* Now actually get the DEVMODE data. DM_IN_PROMPT brings up the window.
- * DM_OUT_BUFFER ensures that we get the values that have been set */
- DWORD fMode = DM_OUT_BUFFER;
- if (show_win)
- fMode = fMode | DM_IN_PROMPT;
-
- dwRet = DocumentProperties(hWnd, hPrinter, output, pDevMode, NULL, fMode);
- if (dwRet != IDOK)
- {
- delete[] output;
- ClosePrinter(hPrinter);
- free(pDevMode);
- return FAIL;
- }
-
- /* This is the secret to ensure that the DEVMODE settings are saved. Fun
- * finding this bit of information in the MS literature */
- PRINTER_INFO_9 new_info;
- new_info.pDevMode = pDevMode;
- SetPrinter(hPrinter, 9, (LPBYTE)&new_info, 0);
-
- /* Clean up */
- free(pDevMode);
- delete[] output;
- ClosePrinter(hPrinter);
- return 0;
-}
diff --git a/platform/windows/gsprint/gsprint.h b/platform/windows/gsprint/gsprint.h
deleted file mode 100644
index cfc2c7b3..00000000
--- a/platform/windows/gsprint/gsprint.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <windows.h>
-#include <winspool.h>
-
-#ifdef __cplusplus
-#define EXTERNC extern "C"
-#else
-#define EXTERNC
-#endif
-
-#define SYMBOL_DECLSPEC __declspec(dllexport)
-
-EXTERN_C SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *ctx, void *printername, bool show_win);