Implement GetDCDWord, update GetObjectType and printing.c fixups.
authorJames Tabor <james.tabor@reactos.org>
Thu, 28 Dec 2006 22:36:53 +0000 (22:36 +0000)
committerJames Tabor <james.tabor@reactos.org>
Thu, 28 Dec 2006 22:36:53 +0000 (22:36 +0000)
svn path=/trunk/; revision=25235

reactos/dll/win32/gdi32/objects/dc.c
reactos/dll/win32/gdi32/objects/painting.c

index 2f3f949..7aecb4b 100644 (file)
@@ -322,6 +322,17 @@ GetRelAbs(
   return NtGdiGetRelAbs(hdc);
 }
 
+
+DWORD
+STDCALL
+GetDCDWord( HDC hDC, INT u, DWORD Result )
+{
+BOOL Ret = TRUE; //NtGdiGetDCDword( hDC, u, (DWORD*) &u );
+  if (!Ret) return Result;
+  else return u;
+}
+
+
 /*
  * @implemented
 */
@@ -528,10 +539,15 @@ GetObjectType(
         Ret = OBJ_REGION;
         break;
       case GDI_OBJECT_TYPE_DC:
-        Ret = OBJ_DC;
+        if ( GetDCDWord( h, GdiGetIsMemDc, 0))
+        {
+           Ret = OBJ_MEMDC;
+        }
+        else
+           Ret = OBJ_DC;
         break;
-      case GDI_OBJECT_TYPE_METADC:
-        Ret = OBJ_METADC;
+      case GDI_OBJECT_TYPE_COLORSPACE:
+        Ret = OBJ_COLORSPACE;
         break;
       case GDI_OBJECT_TYPE_METAFILE:
         Ret = OBJ_METAFILE;
@@ -559,3 +575,5 @@ GetObjectType(
     SetLastError(ERROR_INVALID_HANDLE);
   return Ret;
 }
+
+
index c0918ec..b050eb7 100644 (file)
@@ -139,8 +139,7 @@ MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
  if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
  {
     if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
-//      return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
-         return FALSE;
+      return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
     else
     {
       PLDC pLDC = Dc_Attr->pvLDC;
@@ -151,8 +150,7 @@ MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
       }
       if (pLDC->iType == LDC_EMFLDC)
       {
-        //if (!EMFDRV_MoveTo( hDC, x, y))
-          return FALSE;
+        if (!EMFDRV_MoveTo( hDC, x, y)) return FALSE;
       }
     }
  }
@@ -441,12 +439,8 @@ COLORREF
 STDCALL
 GetPixel( HDC hDC, INT x, INT y )
 {
- PDC_ATTR Dc_Attr;
  if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) return CLR_INVALID;
-
- if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return CLR_INVALID;
+ if (!GdiIsHandleValid((HGDIOBJ) hDC)) return CLR_INVALID;
  return NtGdiGetPixel( hDC, x, y);
 }