1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
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 bool m_isColorCursor
;
39 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
40 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
43 class WXDLLEXPORT wxCursor
: public wxBitmap
45 DECLARE_DYNAMIC_CLASS(wxCursor
)
51 wxCursor(const wxCursor
& cursor
)
55 wxCursor(const char bits
[], int width
, int height
, int hotSpotX
= -1, int hotSpotY
= -1,
56 const char maskBits
[] = NULL
);
58 wxCursor(const wxImage
& image
) ;
60 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
61 int hotSpotX
= 0, int hotSpotY
= 0);
63 wxCursor(int cursor_type
);
66 virtual bool Ok() const { return (m_refData
!= NULL
&& ( M_CURSORDATA
->m_hCursor
!= NULL
|| M_CURSORDATA
->m_themeCursor
!= -1 ) ) ; }
68 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
69 inline bool operator == (const wxCursor
& cursor
) { return m_refData
== cursor
.m_refData
; }
70 inline bool operator != (const wxCursor
& cursor
) { return m_refData
!= cursor
.m_refData
; }
72 void MacInstall() const ;
74 void SetHCURSOR(WXHCURSOR cursor
);
75 inline WXHCURSOR
GetHCURSOR() const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
77 void CreateFromImage(const wxImage
& image
) ;
80 extern WXDLLEXPORT
void wxSetCursor(const wxCursor
& cursor
);