]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/cursor.h
Do not derive wxCursor from wxBitmap, plus misc cleanup.
[wxWidgets.git] / include / wx / motif / cursor.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cursor.h
3 // Purpose: wxCursor class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CURSOR_H_
13 #define _WX_CURSOR_H_
14
15 #ifdef __GNUG__
16 #pragma interface "cursor.h"
17 #endif
18
19 #include "wx/object.h"
20 #include "wx/gdicmn.h"
21
22 class WXDLLEXPORT wxImage;
23
24 // Cursor
25 class WXDLLEXPORT wxCursor: public wxObject
26 {
27 DECLARE_DYNAMIC_CLASS(wxCursor)
28
29 public:
30 wxCursor();
31
32 // Copy constructors
33 wxCursor(const wxCursor& cursor) { Ref(cursor); }
34
35 wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
36 const char maskBits[] = NULL);
37
38 wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM,
39 int hotSpotX = 0, int hotSpotY = 0);
40
41 #if wxUSE_IMAGE
42 wxCursor(const wxImage& image);
43 #endif
44
45 wxCursor(wxStockCursor id);
46 ~wxCursor();
47
48 virtual bool Ok() const;
49
50 wxCursor& operator = (const wxCursor& cursor)
51 { if (*this == cursor) return (*this); Ref(cursor); return *this; }
52 bool operator == (const wxCursor& cursor) const
53 { return m_refData == cursor.m_refData; }
54 bool operator != (const wxCursor& cursor) const
55 { return m_refData != cursor.m_refData; }
56
57 // Motif-specific.
58 // Create/get a cursor for the current display
59 WXCursor GetXCursor(WXDisplay* display) ;
60 private:
61 // Make a cursor from standard id
62 WXCursor MakeCursor(WXDisplay* display, wxStockCursor id);
63 };
64
65 extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
66
67 #endif
68 // _WX_CURSOR_H_