| 1 | /* $Id: printer.cpp,v 1.1 2001-07-14 15:31:45 sandervl Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * GDI32 printer apis | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright 2001 Sander van Leeuwen (sandervl@xs4all.nl) | 
|---|
| 7 | * | 
|---|
| 8 | * | 
|---|
| 9 | * Parts based on Wine code (StartDocW) | 
|---|
| 10 | * | 
|---|
| 11 | * Copyright 1996 John Harvey | 
|---|
| 12 | * Copyright 1998 Huw Davies | 
|---|
| 13 | * Copyright 1998 Andreas Mohr | 
|---|
| 14 | * Copyright 1999 Klaas van Gend | 
|---|
| 15 | * | 
|---|
| 16 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 17 | * | 
|---|
| 18 | */ | 
|---|
| 19 | #include <os2win.h> | 
|---|
| 20 | #include <stdarg.h> | 
|---|
| 21 | #include <misc.h> | 
|---|
| 22 | #include <heapstring.h> | 
|---|
| 23 |  | 
|---|
| 24 | #define DBG_LOCALLOG    DBG_printer | 
|---|
| 25 | #include "dbglocal.h" | 
|---|
| 26 |  | 
|---|
| 27 | //****************************************************************************** | 
|---|
| 28 | //****************************************************************************** | 
|---|
| 29 | INT WIN32API StartDocA(HDC hdc, const DOCINFOA *lpDocInfo) | 
|---|
| 30 | { | 
|---|
| 31 | dprintf(("GDI32: StartDocA %x %x", hdc, lpDocInfo)); | 
|---|
| 32 | return O32_StartDoc(hdc, (LPDOCINFOA)lpDocInfo); | 
|---|
| 33 | } | 
|---|
| 34 | //****************************************************************************** | 
|---|
| 35 | //****************************************************************************** | 
|---|
| 36 | INT WIN32API StartDocW(HDC hdc, const DOCINFOW* doc) | 
|---|
| 37 | { | 
|---|
| 38 | DOCINFOA docA; | 
|---|
| 39 | INT ret; | 
|---|
| 40 |  | 
|---|
| 41 | docA.cbSize = doc->cbSize; | 
|---|
| 42 | docA.lpszDocName = doc->lpszDocName ? | 
|---|
| 43 | HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszDocName ) : NULL; | 
|---|
| 44 | docA.lpszOutput = doc->lpszOutput ? | 
|---|
| 45 | HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszOutput ) : NULL; | 
|---|
| 46 | docA.lpszDatatype = doc->lpszDatatype ? | 
|---|
| 47 | HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszDatatype ) : NULL; | 
|---|
| 48 | docA.fwType = doc->fwType; | 
|---|
| 49 |  | 
|---|
| 50 | ret = StartDocA(hdc, &docA); | 
|---|
| 51 |  | 
|---|
| 52 | if(docA.lpszDocName) | 
|---|
| 53 | HeapFree( GetProcessHeap(), 0, (LPSTR)docA.lpszDocName ); | 
|---|
| 54 | if(docA.lpszOutput) | 
|---|
| 55 | HeapFree( GetProcessHeap(), 0, (LPSTR)docA.lpszOutput ); | 
|---|
| 56 | if(docA.lpszDatatype) | 
|---|
| 57 | HeapFree( GetProcessHeap(), 0, (LPSTR)docA.lpszDatatype ); | 
|---|
| 58 |  | 
|---|
| 59 | return ret; | 
|---|
| 60 | } | 
|---|
| 61 | //****************************************************************************** | 
|---|
| 62 | //****************************************************************************** | 
|---|
| 63 | int WIN32API EndDoc( HDC hdc) | 
|---|
| 64 | { | 
|---|
| 65 | dprintf(("GDI32: EndDoc %x", hdc)); | 
|---|
| 66 | return O32_EndDoc(hdc); | 
|---|
| 67 | } | 
|---|
| 68 | //****************************************************************************** | 
|---|
| 69 | //****************************************************************************** | 
|---|
| 70 | int WIN32API AbortDoc(HDC hdc) | 
|---|
| 71 | { | 
|---|
| 72 | dprintf(("GDI32: AbortDoc %x", hdc)); | 
|---|
| 73 | return O32_AbortDoc(hdc); | 
|---|
| 74 | } | 
|---|
| 75 | //****************************************************************************** | 
|---|
| 76 | //****************************************************************************** | 
|---|
| 77 | int WIN32API StartPage( HDC hdc) | 
|---|
| 78 | { | 
|---|
| 79 | dprintf(("GDI32: StartPage %x", hdc)); | 
|---|
| 80 | return O32_StartPage(hdc); | 
|---|
| 81 | } | 
|---|
| 82 | //****************************************************************************** | 
|---|
| 83 | //****************************************************************************** | 
|---|
| 84 | int WIN32API EndPage( HDC hdc) | 
|---|
| 85 | { | 
|---|
| 86 | dprintf(("GDI32: EndPage %x", hdc)); | 
|---|
| 87 | return O32_EndPage(hdc); | 
|---|
| 88 | } | 
|---|
| 89 | //****************************************************************************** | 
|---|
| 90 | //****************************************************************************** | 
|---|
| 91 | int WIN32API SetAbortProc(HDC hdc, ABORTPROC lpAbortProc) | 
|---|
| 92 | { | 
|---|
| 93 | dprintf(("GDI32: SetAbortProc %x %x - stub (1)", hdc, lpAbortProc)); | 
|---|
| 94 | return(1); | 
|---|
| 95 | } | 
|---|
| 96 | //****************************************************************************** | 
|---|
| 97 | //****************************************************************************** | 
|---|