Moved Clear() implementation into wxDC using a new virtual CocoaGetBounds()

to determine the rect to clear.  Also added CocoaUnapplyTransformations()
to bring the coordinate system back into Cocoa coordinates for those
cases such as Clear() where it makes more sense.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2005-01-17 21:30:53 +00:00
parent 1aaf88d220
commit 3e21fc053d
6 changed files with 58 additions and 28 deletions

View File

@@ -58,7 +58,12 @@ protected:
void CocoaUnwindStackAndLoseFocus();
// DC flipping/transformation
void CocoaApplyTransformations();
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,

View File

@@ -27,8 +27,6 @@ public:
wxWindowDC(wxWindow *win);
~wxWindowDC(void);
// NSView specific functions
virtual void Clear();
protected:
wxWindow *m_window;
WX_NSView m_lockedNSView;
@@ -37,6 +35,7 @@ protected:
virtual bool CocoaUnlockFocus();
bool CocoaLockFocusOnNSView(WX_NSView nsview);
bool CocoaUnlockFocusOnNSView();
virtual bool CocoaGetBounds(void *rectData);
};
class wxClientDC: public wxWindowDC

View File

@@ -23,14 +23,13 @@ public:
~wxMemoryDC(void);
virtual void SelectObject(const wxBitmap& bitmap);
virtual void DoGetSize(int *width, int *height) const;
virtual void Clear();
protected:
wxBitmap m_selectedBitmap;
WX_NSImage m_cocoaNSImage;
// DC stack
virtual bool CocoaLockFocus();
virtual bool CocoaUnlockFocus();
virtual bool CocoaGetBounds(void *rectData);
// Blitting
virtual bool CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc,