1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
4 // Author: David Elliott <dfe@cox.net>
8 // Copyright: (c) David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_CURSOR_H_
13 #define _WX_COCOA_CURSOR_H_
15 #include "wx/bitmap.h"
17 class WXDLLEXPORT wxCursorRefData
: public wxObjectRefData
19 DECLARE_NO_COPY_CLASS(wxCursorRefData
)
21 friend class WXDLLEXPORT wxBitmap
;
22 friend class WXDLLEXPORT wxCursor
;
28 int m_width
, m_height
;
29 WX_NSCursor m_hCursor
;
32 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
33 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
36 class WXDLLEXPORT wxCursor
: public wxBitmap
38 DECLARE_DYNAMIC_CLASS(wxCursor
)
44 wxCursor(const wxCursor
& cursor
)
48 wxCursor(const char bits
[], int width
, int height
, int hotSpotX
= -1, int hotSpotY
= -1,
49 const char maskBits
[] = NULL
);
51 wxCursor(const wxString
& name
, long flags
= 0,
52 int hotSpotX
= 0, int hotSpotY
= 0);
54 wxCursor(int cursor_type
);
57 virtual bool Ok() const { return m_refData
; }
59 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
60 inline bool operator == (const wxCursor
& cursor
) const { return m_refData
== cursor
.m_refData
; }
61 inline bool operator != (const wxCursor
& cursor
) const { return m_refData
!= cursor
.m_refData
; }
63 inline WX_NSCursor
GetNSCursor() const
65 return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0);
70 extern WXDLLEXPORT
void wxSetCursor(const wxCursor
& cursor
);
72 #endif // _WX_COCOA_CURSOR_H_