ReactOS  0.4.15-dev-3173-g40ee59d
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 {
29  nativeCap = NULL;
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 {
38 }
39 
40 inline CustomLineCap *
42 {
45  if (lastStatus != Ok)
46  return NULL;
47 
48  CustomLineCap *newLineCap = new CustomLineCap(cap, lastStatus);
49  if (newLineCap == NULL)
50  {
52  }
53 
54  return newLineCap;
55 }
56 
57 inline LineCap
59 {
60  LineCap baseCap;
62  return baseCap;
63 }
64 
65 inline REAL
67 {
68  REAL inset;
70  return inset;
71 }
72 
73 inline Status
75 {
76  return lastStatus;
77 }
78 
79 inline Status
81 {
82 #if 1
83  return SetStatus(NotImplemented);
84 #else
85  return SetStatus(DllExports::GdipGetCustomLineCapStrokeCaps(nativeCap, startCap, endCap));
86 #endif
87 }
88 
89 inline LineJoin
91 {
92  LineJoin lineJoin;
94  return lineJoin;
95 }
96 
97 inline REAL
99 {
100  REAL widthScale;
102  return widthScale;
103 }
104 
105 inline Status
107 {
109 }
110 
111 inline Status
113 {
115 }
116 
117 inline Status
119 {
120  return SetStrokeCaps(strokeCap, strokeCap);
121 }
122 
123 inline Status
125 {
127 }
128 
129 inline Status
131 {
133 }
134 
135 inline Status
137 {
139 }
140 
142 {
143  public:
145  {
148  SetNativeCap(cap);
149  }
150 
151  REAL
153  {
154  REAL height;
157  return height;
158  }
159 
160  REAL
162  {
164  REAL middleInset;
166  return middleInset;
167  }
168 
169  REAL
171  {
173  REAL width;
175  return width;
176  }
177 
178  BOOL
180  {
182  BOOL isFilled;
184  return isFilled;
185  }
186 
187  Status
188  SetFillState(BOOL isFilled)
189  {
192  }
193 
194  Status
196  {
199  }
200 
201  Status
202  SetMiddleInset(REAL middleInset)
203  {
206  }
207 
208  Status
210  {
213  }
214 
215  protected:
218  {
219  return static_cast<GpAdjustableArrowCap *>(nativeCap);
220  }
221 
222  private:
223  // AdjustableArrowCap is not copyable
226  operator=(const AdjustableArrowCap &);
227 };
228 
229 #endif /* _GDIPLUSLINECAPS_H */
GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap *custom, GpLineCap start, GpLineCap end)
GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath *fillPath, GpPath *strokePath, GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap)
#define IN
Definition: typedefs.h:39
GLint GLint GLsizei width
Definition: gl.h:1546
GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap *custom, REAL *widthScale)
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap *custom, REAL *inset)
GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap(GpCustomLineCap *custom, GpLineCap base)
CustomLineCap * Clone()
Status SetHeight(REAL height)
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap *cap, REAL *width)
Status GetLastStatus()
AdjustableArrowCap(REAL height, REAL width, BOOL isFilled)
Status SetStatus(Status status) const
LineJoin
Definition: gdiplusenums.h:104
Status SetFillState(BOOL isFilled)
GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap *customCap)
GLenum cap
Definition: glext.h:9639
unsigned int BOOL
Definition: ntddk_ex.h:94
Status SetBaseCap(LineCap baseCap)
Status SetWidth(REAL width)
Status SetMiddleInset(REAL middleInset)
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap *cap, REAL *height)
Status SetStrokeJoin(LineJoin lineJoin)
Status SetStrokeCaps(LineCap startCap, LineCap endCap)
Status
Definition: gdiplustypes.h:24
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap *cap, BOOL fill)
friend GpCustomLineCap *& getNat(const CustomLineCap *cap)
LineCap
Definition: gdiplusenums.h:59
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap *cap, REAL width)
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap *cap, REAL height)
Status GetStrokeCaps(LineCap *startCap, LineCap *endCap)
REAL GetWidthScale()
GpAdjustableArrowCap * GetNativeAdjustableArrowCap() const
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap *from, GpCustomLineCap **to)
Definition: customlinecap.c:34
void SetNativeCap(GpCustomLineCap *cap)
GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap *custom, REAL width)
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GpCustomLineCap * nativeCap
GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap(REAL height, REAL width, BOOL fill, GpAdjustableArrowCap **cap)
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap *customCap, GpLineCap *baseCap)
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap *cap, REAL *middle)
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap *cap, REAL middle)
#define NULL
Definition: types.h:112
GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin(GpCustomLineCap *custom, GpLineJoin join)
Status SetBaseInset(REAL inset)
GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap *customCap, GpLineJoin *lineJoin)
float REAL
Definition: types.h:41
LineCap GetBaseCap()
AdjustableArrowCap & operator=(const AdjustableArrowCap &)
Status SetWidthScale(IN REAL widthScale)
Status SetStrokeCap(LineCap strokeCap)
GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap *custom, REAL inset)
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap *cap, BOOL *fill)
LineJoin GetStrokeJoin()