]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/cursor.h
Automatically adjust toolbar's tool size if the provided bitmaps
[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
53a2db12 17class WXDLLIMPEXP_CORE wxCursorRefData : public wxGDIRefData
a24aff65 18{
a24aff65
DE
19public:
20 wxCursorRefData();
d3c7fc99 21 virtual ~wxCursorRefData();
a24aff65
DE
22
23protected:
a4d592ff 24 int m_width, m_height;
5558135c 25 WX_NSCursor m_hCursor;
8f884a0d
VZ
26
27 friend class WXDLLIMPEXP_FWD_CORE wxBitmap;
28 friend class WXDLLIMPEXP_FWD_CORE wxCursor;
29
30 DECLARE_NO_COPY_CLASS(wxCursorRefData)
a24aff65
DE
31};
32
33#define M_CURSORDATA ((wxCursorRefData *)m_refData)
34#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
35
36// Cursor
53a2db12 37class WXDLLIMPEXP_CORE wxCursor: public wxBitmap
a24aff65 38{
a24aff65 39public:
8f884a0d 40 wxCursor();
a24aff65 41
0ef5b1da 42 wxCursor(const wxString& name, wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
8f884a0d 43 int hotSpotX = 0, int hotSpotY = 0);
a24aff65 44
0ef5b1da
FM
45 wxCursor(wxStockCursor id) { InitFromStock(id); }
46#if WXWIN_COMPATIBILITY_2_8
47 wxCursor(int id) { InitFromStock((wxStockCursor)id); }
48#endif
8f884a0d 49 virtual ~wxCursor();
a24aff65 50
8f884a0d
VZ
51 // FIXME: operator==() is wrong!
52 bool operator==(const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
53 bool operator!=(const wxCursor& cursor) const { return !(*this == cursor); }
1b88201f 54
8f884a0d 55 WX_NSCursor GetNSCursor() const { return M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0; }
a24aff65 56
0ef5b1da
FM
57private:
58 void InitFromStock(wxStockCursor);
8f884a0d 59 DECLARE_DYNAMIC_CLASS(wxCursor)
a24aff65
DE
60};
61
53a2db12 62extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor);
a24aff65 63
1b88201f
WS
64#endif
65 // _WX_COCOA_CURSOR_H_