ReactOS 0.4.15-dev-8131-g4988de4
gdipluslinecaps.h
Go to the documentation of this file.
1/*
2 * GdiPlusLineCaps.h
3 *
4 * Windows GDI+
5 *
6 * This file is part of the w32api package.
7 *
8 * THIS SOFTWARE IS NOT COPYRIGHTED
9 *
10 * This source code is offered for use in the public domain. You may
11 * use, modify or distribute it freely.
12 *
13 * This code is distributed in the hope that it will be useful but
14 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
15 * DISCLAIMED. This includes but is not limited to warranties of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 */
18
19#ifndef _GDIPLUSLINECAPS_H
20#define _GDIPLUSLINECAPS_H
21
23 const GraphicsPath *fillPath,
24 const GraphicsPath *strokePath,
25 LineCap baseCap,
26 REAL baseInset)
27 : nativeCap(NULL)
28{
30 GpPath *nativeFillPath = fillPath ? getNat(fillPath) : NULL;
31 GpPath *nativeStrokePath = strokePath ? getNat(strokePath) : NULL;
32 lastStatus = DllExports::GdipCreateCustomLineCap(nativeFillPath, nativeStrokePath, baseCap, baseInset, &nativeCap);
33}
34
36{
37 DllExports::GdipDeleteCustomLineCap(nativeCap);
38}
39
40inline CustomLineCap *
42{
44 SetStatus(DllExports::GdipCloneCustomLineCap(nativeCap, &cap));
45 if (lastStatus != Ok)
46 return NULL;
47
48 CustomLineCap *newLineCap = new CustomLineCap(cap, lastStatus);
49 if (newLineCap == NULL)
50 {
51 SetStatus(DllExports::GdipDeleteCustomLineCap(cap));
52 }
53
54 return newLineCap;
55}
56
57inline LineCap
59{
60 LineCap baseCap;
61 SetStatus(DllExports::GdipGetCustomLineCapBaseCap(nativeCap, &baseCap));
62 return baseCap;
63}
64
65inline REAL
67{
68 REAL inset;
69 SetStatus(DllExports::GdipGetCustomLineCapBaseInset(nativeCap, &inset));
70 return inset;
71}
72
73inline Status
75{
76 return lastStatus;
77}
78
79inline Status
81{
82#if 1
84#else
85 return SetStatus(DllExports::GdipGetCustomLineCapStrokeCaps(nativeCap, startCap, endCap));
86#endif
87}
88
89inline LineJoin
91{
92 LineJoin lineJoin;
93 SetStatus(DllExports::GdipGetCustomLineCapStrokeJoin(nativeCap, &lineJoin));
94 return lineJoin;
95}
96
97inline REAL
99{
100 REAL widthScale;
101 SetStatus(DllExports::GdipGetCustomLineCapWidthScale(nativeCap, &widthScale));
102 return widthScale;
103}
104
105inline Status
107{
108 return SetStatus(DllExports::GdipSetCustomLineCapBaseCap(nativeCap, baseCap));
109}
110
111inline Status
113{
114 return SetStatus(DllExports::GdipSetCustomLineCapBaseInset(nativeCap, inset));
115}
116
117inline Status
119{
120 return SetStrokeCaps(strokeCap, strokeCap);
121}
122
123inline Status
125{
126 return SetStatus(DllExports::GdipSetCustomLineCapStrokeCaps(nativeCap, startCap, endCap));
127}
128
129inline Status
131{
132 return SetStatus(DllExports::GdipSetCustomLineCapStrokeJoin(nativeCap, lineJoin));
133}
134
135inline Status
137{
138 return SetStatus(DllExports::GdipSetCustomLineCapWidthScale(nativeCap, widthScale));
139}
140
142{
143 public:
145 {
147 lastStatus = DllExports::GdipCreateAdjustableArrowCap(height, width, isFilled, &cap);
149 }
150
151 REAL
153 {
154 REAL height;
156 SetStatus(DllExports::GdipGetAdjustableArrowCapHeight(cap, &height));
157 return height;
158 }
159
160 REAL
162 {
164 REAL middleInset;
165 SetStatus(DllExports::GdipGetAdjustableArrowCapMiddleInset(cap, &middleInset));
166 return middleInset;
167 }
168
169 REAL
171 {
173 REAL width;
174 SetStatus(DllExports::GdipGetAdjustableArrowCapWidth(cap, &width));
175 return width;
176 }
177
178 BOOL
180 {
182 BOOL isFilled;
183 SetStatus(DllExports::GdipGetAdjustableArrowCapFillState(cap, &isFilled));
184 return isFilled;
185 }
186
187 Status
189 {
191 return SetStatus(DllExports::GdipSetAdjustableArrowCapFillState(cap, isFilled));
192 }
193
194 Status
196 {
198 return SetStatus(DllExports::GdipSetAdjustableArrowCapHeight(cap, height));
199 }
200
201 Status
202 SetMiddleInset(REAL middleInset)
203 {
205 return SetStatus(DllExports::GdipSetAdjustableArrowCapMiddleInset(cap, middleInset));
206 }
207
208 Status
210 {
212 return SetStatus(DllExports::GdipSetAdjustableArrowCapWidth(cap, width));
213 }
214
215 protected:
218 {
219 return static_cast<GpAdjustableArrowCap *>(nativeCap);
220 }
221
222 private:
223 // AdjustableArrowCap is not copyable
227};
228
229#endif /* _GDIPLUSLINECAPS_H */
Status SetMiddleInset(REAL middleInset)
AdjustableArrowCap(REAL height, REAL width, BOOL isFilled)
AdjustableArrowCap & operator=(const AdjustableArrowCap &)
Status SetHeight(REAL height)
Status SetWidth(REAL width)
GpAdjustableArrowCap * GetNativeAdjustableArrowCap() const
Status SetFillState(BOOL isFilled)
AdjustableArrowCap(const AdjustableArrowCap &)
void SetNativeCap(GpCustomLineCap *cap)
Status SetStrokeCap(LineCap strokeCap)
REAL GetWidthScale()
Status GetStrokeCaps(LineCap *startCap, LineCap *endCap)
Status GetLastStatus()
LineJoin GetStrokeJoin()
GpCustomLineCap * nativeCap
Status SetStrokeJoin(LineJoin lineJoin)
Status SetStatus(Status status) const
Status SetWidthScale(IN REAL widthScale)
Status SetBaseInset(REAL inset)
Status SetStrokeCaps(LineCap startCap, LineCap endCap)
LineCap GetBaseCap()
Status SetBaseCap(LineCap baseCap)
CustomLineCap * Clone()
friend GpCustomLineCap *& getNat(const CustomLineCap *cap)
#define NULL
Definition: types.h:112
float REAL
Definition: types.h:41
unsigned int BOOL
Definition: ntddk_ex.h:94
LineJoin
Definition: gdiplusenums.h:105
LineCap
Definition: gdiplusenums.h:60
Status
Definition: gdiplustypes.h:25
@ Ok
Definition: gdiplustypes.h:26
@ NotImplemented
Definition: gdiplustypes.h:32
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum cap
Definition: glext.h:9639
#define IN
Definition: typedefs.h:39