implemented: NtGdiAbortPath, NtGdiBeginPath, NtGdiEndPath, NtGdiFillPath, AbortPath...
authorChristoph von Wittich <christoph_vw@reactos.org>
Thu, 8 Dec 2005 23:27:34 +0000 (23:27 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Thu, 8 Dec 2005 23:27:34 +0000 (23:27 +0000)
svn path=/trunk/; revision=19982

reactos/lib/gdi32/gdi32.xml
reactos/lib/gdi32/misc/stubs.c
reactos/lib/gdi32/objects/path.c [new file with mode: 0644]
reactos/subsys/win32k/objects/path.c

index 80333d1..04af324 100644 (file)
@@ -35,6 +35,7 @@
                <file>region.c</file>
                <file>text.c</file>
                <file>utils.c</file>
+               <file>path.c</file>
        </directory>
        <linkerflag>-lgcc</linkerflag>
        <linkerflag>-nostartfiles</linkerflag>
index 265d9f8..a9808a4 100644 (file)
@@ -832,129 +832,6 @@ SetAbortProc(
 }
 
 
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-AbortPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-BeginPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-CloseFigure(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-EndPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-FillPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-FlattenPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-int
-STDCALL
-GetPath(
-       HDC             hdc,
-       LPPOINT         a1,
-       LPBYTE          a2,
-       int             a3
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
-/*
- * @unimplemented
- */
-HRGN
-STDCALL
-PathToRegion(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
 /*
  * @unimplemented
  */
@@ -973,99 +850,6 @@ PolyDraw(
 }
 
 
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-SelectClipPath(
-       HDC     hdc,
-       int     a1
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-SetMiterLimit(
-       HDC     hdc,
-       FLOAT   a1,
-       PFLOAT  a2
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-StrokeAndFillPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-StrokePath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-WidenPath(
-       HDC     hdc
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GetMiterLimit(
-       HDC     hdc,
-       PFLOAT  a1
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
 /*
  * @unimplemented
  */
diff --git a/reactos/lib/gdi32/objects/path.c b/reactos/lib/gdi32/objects/path.c
new file mode 100644 (file)
index 0000000..9260e56
--- /dev/null
@@ -0,0 +1,197 @@
+/* $Id: stubs.c 18897 2005-12-08 23:10:33Z cwittich $\r
+ *\r
+ * reactos/lib/gdi32/objects/path.c\r
+ *\r
+ * GDI32.DLL Path\r
+ *\r
+ * When you implement one of these functions,\r
+ * remove its stub from this file.\r
+ *\r
+ */\r
+\r
+#include "precomp.h"\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+AbortPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiAbortPath( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+BeginPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiBeginPath( hdc );\r
+}\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+CloseFigure(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiCloseFigure ( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+EndPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiEndPath( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+FillPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiFillPath( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+FlattenPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiFlattenPath ( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+int\r
+STDCALL\r
+GetPath(\r
+       HDC             hdc,\r
+       LPPOINT         a1,\r
+       LPBYTE          a2,\r
+       int             a3\r
+       )\r
+{\r
+       return NtGdiGetPath ( hdc, a1, a2, a3 );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+HRGN\r
+STDCALL\r
+PathToRegion(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiPathToRegion ( hdc );\r
+}\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+SetMiterLimit(\r
+       HDC     hdc,\r
+       FLOAT   a1,\r
+       PFLOAT  a2\r
+       )\r
+{\r
+       return NtGdiSetMiterLimit ( hdc, a1, a2 );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+StrokeAndFillPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiStrokeAndFillPath ( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+StrokePath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiStrokePath ( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+WidenPath(\r
+       HDC     hdc\r
+       )\r
+{\r
+       return NtGdiWidenPath ( hdc );\r
+}\r
+\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+GetMiterLimit(\r
+       HDC     hdc,\r
+       PFLOAT  a1\r
+       )\r
+{\r
+       return NtGdiGetMiterLimit ( hdc, a1 );\r
+}\r
+\r
+/*\r
+ * @implemented\r
+ */\r
+BOOL\r
+STDCALL\r
+SelectClipPath(\r
+       HDC     hdc,\r
+       int     Mode\r
+       )\r
+{\r
+       return NtGdiSelectClipPath ( hdc, Mode );\r
+}\r
index adf5e5b..7ba7208 100644 (file)
@@ -31,6 +31,7 @@
 BOOL FASTCALL PATH_AddEntry (GdiPath *pPath, const POINT *pPoint, BYTE flags);
 BOOL FASTCALL PATH_AddFlatBezier (GdiPath *pPath, POINT *pt, BOOL closed);
 BOOL FASTCALL PATH_DoArcPart (GdiPath *pPath, FLOAT_POINT corners[], double angleStart, double angleEnd, BOOL addMoveTo);
+BOOL FASTCALL PATH_FillPath( PDC dc, GdiPath *pPath );
 BOOL FASTCALL PATH_FlattenPath (GdiPath *pPath);
 VOID FASTCALL PATH_GetPathFromDC (PDC dc, GdiPath **ppPath);
 VOID FASTCALL PATH_NormalizePoint (FLOAT_POINT corners[], const FLOAT_POINT *pPoint, double *pX, double *pY);
@@ -46,16 +47,47 @@ BOOL
 STDCALL
 NtGdiAbortPath(HDC  hDC)
 {
-  UNIMPLEMENTED;
-  return FALSE;
+  GdiPath *pPath;
+  BOOL ret = TRUE;
+  PDC dc = DC_LockDc ( hDC );
+
+  if( !dc ) return FALSE;
+
+  /* Get pointer to path */
+  PATH_GetPathFromDC ( dc, &pPath );
+
+  PATH_EmptyPath( pPath );
+
+  DC_UnlockDc ( dc );
+  return ret;
 }
 
 BOOL
 STDCALL
-NtGdiBeginPath(HDC  hDC)
+NtGdiBeginPath( HDC  hDC )
 {
-  UNIMPLEMENTED;
-  return FALSE;
+  GdiPath *pPath;
+  BOOL ret = TRUE;
+  PDC dc = DC_LockDc ( hDC );
+
+  if( !dc ) return FALSE;
+
+  /* Get pointer to path */
+  PATH_GetPathFromDC ( dc, &pPath );
+      
+  /* If path is already open, do nothing */
+  if ( pPath->state != PATH_Open )
+  {
+    /* Make sure that path is empty */
+    PATH_EmptyPath( pPath );
+
+    /* Initialize variables for new path */
+    pPath->newStroke = TRUE;
+    pPath->state = PATH_Open;
+  }
+
+  DC_UnlockDc ( dc );
+  return ret;
 }
 
 BOOL
@@ -86,16 +118,50 @@ BOOL
 STDCALL
 NtGdiEndPath(HDC  hDC)
 {
-  UNIMPLEMENTED;
-  return FALSE;
+  GdiPath *pPath;
+  BOOL ret = TRUE;
+  PDC dc = DC_LockDc ( hDC );
+
+  if ( !dc ) return FALSE;
+
+  /* Get pointer to path */
+  PATH_GetPathFromDC ( dc, &pPath );
+
+  /* Check that path is currently being constructed */
+  if( pPath->state != PATH_Open )
+  {
+    ret = FALSE;
+  }
+  /* Set flag to indicate that path is finished */
+  else pPath->state = PATH_Closed;
+
+  DC_UnlockDc ( dc );
+  return ret;
 }
 
 BOOL
 STDCALL
 NtGdiFillPath(HDC  hDC)
 {
-  UNIMPLEMENTED;
-  return FALSE;
+  GdiPath *pPath;
+  BOOL ret = TRUE;
+  PDC dc = DC_LockDc ( hDC );
+
+  if ( !dc ) return FALSE;
+
+  /* Get pointer to path */
+  PATH_GetPathFromDC ( dc, &pPath );
+  
+  ret = PATH_FillPath( dc, pPath );
+  if( ret ) 
+  {
+    /* FIXME: Should the path be emptied even if conversion
+       failed? */
+    PATH_EmptyPath( pPath );
+  }
+
+  DC_UnlockDc ( dc );
+  return ret;
 }
 
 BOOL
@@ -169,10 +235,30 @@ NtGdiWidenPath(HDC  hDC)
    return FALSE;
 }
 
+
+
 /***********************************************************************
  * Exported functions
  */
 
+
+/* PATH_FillPath
+ * unimplemented
+ * 
+ */
+BOOL
+FASTCALL 
+PATH_FillPath( PDC dc, GdiPath *pPath )
+{
+  if( pPath->state != PATH_Closed )
+  {
+    return FALSE;
+  }
+    
+  UNIMPLEMENTED;
+  return FALSE;
+}
+
 /* PATH_InitGdiPath
  *
  * Initializes the GdiPath structure.