mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
Remove unused flags and start using new dc type ids.
svn path=/trunk/; revision=31660
This commit is contained in:
parent
689819ce3e
commit
238f8e2ac9
12 changed files with 33 additions and 43 deletions
|
@ -394,7 +394,6 @@ typedef struct _DC
|
|||
|
||||
INT saveLevel; // DCLEVEL lSaveDepth
|
||||
HDC hSelf; // DCLEVEL hdcSave Used only for MemoryDC & SaveDC.
|
||||
BOOL IsIC; // Use DC_Type
|
||||
|
||||
HPALETTE PalIndexed;
|
||||
|
||||
|
|
|
@ -5,12 +5,8 @@
|
|||
#include "driver.h"
|
||||
|
||||
/* DC flags */
|
||||
#define DC_MEMORY 0x0001 /* It is a memory DC */
|
||||
#define DC_SAVED 0x0002 /* It is a saved DC */
|
||||
#define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
|
||||
#define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
|
||||
|
||||
#define GDI_DC_TYPE (1)
|
||||
|
||||
// GDIDEVICE flags
|
||||
#define PDEV_DISPLAY 0x00000001 // Display device
|
||||
|
|
|
@ -90,7 +90,7 @@ NtGdiArcInternal(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
|
|
@ -58,7 +58,7 @@ NtGdiAlphaBlend(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCDest->IsIC)
|
||||
if (DCDest->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -75,7 +75,7 @@ NtGdiAlphaBlend(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCSrc->IsIC)
|
||||
if (DCSrc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
|
@ -204,7 +204,7 @@ NtGdiBitBlt(
|
|||
DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCDest);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCDest->IsIC)
|
||||
if (DCDest->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -222,7 +222,7 @@ NtGdiBitBlt(
|
|||
DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCSrc->IsIC)
|
||||
if (DCSrc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
|
@ -424,7 +424,7 @@ NtGdiTransparentBlt(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCDest->IsIC)
|
||||
if (DCDest->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -442,7 +442,7 @@ NtGdiTransparentBlt(
|
|||
{
|
||||
DCSrc = DCDest;
|
||||
}
|
||||
if (DCSrc->IsIC)
|
||||
if (DCSrc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCSrc);
|
||||
if(hdcDst != hdcSrc)
|
||||
|
@ -814,7 +814,7 @@ NtGdiStretchBlt(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCDest->IsIC)
|
||||
if (DCDest->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -833,7 +833,7 @@ NtGdiStretchBlt(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCSrc->IsIC)
|
||||
if (DCSrc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
|
@ -1103,7 +1103,7 @@ IntGdiPolyPatBlt(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -1155,7 +1155,7 @@ NtGdiPatBlt(
|
|||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
|
|
@ -257,7 +257,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return Result;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
return Result;
|
||||
|
|
|
@ -548,7 +548,7 @@ UINT FASTCALL IntGdiRealizePalette(HDC hDC)
|
|||
// The RealizePalette function modifies the palette for the device associated with the specified device context. If the
|
||||
// device context is a memory DC, the color table for the bitmap selected into the DC is modified. If the device
|
||||
// context is a display DC, the physical palette for that device is modified.
|
||||
if(dc->w.flags == DC_MEMORY)
|
||||
if(dc->DC_Type == DC_TYPE_MEMORY)
|
||||
{
|
||||
// Memory managed DC
|
||||
ASSERT(sysGDI->NumColors <= 256);
|
||||
|
@ -571,7 +571,7 @@ UINT FASTCALL IntGdiRealizePalette(HDC hDC)
|
|||
PALETTE_UnlockPalette(palGDI);
|
||||
|
||||
// Step 3: Create the XLATEOBJ for device managed DCs
|
||||
if(dc->w.flags != DC_MEMORY)
|
||||
if(dc->DC_Type != DC_TYPE_MEMORY)
|
||||
{
|
||||
// Device managed DC
|
||||
palGDI->logicalToSystem = IntEngCreateXlate(sysMode, palMode, systemPalette, dc->w.hPalette);
|
||||
|
|
|
@ -62,7 +62,6 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
HDC hNewDC, DisplayDC;
|
||||
HRGN hVisRgn;
|
||||
UNICODE_STRING DriverName;
|
||||
INT DC_Type = DC_TYPE_DIRECT;
|
||||
|
||||
DisplayDC = NULL;
|
||||
if (hDC == NULL)
|
||||
|
@ -74,7 +73,6 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
return NULL;
|
||||
}
|
||||
hDC = DisplayDC;
|
||||
DC_Type = DC_TYPE_MEMORY; // Null hDC == Memory DC.
|
||||
}
|
||||
|
||||
/* Allocate a new DC based on the original DC's device */
|
||||
|
@ -106,8 +104,6 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
|
||||
/* Copy information from original DC to new DC */
|
||||
NewDC->hSelf = hNewDC;
|
||||
NewDC->IsIC = FALSE;
|
||||
NewDC->DC_Type = DC_Type;
|
||||
|
||||
NewDC->PDev = OrigDC->PDev;
|
||||
|
||||
|
@ -131,7 +127,7 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
NewDC->w.flags = DC_MEMORY;
|
||||
NewDC->DC_Type = DC_TYPE_MEMORY; // Always!
|
||||
NewDC->w.hBitmap = hBitmap;
|
||||
NewDC->w.hFirstBitmap = hBitmap;
|
||||
NewDC->pPDev = OrigDC->pPDev;
|
||||
|
@ -802,7 +798,6 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
|||
if(!nDc_Attr) nDc_Attr = &NewDC->Dc_Attr;
|
||||
|
||||
NewDC->DC_Type = DC_TYPE_DIRECT;
|
||||
NewDC->IsIC = CreateAsIC;
|
||||
|
||||
NewDC->PDev = PrimarySurface.hPDev;
|
||||
if(pUMdhpdev) pUMdhpdev = NewDC->PDev; // set DHPDEV for device.
|
||||
|
@ -974,7 +969,7 @@ IntGdiDeleteDC(HDC hDC, BOOL Force)
|
|||
NtGdiSelectBrush (DCHandle, STOCK_WHITE_BRUSH);
|
||||
NtGdiSelectFont (DCHandle, STOCK_SYSTEM_FONT);
|
||||
DC_LockDC (DCHandle); NtGdiSelectXxx does not recognize stock objects yet */
|
||||
if (DCToDelete->w.flags & DC_MEMORY)
|
||||
if (DCToDelete->DC_Type == DC_TYPE_MEMORY)
|
||||
{
|
||||
NtGdiDeleteObject (DCToDelete->w.hFirstBitmap);
|
||||
}
|
||||
|
@ -1256,7 +1251,7 @@ IntGdiCopyToSaveState(PDC dc, PDC newdc)
|
|||
nDc_Attr->szlViewportExt = Dc_Attr->szlViewportExt;
|
||||
|
||||
newdc->saveLevel = 0;
|
||||
newdc->IsIC = dc->IsIC;
|
||||
newdc->DC_Type = dc->DC_Type;
|
||||
|
||||
#if 0
|
||||
PATH_InitGdiPath( &newdc->w.path );
|
||||
|
@ -1330,7 +1325,7 @@ IntGdiCopyFromSaveState(PDC dc, PDC dcs, HDC hDC)
|
|||
Dc_Attr->szlViewportExt = sDc_Attr->szlViewportExt;
|
||||
dc->PalIndexed = dcs->PalIndexed;
|
||||
|
||||
if (!(dc->w.flags & DC_MEMORY))
|
||||
if (dc->DC_Type != DC_TYPE_MEMORY)
|
||||
{
|
||||
dc->w.bitsPerPixel = dcs->w.bitsPerPixel;
|
||||
}
|
||||
|
@ -1928,7 +1923,7 @@ NtGdiSelectBitmap(
|
|||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
|
||||
/* must be memory dc to select bitmap */
|
||||
if (!(pDC->w.flags & DC_MEMORY))
|
||||
if (pDC->DC_Type != DC_TYPE_MEMORY)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
return NULL;
|
||||
|
|
|
@ -33,7 +33,7 @@ IntSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Color
|
|||
UINT Index;
|
||||
|
||||
if (!(dc = DC_LockDc(hDC))) return 0;
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
return 0;
|
||||
|
@ -91,7 +91,7 @@ IntGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
|
|||
UINT Index;
|
||||
|
||||
if (!(dc = DC_LockDc(hDC))) return 0;
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
return 0;
|
||||
|
@ -297,7 +297,7 @@ NtGdiSetDIBits(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
if (Dc->IsIC)
|
||||
if (Dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
return 0;
|
||||
|
@ -351,7 +351,7 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
if (pDC->IsIC)
|
||||
if (pDC->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
return 0;
|
||||
|
@ -466,7 +466,7 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
/* Get handle for the palette in DC. */
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (Dc == NULL) return 0;
|
||||
if (Dc->IsIC)
|
||||
if (Dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
return 0;
|
||||
|
|
|
@ -226,7 +226,7 @@ NtGdiEllipse(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -665,7 +665,7 @@ NtGdiPie(HDC hDC,
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -861,7 +861,7 @@ NtGdiPolyPolyDraw( IN HDC hDC,
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -1155,7 +1155,7 @@ NtGdiRectangle(HDC hDC,
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -1461,7 +1461,7 @@ NtGdiRoundRect(
|
|||
DPRINT1("NtGdiRoundRect() - hDC is invalid\n");
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
else if (dc->IsIC)
|
||||
else if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
@ -1599,7 +1599,7 @@ NtGdiGradientFill(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
|
|
@ -393,7 +393,7 @@ NtGdiLineTo(HDC hDC,
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
|
|
@ -173,7 +173,7 @@ NtGdiExtEscape(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return -1;
|
||||
}
|
||||
if ( pDC->IsIC )
|
||||
if ( pDC->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
return 0;
|
||||
|
|
|
@ -1567,7 +1567,7 @@ NtGdiExtTextOutW(
|
|||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (dc->IsIC)
|
||||
if (dc->DC_Type == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
|
|
Loading…
Reference in a new issue