X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/907789a0f72354f30ec04f79f03a0b7e2a29ac9a..16bcc879d96712f9acf4bcc1236096251a1b7586:/src/gtk/pen.cpp diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index dc2fec60a0..3152074605 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -4,7 +4,7 @@ // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -14,6 +14,8 @@ #include "wx/pen.h" +#include "gdk/gdk.h" + //----------------------------------------------------------------------------- // wxPen //----------------------------------------------------------------------------- @@ -21,10 +23,10 @@ class wxPenRefData: public wxObjectRefData { public: - + wxPenRefData(void); wxPenRefData(const wxPenRefData& data); - + int m_width; int m_style; int m_joinStyle; @@ -55,7 +57,7 @@ wxPenRefData::wxPenRefData( const wxPenRefData& data ) IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject) -wxPen::wxPen(void) +wxPen::wxPen() { if (wxThePenList) wxThePenList->AddPen( this ); } @@ -66,7 +68,7 @@ wxPen::wxPen( const wxColour &colour, int width, int style ) M_PENDATA->m_width = width; M_PENDATA->m_style = style; M_PENDATA->m_colour = colour; - + if (wxThePenList) wxThePenList->AddPen( this ); } @@ -76,14 +78,6 @@ wxPen::wxPen( const wxPen& pen ) if (wxThePenList) wxThePenList->AddPen( this ); } -wxPen::wxPen( const wxPen* pen ) -{ - UnRef(); - if (pen) Ref( *pen ); - - if (wxThePenList) wxThePenList->AddPen( this ); -} - wxPen::~wxPen() { if (wxThePenList) wxThePenList->RemovePen( this ); @@ -91,19 +85,19 @@ wxPen::~wxPen() wxPen& wxPen::operator = ( const wxPen& pen ) { - if (*this == pen) return (*this); - Ref( pen ); - return *this; + if (*this == pen) return (*this); + Ref( pen ); + return *this; } bool wxPen::operator == ( const wxPen& pen ) { - return m_refData == pen.m_refData; + return m_refData == pen.m_refData; } bool wxPen::operator != ( const wxPen& pen ) { - return m_refData != pen.m_refData; + return m_refData != pen.m_refData; } void wxPen::SetColour( const wxColour &colour ) @@ -145,35 +139,35 @@ void wxPen::SetWidth( int width ) int wxPen::GetCap() const { wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + return M_PENDATA->m_capStyle; } int wxPen::GetJoin() const { wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + return M_PENDATA->m_joinStyle; } int wxPen::GetStyle() const { wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + return M_PENDATA->m_style; } int wxPen::GetWidth() const { wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + return M_PENDATA->m_width; } wxColour &wxPen::GetColour() const { wxCHECK_MSG( Ok(), wxNullColour, "invalid pen" ); - + return M_PENDATA->m_colour; }