X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/907789a0f72354f30ec04f79f03a0b7e2a29ac9a..1b3667ab28da7b78b49813b99047221e03a69b62:/src/gtk/pen.cpp diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index dc2fec60a0..1e2205e78d 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 ) @@ -144,36 +138,36 @@ void wxPen::SetWidth( int width ) int wxPen::GetCap() const { - wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + return M_PENDATA->m_capStyle; } int wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + return M_PENDATA->m_joinStyle; } int wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, "invalid pen" ); - + wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + return M_PENDATA->m_width; } wxColour &wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, "invalid pen" ); - + wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") ); + return M_PENDATA->m_colour; }