]>
Commit | Line | Data |
---|---|---|
9b6dbb09 | 1 | ///////////////////////////////////////////////////////////////////////////// |
925f7740 | 2 | // Name: wx/motif/cursor.h |
9b6dbb09 JS |
3 | // Purpose: wxCursor class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
9b6dbb09 | 7 | // Copyright: (c) Julian Smart |
925f7740 | 8 | // Licence: wxWindows licence |
9b6dbb09 JS |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_CURSOR_H_ | |
12 | #define _WX_CURSOR_H_ | |
13 | ||
8f884a0d | 14 | #include "wx/gdiobj.h" |
93e73c74 | 15 | #include "wx/gdicmn.h" |
9b6dbb09 | 16 | |
b5dbe15d | 17 | class WXDLLIMPEXP_FWD_CORE wxImage; |
9b6dbb09 JS |
18 | |
19 | // Cursor | |
53a2db12 | 20 | class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject |
9b6dbb09 | 21 | { |
9b6dbb09 | 22 | public: |
83df96d6 | 23 | wxCursor(); |
f8855e47 | 24 | |
ffa3d6b8 MB |
25 | wxCursor(const char bits[], int width, int height, |
26 | int hotSpotX = -1, int hotSpotY = -1, | |
0ef5b1da FM |
27 | const char maskBits[] = NULL, |
28 | const wxColour* fg = NULL, const wxColour* bg = NULL); | |
925f7740 | 29 | |
0ef5b1da FM |
30 | wxCursor(const wxString& name, |
31 | wxBitmapType type = wxCURSOR_DEFAULT_TYPE, | |
32 | int hotSpotX = 0, int hotSpotY = 0); | |
4daa4d66 | 33 | |
925f7740 | 34 | #if wxUSE_IMAGE |
4daa4d66 CE |
35 | wxCursor(const wxImage& image); |
36 | #endif | |
925f7740 | 37 | |
0ef5b1da FM |
38 | wxCursor(wxStockCursor id) { InitFromStock(id); } |
39 | #if WXWIN_COMPATIBILITY_2_8 | |
40 | wxCursor(int id) { InitFromStock((wxStockCursor)id); } | |
41 | #endif | |
42 | ||
d3c7fc99 | 43 | virtual ~wxCursor(); |
925f7740 | 44 | |
83df96d6 JS |
45 | // Motif-specific. |
46 | // Create/get a cursor for the current display | |
bc6e28d5 | 47 | WXCursor GetXCursor(WXDisplay* display) const; |
8f884a0d VZ |
48 | |
49 | protected: | |
50 | virtual wxGDIRefData *CreateGDIRefData() const; | |
51 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
52 | ||
93e73c74 | 53 | private: |
0ef5b1da FM |
54 | void InitFromStock(wxStockCursor); |
55 | ||
ffa3d6b8 MB |
56 | void Create(const char bits[], int width, int height, |
57 | int hotSpotX = -1, int hotSpotY = -1, | |
58 | const char maskBits[] = NULL); | |
59 | void Create(WXPixmap cursor, WXPixmap mask, int hotSpotX, int hotSpotY); | |
60 | ||
83df96d6 | 61 | // Make a cursor from standard id |
bc6e28d5 | 62 | WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const; |
8f884a0d VZ |
63 | |
64 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
9b6dbb09 JS |
65 | }; |
66 | ||
53a2db12 | 67 | extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor); |
9b6dbb09 JS |
68 | |
69 | #endif | |
83df96d6 | 70 | // _WX_CURSOR_H_ |