1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2008-2021. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%% This file is generated DO NOT EDIT
20
21-module(wxGraphicsContext).
22-include("wxe.hrl").
23-export([clip/2,clip/5,concatTransform/2,create/0,create/1,createBrush/2,createFont/2,
24  createFont/3,createFont/4,createLinearGradientBrush/6,createLinearGradientBrush/7,
25  createMatrix/1,createMatrix/2,createPath/1,createPen/2,createRadialGradientBrush/7,
26  createRadialGradientBrush/8,destroy/1,drawBitmap/6,drawEllipse/5,
27  drawIcon/6,drawLines/2,drawLines/3,drawPath/2,drawPath/3,drawRectangle/5,
28  drawRoundedRectangle/6,drawText/4,drawText/5,drawText/6,fillPath/2,
29  fillPath/3,getPartialTextExtents/2,getTextExtent/2,getTransform/1,
30  resetClip/1,rotate/2,scale/3,setBrush/2,setFont/2,setFont/3,setPen/2,
31  setTransform/2,strokeLine/5,strokeLines/2,strokePath/2,translate/3]).
32
33%% inherited exports
34-export([getRenderer/1,isNull/1,parent_class/1]).
35
36-type wxGraphicsContext() :: wx:wx_object().
37-export_type([wxGraphicsContext/0]).
38%% @hidden
39parent_class(wxGraphicsObject) -> true;
40parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
41
42%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreate">external documentation</a>.
43-spec create() -> wxGraphicsContext().
44create() ->
45  wxe_util:queue_cmd(?get_env(), ?wxGraphicsContext_Create_STAT_0),
46  wxe_util:rec(?wxGraphicsContext_Create_STAT_0).
47
48%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreate">external documentation</a>.
49-spec create(WindowDC) -> wxGraphicsContext() when
50	WindowDC::wxWindowDC:wxWindowDC() | wxWindow:wxWindow() | wxMemoryDC:wxMemoryDC() | wxImage:wxImage().
51create(#wx_ref{type=WindowDCT}=WindowDC) ->
52  IswxWindowDC = ?CLASS_T(WindowDCT,wxWindowDC),
53  IswxWindow = ?CLASS_T(WindowDCT,wxWindow),
54  IswxMemoryDC = ?CLASS_T(WindowDCT,wxMemoryDC),
55  IswxImage = ?CLASS_T(WindowDCT,wxImage),
56  WindowDCType = if
57    IswxWindowDC ->   wxWindowDC;
58    IswxWindow ->   wxWindow;
59    IswxMemoryDC ->   wxMemoryDC;
60    IswxImage ->   wxImage;
61    true -> error({badarg, WindowDCT})
62  end,
63  wxe_util:queue_cmd(wx:typeCast(WindowDC, WindowDCType),?get_env(),?wxGraphicsContext_Create_STAT_1),
64  wxe_util:rec(?wxGraphicsContext_Create_STAT_1).
65
66%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatepen">external documentation</a>.
67-spec createPen(This, Pen) -> wxGraphicsPen:wxGraphicsPen() when
68	This::wxGraphicsContext(), Pen::wxPen:wxPen().
69createPen(#wx_ref{type=ThisT}=This,#wx_ref{type=PenT}=Pen) ->
70  ?CLASS(ThisT,wxGraphicsContext),
71  ?CLASS(PenT,wxPen),
72  wxe_util:queue_cmd(This,Pen,?get_env(),?wxGraphicsContext_CreatePen),
73  wxe_util:rec(?wxGraphicsContext_CreatePen).
74
75%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatebrush">external documentation</a>.
76-spec createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush() when
77	This::wxGraphicsContext(), Brush::wxBrush:wxBrush().
78createBrush(#wx_ref{type=ThisT}=This,#wx_ref{type=BrushT}=Brush) ->
79  ?CLASS(ThisT,wxGraphicsContext),
80  ?CLASS(BrushT,wxBrush),
81  wxe_util:queue_cmd(This,Brush,?get_env(),?wxGraphicsContext_CreateBrush),
82  wxe_util:rec(?wxGraphicsContext_CreateBrush).
83
84%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreateradialgradientbrush">external documentation</a>.
85-spec createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops) -> wxGraphicsBrush:wxGraphicsBrush() when
86	This::wxGraphicsContext(), StartX::number(), StartY::number(), EndX::number(), EndY::number(), Radius::number(), Stops::wxGraphicsGradientStops:wxGraphicsGradientStops().
87createRadialGradientBrush(#wx_ref{type=ThisT}=This,StartX,StartY,EndX,EndY,Radius,#wx_ref{type=StopsT}=Stops)
88 when is_number(StartX),is_number(StartY),is_number(EndX),is_number(EndY),is_number(Radius) ->
89  ?CLASS(ThisT,wxGraphicsContext),
90  ?CLASS(StopsT,wxGraphicsGradientStops),
91  wxe_util:queue_cmd(This,StartX,StartY,EndX,EndY,Radius,Stops,?get_env(),?wxGraphicsContext_CreateRadialGradientBrush_6),
92  wxe_util:rec(?wxGraphicsContext_CreateRadialGradientBrush_6).
93
94%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreateradialgradientbrush">external documentation</a>.
95-spec createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, OColor, CColor) -> wxGraphicsBrush:wxGraphicsBrush() when
96	This::wxGraphicsContext(), StartX::number(), StartY::number(), EndX::number(), EndY::number(), Radius::number(), OColor::wx:wx_colour(), CColor::wx:wx_colour().
97createRadialGradientBrush(#wx_ref{type=ThisT}=This,StartX,StartY,EndX,EndY,Radius,OColor,CColor)
98 when is_number(StartX),is_number(StartY),is_number(EndX),is_number(EndY),is_number(Radius),?is_colordata(OColor),?is_colordata(CColor) ->
99  ?CLASS(ThisT,wxGraphicsContext),
100  wxe_util:queue_cmd(This,StartX,StartY,EndX,EndY,Radius,wxe_util:color(OColor),wxe_util:color(CColor),?get_env(),?wxGraphicsContext_CreateRadialGradientBrush_7),
101  wxe_util:rec(?wxGraphicsContext_CreateRadialGradientBrush_7).
102
103%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatelineargradientbrush">external documentation</a>.
104-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops) -> wxGraphicsBrush:wxGraphicsBrush() when
105	This::wxGraphicsContext(), X1::number(), Y1::number(), X2::number(), Y2::number(), Stops::wxGraphicsGradientStops:wxGraphicsGradientStops().
106createLinearGradientBrush(#wx_ref{type=ThisT}=This,X1,Y1,X2,Y2,#wx_ref{type=StopsT}=Stops)
107 when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2) ->
108  ?CLASS(ThisT,wxGraphicsContext),
109  ?CLASS(StopsT,wxGraphicsGradientStops),
110  wxe_util:queue_cmd(This,X1,Y1,X2,Y2,Stops,?get_env(),?wxGraphicsContext_CreateLinearGradientBrush_5),
111  wxe_util:rec(?wxGraphicsContext_CreateLinearGradientBrush_5).
112
113%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatelineargradientbrush">external documentation</a>.
114-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, C1, C2) -> wxGraphicsBrush:wxGraphicsBrush() when
115	This::wxGraphicsContext(), X1::number(), Y1::number(), X2::number(), Y2::number(), C1::wx:wx_colour(), C2::wx:wx_colour().
116createLinearGradientBrush(#wx_ref{type=ThisT}=This,X1,Y1,X2,Y2,C1,C2)
117 when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2),?is_colordata(C1),?is_colordata(C2) ->
118  ?CLASS(ThisT,wxGraphicsContext),
119  wxe_util:queue_cmd(This,X1,Y1,X2,Y2,wxe_util:color(C1),wxe_util:color(C2),?get_env(),?wxGraphicsContext_CreateLinearGradientBrush_6),
120  wxe_util:rec(?wxGraphicsContext_CreateLinearGradientBrush_6).
121
122%% @equiv createFont(This,Font, [])
123-spec createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont() when
124	This::wxGraphicsContext(), Font::wxFont:wxFont().
125
126createFont(This,Font)
127 when is_record(This, wx_ref),is_record(Font, wx_ref) ->
128  createFont(This,Font, []).
129
130%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatefont">external documentation</a>.
131%% <br /> Also:<br />
132%% createFont(This, Font, [Option]) -> wxGraphicsFont:wxGraphicsFont() when<br />
133%% 	This::wxGraphicsContext(), Font::wxFont:wxFont(),<br />
134%% 	Option :: {'col', wx:wx_colour()}.<br />
135%%
136-spec createFont(This, SizeInPixels, Facename) -> wxGraphicsFont:wxGraphicsFont() when
137	This::wxGraphicsContext(), SizeInPixels::number(), Facename::unicode:chardata();
138      (This, Font, [Option]) -> wxGraphicsFont:wxGraphicsFont() when
139	This::wxGraphicsContext(), Font::wxFont:wxFont(),
140	Option :: {'col', wx:wx_colour()}.
141
142createFont(This,SizeInPixels,Facename)
143 when is_record(This, wx_ref),is_number(SizeInPixels),?is_chardata(Facename) ->
144  createFont(This,SizeInPixels,Facename, []);
145createFont(#wx_ref{type=ThisT}=This,#wx_ref{type=FontT}=Font, Options)
146 when is_list(Options) ->
147  ?CLASS(ThisT,wxGraphicsContext),
148  ?CLASS(FontT,wxFont),
149  MOpts = fun({col, Col}) -> {col,wxe_util:color(Col)};
150          (BadOpt) -> erlang:error({badoption, BadOpt}) end,
151  Opts = lists:map(MOpts, Options),
152  wxe_util:queue_cmd(This,Font, Opts,?get_env(),?wxGraphicsContext_CreateFont_2),
153  wxe_util:rec(?wxGraphicsContext_CreateFont_2).
154
155%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatefont">external documentation</a>.
156-spec createFont(This, SizeInPixels, Facename, [Option]) -> wxGraphicsFont:wxGraphicsFont() when
157	This::wxGraphicsContext(), SizeInPixels::number(), Facename::unicode:chardata(),
158	Option :: {'flags', integer()}
159		 | {'col', wx:wx_colour()}.
160createFont(#wx_ref{type=ThisT}=This,SizeInPixels,Facename, Options)
161 when is_number(SizeInPixels),?is_chardata(Facename),is_list(Options) ->
162  ?CLASS(ThisT,wxGraphicsContext),
163  Facename_UC = unicode:characters_to_binary(Facename),
164  MOpts = fun({flags, _flags} = Arg) -> Arg;
165          ({col, Col}) -> {col,wxe_util:color(Col)};
166          (BadOpt) -> erlang:error({badoption, BadOpt}) end,
167  Opts = lists:map(MOpts, Options),
168  wxe_util:queue_cmd(This,SizeInPixels,Facename_UC, Opts,?get_env(),?wxGraphicsContext_CreateFont_3),
169  wxe_util:rec(?wxGraphicsContext_CreateFont_3).
170
171%% @equiv createMatrix(This, [])
172-spec createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when
173	This::wxGraphicsContext().
174
175createMatrix(This)
176 when is_record(This, wx_ref) ->
177  createMatrix(This, []).
178
179%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatematrix">external documentation</a>.
180-spec createMatrix(This, [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix() when
181	This::wxGraphicsContext(),
182	Option :: {'a', number()}
183		 | {'b', number()}
184		 | {'c', number()}
185		 | {'d', number()}
186		 | {'tx', number()}
187		 | {'ty', number()}.
188createMatrix(#wx_ref{type=ThisT}=This, Options)
189 when is_list(Options) ->
190  ?CLASS(ThisT,wxGraphicsContext),
191  MOpts = fun({a, _a} = Arg) -> Arg;
192          ({b, _b} = Arg) -> Arg;
193          ({c, _c} = Arg) -> Arg;
194          ({d, _d} = Arg) -> Arg;
195          ({tx, _tx} = Arg) -> Arg;
196          ({ty, _ty} = Arg) -> Arg;
197          (BadOpt) -> erlang:error({badoption, BadOpt}) end,
198  Opts = lists:map(MOpts, Options),
199  wxe_util:queue_cmd(This, Opts,?get_env(),?wxGraphicsContext_CreateMatrix),
200  wxe_util:rec(?wxGraphicsContext_CreateMatrix).
201
202%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextcreatepath">external documentation</a>.
203-spec createPath(This) -> wxGraphicsPath:wxGraphicsPath() when
204	This::wxGraphicsContext().
205createPath(#wx_ref{type=ThisT}=This) ->
206  ?CLASS(ThisT,wxGraphicsContext),
207  wxe_util:queue_cmd(This,?get_env(),?wxGraphicsContext_CreatePath),
208  wxe_util:rec(?wxGraphicsContext_CreatePath).
209
210%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextclip">external documentation</a>.
211-spec clip(This, Region) -> 'ok' when
212	This::wxGraphicsContext(), Region::wxRegion:wxRegion().
213clip(#wx_ref{type=ThisT}=This,#wx_ref{type=RegionT}=Region) ->
214  ?CLASS(ThisT,wxGraphicsContext),
215  ?CLASS(RegionT,wxRegion),
216  wxe_util:queue_cmd(This,Region,?get_env(),?wxGraphicsContext_Clip_1).
217
218%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextclip">external documentation</a>.
219-spec clip(This, X, Y, W, H) -> 'ok' when
220	This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number().
221clip(#wx_ref{type=ThisT}=This,X,Y,W,H)
222 when is_number(X),is_number(Y),is_number(W),is_number(H) ->
223  ?CLASS(ThisT,wxGraphicsContext),
224  wxe_util:queue_cmd(This,X,Y,W,H,?get_env(),?wxGraphicsContext_Clip_4).
225
226%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextresetclip">external documentation</a>.
227-spec resetClip(This) -> 'ok' when
228	This::wxGraphicsContext().
229resetClip(#wx_ref{type=ThisT}=This) ->
230  ?CLASS(ThisT,wxGraphicsContext),
231  wxe_util:queue_cmd(This,?get_env(),?wxGraphicsContext_ResetClip).
232
233%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawbitmap">external documentation</a>.
234-spec drawBitmap(This, Bmp, X, Y, W, H) -> 'ok' when
235	This::wxGraphicsContext(), Bmp::wxBitmap:wxBitmap(), X::number(), Y::number(), W::number(), H::number().
236drawBitmap(#wx_ref{type=ThisT}=This,#wx_ref{type=BmpT}=Bmp,X,Y,W,H)
237 when is_number(X),is_number(Y),is_number(W),is_number(H) ->
238  ?CLASS(ThisT,wxGraphicsContext),
239  ?CLASS(BmpT,wxBitmap),
240  wxe_util:queue_cmd(This,Bmp,X,Y,W,H,?get_env(),?wxGraphicsContext_DrawBitmap).
241
242%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawellipse">external documentation</a>.
243-spec drawEllipse(This, X, Y, W, H) -> 'ok' when
244	This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number().
245drawEllipse(#wx_ref{type=ThisT}=This,X,Y,W,H)
246 when is_number(X),is_number(Y),is_number(W),is_number(H) ->
247  ?CLASS(ThisT,wxGraphicsContext),
248  wxe_util:queue_cmd(This,X,Y,W,H,?get_env(),?wxGraphicsContext_DrawEllipse).
249
250%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawicon">external documentation</a>.
251-spec drawIcon(This, Icon, X, Y, W, H) -> 'ok' when
252	This::wxGraphicsContext(), Icon::wxIcon:wxIcon(), X::number(), Y::number(), W::number(), H::number().
253drawIcon(#wx_ref{type=ThisT}=This,#wx_ref{type=IconT}=Icon,X,Y,W,H)
254 when is_number(X),is_number(Y),is_number(W),is_number(H) ->
255  ?CLASS(ThisT,wxGraphicsContext),
256  ?CLASS(IconT,wxIcon),
257  wxe_util:queue_cmd(This,Icon,X,Y,W,H,?get_env(),?wxGraphicsContext_DrawIcon).
258
259%% @equiv drawLines(This,Points, [])
260-spec drawLines(This, Points) -> 'ok' when
261	This::wxGraphicsContext(), Points::[{X::float(), Y::float()}].
262
263drawLines(This,Points)
264 when is_record(This, wx_ref),is_list(Points) ->
265  drawLines(This,Points, []).
266
267%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawlines">external documentation</a>.
268%%<br /> FillStyle = ?wxODDEVEN_RULE | ?wxWINDING_RULE
269-spec drawLines(This, Points, [Option]) -> 'ok' when
270	This::wxGraphicsContext(), Points::[{X::float(), Y::float()}],
271	Option :: {'fillStyle', wx:wx_enum()}.
272drawLines(#wx_ref{type=ThisT}=This,Points, Options)
273 when is_list(Points),is_list(Options) ->
274  ?CLASS(ThisT,wxGraphicsContext),
275  MOpts = fun({fillStyle, _fillStyle} = Arg) -> Arg;
276          (BadOpt) -> erlang:error({badoption, BadOpt}) end,
277  Opts = lists:map(MOpts, Options),
278  wxe_util:queue_cmd(This,Points, Opts,?get_env(),?wxGraphicsContext_DrawLines).
279
280%% @equiv drawPath(This,Path, [])
281-spec drawPath(This, Path) -> 'ok' when
282	This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath().
283
284drawPath(This,Path)
285 when is_record(This, wx_ref),is_record(Path, wx_ref) ->
286  drawPath(This,Path, []).
287
288%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawpath">external documentation</a>.
289%%<br /> FillStyle = ?wxODDEVEN_RULE | ?wxWINDING_RULE
290-spec drawPath(This, Path, [Option]) -> 'ok' when
291	This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath(),
292	Option :: {'fillStyle', wx:wx_enum()}.
293drawPath(#wx_ref{type=ThisT}=This,#wx_ref{type=PathT}=Path, Options)
294 when is_list(Options) ->
295  ?CLASS(ThisT,wxGraphicsContext),
296  ?CLASS(PathT,wxGraphicsPath),
297  MOpts = fun({fillStyle, _fillStyle} = Arg) -> Arg;
298          (BadOpt) -> erlang:error({badoption, BadOpt}) end,
299  Opts = lists:map(MOpts, Options),
300  wxe_util:queue_cmd(This,Path, Opts,?get_env(),?wxGraphicsContext_DrawPath).
301
302%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawrectangle">external documentation</a>.
303-spec drawRectangle(This, X, Y, W, H) -> 'ok' when
304	This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number().
305drawRectangle(#wx_ref{type=ThisT}=This,X,Y,W,H)
306 when is_number(X),is_number(Y),is_number(W),is_number(H) ->
307  ?CLASS(ThisT,wxGraphicsContext),
308  wxe_util:queue_cmd(This,X,Y,W,H,?get_env(),?wxGraphicsContext_DrawRectangle).
309
310%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawroundedrectangle">external documentation</a>.
311-spec drawRoundedRectangle(This, X, Y, W, H, Radius) -> 'ok' when
312	This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number(), Radius::number().
313drawRoundedRectangle(#wx_ref{type=ThisT}=This,X,Y,W,H,Radius)
314 when is_number(X),is_number(Y),is_number(W),is_number(H),is_number(Radius) ->
315  ?CLASS(ThisT,wxGraphicsContext),
316  wxe_util:queue_cmd(This,X,Y,W,H,Radius,?get_env(),?wxGraphicsContext_DrawRoundedRectangle).
317
318%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawtext">external documentation</a>.
319-spec drawText(This, Str, X, Y) -> 'ok' when
320	This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number().
321drawText(#wx_ref{type=ThisT}=This,Str,X,Y)
322 when ?is_chardata(Str),is_number(X),is_number(Y) ->
323  ?CLASS(ThisT,wxGraphicsContext),
324  Str_UC = unicode:characters_to_binary(Str),
325  wxe_util:queue_cmd(This,Str_UC,X,Y,?get_env(),?wxGraphicsContext_DrawText_3).
326
327%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawtext">external documentation</a>.
328%% <br /> Also:<br />
329%% drawText(This, Str, X, Y, BackgroundBrush) -> 'ok' when<br />
330%% 	This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush().<br />
331%%
332-spec drawText(This, Str, X, Y, Angle) -> 'ok' when
333	This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), Angle::number();
334      (This, Str, X, Y, BackgroundBrush) -> 'ok' when
335	This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush().
336drawText(#wx_ref{type=ThisT}=This,Str,X,Y,Angle)
337 when ?is_chardata(Str),is_number(X),is_number(Y),is_number(Angle) ->
338  ?CLASS(ThisT,wxGraphicsContext),
339  Str_UC = unicode:characters_to_binary(Str),
340  wxe_util:queue_cmd(This,Str_UC,X,Y,Angle,?get_env(),?wxGraphicsContext_DrawText_4_0);
341drawText(#wx_ref{type=ThisT}=This,Str,X,Y,#wx_ref{type=BackgroundBrushT}=BackgroundBrush)
342 when ?is_chardata(Str),is_number(X),is_number(Y) ->
343  ?CLASS(ThisT,wxGraphicsContext),
344  Str_UC = unicode:characters_to_binary(Str),
345  ?CLASS(BackgroundBrushT,wxGraphicsBrush),
346  wxe_util:queue_cmd(This,Str_UC,X,Y,BackgroundBrush,?get_env(),?wxGraphicsContext_DrawText_4_1).
347
348%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextdrawtext">external documentation</a>.
349-spec drawText(This, Str, X, Y, Angle, BackgroundBrush) -> 'ok' when
350	This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), Angle::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush().
351drawText(#wx_ref{type=ThisT}=This,Str,X,Y,Angle,#wx_ref{type=BackgroundBrushT}=BackgroundBrush)
352 when ?is_chardata(Str),is_number(X),is_number(Y),is_number(Angle) ->
353  ?CLASS(ThisT,wxGraphicsContext),
354  Str_UC = unicode:characters_to_binary(Str),
355  ?CLASS(BackgroundBrushT,wxGraphicsBrush),
356  wxe_util:queue_cmd(This,Str_UC,X,Y,Angle,BackgroundBrush,?get_env(),?wxGraphicsContext_DrawText_5).
357
358%% @equiv fillPath(This,Path, [])
359-spec fillPath(This, Path) -> 'ok' when
360	This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath().
361
362fillPath(This,Path)
363 when is_record(This, wx_ref),is_record(Path, wx_ref) ->
364  fillPath(This,Path, []).
365
366%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextfillpath">external documentation</a>.
367%%<br /> FillStyle = ?wxODDEVEN_RULE | ?wxWINDING_RULE
368-spec fillPath(This, Path, [Option]) -> 'ok' when
369	This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath(),
370	Option :: {'fillStyle', wx:wx_enum()}.
371fillPath(#wx_ref{type=ThisT}=This,#wx_ref{type=PathT}=Path, Options)
372 when is_list(Options) ->
373  ?CLASS(ThisT,wxGraphicsContext),
374  ?CLASS(PathT,wxGraphicsPath),
375  MOpts = fun({fillStyle, _fillStyle} = Arg) -> Arg;
376          (BadOpt) -> erlang:error({badoption, BadOpt}) end,
377  Opts = lists:map(MOpts, Options),
378  wxe_util:queue_cmd(This,Path, Opts,?get_env(),?wxGraphicsContext_FillPath).
379
380%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextstrokepath">external documentation</a>.
381-spec strokePath(This, Path) -> 'ok' when
382	This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath().
383strokePath(#wx_ref{type=ThisT}=This,#wx_ref{type=PathT}=Path) ->
384  ?CLASS(ThisT,wxGraphicsContext),
385  ?CLASS(PathT,wxGraphicsPath),
386  wxe_util:queue_cmd(This,Path,?get_env(),?wxGraphicsContext_StrokePath).
387
388%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextgetpartialtextextents">external documentation</a>.
389-spec getPartialTextExtents(This, Text) -> [number()] when
390	This::wxGraphicsContext(), Text::unicode:chardata().
391getPartialTextExtents(#wx_ref{type=ThisT}=This,Text)
392 when ?is_chardata(Text) ->
393  ?CLASS(ThisT,wxGraphicsContext),
394  Text_UC = unicode:characters_to_binary(Text),
395  wxe_util:queue_cmd(This,Text_UC,?get_env(),?wxGraphicsContext_GetPartialTextExtents),
396  wxe_util:rec(?wxGraphicsContext_GetPartialTextExtents).
397
398%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextgettextextent">external documentation</a>.
399-spec getTextExtent(This, Text) -> Result when
400	Result ::{Width::number(), Height::number(), Descent::number(), ExternalLeading::number()},
401	This::wxGraphicsContext(), Text::unicode:chardata().
402getTextExtent(#wx_ref{type=ThisT}=This,Text)
403 when ?is_chardata(Text) ->
404  ?CLASS(ThisT,wxGraphicsContext),
405  Text_UC = unicode:characters_to_binary(Text),
406  wxe_util:queue_cmd(This,Text_UC,?get_env(),?wxGraphicsContext_GetTextExtent),
407  wxe_util:rec(?wxGraphicsContext_GetTextExtent).
408
409%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextrotate">external documentation</a>.
410-spec rotate(This, Angle) -> 'ok' when
411	This::wxGraphicsContext(), Angle::number().
412rotate(#wx_ref{type=ThisT}=This,Angle)
413 when is_number(Angle) ->
414  ?CLASS(ThisT,wxGraphicsContext),
415  wxe_util:queue_cmd(This,Angle,?get_env(),?wxGraphicsContext_Rotate).
416
417%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextscale">external documentation</a>.
418-spec scale(This, XScale, YScale) -> 'ok' when
419	This::wxGraphicsContext(), XScale::number(), YScale::number().
420scale(#wx_ref{type=ThisT}=This,XScale,YScale)
421 when is_number(XScale),is_number(YScale) ->
422  ?CLASS(ThisT,wxGraphicsContext),
423  wxe_util:queue_cmd(This,XScale,YScale,?get_env(),?wxGraphicsContext_Scale).
424
425%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontexttranslate">external documentation</a>.
426-spec translate(This, Dx, Dy) -> 'ok' when
427	This::wxGraphicsContext(), Dx::number(), Dy::number().
428translate(#wx_ref{type=ThisT}=This,Dx,Dy)
429 when is_number(Dx),is_number(Dy) ->
430  ?CLASS(ThisT,wxGraphicsContext),
431  wxe_util:queue_cmd(This,Dx,Dy,?get_env(),?wxGraphicsContext_Translate).
432
433%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextgettransform">external documentation</a>.
434-spec getTransform(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when
435	This::wxGraphicsContext().
436getTransform(#wx_ref{type=ThisT}=This) ->
437  ?CLASS(ThisT,wxGraphicsContext),
438  wxe_util:queue_cmd(This,?get_env(),?wxGraphicsContext_GetTransform),
439  wxe_util:rec(?wxGraphicsContext_GetTransform).
440
441%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextsettransform">external documentation</a>.
442-spec setTransform(This, Matrix) -> 'ok' when
443	This::wxGraphicsContext(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix().
444setTransform(#wx_ref{type=ThisT}=This,#wx_ref{type=MatrixT}=Matrix) ->
445  ?CLASS(ThisT,wxGraphicsContext),
446  ?CLASS(MatrixT,wxGraphicsMatrix),
447  wxe_util:queue_cmd(This,Matrix,?get_env(),?wxGraphicsContext_SetTransform).
448
449%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextconcattransform">external documentation</a>.
450-spec concatTransform(This, Matrix) -> 'ok' when
451	This::wxGraphicsContext(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix().
452concatTransform(#wx_ref{type=ThisT}=This,#wx_ref{type=MatrixT}=Matrix) ->
453  ?CLASS(ThisT,wxGraphicsContext),
454  ?CLASS(MatrixT,wxGraphicsMatrix),
455  wxe_util:queue_cmd(This,Matrix,?get_env(),?wxGraphicsContext_ConcatTransform).
456
457%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextsetbrush">external documentation</a>.
458-spec setBrush(This, Brush) -> 'ok' when
459	This::wxGraphicsContext(), Brush::wxGraphicsBrush:wxGraphicsBrush() | wxBrush:wxBrush().
460setBrush(#wx_ref{type=ThisT}=This,#wx_ref{type=BrushT}=Brush) ->
461  ?CLASS(ThisT,wxGraphicsContext),
462  IswxGraphicsBrush = ?CLASS_T(BrushT,wxGraphicsBrush),
463  IswxBrush = ?CLASS_T(BrushT,wxBrush),
464  BrushType = if
465    IswxGraphicsBrush ->   wxGraphicsBrush;
466    IswxBrush ->   wxBrush;
467    true -> error({badarg, BrushT})
468  end,
469  wxe_util:queue_cmd(This,wx:typeCast(Brush, BrushType),?get_env(),?wxGraphicsContext_SetBrush).
470
471%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextsetfont">external documentation</a>.
472-spec setFont(This, Font) -> 'ok' when
473	This::wxGraphicsContext(), Font::wxGraphicsFont:wxGraphicsFont().
474setFont(#wx_ref{type=ThisT}=This,#wx_ref{type=FontT}=Font) ->
475  ?CLASS(ThisT,wxGraphicsContext),
476  ?CLASS(FontT,wxGraphicsFont),
477  wxe_util:queue_cmd(This,Font,?get_env(),?wxGraphicsContext_SetFont_1).
478
479%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextsetfont">external documentation</a>.
480-spec setFont(This, Font, Colour) -> 'ok' when
481	This::wxGraphicsContext(), Font::wxFont:wxFont(), Colour::wx:wx_colour().
482setFont(#wx_ref{type=ThisT}=This,#wx_ref{type=FontT}=Font,Colour)
483 when ?is_colordata(Colour) ->
484  ?CLASS(ThisT,wxGraphicsContext),
485  ?CLASS(FontT,wxFont),
486  wxe_util:queue_cmd(This,Font,wxe_util:color(Colour),?get_env(),?wxGraphicsContext_SetFont_2).
487
488%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextsetpen">external documentation</a>.
489-spec setPen(This, Pen) -> 'ok' when
490	This::wxGraphicsContext(), Pen::wxPen:wxPen() | wxGraphicsPen:wxGraphicsPen().
491setPen(#wx_ref{type=ThisT}=This,#wx_ref{type=PenT}=Pen) ->
492  ?CLASS(ThisT,wxGraphicsContext),
493  IswxPen = ?CLASS_T(PenT,wxPen),
494  IswxGraphicsPen = ?CLASS_T(PenT,wxGraphicsPen),
495  PenType = if
496    IswxPen ->   wxPen;
497    IswxGraphicsPen ->   wxGraphicsPen;
498    true -> error({badarg, PenT})
499  end,
500  wxe_util:queue_cmd(This,wx:typeCast(Pen, PenType),?get_env(),?wxGraphicsContext_SetPen).
501
502%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextstrokeline">external documentation</a>.
503-spec strokeLine(This, X1, Y1, X2, Y2) -> 'ok' when
504	This::wxGraphicsContext(), X1::number(), Y1::number(), X2::number(), Y2::number().
505strokeLine(#wx_ref{type=ThisT}=This,X1,Y1,X2,Y2)
506 when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2) ->
507  ?CLASS(ThisT,wxGraphicsContext),
508  wxe_util:queue_cmd(This,X1,Y1,X2,Y2,?get_env(),?wxGraphicsContext_StrokeLine).
509
510%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgraphicscontext.html#wxgraphicscontextstrokelines">external documentation</a>.
511-spec strokeLines(This, Points) -> 'ok' when
512	This::wxGraphicsContext(), Points::[{X::float(), Y::float()}].
513strokeLines(#wx_ref{type=ThisT}=This,Points)
514 when is_list(Points) ->
515  ?CLASS(ThisT,wxGraphicsContext),
516  wxe_util:queue_cmd(This,Points,?get_env(),?wxGraphicsContext_StrokeLines).
517
518%% @doc Destroys this object, do not use object again
519-spec destroy(This::wxGraphicsContext()) -> 'ok'.
520destroy(Obj=#wx_ref{type=Type}) ->
521  ?CLASS(Type,wxGraphicsContext),
522  wxe_util:queue_cmd(Obj, ?get_env(), ?DESTROY_OBJECT),
523  ok.
524 %% From wxGraphicsObject
525%% @hidden
526isNull(This) -> wxGraphicsObject:isNull(This).
527%% @hidden
528getRenderer(This) -> wxGraphicsObject:getRenderer(This).
529