- Removed NtGdiGet/SetArcDirection and NtGdiGetSetTextCharExtra, update ntgdibad.h.
authorJames Tabor <james.tabor@reactos.org>
Wed, 8 Aug 2007 18:58:06 +0000 (18:58 +0000)
committerJames Tabor <james.tabor@reactos.org>
Wed, 8 Aug 2007 18:58:06 +0000 (18:58 +0000)
- Updated NtGdiGet/AndSet/DCDword.
- Changes to other files to reflect the updates and removals.

svn path=/trunk/; revision=28248

reactos/dll/win32/gdi32/gdi32.def
reactos/dll/win32/gdi32/misc/stubs.c
reactos/dll/win32/gdi32/objects/dc.c
reactos/dll/win32/gdi32/objects/text.c
reactos/include/reactos/win32k/ntgdibad.h
reactos/subsystems/win32/win32k/objects/dc.c
reactos/subsystems/win32/win32k/objects/line.c
reactos/subsystems/win32/win32k/objects/path.c
reactos/subsystems/win32/win32k/objects/text.c
reactos/subsystems/win32/win32k/w32ksvc.db

index d38a298..0b31ee0 100644 (file)
@@ -334,7 +334,7 @@ GdiStartPageEMF@4
 GdiSwapBuffers@4
 GdiTransparentBlt@44=NtGdiTransparentBlt@44
 GdiValidateHandle@4
-GetArcDirection@4=NtGdiGetArcDirection@4
+GetArcDirection@4
 GetAspectRatioFilterEx@8
 GetBitmapAttributes@4
 GetBitmapBits@12=NtGdiGetBitmapBits@12
@@ -529,7 +529,7 @@ SelectFontLocal@8
 SelectObject@8=NtGdiSelectObject@8
 SelectPalette@12=NtGdiSelectPalette@12
 SetAbortProc@8
-SetArcDirection@8=NtGdiSetArcDirection@8
+SetArcDirection@8
 SetBitmapAttributes@8
 SetBitmapBits@12=NtGdiSetBitmapBits@12
 SetBitmapDimensionEx@16=NtGdiSetBitmapDimensionEx@16
index 101009f..fbe5534 100644 (file)
@@ -173,19 +173,6 @@ GetSystemPaletteUse(HDC hDc)
 }
 
 
-/*
- * @unimplemented
- */
-int
-STDCALL
-GetTextCharacterExtra(
-       HDC     hDc
-       )
-{
-       return NtGdiGetSetTextCharExtra( hDc, 0, FALSE);
-}
-
-
 /*
  * @unimplemented
  */
@@ -313,20 +300,6 @@ SetSystemPaletteUse(
 }
 
 
-/*
- * @unimplemented
- */
-int
-STDCALL
-SetTextCharacterExtra(
-       HDC     hDC,
-       int     CharExtra
-       )
-{
-       return NtGdiGetSetTextCharExtra( hDC, CharExtra, TRUE);
-}
-
-
 /*
  * @unimplemented
  */
@@ -1275,22 +1248,6 @@ SetFontEnumeration(
 }
 
 
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-SetRelAbs(
-       DWORD   a0,
-       DWORD   a1
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
 /*
  * @unimplemented
  */
index 6e1b6a3..90fbef5 100644 (file)
@@ -290,6 +290,22 @@ DeleteObject(HGDIOBJ hObject)
 }
 
 
+INT
+STDCALL
+GetArcDirection( HDC hdc )
+{
+  return GetDCDWord( hdc, GdiGetArcDirection, 0);
+}
+
+
+INT
+STDCALL
+SetArcDirection( HDC hdc, INT nDirection )
+{
+  return GetAndSetDCDWord( hdc, GdiGetSetArcDirection, nDirection, 0, 0, 0 );
+}
+
+
 /*
  * @implemented
  */
