Fix copy count and added dc path flags and support new arc direction.
authorJames Tabor <james.tabor@reactos.org>
Thu, 17 Apr 2008 01:12:58 +0000 (01:12 +0000)
committerJames Tabor <james.tabor@reactos.org>
Thu, 17 Apr 2008 01:12:58 +0000 (01:12 +0000)
svn path=/trunk/; revision=32992

reactos/subsystems/win32/win32k/include/dc.h
reactos/subsystems/win32/win32k/objects/dc.c

index b13dc5a..5f83a8d 100644 (file)
@@ -9,6 +9,11 @@
 // Get/SetBounds/Rect support.
 #define DCB_WINDOWMGR 0x8000 // Queries the Windows bounding rectangle instead of the application's
 
+  /* DCPATH flPath */
+#define DCPATH_ACTIVE    0x0001
+#define DCPATH_SAVE      0x0002
+#define DCPATH_CLOCKWISE 0x0004
+
   /* DC flags */
 #define DC_SAVED      0x0002   /* It is a saved DC */
 #define DC_DIRTY      0x0004   /* hVisRgn has to be updated */
index 8de840a..80e4ced 100644 (file)
@@ -2187,6 +2187,8 @@ NtGdiGetAndSetDCDword(
   switch (u)
   {
     case GdtGetSetCopyCount:
+      SafeResult = dc->ulCopyCount;
+      dc->ulCopyCount = dwIn;
       break;
     case GdiGetSetTextAlign:
       SafeResult = Dc_Attr->lTextAlign;
@@ -2213,9 +2215,31 @@ NtGdiGetAndSetDCDword(
       {
          SetLastWin32Error(ERROR_INVALID_PARAMETER);
          Ret = FALSE;
+         break;
       }
-      SafeResult = dc->w.ArcDirection;
-      dc->w.ArcDirection = dwIn;
+      if ( Dc_Attr->dwLayout & LAYOUT_RTL )
+      {
+         SafeResult = AD_CLOCKWISE - ((dc->DcLevel.flPath & DCPATH_CLOCKWISE) != 0);
+         if ( dwIn == AD_CLOCKWISE )
+         {
+            dc->DcLevel.flPath |= DCPATH_CLOCKWISE;
+            break;
+         }
+         dc->DcLevel.flPath &= ~DCPATH_CLOCKWISE;
+      }
+      else
+      {
+         SafeResult = ((dc->DcLevel.flPath & DCPATH_CLOCKWISE) != 0) + AD_COUNTERCLOCKWISE;
+         if ( dwIn == AD_COUNTERCLOCKWISE)
+         {
+            dc->DcLevel.flPath |= DCPATH_CLOCKWISE;
+            break;
+         }
+         dc->DcLevel.flPath &= ~DCPATH_CLOCKWISE;
+      }
+
+      SafeResult = dc->w.ArcDirection; // Fixme
+      dc->w.ArcDirection = dwIn;       // Fixme
       break;
     default:
       SetLastWin32Error(ERROR_INVALID_PARAMETER);