gdiplus: Implemented GdipCreatePath and GdipDeletePath.
This commit is contained in:
parent
f6f04f6e0e
commit
14802872b8
|
@ -10,6 +10,7 @@ C_SRCS = \
|
|||
brush.c \
|
||||
gdiplus.c \
|
||||
graphics.c \
|
||||
graphicspath.c \
|
||||
pen.c
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
@ stub GdipCreateMetafileFromWmfFile
|
||||
@ stub GdipCreatePath2
|
||||
@ stub GdipCreatePath2I
|
||||
@ stub GdipCreatePath
|
||||
@ stdcall GdipCreatePath(long ptr)
|
||||
@ stub GdipCreatePathGradient
|
||||
@ stub GdipCreatePathGradientFromPath
|
||||
@ stub GdipCreatePathGradientI
|
||||
|
@ -134,7 +134,7 @@
|
|||
@ stub GdipDeleteFontFamily
|
||||
@ stdcall GdipDeleteGraphics(ptr)
|
||||
@ stub GdipDeleteMatrix
|
||||
@ stub GdipDeletePath
|
||||
@ stdcall GdipDeletePath(ptr)
|
||||
@ stub GdipDeletePathIter
|
||||
@ stdcall GdipDeletePen(ptr)
|
||||
@ stub GdipDeletePrivateFontCollection
|
||||
|
|
|
@ -49,4 +49,11 @@ struct GpSolidFill{
|
|||
GpBrush brush;
|
||||
};
|
||||
|
||||
struct GpPath{
|
||||
GpFillMode fill;
|
||||
GpGraphics* graphics;
|
||||
GpPathData pathdata;
|
||||
BOOL newfigure; /* whether the next drawing action starts a new figure */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* 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 <math.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
|
||||
{
|
||||
HDC hdc;
|
||||
GpStatus ret;
|
||||
|
||||
if(!path)
|
||||
return InvalidParameter;
|
||||
|
||||
*path = GdipAlloc(sizeof(GpSolidFill));
|
||||
if(!*path) return OutOfMemory;
|
||||
|
||||
hdc = GetDC(0);
|
||||
|
||||
(*path)->fill = fill;
|
||||
(*path)->newfigure = TRUE;
|
||||
|
||||
ret = GdipCreateFromHDC(hdc, &((*path)->graphics));
|
||||
|
||||
if(ret != Ok){
|
||||
ReleaseDC(0, hdc);
|
||||
GdipFree(*path);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
|
||||
{
|
||||
if(!path || !(path->graphics))
|
||||
return InvalidParameter;
|
||||
|
||||
ReleaseDC(0, path->graphics->hdc);
|
||||
GdipDeleteGraphics(path->graphics);
|
||||
GdipFree(path);
|
||||
|
||||
return Ok;
|
||||
}
|
|
@ -39,10 +39,17 @@ enum BrushType
|
|||
BrushTypeLinearGradient = 4
|
||||
};
|
||||
|
||||
enum FillMode
|
||||
{
|
||||
FillModeAlternate = 0,
|
||||
FillModeWinding = 1
|
||||
};
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
typedef enum Unit Unit;
|
||||
typedef enum BrushType BrushType;
|
||||
typedef enum FillMode FillMode;
|
||||
|
||||
#endif /* end of c typedefs */
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
|
|||
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);
|
||||
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode,GpPath**);
|
||||
GpStatus WINGDIPAPI GdipDeletePath(GpPath*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,7 @@ class GpGraphics {};
|
|||
class GpGraphics {};
|
||||
class GpBrush {};
|
||||
class GpSolidFill {};
|
||||
class GpPath {};
|
||||
|
||||
#else /* end of c++ declarations */
|
||||
|
||||
|
@ -32,6 +33,7 @@ typedef struct GpGraphics GpGraphics;
|
|||
typedef struct GpPen GpPen;
|
||||
typedef struct GpBrush GpBrush;
|
||||
typedef struct GpSolidFill GpSolidFill;
|
||||
typedef struct GpPath GpPath;
|
||||
|
||||
#endif /* end of c declarations */
|
||||
|
||||
|
@ -39,5 +41,7 @@ typedef Status GpStatus;
|
|||
typedef Unit GpUnit;
|
||||
typedef BrushType GpBrushType;
|
||||
typedef PointF GpPointF;
|
||||
typedef FillMode GpFillMode;
|
||||
typedef PathData GpPathData;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -89,6 +89,39 @@ public:
|
|||
REAL Y;
|
||||
};
|
||||
|
||||
class PathData
|
||||
{
|
||||
public:
|
||||
PathData()
|
||||
{
|
||||
Count = 0;
|
||||
Points = NULL;
|
||||
Types = NULL;
|
||||
}
|
||||
|
||||
~PathData()
|
||||
{
|
||||
if (Points != NULL)
|
||||
{
|
||||
delete Points;
|
||||
}
|
||||
|
||||
if (Types != NULL)
|
||||
{
|
||||
delete Types;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
PathData(const PathData &);
|
||||
PathData& operator=(const PathData &);
|
||||
|
||||
public:
|
||||
INT Count;
|
||||
PointF* Points;
|
||||
BYTE* Types;
|
||||
};
|
||||
|
||||
#else /* end of c++ typedefs */
|
||||
|
||||
typedef struct PointF
|
||||
|
@ -97,6 +130,13 @@ typedef struct PointF
|
|||
REAL Y;
|
||||
} PointF;
|
||||
|
||||
typedef struct PathData
|
||||
{
|
||||
INT Count;
|
||||
PointF* Points;
|
||||
BYTE* Types;
|
||||
} PathData;
|
||||
|
||||
typedef enum Status Status;
|
||||
|
||||
#endif /* end of c typedefs */
|
||||
|
|
Loading…
Reference in New Issue