]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/NSView.h
Add lambda-friendly wxDialog::ShowWindowModalThenDo().
[wxWidgets.git] / include / wx / cocoa / NSView.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/NSView.h
3 // Purpose: wxCocoaNSView class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2003/02/15
7 // Copyright: (c) 2003 David Elliott
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef __WX_COCOA_NSVIEW_H__
12 #define __WX_COCOA_NSVIEW_H__
13
14 #include "wx/hashmap.h"
15 #include "wx/cocoa/ObjcAssociate.h"
16
17 #if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
18 typedef struct CGRect NSRect;
19 #else
20 typedef struct _NSRect NSRect;
21 #endif
22
23 struct objc_object;
24
25 class wxWindow;
26
27 WX_DECLARE_OBJC_HASHMAP(NSView);
28 class wxCocoaNSView
29 {
30 /* NSView is a rather special case and requires some extra attention */
31 WX_DECLARE_OBJC_INTERFACE_HASHMAP(NSView)
32 public:
33 void AssociateNSView(WX_NSView cocoaNSView);
34 void DisassociateNSView(WX_NSView cocoaNSView);
35 protected:
36 static struct objc_object *sm_cocoaObserver;
37 public:
38 virtual wxWindow* GetWxWindow() const
39 { return NULL; }
40 virtual void Cocoa_FrameChanged(void) = 0;
41 virtual void Cocoa_synthesizeMouseMoved(void) = 0;
42 virtual bool Cocoa_acceptsFirstMouse(bool &WXUNUSED(acceptsFirstMouse), WX_NSEvent WXUNUSED(theEvent))
43 { return false; }
44 virtual bool Cocoa_drawRect(const NSRect &WXUNUSED(rect))
45 { return false; }
46 virtual bool Cocoa_mouseDown(WX_NSEvent WXUNUSED(theEvent))
47 { return false; }
48 virtual bool Cocoa_mouseDragged(WX_NSEvent WXUNUSED(theEvent))
49 { return false; }
50 virtual bool Cocoa_mouseUp(WX_NSEvent WXUNUSED(theEvent))
51 { return false; }
52 virtual bool Cocoa_mouseMoved(WX_NSEvent WXUNUSED(theEvent))
53 { return false; }
54 virtual bool Cocoa_mouseEntered(WX_NSEvent WXUNUSED(theEvent))
55 { return false; }
56 virtual bool Cocoa_mouseExited(WX_NSEvent WXUNUSED(theEvent))
57 { return false; }
58 virtual bool Cocoa_rightMouseDown(WX_NSEvent WXUNUSED(theEvent))
59 { return false; }
60 virtual bool Cocoa_rightMouseDragged(WX_NSEvent WXUNUSED(theEvent))
61 { return false; }
62 virtual bool Cocoa_rightMouseUp(WX_NSEvent WXUNUSED(theEvent))
63 { return false; }
64 virtual bool Cocoa_otherMouseDown(WX_NSEvent WXUNUSED(theEvent))
65 { return false; }
66 virtual bool Cocoa_otherMouseDragged(WX_NSEvent WXUNUSED(theEvent))
67 { return false; }
68 virtual bool Cocoa_otherMouseUp(WX_NSEvent WXUNUSED(theEvent))
69 { return false; }
70 virtual bool Cocoa_resetCursorRects()
71 { return false; }
72 virtual bool Cocoa_viewDidMoveToWindow()
73 { return false; }
74 virtual bool Cocoa_viewWillMoveToWindow(WX_NSWindow WXUNUSED(newWindow))
75 { return false; }
76 virtual ~wxCocoaNSView() { }
77 };
78
79 #endif
80 // __WX_COCOA_NSVIEW_H__