]>
Commit | Line | Data |
---|---|---|
a24aff65 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1b88201f | 2 | // Name: wx/cocoa/cursor.h |
a24aff65 DE |
3 | // Purpose: wxCursor class |
4 | // Author: David Elliott <dfe@cox.net> | |
5 | // Modified by: | |
6 | // Created: 2002/11/27 | |
a24aff65 | 7 | // Copyright: (c) David Elliott |
1b88201f | 8 | // Licence: wxWindows licence |
a24aff65 DE |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_COCOA_CURSOR_H_ | |
12 | #define _WX_COCOA_CURSOR_H_ | |
13 | ||
a24aff65 DE |
14 | #include "wx/bitmap.h" |
15 | ||
53a2db12 | 16 | class WXDLLIMPEXP_CORE wxCursorRefData : public wxGDIRefData |
a24aff65 | 17 | { |
a24aff65 DE |
18 | public: |
19 | wxCursorRefData(); | |
d3c7fc99 | 20 | virtual ~wxCursorRefData(); |
a24aff65 DE |
21 | |
22 | protected: | |
a4d592ff | 23 | int m_width, m_height; |
5558135c | 24 | WX_NSCursor m_hCursor; |
8f884a0d VZ |
25 | |
26 | friend class WXDLLIMPEXP_FWD_CORE wxBitmap; | |
27 | friend class WXDLLIMPEXP_FWD_CORE wxCursor; | |
28 | ||
c0c133e1 | 29 | wxDECLARE_NO_COPY_CLASS(wxCursorRefData); |
a24aff65 DE |
30 | }; |
31 | ||
32 | #define M_CURSORDATA ((wxCursorRefData *)m_refData) | |
33 | #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) | |
34 | ||
35 | // Cursor | |
53a2db12 | 36 | class WXDLLIMPEXP_CORE wxCursor: public wxBitmap |
a24aff65 | 37 | { |
a24aff65 | 38 | public: |
8f884a0d | 39 | wxCursor(); |
a24aff65 | 40 | |
0ef5b1da | 41 | wxCursor(const wxString& name, wxBitmapType type = wxCURSOR_DEFAULT_TYPE, |
8f884a0d | 42 | int hotSpotX = 0, int hotSpotY = 0); |
a24aff65 | 43 | |
0ef5b1da FM |
44 | wxCursor(wxStockCursor id) { InitFromStock(id); } |
45 | #if WXWIN_COMPATIBILITY_2_8 | |
46 | wxCursor(int id) { InitFromStock((wxStockCursor)id); } | |
47 | #endif | |
8f884a0d | 48 | virtual ~wxCursor(); |
a24aff65 | 49 | |
8f884a0d VZ |
50 | // FIXME: operator==() is wrong! |
51 | bool operator==(const wxCursor& cursor) const { return m_refData == cursor.m_refData; } | |
52 | bool operator!=(const wxCursor& cursor) const { return !(*this == cursor); } | |
1b88201f | 53 | |
8f884a0d | 54 | WX_NSCursor GetNSCursor() const { return M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0; } |
a24aff65 | 55 | |
0ef5b1da FM |
56 | private: |
57 | void InitFromStock(wxStockCursor); | |
8f884a0d | 58 | DECLARE_DYNAMIC_CLASS(wxCursor) |
a24aff65 DE |
59 | }; |
60 | ||
53a2db12 | 61 | extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor); |
a24aff65 | 62 | |
1b88201f WS |
63 | #endif |
64 | // _WX_COCOA_CURSOR_H_ |