@@ -304,6 +320,20 @@ GetRelAbs(
 }
 
 
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+SetRelAbs(
+       HDC hdc,
+       INT Mode
+       )
+{
+  return GetAndSetDCDWord( hdc, GdiGetSetRelAbs, Mode, 0, 0, 0 );
+}
+
+
 /*
  * @implemented
  */
index 9fd5d25..3f6094a 100644 (file)
@@ -47,6 +47,26 @@ TextOutW(
 }
 
 
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+GetTextCharacterExtra(
+       HDC     hDc
+       )
+{
+#if 0
+  PDC_ATTR Dc_Attr;
+  if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr)) return 0;
+  return Dc_Attr->lTextExtra;
+#endif
+  // Do it this way for now.
+  return GetDCDWord( hDc, GdiGetTextCharExtra, 0);
+}
+
+
 /*
  * @implemented
  */
@@ -393,3 +413,47 @@ GetFontResourceInfoW(
 
     return TRUE;
 }
+
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetTextCharacterExtra(
+       HDC     hDC,
+       int     CharExtra
+       )
+{
+  INT cExtra = 0x80000000;
+//  PDC_ATTR Dc_Attr;
+
+  if (CharExtra == cExtra)
+  {
+     SetLastError(ERROR_INVALID_PARAMETER);
+     return cExtra;
+  }
+#if 0
+  if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+  {
+    return 0; //call MFDRV META_SETTEXTCHAREXTRA
+  }
+  if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return cExtra;
+
+  if (NtCurrentTeb()->GdiTebBatch.HDC == hDC)
+  {
+     if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
+     {
+       NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
+       Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+     }
+  }
+  cExtra = Dc_Attr->lTextExtra;
+  Dc_Attr->lTextExtra = CharExtra;
+  return cExrta;
+#endif  
+// Do this for now.  
+  return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 );
+}
+
+
index b89fc33..9ee5799 100644 (file)
@@ -259,11 +259,6 @@ NtGdiGdiComment (
        CONST LPBYTE    Data
        );
 
-/* Use NtGdiGetDCDword with GdiGetArcDirection. */
-INT
-STDCALL
-NtGdiGetArcDirection ( HDC hDC );
-
 /* Should be done in user-mode. */
 BOOL
 STDCALL
@@ -465,11 +460,6 @@ INT STDCALL  NtGdiGetPolyFillMode(HDC  hDC);
 /* Should be done in user-mode using shared GDI Objects. */
 INT STDCALL  NtGdiGetROP2(HDC  hDC);
 
-/* Should be done in user-mode using shared GDI Objects. */
-INT
-STDCALL
-NtGdiGetSetTextCharExtra( HDC hDC, INT CharExtra, BOOL Set);
-
 /* Should be done in user-mode using shared GDI Objects. */
 INT STDCALL  NtGdiGetStretchBltMode(HDC  hDC);
 
@@ -677,12 +667,6 @@ STDCALL
 NtGdiSetAbortProc(HDC  hDC,
                       ABORTPROC  AbortProc);
 
-/* Use NtGdiGetAndSetDCDword with GdiGetSetArcDirection. */
-int
-STDCALL
-NtGdiSetArcDirection(HDC  hDC,
-                         int  ArcDirection);
-
 /* Use NtGdiSetBitmapDimension. */
 BOOL
 STDCALL
