X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1263dcfa3fb318e9a48bdbdfe548eb474ae5fde..664e5ff93e8ed74969e67c79ce9da004309ca91c:/include/wx/cocoa/dc.h diff --git a/include/wx/cocoa/dc.h b/include/wx/cocoa/dc.h index ccf45da798..8e990e080e 100644 --- a/include/wx/cocoa/dc.h +++ b/include/wx/cocoa/dc.h @@ -12,22 +12,26 @@ #ifndef __WX_COCOA_DC_H__ #define __WX_COCOA_DC_H__ -class WXDLLEXPORT wxDC; -WX_DECLARE_LIST(wxDC, wxCocoaDCStack); +DECLARE_WXCOCOA_OBJC_CLASS(NSAffineTransform); + +#include "wx/dc.h" + +class WXDLLIMPEXP_FWD_CORE wxCocoaDCImpl; +WX_DECLARE_LIST(wxCocoaDCImpl, wxCocoaDCStack); //========================================================================= // wxDC //========================================================================= -class WXDLLEXPORT wxDC: public wxDCBase +class WXDLLIMPEXP_CORE wxCocoaDCImpl: public wxDCImpl { - DECLARE_DYNAMIC_CLASS(wxDC) - DECLARE_NO_COPY_CLASS(wxDC) + DECLARE_ABSTRACT_CLASS(wxCocoaDCImpl) + DECLARE_NO_COPY_CLASS(wxCocoaDCImpl) //------------------------------------------------------------------------- // Initialization //------------------------------------------------------------------------- public: - wxDC(); - ~wxDC(); + wxCocoaDCImpl(wxDC *owner); + virtual ~wxCocoaDCImpl(); //------------------------------------------------------------------------- // wxCocoa specifics @@ -38,6 +42,8 @@ public: static WX_NSTextStorage sm_cocoaNSTextStorage; static WX_NSLayoutManager sm_cocoaNSLayoutManager; static WX_NSTextContainer sm_cocoaNSTextContainer; + // Create a simple Wx to Bounds transform (just flip the coordinate system) + static WX_NSAffineTransform CocoaGetWxToBoundsTransform(bool isFlipped, float height); protected: // DC stack static wxCocoaDCStack sm_cocoaDCStack; @@ -54,8 +60,12 @@ protected: void CocoaUnwindStackAndLoseFocus(); // DC flipping/transformation void CocoaApplyTransformations(); - float m_cocoaHeight; - bool m_cocoaFlipped; + void CocoaUnapplyTransformations(); + WX_NSAffineTransform m_cocoaWxToBoundsTransform; +// Get bounds rect (for Clear()) + // note: we use void * to mean NSRect * so that we can avoid + // putting NSRect in the headers. + virtual bool CocoaGetBounds(void *rectData); // Blitting virtual bool CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc, @@ -75,7 +85,7 @@ public: virtual void StartPage(void) {}; virtual void EndPage(void) {}; - virtual void SetFont(const wxFont& font) {} + virtual void SetFont(const wxFont& font); virtual void SetPen(const wxPen& pen); virtual void SetBrush(const wxBrush& brush); virtual void SetBackground(const wxBrush& brush); @@ -90,7 +100,7 @@ public: wxCoord *x, wxCoord *y, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; + const wxFont *theFont = NULL) const; virtual bool CanDrawBitmap() const; virtual bool CanGetTextExtent() const; @@ -148,7 +158,7 @@ protected: // this is gnarly - we can't even call this function DoSetClippingRegion() // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);