]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/cursor.h
added definition of TARGET_CARBON when compiling with non generated setup.h
[wxWidgets.git] / include / wx / msw / cursor.h
... / ...
CommitLineData
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
21class WXDLLEXPORT wxImage;
22
23class WXDLLEXPORT wxCursorRefData : public wxGDIImageRefData
24{
25public:
26 wxCursorRefData();
27 virtual ~wxCursorRefData() { Free(); }
28
29 virtual void Free();
30
31 // for compatibility
32public:
33 bool m_destroyCursor;
34};
35
36// Cursor
37class WXDLLEXPORT wxCursor : public wxGDIImage
38{
39public:
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
61protected:
62 virtual wxGDIImageRefData *CreateData() const { return new wxCursorRefData; }
63
64private:
65 DECLARE_DYNAMIC_CLASS(wxCursor)
66};
67
68#endif
69 // _WX_CURSOR_H_