Implement GetDeviceCaps()

svn path=/trunk/; revision=4639
This commit is contained in:
Gé van Geldorp 2003-05-03 13:39:06 +00:00
parent 8e7f49204c
commit 158fda092b
9 changed files with 367 additions and 236 deletions

View file

@ -1,13 +1,13 @@
/*
* entry.c
*
* $Revision: 1.26 $
* $Author: hbirr $
* $Date: 2003/03/09 21:44:24 $
* $Revision: 1.27 $
* $Author: gvg $
* $Date: 2003/05/03 13:39:05 $
*
*/
#include "gdiinfo.h"
#include "../vgaddi.h"
#include "../vgavideo/vgavideo.h"
#define NDEBUG
#include <debug.h>
@ -61,6 +61,124 @@ DRVFN FuncList[] =
#endif
};
GDIINFO gaulCap = {
GDI_DRIVER_VERSION,
DT_RASDISPLAY, // ulTechnology
0, // ulHorzSize
0, // ulVertSize
0, // ulHorzRes (filled in at initialization)
0, // ulVertRes (filled in at initialization)
4, // cBitsPixel
1, // cPlanes
16, // ulNumColors
0, // flRaster (DDI reserved field)
96, // ulLogPixelsX (must be set to 96 according to MSDN)
96, // ulLogPixelsY (must be set to 96 according to MSDN)
TC_RA_ABLE | TC_SCROLLBLT, // flTextCaps
6, // ulDACRed
6, // ulDACGree
6, // ulDACBlue
0x0024, // ulAspectX (one-to-one aspect ratio)
0x0024, // ulAspectY
0x0033, // ulAspectXY
1, // xStyleStep
1, // yStyleSte;
3, // denStyleStep
{ 0, 0 }, // ptlPhysOffset
{ 0, 0 }, // szlPhysSize
0, // ulNumPalReg (win3.1 16 color drivers say 0 too)
// These fields are for halftone initialization.
{ // ciDevice, ColorInfo
{ 6700, 3300, 0 }, // Red
{ 2100, 7100, 0 }, // Green
{ 1400, 800, 0 }, // Blue
{ 1750, 3950, 0 }, // Cyan
{ 4050, 2050, 0 }, // Magenta
{ 4400, 5200, 0 }, // Yellow
{ 3127, 3290, 0 }, // AlignmentWhite
20000, // RedGamma
20000, // GreenGamma
20000, // BlueGamma
0, 0, 0, 0, 0, 0
},
0, // ulDevicePelsDPI
PRIMARY_ORDER_CBA, // ulPrimaryOrder
HT_PATSIZE_4x4_M, // ulHTPatternSize
HT_FORMAT_4BPP_IRGB, // ulHTOutputFormat
HT_FLAG_ADDITIVE_PRIMS, // flHTFlags
0, // ulVRefresh
8, // ulBltAlignment
0, // ulPanningHorzRes
0, // ulPanningVertRes
};
// Palette for VGA
typedef struct _VGALOGPALETTE
{
USHORT ident;
USHORT NumEntries;
PALETTEENTRY PaletteEntry[16];
} VGALOGPALETTE;
const VGALOGPALETTE VGApalette =
{
0x400, // driver version
16, // num entries
{
{ 0x00, 0x00, 0x00, 0x00 }, // 0
{ 0x80, 0x00, 0x00, 0x00 }, // 1
{ 0x00, 0x80, 0x00, 0x00 }, // 2
{ 0x80, 0x80, 0x00, 0x00 }, // 3
{ 0x00, 0x00, 0x80, 0x00 }, // 4
{ 0x80, 0x00, 0x80, 0x00 }, // 5
{ 0x00, 0x80, 0x80, 0x00 }, // 6
{ 0x80, 0x80, 0x80, 0x00 }, // 7
{ 0xc0, 0xc0, 0xc0, 0x00 }, // 8
{ 0xff, 0x00, 0x00, 0x00 }, // 9
{ 0x00, 0xff, 0x00, 0x00 }, // 10
{ 0xff, 0xff, 0x00, 0x00 }, // 11
{ 0x00, 0x00, 0xff, 0x00 }, // 12
{ 0xff, 0x00, 0xff, 0x00 }, // 13
{ 0x00, 0xff, 0xff, 0x00 }, // 14
{ 0xff, 0xff, 0xff, 0x00 } // 15
}
};
// Devinfo structure passed back to the engine in DrvEnablePDEV
#define SYSTM_LOGFONT {16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,VARIABLE_PITCH | FF_DONTCARE, L"System"}
#define HELVE_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,VARIABLE_PITCH | FF_DONTCARE, L"MS Sans Serif"}
#define COURI_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,FIXED_PITCH | FF_DONTCARE, L"Courier"}
DEVINFO devinfoVGA =
{
(GCAPS_OPAQUERECT | GCAPS_HORIZSTRIKE | GCAPS_ALTERNATEFILL | GCAPS_MONO_DITHER | GCAPS_COLOR_DITHER |
GCAPS_WINDINGFILL | GCAPS_DITHERONREALIZE
), // Graphics capabilities
SYSTM_LOGFONT, // Default font description
HELVE_LOGFONT, // ANSI variable font description
COURI_LOGFONT, // ANSI fixed font description
0, // Count of device fonts
BMF_4BPP, // preferred DIB format
8, // Width of color dither
8, // Height of color dither
0 // Default palette to use for this device
};
BOOL STDCALL
DrvEnableDriver(IN ULONG EngineVersion,
@ -110,10 +228,10 @@ DrvDisableDriver(VOID)
// IN LPWSTR LogAddress
// IN ULONG PatternCount number of patterns expected
// OUT HSURF * SurfPatterns array to contain pattern handles
// IN ULONG CapsSize the size of the DevCaps object passed in
// OUT ULONG * DevCaps Device Capabilities object
// IN ULONG GDIInfoSize the size of the GDIInfo object passed in
// OUT GDIINFO * GDIInfo GDI Info object
// IN ULONG DevInfoSize the size of the DevInfo object passed in
// OUT DEVINFO * DI Device Info object
// OUT DEVINFO * DevInfo Device Info object
// IN LPWSTR DevDataFile ignore
// IN LPWSTR DeviceName Device name
// IN HANDLE Driver handle to KM driver
@ -125,10 +243,10 @@ DrvEnablePDEV(IN DEVMODEW *DM,
IN LPWSTR LogAddress,
IN ULONG PatternCount,
OUT HSURF *SurfPatterns,
IN ULONG CapsSize,
OUT ULONG *DevCaps,
IN ULONG GDIInfoSize,
OUT GDIINFO *GDIInfo,
IN ULONG DevInfoSize,
OUT DEVINFO *DI,
OUT DEVINFO *DevInfo,
IN LPWSTR DevDataFile,
IN LPWSTR DeviceName,
IN HANDLE Driver)
@ -149,13 +267,21 @@ DrvEnablePDEV(IN DEVMODEW *DM,
PDev->ptlExtent.y = 0;
PDev->cExtent = 0;
PDev->flCursor = CURSOR_DOWN;
// FIXME: fill out DevCaps
// FIXME: full out DevInfo
devinfoVGA.hpalDefault = EngCreatePalette(PAL_INDEXED, 16, (PULONG *)VGApalette.PaletteEntry, 0, 0, 0);
DPRINT("Palette from Driver: %u\n", devinfoVGA.hpalDefault);
*DI = devinfoVGA;
DPRINT("Palette from Driver 2: %u and DI is %08x\n", DI->hpalDefault, DI);
gaulCap.ulHorzRes = 640;
gaulCap.ulVertRes = 480;
if (sizeof(GDIINFO) < GDIInfoSize)
{
GDIInfoSize = sizeof(GDIINFO);
}
memcpy(GDIInfo, &gaulCap, GDIInfoSize);
devinfoVGA.hpalDefault = EngCreatePalette(PAL_INDEXED, 16, (ULONG *) VGApalette.PaletteEntry, 0, 0, 0);
if (sizeof(DEVINFO) < DevInfoSize)
{
DevInfoSize = sizeof(DEVINFO);
}
memcpy(DevInfo, &devinfoVGA, DevInfoSize);
return(PDev);
}

View file

@ -1,119 +0,0 @@
#include "../vgaddi.h"
GDIINFO gaulCap = {
GDI_DRIVER_VERSION,
DT_RASDISPLAY, // ulTechnology
0, // ulHorzSize
0, // ulVertSize
0, // ulHorzRes (filled in at initialization)
0, // ulVertRes (filled in at initialization)
4, // cBitsPixel
1, // cPlanes
16, // ulNumColors
0, // flRaster (DDI reserved field)
0, // ulLogPixelsX (filled in at initialization)
0, // ulLogPixelsY (filled in at initialization)
TC_RA_ABLE | TC_SCROLLBLT, // flTextCaps
6, // ulDACRed
6, // ulDACGree
6, // ulDACBlue
0x0024, // ulAspectX (one-to-one aspect ratio)
0x0024, // ulAspectY
0x0033, // ulAspectXY
1, // xStyleStep
1, // yStyleSte;
3, // denStyleStep
{ 0, 0 }, // ptlPhysOffset
{ 0, 0 }, // szlPhysSize
0, // ulNumPalReg (win3.1 16 color drivers say 0 too)
// These fields are for halftone initialization.
{ // ciDevice, ColorInfo
{ 6700, 3300, 0 }, // Red
{ 2100, 7100, 0 }, // Green
{ 1400, 800, 0 }, // Blue
{ 1750, 3950, 0 }, // Cyan
{ 4050, 2050, 0 }, // Magenta
{ 4400, 5200, 0 }, // Yellow
{ 3127, 3290, 0 }, // AlignmentWhite
20000, // RedGamma
20000, // GreenGamma
20000, // BlueGamma
0, 0, 0, 0, 0, 0
},
0, // ulDevicePelsDPI
PRIMARY_ORDER_CBA, // ulPrimaryOrder
HT_PATSIZE_4x4_M, // ulHTPatternSize
HT_FORMAT_4BPP_IRGB, // ulHTOutputFormat
HT_FLAG_ADDITIVE_PRIMS, // flHTFlags
0, // ulVRefresh
8, // ulBltAlignment
0, // ulPanningHorzRes
0, // ulPanningVertRes
};
// Palette for VGA
typedef struct _VGALOGPALETTE
{
USHORT ident;
USHORT NumEntries;
PALETTEENTRY PaletteEntry[16];
} VGALOGPALETTE;
const VGALOGPALETTE VGApalette =
{
0x400, // driver version
16, // num entries
{
{ 0x00, 0x00, 0x00, 0x00 }, // 0
{ 0x80, 0x00, 0x00, 0x00 }, // 1
{ 0x00, 0x80, 0x00, 0x00 }, // 2
{ 0x80, 0x80, 0x00, 0x00 }, // 3
{ 0x00, 0x00, 0x80, 0x00 }, // 4
{ 0x80, 0x00, 0x80, 0x00 }, // 5
{ 0x00, 0x80, 0x80, 0x00 }, // 6
{ 0x80, 0x80, 0x80, 0x00 }, // 7
{ 0xc0, 0xc0, 0xc0, 0x00 }, // 8
{ 0xff, 0x00, 0x00, 0x00 }, // 9
{ 0x00, 0xff, 0x00, 0x00 }, // 10
{ 0xff, 0xff, 0x00, 0x00 }, // 11
{ 0x00, 0x00, 0xff, 0x00 }, // 12
{ 0xff, 0x00, 0xff, 0x00 }, // 13
{ 0x00, 0xff, 0xff, 0x00 }, // 14
{ 0xff, 0xff, 0xff, 0x00 } // 15
}
};
// Devinfo structure passed back to the engine in DrvEnablePDEV
#define SYSTM_LOGFONT {16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,VARIABLE_PITCH | FF_DONTCARE, L"System"}
#define HELVE_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,VARIABLE_PITCH | FF_DONTCARE, L"MS Sans Serif"}
#define COURI_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,FIXED_PITCH | FF_DONTCARE, L"Courier"}
DEVINFO devinfoVGA =
{
(GCAPS_OPAQUERECT | GCAPS_HORIZSTRIKE | GCAPS_ALTERNATEFILL | GCAPS_MONO_DITHER | GCAPS_COLOR_DITHER |
GCAPS_WINDINGFILL | GCAPS_DITHERONREALIZE
), // Graphics capabilities
SYSTM_LOGFONT, // Default font description
HELVE_LOGFONT, // ANSI variable font description
COURI_LOGFONT, // ANSI fixed font description
0, // Count of device fonts
BMF_4BPP, // preferred DIB format
8, // Width of color dither
8, // Height of color dither
0 // Default palette to use for this device
};

View file

@ -751,10 +751,10 @@ DrvEnablePDEV(IN DEVMODEW *DM,
IN LPWSTR LogAddress,
IN ULONG PatternCount,
OUT HSURF *SurfPatterns,
IN ULONG CapsSize,
OUT ULONG *DevCaps,
IN ULONG GDIInfoSize,
OUT GDIINFO *GDIInfo,
IN ULONG DevInfoSize,
OUT DEVINFO *DI,
OUT DEVINFO *DevInfo,
IN LPWSTR DevDataFile,
IN LPWSTR DeviceName,
IN HANDLE Driver);

View file

@ -7,56 +7,9 @@
#include <win32k/gdiobj.h>
#include <win32k/path.h>
typedef struct
{
HANDLE Handle;
DHPDEV PDev;
DEVMODEW DMW;
HSURF FillPatterns[HS_DDI_MAX];
GDIINFO GDIInfo;
DEVINFO DevInfo;
DRIVER_FUNCTIONS DriverFunctions;
} GDIDEVICE;
/* (RJJ) Taken from WINE */
typedef struct _DEVICECAPS
{
WORD version; /* 0: driver version */
WORD technology; /* 2: device technology */
WORD horzSize; /* 4: width of display in mm */
WORD vertSize; /* 6: height of display in mm */
WORD horzRes; /* 8: width of display in pixels */
WORD vertRes; /* 10: width of display in pixels */
WORD bitsPixel; /* 12: bits per pixel */
WORD planes; /* 14: color planes */
WORD numBrushes; /* 16: device-specific brushes */
WORD numPens; /* 18: device-specific pens */
WORD numMarkers; /* 20: device-specific markers */
WORD numFonts; /* 22: device-specific fonts */
WORD numColors; /* 24: size of color table */
WORD pdeviceSize; /* 26: size of PDEVICE structure */
WORD curveCaps; /* 28: curve capabilities */
WORD lineCaps; /* 30: line capabilities */
WORD polygonalCaps; /* 32: polygon capabilities */
WORD textCaps; /* 34: text capabilities */
WORD clipCaps; /* 36: clipping capabilities */
WORD rasterCaps; /* 38: raster capabilities */
WORD aspectX; /* 40: relative width of device pixel */
WORD aspectY; /* 42: relative height of device pixel */
WORD aspectXY; /* 44: relative diagonal width of device pixel */
WORD pad1[21]; /* 46-86: reserved */
WORD logPixelsX; /* 88: pixels / logical X inch */
WORD logPixelsY; /* 90: pixels / logical Y inch */
WORD pad2[6]; /* 92-102: reserved */
WORD sizePalette; /* 104: entries in system palette */
WORD numReserved; /* 106: reserved entries */
WORD colorRes; /* 108: color resolution */
} DEVICECAPS, *PDEVICECAPS;
typedef struct _WIN_DC_INFO
{
int flags;
const PDEVICECAPS devCaps;
HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
@ -128,8 +81,8 @@ typedef struct _DC
DHPDEV PDev;
DEVMODEW DMW;
HSURF FillPatternSurfaces[HS_DDI_MAX];
GDIINFO GDIInfo;
DEVINFO DevInfo;
PGDIINFO GDIInfo;
PDEVINFO DevInfo;
HSURF Surface;
DRIVER_FUNCTIONS DriverFunctions;
@ -150,6 +103,17 @@ typedef struct _DC
WIN_DC_INFO w;
} DC, *PDC;
typedef struct
{
HANDLE Handle;
DHPDEV PDev;
DEVMODEW DMW;
HSURF FillPatterns[HS_DDI_MAX];
GDIINFO GDIInfo;
DEVINFO DevInfo;
DRIVER_FUNCTIONS DriverFunctions;
} GDIDEVICE;
/* Internal functions */
/*

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.16 2003/03/27 03:24:03 rcampbell Exp $
/* $Id: stubs.c,v 1.17 2003/05/03 13:39:06 gvg Exp $
*
* reactos/lib/gdi32/misc/stubs.c
*
@ -518,19 +518,6 @@ GetCurrentPositionEx(
int
STDCALL
GetDeviceCaps(
HDC a0,
int a1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL

View file

@ -226,3 +226,13 @@ SetPolyFillMode(
return W32kSetPolyFillMode(a0, a1);
}
int
STDCALL
GetDeviceCaps(
HDC DC,
int Index
)
{
return W32kGetDeviceCaps(DC, Index);
}

View file

@ -251,17 +251,17 @@ UINT STDCALL W32kGetSystemPaletteEntries(HDC hDC,
if (!pe)
{
Entries = dc->devCaps->sizePalette;
Entries = dc->GDIInfo->ulNumPalReg;
goto done;
}
if (StartIndex >= dc->devCaps->sizePalette)
if (StartIndex >= dc->GDIInfo->ulNumPalReg)
{
Entries = 0;
goto done;
}
if (StartIndex + Entries >= dc->devCaps->sizePalette) Entries = dc->devCaps->sizePalette - StartIndex;
if (StartIndex + Entries >= dc->GDIInfo->ulNumPalReg) Entries = dc->GDIInfo->ulNumPalReg - StartIndex;
for (i = 0; i < Entries; i++)
{
@ -469,7 +469,7 @@ BOOL STDCALL W32kUpdateColors(HDC hDC)
int size;
/*
if (!(dc = AccessUserObject(hDC))) return 0;
size = dc->devCaps->sizePalette;
size = dc->GDIInfo->ulNumPalReg;
// GDI_ReleaseObj( hDC );
if (Callout.WindowFromDC)

View file

@ -1,4 +1,4 @@
/* $Id: dc.c,v 1.57 2003/03/28 16:20:51 gvg Exp $
/* $Id: dc.c,v 1.58 2003/05/03 13:39:06 gvg Exp $
*
* DC.C - Device context functions
*
@ -223,6 +223,43 @@ static BOOL STDCALL FindDriverFileNames(PUNICODE_STRING DriverFileNames)
return TRUE;
}
#ifdef TODO
static void
SetupDevCaps(GDIDEVICE *GDIDev)
{
RtlZeroMemory(&(GDIDev->DevCaps), sizeof(DEVICECAPS));
GDIDev->DevCaps.version = GDIDev->GDIInfo.ulVersion;
GDIDev->DevCaps.technology = GDIDev->GDIInfo.ulTechnology;
GDIDev->DevCaps.horzSize = GDIDev->GDIInfo.ulHorzSize;
GDIDev->DevCaps.vertSize = GDIDev->GDIInfo.ulVertSize;
GDIDev->DevCaps.horzRes = GDIDev->GDIInfo.ulHorzRes;
GDIDev->DevCaps.vertRes = GDIDev->GDIInfo.ulVertRes;
GDIDev->DevCaps.bitsPixel = GDIDev->GDIInfo.cBitsPixel;
GDIDev->DevCaps.planes = GDIDev->GDIInfo.cPlanes;
GDIDev->DevCaps.numBrushes = 0; /* FIXME */
GDIDev->DevCaps.numPens = 0; /* FIXME */
GDIDev->DevCaps.numMarkers = 0; /* FIXME */
GDIDev->DevCaps.numFonts = 0; /* FIXME */
GDIDev->DevCaps.numColors = GDIDev->GDIInfo.ulNumColors;
GDIDev->DevCaps.pdeviceSize = 0; /* FIXME */
GDIDev->DevCaps.curveCaps = 0; /* FIXME */
GDIDev->DevCaps.lineCaps = 0; /* FIXME */
GDIDev->DevCaps.polygonalCaps = 0; /* FIXME */
GDIDev->DevCaps.textCaps = GDIDev->GDIInfo.flTextCaps;
GDIDev->DevCaps.clipCaps = 0; /* FIXME */
GDIDev->DevCaps.rasterCaps = 0; /* FIXME */
GDIDev->DevCaps.aspectX = GDIDev->GDIInfo.ulAspectX;
GDIDev->DevCaps.aspectY = GDIDev->GDIInfo.ulAspectY;
GDIDev->DevCaps.aspectXY = GDIDev->GDIInfo.ulAspectXY;
GDIDev->DevCaps.logPixelsX = GDIDev->GDIInfo.ulLogPixelsX;
GDIDev->DevCaps.logPixelsY = GDIDev->GDIInfo.ulLogPixelsY;
GDIDev->DevCaps.sizePalette = GDIDev->GDIInfo.ulNumPalReg; /* FIXME not sure */
GDIDev->DevCaps.numReserved = 0; /* FIXME */
GDIDev->DevCaps.colorRes = 0; /* FIXME */
}
#endif
BOOL STDCALL W32kCreatePrimarySurface(LPCWSTR Driver,
LPCWSTR Device)
{
@ -396,8 +433,8 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
}
PrimarySurfaceCreated = TRUE;
NewDC->DMW = PrimarySurface.DMW;
NewDC->DevInfo = PrimarySurface.DevInfo;
NewDC->GDIInfo = PrimarySurface.GDIInfo;
NewDC->DevInfo = &PrimarySurface.DevInfo;
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
sizeof(NewDC->FillPatternSurfaces));
NewDC->PDev = PrimarySurface.PDev;
@ -419,7 +456,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
NewDC->w.bitsPerPixel = SurfGDI->BitsPerPixel; // FIXME: set this here??
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
@ -595,9 +632,6 @@ HDC STDCALL W32kGetDCState16(HDC hDC)
ASSERT( newdc );
newdc->w.flags = dc->w.flags | DC_SAVED;
#if 0
newdc->w.devCaps = dc->w.devCaps;
#endif
newdc->w.hPen = dc->w.hPen;
newdc->w.hBrush = dc->w.hBrush;
newdc->w.hFont = dc->w.hFont;
@ -687,60 +721,193 @@ INT STDCALL W32kGetDeviceCaps(HDC hDC,
return 0;
}
/* Device capabilities for the printer */
/* Retrieve capability */
switch (Index)
{
case DRIVERVERSION:
ret = dc->GDIInfo->ulVersion;
break;
case TECHNOLOGY:
ret = dc->GDIInfo->ulTechnology;
break;
case HORZSIZE:
ret = dc->GDIInfo->ulHorzSize;
break;
case VERTSIZE:
ret = dc->GDIInfo->ulVertSize;
break;
case HORZRES:
ret = dc->GDIInfo->ulHorzRes;
break;
case VERTRES:
ret = dc->GDIInfo->ulVertRes;
break;
case LOGPIXELSX:
ret = dc->GDIInfo->ulLogPixelsX;
break;
case LOGPIXELSY:
ret = dc->GDIInfo->ulLogPixelsY;
break;
case BITSPIXEL:
ret = dc->GDIInfo->cBitsPixel;
break;
case PLANES:
ret = dc->GDIInfo->cPlanes;
break;
case NUMBRUSHES:
UNIMPLEMENTED; /* FIXME */
break;
case NUMPENS:
UNIMPLEMENTED; /* FIXME */
break;
case NUMFONTS:
UNIMPLEMENTED; /* FIXME */
break;
case NUMCOLORS:
ret = dc->GDIInfo->ulNumColors;
break;
case ASPECTX:
ret = dc->GDIInfo->ulAspectX;
break;
case ASPECTY:
ret = dc->GDIInfo->ulAspectY;
break;
case ASPECTXY:
ret = dc->GDIInfo->ulAspectXY;
break;
case PDEVICESIZE:
UNIMPLEMENTED; /* FIXME */
break;
case CLIPCAPS:
UNIMPLEMENTED; /* FIXME */
break;
case SIZEPALETTE:
ret = dc->GDIInfo->ulNumPalReg; /* FIXME not sure */
break;
case NUMRESERVED:
UNIMPLEMENTED; /* FIXME */
break;
case COLORRES:
UNIMPLEMENTED; /* FIXME */
break;
case PHYSICALWIDTH:
if(W32kEscape(hDC, GETPHYSPAGESIZE, 0, NULL, (LPVOID)&pt) > 0)
{
return pt.x;
ret = pt.x;
}
else
{
ret = 0;
}
break;
case PHYSICALHEIGHT:
if(W32kEscape(hDC, GETPHYSPAGESIZE, 0, NULL, (LPVOID)&pt) > 0)
{
return pt.y;
ret = pt.y;
}
else
{
ret = 0;
}
break;
case PHYSICALOFFSETX:
if(W32kEscape(hDC, GETPRINTINGOFFSET, 0, NULL, (LPVOID)&pt) > 0)
{
return pt.x;
ret = pt.x;
}
else
{
ret = 0;
}
break;
case PHYSICALOFFSETY:
if(W32kEscape(hDC, GETPRINTINGOFFSET, 0, NULL, (LPVOID)&pt) > 0)
{
return pt.y;
ret = pt.y;
}
else
{
ret = 0;
}
break;
case VREFRESH:
UNIMPLEMENTED; /* FIXME */
break;
case SCALINGFACTORX:
if(W32kEscape(hDC, GETSCALINGFACTOR, 0, NULL, (LPVOID)&pt) > 0)
{
return pt.x;
ret = pt.x;
}
else
{
ret = 0;
}
break;
case SCALINGFACTORY:
if(W32kEscape(hDC, GETSCALINGFACTOR, 0, NULL, (LPVOID)&pt) > 0)
{
return pt.y;
ret = pt.y;
}
else
{
ret = 0;
}
break;
case RASTERCAPS:
UNIMPLEMENTED; /* FIXME */
break;
case CURVECAPS:
UNIMPLEMENTED; /* FIXME */
break;
case LINECAPS:
UNIMPLEMENTED; /* FIXME */
break;
case POLYGONALCAPS:
UNIMPLEMENTED; /* FIXME */
break;
case TEXTCAPS:
ret = dc->GDIInfo->flTextCaps;
break;
default:
ret = 0;
break;
}
if ((Index < 0) || (Index > sizeof(DEVICECAPS) - sizeof(WORD)))
{
return 0;
}
DPRINT("(%04x,%d): returning %d\n",
hDC, Index, *(WORD *)(((char *)dc->w.devCaps) + Index));
ret = *(WORD *)(((char *)dc->w.devCaps) + Index);
DPRINT("(%04x,%d): returning %d\n", hDC, Index, ret);
DC_ReleasePtr( hDC );
return ret;
@ -1183,10 +1350,6 @@ static void W32kSetDCState16(HDC hDC, HDC hDCSave)
dc->w.flags = dcs->w.flags & ~DC_SAVED;
#if 0
dc->w.devCaps = dcs->w.devCaps;
#endif
dc->w.hFirstBitmap = dcs->w.hFirstBitmap;
#if 0

