Implement wxGraphicsContext::GetSize() for Cairo.

As the implementation of this method is basically the same for all ports move
it to the base class itself instead of requiring the derived classes to
implement it. Now the derived classes need to fill in m_width and m_height
members instead.

Do fill them when creating wxGraphicsContext in Cairo version.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-03-31 09:38:03 +00:00
parent cdcc1edaf2
commit b129eaa377
6 changed files with 39 additions and 28 deletions

View File

@@ -503,7 +503,13 @@ public:
virtual bool SetCompositionMode(wxCompositionMode op) = 0;
// returns the size of the graphics context in device coordinates
virtual void GetSize( wxDouble* width, wxDouble* height);
void GetSize(wxDouble* width, wxDouble* height)
{
if ( width )
*width = m_width;
if ( height )
*height = m_height;
}
// returns the resolution of the graphics context in device points per inch
virtual void GetDPI( wxDouble* dpiX, wxDouble* dpiY);
@@ -638,6 +644,9 @@ public:
virtual bool ShouldOffset() const { return false; }
protected:
// These fields must be initialized in the derived class ctors.
wxDouble m_width,
m_height;
wxGraphicsPen m_pen;
wxGraphicsBrush m_brush;