flesh out the dummy classes
reorg the class decls a bit do some overloading add docstrings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -29,23 +29,27 @@
|
||||
|
||||
%{
|
||||
#if !wxUSE_GRAPHICS_CONTEXT
|
||||
// C++ stub classes for platforms that don't have wxGraphicsContext yet.
|
||||
// C++ stub classes for platforms or build configurations that don't have
|
||||
// wxGraphicsContext yet.
|
||||
|
||||
class wxGraphicsObject : public wxObject
|
||||
{
|
||||
public :
|
||||
wxGraphicsObject( wxGraphicsRenderer* renderer ) {}
|
||||
wxGraphicsObject( const wxGraphicsObject& obj ) {}
|
||||
wxGraphicsObject( wxGraphicsRenderer* ) {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wx.GraphicsObject is not available on this platform.");
|
||||
}
|
||||
wxGraphicsObject( const wxGraphicsObject& ) {}
|
||||
virtual ~wxGraphicsObject() {}
|
||||
wxGraphicsRenderer* GetRenderer() const {}
|
||||
wxGraphicsRenderer* GetRenderer() const { return NULL; }
|
||||
} ;
|
||||
|
||||
class wxGraphicsPen : public wxGraphicsObject
|
||||
{
|
||||
//wxGraphicsPen(wxGraphicsRenderer* renderer) : wxGraphicsObject(renderer) {}
|
||||
//wxGraphicsPen(wxGraphicsRenderer* ) {}
|
||||
virtual ~wxGraphicsPen() {}
|
||||
virtual void Apply( wxGraphicsContext* context) {}
|
||||
virtual wxDouble GetWidth() {}
|
||||
virtual void Apply( wxGraphicsContext* ) {}
|
||||
virtual wxDouble GetWidth() { return 0; }
|
||||
} ;
|
||||
|
||||
class wxGraphicsBrush : public wxGraphicsObject
|
||||
@@ -53,7 +57,7 @@ class wxGraphicsBrush : public wxGraphicsObject
|
||||
public :
|
||||
//wxGraphicsBrush(wxGraphicsRenderer* renderer) {}
|
||||
virtual ~wxGraphicsBrush() {}
|
||||
virtual void Apply( wxGraphicsContext* context) {}
|
||||
virtual void Apply( wxGraphicsContext* ) {}
|
||||
} ;
|
||||
|
||||
class wxGraphicsFont : public wxGraphicsObject
|
||||
@@ -61,112 +65,210 @@ class wxGraphicsFont : public wxGraphicsObject
|
||||
public :
|
||||
//wxGraphicsFont(wxGraphicsRenderer* renderer) {}
|
||||
virtual ~wxGraphicsFont() {}
|
||||
virtual void Apply( wxGraphicsContext* context) {}
|
||||
virtual void Apply( wxGraphicsContext* ) {}
|
||||
} ;
|
||||
|
||||
class wxGraphicsPath
|
||||
class wxGraphicsPath : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
wxGraphicsPath() {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
wxGraphicsPath(wxGraphicsRenderer* ) {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wxGraphicsPath is not available on this platform.");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
"wx.GraphicsPath is not available on this platform.");
|
||||
}
|
||||
virtual ~wxGraphicsPath() {}
|
||||
|
||||
virtual wxGraphicsPath *Clone() const { return NULL; }
|
||||
|
||||
void MoveToPoint( wxDouble, wxDouble ) {}
|
||||
void MoveToPoint( const wxPoint2DDouble& ) {}
|
||||
void AddLineToPoint( wxDouble, wxDouble ) {}
|
||||
void AddLineToPoint( const wxPoint2DDouble& ) {}
|
||||
void AddCurveToPoint( wxDouble, wxDouble, wxDouble, wxDouble, wxDouble, wxDouble ) {}
|
||||
void AddCurveToPoint( const wxPoint2DDouble&, const wxPoint2DDouble&, const wxPoint2DDouble&) {}
|
||||
void AddPath( const wxGraphicsPath* ) {}
|
||||
void CloseSubpath() {}
|
||||
void GetCurrentPoint( wxDouble&, wxDouble&) {}
|
||||
wxPoint2DDouble GetCurrentPoint() { reutrn wxPoint2D(0,0); }
|
||||
void AddArc( wxDouble, wxDouble, wxDouble, wxDouble, wxDouble, bool ) {}
|
||||
void AddArc( const wxPoint2DDouble& , wxDouble, wxDouble , wxDouble , bool ) {}
|
||||
|
||||
void AddQuadCurveToPoint( wxDouble, wxDouble, wxDouble, wxDouble ) {}
|
||||
void AddRectangle( wxDouble, wxDouble, wxDouble, wxDouble ) {}
|
||||
void AddCircle( wxDouble, wxDouble, wxDouble ) {}
|
||||
void AddArcToPoint( wxDouble, wxDouble , wxDouble, wxDouble, wxDouble ) {}
|
||||
|
||||
wxPoint2DDouble GetCurrentPoint() { return wxPoint2DDouble(0,0); }
|
||||
void MoveToPoint( const wxPoint2DDouble& ) {}
|
||||
void AddLineToPoint( const wxPoint2DDouble&) {}
|
||||
void AddCurveToPoint( const wxPoint2DDouble&, const wxPoint2DDouble&, const wxPoint2DDouble&) {}
|
||||
void AddArc( const wxPoint2DDouble&, wxDouble, wxDouble, wxDouble, bool) {}
|
||||
void AddEllipse( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
void AddRoundedRectangle( wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
void * GetNativePath() const { return NULL; }
|
||||
void UnGetNativePath(void *) {}
|
||||
void Transform( wxGraphicsMatrix* ) {}
|
||||
void GetBox(wxDouble *, wxDouble *, wxDouble *, wxDouble *) {}
|
||||
wxRect2D GetBox() { return wxRect2D(0,0,0,0); }
|
||||
|
||||
bool Contains( wxDouble , wxDouble , int ) { return false; }
|
||||
bool Contains( const wxPoint2DDouble& , int ) { return false; }
|
||||
};
|
||||
|
||||
|
||||
class wxGraphicsContext
|
||||
class wxGraphicsMatrix : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
wxGraphicsContext() {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
wxGraphicsMatrix(wxGraphicsRenderer* ) {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wxGraphicsContext is not available on this platform.");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
"wx.GraphicsMatrix is not available on this platform.");
|
||||
}
|
||||
virtual ~wxGraphicsMatrix() {}
|
||||
virtual wxGraphicsMatrix *Clone() const { return NULL; }
|
||||
virtual void Concat( const wxGraphicsMatrix * ) {}
|
||||
virtual void Copy( const wxGraphicsMatrix * ) {}
|
||||
virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble ,
|
||||
wxDouble , wxDouble ) {}
|
||||
virtual void Invert() {}
|
||||
virtual bool IsEqual( const wxGraphicsMatrix* t) const {}
|
||||
virtual bool IsIdentity() { return false; }
|
||||
virtual void Translate( wxDouble , wxDouble ) {}
|
||||
virtual void Scale( wxDouble , wxDouble ) {}
|
||||
virtual void Rotate( wxDouble ) {}
|
||||
virtual void TransformPoint( wxDouble *, wxDouble * ) {}
|
||||
virtual void TransformDistance( wxDouble *, wxDouble * ) {}
|
||||
virtual void * GetNativeMatrix() const { return NULL; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxGraphicsContext : public wxGraphicsObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxGraphicsContext(wxGraphicsRenderer* ) {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wx.GraphicsContext is not available on this platform.");
|
||||
}
|
||||
|
||||
virtual ~wxGraphicsContext() {}
|
||||
|
||||
static wxGraphicsContext* Create( const wxWindowDC& ) {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wxGraphicsPath is not available on this platform.");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
"wx.GraphicsContext is not available on this platform.");
|
||||
}
|
||||
|
||||
static wxGraphicsContext* CreateFromNative( void * ) {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wxGraphicsContext is not available on this platform.");
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return NULL;
|
||||
"wx.GraphicsContext is not available on this platform.");
|
||||
}
|
||||
|
||||
virtual wxGraphicsPen* CreatePen(const wxPen& pen) {}
|
||||
|
||||
virtual wxGraphicsBrush* CreateBrush(const wxBrush& brush ) {}
|
||||
|
||||
virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
|
||||
const wxColour&c1, const wxColour&c2) {}
|
||||
|
||||
virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
|
||||
const wxColour &oColor, const wxColour &cColor) {}
|
||||
|
||||
virtual wxGraphicsFont* CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) {}
|
||||
static wxGraphicsContext* CreateFromNativeWindow( void * ) {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wx.GraphicsContext is not available on this platform.");
|
||||
}
|
||||
|
||||
static wxGraphicsContext* Create( wxWindow* ) {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wx.GraphicsContext is not available on this platform.");
|
||||
}
|
||||
|
||||
wxGraphicsPath * CreatePath() { return NULL; }
|
||||
void PushState() {}
|
||||
void PopState() {}
|
||||
void Clip( const wxRegion & ) {}
|
||||
void Clip( wxDouble, wxDouble, wxDouble, wxDouble ) {}
|
||||
void ResetClip() {}
|
||||
void * GetNativeContext() { return NULL; }
|
||||
void Translate( wxDouble , wxDouble ) {}
|
||||
void Scale( wxDouble , wxDouble ) {}
|
||||
void Rotate( wxDouble ) {}
|
||||
void SetFont( const wxFont &, bool ) {}
|
||||
|
||||
virtual wxGraphicsPen* CreatePen(const wxPen& ) { return NULL; }
|
||||
|
||||
virtual wxGraphicsBrush* CreateBrush(const wxBrush& ) { return NULL; }
|
||||
|
||||
virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble , wxDouble , wxDouble , wxDouble ,
|
||||
const wxColour&, const wxColour&) { return NULL; }
|
||||
|
||||
virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo,
|
||||
wxDouble xc, wxDouble yc, wxDouble radius,
|
||||
const wxColour &oColor, const wxColour &cColor) { return NULL; }
|
||||
|
||||
virtual wxGraphicsFont* CreateFont( const wxFont &, const wxColour & ) { return NULL; }
|
||||
|
||||
virtual wxGraphicsMatrix* CreateMatrix( wxDouble, wxDouble, wxDouble, wxDouble,
|
||||
wxDouble, wxDouble) { return NULL; }
|
||||
|
||||
virtual void PushState() {}
|
||||
virtual void PopState() {}
|
||||
virtual void Clip( const wxRegion & ) {}
|
||||
virtual void Clip( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void ResetClip() {}
|
||||
virtual void * GetNativeContext() { return NULL; }
|
||||
virtual void Translate( wxDouble , wxDouble ) {}
|
||||
virtual void Scale( wxDouble , wxDouble ) {}
|
||||
virtual void Rotate( wxDouble ) {}
|
||||
virtual void ConcatTransform( const wxGraphicsMatrix* ) {}
|
||||
virtual void SetTransform( const wxGraphicsMatrix* ) {}
|
||||
virtual void GetTransform( wxGraphicsMatrix* ) {}
|
||||
|
||||
virtual void SetPen( wxGraphicsPen* , bool ) {}
|
||||
void SetPen( const wxPen& ) {}
|
||||
|
||||
virtual void SetBrush( wxGraphicsBrush* , bool ) {}
|
||||
void SetBrush( const wxBrush& ) {}
|
||||
|
||||
virtual void SetFont( wxGraphicsFont*, bool ) {}
|
||||
void SetFont( const wxFont&, const wxColour& ) {}
|
||||
void StrokePath( const wxGraphicsPath * ) {}
|
||||
void FillPath( const wxGraphicsPath *, int ) {}
|
||||
void DrawPath( const wxGraphicsPath *, int ) {}
|
||||
void DrawText( const wxString &, wxDouble , wxDouble ) {}
|
||||
void DrawText( const wxString &, wxDouble , wxDouble , wxDouble ) {}
|
||||
void GetTextExtent( const wxString &, wxDouble *, wxDouble *,
|
||||
|
||||
virtual void StrokePath( const wxGraphicsPath * ) {}
|
||||
virtual void FillPath( const wxGraphicsPath *, int ) {}
|
||||
virtual void DrawPath( const wxGraphicsPath *, int ) {}
|
||||
|
||||
virtual void DrawText( const wxString &, wxDouble , wxDouble ) {}
|
||||
virtual void DrawText( const wxString &, wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void GetTextExtent( const wxString &, wxDouble *, wxDouble *,
|
||||
wxDouble *, wxDouble * ) const {}
|
||||
void GetPartialTextExtents(const wxString& , wxArrayDouble& ) const {}
|
||||
void DrawBitmap( const wxBitmap &, wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
void DrawIcon( const wxIcon &, wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
void StrokeLine( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
void StrokeLines( size_t , const wxPoint2DDouble *) {}
|
||||
void StrokeLines( size_t , const wxPoint2DDouble *, const wxPoint2DDouble *) {}
|
||||
void DrawLines( size_t , const wxPoint2DDouble *, int ) {}
|
||||
void DrawRectangle( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
void DrawEllipse( wxDouble , wxDouble, wxDouble , wxDouble) {}
|
||||
void DrawRoundedRectangle( wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void GetPartialTextExtents(const wxString& , wxArrayDouble& ) const {}
|
||||
|
||||
virtual void DrawBitmap( const wxBitmap &, wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void DrawIcon( const wxIcon &, wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
|
||||
virtual void StrokeLine( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void StrokeLines( size_t , const wxPoint2DDouble *) {}
|
||||
virtual void StrokeLines( size_t , const wxPoint2DDouble *, const wxPoint2DDouble *) {}
|
||||
virtual void DrawLines( size_t , const wxPoint2DDouble *, int ) {}
|
||||
virtual void DrawRectangle( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void DrawEllipse( wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual void DrawRoundedRectangle( wxDouble wxDouble , wxDouble , wxDouble , wxDouble ) {}
|
||||
virtual bool ShouldOffset() const { return false; }
|
||||
};
|
||||
|
||||
|
||||
class wxGraphicsRenderer : public wxObject
|
||||
{
|
||||
public :
|
||||
wxGraphicsRenderer() {
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wx.GraphicsRenderer is not available on this platform.");
|
||||
}
|
||||
|
||||
virtual ~wxGraphicsRenderer() {}
|
||||
|
||||
static wxGraphicsRenderer* GetDefaultRenderer(
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"wx.GraphicsRenderer is not available on this platform.");
|
||||
);
|
||||
|
||||
virtual wxGraphicsContext * CreateContext( const wxWindowDC& ) { return NULL; }
|
||||
virtual wxGraphicsContext * CreateContextFromNativeContext( void * ) { return NULL; }
|
||||
virtual wxGraphicsContext * CreateContextFromNativeWindow( void * ) { return NULL; }
|
||||
virtual wxGraphicsContext * CreateContext( wxWindow* ) { return NULL; }
|
||||
|
||||
virtual wxGraphicsPath * CreatePath() { return NULL; }
|
||||
|
||||
virtual wxGraphicsMatrix * CreateMatrix( wxDouble , wxDouble , wxDouble , wxDouble ,
|
||||
wxDouble , wxDouble ) {}
|
||||
|
||||
virtual wxGraphicsPen* CreatePen(const wxPen& ) { return NULL; }
|
||||
virtual wxGraphicsBrush* CreateBrush(const wxBrush& ) { return NULL; }
|
||||
virtual wxGraphicsBrush* CreateLinearGradientBrush(
|
||||
wxDouble , wxDouble , wxDouble , wxDouble ,
|
||||
const wxColour&, const wxColour&) { return NULL; }
|
||||
virtual wxGraphicsBrush* CreateRadialGradientBrush(
|
||||
wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ,
|
||||
const wxColour &, const wxColour &) { return NULL; }
|
||||
virtual wxGraphicsFont* CreateFont( const wxFont & , const wxColour & ) { return NULL; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxGCDC: public wxWindowDC
|
||||
{
|
||||
public:
|
||||
@@ -211,21 +313,19 @@ MustHaveApp(wxGraphicsPath);
|
||||
MustHaveApp(wxGraphicsContext);
|
||||
MustHaveApp(wxGCDC);
|
||||
|
||||
//#define wxDouble double
|
||||
typedef double wxDouble;
|
||||
|
||||
|
||||
// TODO: Decide which of the overloaded methods should use the primary names
|
||||
|
||||
class wxGraphicsObject : public wxObject
|
||||
{
|
||||
public :
|
||||
wxGraphicsObject( wxGraphicsRenderer* renderer = NULL );
|
||||
wxGraphicsObject( const wxGraphicsObject& obj );
|
||||
virtual ~wxGraphicsObject();
|
||||
wxGraphicsRenderer* GetRenderer() const;
|
||||
};
|
||||
|
||||
|
||||
class wxGraphicsPen : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
@@ -235,6 +335,7 @@ public :
|
||||
virtual wxDouble GetWidth();
|
||||
};
|
||||
|
||||
|
||||
class wxGraphicsBrush : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
@@ -243,6 +344,7 @@ public :
|
||||
virtual void Apply( wxGraphicsContext* context);
|
||||
};
|
||||
|
||||
|
||||
class wxGraphicsFont : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
@@ -251,12 +353,15 @@ public :
|
||||
virtual void Apply( wxGraphicsContext* context);
|
||||
};
|
||||
|
||||
class wxGraphicsPath
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxGraphicsPath : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
//wxGraphicsPath(); *** This class is an ABC, so we can't allow instances to be created directly
|
||||
//wxGraphicsPath(wxGraphicsRenderer* renderer); *** This class is an ABC, so we can't allow instances to be created directly
|
||||
virtual ~wxGraphicsPath();
|
||||
|
||||
virtual wxGraphicsPath *Clone() const = 0;
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , MoveToPoint( wxDouble x, wxDouble y ),
|
||||
@@ -279,6 +384,12 @@ points and an end point", "");
|
||||
// void AddCurveToPoint( const wxPoint2D& c1, const wxPoint2D& c2, const wxPoint2D& e);
|
||||
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , AddPath( const wxGraphicsPath* path ),
|
||||
"adds another path", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , CloseSubpath(),
|
||||
"closes the current sub-path", "");
|
||||
@@ -320,49 +431,123 @@ point and an end point", "");
|
||||
to (x2,y2), also a straight line from (current) to (x1,y1)", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h),
|
||||
"appends an ellipse", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius),
|
||||
"appends a rounded rectangle", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void * , GetNativePath() const,
|
||||
"returns the native path", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , UnGetNativePath(void *p),
|
||||
"give the native path returned by GetNativePath() back (there might be some
|
||||
deallocations necessary)", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , Transform( wxGraphicsMatrix* matrix ),
|
||||
"transforms each point of this path by the matrix", "");
|
||||
|
||||
|
||||
//virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) =0;
|
||||
DocDeclStr(
|
||||
wxRect2DDouble , GetBox(),
|
||||
"gets the bounding box enclosing all points (possibly including control points)", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual bool , Contains( wxDouble x, wxDouble y, int fillStyle = wxWINDING_RULE),
|
||||
"", "");
|
||||
//bool Contains( const wxPoint2DDouble& c, int fillStyle = wxWINDING_RULE);
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
class wxGraphicsMatrix
|
||||
class wxGraphicsMatrix : public wxGraphicsObject
|
||||
{
|
||||
public :
|
||||
wxGraphicsMatrix() {}
|
||||
// wxGraphicsMatrix(wxGraphicsRenderer* renderer); *** This class is an ABC
|
||||
|
||||
virtual ~wxGraphicsMatrix() {}
|
||||
virtual ~wxGraphicsMatrix();
|
||||
|
||||
wxGraphicsMatrix* Concat( const wxGraphicsMatrix *t ) const;
|
||||
virtual wxGraphicsMatrix *Clone() const;
|
||||
|
||||
// returns the inverse matrix
|
||||
wxGraphicsMatrix* Invert() const;
|
||||
DocDeclStr(
|
||||
virtual void , Concat( const wxGraphicsMatrix *t ),
|
||||
"concatenates the matrix", "");
|
||||
|
||||
// returns true if the elements of the transformation matrix are equal ?
|
||||
bool operator==(const wxGraphicsMatrix& t) const;
|
||||
|
||||
// return true if this is the identity matrix
|
||||
bool IsIdentity();
|
||||
DocDeclStr(
|
||||
virtual void , Copy( const wxGraphicsMatrix *t ),
|
||||
"copies the passed in matrix", "");
|
||||
|
||||
//
|
||||
// transformation
|
||||
//
|
||||
|
||||
// translate
|
||||
virtual void Translate( wxDouble dx , wxDouble dy ) = 0;
|
||||
DocDeclStr(
|
||||
virtual void , Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
|
||||
wxDouble tx=0.0, wxDouble ty=0.0),
|
||||
"sets the matrix to the respective values", "");
|
||||
|
||||
// scale
|
||||
virtual void Scale( wxDouble xScale , wxDouble yScale ) = 0;
|
||||
|
||||
// rotate (radians)
|
||||
virtual void Rotate( wxDouble angle ) = 0;
|
||||
DocDeclStr(
|
||||
virtual void , Invert(),
|
||||
"makes this the inverse matrix", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual bool , IsEqual( const wxGraphicsMatrix* t) const,
|
||||
"returns true if the elements of the transformation matrix are equal", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual bool , IsIdentity(),
|
||||
"return true if this is the identity matrix", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , Translate( wxDouble dx , wxDouble dy ),
|
||||
"add the translation to this matrix", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , Scale( wxDouble xScale , wxDouble yScale ),
|
||||
"add the scale to this matrix", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , Rotate( wxDouble angle ),
|
||||
"add the rotation to this matrix (radians)", "");
|
||||
|
||||
|
||||
DocDeclAStr(
|
||||
virtual void , TransformPoint( wxDouble *INOUT, wxDouble *INOUT ),
|
||||
"TransformPoint(self, x, y) --> (x, y)",
|
||||
"applies that matrix to the point", "");
|
||||
|
||||
|
||||
DocDeclAStr(
|
||||
virtual void , TransformDistance( wxDouble *INOUT, wxDouble *INOUT ),
|
||||
"TransformDistance(self, dx, dy) --> (dx, dy)",
|
||||
"applies the matrix except for translations", "");
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual void * , GetNativeMatrix() const,
|
||||
"returns the native representation", "");
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class wxGraphicsContext
|
||||
class wxGraphicsContext : public wxGraphicsObject
|
||||
{
|
||||
public:
|
||||
// wxGraphicsContext() This is also an ABC, use Create to make an instance...
|
||||
@@ -379,153 +564,144 @@ public:
|
||||
%newobject CreateFromNative;
|
||||
static wxGraphicsContext* CreateFromNative( void * context ) ;
|
||||
|
||||
%newobject CreateFromNative;
|
||||
static wxGraphicsContext* CreateFromNativeWindow( void * window ) ;
|
||||
|
||||
|
||||
%newobject CreatePath;
|
||||
// creates a path instance that corresponds to the type of graphics context, ie GDIPlus, cairo, CoreGraphics ...
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsPath * , CreatePath(),
|
||||
"creates a path instance that corresponds to the type of graphics context, ie GDIPlus, Cairo, CoreGraphics ...", "");
|
||||
|
||||
|
||||
%newobject CreatePen;
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsPen* , CreatePen(const wxPen& pen),
|
||||
"", "");
|
||||
|
||||
/*
|
||||
|
||||
%newobject CreatePen
|
||||
virtual wxGraphicsPen* CreatePen(const wxPen& pen);
|
||||
%newobject CreateBrush;
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsBrush* , CreateBrush(const wxBrush& brush ),
|
||||
"", "");
|
||||
|
||||
%newobject CreateBrush
|
||||
virtual wxGraphicsBrush* CreateBrush(const wxBrush& brush );
|
||||
|
||||
%newobject CreateLinearGradientBrush
|
||||
// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
|
||||
virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
|
||||
const wxColour&c1, const wxColour&c2);
|
||||
%newobject CreateLinearGradientBrush;
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsBrush* ,
|
||||
CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
|
||||
const wxColour& c1, const wxColour& c2),
|
||||
"sets the brush to a linear gradient, starting at (x1,y1) with color c1
|
||||
to (x2,y2) with color c2", "");
|
||||
|
||||
%newobject CreateRadialGradientBrush
|
||||
// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
|
||||
// with radius r and color cColor
|
||||
virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
|
||||
const wxColour &oColor, const wxColour &cColor);
|
||||
|
||||
%newobject CreateFont
|
||||
// sets the font
|
||||
virtual wxGraphicsFont* CreateFont( const wxFont &font , const wxColour &col = *wxBLACK );
|
||||
%newobject CreateRadialGradientBrush;
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsBrush* ,
|
||||
CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
|
||||
const wxColour &oColor, const wxColour &cColor),
|
||||
"sets the brush to a radial gradient originating at (xo,yc) with color
|
||||
oColor and ends on a circle around (xc,yc) with radius r and color
|
||||
cColor
|
||||
", "");
|
||||
|
||||
// create a 'native' matrix corresponding to these values
|
||||
virtual wxGraphicsMatrix* CreateMatrix( wxDouble a=1.0, wxDouble b=0.0,
|
||||
|
||||
%newobject CreateFont;
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsFont* , CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ),
|
||||
"sets the font", "");
|
||||
|
||||
|
||||
%newobject CreateMatrix;
|
||||
DocDeclStr(
|
||||
virtual wxGraphicsMatrix* , CreateMatrix( wxDouble a=1.0, wxDouble b=0.0,
|
||||
wxDouble c=0.0, wxDouble d=1.0,
|
||||
wxDouble tx=0.0, wxDouble ty=0.0) = 0;
|
||||
*/
|
||||
wxDouble tx=0.0, wxDouble ty=0.0),
|
||||
"create a 'native' matrix corresponding to these values", "");
|
||||
|
||||
|
||||
|
||||
// push the current state of the context, ie the transformation matrix on a stack
|
||||
DocDeclStr(
|
||||
virtual void , PushState(),
|
||||
"", "");
|
||||
"push the current state of the context, ie the transformation matrix on a stack", "");
|
||||
|
||||
|
||||
// pops a stored state from the stack
|
||||
DocDeclStr(
|
||||
virtual void , PopState(),
|
||||
"", "");
|
||||
"pops a stored state from the stack", "");
|
||||
|
||||
|
||||
// clips drawings to the region
|
||||
DocDeclStrName(
|
||||
virtual void , Clip( const wxRegion ®ion ),
|
||||
"", "",
|
||||
"clips drawings to the region", "",
|
||||
ClipRegion);
|
||||
|
||||
// clips drawings to the rect
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ),
|
||||
"", "");
|
||||
"clips drawings to the rect", "");
|
||||
|
||||
|
||||
// resets the clipping to original extent
|
||||
DocDeclStr(
|
||||
virtual void , ResetClip(),
|
||||
"", "");
|
||||
"resets the clipping to original extent", "");
|
||||
|
||||
|
||||
// returns the native context
|
||||
DocDeclStr(
|
||||
virtual void * , GetNativeContext(),
|
||||
"", "");
|
||||
"returns the native context", "");
|
||||
|
||||
|
||||
|
||||
//
|
||||
// transformation: changes the current transformation matrix CTM of the context
|
||||
//
|
||||
|
||||
// translate
|
||||
DocDeclStr(
|
||||
virtual void , Translate( wxDouble dx , wxDouble dy ),
|
||||
"", "");
|
||||
"translate the current transformation matrix CTM of the context", "");
|
||||
|
||||
|
||||
// scale
|
||||
DocDeclStr(
|
||||
virtual void , Scale( wxDouble xScale , wxDouble yScale ),
|
||||
"", "");
|
||||
"scale the current transformation matrix CTM of the context", "");
|
||||
|
||||
|
||||
// rotate (radians)
|
||||
DocDeclStr(
|
||||
virtual void , Rotate( wxDouble angle ),
|
||||
"", "");
|
||||
|
||||
|
||||
//
|
||||
// setting the paint
|
||||
//
|
||||
|
||||
// sets the pan
|
||||
DocDeclStr(
|
||||
virtual void , SetPen( const wxPen &pen ),
|
||||
"", "");
|
||||
|
||||
|
||||
// sets the brush for filling
|
||||
DocDeclStr(
|
||||
virtual void , SetBrush( const wxBrush &brush ),
|
||||
"", "");
|
||||
|
||||
|
||||
// sets the font
|
||||
DocDeclStr(
|
||||
virtual void , SetFont( const wxFont &font, bool release = true ),
|
||||
"", "");
|
||||
|
||||
|
||||
// sets the font
|
||||
DocDeclStr(
|
||||
void , SetFont( const wxFont &font, const wxColour& colour ),
|
||||
"", "");
|
||||
"rotate (radians) the current transformation matrix CTM of the context", "");
|
||||
|
||||
|
||||
|
||||
DocStr(SetPen, "sets the stroke pen", "");
|
||||
%nokwargs SetPen;
|
||||
virtual void SetPen( wxGraphicsPen* pen , bool release = true );
|
||||
void SetPen( const wxPen& pen );
|
||||
|
||||
|
||||
DocStr(SetBrush, "sets the brush for filling", "");
|
||||
%nokwargs SetBrush;
|
||||
virtual void SetBrush( wxGraphicsBrush* brush , bool release = true );
|
||||
void SetBrush( const wxBrush& brush );
|
||||
|
||||
|
||||
DocStr(SetFont, "sets the font", "");
|
||||
%nokwargs SetFont;
|
||||
virtual void SetFont( wxGraphicsFont* font, bool release = true );
|
||||
void SetFont( const wxFont& font, const wxColour& colour = *wxBLACK);
|
||||
|
||||
|
||||
|
||||
// strokes along a path with the current pen
|
||||
DocDeclStr(
|
||||
virtual void , StrokePath( const wxGraphicsPath *path ),
|
||||
"", "");
|
||||
"strokes along a path with the current pen", "");
|
||||
|
||||
|
||||
// fills a path with the current brush
|
||||
DocDeclStr(
|
||||
virtual void , FillPath( const wxGraphicsPath *path, int fillStyle = wxWINDING_RULE ),
|
||||
"", "");
|
||||
"fills a path with the current brush", "");
|
||||
|
||||
|
||||
// draws a path by first filling and then stroking
|
||||
DocDeclStr(
|
||||
virtual void , DrawPath( const wxGraphicsPath *path, int fillStyle = wxWINDING_RULE ),
|
||||
"", "");
|
||||
"draws a path by first filling and then stroking", "");
|
||||
|
||||
|
||||
//
|
||||
// text
|
||||
//
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , DrawText( const wxString &str, wxDouble x, wxDouble y ),
|
||||
"", "");
|
||||
@@ -578,10 +754,6 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// image support
|
||||
//
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ),
|
||||
"", "");
|
||||
@@ -592,27 +764,21 @@ public:
|
||||
"", "");
|
||||
|
||||
|
||||
//
|
||||
// convenience methods
|
||||
//
|
||||
|
||||
// strokes a single line
|
||||
DocDeclStr(
|
||||
virtual void , StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2),
|
||||
"", "");
|
||||
"strokes a single line", "");
|
||||
|
||||
|
||||
// stroke lines connecting each of the points
|
||||
DocDeclAStr(
|
||||
virtual void , StrokeLines( size_t points, const wxPoint2D *points_array),
|
||||
"StrokeLines(self, List points)",
|
||||
"", "");
|
||||
"stroke lines connecting each of the points", "");
|
||||
|
||||
|
||||
// // stroke disconnected lines from begin to end points
|
||||
// virtual void StrokeLines( size_t n, const wxPoint2D *beginPoints, const wxPoint2D *endPoints);
|
||||
|
||||
%extend {
|
||||
DocStr(StrokeLineSegements,
|
||||
"stroke disconnected lines from begin to end points", "");
|
||||
void StrokeLineSegements(PyObject* beginPoints, PyObject* endPoints)
|
||||
{
|
||||
size_t c1, c2, count;
|
||||
@@ -629,32 +795,87 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// draws a polygon
|
||||
|
||||
DocDeclStr(
|
||||
virtual void , DrawLines( size_t points, const wxPoint2D *points_array, int fillStyle = wxWINDING_RULE ),
|
||||
"", "");
|
||||
"draws a polygon", "");
|
||||
|
||||
|
||||
// draws a polygon
|
||||
DocDeclStr(
|
||||
virtual void , DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h),
|
||||
"", "");
|
||||
"draws a rectangle", "");
|
||||
|
||||
|
||||
// draws an ellipse
|
||||
DocDeclStr(
|
||||
virtual void , DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h),
|
||||
"", "");
|
||||
"draws an ellipse", "");
|
||||
|
||||
|
||||
// draws a rounded rectangle
|
||||
DocDeclStr(
|
||||
virtual void , DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius),
|
||||
"", "");
|
||||
"draws a rounded rectangle", "");
|
||||
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual bool , ShouldOffset() const,
|
||||
"helper to determine if a 0.5 offset should be applied for the drawing operation", "");
|
||||
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxGraphicsRenderer : public wxObject
|
||||
{
|
||||
public :
|
||||
// wxGraphicsRenderer(); This is an ABC, use GetDefaultRenderer
|
||||
|
||||
virtual ~wxGraphicsRenderer();
|
||||
|
||||
// %newobject GetDefaultRenderer; ???
|
||||
static wxGraphicsRenderer* GetDefaultRenderer();
|
||||
|
||||
%nokwargs CreateContext;
|
||||
%newobject CreateContext;
|
||||
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) ;
|
||||
virtual wxGraphicsContext * CreateContext( wxWindow* window );
|
||||
|
||||
%newobject CreateContextFromNativeContext;
|
||||
virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
|
||||
|
||||
%newobject CreateContextFromNativeWindow;
|
||||
virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window );
|
||||
|
||||
|
||||
%newobject CreatePath;
|
||||
virtual wxGraphicsPath * CreatePath();
|
||||
|
||||
%newobject CreateMatrix;
|
||||
virtual wxGraphicsMatrix * CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
|
||||
wxDouble tx=0.0, wxDouble ty=0.0);
|
||||
|
||||
%newobject CreatePen;
|
||||
virtual wxGraphicsPen* CreatePen(const wxPen& pen) ;
|
||||
|
||||
%newobject CreateBrush;
|
||||
virtual wxGraphicsBrush* CreateBrush(const wxBrush& brush ) ;
|
||||
|
||||
%newobject CreateLinearGradientBrush;
|
||||
virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
|
||||
const wxColour&c1, const wxColour&c2);
|
||||
|
||||
%newobject CreateRadialGradientBrush;
|
||||
virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
|
||||
const wxColour &oColor, const wxColour &cColor);
|
||||
|
||||
%newobject CreateFont;
|
||||
virtual wxGraphicsFont* CreateFont( const wxFont &font , const wxColour &col = *wxBLACK );
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
|
Reference in New Issue
Block a user