]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/cursor.h
Open Watcom correction
[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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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,
36 int hotSpotX = -1, int hotSpotY = -1,
37 const char maskBits[] = NULL);
38
39 wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM,
40 int hotSpotX = 0, int hotSpotY = 0);
41
42 #if wxUSE_IMAGE
43 wxCursor(const wxImage& image);
44 #endif
45
46 wxCursor(wxStockCursor id);
47 ~wxCursor();
48
49 virtual bool Ok() const;
50
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; }
57
58 // Motif-specific.
59 // Create/get a cursor for the current display
60 WXCursor GetXCursor(WXDisplay* display) ;
61 private:
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);
66
67 // Make a cursor from standard id
68 WXCursor MakeCursor(WXDisplay* display, wxStockCursor id);
69 };
70
71 extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
72
73 #endif
74 // _WX_CURSOR_H_