]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/cursor.h
Factory some of wxFilterClassFactory into a base class.
[wxWidgets.git] / include / wx / motif / cursor.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/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 #include "wx/object.h"
16 #include "wx/gdicmn.h"
17
18 class WXDLLEXPORT wxImage;
19
20 // Cursor
21 class WXDLLEXPORT wxCursor: public wxObject
22 {
23 DECLARE_DYNAMIC_CLASS(wxCursor)
24
25 public:
26 wxCursor();
27
28 wxCursor(const char bits[], int width, int height,
29 int hotSpotX = -1, int hotSpotY = -1,
30 const char maskBits[] = NULL);
31
32 wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM,
33 int hotSpotX = 0, int hotSpotY = 0);
34
35 #if wxUSE_IMAGE
36 wxCursor(const wxImage& image);
37 #endif
38
39 wxCursor(wxStockCursor id);
40 virtual ~wxCursor();
41
42 virtual bool Ok() const { return IsOk(); }
43 virtual bool IsOk() const;
44
45 bool operator == (const wxCursor& cursor) const
46 { return m_refData == cursor.m_refData; }
47 bool operator != (const wxCursor& cursor) const
48 { return m_refData != cursor.m_refData; }
49
50 // Motif-specific.
51 // Create/get a cursor for the current display
52 WXCursor GetXCursor(WXDisplay* display) const;
53 private:
54 void Create(const char bits[], int width, int height,
55 int hotSpotX = -1, int hotSpotY = -1,
56 const char maskBits[] = NULL);
57 void Create(WXPixmap cursor, WXPixmap mask, int hotSpotX, int hotSpotY);
58
59 // Make a cursor from standard id
60 WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const;
61 };
62
63 extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
64
65 #endif
66 // _WX_CURSOR_H_