-IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
-WX_NSTextStorage wxDC::sm_cocoaNSTextStorage = nil;
-WX_NSLayoutManager wxDC::sm_cocoaNSLayoutManager = nil;
-WX_NSTextContainer wxDC::sm_cocoaNSTextContainer = nil;
-wxCocoaDCStack wxDC::sm_cocoaDCStack;
+IMPLEMENT_ABSTRACT_CLASS(wxCocoaDCImpl, wxDCImpl)
+
+WX_NSTextStorage wxCocoaDCImpl::sm_cocoaNSTextStorage = nil;
+WX_NSLayoutManager wxCocoaDCImpl::sm_cocoaNSLayoutManager = nil;
+WX_NSTextContainer wxCocoaDCImpl::sm_cocoaNSTextContainer = nil;
+wxCocoaDCStack wxCocoaDCImpl::sm_cocoaDCStack;
+
+inline void CocoaSetPenForNSBezierPath(wxPen &pen, NSBezierPath *bezpath)
+{
+ [pen.GetNSColor() set];
+ const CGFloat *pattern;
+ [bezpath setLineDash:pattern count:pen.GetCocoaLineDash(&pattern) phase:0.0];
+ [bezpath setLineWidth:pen.GetWidth()];
+ switch(pen.GetJoin())
+ {
+ case wxJOIN_BEVEL:
+ [bezpath setLineJoinStyle:NSBevelLineJoinStyle];
+ break;
+ case wxJOIN_ROUND:
+ [bezpath setLineJoinStyle:NSRoundLineJoinStyle];
+ break;
+ case wxJOIN_MITER:
+ [bezpath setLineJoinStyle:NSMiterLineJoinStyle];
+ break;
+ }
+ switch(pen.GetCap())
+ {
+ case wxCAP_ROUND:
+ [bezpath setLineCapStyle:NSRoundLineCapStyle];
+ break;
+ case wxCAP_PROJECTING:
+ [bezpath setLineCapStyle:NSSquareLineCapStyle];
+ break;
+ case wxCAP_BUTT:
+ [bezpath setLineCapStyle:NSButtLineCapStyle];
+ break;
+ }
+}