]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: _graphics.i | |
3 | // Purpose: Wrapper definitions for wx.GraphicsPath, wx.GraphicsContext | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 2-Oct-2006 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 2006 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | // Not a %module | |
14 | ||
15 | ||
16 | //--------------------------------------------------------------------------- | |
17 | %newgroup | |
18 | ||
19 | %{ | |
20 | #include <wx/graphics.h> | |
21 | %} | |
22 | ||
23 | // Turn off the aquisition of the Global Interpreter Lock for the classes and | |
24 | // functions in this file | |
25 | %threadWrapperOff | |
26 | ||
27 | ||
28 | //--------------------------------------------------------------------------- | |
29 | //--------------------------------------------------------------------------- | |
30 | ||
31 | %{ | |
32 | #if !wxUSE_GRAPHICS_CONTEXT | |
33 | // C++ stub classes for platforms or build configurations that don't have | |
34 | // wxGraphicsContext yet. | |
35 | ||
36 | class wxGraphicsRenderer; | |
37 | class wxGraphicsMatrix; | |
38 | ||
39 | ||
40 | class wxGraphicsObject : public wxObject | |
41 | { | |
42 | public : | |
43 | wxGraphicsObject() {} | |
44 | wxGraphicsObject( wxGraphicsRenderer* ) { | |
45 | PyErr_SetString(PyExc_NotImplementedError, | |
46 | "wx.GraphicsObject is not available on this platform."); | |
47 | } | |
48 | wxGraphicsObject( const wxGraphicsObject& ) {} | |
49 | virtual ~wxGraphicsObject() {} | |
50 | bool IsNull() const { return false; } | |
51 | wxGraphicsRenderer* GetRenderer() const { return NULL; } | |
52 | } ; | |
53 | ||
54 | ||
55 | ||
56 | class wxGraphicsPen : public wxGraphicsObject | |
57 | { | |
58 | public: | |
59 | wxGraphicsPen() {} | |
60 | virtual ~wxGraphicsPen() {} | |
61 | } ; | |
62 | wxGraphicsPen wxNullGraphicsPen; | |
63 | ||
64 | ||
65 | ||
66 | class wxGraphicsBrush : public wxGraphicsObject | |
67 | { | |
68 | public : | |
69 | wxGraphicsBrush() {} | |
70 | virtual ~wxGraphicsBrush() {} | |
71 | } ; | |
72 | wxGraphicsBrush wxNullGraphicsBrush; | |
73 | ||
74 | ||
75 | ||
76 | class wxGraphicsFont : public wxGraphicsObject | |
77 | { | |
78 | public : | |
79 | wxGraphicsFont() {} | |
80 | virtual ~wxGraphicsFont() {} | |
81 | } ; | |
82 | wxGraphicsFont wxNullGraphicsFont; | |
83 | ||
84 | ||
85 | ||
86 | class wxGraphicsPath : public wxGraphicsObject | |
87 | { | |
88 | public : | |
89 | wxGraphicsPath() { } | |
90 | wxGraphicsPath(wxGraphicsRenderer* ) { | |
91 | PyErr_SetString(PyExc_NotImplementedError, | |
92 | "wx.GraphicsPath is not available on this platform."); | |
93 | } | |
94 | virtual ~wxGraphicsPath() {} | |
95 | ||
96 | void MoveToPoint( wxDouble, wxDouble ) {} | |
97 | void MoveToPoint( const wxPoint2DDouble& ) {} | |
98 | void AddLineToPoint( wxDouble, wxDouble ) {} | |
99 | void AddLineToPoint( const wxPoint2DDouble& ) {} | |
100 | void AddCurveToPoint( wxDouble, wxDouble, wxDouble, wxDouble, wxDouble, wxDouble ) {} | |
101 | void AddCurveToPoint( const wxPoint2DDouble&, const wxPoint2DDouble&, const wxPoint2DDouble&) {} | |
102 | void AddPath( const wxGraphicsPath& ) {} | |
103 | void CloseSubpath() {} | |
104 | void GetCurrentPoint( wxDouble&, wxDouble&) const {} | |
105 | wxPoint2DDouble GetCurrentPoint() const { return wxPoint2D(0,0); } | |
106 | void AddArc( wxDouble, wxDouble, wxDouble, wxDouble, wxDouble, bool ) {} | |
107 | void AddArc( const wxPoint2DDouble& , wxDouble, wxDouble , wxDouble , bool ) {} | |
108 | ||
109 | void AddQuadCurveToPoint( wxDouble, wxDouble, wxDouble, wxDouble ) {} | |
110 | void AddRectangle( wxDouble, wxDouble, wxDouble, wxDouble ) {} | |
111 | void AddCircle( wxDouble, wxDouble, wxDouble ) {} | |
112 | void AddArcToPoint( wxDouble, wxDouble , wxDouble, wxDouble, wxDouble ) {} | |
113 | ||
114 | void AddEllipse( wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
115 | void AddRoundedRectangle( wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
116 | void * GetNativePath() const { return NULL; } | |
117 | void UnGetNativePath(void *) const {} | |
118 | void Transform( const wxGraphicsMatrix& ) {} | |
119 | void GetBox(wxDouble *, wxDouble *, wxDouble *, wxDouble *) const {} | |
120 | wxRect2D GetBox() const { return wxRect2D(0,0,0,0); } | |
121 | ||
122 | bool Contains( wxDouble , wxDouble , int ) const { return false; } | |
123 | bool Contains( const wxPoint2DDouble& , int ) const { return false; } | |
124 | }; | |
125 | wxGraphicsPath wxNullGraphicsPath; | |
126 | ||
127 | ||
128 | class wxGraphicsMatrix : public wxGraphicsObject | |
129 | { | |
130 | public : | |
131 | wxGraphicsMatrix() { } | |
132 | wxGraphicsMatrix(wxGraphicsRenderer* ) { | |
133 | PyErr_SetString(PyExc_NotImplementedError, | |
134 | "wx.GraphicsMatrix is not available on this platform."); | |
135 | } | |
136 | virtual ~wxGraphicsMatrix() {} | |
137 | virtual void Concat( const wxGraphicsMatrix & ) {} | |
138 | virtual void Copy( const wxGraphicsMatrix & ) {} | |
139 | virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble , | |
140 | wxDouble , wxDouble ) {} | |
141 | virtual void Get(wxDouble*, wxDouble*, wxDouble*, | |
142 | wxDouble*, wxDouble*, wxDouble*) {} | |
143 | virtual void Invert() {} | |
144 | virtual bool IsEqual( const wxGraphicsMatrix& t) const { return false; } | |
145 | virtual bool IsIdentity() const { return false; } | |
146 | virtual void Translate( wxDouble , wxDouble ) {} | |
147 | virtual void Scale( wxDouble , wxDouble ) {} | |
148 | virtual void Rotate( wxDouble ) {} | |
149 | virtual void TransformPoint( wxDouble *, wxDouble * ) const {} | |
150 | virtual void TransformDistance( wxDouble *, wxDouble * ) const {} | |
151 | virtual void * GetNativeMatrix() const { return NULL; } | |
152 | }; | |
153 | wxGraphicsMatrix wxNullGraphicsMatrix; | |
154 | ||
155 | ||
156 | class wxGraphicsContext : public wxGraphicsObject | |
157 | { | |
158 | public: | |
159 | ||
160 | wxGraphicsContext(wxGraphicsRenderer* ) { | |
161 | PyErr_SetString(PyExc_NotImplementedError, | |
162 | "wx.GraphicsContext is not available on this platform."); | |
163 | } | |
164 | ||
165 | virtual ~wxGraphicsContext() {} | |
166 | ||
167 | static wxGraphicsContext* Create() { | |
168 | PyErr_SetString(PyExc_NotImplementedError, | |
169 | "wx.GraphicsContext is not available on this platform."); | |
170 | return NULL; | |
171 | } | |
172 | static wxGraphicsContext* Create( const wxWindowDC& ) { | |
173 | PyErr_SetString(PyExc_NotImplementedError, | |
174 | "wx.GraphicsContext is not available on this platform."); | |
175 | return NULL; | |
176 | } | |
177 | ||
178 | static wxGraphicsContext* CreateFromNative( void * ) { | |
179 | PyErr_SetString(PyExc_NotImplementedError, | |
180 | "wx.GraphicsContext is not available on this platform."); | |
181 | return NULL; | |
182 | } | |
183 | ||
184 | static wxGraphicsContext* CreateFromNativeWindow( void * ) { | |
185 | PyErr_SetString(PyExc_NotImplementedError, | |
186 | "wx.GraphicsContext is not available on this platform."); | |
187 | return NULL; | |
188 | } | |
189 | ||
190 | static wxGraphicsContext* Create( wxWindow* ) { | |
191 | PyErr_SetString(PyExc_NotImplementedError, | |
192 | "wx.GraphicsContext is not available on this platform."); | |
193 | return NULL; | |
194 | } | |
195 | ||
196 | wxGraphicsPath CreatePath() { return wxNullGraphicsPath; } | |
197 | ||
198 | virtual wxGraphicsPen CreatePen(const wxPen& ) { return wxNullGraphicsPen; } | |
199 | ||
200 | virtual wxGraphicsBrush CreateBrush(const wxBrush& ) { return wxNullGraphicsBrush; } | |
201 | ||
202 | virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble , wxDouble , wxDouble , wxDouble , | |
203 | const wxColour&, const wxColour&) { return wxNullGraphicsBrush; } | |
204 | ||
205 | virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, | |
206 | wxDouble xc, wxDouble yc, wxDouble radius, | |
207 | const wxColour &oColor, const wxColour &cColor) { return wxNullGraphicsBrush; } | |
208 | ||
209 | virtual wxGraphicsFont CreateFont( const wxFont &, const wxColour & ) { return wxNullGraphicsFont; } | |
210 | ||
211 | virtual wxGraphicsMatrix CreateMatrix( wxDouble, wxDouble, wxDouble, wxDouble, | |
212 | wxDouble, wxDouble) { return wxNullGraphicsMatrix; } | |
213 | ||
214 | virtual void PushState() {} | |
215 | virtual void PopState() {} | |
216 | virtual void Clip( const wxRegion & ) {} | |
217 | virtual void Clip( wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
218 | virtual void ResetClip() {} | |
219 | virtual void * GetNativeContext() { return NULL; } | |
220 | virtual int GetLogicalFunction() const { return 0; } | |
221 | virtual bool SetLogicalFunction(int ) {} | |
222 | virtual void Translate( wxDouble , wxDouble ) {} | |
223 | virtual void Scale( wxDouble , wxDouble ) {} | |
224 | virtual void Rotate( wxDouble ) {} | |
225 | virtual void ConcatTransform( const wxGraphicsMatrix& ) {} | |
226 | virtual void SetTransform( const wxGraphicsMatrix& ) {} | |
227 | virtual wxGraphicsMatrix GetTransform() const { return wxNullGraphicsMatrix; } | |
228 | ||
229 | virtual void SetPen( const wxGraphicsPen& ) {} | |
230 | void SetPen( const wxPen& ) {} | |
231 | ||
232 | virtual void SetBrush( const wxGraphicsBrush& ) {} | |
233 | void SetBrush( const wxBrush& ) {} | |
234 | ||
235 | virtual void SetFont( const wxGraphicsFont& ) {} | |
236 | void SetFont( const wxFont&, const wxColour& ) {} | |
237 | ||
238 | virtual void StrokePath( const wxGraphicsPath & ) {} | |
239 | virtual void FillPath( const wxGraphicsPath &, int ) {} | |
240 | virtual void DrawPath( const wxGraphicsPath &, int ) {} | |
241 | ||
242 | virtual void DrawText( const wxString &, wxDouble , wxDouble ) {} | |
243 | virtual void DrawText( const wxString &, wxDouble , wxDouble , wxDouble ) {} | |
244 | virtual void DrawText( const wxString &, wxDouble , wxDouble , wxGraphicsBrush ) {} | |
245 | virtual void DrawText( const wxString &, wxDouble , wxDouble , wxDouble , wxGraphicsBrush ) {} | |
246 | virtual void GetTextExtent( const wxString &, wxDouble *, wxDouble *, | |
247 | wxDouble *, wxDouble * ) const {} | |
248 | virtual void GetPartialTextExtents(const wxString& , wxArrayDouble& ) const {} | |
249 | ||
250 | virtual void DrawBitmap( const wxBitmap &, wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
251 | virtual void DrawIcon( const wxIcon &, wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
252 | ||
253 | virtual void StrokeLine( wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
254 | virtual void StrokeLines( size_t , const wxPoint2DDouble *) {} | |
255 | virtual void StrokeLines( size_t , const wxPoint2DDouble *, const wxPoint2DDouble *) {} | |
256 | virtual void DrawLines( size_t , const wxPoint2DDouble *, int ) {} | |
257 | virtual void DrawRectangle( wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
258 | virtual void DrawEllipse( wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
259 | virtual void DrawRoundedRectangle( wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ) {} | |
260 | virtual bool ShouldOffset() const { return false; } | |
261 | }; | |
262 | ||
263 | ||
264 | class wxGraphicsRenderer : public wxObject | |
265 | { | |
266 | public : | |
267 | wxGraphicsRenderer() { | |
268 | PyErr_SetString(PyExc_NotImplementedError, | |
269 | "wx.GraphicsRenderer is not available on this platform."); | |
270 | } | |
271 | ||
272 | virtual ~wxGraphicsRenderer() {} | |
273 | ||
274 | static wxGraphicsRenderer* GetDefaultRenderer() { | |
275 | PyErr_SetString(PyExc_NotImplementedError, | |
276 | "wx.GraphicsRenderer is not available on this platform."); | |
277 | return NULL; | |
278 | } | |
279 | ||
280 | virtual wxGraphicsContext * CreateContext( const wxWindowDC& ) { return NULL; } | |
281 | virtual wxGraphicsContext * CreateContextFromNativeContext( void * ) { return NULL; } | |
282 | virtual wxGraphicsContext * CreateContextFromNativeWindow( void * ) { return NULL; } | |
283 | virtual wxGraphicsContext * CreateContext( wxWindow* ) { return NULL; } | |
284 | virtual wxGraphicsContext * CreateMeasuringContext() { return NULL; } | |
285 | ||
286 | virtual wxGraphicsPath CreatePath() { return wxNullGraphicsPath; } | |
287 | ||
288 | virtual wxGraphicsMatrix CreateMatrix( wxDouble , wxDouble , wxDouble , wxDouble , | |
289 | wxDouble , wxDouble ) { return wxNullGraphicsMatrix; } | |
290 | ||
291 | virtual wxGraphicsPen CreatePen(const wxPen& ) { return wxNullGraphicsPen; } | |
292 | virtual wxGraphicsBrush CreateBrush(const wxBrush& ) { return wxNullGraphicsBrush; } | |
293 | virtual wxGraphicsBrush CreateLinearGradientBrush(wxDouble , wxDouble , wxDouble , wxDouble , | |
294 | const wxColour&, const wxColour&) { return wxNullGraphicsBrush; } | |
295 | virtual wxGraphicsBrush CreateRadialGradientBrush(wxDouble , wxDouble , wxDouble , wxDouble , wxDouble , | |
296 | const wxColour &, const wxColour &) { return wxNullGraphicsBrush; } | |
297 | virtual wxGraphicsFont CreateFont( const wxFont & , const wxColour & ) { return wxNullGraphicsFont; } | |
298 | }; | |
299 | ||
300 | ||
301 | ||
302 | class wxGCDC: public wxWindowDC | |
303 | { | |
304 | public: | |
305 | wxGCDC(const wxWindowDC&) { | |
306 | wxPyBlock_t blocked = wxPyBeginBlockThreads(); | |
307 | PyErr_SetString(PyExc_NotImplementedError, | |
308 | "wxGCDC is not available on this platform."); | |
309 | wxPyEndBlockThreads(blocked); | |
310 | } | |
311 | ||
312 | wxGCDC(const wxWindow*) { | |
313 | wxPyBlock_t blocked = wxPyBeginBlockThreads(); | |
314 | PyErr_SetString(PyExc_NotImplementedError, | |
315 | "wxGCDC is not available on this platform."); | |
316 | wxPyEndBlockThreads(blocked); | |
317 | } | |
318 | ||
319 | wxGCDC() { | |
320 | wxPyBlock_t blocked = wxPyBeginBlockThreads(); | |
321 | PyErr_SetString(PyExc_NotImplementedError, | |
322 | "wxGCDC is not available on this platform."); | |
323 | wxPyEndBlockThreads(blocked); | |
324 | } | |
325 | ||
326 | virtual ~wxGCDC() {} | |
327 | ||
328 | wxGraphicsContext* GetGraphicsContext() { return NULL; } | |
329 | void SetGraphicsContext( wxGraphicsContext* ) {} | |
330 | }; | |
331 | ||
332 | #endif | |
333 | %} | |
334 | ||
335 | //--------------------------------------------------------------------------- | |
336 | //--------------------------------------------------------------------------- | |
337 | ||
338 | ||
339 | %typemap(in) (size_t points, wxPoint2D* points_array ) { | |
340 | $2 = wxPoint2D_LIST_helper($input, &$1); | |
341 | if ($2 == NULL) SWIG_fail; | |
342 | } | |
343 | %typemap(freearg) (size_t points, wxPoint2D* points_array ) { | |
344 | if ($2) delete [] $2; | |
345 | } | |
346 | ||
347 | ||
348 | ||
349 | MustHaveApp(wxGraphicsPath); | |
350 | MustHaveApp(wxGraphicsContext); | |
351 | MustHaveApp(wxGCDC); | |
352 | ||
353 | typedef double wxDouble; | |
354 | ||
355 | ||
356 | //--------------------------------------------------------------------------- | |
357 | ||
358 | ||
359 | DocStr(wxGraphicsObject, | |
360 | "This class is the superclass of native graphics objects like pens | |
361 | etc. It provides the internal reference counting. It is not to be | |
362 | instantiated by user code.", ""); | |
363 | class wxGraphicsObject : public wxObject | |
364 | { | |
365 | public : | |
366 | wxGraphicsObject( wxGraphicsRenderer* renderer = NULL ); | |
367 | virtual ~wxGraphicsObject(); | |
368 | ||
369 | DocDeclStr( | |
370 | bool , IsNull() const , | |
371 | "Is this object valid (false) or still empty (true)?", ""); | |
372 | ||
373 | DocDeclStr( | |
374 | wxGraphicsRenderer* , GetRenderer() const, | |
375 | "Returns the renderer that was used to create this instance, or | |
376 | ``None`` if it has not been initialized yet.", ""); | |
377 | ||
378 | }; | |
379 | ||
380 | ||
381 | DocStr(wxGraphicsPen, | |
382 | "A wx.GraphicsPen is a native representation of a pen. It is used for | |
383 | stroking a path on a `wx.GraphicsContext`. The contents are specific and | |
384 | private to the respective renderer. The only way to get a valid instance | |
385 | is via a CreatePen call on the graphics context or the renderer | |
386 | instance.", ""); | |
387 | class wxGraphicsPen : public wxGraphicsObject | |
388 | { | |
389 | public : | |
390 | wxGraphicsPen(); | |
391 | virtual ~wxGraphicsPen(); | |
392 | }; | |
393 | ||
394 | DocStr(wxGraphicsBrush, | |
395 | "A wx.GraphicsBrush is a native representation of a brush. It is used | |
396 | for filling a path on a `wx.GraphicsContext`. The contents are | |
397 | specific and private to the respective renderer. The only way to get a | |
398 | valid instance is via a Create...Brush call on the graphics context or | |
399 | the renderer instance.", ""); | |
400 | class wxGraphicsBrush : public wxGraphicsObject | |
401 | { | |
402 | public : | |
403 | wxGraphicsBrush(); | |
404 | virtual ~wxGraphicsBrush(); | |
405 | }; | |
406 | ||
407 | ||
408 | DocStr(wxGraphicsFont, | |
409 | "A `wx.GraphicsFont` is a native representation of a font (including | |
410 | text colour). The contents are specific an private to the respective | |
411 | renderer. The only way to get a valid instance is via a CreateFont | |
412 | call on the graphics context or the renderer instance.", ""); | |
413 | class wxGraphicsFont : public wxGraphicsObject | |
414 | { | |
415 | public : | |
416 | wxGraphicsFont(); | |
417 | virtual ~wxGraphicsFont(); | |
418 | }; | |
419 | ||
420 | ||
421 | //--------------------------------------------------------------------------- | |
422 | ||
423 | DocStr(wxGraphicsMatrix, | |
424 | "A wx.GraphicsMatrix is a native representation of an affine | |
425 | matrix. The contents are specific an private to the respective | |
426 | renderer. The only way to get a valid instance is via a CreateMatrix | |
427 | call on the graphics context or the renderer instance.", ""); | |
428 | class wxGraphicsMatrix : public wxGraphicsObject | |
429 | { | |
430 | public : | |
431 | wxGraphicsMatrix(); | |
432 | virtual ~wxGraphicsMatrix(); | |
433 | ||
434 | DocDeclStr( | |
435 | virtual void , Concat( const wxGraphicsMatrix& t ), | |
436 | "Concatenates the passed in matrix to the current matrix.", ""); | |
437 | ||
438 | // %extend { | |
439 | // DocStr(Copy, | |
440 | // "Copy the passed in matrix to this one.", ""); | |
441 | // void Copy( const wxGraphicsMatrix& t ) { | |
442 | // *self = t; | |
443 | // } | |
444 | // } | |
445 | ||
446 | ||
447 | DocDeclStr( | |
448 | virtual void , Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, | |
449 | wxDouble tx=0.0, wxDouble ty=0.0), | |
450 | "Sets the matrix to the specified values (default values are the | |
451 | identity matrix.)", ""); | |
452 | ||
453 | ||
454 | DocDeclAStr( | |
455 | virtual void , Get(wxDouble* OUTPUT, wxDouble* OUTPUT, wxDouble* OUTPUT, | |
456 | wxDouble* OUTPUT, wxDouble* OUTPUT, wxDouble* OUTPUT), | |
457 | "Get(self) --> (a, b, c, d, tx, ty)", | |
458 | "Gets the component values of the matrix and returns them as a tuple.", ""); | |
459 | ||
460 | ||
461 | DocDeclStr( | |
462 | virtual void , Invert(), | |
463 | "Inverts the matrix.", ""); | |
464 | ||
465 | ||
466 | DocDeclStr( | |
467 | virtual bool , IsEqual( const wxGraphicsMatrix& t) const, | |
468 | "Returns ``True`` if the elements of the transformation matrix are | |
469 | equal", ""); | |
470 | ||
471 | ||
472 | DocDeclStr( | |
473 | virtual bool , IsIdentity() const, | |
474 | "Returns ``True`` if this is the identity matrix", ""); | |
475 | ||
476 | ||
477 | DocDeclStr( | |
478 | virtual void , Translate( wxDouble dx , wxDouble dy ), | |
479 | "Add a translation to this matrix.", ""); | |
480 | ||
481 | ||
482 | DocDeclStr( | |
483 | virtual void , Scale( wxDouble xScale , wxDouble yScale ), | |
484 | "Scales this matrix.", ""); | |
485 | ||
486 | ||
487 | DocDeclStr( | |
488 | virtual void , Rotate( wxDouble angle ), | |
489 | "Rotates this matrix. The angle should be specified in radians.", ""); | |
490 | ||
491 | ||
492 | DocDeclAStr( | |
493 | virtual void , TransformPoint( wxDouble *INOUT, wxDouble *INOUT ) const, | |
494 | "TransformPoint(self, x, y) --> (x, y)", | |
495 | "Applies this matrix to a point, returns the resulting point values", ""); | |
496 | ||
497 | ||
498 | DocDeclAStr( | |
499 | virtual void , TransformDistance( wxDouble *INOUT, wxDouble *INOUT ) const, | |
500 | "TransformDistance(self, dx, dy) --> (dx, dy)", | |
501 | "Applies this matrix to a distance (ie. performs all transforms except | |
502 | translations)", ""); | |
503 | ||
504 | ||
505 | DocDeclStr( | |
506 | virtual void * , GetNativeMatrix() const, | |
507 | "Returns the native representation of the matrix. For CoreGraphics this | |
508 | is a CFAffineMatrix pointer. For GDIPlus a Matrix Pointer and for | |
509 | Cairo a cairo_matrix_t pointer. NOTE: For wxPython we still need a | |
510 | way to make this value usable.", ""); | |
511 | }; | |
512 | ||
513 | //--------------------------------------------------------------------------- | |
514 | ||
515 | class wxGraphicsPath : public wxGraphicsObject | |
516 | { | |
517 | public : | |
518 | wxGraphicsPath(); | |
519 | virtual ~wxGraphicsPath(); | |
520 | ||
521 | ||
522 | %nokwargs MoveToPoint; | |
523 | DocStr(MoveToPoint, | |
524 | "Begins a new subpath at the specified point.", ""); | |
525 | virtual void MoveToPoint( wxDouble x, wxDouble y ); | |
526 | void MoveToPoint( const wxPoint2D& p); | |
527 | ||
528 | ||
529 | %nokwargs AddLineToPoint; | |
530 | DocStr(AddLineToPoint, | |
531 | "Adds a straight line from the current point to the specified point.", ""); | |
532 | virtual void AddLineToPoint( wxDouble x, wxDouble y ); | |
533 | void AddLineToPoint( const wxPoint2D& p); | |
534 | ||
535 | ||
536 | %nokwargs AddCurveToPoint; | |
537 | DocStr(AddCurveToPoint, | |
538 | "Adds a cubic Bezier curve from the current point, using two control | |
539 | points and an end point", ""); | |
540 | virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1, | |
541 | wxDouble cx2, wxDouble cy2, | |
542 | wxDouble x, wxDouble y ); | |
543 | void AddCurveToPoint( const wxPoint2D& c1, const wxPoint2D& c2, const wxPoint2D& e); | |
544 | ||
545 | ||
546 | ||
547 | DocDeclStr( | |
548 | virtual void , AddPath( const wxGraphicsPath& path ), | |
549 | "Adds another path", ""); | |
550 | ||
551 | ||
552 | DocDeclStr( | |
553 | virtual void , CloseSubpath(), | |
554 | "Closes the current sub-path.", ""); | |
555 | ||
556 | ||
557 | DocDeclStr( | |
558 | wxPoint2D , GetCurrentPoint() const, | |
559 | "Gets the last point of the current path, (0,0) if not yet set", ""); | |
560 | ||
561 | ||
562 | %nokwargs AddArc; | |
563 | DocStr(AddArc, | |
564 | "Adds an arc of a circle centering at (x,y) with radius (r) from | |
565 | startAngle to endAngle", ""); | |
566 | virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, | |
567 | wxDouble startAngle, wxDouble endAngle, bool clockwise=true ); | |
568 | void AddArc( const wxPoint2D& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise=true); | |
569 | ||
570 | ||
571 | DocDeclStr( | |
572 | virtual void , AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y ), | |
573 | "Adds a quadratic Bezier curve from the current point, using a control | |
574 | point and an end point", ""); | |
575 | ||
576 | ||
577 | DocDeclStr( | |
578 | virtual void , AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ), | |
579 | "Appends a rectangle as a new closed subpath.", ""); | |
580 | ||
581 | ||
582 | DocDeclStr( | |
583 | virtual void , AddCircle( wxDouble x, wxDouble y, wxDouble r ), | |
584 | "Appends a circle around (x,y) with radius r as a new closed subpath.", ""); | |
585 | ||
586 | ||
587 | DocDeclStr( | |
588 | virtual void , AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) , | |
589 | "Appends an arc to two tangents connecting (current) to (x1,y1) and | |
590 | (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1)", ""); | |
591 | ||
592 | ||
593 | DocDeclStr( | |
594 | virtual void , AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h), | |
595 | "Appends an ellipse fitting into the passed in rectangle.", ""); | |
596 | ||
597 | ||
598 | DocDeclStr( | |
599 | virtual void , AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius), | |
600 | "Appends a rounded rectangle.", ""); | |
601 | ||
602 | ||
603 | DocDeclStr( | |
604 | virtual void * , GetNativePath() const, | |
605 | "Returns the native path (CGPathRef for Core Graphics, Path pointer for | |
606 | GDIPlus and a cairo_path_t pointer for cairo). NOTE: For wxPython we | |
607 | still need a way to make this value usable.", ""); | |
608 | ||
609 | ||
610 | DocDeclStr( | |
611 | virtual void , UnGetNativePath(void *p) const, | |
612 | "Gives back the native path returned by GetNativePath() because there | |
613 | might be some deallocations necessary (eg on cairo the native path | |
614 | returned by GetNativePath is newly allocated each time).", ""); | |
615 | ||
616 | ||
617 | DocDeclStr( | |
618 | virtual void , Transform( const wxGraphicsMatrix& matrix ), | |
619 | "Transforms each point of this path by the matrix", ""); | |
620 | ||
621 | ||
622 | DocDeclStr( | |
623 | wxRect2D , GetBox() const, | |
624 | "Gets the bounding box enclosing all points (possibly including control | |
625 | points)", ""); | |
626 | ||
627 | ||
628 | %nokwargs Contains; | |
629 | DocStr(Contains, | |
630 | "Returns ``True`` if the point is within the path.", ""); | |
631 | virtual bool Contains( wxDouble x, wxDouble y, int fillStyle = wxODDEVEN_RULE) const; | |
632 | bool Contains( const wxPoint2D& c, int fillStyle = wxODDEVEN_RULE) const; | |
633 | ||
634 | }; | |
635 | ||
636 | ||
637 | //--------------------------------------------------------------------------- | |
638 | ||
639 | %immutable; | |
640 | const wxGraphicsPen wxNullGraphicsPen; | |
641 | const wxGraphicsBrush wxNullGraphicsBrush; | |
642 | const wxGraphicsFont wxNullGraphicsFont; | |
643 | const wxGraphicsMatrix wxNullGraphicsMatrix; | |
644 | const wxGraphicsPath wxNullGraphicsPath; | |
645 | %mutable; | |
646 | ||
647 | //--------------------------------------------------------------------------- | |
648 | ||
649 | DocStr(wxGraphicsContext, | |
650 | "A `wx.GraphicsContext` instance is the object that is drawn upon. It is | |
651 | created by a renderer using the CreateContext calls, this can be done | |
652 | either directly using a renderer instance, or indirectly using the | |
653 | static convenience CreateXXX functions of wx.GraphicsContext that | |
654 | always delegate the task to the default renderer.", ""); | |
655 | ||
656 | class wxGraphicsContext : public wxGraphicsObject | |
657 | { | |
658 | public: | |
659 | //wxGraphicsContext(); This is an ABC, use Create to make an instance... | |
660 | virtual ~wxGraphicsContext(); | |
661 | ||
662 | %newobject Create; | |
663 | %nokwargs Create; | |
664 | %pythonAppend Create | |
665 | "val.__dc = args[0] # save a ref so the dc will not be deleted before self"; | |
666 | DocStr(Create, | |
667 | "Creates a wx.GraphicsContext either from a window or a DC.", ""); | |
668 | static wxGraphicsContext* Create( const wxWindowDC& dc); | |
669 | static wxGraphicsContext* Create( wxWindow* window ) ; | |
670 | ||
671 | DocDeclStrName( | |
672 | static wxGraphicsContext* , Create(), | |
673 | "Create a lightwieght context that can be used for measuring text only.", "", | |
674 | CreateMeasuringContext); | |
675 | ||
676 | %newobject CreateFromNative; | |
677 | DocDeclStr( | |
678 | static wxGraphicsContext* , CreateFromNative( void * context ) , | |
679 | "Creates a wx.GraphicsContext from a native context. This native | |
680 | context must be eg a CGContextRef for Core Graphics, a Graphics | |
681 | pointer for GDIPlus or a cairo_t pointer for Cairo.", ""); | |
682 | ||
683 | ||
684 | %newobject CreateFromNative; | |
685 | DocDeclStr( | |
686 | static wxGraphicsContext* , CreateFromNativeWindow( void * window ) , | |
687 | "Creates a wx.GraphicsContext from a native window.", ""); | |
688 | ||
689 | ||
690 | ||
691 | DocDeclStr( | |
692 | virtual wxGraphicsPath , CreatePath(), | |
693 | "Creates a native graphics path which is initially empty.", ""); | |
694 | ||
695 | ||
696 | DocDeclStr( | |
697 | virtual wxGraphicsPen , CreatePen(const wxPen& pen), | |
698 | "Creates a native pen from a `wx.Pen`.", ""); | |
699 | ||
700 | ||
701 | DocDeclStr( | |
702 | virtual wxGraphicsBrush , CreateBrush(const wxBrush& brush ), | |
703 | "Creates a native brush from a `wx.Brush`.", ""); | |
704 | ||
705 | ||
706 | DocDeclStr( | |
707 | virtual wxGraphicsBrush , | |
708 | CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, | |
709 | const wxColour& c1, const wxColour& c2), | |
710 | "Creates a native brush, having a linear gradient, starting at (x1,y1) | |
711 | with color c1 to (x2,y2) with color c2.", ""); | |
712 | ||
713 | ||
714 | DocDeclStr( | |
715 | virtual wxGraphicsBrush , | |
716 | CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, | |
717 | const wxColour &oColor, const wxColour &cColor), | |
718 | "Creates a native brush, having a radial gradient originating at point | |
719 | (xo,yc) with color oColour and ends on a circle around (xc,yc) with | |
720 | radius r and color cColour.", ""); | |
721 | ||
722 | ||
723 | DocDeclStr( | |
724 | virtual wxGraphicsFont , CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ), | |
725 | "Creates a native graphics font from a `wx.Font` and a text colour.", ""); | |
726 | ||
727 | ||
728 | DocDeclStr( | |
729 | virtual wxGraphicsMatrix , CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, | |
730 | wxDouble c=0.0, wxDouble d=1.0, | |
731 | wxDouble tx=0.0, wxDouble ty=0.0), | |
732 | "Creates a native affine transformation matrix from the passed in | |
733 | values. The defaults result in an identity matrix.", ""); | |
734 | ||
735 | ||
736 | ||
737 | DocDeclStr( | |
738 | virtual void , PushState(), | |
739 | "Push the current state of the context, (ie the transformation matrix) | |
740 | on a stack", ""); | |
741 | ||
742 | ||
743 | DocDeclStr( | |
744 | virtual void , PopState(), | |
745 | "Pops a stored state from the stack", ""); | |
746 | ||
747 | ||
748 | DocDeclStrName( | |
749 | virtual void , Clip( const wxRegion ®ion ), | |
750 | "Clips drawings to the region, combined to current clipping region.", "", | |
751 | ClipRegion); | |
752 | ||
753 | ||
754 | DocDeclStr( | |
755 | virtual void , Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ), | |
756 | "Clips drawings to the rectangle.", ""); | |
757 | ||
758 | ||
759 | DocDeclStr( | |
760 | virtual void , ResetClip(), | |
761 | "Resets the clipping to original shape.", ""); | |
762 | ||
763 | ||
764 | DocDeclStr( | |
765 | virtual void * , GetNativeContext(), | |
766 | "Returns the native context (CGContextRef for Core Graphics, Graphics | |
767 | pointer for GDIPlus and cairo_t pointer for cairo).", ""); | |
768 | ||
769 | ||
770 | DocDeclStr( | |
771 | virtual int , GetLogicalFunction() const, | |
772 | "Returns the current logical function.", ""); | |
773 | ||
774 | ||
775 | DocDeclStr( | |
776 | virtual bool , SetLogicalFunction(int function) , | |
777 | "Sets the current logical function, returns ``True`` if it supported", ""); | |
778 | ||
779 | ||
780 | DocDeclStr( | |
781 | virtual void , Translate( wxDouble dx , wxDouble dy ), | |
782 | "Translates the current transformation matrix.", ""); | |
783 | ||
784 | ||
785 | DocDeclStr( | |
786 | virtual void , Scale( wxDouble xScale , wxDouble yScale ), | |
787 | "Scale the current transformation matrix of the context.", ""); | |
788 | ||
789 | ||
790 | DocDeclStr( | |
791 | virtual void , Rotate( wxDouble angle ), | |
792 | "Rotate the current transformation matrix of the context. ``angle`` is | |
793 | specified in radians.", ""); | |
794 | ||
795 | ||
796 | DocDeclStr( | |
797 | virtual void , ConcatTransform( const wxGraphicsMatrix& matrix ), | |
798 | "Concatenates the passed in transform with the current transform of | |
799 | this context.", ""); | |
800 | ||
801 | ||
802 | DocDeclStr( | |
803 | virtual void , SetTransform( const wxGraphicsMatrix& matrix ), | |
804 | "Sets the current transform of this context.", ""); | |
805 | ||
806 | ||
807 | DocDeclStr( | |
808 | virtual wxGraphicsMatrix , GetTransform() const, | |
809 | "Gets the current transformation matrix of this context.", ""); | |
810 | ||
811 | ||
812 | ||
813 | ||
814 | DocStr(SetPen, "Sets the stroke pen", ""); | |
815 | %nokwargs SetPen; | |
816 | virtual void SetPen( const wxGraphicsPen& pen ); | |
817 | void SetPen( const wxPen& pen ); | |
818 | ||
819 | ||
820 | DocStr(SetBrush, "Sets the brush for filling", ""); | |
821 | %nokwargs SetBrush; | |
822 | virtual void SetBrush( const wxGraphicsBrush& brush ); | |
823 | void SetBrush( const wxBrush& brush ); | |
824 | ||
825 | ||
826 | DocStr(SetFont, "Sets the font", ""); | |
827 | %nokwargs SetFont; | |
828 | virtual void SetFont( const wxGraphicsFont& font ); | |
829 | void SetFont( const wxFont& font, const wxColour& colour = *wxBLACK); | |
830 | ||
831 | ||
832 | ||
833 | DocDeclStr( | |
834 | virtual void , StrokePath( const wxGraphicsPath& path ), | |
835 | "Strokes along a path with the current pen.", ""); | |
836 | ||
837 | ||
838 | DocDeclStr( | |
839 | virtual void , FillPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ), | |
840 | "Fills a path with the current brush.", ""); | |
841 | ||
842 | ||
843 | DocDeclStr( | |
844 | virtual void , DrawPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ), | |
845 | "Draws the path by first filling and then stroking.", ""); | |
846 | ||
847 | ||
848 | %extend { | |
849 | DocStr(DrawText, | |
850 | "Draws a text string at the defined position.", ""); | |
851 | void DrawText( const wxString &str, wxDouble x, wxDouble y, | |
852 | const wxGraphicsBrush& backgroundBrush = wxNullGraphicsBrush ) | |
853 | { | |
854 | if ( !backgroundBrush.IsNull() ) | |
855 | self->DrawText(str, x, y, backgroundBrush); | |
856 | else | |
857 | self->DrawText(str, x, y); | |
858 | } | |
859 | ||
860 | DocStr(DrawRotatedText, | |
861 | "Draws a text string at the defined position, at the specified angle, | |
862 | which is given in radians.", ""); | |
863 | void DrawRotatedText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle, | |
864 | const wxGraphicsBrush& backgroundBrush = wxNullGraphicsBrush ) | |
865 | { | |
866 | if ( !backgroundBrush.IsNull() ) | |
867 | self->DrawText(str, x, y, angle, backgroundBrush); | |
868 | else | |
869 | self->DrawText(str, x, y, angle); | |
870 | } | |
871 | } | |
872 | ||
873 | ||
874 | ||
875 | DocDeclAStrName( | |
876 | virtual void , GetTextExtent( const wxString &text, | |
877 | wxDouble *OUTPUT /*width*/, | |
878 | wxDouble *OUTPUT /*height*/, | |
879 | wxDouble *OUTPUT /*descent*/, | |
880 | wxDouble *OUTPUT /*externalLeading*/ ) const , | |
881 | "GetFullTextExtent(self, text) --> (width, height, descent, externalLeading)", | |
882 | "Gets the dimensions of the string using the currently selected | |
883 | font. ``text`` is the string to measure, ``w`` and ``h`` are the total | |
884 | width and height respectively, ``descent`` is the dimension from the | |
885 | baseline of the font to the bottom of the descender, and | |
886 | ``externalLeading`` is any extra vertical space added to the font by | |
887 | the font designer (usually is zero).", "", | |
888 | GetFullTextExtent); | |
889 | ||
890 | %extend { | |
891 | DocAStr(GetTextExtent, | |
892 | "GetTextExtent(self, text) --> (width, height)", | |
893 | "Gets the dimensions of the string using the currently selected | |
894 | font. ``text`` is the string to measure, ``w`` and ``h`` are the total | |
895 | width and height respectively.", ""); | |
896 | ||
897 | PyObject* GetTextExtent( const wxString &text ) | |
898 | { | |
899 | wxDouble width = 0.0, | |
900 | height = 0.0; | |
901 | self->GetTextExtent(text, &width, &height, NULL, NULL); | |
902 | // thread wrapers are turned off for this .i file, so no need to acquire GIL... | |
903 | PyObject* rv = PyTuple_New(2); | |
904 | PyTuple_SET_ITEM(rv, 0, PyFloat_FromDouble(width)); | |
905 | PyTuple_SET_ITEM(rv, 1, PyFloat_FromDouble(height)); | |
906 | return rv; | |
907 | } | |
908 | } | |
909 | ||
910 | ||
911 | %extend { | |
912 | DocAStr(GetPartialTextExtents, | |
913 | "GetPartialTextExtents(self, text) -> [widths]", | |
914 | "Returns a list of widths from the beginning of ``text`` to the | |
915 | coresponding character in ``text``.", ""); | |
916 | wxArrayDouble GetPartialTextExtents(const wxString& text) { | |
917 | wxArrayDouble widths; | |
918 | self->GetPartialTextExtents(text, widths); | |
919 | return widths; | |
920 | } | |
921 | } | |
922 | ||
923 | ||
924 | DocDeclStr( | |
925 | virtual void , DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ), | |
926 | "Draws the bitmap. In case of a mono bitmap, this is treated as a mask | |
927 | and the current brush is used for filling.", ""); | |
928 | ||
929 | ||
930 | DocDeclStr( | |
931 | virtual void , DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ), | |
932 | "Draws the icon.", ""); | |
933 | ||
934 | ||
935 | ||
936 | DocDeclStr( | |
937 | virtual void , StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2), | |
938 | "Strokes a single line.", ""); | |
939 | ||
940 | ||
941 | DocDeclAStr( | |
942 | virtual void , StrokeLines( size_t points, const wxPoint2D *points_array), | |
943 | "StrokeLines(self, List points)", | |
944 | "Stroke lines connecting each of the points", ""); | |
945 | ||
946 | ||
947 | %extend { | |
948 | DocStr(StrokeLineSegements, | |
949 | "Stroke disconnected lines from begin to end points", ""); | |
950 | void StrokeLineSegements(PyObject* beginPoints, PyObject* endPoints) | |
951 | { | |
952 | size_t c1, c2, count; | |
953 | wxPoint2D* beginP = wxPoint2D_LIST_helper(beginPoints, &c1); | |
954 | wxPoint2D* endP = wxPoint2D_LIST_helper(endPoints, &c2); | |
955 | ||
956 | if ( beginP != NULL && endP != NULL ) | |
957 | { | |
958 | count = wxMin(c1, c2); | |
959 | self->StrokeLines(count, beginP, endP); | |
960 | } | |
961 | delete [] beginP; | |
962 | delete [] endP; | |
963 | } | |
964 | } | |
965 | ||
966 | ||
967 | DocDeclStr( | |
968 | virtual void , DrawLines( size_t points, const wxPoint2D *points_array, | |
969 | int fillStyle = wxODDEVEN_RULE ), | |
970 | "Draws a polygon.", ""); | |
971 | ||
972 | ||
973 | DocDeclStr( | |
974 | virtual void , DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h), | |
975 | "Draws a rectangle.", ""); | |
976 | ||
977 | ||
978 | DocDeclStr( | |
979 | virtual void , DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h), | |
980 | "Draws an ellipse.", ""); | |
981 | ||
982 | ||
983 | DocDeclStr( | |
984 | virtual void , DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius), | |
985 | "Draws a rounded rectangle", ""); | |
986 | ||
987 | ||
988 | ||
989 | DocDeclStr( | |
990 | virtual bool , ShouldOffset() const, | |
991 | "helper to determine if a 0.5 offset should be applied for the drawing operation", ""); | |
992 | ||
993 | }; | |
994 | ||
995 | ||
996 | //--------------------------------------------------------------------------- | |
997 | ||
998 | class wxGraphicsRenderer : public wxObject | |
999 | { | |
1000 | public : | |
1001 | // wxGraphicsRenderer(); This is an ABC, use GetDefaultRenderer | |
1002 | ||
1003 | virtual ~wxGraphicsRenderer(); | |
1004 | ||
1005 | // %newobject GetDefaultRenderer; ??? | |
1006 | static wxGraphicsRenderer* GetDefaultRenderer(); | |
1007 | ||
1008 | %nokwargs CreateContext; | |
1009 | %newobject CreateContext; | |
1010 | virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) ; | |
1011 | virtual wxGraphicsContext * CreateContext( wxWindow* window ); | |
1012 | ||
1013 | // create a context that can be used for measuring texts only, no drawing allowed | |
1014 | virtual wxGraphicsContext * CreateMeasuringContext(); | |
1015 | ||
1016 | %newobject CreateContextFromNativeContext; | |
1017 | virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ); | |
1018 | ||
1019 | %newobject CreateContextFromNativeWindow; | |
1020 | virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ); | |
1021 | ||
1022 | ||
1023 | virtual wxGraphicsPath CreatePath(); | |
1024 | ||
1025 | virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, | |
1026 | wxDouble tx=0.0, wxDouble ty=0.0); | |
1027 | ||
1028 | virtual wxGraphicsPen CreatePen(const wxPen& pen) ; | |
1029 | ||
1030 | virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) ; | |
1031 | ||
1032 | virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, | |
1033 | const wxColour&c1, const wxColour&c2); | |
1034 | ||
1035 | virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, | |
1036 | const wxColour &oColor, const wxColour &cColor); | |
1037 | ||
1038 | virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ); | |
1039 | ||
1040 | }; | |
1041 | ||
1042 | ||
1043 | ||
1044 | //--------------------------------------------------------------------------- | |
1045 | ||
1046 | %{ | |
1047 | #include "wx/dcgraph.h" | |
1048 | %} | |
1049 | ||
1050 | class wxGCDC: public wxDC | |
1051 | { | |
1052 | public: | |
1053 | %nokwargs wxGCDC; | |
1054 | %pythonAppend wxGCDC | |
1055 | "self.__dc = args[0] # save a ref so the other dc will not be deleted before self"; | |
1056 | wxGCDC(const wxWindowDC& dc); | |
1057 | wxGCDC(wxWindow* window); | |
1058 | //wxGCDC(); | |
1059 | virtual ~wxGCDC(); | |
1060 | ||
1061 | wxGraphicsContext* GetGraphicsContext(); | |
1062 | virtual void SetGraphicsContext( wxGraphicsContext* ctx ); | |
1063 | ||
1064 | %property(GraphicsContext, GetGraphicsContext, SetGraphicsContext); | |
1065 | }; | |
1066 | ||
1067 | ||
1068 | //--------------------------------------------------------------------------- | |
1069 | ||
1070 | // Turn GIL acquisition back on. | |
1071 | %threadWrapperOn | |
1072 |