Commit e39b676a authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

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>
parent 2b898806
......@@ -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 \
......
......@@ -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
......
......@@ -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
......
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winspool
C_SRCS = \
info.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
......@@ -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);
}
......@@ -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 */
};
......
......@@ -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;
......
......@@ -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: {
......
......@@ -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 */
};
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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),
......
......@@ -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;
......
......@@ -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;
......
......@@ -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"
......
......@@ -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 */
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -24,7 +24,6 @@ C_SRCS = \
registry.c \
shell.c \
sound.c \
spooler.c \
spy.c \
stress.c \
string.c \
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment