mirror of
https://github.com/reactos/reactos.git
synced 2024-08-21 10:53:15 +00:00
Fixed a lot of warnings.
svn path=/trunk/; revision=2007
This commit is contained in:
parent
4a45379380
commit
b9689b04fa
|
@ -146,6 +146,7 @@ typedef struct _DC
|
|||
((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);
|
||||
|
|
|
@ -57,8 +57,8 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
|
|||
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)),
|
||||
|
@ -96,7 +96,7 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
|
|||
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);
|
||||
|
|
|
@ -22,8 +22,8 @@ CLIPOBJ *EngCreateClipRegion(ULONG NumRects, RECTL Rects[],
|
|||
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);
|
||||
|
||||
|
@ -58,7 +58,7 @@ CLIPOBJ *EngCreateClipRegion(ULONG NumRects, RECTL Rects[],
|
|||
VOID EngDeleteClipRegion(CLIPOBJ *ClipObj)
|
||||
{
|
||||
HCLIP HClip = AccessHandleFromUserObject(ClipObj);
|
||||
CLIPGDI *ClipGDI = AccessInternalObject(HClip);
|
||||
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObject(HClip);
|
||||
|
||||
EngFreeMem(ClipGDI);
|
||||
EngFreeMem(ClipObj);
|
||||
|
@ -67,7 +67,7 @@ VOID EngDeleteClipRegion(CLIPOBJ *ClipObj)
|
|||
|
||||
VOID EngIntersectClipRegion(CLIPOBJ *ClipObj, ULONG NumRects, RECTL *IntersectRects)
|
||||
{
|
||||
CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
|
||||
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
|
||||
|
||||
ClipGDI->NumIntersectRects = NumRects;
|
||||
ClipGDI->IntersectRects = IntersectRects;
|
||||
|
@ -85,7 +85,7 @@ VOID EngIntersectClipRegion(CLIPOBJ *ClipObj, ULONG NumRects, RECTL *IntersectRe
|
|||
|
||||
CLIPOBJ *EngCreateClip(VOID)
|
||||
{
|
||||
return EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), NULL);
|
||||
return EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), 0);
|
||||
}
|
||||
|
||||
VOID EngDeleteClip(CLIPOBJ *ClipRegion)
|
||||
|
@ -97,7 +97,7 @@ ULONG CLIPOBJ_cEnumStart(IN PCLIPOBJ ClipObj, IN BOOL ShouldDoAll,
|
|||
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;
|
||||
|
@ -114,7 +114,7 @@ ULONG CLIPOBJ_cEnumStart(IN PCLIPOBJ ClipObj, IN BOOL ShouldDoAll,
|
|||
BOOL CLIPOBJ_bEnum(IN PCLIPOBJ ClipObj, IN ULONG ObjSize,
|
||||
OUT ULONG *EnumRects)
|
||||
{
|
||||
CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
|
||||
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
|
||||
|
||||
ClipGDI->EnumPos++;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ BOOL EngLineTo(SURFOBJ *Surface, CLIPOBJ *Clip, BRUSHOBJ *Brush,
|
|||
PFN_DIB_HLine DIB_HLine;
|
||||
PFN_DIB_VLine DIB_VLine;
|
||||
|
||||
SurfGDI = AccessInternalObjectFromUserObject(Surface);
|
||||
SurfGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
|
||||
|
||||
MouseSafetyOnDrawStart(Surface, SurfGDI, x1, y1, x2, y2);
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ VOID MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount)
|
|||
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;
|
||||
|
@ -134,10 +134,10 @@ NTSTATUS ConnectMouseClassDriver()
|
|||
|
||||
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;
|
||||
|
||||
|
@ -181,7 +181,7 @@ void TestMouse()
|
|||
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;
|
||||
|
|
|
@ -18,7 +18,7 @@ BOOL FillSolid(SURFOBJ *Surface, PRECTL Dimensions, ULONG iColor)
|
|||
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++)
|
||||
|
@ -72,7 +72,7 @@ BOOL EngPaint(IN SURFOBJ *Surface, IN CLIPOBJ *ClipRegion,
|
|||
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);
|
||||
|
|
|
@ -22,10 +22,10 @@ HPALETTE EngCreatePalette(ULONG Mode,
|
|||
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;
|
||||
|
||||
|
@ -55,8 +55,8 @@ BOOL EngDeletePalette(IN HPALETTE Palette)
|
|||
PALOBJ *PalObj;
|
||||
PALGDI *PalGDI;
|
||||
|
||||
PalGDI = AccessInternalObject(Palette);
|
||||
PalObj = AccessUserObject(Palette);
|
||||
PalGDI = (PALGDI*)AccessInternalObject(Palette);
|
||||
PalObj = (PALOBJ*)AccessUserObject(Palette);
|
||||
|
||||
EngFreeMem(PalGDI);
|
||||
EngFreeMem(PalObj);
|
||||
|
@ -71,7 +71,7 @@ ULONG PALOBJ_cGetColors(PALOBJ *PalObj, ULONG Start, ULONG Colors,
|
|||
ULONG i, entry;
|
||||
PALGDI *PalGDI;
|
||||
|
||||
PalGDI = AccessInternalObjectFromUserObject(PalObj);
|
||||
PalGDI = (PALGDI*)AccessInternalObjectFromUserObject(PalObj);
|
||||
|
||||
for(i=Start; i<Colors; i++)
|
||||
{
|
||||
|
|
|
@ -131,10 +131,10 @@ HSURF EngCreateDeviceSurface(DHSURF dhsurf, SIZEL Size, ULONG Format)
|
|||
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);
|
||||
|
||||
|
@ -201,8 +201,8 @@ BOOL EngDeleteSurface(HSURF Surface)
|
|||
SURFOBJ *SurfObj;
|
||||
SURFGDI *SurfGDI;
|
||||
|
||||
SurfGDI = AccessInternalObject(Surface);
|
||||
SurfObj = AccessUserObject(Surface);
|
||||
SurfGDI = (SURFGDI*)AccessInternalObject(Surface);
|
||||
SurfObj = (SURFOBJ*)AccessUserObject(Surface);
|
||||
|
||||
EngFreeMem(SurfGDI);
|
||||
EngFreeMem(SurfObj);
|
||||
|
@ -214,5 +214,5 @@ BOOL EngDeleteSurface(HSURF Surface)
|
|||
SURFOBJ *EngLockSurface(HSURF Surface)
|
||||
{
|
||||
// FIXME: Call GDI_LockObject (see subsys/win32k/objects/gdi.c)
|
||||
return AccessUserObject(Surface);
|
||||
return (SURFOBJ*)AccessUserObject(Surface);
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ BOOL EngTransparentBlt(PSURFOBJ Dest, PSURFOBJ Source,
|
|||
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;
|
||||
|
@ -56,7 +56,7 @@ BOOL EngTransparentBlt(PSURFOBJ Dest, PSURFOBJ Source,
|
|||
|
||||
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;
|
||||
|
|
|
@ -105,13 +105,13 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
|||
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;
|
||||
|
@ -146,7 +146,7 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
|||
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
|
||||
|
@ -191,8 +191,8 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
|||
|
||||
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)
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ EngDeleteXlate(XLATEOBJ *XlateObj)
|
|||
|
||||
ULONG *XLATEOBJ_piVector(XLATEOBJ *XlateObj)
|
||||
{
|
||||
XLATEGDI *XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
|
||||
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||
|
||||
if(XlateObj->iSrcType == PAL_INDEXED)
|
||||
{
|
||||
|
@ -219,7 +219,7 @@ ULONG *XLATEOBJ_piVector(XLATEOBJ *XlateObj)
|
|||
ULONG XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color)
|
||||
{
|
||||
PALGDI *PalGDI;
|
||||
XLATEGDI *XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
|
||||
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||
|
||||
if(XlateObj->flXlate & XO_TRIVIAL)
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ ULONG XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color)
|
|||
// 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);
|
||||
|
@ -252,7 +252,7 @@ ULONG XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj,
|
|||
XLATEGDI *XlateGDI;
|
||||
PALGDI *PalGDI;
|
||||
|
||||
XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
|
||||
XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||
|
||||
if(PalOutType == XO_SRCPALETTE)
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ ULONG XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj,
|
|||
HPal = XlateGDI->DestPal;
|
||||
}
|
||||
|
||||
PalGDI = AccessInternalObject(HPal);
|
||||
PalGDI = (PALGDI*)AccessInternalObject(HPal);
|
||||
RtlCopyMemory(OutPal, PalGDI->IndexedColors, sizeof(ULONG)*cPal);
|
||||
|
||||
return i;
|
||||
|
|
|
@ -44,14 +44,14 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest,
|
|||
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)
|
||||
|
@ -72,10 +72,10 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest,
|
|||
} 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
|
||||
|
|
|
@ -52,7 +52,7 @@ const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
|
|||
|
||||
const PALETTEENTRY* COLOR_GetSystemPaletteTemplate(void)
|
||||
{
|
||||
return &COLOR_sysPalTemplate;
|
||||
return (const PALETTEENTRY*)&COLOR_sysPalTemplate;
|
||||
}
|
||||
|
||||
BOOL STDCALL W32kAnimatePalette(HPALETTE hpal,
|
||||
|
@ -120,10 +120,10 @@ HPALETTE STDCALL W32kCreatePalette(CONST PLOGPALETTE palette)
|
|||
{
|
||||
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);
|
||||
|
@ -150,7 +150,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC,
|
|||
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;
|
||||
|
@ -169,7 +169,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC,
|
|||
UINT STDCALL W32kGetNearestPaletteIndex(HPALETTE hpal,
|
||||
COLORREF Color)
|
||||
{
|
||||
PPALOBJ palObj = AccessUserObject(hpal);
|
||||
PPALOBJ palObj = (PPALOBJ)AccessUserObject(hpal);
|
||||
UINT index = 0;
|
||||
|
||||
if( palObj )
|
||||
|
@ -190,7 +190,7 @@ UINT STDCALL W32kGetPaletteEntries(HPALETTE hpal,
|
|||
PPALOBJ palPtr;
|
||||
UINT numEntries;
|
||||
|
||||
palPtr = AccessUserObject(hpal);
|
||||
palPtr = (PPALOBJ)AccessUserObject(hpal);
|
||||
if (!palPtr) return 0;
|
||||
|
||||
numEntries = palPtr->logpalette->palNumEntries;
|
||||
|
@ -271,19 +271,19 @@ A logical palette is a buffer between color-intensive applications and the syste
|
|||
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,
|
||||
|
@ -365,7 +365,7 @@ HPALETTE STDCALL W32kSelectPalette(HDC hDC,
|
|||
HPALETTE hpal,
|
||||
BOOL ForceBackground)
|
||||
{
|
||||
PDC dc = AccessUserObject(hDC);
|
||||
PDC dc = (PDC)AccessUserObject(hDC);
|
||||
HPALETTE oldPal;
|
||||
|
||||
oldPal = dc->w.hPalette;
|
||||
|
@ -390,7 +390,7 @@ UINT STDCALL W32kSetPaletteEntries(HPALETTE hpal,
|
|||
PPALOBJ palPtr;
|
||||
INT numEntries;
|
||||
|
||||
palPtr = AccessUserObject(hpal);
|
||||
palPtr = (PPALOBJ)AccessUserObject(hpal);
|
||||
if (!palPtr) return 0;
|
||||
|
||||
numEntries = palPtr->logpalette->palNumEntries;
|
||||
|
@ -466,7 +466,7 @@ COLORREF COLOR_LookupNearestColor( PALETTEENTRY* palPalEntry, int size, COLORREF
|
|||
{
|
||||
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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $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
|
||||
*
|
||||
|
@ -87,7 +87,7 @@ static void W32kSetDCState16(HDC hDC, HDC hDCSave);
|
|||
|
||||
// ----------------------------------------------------- Public Functions
|
||||
|
||||
HDC RetrieveDisplayHDC()
|
||||
HDC RetrieveDisplayHDC(VOID)
|
||||
{
|
||||
return hDISPLAY_DC;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
|||
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);
|
||||
|
@ -308,7 +308,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
|||
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;
|
||||
}
|
||||
|
@ -939,8 +939,8 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
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;
|
||||
|
@ -1159,7 +1159,7 @@ PDC DC_FindOpenDC(LPCWSTR Driver)
|
|||
{
|
||||
/* 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);
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
|
|||
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;
|
||||
|
@ -95,7 +95,7 @@ INT STDCALL W32kSetDIBits(HDC hDC,
|
|||
// 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);
|
||||
|
||||
|
@ -105,10 +105,10 @@ INT STDCALL W32kSetDIBits(HDC hDC,
|
|||
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;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ W32kRectangle(HDC hDC,
|
|||
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);
|
||||
|
@ -89,7 +89,7 @@ W32kRectangle(HDC hDC,
|
|||
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,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* 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 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -227,7 +227,7 @@ VOID CreateStockObjects(void)
|
|||
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)
|
||||
|
|
|
@ -104,7 +104,7 @@ W32kLineTo(HDC hDC,
|
|||
int YEnd)
|
||||
{
|
||||
DC *dc = DC_HandleToPtr(hDC);
|
||||
SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
|
||||
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
|
||||
BOOL ret;
|
||||
|
||||
if(!dc) return FALSE;
|
||||
|
|
|
@ -27,7 +27,7 @@ HPALETTE PALETTE_Init(void)
|
|||
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)));
|
||||
|
@ -46,7 +46,7 @@ HPALETTE PALETTE_Init(void)
|
|||
hpalette = W32kCreatePalette(palPtr);
|
||||
ExFreePool(palPtr);
|
||||
|
||||
palObj = AccessUserObject(hpalette);
|
||||
palObj = (PPALOBJ)AccessUserObject(hpalette);
|
||||
if (palObj)
|
||||
{
|
||||
if (!(palObj->mapping = ExAllocatePool(NonPagedPool, sizeof(int) * 20)))
|
||||
|
|
|
@ -137,7 +137,7 @@ W32kAddFontResource(LPCWSTR Filename)
|
|||
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++;
|
||||
|
@ -420,14 +420,14 @@ W32kGetTextExtentPoint(HDC hDC,
|
|||
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++)
|
||||
{
|
||||
|
@ -450,7 +450,7 @@ W32kGetTextExtentPoint(HDC hDC,
|
|||
|
||||
CurrentChar++;
|
||||
|
||||
if(CurrentChar < Size) TotalWidth += SpaceBetweenChars;
|
||||
if(CurrentChar < Size->cx) TotalWidth += SpaceBetweenChars;
|
||||
String++;
|
||||
}
|
||||
|
||||
|
@ -482,10 +482,10 @@ STDCALL
|
|||
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;
|
||||
|
@ -576,7 +576,7 @@ W32kTextOut(HDC hDC,
|
|||
// 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;
|
||||
|
@ -612,8 +612,8 @@ W32kTextOut(HDC hDC,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
FontObj = AccessUserObject(hFont);
|
||||
FontGDI = AccessInternalObject(hFont);
|
||||
FontObj = (PFONTOBJ)AccessUserObject(hFont);
|
||||
FontGDI = (PFONTGDI)AccessInternalObject(hFont);
|
||||
face = FontGDI->face;
|
||||
|
||||
if (face->charmap == NULL)
|
||||
|
@ -643,8 +643,8 @@ W32kTextOut(HDC hDC,
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
@ -711,7 +711,7 @@ W32kTextOut(HDC hDC,
|
|||
// 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);
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
STUB(BRUSHOBJ_ulGetBrushColor)
|
||||
STUB(CLIPOBJ_ppoGetPath)
|
||||
STUB(EngAcquireSemaphore)
|
||||
STUB(EngAllocMem)
|
||||
STUB(EngAllocUserMem)
|
||||
STUB(EngCheckAbort)
|
||||
STUB(EngComputeGlyphSet)
|
||||
STUB(EngCreateDriverObj)
|
||||
|
@ -31,7 +29,6 @@ STUB(EngFillPath)
|
|||
STUB(EngFindImageProcAddress)
|
||||
STUB(EngFindResource)
|
||||
STUB(EngFreeModule)
|
||||
STUB(EngFreeUserMem)
|
||||
STUB(EngGetCurrentCodePage)
|
||||
STUB(EngGetDriverName)
|
||||
STUB(EngGetFileChangeTime)
|
||||
|
|
Loading…
Reference in a new issue