]>
Commit | Line | Data |
---|---|---|
52479aef | 1 | ///////////////////////////////////////////////////////////////////////////// |
1b88201f | 2 | // Name: wx/mac/classic/cursor.h |
52479aef SC |
3 | // Purpose: wxCursor class |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
65571936 | 9 | // Licence: wxWindows licence |
52479aef SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CURSOR_H_ | |
13 | #define _WX_CURSOR_H_ | |
14 | ||
52479aef SC |
15 | #include "wx/bitmap.h" |
16 | ||
17 | class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData | |
18 | { | |
19 | DECLARE_NO_COPY_CLASS(wxCursorRefData) | |
1b88201f | 20 | |
52479aef SC |
21 | friend class WXDLLEXPORT wxBitmap; |
22 | friend class WXDLLEXPORT wxCursor; | |
23 | public: | |
24 | wxCursorRefData(); | |
d3c7fc99 | 25 | virtual ~wxCursorRefData(); |
52479aef SC |
26 | |
27 | protected: | |
28 | WXHCURSOR m_hCursor; | |
29 | bool m_disposeHandle; | |
30 | bool m_releaseHandle; | |
31 | bool m_isColorCursor ; | |
32 | long m_themeCursor ; | |
33 | }; | |
34 | ||
35 | #define M_CURSORDATA ((wxCursorRefData *)m_refData) | |
36 | #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) | |
37 | ||
38 | // Cursor | |
39 | class WXDLLEXPORT wxCursor: public wxBitmap | |
40 | { | |
41 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
42 | ||
43 | public: | |
44 | wxCursor(); | |
45 | ||
52479aef SC |
46 | wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, |
47 | const char maskBits[] = NULL); | |
48 | ||
49 | wxCursor(const wxImage & image) ; | |
50 | wxCursor(const char **bits) ; | |
51 | wxCursor(char **bits) ; | |
52 | wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE, | |
53 | int hotSpotX = 0, int hotSpotY = 0); | |
54 | ||
55 | wxCursor(int cursor_type); | |
d3c7fc99 | 56 | virtual ~wxCursor(); |
52479aef | 57 | |
1b88201f | 58 | bool CreateFromXpm(const char **bits) ; |
b7cacb43 VZ |
59 | virtual bool Ok() const { return IsOk(); } |
60 | virtual bool IsOk() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; } | |
52479aef | 61 | |
fbfb8bcc VZ |
62 | inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; } |
63 | inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; } | |
52479aef SC |
64 | |
65 | void MacInstall() const ; | |
66 | ||
67 | void SetHCURSOR(WXHCURSOR cursor); | |
68 | inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } | |
69 | private : | |
70 | void CreateFromImage(const wxImage & image) ; | |
71 | }; | |
72 | ||
73 | extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); | |
74 | ||
75 | #endif | |
76 | // _WX_CURSOR_H_ |