From: Robert Roebling Date: Fri, 25 Apr 2008 13:32:23 +0000 (+0000) Subject: Made wxCairo graphics code compile again, wxGraphicsBitmap still missing X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d974a4945c7325a83dab9bcb83a5021f77cb65eb?ds=sidebyside Made wxCairo graphics code compile again, wxGraphicsBitmap still missing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/graphics.h b/include/wx/graphics.h index f26ae667f1..488e8dcd54 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -439,7 +439,9 @@ public: // image support // +#ifndef __WXGTK20__ virtual void DrawBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; +#endif virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; @@ -577,12 +579,16 @@ public : // sets the font virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) = 0; - + +#ifndef __WXGTK20__ // create a native bitmap representation virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0; // create a subimage from a native image representation virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; +#endif + + private : DECLARE_NO_COPY_CLASS(wxGraphicsRenderer) DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer) diff --git a/interface/graphics.h b/interface/graphics.h index c20139b4bd..5d973ec52b 100644 --- a/interface/graphics.h +++ b/interface/graphics.h @@ -196,6 +196,29 @@ public: instance, or indirectly using the static convenience CreateXXX functions of wxGraphicsContext that always delegate the task to the default renderer. + @code + void MyCanvas::OnPaint(wxPaintEvent &event) + { + // Create paint DC + wxPaintDC dc(this); + + // Create graphics context from it + wxGraphicsContext *gc = dc.CreateGraphicsContext(); + + // make a path that contains a circle and some lines, centered at 100,100 + wxGraphicsPath path = gc->CreatePath(); + path.AddCircle( 0.0, 0.0, 100.0 ); + path.MoveToPoint(0.0, -100.0); + path.AddLineToPoint(0.0, 100.0); + path.MoveToPoint(-100.0, 0.0); + path.AddLineToPoint(100.0, 0); + path.CloseSubpath(); + path.AddRectangle(-50.0, -25.0, 100.0, 50.0); + + delete gc; + @endcode + + @library{wxcore} @category{FIXME} diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index b70fbd4f9a..0c6ff55590 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1516,6 +1516,20 @@ public : // sets the font virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) ; + // create a native bitmap representation +#if 0 + virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) + { + return wxGraphicsBitmap; + } + + // create a subimage from a native image representation + virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) + { + return wxGraphicsBitmap; + } +#endif + private : DECLARE_DYNAMIC_CLASS_NO_COPY(wxCairoRenderer) } ;