Implement DocumentProperties, DeviceCapabilities, beginnings of

Open/Get/ClosePrinter.  Additions to PSDRV_DeviceCapabilities.
Split off WINSPOOL into its own directory.
Several functions added to DC_Funcs.
Based largely on a patch by Pascal Lessard <pascal@macadamian.com>
This commit is contained in:
Huw D M Davies 1999-05-17 16:20:51 +00:00 committed by Alexandre Julliard
parent 2b898806ec
commit e39b676ae9
29 changed files with 2170 additions and 1684 deletions

View File

@ -43,6 +43,7 @@ LIBSUBDIRS = \
dlls/ver \
dlls/version \
dlls/winaspi \
dlls/winspool \
dlls/wnaspi32 \
files \
graphics \
@ -118,6 +119,7 @@ LIBOBJS = \
dlls/ver/ver.o \
dlls/version/version.o \
dlls/winaspi/winaspi.o \
dlls/winspool/winspool.o \
dlls/wnaspi32/wnaspi32.o \
files/files.o \
graphics/graphics.o \

2
configure vendored
View File

@ -5214,6 +5214,7 @@ dlls/tapi32/Makefile
dlls/ver/Makefile
dlls/version/Makefile
dlls/winaspi/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
documentation/Makefile
files/Makefile
@ -5381,6 +5382,7 @@ dlls/tapi32/Makefile
dlls/ver/Makefile
dlls/version/Makefile
dlls/winaspi/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
documentation/Makefile
files/Makefile

View File

@ -742,6 +742,7 @@ dlls/tapi32/Makefile
dlls/ver/Makefile
dlls/version/Makefile
dlls/winaspi/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
documentation/Makefile
files/Makefile

1
dlls/winspool/.cvsignore Normal file
View File

@ -0,0 +1 @@
Makefile

16
dlls/winspool/Makefile.in Normal file
View File

@ -0,0 +1,16 @@
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winspool
C_SRCS = \
info.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:

