implemented: NtGdiAbortPath, NtGdiBeginPath, NtGdiEndPath, NtGdiFillPath, AbortPath, BeginPath, EndPath, FillPath, FlattenPath, GetPath, PathToRegion, SetMiterLimit, StrokeAndFillPath, StrokePath, WidenPath, GetMiterLimit and SelectClipPath Modified: trunk/reactos/lib/gdi32/gdi32.xml Modified: trunk/reactos/lib/gdi32/misc/stubs.c Added: trunk/reactos/lib/gdi32/objects/path.c Modified: trunk/reactos/subsys/win32k/objects/path.c _____
Modified: trunk/reactos/lib/gdi32/gdi32.xml --- trunk/reactos/lib/gdi32/gdi32.xml 2005-12-08 23:14:04 UTC (rev 19981) +++ trunk/reactos/lib/gdi32/gdi32.xml 2005-12-08 23:27:34 UTC (rev 19982) @@ -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> _____
Modified: trunk/reactos/lib/gdi32/misc/stubs.c --- trunk/reactos/lib/gdi32/misc/stubs.c 2005-12-08 23:14:04 UTC (rev 19981) +++ trunk/reactos/lib/gdi32/misc/stubs.c 2005-12-08 23:27:34 UTC (rev 19982) @@ -837,129 +837,6 @@
*/ 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 - */ -BOOL -STDCALL PolyDraw( HDC hdc, CONST POINT *a1, @@ -978,99 +855,6 @@ */ 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 - */ -BOOL -STDCALL ScaleViewportExtEx( HDC a0, int a1, _____
Added: trunk/reactos/lib/gdi32/objects/path.c --- trunk/reactos/lib/gdi32/objects/path.c 2005-12-08 23:14:04 UTC (rev 19981) +++ trunk/reactos/lib/gdi32/objects/path.c 2005-12-08 23:27:34 UTC (rev 19982) @@ -0,0 +1,197 @@
+/* $Id: stubs.c 18897 2005-12-08 23:10:33Z cwittich $ + * + * reactos/lib/gdi32/objects/path.c + * + * GDI32.DLL Path + * + * When you implement one of these functions, + * remove its stub from this file. + * + */ + +#include "precomp.h" + +/* + * @implemented + */ +BOOL +STDCALL +AbortPath( + HDC hdc + ) +{ + return NtGdiAbortPath( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +BeginPath( + HDC hdc + ) +{ + return NtGdiBeginPath( hdc ); +} + +/* + * @implemented + */ +BOOL +STDCALL +CloseFigure( + HDC hdc + ) +{ + return NtGdiCloseFigure ( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +EndPath( + HDC hdc + ) +{ + return NtGdiEndPath( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +FillPath( + HDC hdc + ) +{ + return NtGdiFillPath( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +FlattenPath( + HDC hdc + ) +{ + return NtGdiFlattenPath ( hdc ); +} + + +/* + * @implemented + */ +int +STDCALL +GetPath( + HDC hdc, + LPPOINT a1, + LPBYTE a2, + int a3 + ) +{ + return NtGdiGetPath ( hdc, a1, a2, a3 ); +} + + +/* + * @implemented + */ +HRGN +STDCALL +PathToRegion( + HDC hdc + ) +{ + return NtGdiPathToRegion ( hdc ); +} + +/* + * @implemented + */ +BOOL +STDCALL +SetMiterLimit( + HDC hdc, + FLOAT a1, + PFLOAT a2 + ) +{ + return NtGdiSetMiterLimit ( hdc, a1, a2 ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +StrokeAndFillPath( + HDC hdc + ) +{ + return NtGdiStrokeAndFillPath ( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +StrokePath( + HDC hdc + ) +{ + return NtGdiStrokePath ( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +WidenPath( + HDC hdc + ) +{ + return NtGdiWidenPath ( hdc ); +} + + +/* + * @implemented + */ +BOOL +STDCALL +GetMiterLimit( + HDC hdc, + PFLOAT a1 + ) +{ + return NtGdiGetMiterLimit ( hdc, a1 ); +} + +/* + * @implemented + */ +BOOL +STDCALL +SelectClipPath( + HDC hdc, + int Mode + ) +{ + return NtGdiSelectClipPath ( hdc, Mode ); +} _____
Modified: trunk/reactos/subsys/win32k/objects/path.c --- trunk/reactos/subsys/win32k/objects/path.c 2005-12-08 23:14:04 UTC (rev 19981) +++ trunk/reactos/subsys/win32k/objects/path.c 2005-12-08 23:27:34 UTC (rev 19982) @@ -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 @@ 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 @@ 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 @@ 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.