((PDC) GDIOBJ_HandleToPtr ((HGDIOBJ) hDC, GO_DC_MAGIC))
#define DC_LockDC(hDC) GDIOBJ_LockObject ((HGDIOBJ) hDC)
#define DC_UnlockDC(hDC) GDIOBJ_UnlockObject ((HGDIOBJ) hDC)
+HDC RetrieveDisplayHDC(VOID);
PDC DC_AllocDC(LPCWSTR Driver);
void DC_InitDC(PDC DCToInit);
PDC DC_FindOpenDC(LPCWSTR Driver);
RECTL TempRect;
SIZEL TempSize;
- if(Source != NULL) SourceGDI = AccessInternalObjectFromUserObject(Source);
- if(Dest != NULL) DestGDI = AccessInternalObjectFromUserObject(Dest);
+ if(Source != NULL) SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
+ if(Dest != NULL) DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest);
MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
hTemp = EngCreateBitmap(TempSize,
DIB_GetDIBWidthBytes(DestRect->right - DestRect->left, BitsPerFormat(Dest->iBitmapFormat)),
Dest->iBitmapFormat, 0, NULL);
- TempSurf = AccessUserObject(hTemp);
+ TempSurf = (PSURFOBJ)AccessUserObject(hTemp);
// FIXME: Skip creating a TempSurf if we have the same BPP and palette
EngBitBlt(TempSurf, Source, NULL, NULL, ColorTranslation, &TempRect, SourcePoint, NULL, NULL, NULL, 0);
CLIPOBJ *ClipObj;
CLIPGDI *ClipGDI;
- ClipObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), NULL);
- ClipGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPGDI), NULL);
+ ClipObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), 0);
+ ClipGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPGDI), 0);
NewClip = CreateGDIHandle(ClipGDI, ClipObj);
VOID EngDeleteClipRegion(CLIPOBJ *ClipObj)
{
HCLIP HClip = AccessHandleFromUserObject(ClipObj);
- CLIPGDI *ClipGDI = AccessInternalObject(HClip);
+ CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObject(HClip);
EngFreeMem(ClipGDI);
EngFreeMem(ClipObj);
VOID EngIntersectClipRegion(CLIPOBJ *ClipObj, ULONG NumRects, RECTL *IntersectRects)
{
- CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
+ CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
ClipGDI->NumIntersectRects = NumRects;
ClipGDI->IntersectRects = IntersectRects;
CLIPOBJ *EngCreateClip(VOID)
{
- return EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), NULL);
+ return EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), 0);
}
VOID EngDeleteClip(CLIPOBJ *ClipRegion)
IN ULONG ClipType, IN ULONG BuildOrder,
IN ULONG MaxRects)
{
- CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
+ CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
ClipGDI->EnumPos = 0;
ClipGDI->EnumRects.c = MaxRects;
BOOL CLIPOBJ_bEnum(IN PCLIPOBJ ClipObj, IN ULONG ObjSize,
OUT ULONG *EnumRects)
{
- CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
+ CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
ClipGDI->EnumPos++;
PFN_DIB_HLine DIB_HLine;
PFN_DIB_VLine DIB_VLine;
- SurfGDI = AccessInternalObjectFromUserObject(Surface);
+ SurfGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
MouseSafetyOnDrawStart(Surface, SurfGDI, x1, y1, x2, y2);
LONG mouse_cx = 0, mouse_cy = 0;
HDC hDC = RetrieveDisplayHDC();
PDC dc = DC_HandleToPtr(hDC);
- PSURFOBJ SurfObj = AccessUserObject(dc->Surface);
- PSURFGDI SurfGDI = AccessInternalObject(dc->Surface);
+ PSURFOBJ SurfObj = (PSURFOBJ)AccessUserObject(dc->Surface);
+ PSURFGDI SurfGDI = (PSURFGDI)AccessInternalObject(dc->Surface);
RECTL MouseRect;
PDEVICE_OBJECT ClassDeviceObject = NULL;
void TestMouse()
{
- HDC hDC = RetrieveDisplayHDC(RetrieveDisplayHDC());
+ HDC hDC = RetrieveDisplayHDC();
PDC dc = DC_HandleToPtr(hDC);
- PSURFOBJ SurfObj = AccessUserObject(dc->Surface);
- PSURFGDI SurfGDI = AccessInternalObject(dc->Surface);
+ PSURFOBJ SurfObj = (PSURFOBJ)AccessUserObject(dc->Surface);
+ PSURFGDI SurfGDI = (PSURFGDI)AccessInternalObject(dc->Surface);
BOOL txt;
int i;
MouseSize.cx = 16;
MouseSize.cy = 16;
hMouseSurf = EngCreateBitmap(MouseSize, 16, BMF_4BPP, 0, NULL);
- MouseSurf = AccessUserObject(hMouseSurf);
+ MouseSurf = (PSURFOBJ)AccessUserObject(hMouseSurf);
// Capture the cursor we drew in the mouse cursor buffer
ZeroPoint.x = 0;
ULONG x, y, LineWidth, leftOfBitmap;
SURFGDI *SurfaceGDI;
- SurfaceGDI = AccessInternalObjectFromUserObject(Surface);
+ SurfaceGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
LineWidth = Dimensions->right - Dimensions->left;
for (y = Dimensions->top; y < Dimensions->bottom; y++)
SURFGDI *SurfGDI;
// Is the surface's Paint function hooked?
- SurfGDI = AccessInternalObjectFromUserObject(Surface);
+ SurfGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
// FIXME: Perform Mouse Safety on the given ClipRegion
// MouseSafetyOnDrawStart(Surface, SurfGDI, x1, y1, x2, y2);
PALOBJ *PalObj;
PALGDI *PalGDI;
- PalObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALOBJ), NULL);
- PalGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALGDI), NULL);
+ PalObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALOBJ), 0);
+ PalGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALGDI), 0);
- NewPalette = CreateGDIHandle(PalGDI, PalObj);
+ NewPalette = (HPALETTE)CreateGDIHandle(PalGDI, PalObj);
PalGDI->Mode = Mode;
PALOBJ *PalObj;
PALGDI *PalGDI;
- PalGDI = AccessInternalObject(Palette);
- PalObj = AccessUserObject(Palette);
+ PalGDI = (PALGDI*)AccessInternalObject(Palette);
+ PalObj = (PALOBJ*)AccessUserObject(Palette);
EngFreeMem(PalGDI);
EngFreeMem(PalObj);
ULONG i, entry;
PALGDI *PalGDI;
- PalGDI = AccessInternalObjectFromUserObject(PalObj);
+ PalGDI = (PALGDI*)AccessInternalObjectFromUserObject(PalObj);
for(i=Start; i<Colors; i++)
{
SURFOBJ *SurfObj;
SURFGDI *SurfGDI;
- SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
- SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), NULL);
+ SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), 0);
+ SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), 0);
- NewSurface = CreateGDIHandle(SurfGDI, SurfObj);
+ NewSurface = (HSURF)CreateGDIHandle(SurfGDI, SurfObj);
InitializeHooks(SurfGDI);
SURFOBJ *SurfObj;
SURFGDI *SurfGDI;
- SurfGDI = AccessInternalObject(Surface);
- SurfObj = AccessUserObject(Surface);
+ SurfGDI = (SURFGDI*)AccessInternalObject(Surface);
+ SurfObj = (SURFOBJ*)AccessUserObject(Surface);
EngFreeMem(SurfGDI);
EngFreeMem(SurfObj);
SURFOBJ *EngLockSurface(HSURF Surface)
{
// FIXME: Call GDI_LockObject (see subsys/win32k/objects/gdi.c)
- return AccessUserObject(Surface);
+ return (SURFOBJ*)AccessUserObject(Surface);
}
PRECTL DestRect, PRECTL SourceRect,
ULONG TransparentColor, ULONG Reserved)
{
- PSURFGDI DestGDI = AccessInternalObjectFromUserObject(Dest),
- SourceGDI = AccessInternalObjectFromUserObject(Source);
+ PSURFGDI DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest),
+ SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
HSURF hTemp;
PSURFOBJ TempSurf;
POINTL TempPoint, SourcePoint;
hTemp = EngCreateBitmap(TempSize,
DIB_GetDIBWidthBytes(dx, BitsPerFormat(Dest->iBitmapFormat)), Dest->iBitmapFormat, 0, NULL);
- TempSurf = AccessUserObject(hTemp);
+ TempSurf = (PSURFOBJ)AccessUserObject(hTemp);
SourcePoint.x = SourceRect->left;
SourcePoint.y = SourceRect->top;
PALGDI *SourcePalGDI, *DestPalGDI;
ULONG IndexedColors;
- XlateObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEOBJ), NULL);
- XlateGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEGDI), NULL);
+ XlateObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEOBJ), 0);
+ XlateGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEGDI), 0);
- NewXlate = CreateGDIHandle(XlateGDI, XlateObj);
+ NewXlate = (HPALETTE)CreateGDIHandle(XlateGDI, XlateObj);
- if(SourcePalType == PAL_INDEXED) SourcePalGDI = AccessInternalObject(PaletteSource);
- if(DestPalType == PAL_INDEXED) DestPalGDI = AccessInternalObject(PaletteDest);
+ if(SourcePalType == PAL_INDEXED) SourcePalGDI = (PALGDI*)AccessInternalObject(PaletteSource);
+ if(DestPalType == PAL_INDEXED) DestPalGDI = (PALGDI*)AccessInternalObject(PaletteDest);
XlateObj->iSrcType = SourcePalType;
XlateObj->iDstType = DestPalType;
else if (SourcePalType == PAL_INDEXED) { IndexedColors = SourcePalGDI->NumColors; }
else if (DestPalType == PAL_INDEXED) { IndexedColors = DestPalGDI->NumColors; }
- XlateGDI->translationTable = EngAllocMem(FL_ZERO_MEMORY, sizeof(ULONG)*IndexedColors, NULL);
+ XlateGDI->translationTable = EngAllocMem(FL_ZERO_MEMORY, sizeof(ULONG)*IndexedColors, 0);
}
// Source palette is indexed
EngDeleteXlate(XLATEOBJ *XlateObj)
{
- HPALETTE HXlate = AccessHandleFromUserObject(XlateObj);
- XLATEGDI *XlateGDI = AccessInternalObject(HXlate);
+ HPALETTE HXlate = (HPALETTE)AccessHandleFromUserObject(XlateObj);
+ XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObject(HXlate);
if(XlateGDI->translationTable!=NULL)
{
ULONG *XLATEOBJ_piVector(XLATEOBJ *XlateObj)
{
- XLATEGDI *XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
+ XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
if(XlateObj->iSrcType == PAL_INDEXED)
{
ULONG XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color)
{
PALGDI *PalGDI;
- XLATEGDI *XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
+ XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
if(XlateObj->flXlate & XO_TRIVIAL)
{
// FIXME: won't work if destination isn't indexed
// Extract the destination palette
- PalGDI = AccessInternalObject(XlateGDI->DestPal);
+ PalGDI = (PALGDI*)AccessInternalObject(XlateGDI->DestPal);
// Return closest match for the given RGB color
return ClosestColorMatch(Color, PalGDI->IndexedColors, PalGDI->NumColors);
XLATEGDI *XlateGDI;
PALGDI *PalGDI;
- XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
+ XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
if(PalOutType == XO_SRCPALETTE)
{
HPal = XlateGDI->DestPal;
}
- PalGDI = AccessInternalObject(HPal);
+ PalGDI = (PALGDI*)AccessInternalObject(HPal);
RtlCopyMemory(OutPal, PalGDI->IndexedColors, sizeof(ULONG)*cPal);
return i;
SurfSrcAlloc = FALSE;
// Determine surfaces to be used in the bitblt
- SurfDest = AccessUserObject(DCDest->Surface);
- SurfSrc = AccessUserObject(DCSrc->Surface);
+ SurfDest = (PSURFOBJ)AccessUserObject(DCDest->Surface);
+ SurfSrc = (PSURFOBJ)AccessUserObject(DCSrc->Surface);
- SurfGDIDest = AccessInternalObjectFromUserObject(SurfDest);
- SurfGDISrc = AccessInternalObjectFromUserObject(SurfSrc);
+ SurfGDIDest = (PSURFGDI)AccessInternalObjectFromUserObject(SurfDest);
+ SurfGDISrc = (PSURFGDI)AccessInternalObjectFromUserObject(SurfSrc);
// Retrieve the logical palette of the destination DC
- DCLogPal = AccessUserObject(DCDest->w.hPalette);
+ DCLogPal = (PPALOBJ)AccessUserObject(DCDest->w.hPalette);
if(DCLogPal)
if(DCLogPal->logicalToSystem)
} else
SourcePalette = W32kGetStockObject(DEFAULT_PALETTE);
- PalDestGDI = AccessInternalObject(DestPalette);
- PalSourceGDI = AccessInternalObject(SourcePalette);
+ PalDestGDI = (PPALGDI)AccessInternalObject(DestPalette);
+ PalSourceGDI = (PPALGDI)AccessInternalObject(SourcePalette);
- XlateObj = EngCreateXlate(PalDestGDI->Mode, PalSourceGDI->Mode, DestPalette, SourcePalette);
+ XlateObj = (PXLATEOBJ)EngCreateXlate(PalDestGDI->Mode, PalSourceGDI->Mode, DestPalette, SourcePalette);
}
// Perform the bitblt operation
const PALETTEENTRY* COLOR_GetSystemPaletteTemplate(void)
{
- return &COLOR_sysPalTemplate;
+ return (const PALETTEENTRY*)&COLOR_sysPalTemplate;
}
BOOL STDCALL W32kAnimatePalette(HPALETTE hpal,
{
PPALOBJ PalObj;
- HPALETTE NewPalette = EngCreatePalette(PAL_INDEXED, palette->palNumEntries, palette->palPalEntry, 0, 0, 0);
+ HPALETTE NewPalette = (HPALETTE)EngCreatePalette(PAL_INDEXED, palette->palNumEntries, palette->palPalEntry, 0, 0, 0);
ULONG size;
- PalObj = AccessUserObject(NewPalette);
+ PalObj = (PPALOBJ)AccessUserObject(NewPalette);
size = sizeof(LOGPALETTE) + (palette->palNumEntries * sizeof(PALETTEENTRY));
PalObj->logpalette = ExAllocatePool(NonPagedPool, size);
if(DC_HandleToPtr(hDC))
{
HPALETTE hpal = (dc->w.hPalette)? dc->w.hPalette : W32kGetStockObject(DEFAULT_PALETTE);
- palObj = AccessUserObject(hpal);
+ palObj = (PPALOBJ)AccessUserObject(hpal);
if (!palObj) {
// GDI_ReleaseObj(hdc);
return nearest;
UINT STDCALL W32kGetNearestPaletteIndex(HPALETTE hpal,
COLORREF Color)
{
- PPALOBJ palObj = AccessUserObject(hpal);
+ PPALOBJ palObj = (PPALOBJ)AccessUserObject(hpal);
UINT index = 0;
if( palObj )
PPALOBJ palPtr;
UINT numEntries;
- palPtr = AccessUserObject(hpal);
+ palPtr = (PPALOBJ)AccessUserObject(hpal);
if (!palPtr) return 0;
numEntries = palPtr->logpalette->palNumEntries;
PPALOBJ palPtr, sysPtr;
PPALGDI palGDI, sysGDI;
int realized = 0;
- PDC dc = AccessUserObject(hDC);
+ PDC dc = (PDC)AccessUserObject(hDC);
HPALETTE systemPalette;
PSURFGDI SurfGDI;
BOOLEAN success;
if (!dc) return 0;
- palPtr = AccessUserObject(dc->w.hPalette);
- SurfGDI = AccessInternalObjectFromUserObject(dc->Surface);
+ palPtr = (PPALOBJ)AccessUserObject(dc->w.hPalette);
+ SurfGDI = (PSURFGDI)AccessInternalObjectFromUserObject(dc->Surface);
systemPalette = W32kGetStockObject(STOCK_DEFAULT_PALETTE);
- sysPtr = AccessInternalObject(systemPalette);
- palGDI = AccessInternalObject(dc->w.hPalette);
- sysGDI = AccessInternalObject(systemPalette);
+ sysPtr = (PPALOBJ)AccessInternalObject(systemPalette);
+ palGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
+ sysGDI = (PPALGDI)AccessInternalObject(systemPalette);
// Step 1: Create mapping of system palette\DC palette
realized = PALETTE_SetMapping(palPtr, 0, palPtr->logpalette->palNumEntries,
HPALETTE hpal,
BOOL ForceBackground)
{
- PDC dc = AccessUserObject(hDC);
+ PDC dc = (PDC)AccessUserObject(hDC);
HPALETTE oldPal;
oldPal = dc->w.hPalette;
PPALOBJ palPtr;
INT numEntries;
- palPtr = AccessUserObject(hpal);
+ palPtr = (PPALOBJ)AccessUserObject(hpal);
if (!palPtr) return 0;
numEntries = palPtr->logpalette->palNumEntries;
{
unsigned char spec_type = color >> 24;
int i;
- PALETTEENTRY *COLOR_sysPal = ReturnSystemPalette();
+ PALETTEENTRY *COLOR_sysPal = (PALETTEENTRY*)ReturnSystemPalette();
// we need logical palette for PALETTERGB and PALETTEINDEX colorrefs
-/* $Id: dc.c,v 1.22 2001/05/26 08:15:40 jfilby Exp $
+/* $Id: dc.c,v 1.23 2001/06/25 09:30:06 ekohl Exp $
*
* DC.C - Device context functions
*
// ----------------------------------------------------- Public Functions
-HDC RetrieveDisplayHDC()
+HDC RetrieveDisplayHDC(VOID)
{
return hDISPLAY_DC;
}
NewDC->Surface = NewDC->DriverFunctions.EnableSurface(NewDC->PDev); // hsurf
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
- SurfObj = AccessUserObject(NewDC->Surface);
+ SurfObj = (PSURFOBJ)AccessUserObject(NewDC->Surface);
SurfObj->dhpdev = NewDC->PDev;
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
W32kSetTextAlign(hNewDC, TA_BASELINE);
// If we've created a DC for the DISPLAY, save the reference for later CreateCompatibleDC(NULL... usage
- if(wcscmp(Driver, "DISPLAY")) // FIXME: this works.. but shouldn't we compare to L"DISPLAY" ? (which doesn't work..)
+ if(wcscmp(Driver, L"DISPLAY")) // FIXME: this works.. but shouldn't we compare to L"DISPLAY" ? (which doesn't work..)
{
hDISPLAY_DC = hNewDC;
}
dc->w.hPen = hGDIObj;
// Convert the color of the pen to the format of the DC
- PalGDI = AccessInternalObject(dc->w.hPalette);
- XlateObj = EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
+ PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
+ XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
pen = GDIOBJ_HandleToPtr(dc->w.hPen, GO_PEN_MAGIC);
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
break;
{
/* FIXME: This is just a hack to return the pointer to the DISPLAY DC.. must cater for others too! */
- if(wcscmp(Driver, "DISPLAY"))
+ if(wcscmp(Driver, L"DISPLAY"))
{
return DC_HandleToPtr(hDISPLAY_DC);
}
PPALOBJ palette;
RGBQUAD *end;
- if (!(dc = AccessUserObject(hDC))) return 0;
+ if (!(dc = (PDC)AccessUserObject(hDC))) return 0;
- if (!(palette = AccessUserObject(dc->DevInfo.hpalDefault)))
+ if (!(palette = (PPALOBJ)AccessUserObject(dc->DevInfo.hpalDefault)))
{
// GDI_ReleaseObj( hdc );
return 0;
// Create a temporary surface for the destination bitmap
DestSurf = ExAllocatePool(PagedPool, sizeof(SURFOBJ));
DestGDI = ExAllocatePool(PagedPool, sizeof(SURFGDI));
- DestBitmap = CreateGDIHandle(DestGDI, DestSurf);
+ DestBitmap = (HBITMAP)CreateGDIHandle(DestGDI, DestSurf);
BitmapToSurf(hDC, DestGDI, DestSurf, bitmap);
SourceBitmap = EngCreateBitmap(SourceSize, DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount),
BitmapFormat(bmi->bmiHeader.biBitCount, bmi->bmiHeader.biCompression),
0, Bits);
- SourceSurf = AccessUserObject(SourceBitmap);
+ SourceSurf = (PSURFOBJ)AccessUserObject(SourceBitmap);
// Destination palette obtained from the hDC
- hDCPalette = AccessInternalObject(dc->DevInfo.hpalDefault);
+ hDCPalette = (PPALGDI)AccessInternalObject(dc->DevInfo.hpalDefault);
DDB_Palette_Type = hDCPalette->Mode;
DDB_Palette = dc->DevInfo.hpalDefault;
int BottomRect)
{
DC *dc = DC_HandleToPtr(hDC);
- SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
+ SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
PBRUSHOBJ BrushObj;
BOOL ret;
PRECTL RectBounds = GDIOBJ_HandleToPtr(dc->w.hGCClipRgn, GO_REGION_MAGIC);
ret = PATH_Rectangle(hDC, LeftRect, TopRect, RightRect, BottomRect);
} else {
// Draw the rectangle with the current pen
- BrushObj = PenToBrushObj(dc, GDIOBJ_HandleToPtr(dc->w.hPen, GO_PEN_MAGIC));
+ BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, GDIOBJ_HandleToPtr(dc->w.hPen, GO_PEN_MAGIC));
ret = EngLineTo(SurfObj,
NULL, // ClipObj,
/*
* GDIOBJ.C - GDI object manipulation routines
*
- * $Id: gdiobj.c,v 1.9 2001/06/12 17:50:29 chorns Exp $
+ * $Id: gdiobj.c,v 1.10 2001/06/25 09:30:06 ekohl Exp $
*
*/
StockObjects[SYSTEM_FIXED_FONT] = W32kCreateFontIndirect(&SystemFixedFont);
StockObjects[DEFAULT_GUI_FONT] = W32kCreateFontIndirect(&DefaultGuiFont);
- StockObjects[DEFAULT_PALETTE] = PALETTE_Init();
+ StockObjects[DEFAULT_PALETTE] = (HGDIOBJ*)PALETTE_Init();
}
HGDIOBJ STDCALL W32kGetStockObject(INT Object)
int YEnd)
{
DC *dc = DC_HandleToPtr(hDC);
- SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
+ SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
BOOL ret;
if(!dc) return FALSE;
HPALETTE hpalette;
PLOGPALETTE palPtr;
PPALOBJ palObj;
- const PALETTEENTRY* __sysPalTemplate = COLOR_GetSystemPaletteTemplate();
+ const PALETTEENTRY* __sysPalTemplate = (const PALETTEENTRY*)COLOR_GetSystemPaletteTemplate();
// create default palette (20 system colors)
palPtr = ExAllocatePool(NonPagedPool, sizeof(LOGPALETTE) + (NB_RESERVED_COLORS * sizeof(PALETTEENTRY)));
hpalette = W32kCreatePalette(palPtr);
ExFreePool(palPtr);
- palObj = AccessUserObject(hpalette);
+ palObj = (PPALOBJ)AccessUserObject(hpalette);
if (palObj)
{
if (!(palObj->mapping = ExAllocatePool(NonPagedPool, sizeof(int) * 20)))
RtlInitAnsiString(&StringA, (LPSTR)face->family_name);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
FontTable[FontsLoaded].FaceName = ExAllocatePool(NonPagedPool, (StringU.Length + 1) * 2);
- wcscpy(FontTable[FontsLoaded].FaceName, StringU.Buffer);
+ wcscpy((LPWSTR)FontTable[FontsLoaded].FaceName, StringU.Buffer);
RtlFreeUnicodeString(&StringU);
FontsLoaded++;
int Count,
LPSIZE Size)
{
- PDC dc = AccessUserObject(hDC);
+ PDC dc = (PDC)AccessUserObject(hDC);
PFONTGDI FontGDI;
FT_Face face;
FT_GlyphSlot glyph;
INT error, pitch, glyph_index, i;
ULONG TotalWidth = 0, MaxHeight = 0, CurrentChar = 0, SpaceBetweenChars = 5;
- FontGDI = AccessInternalObject(dc->w.hFont);
+ FontGDI = (PFONTGDI)AccessInternalObject(dc->w.hFont);
for(i=0; i<Count; i++)
{
CurrentChar++;
- if(CurrentChar < Size) TotalWidth += SpaceBetweenChars;
+ if(CurrentChar < Size->cx) TotalWidth += SpaceBetweenChars;
String++;
}
W32kGetTextMetrics(HDC hDC,
LPTEXTMETRIC tm)
{
- PDC dc = AccessUserObject(hDC);
+ PDC dc = (PDC)AccessUserObject(hDC);
PFONTGDI FontGDI;
- FontGDI = AccessInternalObject(dc->w.hFont);
+ FontGDI = (PFONTGDI)AccessInternalObject(dc->w.hFont);
memcpy(tm, &FontGDI->TextMetric, sizeof(TEXTMETRIC));
return TRUE;
// Fixme: Call EngTextOut, which does the real work (calling DrvTextOut where appropriate)
DC *dc = DC_HandleToPtr(hDC);
- SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
+ SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
int error, glyph_index, n, load_flags = FT_LOAD_RENDER, i, j, sx, sy, scc;
FT_Face face;
FT_GlyphSlot glyph;
return FALSE;
}
- FontObj = AccessUserObject(hFont);
- FontGDI = AccessInternalObject(hFont);
+ FontObj = (PFONTOBJ)AccessUserObject(hFont);
+ FontGDI = (PFONTGDI)AccessInternalObject(hFont);
face = FontGDI->face;
if (face->charmap == NULL)
}
// Create the brush
- PalDestGDI = AccessInternalObject(dc->w.hPalette);
- XlateObj = EngCreateXlate(PalDestGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
+ PalDestGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
+ XlateObj = (PXLATEOBJ)EngCreateXlate(PalDestGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
hBrush = W32kCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor));
Brush = BRUSHOBJ_HandleToPtr(hBrush);
EngDeleteXlate(XlateObj);
// Then use memset with 0 to clear it and sourcerect to limit the work of the transbitblt
HSourceGlyph = EngCreateBitmap(bitSize, pitch, BMF_1BPP, 0, glyph->bitmap.buffer);
- SourceGlyphSurf = AccessUserObject(HSourceGlyph);
+ SourceGlyphSurf = (PSURFOBJ)AccessUserObject(HSourceGlyph);
// Use the font data as a mask to paint onto the DCs surface using a brush
EngBitBlt(SurfObj, NULL, SourceGlyphSurf, NULL, NULL, &DestRect, &SourcePoint, &MaskRect, Brush, &BrushOrigin, 0xAACC);
STUB(BRUSHOBJ_ulGetBrushColor)
STUB(CLIPOBJ_ppoGetPath)
STUB(EngAcquireSemaphore)
-STUB(EngAllocMem)
-STUB(EngAllocUserMem)
STUB(EngCheckAbort)
STUB(EngComputeGlyphSet)
STUB(EngCreateDriverObj)
STUB(EngFindImageProcAddress)
STUB(EngFindResource)
STUB(EngFreeModule)
-STUB(EngFreeUserMem)
STUB(EngGetCurrentCodePage)
STUB(EngGetDriverName)
STUB(EngGetFileChangeTime)