gdiplus: Initial path iterator implementation.

oldstable
Evan Stade 2007-07-16 19:45:02 -07:00 committed by Alexandre Julliard
parent d59fe31e8b
commit 085082897a
6 changed files with 79 additions and 2 deletions

View File

@ -12,6 +12,7 @@ C_SRCS = \
graphics.c \
graphicspath.c \
matrix.c \
pathiterator.c \
pen.c
@MAKE_DLL_RULES@

View File

@ -110,7 +110,7 @@
@ stub GdipCreatePathGradient
@ stub GdipCreatePathGradientFromPath
@ stub GdipCreatePathGradientI
@ stub GdipCreatePathIter
@ stdcall GdipCreatePathIter(ptr ptr)
@ stdcall GdipCreatePen1(long long long ptr)
@ stub GdipCreatePen2
@ stub GdipCreateRegion
@ -135,7 +135,7 @@
@ stdcall GdipDeleteGraphics(ptr)
@ stdcall GdipDeleteMatrix(ptr)
@ stdcall GdipDeletePath(ptr)
@ stub GdipDeletePathIter
@ stdcall GdipDeletePathIter(ptr)
@ stdcall GdipDeletePen(ptr)
@ stub GdipDeletePrivateFontCollection
@ stub GdipDeleteRegion

View File

@ -83,4 +83,11 @@ struct GpMatrix{
REAL matrix[6];
};
struct GpPathIterator{
GpPathData pathdata;
INT subpath_pos; /* for NextSubpath methods */
INT marker_pos; /* for NextMarker methods */
INT pathtype_pos; /* for NextPathType methods */
};
#endif

View File

@ -0,0 +1,64 @@
/*
* Copyright (C) 2007 Google (Evan Stade)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath* path)
{
INT size;
if(!iterator || !path)
return InvalidParameter;
size = path->pathdata.Count;
*iterator = GdipAlloc(sizeof(GpPathIterator));
if(!*iterator) return OutOfMemory;
(*iterator)->pathdata.Types = GdipAlloc(size);
(*iterator)->pathdata.Points = GdipAlloc(size * sizeof(PointF));
memcpy((*iterator)->pathdata.Types, path->pathdata.Types, size);
memcpy((*iterator)->pathdata.Points, path->pathdata.Points,
size * sizeof(PointF));
(*iterator)->pathdata.Count = size;
(*iterator)->subpath_pos = 0;
(*iterator)->marker_pos = 0;
(*iterator)->pathtype_pos = 0;
return Ok;
}
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
{
if(!iter)
return InvalidParameter;
GdipFree(iter->pathdata.Types);
GdipFree(iter->pathdata.Points);
GdipFree(iter);
return Ok;
}

View File

@ -85,6 +85,9 @@ GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**);
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*);
GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT);
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator**,GpPath*);
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator*);
#ifdef __cplusplus
}
#endif

View File

@ -27,6 +27,7 @@ class GpBrush {};
class GpSolidFill {};
class GpPath {};
class GpMatrix {};
class GpPathIterator {};
#else /* end of c++ declarations */
@ -36,6 +37,7 @@ typedef struct GpBrush GpBrush;
typedef struct GpSolidFill GpSolidFill;
typedef struct GpPath GpPath;
typedef struct GpMatrix GpMatrix;
typedef struct GpPathIterator GpPathIterator;
#endif /* end of c declarations */