]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/cursor.h
Change GetC to return an int so that it can return wxEOF on error.
[wxWidgets.git] / include / wx / cocoa / cursor.h
CommitLineData
a24aff65 1/////////////////////////////////////////////////////////////////////////////
1b88201f 2// Name: wx/cocoa/cursor.h
a24aff65
DE
3// Purpose: wxCursor class
4// Author: David Elliott <dfe@cox.net>
5// Modified by:
6// Created: 2002/11/27
1b88201f 7// RCS-ID: $Id$
a24aff65 8// Copyright: (c) David Elliott
1b88201f 9// Licence: wxWindows licence
a24aff65
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COCOA_CURSOR_H_
13#define _WX_COCOA_CURSOR_H_
14
a24aff65
DE
15#include "wx/bitmap.h"
16
a4d592ff 17class WXDLLEXPORT wxCursorRefData: public wxObjectRefData
a24aff65
DE
18{
19 DECLARE_NO_COPY_CLASS(wxCursorRefData)
1b88201f 20
a24aff65
DE
21 friend class WXDLLEXPORT wxBitmap;
22 friend class WXDLLEXPORT wxCursor;
23public:
24 wxCursorRefData();
d3c7fc99 25 virtual ~wxCursorRefData();
a24aff65
DE
26
27protected:
a4d592ff 28 int m_width, m_height;
5558135c 29 WX_NSCursor m_hCursor;
a24aff65
DE
30};
31
32#define M_CURSORDATA ((wxCursorRefData *)m_refData)
33#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
34
35// Cursor
36class WXDLLEXPORT wxCursor: public wxBitmap
37{
38 DECLARE_DYNAMIC_CLASS(wxCursor)
39
40public:
41 wxCursor();
42
a24aff65
DE
43 wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
44 const char maskBits[] = NULL);
45
46 wxCursor(const wxString& name, long flags = 0,
47 int hotSpotX = 0, int hotSpotY = 0);
48
49 wxCursor(int cursor_type);
d3c7fc99 50 virtual ~wxCursor();
a24aff65 51
b7cacb43
VZ
52 virtual bool Ok() const { return IsOk(); }
53 virtual bool IsOk() const { return m_refData ; }
a24aff65 54
fbfb8bcc
VZ
55 inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
56 inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
1b88201f 57
5558135c 58 inline WX_NSCursor GetNSCursor() const
1b88201f 59 {
5558135c
RN
60 return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0);
61 }
a24aff65
DE
62
63};
64
65extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
66
1b88201f
WS
67#endif
68 // _WX_COCOA_CURSOR_H_