Commit 08508289 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Initial path iterator implementation.

parent d59fe31e
......@@ -12,6 +12,7 @@ C_SRCS = \
graphics.c \
graphicspath.c \
matrix.c \
pathiterator.c \
pen.c
@MAKE_DLL_RULES@
......
......@@ -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
......
......@@ -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
/*
* 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;
}
......@@ -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
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment