]>
Commit | Line | Data |
---|---|---|
fb896a32 DE |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cocoa/NSView.h | |
3 | // Purpose: wxCocoaNSView class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/02/15 | |
fb896a32 | 7 | // Copyright: (c) 2003 David Elliott |
65571936 | 8 | // Licence: wxWindows licence |
fb896a32 DE |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef __WX_COCOA_NSVIEW_H__ | |
12 | #define __WX_COCOA_NSVIEW_H__ | |
13 | ||
14 | #include "wx/hashmap.h" | |
e6686511 | 15 | #include "wx/cocoa/ObjcAssociate.h" |
fb896a32 | 16 | |
4799f3ba DE |
17 | #if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) |
18 | typedef struct CGRect NSRect; | |
19 | #else | |
8ea5271e | 20 | typedef struct _NSRect NSRect; |
4799f3ba DE |
21 | #endif |
22 | ||
ddfdef64 DE |
23 | struct objc_object; |
24 | ||
f7e98dee | 25 | class wxWindow; |
8ea5271e | 26 | |
fb896a32 DE |
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: | |
ddfdef64 | 36 | static struct objc_object *sm_cocoaObserver; |
fb896a32 | 37 | public: |
f7e98dee | 38 | virtual wxWindow* GetWxWindow() const |
1b88201f | 39 | { return NULL; } |
fb896a32 | 40 | virtual void Cocoa_FrameChanged(void) = 0; |
7c5a378f | 41 | virtual void Cocoa_synthesizeMouseMoved(void) = 0; |
8e33de15 | 42 | virtual bool Cocoa_acceptsFirstMouse(bool &WXUNUSED(acceptsFirstMouse), WX_NSEvent WXUNUSED(theEvent)) |
c05e07cb | 43 | { return false; } |
8e33de15 | 44 | virtual bool Cocoa_drawRect(const NSRect &WXUNUSED(rect)) |
2d6c4e48 | 45 | { return false; } |
8e33de15 | 46 | virtual bool Cocoa_mouseDown(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 47 | { return false; } |
8e33de15 | 48 | virtual bool Cocoa_mouseDragged(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 49 | { return false; } |
8e33de15 | 50 | virtual bool Cocoa_mouseUp(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 51 | { return false; } |
8e33de15 | 52 | virtual bool Cocoa_mouseMoved(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 53 | { return false; } |
8e33de15 | 54 | virtual bool Cocoa_mouseEntered(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 55 | { return false; } |
8e33de15 | 56 | virtual bool Cocoa_mouseExited(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 57 | { return false; } |
8e33de15 | 58 | virtual bool Cocoa_rightMouseDown(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 59 | { return false; } |
8e33de15 | 60 | virtual bool Cocoa_rightMouseDragged(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 61 | { return false; } |
8e33de15 | 62 | virtual bool Cocoa_rightMouseUp(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 63 | { return false; } |
8e33de15 | 64 | virtual bool Cocoa_otherMouseDown(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 65 | { return false; } |
8e33de15 | 66 | virtual bool Cocoa_otherMouseDragged(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 67 | { return false; } |
8e33de15 | 68 | virtual bool Cocoa_otherMouseUp(WX_NSEvent WXUNUSED(theEvent)) |
2d6c4e48 | 69 | { return false; } |
5558135c | 70 | virtual bool Cocoa_resetCursorRects() |
1b88201f | 71 | { return false; } |
7c5a378f DE |
72 | virtual bool Cocoa_viewDidMoveToWindow() |
73 | { return false; } | |
8e33de15 | 74 | virtual bool Cocoa_viewWillMoveToWindow(WX_NSWindow WXUNUSED(newWindow)) |
7c5a378f | 75 | { return false; } |
31e57091 | 76 | virtual ~wxCocoaNSView() { } |
fb896a32 DE |
77 | }; |
78 | ||
1b88201f WS |
79 | #endif |
80 | // __WX_COCOA_NSVIEW_H__ |