Remove unused flags and start using new dc type ids.
authorJames Tabor <james.tabor@reactos.org>
Tue, 8 Jan 2008 03:48:08 +0000 (03:48 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 8 Jan 2008 03:48:08 +0000 (03:48 +0000)
svn path=/trunk/; revision=31660

12 files changed:
reactos/include/reactos/win32k/ntgdihdl.h
reactos/subsystems/win32/win32k/include/dc.h
reactos/subsystems/win32/win32k/objects/arc.c
reactos/subsystems/win32/win32k/objects/bitblt.c
reactos/subsystems/win32/win32k/objects/bitmaps.c
reactos/subsystems/win32/win32k/objects/color.c
reactos/subsystems/win32/win32k/objects/dc.c
reactos/subsystems/win32/win32k/objects/dibobj.c
reactos/subsystems/win32/win32k/objects/fillshap.c
reactos/subsystems/win32/win32k/objects/line.c
reactos/subsystems/win32/win32k/objects/print.c
reactos/subsystems/win32/win32k/objects/text.c

index 2282afd..20e91a4 100644 (file)
@@ -394,7 +394,6 @@ typedef struct _DC
 \r
   INT         saveLevel; // DCLEVEL lSaveDepth\r
   HDC         hSelf;  // DCLEVEL hdcSave Used only for MemoryDC & SaveDC.\r
-  BOOL        IsIC;      // Use DC_Type\r
 \r
   HPALETTE    PalIndexed;\r
 \r
index 68679b5..ef25e5e 100644 (file)
@@ -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
index a0a1169..60e1f34 100644 (file)
@@ -90,7 +90,7 @@ NtGdiArcInternal(
     SetLastWin32Error(ERROR_INVALID_HANDLE);\r
     return FALSE;\r
   }\r
-  if (dc->IsIC)\r
+  if (dc->DC_Type == DC_TYPE_INFO)\r
   {\r
     DC_UnlockDc(dc);\r
     /* Yes, Windows really returns TRUE in this case */\r
index 9fe53a1..bfc5962 100644 (file)
@@ -58,7 +58,7 @@ NtGdiAlphaBlend(
                SetLastWin32Error(ERROR_INVALID_HANDLE);\r
                return FALSE;\r
        }\r
-       if (DCDest->IsIC)\r
+       if (DCDest->DC_Type == DC_TYPE_INFO)\r
        {\r
                DC_UnlockDc(DCDest);\r
                /* Yes, Windows really returns TRUE in this case */\r
@@ -75,7 +75,7 @@ NtGdiAlphaBlend(
                        SetLastWin32Error(ERROR_INVALID_HANDLE);\r
                        return FALSE;\r
                }\r
-               if (DCSrc->IsIC)\r
+               if (DCSrc->DC_Type == DC_TYPE_INFO)\r
                {\r
                        DC_UnlockDc(DCSrc);\r
                        DC_UnlockDc(DCDest);\r
@@ -204,7 +204,7 @@ NtGdiBitBlt(
                DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCDest);\r
                return FALSE;\r
        }\r
-       if (DCDest->IsIC)\r
+       if (DCDest->DC_Type == DC_TYPE_INFO)\r
        {\r
                DC_UnlockDc(DCDest);\r
                /* Yes, Windows really returns TRUE in this case */\r
@@ -222,7 +222,7 @@ NtGdiBitBlt(
                                DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc);\r
                                return FALSE;\r
                        }\r
-                       if (DCSrc->IsIC)\r
+                       if (DCSrc->DC_Type == DC_TYPE_INFO)\r
                        {\r
                                DC_UnlockDc(DCSrc);\r
                                DC_UnlockDc(DCDest);\r
@@ -424,7 +424,7 @@ NtGdiTransparentBlt(
     SetLastWin32Error(ERROR_INVALID_HANDLE);\r
     return FALSE;\r
   }\r
-  if (DCDest->IsIC)\r
+  if (DCDest->DC_Type == DC_TYPE_INFO)\r
   {\r
     DC_UnlockDc(DCDest);\r
     /* Yes, Windows really returns TRUE in this case */\r
@@ -442,7 +442,7 @@ NtGdiTransparentBlt(
   {\r
     DCSrc = DCDest;\r
   }\r
-  if (DCSrc->IsIC)\r
+  if (DCSrc->DC_Type == DC_TYPE_INFO)\r
   {\r
     DC_UnlockDc(DCSrc);\r
     if(hdcDst != hdcSrc)\r
@@ -814,7 +814,7 @@ NtGdiStretchBlt(
                SetLastWin32Error(ERROR_INVALID_HANDLE);\r
                return FALSE;\r
        }\r
-       if (DCDest->IsIC)\r
+       if (DCDest->DC_Type == DC_TYPE_INFO)\r
        {\r
                DC_UnlockDc(DCDest);\r
                /* Yes, Windows really returns TRUE in this case */\r
@@ -833,7 +833,7 @@ NtGdiStretchBlt(
                                SetLastWin32Error(ERROR_INVALID_HANDLE);\r
                                return FALSE;\r
                        }\r
-                       if (DCSrc->IsIC)\r
+                       if (DCSrc->DC_Type == DC_TYPE_INFO)\r
                        {\r
                                DC_UnlockDc(DCSrc);\r
                                DC_UnlockDc(DCDest);\r
@@ -1103,7 +1103,7 @@ IntGdiPolyPatBlt(
       SetLastWin32Error(ERROR_INVALID_HANDLE);\r
       return FALSE;\r
    }\r
-   if (dc->IsIC)\r
+   if (dc->DC_Type == DC_TYPE_INFO)\r
    {\r
       DC_UnlockDc(dc);\r
       /* Yes, Windows really returns TRUE in this case */\r
@@ -1155,7 +1155,7 @@ NtGdiPatBlt(
    }\r
    Dc_Attr = dc->pDc_Attr;\r
    if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;\r
-   if (dc->IsIC)\r
+   if (dc->DC_Type == DC_TYPE_INFO)\r
    {\r
       DC_UnlockDc(dc);\r
       /* Yes, Windows really returns TRUE in this case */\r
index 6d01db4..c0b6a7b 100644 (file)
@@ -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;
index 68605bf..4ebd7a8 100644 (file)
@@ -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);
index 53c0750..c1c9372 100644 (file)
@@ -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;
index 7d5c3f7..7019832 100644 (file)
@@ -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;
index f6b54bc..71467dc 100644 (file)
@@ -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 */
index 0c97dc9..b6029f0 100644 (file)
@@ -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 */
index e5c8c30..7689b4e 100644 (file)
@@ -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;
index fabfb62..8b03a50 100644 (file)
@@ -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 */