index e803c58..7eb6792 100644 (file)
@@ -2161,20 +2161,31 @@ NtGdiGetDCDword(
       SafeResult = dc->Dc_Attr.lRelAbs;
       break;
     case GdiGetBreakExtra:
+      SafeResult = dc->Dc_Attr.lBreakExtra;
       break;
     case GdiGerCharBreak:
+      SafeResult = dc->Dc_Attr.cBreak;
       break;
     case GdiGetArcDirection:
+      SafeResult = dc->w.ArcDirection;
       break;
     case GdiGetEMFRestorDc:
       break;
     case GdiGetFontLanguageInfo:
       break;
     case GdiGetIsMemDc:
+      {
+        if (dc->w.flags & DC_MEMORY)
+          SafeResult = DC_TYPE_MEMORY;  // = dc->DC_Type;
+        else
+          SafeResult = DC_TYPE_DIRECT;
+      }
       break;
     case GdiGetMapMode:
+      SafeResult = dc->Dc_Attr.iMapMode;
       break;
     case GdiGetTextCharExtra:
+      SafeResult = dc->Dc_Attr.lTextExtra;
       break;
     default:
       SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -2241,18 +2252,34 @@ NtGdiGetAndSetDCDword(
     case GdtGetSetCopyCount:
       break;
     case GdiGetSetTextAlign:
+      SafeResult = dc->Dc_Attr.lTextAlign;
+      dc->Dc_Attr.lTextAlign = dwIn;
+      dc->Dc_Attr.flTextAlign = dwIn;
       break;
     case GdiGetSetRelAbs:
+      SafeResult = dc->Dc_Attr.lRelAbs;
+      dc->Dc_Attr.lRelAbs = dwIn;
       break;
     case GdiGetSetTextCharExtra:
+      SafeResult = dc->Dc_Attr.lTextExtra;
+      dc->Dc_Attr.lTextExtra = dwIn;
       break;
     case GdiGetSetSelectFont:
       break;
     case GdiGetSetMapperFlagsInternal:
       break;
     case GdiGetSetMapMode:
+      SafeResult = dc->Dc_Attr.iMapMode;
+      dc->Dc_Attr.iMapMode = dwIn;
       break;
     case GdiGetSetArcDirection:
+      if (dwIn != AD_COUNTERCLOCKWISE && dwIn != AD_CLOCKWISE)
+      {
+         SetLastWin32Error(ERROR_INVALID_PARAMETER);
+         Ret = FALSE;
+      }                        
+      SafeResult = dc->w.ArcDirection;
+      dc->w.ArcDirection = dwIn;
       break;
     default:
       SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -2290,7 +2317,6 @@ NtGdiGetAndSetDCDword(
 
 DC_SET_MODE( NtGdiSetBkMode, Dc_Attr.jBkMode, TRANSPARENT, OPAQUE )
 DC_SET_MODE( NtGdiSetPolyFillMode, Dc_Attr.jFillMode, ALTERNATE, WINDING )
-// DC_SET_MODE( NtGdiSetRelAbs, Dc_Attr.lRelAbs, ABSOLUTE, RELATIVE )
 DC_SET_MODE( NtGdiSetROP2, Dc_Attr.jROP2, R2_BLACK, R2_WHITE )
 DC_SET_MODE( NtGdiSetStretchBltMode, Dc_Attr.jStretchBltMode, BLACKONWHITE, HALFTONE )
 
index a2c1a60..63daa63 100644 (file)
@@ -278,12 +278,6 @@ IntGdiPolylineTo(DC      *dc,
   return ret;
 }
 
-INT FASTCALL
-IntGdiGetArcDirection(DC *dc)
-{
-  return dc->w.ArcDirection;
-}
-
 
 BOOL FASTCALL
 IntGdiPolyPolyline(DC      *dc,
@@ -327,25 +321,6 @@ NtGdiAngleArc(
   return FALSE;
 }
 
-INT
-STDCALL
-NtGdiGetArcDirection(HDC  hDC)
-{
-  PDC dc = DC_LockDc (hDC);
-  int ret = 0; // default to failure
-
-  if ( dc )
-  {
-    ret = IntGdiGetArcDirection ( dc );
-    DC_UnlockDc(dc);
-  }
-  else
-  {
-    SetLastWin32Error(ERROR_INVALID_HANDLE);
-  }
-
-  return ret;
-}
 
 BOOL
 STDCALL
@@ -956,24 +931,4 @@ NtGdiPolyPolyline(HDC            hDC,
   return Ret;
 }
 
-int
-STDCALL
-NtGdiSetArcDirection(HDC  hDC,
-                    int  ArcDirection)
-{
-  PDC  dc;
-  INT  nOldDirection = 0; // default to FAILURE
-
-  dc = DC_LockDc (hDC);
-  if ( !dc ) return 0;
-
-  if ( ArcDirection == AD_COUNTERCLOCKWISE || ArcDirection == AD_CLOCKWISE )
-  {
-    nOldDirection = dc->w.ArcDirection;
-    dc->w.ArcDirection = ArcDirection;
-  }
-
-  DC_UnlockDc( dc );
-  return nOldDirection;
-}
 /* EOF */
index d5ea951..adbf47f 100644 (file)
@@ -40,9 +40,6 @@ VOID FASTCALL PATH_ScaleNormalizedPoint (FLOAT_POINT corners[], double x, double
 BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath);
 BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, INT y2);
 
-INT FASTCALL
-IntGdiGetArcDirection(DC *dc);
-
 VOID FASTCALL
 IntGetCurrentPositionEx(PDC dc, LPPOINT pt);
 
@@ -750,7 +747,7 @@ PATH_Arc ( PDC dc, INT x1, INT y1, INT x2, INT y2,
 
   ASSERT ( dc );
 
-  clockwise = ( IntGdiGetArcDirection(dc) == AD_CLOCKWISE );
+  clockwise = ( dc->w.ArcDirection == AD_CLOCKWISE );
 
   /* Check that path is open */
   if ( dc->w.path.state != PATH_Open )
index e531bb9..18d6b5d 100644 (file)
@@ -4180,28 +4180,6 @@ FontGetObject(PTEXTOBJ TFont, INT Count, PVOID Buffer)
 }
 
 
-/* Remove this HAX! after the below function is done in GDI32.DLL! */
-INT
-STDCALL
-NtGdiGetSetTextCharExtra( HDC hDC, INT CharExtra, BOOL Set)
-{
-  /* Ulta-Ugly Hax! */
-  INT Ret = 0x80000000;
-
-  PDC dc = DC_LockDc ( hDC );
-  if (!dc)
-  {
-       DPRINT("TextCharacterExtra %d", CharExtra);
-       SetLastWin32Error(ERROR_INVALID_HANDLE);
-       return Ret;
-  }
-  DPRINT("TextCharacterExtra %d", CharExtra);
-  Ret = dc->Dc_Attr.lTextExtra;
-  if( Set ) dc->Dc_Attr.lTextExtra = CharExtra;
-  DC_UnlockDc(dc);
-  return (Ret);
-}
-
 static BOOL FASTCALL
 IntGetFullFileName(
     POBJECT_NAME_INFORMATION NameInfo,
index 4c3d07c..88bd000 100644 (file)
@@ -697,7 +697,6 @@ NtGdiAlphaBlend                         11
 NtGdiSelectObject                       2
 NtGdiSelectPalette                      3
 NtGdiSetAbortProc                       2
-NtGdiSetArcDirection                    2
 NtGdiSetBitmapDimensionEx               4
 NtGdiSetBkColor                         2
 NtGdiSetBkMode                          2
@@ -783,7 +782,6 @@ NtGdiEnumICMProfiles                    3
 NtGdiEscape                             5
 NtGdiExtTextOut                         8
 NtGdiGdiComment                         3
-NtGdiGetArcDirection                    1
 NtGdiGetAspectRatioFilterEx             2
 NtGdiGetBitmapDimensionEx               2
 NtGdiGetBkColor                         1
@@ -816,7 +814,6 @@ NtGdiGetPaletteEntries                  4
 NtGdiGetPixelFormat                     1
 NtGdiGetPolyFillMode                    1
 NtGdiGetROP2                            1
-NtGdiGetSetTextCharExtra                3
 NtGdiGetStretchBltMode                  1
 NtGdiGetSystemPaletteEntries            4
 NtGdiGetTextAlign                       1