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
) ;
59 wxCursor(const char **bits
) ;
60 wxCursor(char **bits
) ;
61 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
62 int hotSpotX
= 0, int hotSpotY
= 0);
64 wxCursor(int cursor_type
);
67 bool CreateFromXpm(const char **bits
) ;
68 virtual bool Ok() const { return (m_refData
!= NULL
&& ( M_CURSORDATA
->m_hCursor
!= NULL
|| M_CURSORDATA
->m_themeCursor
!= -1 ) ) ; }
70 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
71 inline bool operator == (const wxCursor
& cursor
) { return m_refData
== cursor
.m_refData
; }
72 inline bool operator != (const wxCursor
& cursor
) { return m_refData
!= cursor
.m_refData
; }
74 void MacInstall() const ;
76 void SetHCURSOR(WXHCURSOR cursor
);
77 inline WXHCURSOR
GetHCURSOR() const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
79 void CreateFromImage(const wxImage
& image
) ;
82 extern WXDLLEXPORT
void wxSetCursor(const wxCursor
& cursor
);