]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/cursor.h
Small speed up to fonts and support for scaling.
[wxWidgets.git] / include / wx / msw / cursor.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/cursor.h
3 // Purpose: wxCursor class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
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/msw/gdiimage.h"
20
21 class WXDLLEXPORT wxImage;
22
23 class WXDLLEXPORT wxCursorRefData : public wxGDIImageRefData
24 {
25 public:
26 wxCursorRefData();
27 virtual ~wxCursorRefData() { Free(); }
28
29 virtual void Free();
30
31 // for compatibility
32 public:
33 bool m_destroyCursor;
34 };
35
36 // Cursor
37 class WXDLLEXPORT wxCursor : public wxGDIImage
38 {
39 public:
40 wxCursor();
41
42 // Copy constructors
43 wxCursor(const wxCursor& cursor) { Ref(cursor); }
44 wxCursor(const wxImage& image);
45 wxCursor(const char bits[], int width, int height,
46 int hotSpotX = -1, int hotSpotY = -1,
47 const char maskBits[] = NULL);
48 wxCursor(const wxString& name,
49 long flags = wxBITMAP_TYPE_CUR_RESOURCE,
50 int hotSpotX = 0, int hotSpotY = 0);
51 wxCursor(int cursor_type);
52 virtual ~wxCursor();
53
54 wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
55 bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
56 bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
57
58 void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); }
59 WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); }
60
61 protected:
62 virtual wxGDIImageRefData *CreateData() const { return new wxCursorRefData; }
63
64 private:
65 DECLARE_DYNAMIC_CLASS(wxCursor)
66 };
67
68 #endif
69 // _WX_CURSOR_H_