From 1d57de48588afa27a9df2026b830e6cd5b858b5d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Mar 2008 02:58:41 +0000 Subject: [PATCH] more compilation fixes after pen/brush styles changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk1/pen.h | 4 ++-- src/gtk1/brush.cpp | 16 ++++++---------- src/gtk1/pen.cpp | 24 +++++++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/include/wx/gtk1/pen.h b/include/wx/gtk1/pen.h index 01191d0324..b54de75a51 100644 --- a/include/wx/gtk1/pen.h +++ b/include/wx/gtk1/pen.h @@ -42,8 +42,6 @@ public: wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) ); #endif - virtual ~wxPen(); - bool operator==(const wxPen& pen) const; bool operator!=(const wxPen& pen) const { return !(*this == pen); } @@ -54,6 +52,7 @@ public: void SetStyle( wxPenStyle style ); void SetWidth( int width ); void SetDashes( int number_of_dashes, const wxDash *dash ); + void SetStipple(const wxBitmap& stipple); wxColour &GetColour() const; wxPenCap GetCap() const; @@ -63,6 +62,7 @@ public: int GetDashes(wxDash **ptr) const; int GetDashCount() const; wxDash* GetDash() const; + wxBitmap *GetStipple() const; private: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index d574a9ca0d..b8dfff4351 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -27,7 +27,7 @@ class wxBrushRefData: public wxGDIRefData public: wxBrushRefData() { - m_style = 0; + m_style = wxBRUSHSTYLE_INVALID; } wxBrushRefData( const wxBrushRefData& data ) @@ -68,7 +68,7 @@ wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData; M_BRUSHDATA->m_style = (wxBrushStyle)style; - M_BRUSHDATA->m_colour = colour; + M_BRUSHDATA->m_colour = col; } #endif @@ -80,9 +80,9 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap ) M_BRUSHDATA->m_stipple = stippleBitmap; if (M_BRUSHDATA->m_stipple.GetMask()) - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE; else - M_BRUSHDATA->m_style = wxSTIPPLE; + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK; } wxBrush::~wxBrush() @@ -157,11 +157,7 @@ void wxBrush::SetStipple( const wxBitmap& stipple ) M_BRUSHDATA->m_stipple = stipple; if (M_BRUSHDATA->m_stipple.GetMask()) - { - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; - } + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE; else - { - M_BRUSHDATA->m_style = wxSTIPPLE; - } + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK; } diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp index 0dfda413c1..e7202df6e7 100644 --- a/src/gtk1/pen.cpp +++ b/src/gtk1/pen.cpp @@ -106,11 +106,6 @@ wxPen::wxPen(const wxColour& colour, int width, int style) } #endif -wxPen::~wxPen() -{ - // m_refData unrefed in ~wxObject -} - wxGDIRefData *wxPen::CreateGDIRefData() const { return new wxPenRefData; @@ -127,7 +122,7 @@ bool wxPen::operator == ( const wxPen& pen ) const if (!m_refData || !pen.m_refData) return false; - return ( *(wxPenRefData*)m_refData == *(wxPenRefData*)pen.m_refData ); + return *(wxPenRefData*)m_refData == *(wxPenRefData*)pen.m_refData; } void wxPen::SetColour( const wxColour &colour ) @@ -180,6 +175,11 @@ void wxPen::SetWidth( int width ) M_PENDATA->m_width = width; } +void wxPen::SetStipple(const wxBitmap& WXUNUSED(stipple)) +{ + wxFAIL_MSG( "stippled pens not supported" ); +} + int wxPen::GetDashes( wxDash **ptr ) const { wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); @@ -204,21 +204,21 @@ wxDash* wxPen::GetDash() const wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->m_capStyle; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->m_joinStyle; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } @@ -236,3 +236,9 @@ wxColour &wxPen::GetColour() const return M_PENDATA->m_colour; } + +wxBitmap *wxPen::GetStipple() const +{ + return NULL; +} + -- 2.45.2