]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/icon.h
Removed Vadim's surplus code in clipboard.
[wxWidgets.git] / include / wx / mac / icon.h
CommitLineData
0dbd6262
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: icon.h
3// Purpose: wxIcon class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_ICON_H_
13#define _WX_ICON_H_
14
15#ifdef __GNUG__
16#pragma interface "icon.h"
17#endif
18
19#include "wx/bitmap.h"
20
21class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
22{
23 friend class WXDLLEXPORT wxBitmap;
24 friend class WXDLLEXPORT wxIcon;
25public:
26 wxIconRefData();
27 ~wxIconRefData();
28
29public:
0dbd6262 30 WXHICON m_hIcon;
0dbd6262
SC
31};
32
33#define M_ICONDATA ((wxIconRefData *)m_refData)
34#define M_ICONHANDLERDATA ((wxIconRefData *)bitmap->GetRefData())
35
36// Icon
37class WXDLLEXPORT wxIcon: public wxBitmap
38{
39 DECLARE_DYNAMIC_CLASS(wxIcon)
40
41public:
42 wxIcon();
43
44 // Copy constructors
45 inline wxIcon(const wxIcon& icon) { Ref(icon); }
46
47 wxIcon(const char bits[], int width, int height);
519cb848 48 wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICON_RESOURCE,
0dbd6262
SC
49 int desiredWidth = -1, int desiredHeight = -1);
50 ~wxIcon();
51
519cb848
SC
52 bool LoadFile(const wxString& name, long flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
53 int desiredWidth /* = -1 */ , int desiredHeight = -1);
54 bool LoadFile(const wxString& name ,long flags = wxBITMAP_TYPE_ICON_RESOURCE )
55 { return LoadFile( name , flags , -1 , -1 ) ; }
0dbd6262
SC
56
57 inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
58 inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
59 inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
60
0dbd6262
SC
61 void SetHICON(WXHICON ico);
62 inline WXHICON GetHICON() const { return (M_ICONDATA ? M_ICONDATA->m_hIcon : 0); }
0dbd6262 63
0dbd6262
SC
64 virtual bool Ok() const { return (m_refData != NULL) ; }
65};
66
519cb848
SC
67/*
68class WXDLLEXPORT wxICONFileHandler: public wxBitmapHandler
0dbd6262 69{
519cb848 70 DECLARE_DYNAMIC_CLASS(wxICONFileHandler)
0dbd6262 71public:
519cb848 72 inline wxICONFileHandler()
0dbd6262
SC
73 {
74 m_name = "ICO icon file";
75 m_extension = "ico";
76 m_type = wxBITMAP_TYPE_ICO;
77 };
78
79 virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
80 int desiredWidth = -1, int desiredHeight = -1);
81};
519cb848 82*/
0dbd6262 83
519cb848 84class WXDLLEXPORT wxICONResourceHandler: public wxBitmapHandler
0dbd6262 85{
519cb848 86 DECLARE_DYNAMIC_CLASS(wxICONResourceHandler)
0dbd6262 87public:
519cb848 88 inline wxICONResourceHandler()
0dbd6262 89 {
519cb848
SC
90 m_name = "ICON resource";
91 m_extension = "";
92 m_type = wxBITMAP_TYPE_ICON_RESOURCE;
0dbd6262
SC
93 };
94
95 virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
96 int desiredWidth = -1, int desiredHeight = -1);
97
98};
99
0dbd6262
SC
100#endif
101 // _WX_ICON_H_