X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/065e208ec09e3d08d51d9604497f92f53c210f93..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/cocoa/pen.mm diff --git a/src/cocoa/pen.mm b/src/cocoa/pen.mm index 2ab4e00e28..b5e6e36065 100644 --- a/src/cocoa/pen.mm +++ b/src/cocoa/pen.mm @@ -6,15 +6,16 @@ // Created: 2003/08/02 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" + #ifndef WX_PRECOMP #include "wx/pen.h" + #include "wx/bitmap.h" + #include "wx/colour.h" #endif //WX_PRECOMP -#include "wx/bitmap.h" -#include "wx/colour.h" #import @@ -23,7 +24,6 @@ // ======================================================================== class WXDLLEXPORT wxPenRefData: public wxGDIRefData { - friend class WXDLLEXPORT wxPen; public: wxPenRefData(const wxColour& colour = wxNullColour, int width = 1, int style = wxSOLID, @@ -53,7 +53,7 @@ public: m_style = wxSTIPPLE; } WX_NSColor GetNSColor(); - int GetCocoaLineDash(const float **pattern); + int GetCocoaLineDash(const CGFloat **pattern); protected: void FreeCocoaNSColor(); void FreeCocoaDash(); @@ -67,36 +67,39 @@ protected: wxDash *m_dash; wxBitmap m_stipple; WX_NSColor m_cocoaNSColor; - float *m_cocoaDash; + CGFloat *m_cocoaDash; // Predefined dash patterns static const int scm_countDot; - static const float scm_patternDot[]; + static const CGFloat scm_patternDot[]; static const int scm_countLongDash; - static const float scm_patternLongDash[]; + static const CGFloat scm_patternLongDash[]; static const int scm_countShortDash; - static const float scm_patternShortDash[]; + static const CGFloat scm_patternShortDash[]; static const int scm_countDotDash; - static const float scm_patternDotDash[]; + static const CGFloat scm_patternDotDash[]; + + friend class WXDLLIMPEXP_FWD_CORE wxPen; + private: // Don't allow assignment wxPenRefData& operator=(const wxPenRefData& data); }; const int wxPenRefData::scm_countDot = 1; -const float wxPenRefData::scm_patternDot[] = { +const CGFloat wxPenRefData::scm_patternDot[] = { 1.0 }; const int wxPenRefData::scm_countLongDash = 1; -const float wxPenRefData::scm_patternLongDash[] = { +const CGFloat wxPenRefData::scm_patternLongDash[] = { 10.0 }; const int wxPenRefData::scm_countShortDash = 1; -const float wxPenRefData::scm_patternShortDash[] = { +const CGFloat wxPenRefData::scm_patternShortDash[] = { 5.0 }; const int wxPenRefData::scm_countDotDash = 4; -const float wxPenRefData::scm_patternDotDash[] = { +const CGFloat wxPenRefData::scm_patternDotDash[] = { 1.0 , 1.0 , 5.0 @@ -184,7 +187,7 @@ inline WX_NSColor wxPenRefData::GetNSColor() return m_cocoaNSColor; } -int wxPenRefData::GetCocoaLineDash(const float **pattern) +int wxPenRefData::GetCocoaLineDash(const CGFloat **pattern) { int count; switch( m_style ) @@ -215,7 +218,7 @@ int wxPenRefData::GetCocoaLineDash(const float **pattern) { if(!m_cocoaDash) { - m_cocoaDash = new float[count]; + m_cocoaDash = new CGFloat[count]; for(int i=0; im_colour : wxNullColour); + return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); } int wxPen::GetWidth() const { - return (M_PENDATA ? M_PENDATA->m_width : 0); + return (M_PENDATA ? M_PENDATA->m_width : 0); } int wxPen::GetStyle() const { - return (M_PENDATA ? M_PENDATA->m_style : 0); + return (M_PENDATA ? M_PENDATA->m_style : 0); } int wxPen::GetJoin() const { - return (M_PENDATA ? M_PENDATA->m_join : 0); + return (M_PENDATA ? M_PENDATA->m_join : 0); } int wxPen::GetCap() const { - return (M_PENDATA ? M_PENDATA->m_cap : 0); + return (M_PENDATA ? M_PENDATA->m_cap : 0); } int wxPen::GetDashes(wxDash **ptr) const @@ -353,7 +356,7 @@ int wxPen::GetDashes(wxDash **ptr) const wxBitmap *wxPen::GetStipple() const { - return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); + return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); } WX_NSColor wxPen::GetNSColor() @@ -361,7 +364,7 @@ WX_NSColor wxPen::GetNSColor() return (M_PENDATA ? M_PENDATA->GetNSColor() : nil); } -int wxPen::GetCocoaLineDash(const float **pattern) +int wxPen::GetCocoaLineDash(const CGFloat **pattern) { if(M_PENDATA) return M_PENDATA->GetCocoaLineDash(pattern); @@ -369,4 +372,3 @@ int wxPen::GetCocoaLineDash(const float **pattern) *pattern = NULL; return 0; } -