gdiplus: Moved two inline helpers to the header.
[wine] / dlls / gdiplus / gdiplus_private.h
1 /*
2  * Copyright (C) 2007 Google (Evan Stade)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef __WINE_GP_PRIVATE_H_
20 #define __WINE_GP_PRIVATE_H_
21
22 #include <math.h>
23 #include "windef.h"
24 #include "gdiplus.h"
25
26 #define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_ENDCAP_FLAT | PS_JOIN_MITER)
27
28 COLORREF ARGB2COLORREF(ARGB color);
29
30 static inline INT roundr(REAL x)
31 {
32     return (INT) floorf(x + 0.5);
33 }
34
35 static inline REAL deg2rad(REAL degrees)
36 {
37     return M_PI * degrees / 180.0;
38 }
39
40 struct GpPen{
41     UINT style;
42     COLORREF color;
43     GpUnit unit;
44     REAL width;
45     HPEN gdipen;
46     GpLineCap endcap;
47 };
48
49 struct GpGraphics{
50     HDC hdc;
51     HWND hwnd;
52 };
53
54 struct GpBrush{
55     HBRUSH gdibrush;
56     GpBrushType bt;
57     COLORREF color;
58 };
59
60 struct GpSolidFill{
61     GpBrush brush;
62 };
63
64 struct GpPath{
65     GpFillMode fill;
66     GpPathData pathdata;
67     BOOL newfigure; /* whether the next drawing action starts a new figure */
68     INT datalen; /* size of the arrays in pathdata */
69 };
70
71 #endif