1166
dlls/winspool/info.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,7 @@
#include "heap.h"
#include "debugtools.h"
DECLARE_DEBUG_CHANNEL(driver)
DECLARE_DEBUG_CHANNEL(gdi)
DEFAULT_DEBUG_CHANNEL(driver)
typedef struct tagGRAPHICS_DRIVER
{
@ -40,7 +39,7 @@ BOOL DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs )
/* No name -> it's the generic driver */
if (genericDriver)
{
WARN_(driver)(" already a generic driver\n" );
WARN(" already a generic driver\n" );
HeapFree( SystemHeap, 0, driver );
return FALSE;
}
@ -57,6 +56,7 @@ const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name )
{
GRAPHICS_DRIVER *driver = firstDriver;
TRACE(": %s\n", name);
while (driver && name)
{
if (!strcasecmp( driver->name, name )) return driver->funcs;
@ -97,8 +97,23 @@ BOOL DRIVER_UnregisterDriver( LPCSTR name )
}
}
/*****************************************************************************
* DRIVER_GetDriverName
*
*/
BOOL DRIVER_GetDriverName( LPCSTR device, LPSTR driver, DWORD size )
{
char *p;
size = GetProfileStringA("devices", device, "", driver, size);
if(!size) return FALSE;
p = strchr(driver, ',');
if(!p) return FALSE;
*p = '\0';
TRACE("Found '%s' for '%s'\n", driver, device);
return TRUE;
}
/*****************************************************************************
* GDI_CallDevInstall16 [GDI32.100]
*
@ -107,8 +122,8 @@ BOOL DRIVER_UnregisterDriver( LPCSTR name )
INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
LPSTR lpModelName, LPSTR OldPort, LPSTR NewPort )
{
FIXME_(gdi)("(%p, %04x, %s, %s, %s)\n",
lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
FIXME("(%p, %04x, %s, %s, %s)\n",
lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
return -1;
}
@ -132,8 +147,8 @@ INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
LPCSTR lpszPort, LPVOID lpPropSheet )
{
FIXME_(gdi)("(%04x, %s, %s, %p)\n",
hWnd, lpszDevice, lpszPort, lpPropSheet );
FIXME("(%04x, %s, %s, %p)\n",
hWnd, lpszDevice, lpszPort, lpPropSheet );
return -1;
}
@ -144,14 +159,22 @@ INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
* ExtDeviceMode proc.
*/
INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
LPDEVMODE16 lpdmOutput, LPSTR lpszDevice,
LPSTR lpszPort, LPDEVMODE16 lpdmInput,
LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
LPSTR lpszPort, LPDEVMODEA lpdmInput,
LPSTR lpszProfile, DWORD fwMode )
{
FIXME_(gdi)("(%04x, %p, %s, %s, %p, %s, %ld)\n",
hwnd, lpdmOutput, lpszDevice, lpszPort,
lpdmInput, lpszProfile, fwMode );
return -1;
char buf[300];
const DC_FUNCTIONS *funcs;
TRACE("(%04x, %p, %s, %s, %p, %s, %ld)\n",
hwnd, lpdmOutput, lpszDevice, lpszPort,
lpdmInput, lpszProfile, fwMode );
if(!DRIVER_GetDriverName( lpszDevice, buf, sizeof(buf) )) return -1;
funcs = DRIVER_FindDriver( buf );
if(!funcs || !funcs->pExtDeviceMode) return -1;
return funcs->pExtDeviceMode(hwnd, lpdmOutput, lpszDevice, lpszPort,
lpdmInput, lpszProfile, fwMode);
}
/****************************************************************************
@ -161,10 +184,10 @@ INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
* AdvancedSetupDialog proc.
*/
INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
LPDEVMODE16 devin, LPDEVMODE16 devout )
LPDEVMODEA devin, LPDEVMODEA devout )
{
FIXME_(gdi)("(%04x, %s, %p, %p)\n",
hwnd, lpszDevice, devin, devout );
TRACE("(%04x, %s, %p, %p)\n",
hwnd, lpszDevice, devin, devout );
return -1;
}
@ -174,12 +197,22 @@ INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
* This should load the correct driver for lpszDevice and calls this driver's
* DeviceCapabilities proc.
*/
DWORD WINAPI GDI_CallDeviceCapabilities16( LPSTR lpszDevice, LPSTR lpszPort,
DWORD fwCapability, LPSTR lpszOutput,
LPDEVMODE16 lpdm )
DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput,
LPDEVMODEA lpdm )
{
FIXME_(gdi)("(%s, %s, %ld, %p, %p)\n",
lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
return -1L;
char buf[300];
const DC_FUNCTIONS *funcs;
TRACE("(%s, %s, %d, %p, %p)\n",
lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
if(!DRIVER_GetDriverName( lpszDevice, buf, sizeof(buf) )) return -1;
funcs = DRIVER_FindDriver( buf );
if(!funcs || !funcs->pDeviceCapabilities) return -1;
return funcs->pDeviceCapabilities( lpszDevice, lpszPort, fwCapability,
lpszOutput, lpdm);
}

View File

@ -20,20 +20,25 @@ DEFAULT_DEBUG_CHANNEL(enhmetafile)
static const DC_FUNCTIONS EMFDRV_Funcs =
{
NULL, /* pAbortDoc */
EMFDRV_Arc, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
EMFDRV_Chord, /* pChord */
NULL, /* pCreateBitmap */
NULL, /* no implementation */ /* pCreateDC */
NULL, /* no implementation */ /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* no implementation */ /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pDeviceCapabilities */
EMFDRV_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
NULL, /* pEnumDeviceFonts */
NULL, /* pEscape */
EMFDRV_ExcludeClipRect, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
EMFDRV_ExtFloodFill, /* pExtFloodFill */
NULL, /* pExtTextOut */
EMFDRV_FillRgn, /* pFillRgn */
@ -87,6 +92,8 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
EMFDRV_SetViewportOrg, /* pSetViewportOrg */
EMFDRV_SetWindowExt, /* pSetWindowExt */
EMFDRV_SetWindowOrg, /* pSetWindowOrg */
NULL, /* pStartDoc */
NULL, /* pStartPage */
NULL, /* pStretchBlt */
NULL /* pStretchDIBits */
};

View File

@ -75,7 +75,7 @@ static ATOM PortNameToAtom(LPCSTR lpPortName, BOOL16 add)
/***********************************************************************
* GetEnvironment (GDI.134)
*/
INT16 WINAPI GetEnvironment16(LPCSTR lpPortName, LPDEVMODE16 lpdev, UINT16 nMaxSize)
INT16 WINAPI GetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nMaxSize)
{
ATOM atom;
LPCSTR p;
@ -104,7 +104,7 @@ INT16 WINAPI GetEnvironment16(LPCSTR lpPortName, LPDEVMODE16 lpdev, UINT16 nMaxS
/***********************************************************************
* SetEnvironment (GDI.132)
*/
INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODE16 lpdev, UINT16 nCount)
INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nCount)
{
ATOM atom;
BOOL16 nullport = FALSE;

View File

@ -34,13 +34,16 @@ INT WINAPI Escape( HDC hdc, INT nEscape, INT cbInput,
segin = (SEGPTR)lpszInData;
segout = (SEGPTR)lpvOutData;
switch (nEscape) {
/* Escape(hdc,QUERYESCSUPPORT,LPINT32,NULL) */
case QUERYESCSUPPORT: {
/* Escape(hdc,QUERYESCSUPPORT,LPINT,NULL) */
/* Escape(hdc,EXT_DEVICE_CAPS,LPINT,NULL) */
case QUERYESCSUPPORT:
case EXT_DEVICE_CAPS:
{
LPINT16 x = (LPINT16)SEGPTR_NEW(INT16);
*x = *(INT*)lpszInData;
segin = SEGPTR_GET(x);
break;
}
}
/* Escape(hdc,GETSCALINGFACTOR,NULL,LPPOINT32) */
/* Escape(hdc,GETPHYSPAGESIZE,NULL,LPPOINT32) */
@ -101,6 +104,9 @@ INT WINAPI Escape( HDC hdc, INT nEscape, INT cbInput,
TRACE("target DC implements Escape %d\n",nEscape);
SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
break;
case EXT_DEVICE_CAPS:
SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
break;
case GETSCALINGFACTOR:
case GETPRINTINGOFFSET:
case GETPHYSPAGESIZE: {

View File

@ -19,20 +19,25 @@ DEFAULT_DEBUG_CHANNEL(metafile)
static const DC_FUNCTIONS MFDRV_Funcs =
{
NULL, /* pAbortDoc */
MFDRV_Arc, /* pArc */
MFDRV_BitBlt, /* pBitBlt */
NULL, /* pBitmapBits */
MFDRV_Chord, /* pChord */
NULL, /* pCreateBitmap */
NULL, /* no implementation */ /* pCreateDC */
NULL, /* no implementation */ /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* no implementation */ /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pDeviceCapabilities */
MFDRV_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
NULL, /* pEnumDeviceFonts */
NULL, /* pEscape */
MFDRV_ExcludeClipRect, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
MFDRV_ExtFloodFill, /* pExtFloodFill */
MFDRV_ExtTextOut, /* pExtTextOut */
MFDRV_FillRgn, /* pFillRgn */
@ -86,6 +91,8 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_SetViewportOrg, /* pSetViewportOrg */
MFDRV_SetWindowExt, /* pSetWindowExt */
MFDRV_SetWindowOrg, /* pSetWindowOrg */
NULL, /* pStartDoc */
NULL, /* pStartPage */
MFDRV_StretchBlt, /* pStretchBlt */
MFDRV_StretchDIBits /* pStretchDIBits */
};

View File

@ -11,15 +11,13 @@
#include <string.h>
#include "psdrv.h"
#include "debug.h"
#include "debugtools.h"
#include "resource.h"
#include "winuser.h"
#include "winspool.h"
DEFAULT_DEBUG_CHANNEL(psdrv)
static LONG Resolutions[][2] = { {600,600} };
/************************************************************************
*
@ -28,35 +26,62 @@ static LONG Resolutions[][2] = { {600,600} };
* Updates dm1 with some fields from dm2
*
*/
void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
PRINTERINFO *pi)
{
/* some sanity checks here on dm2 */
if(dm2->dmPublic.dmFields & DM_ORIENTATION)
dm1->dmPublic.dmOrientation = dm2->dmPublic.dmOrientation;
/* NB PaperWidth is always < PaperLength */
dm1->dmPublic.u1.s1.dmOrientation = dm2->dmPublic.u1.s1.dmOrientation;
/* NB PaperWidth is always < PaperLength */
if(dm2->dmPublic.dmFields & DM_PAPERSIZE) {
PAGESIZE *page;
for(page = pi->ppd->PageSizes; page; page = page->next) {
if(page->WinPage == dm2->dmPublic.dmPaperSize)
if(page->WinPage == dm2->dmPublic.u1.s1.dmPaperSize)
break;
}
if(page) {
dm1->dmPublic.dmPaperSize = dm2->dmPublic.dmPaperSize;
dm1->dmPublic.dmPaperWidth = page->PaperDimension->x *
dm1->dmPublic.u1.s1.dmPaperSize = dm2->dmPublic.u1.s1.dmPaperSize;
dm1->dmPublic.u1.s1.dmPaperWidth = page->PaperDimension->x *
254.0 / 72.0;
dm1->dmPublic.dmPaperLength = page->PaperDimension->y *
dm1->dmPublic.u1.s1.dmPaperLength = page->PaperDimension->y *
254.0 / 72.0;
TRACE(psdrv, "Changing page to %s %d x %d\n", page->FullName,
dm1->dmPublic.dmPaperWidth, dm1->dmPublic.dmPaperLength );
TRACE("Changing page to %s %d x %d\n", page->FullName,
dm1->dmPublic.u1.s1.dmPaperWidth,
dm1->dmPublic.u1.s1.dmPaperLength );
} else {
TRACE(psdrv, "Trying to change to unsupported pagesize %d\n",
dm2->dmPublic.dmPaperSize);
TRACE("Trying to change to unsupported pagesize %d\n",
dm2->dmPublic.u1.s1.dmPaperSize);
}
}
if(dm2->dmPublic.dmFields & DM_PAPERLENGTH) {
dm1->dmPublic.u1.s1.dmPaperLength = dm2->dmPublic.u1.s1.dmPaperLength;
TRACE("Changing PaperLength to %d\n",
dm2->dmPublic.u1.s1.dmPaperLength);
FIXME("Changing PaperLength. Do we adjust PaperSize?\n");
}
if(dm2->dmPublic.dmFields & DM_PAPERWIDTH) {
dm1->dmPublic.u1.s1.dmPaperWidth = dm2->dmPublic.u1.s1.dmPaperWidth;
TRACE("Changing PaperWidth to %d\n",
dm2->dmPublic.u1.s1.dmPaperWidth);
FIXME("Changing PaperWidth. Do we adjust PaperSize?\n");
}
if(dm2->dmPublic.dmFields & DM_SCALE) {
dm1->dmPublic.dmScale = dm2->dmPublic.dmScale;
TRACE("Changing Scale to %d\n", dm2->dmPublic.dmScale);
}
if(dm2->dmPublic.dmFields & DM_COPIES) {
dm1->dmPublic.dmCopies = dm2->dmPublic.dmCopies;
TRACE("Changing Copies to %d\n", dm2->dmPublic.dmCopies);
}
if(dm2->dmPublic.dmFields & DM_DEFAULTSOURCE) {
INPUTSLOT *slot;
@ -66,14 +91,55 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
}
if(slot) {
dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
TRACE(psdrv, "Changing bin to '%s'\n", slot->FullName);
TRACE("Changing bin to '%s'\n", slot->FullName);
} else {
TRACE(psdrv, "Trying to change to unsupported bin %d\n",
TRACE("Trying to change to unsupported bin %d\n",
dm2->dmPublic.dmDefaultSource);
}
}
/* etc */
if (dm2->dmPublic.dmFields & DM_DEFAULTSOURCE )
dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
if (dm2->dmPublic.dmFields & DM_PRINTQUALITY )
dm1->dmPublic.dmPrintQuality = dm2->dmPublic.dmPrintQuality;
if (dm2->dmPublic.dmFields & DM_COLOR )
dm1->dmPublic.dmColor = dm2->dmPublic.dmColor;
if (dm2->dmPublic.dmFields & DM_DUPLEX )
dm1->dmPublic.dmDuplex = dm2->dmPublic.dmDuplex;
if (dm2->dmPublic.dmFields & DM_YRESOLUTION )
dm1->dmPublic.dmYResolution = dm2->dmPublic.dmYResolution;
if (dm2->dmPublic.dmFields & DM_TTOPTION )
dm1->dmPublic.dmTTOption = dm2->dmPublic.dmTTOption;
if (dm2->dmPublic.dmFields & DM_COLLATE )
dm1->dmPublic.dmCollate = dm2->dmPublic.dmCollate;
if (dm2->dmPublic.dmFields & DM_FORMNAME )
strncpy(dm1->dmPublic.dmFormName, dm2->dmPublic.dmFormName, CCHFORMNAME);
if (dm2->dmPublic.dmFields & DM_BITSPERPEL )
dm1->dmPublic.dmBitsPerPel = dm2->dmPublic.dmBitsPerPel;
if (dm2->dmPublic.dmFields & DM_PELSWIDTH )
dm1->dmPublic.dmPelsWidth = dm2->dmPublic.dmPelsWidth;
if (dm2->dmPublic.dmFields & DM_PELSHEIGHT )
dm1->dmPublic.dmPelsHeight = dm2->dmPublic.dmPelsHeight;
if (dm2->dmPublic.dmFields & DM_DISPLAYFLAGS )
dm1->dmPublic.dmDisplayFlags = dm2->dmPublic.dmDisplayFlags;
if (dm2->dmPublic.dmFields & DM_DISPLAYFREQUENCY )
dm1->dmPublic.dmDisplayFrequency = dm2->dmPublic.dmDisplayFrequency;
if (dm2->dmPublic.dmFields & DM_POSITION )
dm1->dmPublic.u1.dmPosition = dm2->dmPublic.u1.dmPosition;
if (dm2->dmPublic.dmFields & DM_LOGPIXELS )
dm1->dmPublic.dmLogPixels = dm2->dmPublic.dmLogPixels;
if (dm2->dmPublic.dmFields & DM_ICMMETHOD )
dm1->dmPublic.dmICMMethod = dm2->dmPublic.dmICMMethod;
if (dm2->dmPublic.dmFields & DM_ICMINTENT )
dm1->dmPublic.dmICMIntent = dm2->dmPublic.dmICMIntent;
if (dm2->dmPublic.dmFields & DM_MEDIATYPE )
dm1->dmPublic.dmMediaType = dm2->dmPublic.dmMediaType;
if (dm2->dmPublic.dmFields & DM_DITHERTYPE )
dm1->dmPublic.dmDitherType = dm2->dmPublic.dmDitherType;
if (dm2->dmPublic.dmFields & DM_PANNINGWIDTH )
dm1->dmPublic.dmPanningWidth = dm2->dmPublic.dmPanningWidth;
if (dm2->dmPublic.dmFields & DM_PANNINGHEIGHT )
dm1->dmPublic.dmPanningHeight = dm2->dmPublic.dmPanningHeight;
return;
}
@ -91,7 +157,7 @@ LRESULT WINAPI PSDRV_NewPrinterDlgProc(HWND hWnd, UINT wMsg,
{
switch (wMsg) {
case WM_INITDIALOG:
TRACE(psdrv,"WM_INITDIALOG lParam=%08lX\n", lParam);
TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return TRUE;
@ -119,7 +185,7 @@ LRESULT WINAPI PSDRV_AdvancedSetupDlgProc(HWND hWnd, UINT wMsg,
{
switch (wMsg) {
case WM_INITDIALOG:
TRACE(psdrv,"WM_INITDIALOG lParam=%08lX\n", lParam);
TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
SendDlgItemMessageA(hWnd, 99, CB_ADDSTRING, 0,
(LPARAM)"Default Tray");
ShowWindow(hWnd, SW_SHOWNORMAL);
@ -157,10 +223,10 @@ LRESULT WINAPI PSDRV_AdvancedSetupDlgProc(HWND hWnd, UINT wMsg,
*
*/
WORD WINAPI PSDRV_AdvancedSetupDialog16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODE16 devin, LPDEVMODE16 devout)
LPDEVMODEA devin, LPDEVMODEA devout)
{
TRACE(psdrv, "hwnd = %04x, hDriver = %04x devin=%p devout=%p\n", hwnd,
TRACE("hwnd = %04x, hDriver = %04x devin=%p devout=%p\n", hwnd,
hDriver, devin, devout);
return IDCANCEL;
@ -181,46 +247,63 @@ WORD WINAPI PSDRV_AdvancedSetupDialog16(HWND16 hwnd, HANDLE16 hDriver,
* Just returns default devmode at the moment
*/
INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODE16 lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODE16 lpdmInput, LPSTR lpszProfile, WORD fwMode)
LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
LPSTR lpszPort, LPDEVMODEA lpdmInput,
LPSTR lpszProfile, WORD fwMode)
{
PRINTERINFO *pi = PSDRV_FindPrinterInfo(lpszDevice);
TRACE(psdrv,
"(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
TRACE("(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
hwnd, hDriver, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile,
fwMode);
if(!fwMode)
return sizeof(DEVMODE16); /* Just copy dmPublic bit of PSDRV_DEVMODE */
return sizeof(DEVMODEA); /* Just copy dmPublic bit of PSDRV_DEVMODE */
if((fwMode & DM_PROMPT) || (fwMode & DM_UPDATE))
FIXME(psdrv, "Mode %d not implemented\n", fwMode);
if(fwMode & DM_PROMPT)
FIXME("Mode DM_PROMPT not implemented\n");
if(fwMode & DM_UPDATE)
FIXME("Mode DM_UPDATE. Just do the same as DM_COPY\n");
if((fwMode & DM_MODIFY) && lpdmInput) {
TRACE(psdrv, "DM_MODIFY set. devIn->dmFields = %08lx\n", lpdmInput->dmFields);
PSDRV_MergeDevmodes(pi->Devmode, (PSDRV_DEVMODE16 *)lpdmInput, pi);
TRACE("DM_MODIFY set. devIn->dmFields = %08lx\n", lpdmInput->dmFields);
PSDRV_MergeDevmodes(pi->Devmode, (PSDRV_DEVMODEA *)lpdmInput, pi);
}
if(fwMode & DM_COPY) {
memcpy(lpdmOutput, pi->Devmode, sizeof(DEVMODE16));
if((fwMode & DM_COPY) || (fwMode & DM_UPDATE)) {
memcpy(lpdmOutput, pi->Devmode, sizeof(DEVMODEA));
}
return IDOK;
}
/**************************************************************
*
* PSDRV_ExtDeviceMode
*/
INT PSDRV_ExtDeviceMode(HWND hwnd, LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
LPSTR lpszPort, LPDEVMODEA lpdmInput,
LPSTR lpszProfile, DWORD dwMode)
{
return PSDRV_ExtDeviceMode16(hwnd, 0, lpdmOutput, lpszDevice, lpszPort,
lpdmInput, lpszProfile, dwMode);
}
/***************************************************************
*
* PSDRV_DeviceCapabilities16 [WINEPS.91]
*
*/
DWORD WINAPI PSDRV_DeviceCapabilities16(LPSTR lpszDevice, LPSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput, LPDEVMODE16 lpdm)
DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput,
LPDEVMODEA lpDevMode)
{
PRINTERINFO *pi;
DEVMODEA *lpdm;
pi = PSDRV_FindPrinterInfo(lpszDevice);
TRACE(psdrv, "Cap=%d. Got PrinterInfo = %p\n", fwCapability, pi);
TRACE("Cap=%d. Got PrinterInfo = %p\n", fwCapability, pi);
lpdm = lpDevMode ? lpDevMode : (DEVMODEA *)pi->Devmode;
switch(fwCapability) {
@ -296,18 +379,120 @@ DWORD WINAPI PSDRV_DeviceCapabilities16(LPSTR lpszDevice, LPSTR lpszPort,
return i;
}
case DC_ENUMRESOLUTIONS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Resolutions, sizeof(Resolutions));
return sizeof(Resolutions) / sizeof(Resolutions[0]);
case DC_BINADJUST:
FIXME("DC_BINADJUST: stub.\n");
return DCBA_FACEUPNONE;
case DC_ENUMRESOLUTIONS:
{
LONG *lp = (LONG*)lpszOutput;
if(lpszOutput != NULL) {
lp[0] = (LONG)pi->ppd->DefaultResolution;
lp[1] = (LONG)pi->ppd->DefaultResolution;
}
return 1;
}
case DC_COPIES:
FIXME("DC_COPIES: returning %d. Is this correct?\n", lpdm->dmCopies);
return lpdm->dmCopies;
case DC_DRIVER:
return lpdm->dmDriverVersion;
case DC_DATATYPE_PRODUCED:
FIXME("DATA_TYPE_PRODUCED: stub.\n");
return -1; /* simulate that the driver supports 'RAW' */
case DC_DUPLEX:
FIXME("DC_DUPLEX: returning %d. Is this correct?\n", lpdm->dmDuplex);
return lpdm->dmDuplex;
case DC_EMF_COMPLIANT:
FIXME("DC_EMF_COMPLIANT: stub.\n");
return -1; /* simulate that the driver do not support EMF */
case DC_EXTRA:
return lpdm->dmDriverExtra;
case DC_FIELDS:
return lpdm->dmFields;
case DC_FILEDEPENDENCIES:
FIXME("DC_FILEDEPENDENCIES: stub.\n");
return 0;
case DC_MAXEXTENT:
{
PAGESIZE *ps;
int i;
POINT ptMax;
ptMax.x = ptMax.y = 0;
if(lpszOutput == NULL)
return -1;
i = 0;
for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) {
if(ps->PaperDimension->x > ptMax.x)
ptMax.x = ps->PaperDimension->x;
if(ps->PaperDimension->y > ptMax.y)
ptMax.y = ps->PaperDimension->y;
}
*((POINT*)lpszOutput) = ptMax;
return 1;
}
case DC_MINEXTENT:
{
PAGESIZE *ps;
int i;
POINT ptMax;
ptMax.x = ptMax.y = 0;
if(lpszOutput == NULL)
return -1;
i = 0;
for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) {
if(ps->PaperDimension->x > ptMax.x)
ptMax.x = ps->PaperDimension->x;
if(ps->PaperDimension->y > ptMax.y)
ptMax.y = ps->PaperDimension->y;
}
*((POINT*)lpszOutput) = ptMax;
return 1;
}
case DC_SIZE:
return lpdm->dmSize;
case DC_TRUETYPE:
FIXME("DC_TRUETYPE: stub\n");
return DCTT_SUBDEV;
case DC_VERSION:
return lpdm->dmSpecVersion;
default:
FIXME(psdrv, "Unsupported capability %d\n", fwCapability);
FIXME("Unsupported capability %d\n", fwCapability);
}
return -1;
}
/**************************************************************
*
* PSDRV_DeviceCapabilities
*/
DWORD PSDRV_DeviceCapabilities(LPCSTR lpszDevice, LPCSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput,
LPDEVMODEA lpdm)
{
return PSDRV_DeviceCapabilities16(lpszDevice, lpszPort, fwCapability,
lpszOutput, lpdm);
}
/***************************************************************
*
* PSDRV_DeviceMode16 [WINEPS.13]

View File

@ -17,25 +17,30 @@
DEFAULT_DEBUG_CHANNEL(psdrv)
static BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
LPCSTR output, const DEVMODEA* initData );
static BOOL PSDRV_DeleteDC( DC *dc );
static const DC_FUNCTIONS PSDRV_Funcs =
{
NULL, /* pAbortDoc */
PSDRV_Arc, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
PSDRV_Chord, /* pChord */
NULL, /* pCreateBitmap */
PSDRV_CreateDC, /* pCreateDC */
PSDRV_DeleteDC, /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
PSDRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
PSDRV_DeviceCapabilities, /* pDeviceCapabilities */
PSDRV_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
PSDRV_EnumDeviceFonts, /* pEnumDeviceFonts */
PSDRV_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
PSDRV_ExtDeviceMode, /* pExtDeviceMode */
NULL, /* pExtFloodFill */
PSDRV_ExtTextOut, /* pExtTextOut */
NULL, /* pFillRgn */
@ -89,6 +94,8 @@ static const DC_FUNCTIONS PSDRV_Funcs =
NULL, /* pSetViewportOrg (optional) */
NULL, /* pSetWindowExt (optional) */
NULL, /* pSetWindowOrg (optional) */
NULL, /* pStartDoc */
NULL, /* pStartPage */
NULL, /* pStretchBlt */
PSDRV_StretchDIBits /* pStretchDIBits */
};
@ -121,10 +128,9 @@ static DeviceCaps PSDRV_DevCaps = {
PC_INTERIORS,
/* textCaps */ TC_CR_ANY, /* psdrv 0x59f7 */
/* clipCaps */ CP_RECTANGLE,
/* rasterCaps */ RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 |
RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT |
RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS,
/* psdrv 0x6e99 */
/* rasterCaps */ RC_BITBLT | RC_BITMAP64 | RC_GDI20_OUTPUT |
RC_DIBTODEV | RC_STRETCHBLT |
RC_STRETCHDIB, /* psdrv 0x6e99 */
/* aspectX */ 600,
/* aspectY */ 600,
/* aspectXY */ 848,
@ -135,22 +141,26 @@ static DeviceCaps PSDRV_DevCaps = {
/* palette size */ 0,
/* ..etc */ 0, 0 };
static PSDRV_DEVMODE16 DefaultDevmode =
static PSDRV_DEVMODEA DefaultDevmode =
{
{ /* dmPublic */
/* dmDeviceName */ "Wine PostScript Driver",
/* dmSpecVersion */ 0x30a,
/* dmDriverVersion */ 0x001,
/* dmSize */ sizeof(DEVMODE16),
/* dmSize */ sizeof(DEVMODEA),
/* dmDriverExtra */ 0,
/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_PAPERLENGTH |
DM_PAPERWIDTH | DM_SCALE | DM_COPIES |
DM_DEFAULTSOURCE | DM_COLOR | DM_DUPLEX |
DM_YRESOLUTION | DM_TTOPTION,
{ /* u1 */
{ /* s1 */
/* dmOrientation */ DMORIENT_PORTRAIT,
/* dmPaperSize */ DMPAPER_A4,
/* dmPaperLength */ 2969,
/* dmPaperWidth */ 2101,
/* dmPaperWidth */ 2101
}
},
/* dmScale */ 100, /* ?? */
/* dmCopies */ 1,
/* dmDefaultSource */ DMBIN_AUTO,
@ -203,7 +213,7 @@ BOOL PSDRV_Init(void)
* PSDRV_CreateDC
*/
static BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData )
LPCSTR output, const DEVMODEA* initData )
{
PSDRV_PDEVICE *physDev;
PRINTERINFO *pi = PSDRV_FindPrinterInfo(device);
@ -225,29 +235,29 @@ static BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
physDev->pi = pi;
physDev->Devmode = (PSDRV_DEVMODE16 *)HeapAlloc( PSDRV_Heap, 0,
sizeof(PSDRV_DEVMODE16) );
physDev->Devmode = (PSDRV_DEVMODEA *)HeapAlloc( PSDRV_Heap, 0,
sizeof(PSDRV_DEVMODEA) );
if(!physDev->Devmode) {
HeapFree( PSDRV_Heap, 0, physDev );
return FALSE;
}
memcpy( physDev->Devmode, pi->Devmode, sizeof(PSDRV_DEVMODE16) );
memcpy( physDev->Devmode, pi->Devmode, sizeof(PSDRV_DEVMODEA) );
if(initData) {
PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODE16 *)initData, pi);
PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODEA *)initData, pi);
}
devCaps = HeapAlloc( PSDRV_Heap, 0, sizeof(PSDRV_DevCaps) );
memcpy(devCaps, &PSDRV_DevCaps, sizeof(PSDRV_DevCaps));
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_PORTRAIT) {
devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperWidth / 10;
devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperLength / 10;
if(physDev->Devmode->dmPublic.u1.s1.dmOrientation == DMORIENT_PORTRAIT) {
devCaps->horzSize = physDev->Devmode->dmPublic.u1.s1.dmPaperWidth / 10;
devCaps->vertSize = physDev->Devmode->dmPublic.u1.s1.dmPaperLength / 10;
} else {
devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperLength / 10;
devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperWidth / 10;
devCaps->horzSize = physDev->Devmode->dmPublic.u1.s1.dmPaperLength / 10;
devCaps->vertSize = physDev->Devmode->dmPublic.u1.s1.dmPaperWidth / 10;
}
devCaps->horzRes = physDev->pi->ppd->DefaultResolution *
@ -278,7 +288,8 @@ static BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
dc->w.devCaps->vertRes);
dc->w.hFont = PSDRV_DefaultFont;
physDev->job.output = HEAP_strdupA( PSDRV_Heap, 0, output );
physDev->job.output = output ? HEAP_strdupA( PSDRV_Heap, 0, output ) :
NULL;
physDev->job.hJob = 0;
return TRUE;
}

View File

@ -433,7 +433,8 @@ PPD *PSDRV_ParsePPD(char *fname)
TRACE(psdrv, "ColorDevice = %d\n", (int)ppd->ColorDevice);
}
else if(!strcmp("*DefaultResolution", tuple.key)) {
else if((!strcmp("*DefaultResolution", tuple.key)) ||
(!strcmp("*DefaultJCLResolution", tuple.key))) {
sscanf(tuple.value, "%d", &(ppd->DefaultResolution));
TRACE(psdrv, "DefaultResolution = %d\n", ppd->DefaultResolution);
}
@ -628,6 +629,8 @@ PPD *PSDRV_ParsePPD(char *fname)
PAGESIZE *page;
CONSTRAINT *con;
INPUTSLOT *slot;
OPTION *option;
OPTIONENTRY *optionEntry;
for(fn = ppd->InstalledFonts; fn; fn = fn->next)
TRACE(psdrv, "'%s'\n", fn->Name);
@ -645,11 +648,20 @@ PPD *PSDRV_ParsePPD(char *fname)
}
for(con = ppd->Constraints; con; con = con->next)
TRACE(psdrv, "%s %s %s %s\n", con->Feature1, con->Value1,
con->Feature2, con->Value2);
TRACE(psdrv, "CONSTRAINTS@ %s %s %s %s\n", con->Feature1,
con->Value1, con->Feature2, con->Value2);
for(option = ppd->InstalledOptions; option; option = option->next) {
TRACE(psdrv, "OPTION: %s %s %s\n", option->OptionName,
option->FullName, option->DefaultOption);
for(optionEntry = option->Options; optionEntry;
optionEntry = optionEntry->next)
TRACE(psdrv, "\tOPTIONENTRY: %s %s %s\n", optionEntry->Name,
optionEntry->FullName, optionEntry->InvocationString);
}
for(slot = ppd->InputSlots; slot; slot = slot->next)
TRACE(psdrv, "Slot '%s' Name '%s' (%d) Invocation '%s'\n",
TRACE(psdrv, "INPUTSLOTS '%s' Name '%s' (%d) Invocation '%s'\n",
slot->Name, slot->FullName, slot->WinBin,
slot->InvocationString);
}

View File

@ -286,7 +286,7 @@ INT PSDRV_WriteHeader( DC *dc, char *title, int len )
return 0;
}
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_LANDSCAPE) {
if(physDev->Devmode->dmPublic.u1.s1.dmOrientation == DMORIENT_LANDSCAPE) {
/* BBox co-ords are in default user co-ord system so urx < ury even in
landscape mode */
urx = (int) (dc->w.devCaps->vertSize * 72.0 / 25.4);
@ -348,7 +348,7 @@ INT PSDRV_WriteHeader( DC *dc, char *title, int len )
}
for(page = physDev->pi->ppd->PageSizes; page; page = page->next) {
if(page->WinPage == physDev->Devmode->dmPublic.dmPaperSize) {
if(page->WinPage == physDev->Devmode->dmPublic.u1.s1.dmPaperSize) {
if(page->InvocationString) {
PSDRV_WriteFeature(physDev->job.hJob, "*PageSize", page->Name,
page->InvocationString);
@ -419,7 +419,7 @@ INT PSDRV_WriteNewPage( DC *dc )
return 0;
}
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_LANDSCAPE) {
if(physDev->Devmode->dmPublic.u1.s1.dmOrientation == DMORIENT_LANDSCAPE) {
if(physDev->pi->ppd->LandscapeOrientation == -90) {
xtrans = dc->w.devCaps->vertRes;
ytrans = dc->w.devCaps->horzRes;

View File

@ -17,21 +17,26 @@ DEFAULT_DEBUG_CHANNEL(ttydrv)
static const DC_FUNCTIONS TTYDRV_DC_Driver =
{
NULL, /* pAbortDoc */
NULL, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
NULL, /* pChord */
NULL, /* pCreateBitmap */
TTYDRV_DC_CreateDC, /* pCreateDC */
TTYDRV_DC_DeleteDC, /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
TTYDRV_DC_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pDeviceCapabilities */
NULL, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
NULL, /* pEnumDeviceFonts */
TTYDRV_DC_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */
NULL, /* pExtDeviceMode */
NULL, /* pExtFloodFill */
NULL, /* pExtTextOut */
NULL, /* pGetCharWidth */
@ -83,6 +88,8 @@ static const DC_FUNCTIONS TTYDRV_DC_Driver =
NULL, /* pSetViewportOrg (optional) */
NULL, /* pSetWindowExt (optional) */
NULL, /* pSetWindowOrg (optional) */
NULL, /* pStartDoc */
NULL, /* pStartPage */
NULL, /* pStretchBlt */
NULL /* pStretchDIBits */
};
@ -172,7 +179,7 @@ void TTYDRV_GDI_Finalize(void)
* TTYDRV_DC_CreateDC
*/
BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16 *initData)
LPCSTR output, const DEVMODEA *initData)
{
FIXME(ttydrv, "(%p, %s, %s, %s, %p): semistub\n",
dc, debugstr_a(driver), debugstr_a(device),

View File

@ -38,26 +38,31 @@ LPDRAWMODE win16drv_DrawModeP;
static BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
LPCSTR output, const DEVMODEA* initData );
static INT WIN16DRV_Escape( DC *dc, INT nEscape, INT cbInput,
SEGPTR lpInData, SEGPTR lpOutData );
static const DC_FUNCTIONS WIN16DRV_Funcs =
{
NULL, /* pAbortDoc */
NULL, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
NULL, /* pChord */
NULL, /* pCreateBitmap */
WIN16DRV_CreateDC, /* pCreateDC */
NULL, /* pDeleteDC */
NULL, /* pCreateDIBSection */
NULL, /* pCreateDIBSection16 */
NULL, /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pDeviceCapabilities */
WIN16DRV_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
WIN16DRV_EnumDeviceFonts, /* pEnumDeviceFonts */
WIN16DRV_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
NULL, /* pExtFloodFill */
WIN16DRV_ExtTextOut, /* pExtTextOut */
NULL, /* pFillRgn */
@ -111,6 +116,8 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
NULL, /* pSetViewportOrgEx */
NULL, /* pSetWindowExtEx */
NULL, /* pSetWindowOrgEx */
NULL, /* pStartDoc */
NULL, /* pStartPage */
NULL, /* pStretchBlt */
NULL /* pStretchDIBits */
};
@ -164,7 +171,7 @@ void InitDrawMode(LPDRAWMODE lpDrawMode)
}
BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
const DEVMODE16* initData )
const DEVMODEA* initData )
{
LOADED_PRINTER_DRIVER *pLPD;
WORD wRet;

View File

@ -24,7 +24,7 @@
DEFAULT_DEBUG_CHANNEL(x11drv)
static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
LPCSTR output, const DEVMODEA* initData );
static BOOL X11DRV_DeleteDC( DC *dc );
static INT X11DRV_Escape( DC *dc, INT nEscape, INT cbInput,
@ -32,20 +32,25 @@ static INT X11DRV_Escape( DC *dc, INT nEscape, INT cbInput,
static const DC_FUNCTIONS X11DRV_Funcs =
{
NULL, /* pAbortDoc */
X11DRV_Arc, /* pArc */
X11DRV_BitBlt, /* pBitBlt */
X11DRV_BitmapBits, /* pBitmapBits */
X11DRV_Chord, /* pChord */
X11DRV_CreateBitmap, /* pCreateBitmap */
X11DRV_CreateDC, /* pCreateDC */
X11DRV_DeleteDC, /* pDeleteDC */
X11DRV_DIB_CreateDIBSection, /* pCreateDIBSection */
X11DRV_DIB_CreateDIBSection16, /* pCreateDIBSection16 */
X11DRV_DeleteDC, /* pDeleteDC */
X11DRV_DeleteObject, /* pDeleteObject */
NULL, /* pDeviceCapabilities */
X11DRV_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
X11DRV_EnumDeviceFonts, /* pEnumDeviceFonts */
X11DRV_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
X11DRV_ExtFloodFill, /* pExtFloodFill */
X11DRV_ExtTextOut, /* pExtTextOut */
NULL, /* pFillRgn */
@ -99,6 +104,8 @@ static const DC_FUNCTIONS X11DRV_Funcs =
NULL, /* pSetViewportOrg (optional) */
NULL, /* pSetWindowExt (optional) */
NULL, /* pSetWindowOrg (optional) */
NULL, /* pStartDoc */
NULL, /* pStartPage */
X11DRV_StretchBlt, /* pStretchBlt */
NULL /* pStretchDIBits */
};
@ -208,7 +215,7 @@ void X11DRV_GDI_Finalize(void)
* X11DRV_CreateDC
*/
static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData )
LPCSTR output, const DEVMODEA* initData )
{
X11DRV_PDEVICE *physDev;

View File

@ -162,11 +162,12 @@ int dbch_win16drv = 150;
int dbch_win32 = 151;
int dbch_wing = 152;
int dbch_winsock = 153;
int dbch_wnet = 154;
int dbch_x11 = 155;
int dbch_x11drv = 156;
int dbch_winspool = 154;
int dbch_wnet = 155;
int dbch_x11 = 156;
int dbch_x11drv = 157;
#define DEBUG_CHANNEL_COUNT 157
#define DEBUG_CHANNEL_COUNT 158
char __debug_msg_enabled[DEBUG_CHANNEL_COUNT][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
@ -325,6 +326,7 @@ char __debug_msg_enabled[DEBUG_CHANNEL_COUNT][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0}
};
@ -483,6 +485,7 @@ const char * const debug_ch_name[DEBUG_CHANNEL_COUNT] = {
"win32",
"wing",
"winsock",
"winspool",
"wnet",
"x11",
"x11drv"

View File

@ -165,22 +165,28 @@ typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARA
typedef struct tagDC_FUNCS
{
INT (*pAbortDoc)(DC*);
BOOL (*pArc)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
BOOL (*pBitBlt)(DC*,INT,INT,INT,INT,DC*,INT,INT,DWORD);
LONG (*pBitmapBits)(HBITMAP,void*,LONG,WORD);
BOOL (*pChord)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
BOOL (*pCreateBitmap)(HBITMAP);
BOOL (*pCreateDC)(DC*,LPCSTR,LPCSTR,LPCSTR,const DEVMODE16*);
BOOL (*pDeleteDC)(DC*);
BOOL (*pCreateDC)(DC*,LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
HBITMAP (*pCreateDIBSection)(DC *,BITMAPINFO *,UINT,LPVOID *,HANDLE,
DWORD);
HBITMAP16 (*pCreateDIBSection16)(DC *,BITMAPINFO *,UINT16,SEGPTR *,HANDLE,
DWORD);
BOOL (*pDeleteDC)(DC*);
BOOL (*pDeleteObject)(HGDIOBJ);
DWORD (*pDeviceCapabilities)(LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
BOOL (*pEllipse)(DC*,INT,INT,INT,INT);
INT (*pEndDoc)(DC*);
INT (*pEndPage)(DC*);
BOOL (*pEnumDeviceFonts)(DC*,LPLOGFONT16,DEVICEFONTENUMPROC,LPARAM);
INT (*pEscape)(DC*,INT,INT,SEGPTR,SEGPTR);
INT (*pExcludeClipRect)(DC*,INT,INT,INT,INT);
INT (*pExtDeviceMode)(HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,
DWORD);
BOOL (*pExtFloodFill)(DC*,INT,INT,COLORREF,UINT);
BOOL (*pExtTextOut)(DC*,INT,INT,UINT,const RECT*,LPCSTR,UINT,
const INT*);
@ -236,6 +242,8 @@ typedef struct tagDC_FUNCS
BOOL (*pSetViewportOrg)(DC*,INT,INT);
BOOL (*pSetWindowExt)(DC*,INT,INT);
BOOL (*pSetWindowOrg)(DC*,INT,INT);
INT (*pStartDoc)(DC*,const DOCINFOA*);
INT (*pStartPage)(DC*);
BOOL (*pStretchBlt)(DC*,INT,INT,INT,INT,DC*,INT,INT,INT,INT,DWORD);
INT (*pStretchDIBits)(DC*,INT,INT,INT,INT,INT,INT,INT,INT,
const void *,const BITMAPINFO *,UINT,DWORD);
@ -439,5 +447,5 @@ extern GDIOBJHDR * GDI_GetObjPtr( HGDIOBJ16, WORD );
extern BOOL DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs );
extern const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name );
extern BOOL DRIVER_UnregisterDriver( LPCSTR name );
extern BOOL DRIVER_GetDriverName( LPCSTR device, LPSTR driver, DWORD size );
#endif /* __WINE_GDI_H */

View File

@ -10,6 +10,7 @@
#include "font.h"
#include "pen.h"
#include "brush.h"
#include "wine/wingdi16.h"
typedef struct {
float llx, lly, urx, ury;
@ -142,7 +143,7 @@ typedef struct {
} PPD;
typedef struct {
DEVMODE16 dmPublic;
DEVMODEA dmPublic;
struct _tagdocprivate {
int dummy;
} dmDocPrivate;
@ -157,12 +158,12 @@ numInstalledOptions of OPTIONs
*/
} PSDRV_DEVMODE16;
} PSDRV_DEVMODEA;
typedef struct _tagPI {
char *FriendlyName;
PPD *ppd;
PSDRV_DEVMODE16 *Devmode;
PSDRV_DEVMODEA *Devmode;
FONTFAMILY *Fonts;
struct _tagPI *next;
} PRINTERINFO;
@ -225,14 +226,19 @@ typedef struct {
PSCOLOR bkColor;
PSCOLOR inkColor; /* Last colour set */
JOB job;
PSDRV_DEVMODE16 *Devmode;
PSDRV_DEVMODEA *Devmode;
PRINTERINFO *pi;
} PSDRV_PDEVICE;
extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
extern HANDLE PSDRV_Heap;
extern char *PSDRV_ANSIVector[256];
extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
PRINTERINFO *pi);
extern BOOL PSDRV_GetFontMetrics(void);
extern PPD *PSDRV_ParsePPD(char *fname);
@ -340,6 +346,13 @@ extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
INT ySrc, INT widthSrc, INT heightSrc,
const void *bits, const BITMAPINFO *info,
UINT wUsage, DWORD dwRop );
extern INT PSDRV_ExtDeviceMode(HWND hwnd, LPDEVMODEA lpdmOutput,
LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODEA lpdmInput, LPSTR lpszProfile,
DWORD dwMode);
extern DWORD PSDRV_DeviceCapabilities(LPCSTR lpszDevice, LPCSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput,
LPDEVMODEA lpdm);
#endif

View File

@ -41,7 +41,7 @@ typedef struct {
int dummy;
} TTYDRV_PDEVICE;
extern BOOL TTYDRV_DC_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODE16 *initData);
extern BOOL TTYDRV_DC_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODEA *initData);
extern BOOL TTYDRV_DC_DeleteDC(struct tagDC *dc);
extern INT TTYDRV_DC_Escape(struct tagDC *dc, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);

View File

@ -254,37 +254,6 @@ typedef struct
typedef INT16 (CALLBACK *MFENUMPROC16)(HDC16,HANDLETABLE16*,METARECORD*,
INT16,LPARAM);
typedef struct
{
BYTE dmDeviceName[CCHDEVICENAME];
WORD dmSpecVersion;
WORD dmDriverVersion;
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
INT16 dmOrientation;
INT16 dmPaperSize;
INT16 dmPaperLength;
INT16 dmPaperWidth;
INT16 dmScale;
INT16 dmCopies;
INT16 dmDefaultSource;
INT16 dmPrintQuality;
INT16 dmColor;
INT16 dmDuplex;
INT16 dmYResolution;
INT16 dmTTOption;
INT16 dmCollate;
BYTE dmFormName[CCHFORMNAME];
WORD dmUnusedPadding;
WORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
DWORD dmDisplayFlags;
DWORD dmDisplayFrequency;
} DEVMODE16, *LPDEVMODE16;
typedef struct
{
INT16 cbSize;
@ -294,6 +263,9 @@ typedef struct
typedef BOOL16 (CALLBACK* ABORTPROC16)(HDC16, INT16);
#define INT_PD_DEFAULT_DEVMODE 1
#define INT_PD_DEFAULT_MODEL 2
#include "poppack.h"
@ -314,7 +286,7 @@ HBITMAP16 WINAPI CreateBitmapIndirect16(const BITMAP16*);
HBRUSH16 WINAPI CreateBrushIndirect16(const LOGBRUSH16*);
HBITMAP16 WINAPI CreateCompatibleBitmap16(HDC16,INT16,INT16);
HDC16 WINAPI CreateCompatibleDC16(HDC16);
HDC16 WINAPI CreateDC16(LPCSTR,LPCSTR,LPCSTR,const DEVMODE16*);
HDC16 WINAPI CreateDC16(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
HBITMAP16 WINAPI CreateDIBitmap16(HDC16,const BITMAPINFOHEADER*,DWORD,
LPCVOID,const BITMAPINFO*,UINT16);
HBRUSH16 WINAPI CreateDIBPatternBrush16(HGLOBAL16,UINT16);
@ -327,7 +299,7 @@ HFONT16 WINAPI CreateFont16(INT16,INT16,INT16,INT16,INT16,BYTE,BYTE,BYTE,
BYTE,BYTE,BYTE,BYTE,BYTE,LPCSTR);
HFONT16 WINAPI CreateFontIndirect16(const LOGFONT16*);
HBRUSH16 WINAPI CreateHatchBrush16(INT16,COLORREF);
HDC16 WINAPI CreateIC16(LPCSTR,LPCSTR,LPCSTR,const DEVMODE16*);
HDC16 WINAPI CreateIC16(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
HDC16 WINAPI CreateMetaFile16(LPCSTR);
HPALETTE16 WINAPI CreatePalette16(const LOGPALETTE*);
HBRUSH16 WINAPI CreatePatternBrush16(HBITMAP16);
@ -392,7 +364,7 @@ HDC16 WINAPI GetDCState16(HDC16);
INT16 WINAPI GetDeviceCaps16(HDC16,INT16);
UINT16 WINAPI GetDIBColorTable16(HDC16,UINT16,UINT16,RGBQUAD*);
INT16 WINAPI GetDIBits16(HDC16,HBITMAP16,UINT16,UINT16,LPVOID,LPBITMAPINFO,UINT16);
INT16 WINAPI GetEnvironment16(LPCSTR,LPDEVMODE16,UINT16);
INT16 WINAPI GetEnvironment16(LPCSTR,LPDEVMODEA,UINT16);
DWORD WINAPI GetFontLanguageInfo16(HDC16);
DWORD WINAPI GetGlyphOutline16(HDC16,UINT16,UINT16,LPGLYPHMETRICS16,DWORD,LPVOID,const MAT2*);
INT16 WINAPI GetKerningPairs16(HDC16,INT16,LPKERNINGPAIR16);
@ -472,7 +444,7 @@ BOOL16 WINAPI Rectangle16(HDC16,INT16,INT16,INT16,INT16);
BOOL16 WINAPI RectInRegion16(HRGN16,const RECT16 *);
BOOL16 WINAPI RectVisible16(HDC16,const RECT16*);
BOOL16 WINAPI RemoveFontResource16(SEGPTR);
HDC16 WINAPI ResetDC16(HDC16,const DEVMODE16 *);
HDC16 WINAPI ResetDC16(HDC16,const DEVMODEA *);
BOOL16 WINAPI ResizePalette16(HPALETTE16,UINT16);
BOOL16 WINAPI RestoreDC16(HDC16,INT16);
INT16 WINAPI RestoreVisRgn16(HDC16);
@ -506,7 +478,7 @@ UINT16 WINAPI SetDIBColorTable16(HDC16,UINT16,UINT16,RGBQUAD*);
INT16 WINAPI SetDIBits16(HDC16,HBITMAP16,UINT16,UINT16,LPCVOID,const BITMAPINFO*,UINT16);
INT16 WINAPI SetDIBitsToDevice16(HDC16,INT16,INT16,INT16,INT16,INT16,
INT16,UINT16,UINT16,LPCVOID,const BITMAPINFO*,UINT16);
INT16 WINAPI SetEnvironment16(LPCSTR,LPDEVMODE16,UINT16);
INT16 WINAPI SetEnvironment16(LPCSTR,LPDEVMODEA,UINT16);
WORD WINAPI SetHookFlags16(HDC16,WORD);
INT16 WINAPI SetMapMode16(HDC16,INT16);
DWORD WINAPI SetMapperFlags16(HDC16,DWORD);

View File

@ -2625,10 +2625,15 @@ typedef struct
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
SHORT dmOrientation;
SHORT dmPaperSize;
SHORT dmPaperLength;
SHORT dmPaperWidth;
union {
struct {
SHORT dmOrientation;
SHORT dmPaperSize;
SHORT dmPaperLength;
SHORT dmPaperWidth;
} s1;
POINTL dmPosition;
} u1;
SHORT dmScale;
SHORT dmCopies;
SHORT dmDefaultSource;
@ -2663,10 +2668,15 @@ typedef struct
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
SHORT dmOrientation;
SHORT dmPaperSize;
SHORT dmPaperLength;
SHORT dmPaperWidth;
union {
struct {
SHORT dmOrientation;
SHORT dmPaperSize;
SHORT dmPaperLength;
SHORT dmPaperWidth;
} s1;
POINTL dmPosition;
} u1;
SHORT dmScale;
SHORT dmCopies;
SHORT dmDefaultSource;
@ -2713,6 +2723,7 @@ DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DM_PAPERLENGTH 0x00000004L
#define DM_PAPERWIDTH 0x00000008L
#define DM_SCALE 0x00000010L
#define DM_POSITION 0x00000020L
#define DM_COPIES 0x00000100L
#define DM_DEFAULTSOURCE 0x00000200L
#define DM_PRINTQUALITY 0x00000400L
@ -2720,17 +2731,20 @@ DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DM_DUPLEX 0x00001000L
#define DM_YRESOLUTION 0x00002000L
#define DM_TTOPTION 0x00004000L
#define DM_COLLATE 0x00008000L
#define DM_FORMNAME 0x00010000L
#define DM_LOGPIXELS 0x00020000L
#define DM_BITSPERPEL 0x00040000L
#define DM_PELSWIDTH 0x00080000L
#define DM_PELSHEIGHT 0x00100000L
#define DM_DISPLAYFLAGS 0x00200000L
#define DM_DISPLAYFREQUENCY 0x00400000L
#define DM_PANNINGHEIGHT 0x00800000L
#define DM_PANNINGWIDTH 0x01000000L
#define DM_ICMMETHOD 0x02000000L
#define DM_ICMINTENT 0x04000000L
#define DM_MEDIATYPE 0x08000000L
#define DM_DITHERTYPE 0x10000000L
#define DM_ICMMETHOD 0x00800000L
#define DM_ICMINTENT 0x01000000L
#define DM_MEDIATYPE 0x02000000L
#define DM_DITHERTYPE 0x04000000L
#define DM_PANNINGWIDTH 0x08000000L
#define DM_PANNINGHEIGHT 0x10000000L
#define DMORIENT_PORTRAIT 1
#define DMORIENT_LANDSCAPE 2
@ -3029,6 +3043,10 @@ BOOL WINAPI FixBrushOrgEx(HDC,INT,INT,LPPOINT);
BOOL WINAPI FlattenPath(HDC);
BOOL WINAPI FloodFill(HDC,INT,INT,COLORREF);
BOOL WINAPI FrameRgn(HDC,HRGN,HBRUSH,INT,INT);
DWORD WINAPI GDI_CallDeviceCapabilities16(LPCSTR,LPCSTR,WORD,LPSTR,
LPDEVMODEA);
INT WINAPI GDI_CallExtDeviceMode16(HWND,LPDEVMODEA,LPSTR,LPSTR,
LPDEVMODEA,LPSTR,DWORD);
BOOL WINAPI GdiComment(HDC,UINT,const BYTE *);
INT WINAPI GetArcDirection(HDC);
BOOL WINAPI GetAspectRatioFilterEx(HDC,LPSIZE);

View File

@ -17,8 +17,6 @@ extern "C" {
#endif
/* DEFINES */
#define INT_PD_DEFAULT_DEVMODE 1
#define INT_PD_DEFAULT_MODEL 2
#define PRINTER_ATTRIBUTE_QUEUED 0x00000001
#define PRINTER_ATTRIBUTE_DIRECT 0x00000002
@ -234,11 +232,11 @@ int WINAPI EndSpoolPage16(HANDLE16 hJob);
DWORD WINAPI GetSpoolJob16(int nOption, LONG param);
int WINAPI WriteDialog16(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg);
INT WINAPI DeviceCapabilitiesA(LPCSTR printer,LPCSTR target,WORD z,
LPSTR a,LPDEVMODEA b);
INT WINAPI DeviceCapabilitiesA(LPCSTR pDevice,LPCSTR pPort,WORD fwCapability,
LPSTR pOutput, LPDEVMODEA pDevMode);
INT WINAPI DeviceCapabilitiesW(LPCWSTR pDevice, LPCWSTR pPort,
WORD fwCapability, LPWSTR pOutput,
const DEVMODEW *pDevMode);
WORD fwCapability, LPWSTR pOutput,
const DEVMODEW *pDevMode);
#define DeviceCapabilities WINELIB_NAME_AW(DeviceCapabilities)

View File

@ -24,7 +24,6 @@ C_SRCS = \
registry.c \
shell.c \
sound.c \
spooler.c \
spy.c \
stress.c \
string.c \

File diff suppressed because it is too large Load Diff

View File

@ -1,463 +0,0 @@
/*
* Print spooler and PQ functions
*
* Copyright 1996 John Harvey
* 1998 Huw Davies
*
*/
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "winbase.h"
#include "wine/winuser16.h"
#include "callback.h"
#include "dc.h"
#include "debug.h"
#include "gdi.h"
#include "options.h"
#include "winerror.h"
#include "xmalloc.h"
DEFAULT_DEBUG_CHANNEL(print)
/**********************************************************************
* QueryAbort (GDI.155)
*
* Calls the app's AbortProc function if avail.
*
* RETURNS
* TRUE if no AbortProc avail or AbortProc wants to continue printing.
* FALSE if AbortProc wants to abort printing.
*/
BOOL16 WINAPI QueryAbort16(HDC16 hdc, INT16 reserved)
{
DC *dc = DC_GetDCPtr( hdc );
if ((!dc) || (!dc->w.lpfnPrint))
return TRUE;
return Callbacks->CallDrvAbortProc(dc->w.lpfnPrint, hdc, 0);
}
/**********************************************************************
* SetAbortProc16 (GDI.381)
*
*/
INT16 WINAPI SetAbortProc16(HDC16 hdc, SEGPTR abrtprc)
{
return Escape16(hdc, SETABORTPROC, 0, abrtprc, (SEGPTR)0);
}
/**********************************************************************
* SetAbortProc32 (GDI32.301)
*
*/
INT WINAPI SetAbortProc(HDC hdc, ABORTPROC abrtprc)
{
FIXME(print, "stub\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return SP_ERROR;
}
/****************** misc. printer related functions */
/*
* The following function should implement a queing system
*/
#ifndef HPQ
#define HPQ WORD
#endif
struct hpq
{
struct hpq *next;
int tag;
int key;
};
static struct hpq *hpqueue;
/**********************************************************************
* CreatePQ (GDI.230)
*
*/
HPQ WINAPI CreatePQ16(int size)
{
#if 0
HGLOBAL16 hpq = 0;
WORD tmp_size;
LPWORD pPQ;
tmp_size = size << 2;
if (!(hpq = GlobalAlloc16(GMEM_SHARE|GMEM_MOVEABLE, tmp_size + 8)))
return 0xffff;
pPQ = GlobalLock16(hpq);
*pPQ++ = 0;
*pPQ++ = tmp_size;
*pPQ++ = 0;
*pPQ++ = 0;
GlobalUnlock16(hpq);
return (HPQ)hpq;
#else
FIXME(print, "(%d): stub\n",size);
return 1;
#endif
}
/**********************************************************************
* DeletePQ (GDI.235)
*
*/
int WINAPI DeletePQ16(HPQ hPQ)
{
return GlobalFree16((HGLOBAL16)hPQ);
}
/**********************************************************************
* ExtractPQ (GDI.232)
*
*/
int WINAPI ExtractPQ16(HPQ hPQ)
{
struct hpq *queue, *prev, *current, *currentPrev;
int key = 0, tag = -1;
currentPrev = prev = NULL;
queue = current = hpqueue;
if (current)
key = current->key;
while (current)
{
currentPrev = current;
current = current->next;
if (current)
{
if (current->key < key)
{
queue = current;
prev = currentPrev;
}
}
}
if (queue)
{
tag = queue->tag;
if (prev)
prev->next = queue->next;
else
hpqueue = queue->next;
free(queue);
}
TRACE(print, "%x got tag %d key %d\n", hPQ, tag, key);
return tag;
}
/**********************************************************************
* InsertPQ (GDI.233)
*
*/
int WINAPI InsertPQ16(HPQ hPQ, int tag, int key)
{
struct hpq *queueItem = xmalloc(sizeof(struct hpq));
queueItem->next = hpqueue;
hpqueue = queueItem;
queueItem->key = key;
queueItem->tag = tag;
FIXME(print, "(%x %d %d): stub???\n", hPQ, tag, key);
return TRUE;
}
/**********************************************************************
* MinPQ (GDI.231)
*
*/
int WINAPI MinPQ16(HPQ hPQ)
{
FIXME(print, "(%x): stub\n", hPQ);
return 0;
}
/**********************************************************************
* SizePQ (GDI.234)
*
*/
int WINAPI SizePQ16(HPQ hPQ, int sizechange)
{
FIXME(print, "(%x %d): stub\n", hPQ, sizechange);
return -1;
}
/*
* The following functions implement part of the spooling process to
* print manager. I would like to see wine have a version of print managers
* that used LPR/LPD. For simplicity print jobs will be sent to a file for
* now.
*/
typedef struct PRINTJOB
{
char *pszOutput;
char *pszTitle;
HDC16 hDC;
HANDLE16 hHandle;
int nIndex;
int fd;
} PRINTJOB, *PPRINTJOB;
#define MAX_PRINT_JOBS 1
#define SP_OK 1
PPRINTJOB gPrintJobsTable[MAX_PRINT_JOBS];
static PPRINTJOB FindPrintJobFromHandle(HANDLE16 hHandle)
{
return gPrintJobsTable[0];
}
/* TTD Need to do some DOS->UNIX file conversion here */
static int CreateSpoolFile(LPSTR pszOutput)
{
int fd=-1;
char psCmd[1024];
char *psCmdP = psCmd;
/* TTD convert the 'output device' into a spool file name */
if (pszOutput == NULL || *pszOutput == '\0')
return -1;
PROFILE_GetWineIniString( "spooler", pszOutput, "", psCmd, sizeof(psCmd) );
TRACE(print, "Got printerSpoolCommand '%s' for output device '%s'\n",
psCmd, pszOutput);
if (!*psCmd)
psCmdP = pszOutput;
else
{
while (*psCmdP && isspace(*psCmdP))
{
psCmdP++;
};
if (!*psCmdP)
return -1;
}
if (*psCmdP == '|')
{
int fds[2];
if (pipe(fds))
return -1;
if (fork() == 0)
{
psCmdP++;
TRACE(print, "In child need to exec %s\n",psCmdP);
close(0);
dup2(fds[0],0);
close (fds[1]);
system(psCmdP);
exit(0);
}
close (fds[0]);
fd = fds[1];
TRACE(print,"Need to execute a cmnd and pipe the output to it\n");
}
else
{
TRACE(print, "Just assume its a file\n");
if ((fd = open(psCmdP, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0)
{
ERR(print, "Failed to create spool file %s, errno = %d\n",
psCmdP, errno);
}
}
return fd;
}
static int FreePrintJob(HANDLE16 hJob)
{
int nRet = SP_ERROR;
PPRINTJOB pPrintJob;
pPrintJob = FindPrintJobFromHandle(hJob);
if (pPrintJob != NULL)
{
gPrintJobsTable[pPrintJob->nIndex] = NULL;
free(pPrintJob->pszOutput);
free(pPrintJob->pszTitle);
if (pPrintJob->fd >= 0) close(pPrintJob->fd);
free(pPrintJob);
nRet = SP_OK;
}
return nRet;
}
/**********************************************************************
* OpenJob (GDI.240)
*
*/
HANDLE16 WINAPI OpenJob16(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC)
{
HANDLE16 hHandle = (HANDLE16)SP_ERROR;
PPRINTJOB pPrintJob;
TRACE(print, "'%s' '%s' %04x\n", lpOutput, lpTitle, hDC);
pPrintJob = gPrintJobsTable[0];
if (pPrintJob == NULL)
{
int fd;
/* Try an create a spool file */
fd = CreateSpoolFile(lpOutput);
if (fd >= 0)
{
hHandle = 1;
pPrintJob = xmalloc(sizeof(PRINTJOB));
memset(pPrintJob, 0, sizeof(PRINTJOB));
pPrintJob->pszOutput = strdup(lpOutput);
if(lpTitle)
pPrintJob->pszTitle = strdup(lpTitle);
pPrintJob->hDC = hDC;
pPrintJob->fd = fd;
pPrintJob->nIndex = 0;
pPrintJob->hHandle = hHandle;
gPrintJobsTable[pPrintJob->nIndex] = pPrintJob;
}
}
TRACE(print, "return %04x\n", hHandle);
return hHandle;
}
/**********************************************************************
* CloseJob (GDI.243)
*
*/
int WINAPI CloseJob16(HANDLE16 hJob)
{
int nRet = SP_ERROR;
PPRINTJOB pPrintJob = NULL;
TRACE(print, "%04x\n", hJob);
pPrintJob = FindPrintJobFromHandle(hJob);
if (pPrintJob != NULL)
{
/* Close the spool file */
close(pPrintJob->fd);
FreePrintJob(hJob);
nRet = 1;
}
return nRet;
}
/**********************************************************************
* WriteSpool (GDI.241)
*
*/
int WINAPI WriteSpool16(HANDLE16 hJob, LPSTR lpData, WORD cch)
{
int nRet = SP_ERROR;
PPRINTJOB pPrintJob = NULL;
TRACE(print, "%04x %08lx %04x\n", hJob, (DWORD)lpData, cch);
pPrintJob = FindPrintJobFromHandle(hJob);
if (pPrintJob != NULL && pPrintJob->fd >= 0 && cch)
{
if (write(pPrintJob->fd, lpData, cch) != cch)
nRet = SP_OUTOFDISK;
else
nRet = cch;
if (pPrintJob->hDC == 0) {
TRACE(print, "hDC == 0 so no QueryAbort\n");
}
else if (!(QueryAbort16(pPrintJob->hDC, (nRet == SP_OUTOFDISK) ? nRet : 0 )))
{
CloseJob16(hJob); /* printing aborted */
nRet = SP_APPABORT;
}
}
return nRet;
}
/**********************************************************************
* WriteDialog (GDI.242)
*
*/
int WINAPI WriteDialog16(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg)
{
int nRet = 0;
TRACE(print, "%04x %04x '%s'\n", hJob, cchMsg, lpMsg);
nRet = MessageBox16(0, lpMsg, "Printing Error", MB_OKCANCEL);
return nRet;
}
/**********************************************************************
* DeleteJob (GDI.244)
*
*/
int WINAPI DeleteJob16(HANDLE16 hJob, WORD wNotUsed)
{
int nRet;
TRACE(print, "%04x\n", hJob);
nRet = FreePrintJob(hJob);
return nRet;
}
/*
* The following two function would allow a page to be sent to the printer
* when it has been processed. For simplicity they havn't been implemented.
* This means a whole job has to be processed before it is sent to the printer.
*/
/**********************************************************************
* StartSpoolPage (GDI.246)
*
*/
int WINAPI StartSpoolPage16(HANDLE16 hJob)
{
FIXME(print, "StartSpoolPage GDI.246 unimplemented\n");
return 1;
}
/**********************************************************************
* EndSpoolPage (GDI.247)
*
*/
int WINAPI EndSpoolPage16(HANDLE16 hJob)
{
FIXME(print, "EndSpoolPage GDI.247 unimplemented\n");
return 1;
}
/**********************************************************************
* GetSpoolJob (GDI.245)
*
*/
DWORD WINAPI GetSpoolJob16(int nOption, LONG param)
{
DWORD retval = 0;
TRACE(print, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption);
return retval;
}

View File

@ -503,12 +503,18 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
* CreateDC16 (GDI.53)
*/
HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
const DEVMODE16 *initData )
const DEVMODEA *initData )
{
DC * dc;
const DC_FUNCTIONS *funcs;
char buf[300];
if (!(funcs = DRIVER_FindDriver( driver ))) return 0;
if (device) {
if(!DRIVER_GetDriverName( device, buf, sizeof(buf) )) return 0;
} else
strcpy(buf, driver);
if (!(funcs = DRIVER_FindDriver( buf ))) return 0;
if (!(dc = DC_AllocDC( funcs ))) return 0;
dc->w.flags = 0;
@ -535,7 +541,7 @@ HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
HDC WINAPI CreateDCA( LPCSTR driver, LPCSTR device, LPCSTR output,
const DEVMODEA *initData )
{
return CreateDC16( driver, device, output, (const DEVMODE16 *)initData );
return CreateDC16( driver, device, output, (const DEVMODEA *)initData );
}
@ -549,7 +555,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
LPSTR deviceA = HEAP_strdupWtoA( GetProcessHeap(), 0, device );
LPSTR outputA = HEAP_strdupWtoA( GetProcessHeap(), 0, output );
HDC res = CreateDC16( driverA, deviceA, outputA,
(const DEVMODE16 *)initData /*FIXME*/ );
(const DEVMODEA *)initData /*FIXME*/ );
HeapFree( GetProcessHeap(), 0, driverA );
HeapFree( GetProcessHeap(), 0, deviceA );
HeapFree( GetProcessHeap(), 0, outputA );
@ -561,7 +567,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
* CreateIC16 (GDI.153)
*/
HDC16 WINAPI CreateIC16( LPCSTR driver, LPCSTR device, LPCSTR output,
const DEVMODE16* initData )
const DEVMODEA* initData )
{
/* Nothing special yet for ICs */
return CreateDC16( driver, device, output, initData );
@ -702,7 +708,7 @@ BOOL WINAPI DeleteDC( HDC hdc )
/***********************************************************************
* ResetDC16 (GDI.376)
*/
HDC16 WINAPI ResetDC16( HDC16 hdc, const DEVMODE16 *devmode )
HDC16 WINAPI ResetDC16( HDC16 hdc, const DEVMODEA *devmode )
{
FIXME(dc, "stub\n" );
return hdc;
@ -745,9 +751,33 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
INT ret;
POINT pt;
if (!dc) return 0;
/* Device capabilities for the printer */
switch (cap)
{
case PHYSICALWIDTH:
if(Escape(hdc, GETPHYSPAGESIZE, 0, NULL, (LPVOID)&pt) > 0)
return pt.x;
case PHYSICALHEIGHT:
if(Escape(hdc, GETPHYSPAGESIZE, 0, NULL, (LPVOID)&pt) > 0)
return pt.y;
case PHYSICALOFFSETX:
if(Escape(hdc, GETPRINTINGOFFSET, 0, NULL, (LPVOID)&pt) > 0)
return pt.x;
case PHYSICALOFFSETY:
if(Escape(hdc, GETPRINTINGOFFSET, 0, NULL, (LPVOID)&pt) > 0)
return pt.y;
case SCALINGFACTORX:
if(Escape(hdc, GETSCALINGFACTOR, 0, NULL, (LPVOID)&pt) > 0)
return pt.x;
case SCALINGFACTORY:
if(Escape(hdc, GETSCALINGFACTOR, 0, NULL, (LPVOID)&pt) > 0)
return pt.y;
}
if ((cap < 0) || (cap > sizeof(DeviceCaps)-sizeof(WORD)))
{
GDI_HEAP_UNLOCK( hdc );