mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
Fixed a lot of warnings.
svn path=/trunk/; revision=2007
This commit is contained in:
parent
4a45379380
commit
b9689b04fa
20 changed files with 102 additions and 104 deletions
|
@ -146,6 +146,7 @@ typedef struct _DC
|
||||||
((PDC) GDIOBJ_HandleToPtr ((HGDIOBJ) hDC, GO_DC_MAGIC))
|
((PDC) GDIOBJ_HandleToPtr ((HGDIOBJ) hDC, GO_DC_MAGIC))
|
||||||
#define DC_LockDC(hDC) GDIOBJ_LockObject ((HGDIOBJ) hDC)
|
#define DC_LockDC(hDC) GDIOBJ_LockObject ((HGDIOBJ) hDC)
|
||||||
#define DC_UnlockDC(hDC) GDIOBJ_UnlockObject ((HGDIOBJ) hDC)
|
#define DC_UnlockDC(hDC) GDIOBJ_UnlockObject ((HGDIOBJ) hDC)
|
||||||
|
HDC RetrieveDisplayHDC(VOID);
|
||||||
PDC DC_AllocDC(LPCWSTR Driver);
|
PDC DC_AllocDC(LPCWSTR Driver);
|
||||||
void DC_InitDC(PDC DCToInit);
|
void DC_InitDC(PDC DCToInit);
|
||||||
PDC DC_FindOpenDC(LPCWSTR Driver);
|
PDC DC_FindOpenDC(LPCWSTR Driver);
|
||||||
|
|
|
@ -57,8 +57,8 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
|
||||||
RECTL TempRect;
|
RECTL TempRect;
|
||||||
SIZEL TempSize;
|
SIZEL TempSize;
|
||||||
|
|
||||||
if(Source != NULL) SourceGDI = AccessInternalObjectFromUserObject(Source);
|
if(Source != NULL) SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
|
||||||
if(Dest != NULL) DestGDI = AccessInternalObjectFromUserObject(Dest);
|
if(Dest != NULL) DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest);
|
||||||
|
|
||||||
MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
|
MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
|
||||||
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
||||||
|
@ -96,7 +96,7 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
|
||||||
hTemp = EngCreateBitmap(TempSize,
|
hTemp = EngCreateBitmap(TempSize,
|
||||||
DIB_GetDIBWidthBytes(DestRect->right - DestRect->left, BitsPerFormat(Dest->iBitmapFormat)),
|
DIB_GetDIBWidthBytes(DestRect->right - DestRect->left, BitsPerFormat(Dest->iBitmapFormat)),
|
||||||
Dest->iBitmapFormat, 0, NULL);
|
Dest->iBitmapFormat, 0, NULL);
|
||||||
TempSurf = AccessUserObject(hTemp);
|
TempSurf = (PSURFOBJ)AccessUserObject(hTemp);
|
||||||
|
|
||||||
// FIXME: Skip creating a TempSurf if we have the same BPP and palette
|
// 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);
|
EngBitBlt(TempSurf, Source, NULL, NULL, ColorTranslation, &TempRect, SourcePoint, NULL, NULL, NULL, 0);
|
||||||
|
|
|
@ -22,8 +22,8 @@ CLIPOBJ *EngCreateClipRegion(ULONG NumRects, RECTL Rects[],
|
||||||
CLIPOBJ *ClipObj;
|
CLIPOBJ *ClipObj;
|
||||||
CLIPGDI *ClipGDI;
|
CLIPGDI *ClipGDI;
|
||||||
|
|
||||||
ClipObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), NULL);
|
ClipObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), 0);
|
||||||
ClipGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPGDI), NULL);
|
ClipGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPGDI), 0);
|
||||||
|
|
||||||
NewClip = CreateGDIHandle(ClipGDI, ClipObj);
|
NewClip = CreateGDIHandle(ClipGDI, ClipObj);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ CLIPOBJ *EngCreateClipRegion(ULONG NumRects, RECTL Rects[],
|
||||||
VOID EngDeleteClipRegion(CLIPOBJ *ClipObj)
|
VOID EngDeleteClipRegion(CLIPOBJ *ClipObj)
|
||||||
{
|
{
|
||||||
HCLIP HClip = AccessHandleFromUserObject(ClipObj);
|
HCLIP HClip = AccessHandleFromUserObject(ClipObj);
|
||||||
CLIPGDI *ClipGDI = AccessInternalObject(HClip);
|
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObject(HClip);
|
||||||
|
|
||||||
EngFreeMem(ClipGDI);
|
EngFreeMem(ClipGDI);
|
||||||
EngFreeMem(ClipObj);
|
EngFreeMem(ClipObj);
|
||||||
|
@ -67,7 +67,7 @@ VOID EngDeleteClipRegion(CLIPOBJ *ClipObj)
|
||||||
|
|
||||||
VOID EngIntersectClipRegion(CLIPOBJ *ClipObj, ULONG NumRects, RECTL *IntersectRects)
|
VOID EngIntersectClipRegion(CLIPOBJ *ClipObj, ULONG NumRects, RECTL *IntersectRects)
|
||||||
{
|
{
|
||||||
CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
|
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
|
||||||
|
|
||||||
ClipGDI->NumIntersectRects = NumRects;
|
ClipGDI->NumIntersectRects = NumRects;
|
||||||
ClipGDI->IntersectRects = IntersectRects;
|
ClipGDI->IntersectRects = IntersectRects;
|
||||||
|
@ -85,7 +85,7 @@ VOID EngIntersectClipRegion(CLIPOBJ *ClipObj, ULONG NumRects, RECTL *IntersectRe
|
||||||
|
|
||||||
CLIPOBJ *EngCreateClip(VOID)
|
CLIPOBJ *EngCreateClip(VOID)
|
||||||
{
|
{
|
||||||
return EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), NULL);
|
return EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID EngDeleteClip(CLIPOBJ *ClipRegion)
|
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 ClipType, IN ULONG BuildOrder,
|
||||||
IN ULONG MaxRects)
|
IN ULONG MaxRects)
|
||||||
{
|
{
|
||||||
CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
|
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
|
||||||
|
|
||||||
ClipGDI->EnumPos = 0;
|
ClipGDI->EnumPos = 0;
|
||||||
ClipGDI->EnumRects.c = MaxRects;
|
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,
|
BOOL CLIPOBJ_bEnum(IN PCLIPOBJ ClipObj, IN ULONG ObjSize,
|
||||||
OUT ULONG *EnumRects)
|
OUT ULONG *EnumRects)
|
||||||
{
|
{
|
||||||
CLIPGDI *ClipGDI = AccessInternalObjectFromUserObject(ClipObj);
|
CLIPGDI *ClipGDI = (CLIPGDI*)AccessInternalObjectFromUserObject(ClipObj);
|
||||||
|
|
||||||
ClipGDI->EnumPos++;
|
ClipGDI->EnumPos++;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ BOOL EngLineTo(SURFOBJ *Surface, CLIPOBJ *Clip, BRUSHOBJ *Brush,
|
||||||
PFN_DIB_HLine DIB_HLine;
|
PFN_DIB_HLine DIB_HLine;
|
||||||
PFN_DIB_VLine DIB_VLine;
|
PFN_DIB_VLine DIB_VLine;
|
||||||
|
|
||||||
SurfGDI = AccessInternalObjectFromUserObject(Surface);
|
SurfGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
|
||||||
|
|
||||||
MouseSafetyOnDrawStart(Surface, SurfGDI, x1, y1, x2, y2);
|
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;
|
LONG mouse_cx = 0, mouse_cy = 0;
|
||||||
HDC hDC = RetrieveDisplayHDC();
|
HDC hDC = RetrieveDisplayHDC();
|
||||||
PDC dc = DC_HandleToPtr(hDC);
|
PDC dc = DC_HandleToPtr(hDC);
|
||||||
PSURFOBJ SurfObj = AccessUserObject(dc->Surface);
|
PSURFOBJ SurfObj = (PSURFOBJ)AccessUserObject(dc->Surface);
|
||||||
PSURFGDI SurfGDI = AccessInternalObject(dc->Surface);
|
PSURFGDI SurfGDI = (PSURFGDI)AccessInternalObject(dc->Surface);
|
||||||
RECTL MouseRect;
|
RECTL MouseRect;
|
||||||
|
|
||||||
PDEVICE_OBJECT ClassDeviceObject = NULL;
|
PDEVICE_OBJECT ClassDeviceObject = NULL;
|
||||||
|
@ -134,10 +134,10 @@ NTSTATUS ConnectMouseClassDriver()
|
||||||
|
|
||||||
void TestMouse()
|
void TestMouse()
|
||||||
{
|
{
|
||||||
HDC hDC = RetrieveDisplayHDC(RetrieveDisplayHDC());
|
HDC hDC = RetrieveDisplayHDC();
|
||||||
PDC dc = DC_HandleToPtr(hDC);
|
PDC dc = DC_HandleToPtr(hDC);
|
||||||
PSURFOBJ SurfObj = AccessUserObject(dc->Surface);
|
PSURFOBJ SurfObj = (PSURFOBJ)AccessUserObject(dc->Surface);
|
||||||
PSURFGDI SurfGDI = AccessInternalObject(dc->Surface);
|
PSURFGDI SurfGDI = (PSURFGDI)AccessInternalObject(dc->Surface);
|
||||||
BOOL txt;
|
BOOL txt;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ void TestMouse()
|
||||||
MouseSize.cx = 16;
|
MouseSize.cx = 16;
|
||||||
MouseSize.cy = 16;
|
MouseSize.cy = 16;
|
||||||
hMouseSurf = EngCreateBitmap(MouseSize, 16, BMF_4BPP, 0, NULL);
|
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
|
// Capture the cursor we drew in the mouse cursor buffer
|
||||||
ZeroPoint.x = 0;
|
ZeroPoint.x = 0;
|
||||||
|
|
|
@ -18,7 +18,7 @@ BOOL FillSolid(SURFOBJ *Surface, PRECTL Dimensions, ULONG iColor)
|
||||||
ULONG x, y, LineWidth, leftOfBitmap;
|
ULONG x, y, LineWidth, leftOfBitmap;
|
||||||
SURFGDI *SurfaceGDI;
|
SURFGDI *SurfaceGDI;
|
||||||
|
|
||||||
SurfaceGDI = AccessInternalObjectFromUserObject(Surface);
|
SurfaceGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
|
||||||
LineWidth = Dimensions->right - Dimensions->left;
|
LineWidth = Dimensions->right - Dimensions->left;
|
||||||
|
|
||||||
for (y = Dimensions->top; y < Dimensions->bottom; y++)
|
for (y = Dimensions->top; y < Dimensions->bottom; y++)
|
||||||
|
@ -72,7 +72,7 @@ BOOL EngPaint(IN SURFOBJ *Surface, IN CLIPOBJ *ClipRegion,
|
||||||
SURFGDI *SurfGDI;
|
SURFGDI *SurfGDI;
|
||||||
|
|
||||||
// Is the surface's Paint function hooked?
|
// Is the surface's Paint function hooked?
|
||||||
SurfGDI = AccessInternalObjectFromUserObject(Surface);
|
SurfGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);
|
||||||
|
|
||||||
// FIXME: Perform Mouse Safety on the given ClipRegion
|
// FIXME: Perform Mouse Safety on the given ClipRegion
|
||||||
// MouseSafetyOnDrawStart(Surface, SurfGDI, x1, y1, x2, y2);
|
// MouseSafetyOnDrawStart(Surface, SurfGDI, x1, y1, x2, y2);
|
||||||
|
|
|
@ -22,10 +22,10 @@ HPALETTE EngCreatePalette(ULONG Mode,
|
||||||
PALOBJ *PalObj;
|
PALOBJ *PalObj;
|
||||||
PALGDI *PalGDI;
|
PALGDI *PalGDI;
|
||||||
|
|
||||||
PalObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALOBJ), NULL);
|
PalObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALOBJ), 0);
|
||||||
PalGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALGDI), NULL);
|
PalGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(PALGDI), 0);
|
||||||
|
|
||||||
NewPalette = CreateGDIHandle(PalGDI, PalObj);
|
NewPalette = (HPALETTE)CreateGDIHandle(PalGDI, PalObj);
|
||||||
|
|
||||||
PalGDI->Mode = Mode;
|
PalGDI->Mode = Mode;
|
||||||
|
|
||||||
|
@ -55,8 +55,8 @@ BOOL EngDeletePalette(IN HPALETTE Palette)
|
||||||
PALOBJ *PalObj;
|
PALOBJ *PalObj;
|
||||||
PALGDI *PalGDI;
|
PALGDI *PalGDI;
|
||||||
|
|
||||||
PalGDI = AccessInternalObject(Palette);
|
PalGDI = (PALGDI*)AccessInternalObject(Palette);
|
||||||
PalObj = AccessUserObject(Palette);
|
PalObj = (PALOBJ*)AccessUserObject(Palette);
|
||||||
|
|
||||||
EngFreeMem(PalGDI);
|
EngFreeMem(PalGDI);
|
||||||
EngFreeMem(PalObj);
|
EngFreeMem(PalObj);
|
||||||
|
@ -71,7 +71,7 @@ ULONG PALOBJ_cGetColors(PALOBJ *PalObj, ULONG Start, ULONG Colors,
|
||||||
ULONG i, entry;
|
ULONG i, entry;
|
||||||
PALGDI *PalGDI;
|
PALGDI *PalGDI;
|
||||||
|
|
||||||
PalGDI = AccessInternalObjectFromUserObject(PalObj);
|
PalGDI = (PALGDI*)AccessInternalObjectFromUserObject(PalObj);
|
||||||
|
|
||||||
for(i=Start; i<Colors; i++)
|
for(i=Start; i<Colors; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,10 +131,10 @@ HSURF EngCreateDeviceSurface(DHSURF dhsurf, SIZEL Size, ULONG Format)
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
SURFGDI *SurfGDI;
|
SURFGDI *SurfGDI;
|
||||||
|
|
||||||
SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
|
SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), 0);
|
||||||
SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), NULL);
|
SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), 0);
|
||||||
|
|
||||||
NewSurface = CreateGDIHandle(SurfGDI, SurfObj);
|
NewSurface = (HSURF)CreateGDIHandle(SurfGDI, SurfObj);
|
||||||
|
|
||||||
InitializeHooks(SurfGDI);
|
InitializeHooks(SurfGDI);
|
||||||
|
|
||||||
|
@ -201,8 +201,8 @@ BOOL EngDeleteSurface(HSURF Surface)
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
SURFGDI *SurfGDI;
|
SURFGDI *SurfGDI;
|
||||||
|
|
||||||
SurfGDI = AccessInternalObject(Surface);
|
SurfGDI = (SURFGDI*)AccessInternalObject(Surface);
|
||||||
SurfObj = AccessUserObject(Surface);
|
SurfObj = (SURFOBJ*)AccessUserObject(Surface);
|
||||||
|
|
||||||
EngFreeMem(SurfGDI);
|
EngFreeMem(SurfGDI);
|
||||||
EngFreeMem(SurfObj);
|
EngFreeMem(SurfObj);
|
||||||
|
@ -214,5 +214,5 @@ BOOL EngDeleteSurface(HSURF Surface)
|
||||||
SURFOBJ *EngLockSurface(HSURF Surface)
|
SURFOBJ *EngLockSurface(HSURF Surface)
|
||||||
{
|
{
|
||||||
// FIXME: Call GDI_LockObject (see subsys/win32k/objects/gdi.c)
|
// 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,
|
PRECTL DestRect, PRECTL SourceRect,
|
||||||
ULONG TransparentColor, ULONG Reserved)
|
ULONG TransparentColor, ULONG Reserved)
|
||||||
{
|
{
|
||||||
PSURFGDI DestGDI = AccessInternalObjectFromUserObject(Dest),
|
PSURFGDI DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest),
|
||||||
SourceGDI = AccessInternalObjectFromUserObject(Source);
|
SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
|
||||||
HSURF hTemp;
|
HSURF hTemp;
|
||||||
PSURFOBJ TempSurf;
|
PSURFOBJ TempSurf;
|
||||||
POINTL TempPoint, SourcePoint;
|
POINTL TempPoint, SourcePoint;
|
||||||
|
@ -56,7 +56,7 @@ BOOL EngTransparentBlt(PSURFOBJ Dest, PSURFOBJ Source,
|
||||||
|
|
||||||
hTemp = EngCreateBitmap(TempSize,
|
hTemp = EngCreateBitmap(TempSize,
|
||||||
DIB_GetDIBWidthBytes(dx, BitsPerFormat(Dest->iBitmapFormat)), Dest->iBitmapFormat, 0, NULL);
|
DIB_GetDIBWidthBytes(dx, BitsPerFormat(Dest->iBitmapFormat)), Dest->iBitmapFormat, 0, NULL);
|
||||||
TempSurf = AccessUserObject(hTemp);
|
TempSurf = (PSURFOBJ)AccessUserObject(hTemp);
|
||||||
|
|
||||||
SourcePoint.x = SourceRect->left;
|
SourcePoint.x = SourceRect->left;
|
||||||
SourcePoint.y = SourceRect->top;
|
SourcePoint.y = SourceRect->top;
|
||||||
|
|
|
@ -105,13 +105,13 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
||||||
PALGDI *SourcePalGDI, *DestPalGDI;
|
PALGDI *SourcePalGDI, *DestPalGDI;
|
||||||
ULONG IndexedColors;
|
ULONG IndexedColors;
|
||||||
|
|
||||||
XlateObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEOBJ), NULL);
|
XlateObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEOBJ), 0);
|
||||||
XlateGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(XLATEGDI), NULL);
|
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(SourcePalType == PAL_INDEXED) SourcePalGDI = (PALGDI*)AccessInternalObject(PaletteSource);
|
||||||
if(DestPalType == PAL_INDEXED) DestPalGDI = AccessInternalObject(PaletteDest);
|
if(DestPalType == PAL_INDEXED) DestPalGDI = (PALGDI*)AccessInternalObject(PaletteDest);
|
||||||
|
|
||||||
XlateObj->iSrcType = SourcePalType;
|
XlateObj->iSrcType = SourcePalType;
|
||||||
XlateObj->iDstType = DestPalType;
|
XlateObj->iDstType = DestPalType;
|
||||||
|
@ -146,7 +146,7 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
||||||
else if (SourcePalType == PAL_INDEXED) { IndexedColors = SourcePalGDI->NumColors; }
|
else if (SourcePalType == PAL_INDEXED) { IndexedColors = SourcePalGDI->NumColors; }
|
||||||
else if (DestPalType == PAL_INDEXED) { IndexedColors = DestPalGDI->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
|
// Source palette is indexed
|
||||||
|
@ -191,8 +191,8 @@ XLATEOBJ *EngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
||||||
|
|
||||||
EngDeleteXlate(XLATEOBJ *XlateObj)
|
EngDeleteXlate(XLATEOBJ *XlateObj)
|
||||||
{
|
{
|
||||||
HPALETTE HXlate = AccessHandleFromUserObject(XlateObj);
|
HPALETTE HXlate = (HPALETTE)AccessHandleFromUserObject(XlateObj);
|
||||||
XLATEGDI *XlateGDI = AccessInternalObject(HXlate);
|
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObject(HXlate);
|
||||||
|
|
||||||
if(XlateGDI->translationTable!=NULL)
|
if(XlateGDI->translationTable!=NULL)
|
||||||
{
|
{
|
||||||
|
@ -206,7 +206,7 @@ EngDeleteXlate(XLATEOBJ *XlateObj)
|
||||||
|
|
||||||
ULONG *XLATEOBJ_piVector(XLATEOBJ *XlateObj)
|
ULONG *XLATEOBJ_piVector(XLATEOBJ *XlateObj)
|
||||||
{
|
{
|
||||||
XLATEGDI *XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
|
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||||
|
|
||||||
if(XlateObj->iSrcType == PAL_INDEXED)
|
if(XlateObj->iSrcType == PAL_INDEXED)
|
||||||
{
|
{
|
||||||
|
@ -219,7 +219,7 @@ ULONG *XLATEOBJ_piVector(XLATEOBJ *XlateObj)
|
||||||
ULONG XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color)
|
ULONG XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color)
|
||||||
{
|
{
|
||||||
PALGDI *PalGDI;
|
PALGDI *PalGDI;
|
||||||
XLATEGDI *XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
|
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||||
|
|
||||||
if(XlateObj->flXlate & XO_TRIVIAL)
|
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
|
// FIXME: won't work if destination isn't indexed
|
||||||
|
|
||||||
// Extract the destination palette
|
// Extract the destination palette
|
||||||
PalGDI = AccessInternalObject(XlateGDI->DestPal);
|
PalGDI = (PALGDI*)AccessInternalObject(XlateGDI->DestPal);
|
||||||
|
|
||||||
// Return closest match for the given RGB color
|
// Return closest match for the given RGB color
|
||||||
return ClosestColorMatch(Color, PalGDI->IndexedColors, PalGDI->NumColors);
|
return ClosestColorMatch(Color, PalGDI->IndexedColors, PalGDI->NumColors);
|
||||||
|
@ -252,7 +252,7 @@ ULONG XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj,
|
||||||
XLATEGDI *XlateGDI;
|
XLATEGDI *XlateGDI;
|
||||||
PALGDI *PalGDI;
|
PALGDI *PalGDI;
|
||||||
|
|
||||||
XlateGDI = AccessInternalObjectFromUserObject(XlateObj);
|
XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||||
|
|
||||||
if(PalOutType == XO_SRCPALETTE)
|
if(PalOutType == XO_SRCPALETTE)
|
||||||
{
|
{
|
||||||
|
@ -263,7 +263,7 @@ ULONG XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj,
|
||||||
HPal = XlateGDI->DestPal;
|
HPal = XlateGDI->DestPal;
|
||||||
}
|
}
|
||||||
|
|
||||||
PalGDI = AccessInternalObject(HPal);
|
PalGDI = (PALGDI*)AccessInternalObject(HPal);
|
||||||
RtlCopyMemory(OutPal, PalGDI->IndexedColors, sizeof(ULONG)*cPal);
|
RtlCopyMemory(OutPal, PalGDI->IndexedColors, sizeof(ULONG)*cPal);
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
|
|
|
@ -44,14 +44,14 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest,
|
||||||
SurfSrcAlloc = FALSE;
|
SurfSrcAlloc = FALSE;
|
||||||
|
|
||||||
// Determine surfaces to be used in the bitblt
|
// Determine surfaces to be used in the bitblt
|
||||||
SurfDest = AccessUserObject(DCDest->Surface);
|
SurfDest = (PSURFOBJ)AccessUserObject(DCDest->Surface);
|
||||||
SurfSrc = AccessUserObject(DCSrc->Surface);
|
SurfSrc = (PSURFOBJ)AccessUserObject(DCSrc->Surface);
|
||||||
|
|
||||||
SurfGDIDest = AccessInternalObjectFromUserObject(SurfDest);
|
SurfGDIDest = (PSURFGDI)AccessInternalObjectFromUserObject(SurfDest);
|
||||||
SurfGDISrc = AccessInternalObjectFromUserObject(SurfSrc);
|
SurfGDISrc = (PSURFGDI)AccessInternalObjectFromUserObject(SurfSrc);
|
||||||
|
|
||||||
// Retrieve the logical palette of the destination DC
|
// Retrieve the logical palette of the destination DC
|
||||||
DCLogPal = AccessUserObject(DCDest->w.hPalette);
|
DCLogPal = (PPALOBJ)AccessUserObject(DCDest->w.hPalette);
|
||||||
|
|
||||||
if(DCLogPal)
|
if(DCLogPal)
|
||||||
if(DCLogPal->logicalToSystem)
|
if(DCLogPal->logicalToSystem)
|
||||||
|
@ -72,10 +72,10 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest,
|
||||||
} else
|
} else
|
||||||
SourcePalette = W32kGetStockObject(DEFAULT_PALETTE);
|
SourcePalette = W32kGetStockObject(DEFAULT_PALETTE);
|
||||||
|
|
||||||
PalDestGDI = AccessInternalObject(DestPalette);
|
PalDestGDI = (PPALGDI)AccessInternalObject(DestPalette);
|
||||||
PalSourceGDI = AccessInternalObject(SourcePalette);
|
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
|
// Perform the bitblt operation
|
||||||
|
|
|
@ -52,7 +52,7 @@ const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
|
||||||
|
|
||||||
const PALETTEENTRY* COLOR_GetSystemPaletteTemplate(void)
|
const PALETTEENTRY* COLOR_GetSystemPaletteTemplate(void)
|
||||||
{
|
{
|
||||||
return &COLOR_sysPalTemplate;
|
return (const PALETTEENTRY*)&COLOR_sysPalTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL W32kAnimatePalette(HPALETTE hpal,
|
BOOL STDCALL W32kAnimatePalette(HPALETTE hpal,
|
||||||
|
@ -120,10 +120,10 @@ HPALETTE STDCALL W32kCreatePalette(CONST PLOGPALETTE palette)
|
||||||
{
|
{
|
||||||
PPALOBJ PalObj;
|
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;
|
ULONG size;
|
||||||
|
|
||||||
PalObj = AccessUserObject(NewPalette);
|
PalObj = (PPALOBJ)AccessUserObject(NewPalette);
|
||||||
|
|
||||||
size = sizeof(LOGPALETTE) + (palette->palNumEntries * sizeof(PALETTEENTRY));
|
size = sizeof(LOGPALETTE) + (palette->palNumEntries * sizeof(PALETTEENTRY));
|
||||||
PalObj->logpalette = ExAllocatePool(NonPagedPool, size);
|
PalObj->logpalette = ExAllocatePool(NonPagedPool, size);
|
||||||
|
@ -150,7 +150,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC,
|
||||||
if(DC_HandleToPtr(hDC))
|
if(DC_HandleToPtr(hDC))
|
||||||
{
|
{
|
||||||
HPALETTE hpal = (dc->w.hPalette)? dc->w.hPalette : W32kGetStockObject(DEFAULT_PALETTE);
|
HPALETTE hpal = (dc->w.hPalette)? dc->w.hPalette : W32kGetStockObject(DEFAULT_PALETTE);
|
||||||
palObj = AccessUserObject(hpal);
|
palObj = (PPALOBJ)AccessUserObject(hpal);
|
||||||
if (!palObj) {
|
if (!palObj) {
|
||||||
// GDI_ReleaseObj(hdc);
|
// GDI_ReleaseObj(hdc);
|
||||||
return nearest;
|
return nearest;
|
||||||
|
@ -169,7 +169,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC,
|
||||||
UINT STDCALL W32kGetNearestPaletteIndex(HPALETTE hpal,
|
UINT STDCALL W32kGetNearestPaletteIndex(HPALETTE hpal,
|
||||||
COLORREF Color)
|
COLORREF Color)
|
||||||
{
|
{
|
||||||
PPALOBJ palObj = AccessUserObject(hpal);
|
PPALOBJ palObj = (PPALOBJ)AccessUserObject(hpal);
|
||||||
UINT index = 0;
|
UINT index = 0;
|
||||||
|
|
||||||
if( palObj )
|
if( palObj )
|
||||||
|
@ -190,7 +190,7 @@ UINT STDCALL W32kGetPaletteEntries(HPALETTE hpal,
|
||||||
PPALOBJ palPtr;
|
PPALOBJ palPtr;
|
||||||
UINT numEntries;
|
UINT numEntries;
|
||||||
|
|
||||||
palPtr = AccessUserObject(hpal);
|
palPtr = (PPALOBJ)AccessUserObject(hpal);
|
||||||
if (!palPtr) return 0;
|
if (!palPtr) return 0;
|
||||||
|
|
||||||
numEntries = palPtr->logpalette->palNumEntries;
|
numEntries = palPtr->logpalette->palNumEntries;
|
||||||
|
@ -271,19 +271,19 @@ A logical palette is a buffer between color-intensive applications and the syste
|
||||||
PPALOBJ palPtr, sysPtr;
|
PPALOBJ palPtr, sysPtr;
|
||||||
PPALGDI palGDI, sysGDI;
|
PPALGDI palGDI, sysGDI;
|
||||||
int realized = 0;
|
int realized = 0;
|
||||||
PDC dc = AccessUserObject(hDC);
|
PDC dc = (PDC)AccessUserObject(hDC);
|
||||||
HPALETTE systemPalette;
|
HPALETTE systemPalette;
|
||||||
PSURFGDI SurfGDI;
|
PSURFGDI SurfGDI;
|
||||||
BOOLEAN success;
|
BOOLEAN success;
|
||||||
|
|
||||||
if (!dc) return 0;
|
if (!dc) return 0;
|
||||||
|
|
||||||
palPtr = AccessUserObject(dc->w.hPalette);
|
palPtr = (PPALOBJ)AccessUserObject(dc->w.hPalette);
|
||||||
SurfGDI = AccessInternalObjectFromUserObject(dc->Surface);
|
SurfGDI = (PSURFGDI)AccessInternalObjectFromUserObject(dc->Surface);
|
||||||
systemPalette = W32kGetStockObject(STOCK_DEFAULT_PALETTE);
|
systemPalette = W32kGetStockObject(STOCK_DEFAULT_PALETTE);
|
||||||
sysPtr = AccessInternalObject(systemPalette);
|
sysPtr = (PPALOBJ)AccessInternalObject(systemPalette);
|
||||||
palGDI = AccessInternalObject(dc->w.hPalette);
|
palGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||||
sysGDI = AccessInternalObject(systemPalette);
|
sysGDI = (PPALGDI)AccessInternalObject(systemPalette);
|
||||||
|
|
||||||
// Step 1: Create mapping of system palette\DC palette
|
// Step 1: Create mapping of system palette\DC palette
|
||||||
realized = PALETTE_SetMapping(palPtr, 0, palPtr->logpalette->palNumEntries,
|
realized = PALETTE_SetMapping(palPtr, 0, palPtr->logpalette->palNumEntries,
|
||||||
|
@ -365,7 +365,7 @@ HPALETTE STDCALL W32kSelectPalette(HDC hDC,
|
||||||
HPALETTE hpal,
|
HPALETTE hpal,
|
||||||
BOOL ForceBackground)
|
BOOL ForceBackground)
|
||||||
{
|
{
|
||||||
PDC dc = AccessUserObject(hDC);
|
PDC dc = (PDC)AccessUserObject(hDC);
|
||||||
HPALETTE oldPal;
|
HPALETTE oldPal;
|
||||||
|
|
||||||
oldPal = dc->w.hPalette;
|
oldPal = dc->w.hPalette;
|
||||||
|
@ -390,7 +390,7 @@ UINT STDCALL W32kSetPaletteEntries(HPALETTE hpal,
|
||||||
PPALOBJ palPtr;
|
PPALOBJ palPtr;
|
||||||
INT numEntries;
|
INT numEntries;
|
||||||
|
|
||||||
palPtr = AccessUserObject(hpal);
|
palPtr = (PPALOBJ)AccessUserObject(hpal);
|
||||||
if (!palPtr) return 0;
|
if (!palPtr) return 0;
|
||||||
|
|
||||||
numEntries = palPtr->logpalette->palNumEntries;
|
numEntries = palPtr->logpalette->palNumEntries;
|
||||||
|
@ -466,7 +466,7 @@ COLORREF COLOR_LookupNearestColor( PALETTEENTRY* palPalEntry, int size, COLORREF
|
||||||
{
|
{
|
||||||
unsigned char spec_type = color >> 24;
|
unsigned char spec_type = color >> 24;
|
||||||
int i;
|
int i;
|
||||||
PALETTEENTRY *COLOR_sysPal = ReturnSystemPalette();
|
PALETTEENTRY *COLOR_sysPal = (PALETTEENTRY*)ReturnSystemPalette();
|
||||||
|
|
||||||
// we need logical palette for PALETTERGB and PALETTEINDEX colorrefs
|
// 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
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -87,7 +87,7 @@ static void W32kSetDCState16(HDC hDC, HDC hDCSave);
|
||||||
|
|
||||||
// ----------------------------------------------------- Public Functions
|
// ----------------------------------------------------- Public Functions
|
||||||
|
|
||||||
HDC RetrieveDisplayHDC()
|
HDC RetrieveDisplayHDC(VOID)
|
||||||
{
|
{
|
||||||
return hDISPLAY_DC;
|
return hDISPLAY_DC;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
NewDC->Surface = NewDC->DriverFunctions.EnableSurface(NewDC->PDev); // hsurf
|
NewDC->Surface = NewDC->DriverFunctions.EnableSurface(NewDC->PDev); // hsurf
|
||||||
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
|
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
|
||||||
|
|
||||||
SurfObj = AccessUserObject(NewDC->Surface);
|
SurfObj = (PSURFOBJ)AccessUserObject(NewDC->Surface);
|
||||||
SurfObj->dhpdev = NewDC->PDev;
|
SurfObj->dhpdev = NewDC->PDev;
|
||||||
|
|
||||||
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
||||||
|
@ -308,7 +308,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
W32kSetTextAlign(hNewDC, TA_BASELINE);
|
W32kSetTextAlign(hNewDC, TA_BASELINE);
|
||||||
|
|
||||||
// If we've created a DC for the DISPLAY, save the reference for later CreateCompatibleDC(NULL... usage
|
// 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;
|
hDISPLAY_DC = hNewDC;
|
||||||
}
|
}
|
||||||
|
@ -939,8 +939,8 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
dc->w.hPen = hGDIObj;
|
dc->w.hPen = hGDIObj;
|
||||||
|
|
||||||
// Convert the color of the pen to the format of the DC
|
// Convert the color of the pen to the format of the DC
|
||||||
PalGDI = AccessInternalObject(dc->w.hPalette);
|
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||||
XlateObj = EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
pen = GDIOBJ_HandleToPtr(dc->w.hPen, GO_PEN_MAGIC);
|
pen = GDIOBJ_HandleToPtr(dc->w.hPen, GO_PEN_MAGIC);
|
||||||
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
||||||
break;
|
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! */
|
/* 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);
|
return DC_HandleToPtr(hDISPLAY_DC);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,9 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
|
||||||
PPALOBJ palette;
|
PPALOBJ palette;
|
||||||
RGBQUAD *end;
|
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 );
|
// GDI_ReleaseObj( hdc );
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -95,7 +95,7 @@ INT STDCALL W32kSetDIBits(HDC hDC,
|
||||||
// Create a temporary surface for the destination bitmap
|
// Create a temporary surface for the destination bitmap
|
||||||
DestSurf = ExAllocatePool(PagedPool, sizeof(SURFOBJ));
|
DestSurf = ExAllocatePool(PagedPool, sizeof(SURFOBJ));
|
||||||
DestGDI = ExAllocatePool(PagedPool, sizeof(SURFGDI));
|
DestGDI = ExAllocatePool(PagedPool, sizeof(SURFGDI));
|
||||||
DestBitmap = CreateGDIHandle(DestGDI, DestSurf);
|
DestBitmap = (HBITMAP)CreateGDIHandle(DestGDI, DestSurf);
|
||||||
|
|
||||||
BitmapToSurf(hDC, DestGDI, DestSurf, bitmap);
|
BitmapToSurf(hDC, DestGDI, DestSurf, bitmap);
|
||||||
|
|
||||||
|
@ -105,10 +105,10 @@ INT STDCALL W32kSetDIBits(HDC hDC,
|
||||||
SourceBitmap = EngCreateBitmap(SourceSize, DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount),
|
SourceBitmap = EngCreateBitmap(SourceSize, DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount),
|
||||||
BitmapFormat(bmi->bmiHeader.biBitCount, bmi->bmiHeader.biCompression),
|
BitmapFormat(bmi->bmiHeader.biBitCount, bmi->bmiHeader.biCompression),
|
||||||
0, Bits);
|
0, Bits);
|
||||||
SourceSurf = AccessUserObject(SourceBitmap);
|
SourceSurf = (PSURFOBJ)AccessUserObject(SourceBitmap);
|
||||||
|
|
||||||
// Destination palette obtained from the hDC
|
// Destination palette obtained from the hDC
|
||||||
hDCPalette = AccessInternalObject(dc->DevInfo.hpalDefault);
|
hDCPalette = (PPALGDI)AccessInternalObject(dc->DevInfo.hpalDefault);
|
||||||
DDB_Palette_Type = hDCPalette->Mode;
|
DDB_Palette_Type = hDCPalette->Mode;
|
||||||
DDB_Palette = dc->DevInfo.hpalDefault;
|
DDB_Palette = dc->DevInfo.hpalDefault;
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ W32kRectangle(HDC hDC,
|
||||||
int BottomRect)
|
int BottomRect)
|
||||||
{
|
{
|
||||||
DC *dc = DC_HandleToPtr(hDC);
|
DC *dc = DC_HandleToPtr(hDC);
|
||||||
SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
|
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
|
||||||
PBRUSHOBJ BrushObj;
|
PBRUSHOBJ BrushObj;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
PRECTL RectBounds = GDIOBJ_HandleToPtr(dc->w.hGCClipRgn, GO_REGION_MAGIC);
|
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);
|
ret = PATH_Rectangle(hDC, LeftRect, TopRect, RightRect, BottomRect);
|
||||||
} else {
|
} else {
|
||||||
// Draw the rectangle with the current pen
|
// 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,
|
ret = EngLineTo(SurfObj,
|
||||||
NULL, // ClipObj,
|
NULL, // ClipObj,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* GDIOBJ.C - GDI object manipulation routines
|
* 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[SYSTEM_FIXED_FONT] = W32kCreateFontIndirect(&SystemFixedFont);
|
||||||
StockObjects[DEFAULT_GUI_FONT] = W32kCreateFontIndirect(&DefaultGuiFont);
|
StockObjects[DEFAULT_GUI_FONT] = W32kCreateFontIndirect(&DefaultGuiFont);
|
||||||
|
|
||||||
StockObjects[DEFAULT_PALETTE] = PALETTE_Init();
|
StockObjects[DEFAULT_PALETTE] = (HGDIOBJ*)PALETTE_Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
HGDIOBJ STDCALL W32kGetStockObject(INT Object)
|
HGDIOBJ STDCALL W32kGetStockObject(INT Object)
|
||||||
|
|
|
@ -104,7 +104,7 @@ W32kLineTo(HDC hDC,
|
||||||
int YEnd)
|
int YEnd)
|
||||||
{
|
{
|
||||||
DC *dc = DC_HandleToPtr(hDC);
|
DC *dc = DC_HandleToPtr(hDC);
|
||||||
SURFOBJ *SurfObj = AccessUserObject(dc->Surface);
|
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
if(!dc) return FALSE;
|
if(!dc) return FALSE;
|
||||||
|
|
|
@ -27,7 +27,7 @@ HPALETTE PALETTE_Init(void)
|
||||||
HPALETTE hpalette;
|
HPALETTE hpalette;
|
||||||
PLOGPALETTE palPtr;
|
PLOGPALETTE palPtr;
|
||||||
PPALOBJ palObj;
|
PPALOBJ palObj;
|
||||||
const PALETTEENTRY* __sysPalTemplate = COLOR_GetSystemPaletteTemplate();
|
const PALETTEENTRY* __sysPalTemplate = (const PALETTEENTRY*)COLOR_GetSystemPaletteTemplate();
|
||||||
|
|
||||||
// create default palette (20 system colors)
|
// create default palette (20 system colors)
|
||||||
palPtr = ExAllocatePool(NonPagedPool, sizeof(LOGPALETTE) + (NB_RESERVED_COLORS * sizeof(PALETTEENTRY)));
|
palPtr = ExAllocatePool(NonPagedPool, sizeof(LOGPALETTE) + (NB_RESERVED_COLORS * sizeof(PALETTEENTRY)));
|
||||||
|
@ -46,7 +46,7 @@ HPALETTE PALETTE_Init(void)
|
||||||
hpalette = W32kCreatePalette(palPtr);
|
hpalette = W32kCreatePalette(palPtr);
|
||||||
ExFreePool(palPtr);
|
ExFreePool(palPtr);
|
||||||
|
|
||||||
palObj = AccessUserObject(hpalette);
|
palObj = (PPALOBJ)AccessUserObject(hpalette);
|
||||||
if (palObj)
|
if (palObj)
|
||||||
{
|
{
|
||||||
if (!(palObj->mapping = ExAllocatePool(NonPagedPool, sizeof(int) * 20)))
|
if (!(palObj->mapping = ExAllocatePool(NonPagedPool, sizeof(int) * 20)))
|
||||||
|
|
|
@ -137,7 +137,7 @@ W32kAddFontResource(LPCWSTR Filename)
|
||||||
RtlInitAnsiString(&StringA, (LPSTR)face->family_name);
|
RtlInitAnsiString(&StringA, (LPSTR)face->family_name);
|
||||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||||
FontTable[FontsLoaded].FaceName = ExAllocatePool(NonPagedPool, (StringU.Length + 1) * 2);
|
FontTable[FontsLoaded].FaceName = ExAllocatePool(NonPagedPool, (StringU.Length + 1) * 2);
|
||||||
wcscpy(FontTable[FontsLoaded].FaceName, StringU.Buffer);
|
wcscpy((LPWSTR)FontTable[FontsLoaded].FaceName, StringU.Buffer);
|
||||||
RtlFreeUnicodeString(&StringU);
|
RtlFreeUnicodeString(&StringU);
|
||||||
|
|
||||||
FontsLoaded++;
|
FontsLoaded++;
|
||||||
|
@ -420,14 +420,14 @@ W32kGetTextExtentPoint(HDC hDC,
|
||||||
int Count,
|
int Count,
|
||||||
LPSIZE Size)
|
LPSIZE Size)
|
||||||
{
|
{
|
||||||
PDC dc = AccessUserObject(hDC);
|
PDC dc = (PDC)AccessUserObject(hDC);
|
||||||
PFONTGDI FontGDI;
|
PFONTGDI FontGDI;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
FT_GlyphSlot glyph;
|
FT_GlyphSlot glyph;
|
||||||
INT error, pitch, glyph_index, i;
|
INT error, pitch, glyph_index, i;
|
||||||
ULONG TotalWidth = 0, MaxHeight = 0, CurrentChar = 0, SpaceBetweenChars = 5;
|
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++)
|
for(i=0; i<Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -450,7 +450,7 @@ W32kGetTextExtentPoint(HDC hDC,
|
||||||
|
|
||||||
CurrentChar++;
|
CurrentChar++;
|
||||||
|
|
||||||
if(CurrentChar < Size) TotalWidth += SpaceBetweenChars;
|
if(CurrentChar < Size->cx) TotalWidth += SpaceBetweenChars;
|
||||||
String++;
|
String++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,10 +482,10 @@ STDCALL
|
||||||
W32kGetTextMetrics(HDC hDC,
|
W32kGetTextMetrics(HDC hDC,
|
||||||
LPTEXTMETRIC tm)
|
LPTEXTMETRIC tm)
|
||||||
{
|
{
|
||||||
PDC dc = AccessUserObject(hDC);
|
PDC dc = (PDC)AccessUserObject(hDC);
|
||||||
PFONTGDI FontGDI;
|
PFONTGDI FontGDI;
|
||||||
|
|
||||||
FontGDI = AccessInternalObject(dc->w.hFont);
|
FontGDI = (PFONTGDI)AccessInternalObject(dc->w.hFont);
|
||||||
memcpy(tm, &FontGDI->TextMetric, sizeof(TEXTMETRIC));
|
memcpy(tm, &FontGDI->TextMetric, sizeof(TEXTMETRIC));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -576,7 +576,7 @@ W32kTextOut(HDC hDC,
|
||||||
// Fixme: Call EngTextOut, which does the real work (calling DrvTextOut where appropriate)
|
// Fixme: Call EngTextOut, which does the real work (calling DrvTextOut where appropriate)
|
||||||
|
|
||||||
DC *dc = DC_HandleToPtr(hDC);
|
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;
|
int error, glyph_index, n, load_flags = FT_LOAD_RENDER, i, j, sx, sy, scc;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
FT_GlyphSlot glyph;
|
FT_GlyphSlot glyph;
|
||||||
|
@ -612,8 +612,8 @@ W32kTextOut(HDC hDC,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FontObj = AccessUserObject(hFont);
|
FontObj = (PFONTOBJ)AccessUserObject(hFont);
|
||||||
FontGDI = AccessInternalObject(hFont);
|
FontGDI = (PFONTGDI)AccessInternalObject(hFont);
|
||||||
face = FontGDI->face;
|
face = FontGDI->face;
|
||||||
|
|
||||||
if (face->charmap == NULL)
|
if (face->charmap == NULL)
|
||||||
|
@ -643,8 +643,8 @@ W32kTextOut(HDC hDC,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the brush
|
// Create the brush
|
||||||
PalDestGDI = AccessInternalObject(dc->w.hPalette);
|
PalDestGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||||
XlateObj = EngCreateXlate(PalDestGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (PXLATEOBJ)EngCreateXlate(PalDestGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
hBrush = W32kCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor));
|
hBrush = W32kCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor));
|
||||||
Brush = BRUSHOBJ_HandleToPtr(hBrush);
|
Brush = BRUSHOBJ_HandleToPtr(hBrush);
|
||||||
EngDeleteXlate(XlateObj);
|
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
|
// 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);
|
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
|
// 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);
|
EngBitBlt(SurfObj, NULL, SourceGlyphSurf, NULL, NULL, &DestRect, &SourcePoint, &MaskRect, Brush, &BrushOrigin, 0xAACC);
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
STUB(BRUSHOBJ_ulGetBrushColor)
|
STUB(BRUSHOBJ_ulGetBrushColor)
|
||||||
STUB(CLIPOBJ_ppoGetPath)
|
STUB(CLIPOBJ_ppoGetPath)
|
||||||
STUB(EngAcquireSemaphore)
|
STUB(EngAcquireSemaphore)
|
||||||
STUB(EngAllocMem)
|
|
||||||
STUB(EngAllocUserMem)
|
|
||||||
STUB(EngCheckAbort)
|
STUB(EngCheckAbort)
|
||||||
STUB(EngComputeGlyphSet)
|
STUB(EngComputeGlyphSet)
|
||||||
STUB(EngCreateDriverObj)
|
STUB(EngCreateDriverObj)
|
||||||
|
@ -31,7 +29,6 @@ STUB(EngFillPath)
|
||||||
STUB(EngFindImageProcAddress)
|
STUB(EngFindImageProcAddress)
|
||||||
STUB(EngFindResource)
|
STUB(EngFindResource)
|
||||||
STUB(EngFreeModule)
|
STUB(EngFreeModule)
|
||||||
STUB(EngFreeUserMem)
|
|
||||||
STUB(EngGetCurrentCodePage)
|
STUB(EngGetCurrentCodePage)
|
||||||
STUB(EngGetDriverName)
|
STUB(EngGetDriverName)
|
||||||
STUB(EngGetFileChangeTime)
|
STUB(EngGetFileChangeTime)
|
||||||
|
|
Loading…
Reference in a new issue