]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/cursor.h
use std::[w]string for wxString implementation unless wxUSE_STD_STRING==0 but even...
[wxWidgets.git] / include / wx / cocoa / cursor.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/cursor.h
3 // Purpose: wxCursor class
4 // Author: David Elliott <dfe@cox.net>
5 // Modified by:
6 // Created: 2002/11/27
7 // RCS-ID: $Id$
8 // Copyright: (c) David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COCOA_CURSOR_H_
13 #define _WX_COCOA_CURSOR_H_
14
15 #include "wx/bitmap.h"
16
17 class WXDLLIMPEXP_CORE wxCursorRefData : public wxGDIRefData
18 {
19 public:
20 wxCursorRefData();
21 virtual ~wxCursorRefData();
22
23 protected:
24 int m_width, m_height;
25 WX_NSCursor m_hCursor;
26
27 friend class WXDLLIMPEXP_FWD_CORE wxBitmap;
28 friend class WXDLLIMPEXP_FWD_CORE wxCursor;
29
30 DECLARE_NO_COPY_CLASS(wxCursorRefData)
31 };
32
33 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
34 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
35
36 // Cursor
37 class WXDLLIMPEXP_CORE wxCursor: public wxBitmap
38 {
39 public:
40 wxCursor();
41
42 wxCursor(const char bits[], int width, int height,
43 int hotSpotX = -1, int hotSpotY = -1,
44 const char maskBits[] = NULL);
45
46 wxCursor(const wxString& name, long flags = 0,
47 int hotSpotX = 0, int hotSpotY = 0);
48
49 wxCursor(int cursor_type);
50 virtual ~wxCursor();
51
52 // FIXME: operator==() is wrong!
53 bool operator==(const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
54 bool operator!=(const wxCursor& cursor) const { return !(*this == cursor); }
55
56 WX_NSCursor GetNSCursor() const { return M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0; }
57
58 DECLARE_DYNAMIC_CLASS(wxCursor)
59 };
60
61 extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor);
62
63 #endif
64 // _WX_COCOA_CURSOR_H_