X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f884a0dccd6b642f35c441ac9bfc87a6d5b4d35..c37b0f0907b07878551a00165b0ad323bd2ccdaf:/src/dfb/pen.cpp diff --git a/src/dfb/pen.cpp b/src/dfb/pen.cpp index 21d36f623e..bec00cb7e5 100644 --- a/src/dfb/pen.cpp +++ b/src/dfb/pen.cpp @@ -3,7 +3,6 @@ // Purpose: wxPen class implementation // Author: Vaclav Slavik // Created: 2006-08-04 -// RCS-ID: $Id$ // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -29,7 +28,7 @@ class wxPenRefData : public wxGDIRefData { public: - wxPenRefData(const wxColour& clr = wxNullColour, int style = wxSOLID) + wxPenRefData(const wxColour& clr = wxNullColour, wxPenStyle style = wxPENSTYLE_SOLID) { m_colour = clr; SetStyle(style); @@ -40,18 +39,18 @@ public: virtual bool IsOk() const { return m_colour.IsOk(); } - void SetStyle(int style) + void SetStyle(wxPenStyle style) { - if ( style != wxSOLID && style != wxTRANSPARENT ) + if ( style != wxPENSTYLE_SOLID && style != wxPENSTYLE_TRANSPARENT ) { wxFAIL_MSG( "only wxSOLID and wxTRANSPARENT styles are supported" ); - style = wxSOLID; + style = wxPENSTYLE_SOLID; } m_style = style; } - int m_style; + wxPenStyle m_style; wxColour m_colour; }; @@ -61,13 +60,20 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) -wxPen::wxPen(const wxColour &colour, int width, int style) +wxPen::wxPen(const wxColour &colour, int width, wxPenStyle style) { wxASSERT_MSG( width <= 1, "only width=0,1 are supported" ); m_refData = new wxPenRefData(colour, style); } +#if FUTURE_WXWIN_COMPATIBILITY_3_0 +wxPen::wxPen(const wxColour& col, int width, int style) +{ + m_refData = new wxPenRefData(col, (wxPenStyle)style); +} +#endif + wxPen::wxPen(const wxBitmap& WXUNUSED(stipple), int WXUNUSED(width)) { wxFAIL_MSG( "stipple pens not supported" ); @@ -77,7 +83,7 @@ wxPen::wxPen(const wxBitmap& WXUNUSED(stipple), int WXUNUSED(width)) bool wxPen::operator==(const wxPen& pen) const { -#warning "this is incorrect (MGL too)" +#warning "this is incorrect" return m_refData == pen.m_refData; } @@ -98,17 +104,17 @@ void wxPen::SetColour(unsigned char red, unsigned char green, unsigned char blue M_PENDATA->m_colour.Set(red, green, blue); } -void wxPen::SetCap(int WXUNUSED(capStyle)) +void wxPen::SetCap(wxPenCap WXUNUSED(capStyle)) { wxFAIL_MSG( "SetCap not implemented" ); } -void wxPen::SetJoin(int WXUNUSED(joinStyle)) +void wxPen::SetJoin(wxPenJoin WXUNUSED(joinStyle)) { wxFAIL_MSG( "SetJoin not implemented" ); } -void wxPen::SetStyle(int style) +void wxPen::SetStyle(wxPenStyle style) { AllocExclusive(); M_PENDATA->SetStyle(style); @@ -146,46 +152,46 @@ wxDash* wxPen::GetDash() const return NULL; } -int wxPen::GetCap() const +wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); wxFAIL_MSG( "GetCap not implemented" ); - return -1; + return wxCAP_INVALID; } -int wxPen::GetJoin() const +wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); wxFAIL_MSG( "GetJoin not implemented" ); - return -1; + return wxJOIN_INVALID; } -int wxPen::GetStyle() const +wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return 1; } -wxColour &wxPen::GetColour() const +wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } wxBitmap *wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); wxFAIL_MSG( "GetStipple not implemented" ); return NULL;