]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/cursor.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "cursor.h"
19 #include "wx/object.h"
20 #include "wx/gdicmn.h"
22 class WXDLLEXPORT wxImage
;
25 class WXDLLEXPORT wxCursor
: public wxObject
27 DECLARE_DYNAMIC_CLASS(wxCursor
)
33 wxCursor(const wxCursor
& cursor
) { Ref(cursor
); }
35 wxCursor(const char bits
[], int width
, int height
,
36 int hotSpotX
= -1, int hotSpotY
= -1,
37 const char maskBits
[] = NULL
);
39 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_XBM
,
40 int hotSpotX
= 0, int hotSpotY
= 0);
43 wxCursor(const wxImage
& image
);
46 wxCursor(wxStockCursor id
);
49 virtual bool Ok() const;
51 wxCursor
& operator = (const wxCursor
& cursor
)
52 { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
53 bool operator == (const wxCursor
& cursor
) const
54 { return m_refData
== cursor
.m_refData
; }
55 bool operator != (const wxCursor
& cursor
) const
56 { return m_refData
!= cursor
.m_refData
; }
59 // Create/get a cursor for the current display
60 WXCursor
GetXCursor(WXDisplay
* display
) const;
62 void Create(const char bits
[], int width
, int height
,
63 int hotSpotX
= -1, int hotSpotY
= -1,
64 const char maskBits
[] = NULL
);
65 void Create(WXPixmap cursor
, WXPixmap mask
, int hotSpotX
, int hotSpotY
);
67 // Make a cursor from standard id
68 WXCursor
MakeCursor(WXDisplay
* display
, wxStockCursor id
) const;
71 extern WXDLLEXPORT
void wxSetCursor(const wxCursor
& cursor
);