1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "cursor.h"
19 #include "wx/bitmap.h"
21 class WXDLLEXPORT wxCursorRefData
: public wxBitmapRefData
23 DECLARE_NO_COPY_CLASS(wxCursorRefData
)
25 friend class WXDLLEXPORT wxBitmap
;
26 friend class WXDLLEXPORT wxCursor
;
35 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
36 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
39 class WXDLLEXPORT wxCursor
: public wxBitmap
41 DECLARE_DYNAMIC_CLASS(wxCursor
)
47 wxCursor(const wxCursor
& cursor
)
51 wxCursor(const char bits
[], int width
, int height
, int hotSpotX
= -1, int hotSpotY
= -1,
52 const char maskBits
[] = NULL
);
54 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
55 int hotSpotX
= 0, int hotSpotY
= 0);
57 wxCursor(int cursor_type
);
60 virtual bool Ok() const { return (m_refData
!= NULL
&& M_CURSORDATA
->m_hCursor
!= NULL
) ; }
62 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
63 inline bool operator == (const wxCursor
& cursor
) { return m_refData
== cursor
.m_refData
; }
64 inline bool operator != (const wxCursor
& cursor
) { return m_refData
!= cursor
.m_refData
; }
66 void MacInstall() const ;
68 void SetHCURSOR(WXHCURSOR cursor
);
69 inline WXHCURSOR
GetHCURSOR() const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
72 extern WXDLLEXPORT
void wxSetCursor(const wxCursor
& cursor
);