]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/cocoa/dcclient.h | |
3 | // Purpose: wxClientDCImpl, wxPaintDCImpl and wxWindowDCImpl classes | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/04/01 | |
7 | // Copyright: (c) 2003 David Elliott | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef __WX_COCOA_DCCLIENT_H__ | |
12 | #define __WX_COCOA_DCCLIENT_H__ | |
13 | ||
14 | #include "wx/cocoa/dc.h" | |
15 | ||
16 | // DFE: A while ago I stumbled upon the fact that retrieving the parent | |
17 | // NSView of the content view seems to return the entire window rectangle | |
18 | // (including decorations). Of course, that is not at all part of the | |
19 | // Cocoa or OpenStep APIs, but it might be a neat hack. | |
20 | class WXDLLIMPEXP_CORE wxWindowDCImpl: public wxCocoaDCImpl | |
21 | { | |
22 | DECLARE_DYNAMIC_CLASS(wxWindowDCImpl) | |
23 | public: | |
24 | wxWindowDCImpl(wxDC *owner); | |
25 | // Create a DC corresponding to a window | |
26 | wxWindowDCImpl(wxDC *owner, wxWindow *win); | |
27 | virtual ~wxWindowDCImpl(void); | |
28 | ||
29 | protected: | |
30 | wxWindow *m_window; | |
31 | WX_NSView m_lockedNSView; | |
32 | // DC stack | |
33 | virtual bool CocoaLockFocus(); | |
34 | virtual bool CocoaUnlockFocus(); | |
35 | bool CocoaLockFocusOnNSView(WX_NSView nsview); | |
36 | bool CocoaUnlockFocusOnNSView(); | |
37 | virtual bool CocoaGetBounds(void *rectData); | |
38 | }; | |
39 | ||
40 | class WXDLLIMPEXP_CORE wxClientDCImpl: public wxWindowDCImpl | |
41 | { | |
42 | DECLARE_DYNAMIC_CLASS(wxClientDCImpl) | |
43 | public: | |
44 | wxClientDCImpl(wxDC *owner); | |
45 | // Create a DC corresponding to a window | |
46 | wxClientDCImpl(wxDC *owner, wxWindow *win); | |
47 | virtual ~wxClientDCImpl(void); | |
48 | protected: | |
49 | // DC stack | |
50 | virtual bool CocoaLockFocus(); | |
51 | virtual bool CocoaUnlockFocus(); | |
52 | }; | |
53 | ||
54 | class WXDLLIMPEXP_CORE wxPaintDCImpl: public wxWindowDCImpl | |
55 | { | |
56 | DECLARE_DYNAMIC_CLASS(wxPaintDCImpl) | |
57 | public: | |
58 | wxPaintDCImpl(wxDC *owner); | |
59 | // Create a DC corresponding to a window | |
60 | wxPaintDCImpl(wxDC *owner, wxWindow *win); | |
61 | virtual ~wxPaintDCImpl(void); | |
62 | protected: | |
63 | // DC stack | |
64 | virtual bool CocoaLockFocus(); | |
65 | virtual bool CocoaUnlockFocus(); | |
66 | }; | |
67 | ||
68 | #endif | |
69 | // __WX_COCOA_DCCLIENT_H__ |