1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/bitmap.h"
17 class WXDLLEXPORT wxCursorRefData
: public wxBitmapRefData
19 DECLARE_NO_COPY_CLASS(wxCursorRefData
)
21 friend class WXDLLEXPORT wxBitmap
;
22 friend class WXDLLEXPORT wxCursor
;
31 bool m_isColorCursor
;
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 wxImage
& image
) ;
55 wxCursor(const char **bits
) ;
56 wxCursor(char **bits
) ;
57 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
58 int hotSpotX
= 0, int hotSpotY
= 0);
60 wxCursor(int cursor_type
);
63 bool CreateFromXpm(const char **bits
) ;
64 virtual bool Ok() const { return (m_refData
!= NULL
&& ( M_CURSORDATA
->m_hCursor
!= NULL
|| M_CURSORDATA
->m_themeCursor
!= -1 ) ) ; }
66 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
67 inline bool operator == (const wxCursor
& cursor
) const { return m_refData
== cursor
.m_refData
; }
68 inline bool operator != (const wxCursor
& cursor
) const { return m_refData
!= cursor
.m_refData
; }
70 void MacInstall() const ;
72 void SetHCURSOR(WXHCURSOR cursor
);
73 inline WXHCURSOR
GetHCURSOR() const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
75 void CreateFromImage(const wxImage
& image
) ;
78 extern WXDLLEXPORT
void wxSetCursor(const wxCursor
& cursor
);