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