2007-06-11 20:51:15 +02:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_GP_PRIVATE_H_
|
|
|
|
#define __WINE_GP_PRIVATE_H_
|
|
|
|
|
2007-07-12 03:06:44 +02:00
|
|
|
#include <math.h>
|
2007-07-31 04:10:03 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2007-06-11 20:51:15 +02:00
|
|
|
#include "windef.h"
|
2007-07-20 03:22:59 +02:00
|
|
|
#include "wingdi.h"
|
2007-07-31 04:10:03 +02:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
|
|
|
|
#include "objbase.h"
|
|
|
|
#include "ocidl.h"
|
|
|
|
|
2007-06-11 20:51:15 +02:00
|
|
|
#include "gdiplus.h"
|
|
|
|
|
2007-07-17 04:45:16 +02:00
|
|
|
#define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER)
|
2007-07-12 03:06:56 +02:00
|
|
|
#define MAX_ARC_PTS (13)
|
2007-07-28 01:07:39 +02:00
|
|
|
#define MAX_DASHLEN (16) /* this is a limitation of gdi */
|
2007-07-31 04:10:03 +02:00
|
|
|
#define INCH_HIMETRIC (2540)
|
2007-06-11 20:51:15 +02:00
|
|
|
|
2008-07-25 01:01:21 +02:00
|
|
|
#define VERSION_MAGIC 0xdbc01001
|
2008-08-03 00:44:57 +02:00
|
|
|
#define TENSION_CONST (0.3)
|
2008-07-25 01:01:21 +02:00
|
|
|
|
2007-06-11 20:51:15 +02:00
|
|
|
COLORREF ARGB2COLORREF(ARGB color);
|
2007-07-12 03:06:56 +02:00
|
|
|
extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2,
|
|
|
|
REAL startAngle, REAL sweepAngle);
|
2007-08-03 00:53:23 +02:00
|
|
|
extern REAL gdiplus_atan2(REAL dy, REAL dx);
|
2007-08-08 03:42:00 +02:00
|
|
|
extern GpStatus hresult_to_status(HRESULT res);
|
2007-08-08 03:42:09 +02:00
|
|
|
extern REAL convert_unit(HDC hdc, GpUnit unit);
|
2007-06-11 20:51:15 +02:00
|
|
|
|
2008-08-03 00:44:57 +02:00
|
|
|
extern void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1,
|
|
|
|
REAL *y1, REAL *x2, REAL *y2);
|
|
|
|
extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj,
|
|
|
|
REAL tension, REAL *x, REAL *y);
|
|
|
|
|
2008-08-05 18:56:30 +02:00
|
|
|
extern BOOL lengthen_path(GpPath *path, INT len);
|
|
|
|
|
2008-08-27 00:03:27 +02:00
|
|
|
typedef struct region_element region_element;
|
|
|
|
extern inline void delete_element(region_element *element);
|
|
|
|
|
2007-07-12 03:06:44 +02:00
|
|
|
static inline INT roundr(REAL x)
|
|
|
|
{
|
|
|
|
return (INT) floorf(x + 0.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline REAL deg2rad(REAL degrees)
|
|
|
|
{
|
|
|
|
return M_PI * degrees / 180.0;
|
|
|
|
}
|
|
|
|
|
2007-06-11 20:51:15 +02:00
|
|
|
struct GpPen{
|
|
|
|
UINT style;
|
|
|
|
GpUnit unit;
|
|
|
|
REAL width;
|
2007-07-06 03:37:52 +02:00
|
|
|
GpLineCap endcap;
|
2007-07-17 04:44:50 +02:00
|
|
|
GpLineCap startcap;
|
|
|
|
GpDashCap dashcap;
|
2007-07-20 03:22:43 +02:00
|
|
|
GpCustomLineCap *customstart;
|
|
|
|
GpCustomLineCap *customend;
|
2007-07-13 04:42:47 +02:00
|
|
|
GpLineJoin join;
|
|
|
|
REAL miterlimit;
|
2007-07-17 04:45:16 +02:00
|
|
|
GpDashStyle dash;
|
2007-07-26 04:15:38 +02:00
|
|
|
REAL *dashes;
|
|
|
|
INT numdashes;
|
2007-08-09 04:42:03 +02:00
|
|
|
REAL offset; /* dash offset */
|
2007-07-20 03:22:59 +02:00
|
|
|
GpBrush *brush;
|
2008-07-31 07:08:32 +02:00
|
|
|
GpPenAlignment align;
|
2007-06-11 20:51:15 +02:00
|
|
|
};
|
|
|
|
|
2007-06-11 20:54:03 +02:00
|
|
|
struct GpGraphics{
|
|
|
|
HDC hdc;
|
|
|
|
HWND hwnd;
|
2007-07-14 02:51:13 +02:00
|
|
|
SmoothingMode smoothing;
|
2007-07-14 02:51:25 +02:00
|
|
|
CompositingQuality compqual;
|
2007-07-14 02:51:29 +02:00
|
|
|
InterpolationMode interpolation;
|
2007-07-14 02:51:33 +02:00
|
|
|
PixelOffsetMode pixeloffset;
|
2007-08-14 03:34:27 +02:00
|
|
|
CompositingMode compmode;
|
2007-08-15 04:00:09 +02:00
|
|
|
TextRenderingHint texthint;
|
2007-07-24 05:24:41 +02:00
|
|
|
GpUnit unit; /* page unit */
|
2007-07-25 02:18:39 +02:00
|
|
|
REAL scale; /* page scale */
|
2007-07-25 02:18:47 +02:00
|
|
|
GpMatrix * worldtrans; /* world transform */
|
2008-08-24 12:45:18 +02:00
|
|
|
BOOL busy; /* hdc handle obtained by GdipGetDC */
|
2008-08-27 00:03:27 +02:00
|
|
|
GpRegion *clip;
|
2007-06-11 20:54:03 +02:00
|
|
|
};
|
|
|
|
|
2007-06-15 01:09:07 +02:00
|
|
|
struct GpBrush{
|
|
|
|
HBRUSH gdibrush;
|
|
|
|
GpBrushType bt;
|
2007-07-20 03:22:59 +02:00
|
|
|
LOGBRUSH lb;
|
2007-06-15 01:09:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GpSolidFill{
|
|
|
|
GpBrush brush;
|
2007-07-24 05:24:24 +02:00
|
|
|
ARGB color;
|
2007-06-15 01:09:07 +02:00
|
|
|
};
|
|
|
|
|
2007-08-02 02:56:02 +02:00
|
|
|
struct GpPathGradient{
|
|
|
|
GpBrush brush;
|
2007-08-03 02:51:49 +02:00
|
|
|
PathData pathdata;
|
2007-08-02 02:56:02 +02:00
|
|
|
ARGB centercolor;
|
2007-08-02 02:56:10 +02:00
|
|
|
GpWrapMode wrap;
|
2007-08-03 02:52:49 +02:00
|
|
|
BOOL gamma;
|
2007-08-03 02:52:59 +02:00
|
|
|
GpPointF center;
|
2007-08-03 02:53:04 +02:00
|
|
|
GpPointF focus;
|
2008-07-21 21:30:39 +02:00
|
|
|
REAL* blendfac; /* blend factors */
|
|
|
|
REAL* blendpos; /* blend positions */
|
|
|
|
INT blendcount;
|
2007-08-02 02:56:02 +02:00
|
|
|
};
|
|
|
|
|
2007-08-08 03:42:29 +02:00
|
|
|
struct GpLineGradient{
|
|
|
|
GpBrush brush;
|
|
|
|
GpPointF startpoint;
|
|
|
|
GpPointF endpoint;
|
|
|
|
ARGB startcolor;
|
|
|
|
ARGB endcolor;
|
|
|
|
GpWrapMode wrap;
|
2007-08-08 03:42:40 +02:00
|
|
|
BOOL gamma;
|
2007-08-08 03:42:29 +02:00
|
|
|
};
|
|
|
|
|
2007-08-10 03:25:14 +02:00
|
|
|
struct GpTexture{
|
|
|
|
GpBrush brush;
|
2008-09-25 06:54:24 +02:00
|
|
|
GpMatrix *transform;
|
2008-10-21 17:39:21 +02:00
|
|
|
WrapMode wrap; /* not used yet */
|
2007-08-10 03:25:14 +02:00
|
|
|
};
|
|
|
|
|
2007-06-22 01:15:17 +02:00
|
|
|
struct GpPath{
|
|
|
|
GpFillMode fill;
|
|
|
|
GpPathData pathdata;
|
|
|
|
BOOL newfigure; /* whether the next drawing action starts a new figure */
|
2007-07-07 01:14:07 +02:00
|
|
|
INT datalen; /* size of the arrays in pathdata */
|
2007-06-22 01:15:17 +02:00
|
|
|
};
|
|
|
|
|
2007-07-12 03:07:48 +02:00
|
|
|
struct GpMatrix{
|
|
|
|
REAL matrix[6];
|
|
|
|
};
|
|
|
|
|
2007-07-17 04:45:02 +02:00
|
|
|
struct GpPathIterator{
|
|
|
|
GpPathData pathdata;
|
|
|
|
INT subpath_pos; /* for NextSubpath methods */
|
|
|
|
INT marker_pos; /* for NextMarker methods */
|
|
|
|
INT pathtype_pos; /* for NextPathType methods */
|
|
|
|
};
|
|
|
|
|
2007-07-20 03:22:34 +02:00
|
|
|
struct GpCustomLineCap{
|
|
|
|
GpPathData pathdata;
|
|
|
|
BOOL fill; /* TRUE for fill, FALSE for stroke */
|
|
|
|
GpLineCap cap; /* as far as I can tell, this value is ignored */
|
|
|
|
REAL inset; /* how much to adjust the end of the line */
|
2008-07-26 10:48:01 +02:00
|
|
|
GpLineJoin join;
|
2008-07-26 10:48:16 +02:00
|
|
|
REAL scale;
|
2007-07-20 03:22:34 +02:00
|
|
|
};
|
|
|
|
|
2008-09-03 18:34:58 +02:00
|
|
|
struct GpAdustableArrowCap{
|
|
|
|
GpCustomLineCap cap;
|
|
|
|
};
|
|
|
|
|
2007-07-31 04:10:03 +02:00
|
|
|
struct GpImage{
|
|
|
|
IPicture* picture;
|
|
|
|
ImageType type;
|
2008-05-09 14:39:43 +02:00
|
|
|
UINT flags;
|
2007-07-31 04:10:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GpMetafile{
|
|
|
|
GpImage image;
|
2007-07-31 04:09:57 +02:00
|
|
|
GpRectF bounds;
|
|
|
|
GpUnit unit;
|
2007-07-31 04:10:03 +02:00
|
|
|
};
|
|
|
|
|
2007-08-01 04:15:52 +02:00
|
|
|
struct GpBitmap{
|
|
|
|
GpImage image;
|
2007-08-01 04:16:20 +02:00
|
|
|
INT width;
|
|
|
|
INT height;
|
2007-08-04 02:30:30 +02:00
|
|
|
PixelFormat format;
|
2007-08-08 03:41:55 +02:00
|
|
|
ImageLockMode lockmode;
|
|
|
|
INT numlocks;
|
|
|
|
BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */
|
2007-08-01 04:15:52 +02:00
|
|
|
};
|
|
|
|
|
2007-07-31 04:09:54 +02:00
|
|
|
struct GpImageAttributes{
|
|
|
|
WrapMode wrap;
|
|
|
|
};
|
|
|
|
|
2007-08-14 03:34:51 +02:00
|
|
|
struct GpFont{
|
|
|
|
LOGFONTW lfw;
|
2008-06-21 19:02:53 +02:00
|
|
|
REAL emSize;
|
|
|
|
Unit unit;
|
2007-08-14 03:34:51 +02:00
|
|
|
};
|
|
|
|
|
2007-08-15 03:59:48 +02:00
|
|
|
struct GpStringFormat{
|
|
|
|
INT attr;
|
|
|
|
LANGID lang;
|
2008-07-28 23:12:49 +02:00
|
|
|
LANGID digitlang;
|
2007-08-15 04:00:32 +02:00
|
|
|
StringAlignment align;
|
2007-08-15 04:00:40 +02:00
|
|
|
StringTrimming trimming;
|
2007-08-15 04:00:53 +02:00
|
|
|
HotkeyPrefix hkprefix;
|
2007-08-15 04:01:15 +02:00
|
|
|
StringAlignment vertalign;
|
2008-07-28 23:12:49 +02:00
|
|
|
StringDigitSubstitute digitsub;
|
2008-07-30 13:06:39 +02:00
|
|
|
INT tabcount;
|
|
|
|
REAL firsttab;
|
|
|
|
REAL *tabs;
|
2007-08-15 03:59:48 +02:00
|
|
|
};
|
|
|
|
|
2008-06-21 19:02:47 +02:00
|
|
|
struct GpFontCollection{
|
|
|
|
GpFontFamily* FontFamilies;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GpFontFamily{
|
2008-07-03 20:26:50 +02:00
|
|
|
NEWTEXTMETRICW tmw;
|
2008-07-07 14:53:10 +02:00
|
|
|
WCHAR FamilyName[LF_FACESIZE];
|
2008-06-21 19:02:47 +02:00
|
|
|
};
|
|
|
|
|
2008-08-27 00:03:27 +02:00
|
|
|
/* internal use */
|
|
|
|
typedef enum RegionType
|
|
|
|
{
|
|
|
|
RegionDataRect = 0x10000000,
|
|
|
|
RegionDataPath = 0x10000001,
|
|
|
|
RegionDataEmptyRect = 0x10000002,
|
|
|
|
RegionDataInfiniteRect = 0x10000003,
|
|
|
|
} RegionType;
|
|
|
|
|
|
|
|
struct region_element
|
2008-07-25 01:01:21 +02:00
|
|
|
{
|
|
|
|
DWORD type; /* Rectangle, Path, SpecialRectangle, or CombineMode */
|
|
|
|
union
|
|
|
|
{
|
|
|
|
GpRectF rect;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
GpPath* path;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
DWORD size;
|
|
|
|
DWORD magic;
|
|
|
|
DWORD count;
|
|
|
|
DWORD flags;
|
|
|
|
} pathheader;
|
|
|
|
} pathdata;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct region_element *left; /* the original region */
|
|
|
|
struct region_element *right; /* what *left was combined with */
|
|
|
|
} combine;
|
|
|
|
} elementdata;
|
2008-08-27 00:03:27 +02:00
|
|
|
};
|
2008-07-25 01:01:21 +02:00
|
|
|
|
|
|
|
struct GpRegion{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
DWORD size;
|
|
|
|
DWORD checksum;
|
|
|
|
DWORD magic;
|
|
|
|
DWORD num_children;
|
|
|
|
} header;
|
|
|
|
region_element node;
|
|
|
|
};
|
|
|
|
|
2007-06-11 20:51:15 +02:00
|
|
|
#endif
|