View file

@ -22,7 +22,7 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
if (!(dc = (PDC)AccessUserObject(hDC))) return 0;
if (!(palette = (PPALOBJ)AccessUserObject(dc->DevInfo.hpalDefault)))
if (!(palette = (PPALOBJ)AccessUserObject(dc->DevInfo->hpalDefault)))
{
// GDI_ReleaseObj( hdc );
return 0;
@ -48,7 +48,7 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
Entries = 0;
}
// GDI_ReleaseObj(dc->DevInfo.hpalDefault);
// GDI_ReleaseObj(dc->DevInfo->hpalDefault);
// GDI_ReleaseObj(hdc);
return Entries;
@ -125,9 +125,9 @@ INT STDCALL W32kSetDIBits(HDC hDC,
SourceSurf = (PSURFOBJ)AccessUserObject(SourceBitmap);
// Destination palette obtained from the hDC
hDCPalette = (PPALGDI)AccessInternalObject(dc->DevInfo.hpalDefault);
hDCPalette = (PPALGDI)AccessInternalObject(dc->DevInfo->hpalDefault);
DDB_Palette_Type = hDCPalette->Mode;
DDB_Palette = dc->DevInfo.hpalDefault;
DDB_Palette = dc->DevInfo->hpalDefault;
// Source palette obtained from the BITMAPINFO
DIB_Palette = BuildDIBPalette(bmi, &DIB_Palette_Type);
@ -695,7 +695,7 @@ RGBQUAD *DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi)
DWORD *lpIndex;
PPALOBJ palObj;
palObj = AccessUserObject(dc->DevInfo.hpalDefault);
palObj = AccessUserObject(dc->DevInfo->hpalDefault);
if (palObj == NULL) {
// RELEASEDCINFO(hDC);