-/* $Id: dc.c,v 1.37 2002/09/07 15:13:12 chorns Exp $
+/* $Id: dc.c,v 1.38 2002/09/08 10:23:52 chorns Exp $
*
* DC.C - Device context functions
*
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
-#define NTOS_KERNEL_MODE
-#include <ntos.h>
-#include <ddk/ntddvdeo.h>
+#include <ddk/ntddk.h>
#include <win32k/bitmaps.h>
#include <win32k/coord.h>
/* FIXME: DCs should probably be thread safe */
-#define DDI_DRIVER_VERSION 0x00010000
/*
* DC device-independent Get/SetXXX functions
* (RJJ) swiped from WINE
return prevMode; \
}
-VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, SURFOBJ *SurfObj, PBITMAPOBJ Bitmap);
+VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, PSURFOBJ SurfObj, PBITMAPOBJ Bitmap);
// --------------------------------------------------------- File Statics
return hNewDC;
}
+#include <ddk/ntddvid.h>
+
HDC STDCALL W32kCreateDC(LPCWSTR Driver,
LPCWSTR Device,
LPCWSTR Output,
PDC NewDC;
HDC hDC = NULL;
DRVENABLEDATA DED;
- SURFOBJ *SurfObj;
+ PSURFOBJ SurfObj;
/* Check for existing DC object */
if ((hNewDC = DC_FindOpenDC(Driver)) != NULL)
NewDC->Surface = NewDC->DriverFunctions.EnableSurface(NewDC->PDev); // hsurf
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
- SurfObj = (SURFOBJ*)AccessUserObject(NewDC->Surface);
+ SurfObj = (PSURFOBJ)AccessUserObject(NewDC->Surface);
SurfObj->dhpdev = NewDC->PDev;
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
{
- ROS_BRUSHOBJ *brush;
HGDIOBJ objOrg;
BITMAPOBJ *pb;
- SURFOBJ *surfobj;
+ PSURFOBJ surfobj;
PSURFGDI surfgdi;
PDC dc;
PPENOBJ pen;
- XLATEOBJ *XlateObj;
+ PBRUSHOBJ brush;
+ PXLATEOBJ XlateObj;
PPALGDI PalGDI;
WORD objectMagic;
// Convert the color of the pen to the format of the DC
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
if( PalGDI ){
- XlateObj = (XLATEOBJ*)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
+ XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
// Convert the color of the brush to the format of the DC
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
if( PalGDI ){
- XlateObj = (XLATEOBJ*)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
- brush = (ROS_BRUSHOBJ *)GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
+ XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
+ brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj,
brush->logbrush.lbColor);
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
pb = BITMAPOBJ_HandleToPtr (hGDIObj);
dc->w.hBitmap = CreateGDIHandle(sizeof( SURFGDI ), sizeof( SURFOBJ )); // Assign the DC's bitmap
- surfobj = (SURFOBJ*) AccessUserObject( dc->w.hBitmap );
+ surfobj = (PSURFOBJ) AccessUserObject( dc->w.hBitmap );
surfgdi = (PSURFGDI) AccessInternalObject( dc->w.hBitmap );
BitmapToSurf(hDC, surfgdi, surfobj, pb); // Put the bitmap in a surface