]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/cursor.h
Fixed ReadLine missing last character from text files with no final newline.
[wxWidgets.git] / include / wx / os2 / cursor.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cursor.h
3 // Purpose: wxCursor class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CURSOR_H_
13 #define _WX_CURSOR_H_
14
15 #include "wx/bitmap.h"
16
17 class WXDLLEXPORT wxCursorRefData: public wxGDIImageRefData
18 {
19 public:
20 wxCursorRefData();
21 virtual ~wxCursorRefData() { Free(); }
22 virtual void Free(void);
23 bool m_bDestroyCursor;
24 }; // end of CLASS wxCursorRefData
25
26 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
27 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
28
29 // Cursor
30 class WXDLLEXPORT wxCursor: public wxBitmap
31 {
32 public:
33 wxCursor();
34
35 wxCursor(const wxImage& rImage);
36
37 wxCursor( const char acBits[]
38 ,int nWidth
39 ,int nHeight
40 ,int nHotSpotX = -1
41 ,int nHotSpotY = -1
42 ,const char zMaskBits[] = NULL
43 );
44 wxCursor( const wxString& rsName
45 ,long lFlags = wxBITMAP_TYPE_CUR_RESOURCE
46 ,int nHotSpotX = 0
47 ,int nHotSpotY = 0
48 );
49 wxCursor(int nCursorType);
50 inline ~wxCursor() { }
51 inline bool operator == (const wxCursor& rCursor) const { return m_refData == rCursor.m_refData; }
52 inline bool operator != (const wxCursor& rCursor) const { return m_refData != rCursor.m_refData; }
53
54 inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
55 inline void SetHCURSOR(WXHCURSOR hCursor) { SetHandle((WXHANDLE)hCursor); }
56
57 protected:
58 inline virtual wxGDIImageRefData* CreateData(void) const { return (new wxCursorRefData); }
59
60 private:
61 DECLARE_DYNAMIC_CLASS(wxCursor)
62 }; // end of CLASS wxCursor
63
64 #endif
65 // _WX_CURSOR_H_