From 238f8e2ac9abef87e37f5ed922168c7229be5f61 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 8 Jan 2008 03:48:08 +0000 Subject: [PATCH] Remove unused flags and start using new dc type ids. svn path=/trunk/; revision=31660 --- reactos/include/reactos/win32k/ntgdihdl.h | 1 - reactos/subsystems/win32/win32k/include/dc.h | 4 ---- reactos/subsystems/win32/win32k/objects/arc.c | 2 +- .../subsystems/win32/win32k/objects/bitblt.c | 20 +++++++++---------- .../subsystems/win32/win32k/objects/bitmaps.c | 2 +- .../subsystems/win32/win32k/objects/color.c | 4 ++-- reactos/subsystems/win32/win32k/objects/dc.c | 15 +++++--------- .../subsystems/win32/win32k/objects/dibobj.c | 10 +++++----- .../win32/win32k/objects/fillshap.c | 12 +++++------ .../subsystems/win32/win32k/objects/line.c | 2 +- .../subsystems/win32/win32k/objects/print.c | 2 +- .../subsystems/win32/win32k/objects/text.c | 2 +- 12 files changed, 33 insertions(+), 43 deletions(-) diff --git a/reactos/include/reactos/win32k/ntgdihdl.h b/reactos/include/reactos/win32k/ntgdihdl.h index 2282afdb432..20e91a4139e 100644 --- a/reactos/include/reactos/win32k/ntgdihdl.h +++ b/reactos/include/reactos/win32k/ntgdihdl.h @@ -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; diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h index 68679b55b03..ef25e5e8f79 100644 --- a/reactos/subsystems/win32/win32k/include/dc.h +++ b/reactos/subsystems/win32/win32k/include/dc.h @@ -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 diff --git a/reactos/subsystems/win32/win32k/objects/arc.c b/reactos/subsystems/win32/win32k/objects/arc.c index a0a11692590..60e1f342818 100644 --- a/reactos/subsystems/win32/win32k/objects/arc.c +++ b/reactos/subsystems/win32/win32k/objects/arc.c @@ -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 */ diff --git a/reactos/subsystems/win32/win32k/objects/bitblt.c b/reactos/subsystems/win32/win32k/objects/bitblt.c index 9fe53a1e561..bfc5962d662 100644 --- a/reactos/subsystems/win32/win32k/objects/bitblt.c +++ b/reactos/subsystems/win32/win32k/objects/bitblt.c @@ -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 */ diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index 6d01db45396..c0b6a7b7f4e 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -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; diff --git a/reactos/subsystems/win32/win32k/objects/color.c b/reactos/subsystems/win32/win32k/objects/color.c index 68605bf6686..4ebd7a80f38 100644 --- a/reactos/subsystems/win32/win32k/objects/color.c +++ b/reactos/subsystems/win32/win32k/objects/color.c @@ -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); diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index 53c0750169d..c1c937278f5 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -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; diff --git a/reactos/subsystems/win32/win32k/objects/dibobj.c b/reactos/subsystems/win32/win32k/objects/dibobj.c index 7d5c3f78ef8..7019832faed 100644 --- a/reactos/subsystems/win32/win32k/objects/dibobj.c +++ b/reactos/subsystems/win32/win32k/objects/dibobj.c @@ -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; diff --git a/reactos/subsystems/win32/win32k/objects/fillshap.c b/reactos/subsystems/win32/win32k/objects/fillshap.c index f6b54bca8a4..71467dc4a5c 100644 --- a/reactos/subsystems/win32/win32k/objects/fillshap.c +++ b/reactos/subsystems/win32/win32k/objects/fillshap.c @@ -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 */ diff --git a/reactos/subsystems/win32/win32k/objects/line.c b/reactos/subsystems/win32/win32k/objects/line.c index 0c97dc91f76..b6029f05420 100644 --- a/reactos/subsystems/win32/win32k/objects/line.c +++ b/reactos/subsystems/win32/win32k/objects/line.c @@ -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 */ diff --git a/reactos/subsystems/win32/win32k/objects/print.c b/reactos/subsystems/win32/win32k/objects/print.c index e5c8c305431..7689b4e0d40 100644 --- a/reactos/subsystems/win32/win32k/objects/print.c +++ b/reactos/subsystems/win32/win32k/objects/print.c @@ -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; diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index fabfb6289c8..8b03a5077c7 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -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 */