]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/icon.h
factored out key handling for better integrating with carbon
[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
0dbd6262
SC
21// Icon
22class WXDLLEXPORT wxIcon: public wxBitmap
23{
24 DECLARE_DYNAMIC_CLASS(wxIcon)
25
26public:
27 wxIcon();
28
29 // Copy constructors
7ee31b00
GD
30 wxIcon(const wxIcon& icon)
31 : wxBitmap()
32 { Ref(icon); }
0dbd6262 33
d062e17f
GD
34 wxIcon(const char **data);
35 wxIcon(char **data);
b729ceb2 36 wxIcon(const char bits[], int width , int height );
5273bf2f 37 wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
0dbd6262
SC
38 int desiredWidth = -1, int desiredHeight = -1);
39 ~wxIcon();
40
5273bf2f 41 bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
519cb848 42 int desiredWidth /* = -1 */ , int desiredHeight = -1);
5273bf2f 43 bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
519cb848 44 { return LoadFile( name , flags , -1 , -1 ) ; }
0dbd6262
SC
45
46 inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
47 inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
48 inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
d062e17f
GD
49
50 // create from bitmap (which should have a mask unless it's monochrome):
51 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
52 // ctors, assignment operators...), but it's ok to have such function
53 void CopyFromBitmap(const wxBitmap& bmp);
0dbd6262
SC
54};
55
519cb848
SC
56/*
57class WXDLLEXPORT wxICONFileHandler: public wxBitmapHandler
0dbd6262 58{
519cb848 59 DECLARE_DYNAMIC_CLASS(wxICONFileHandler)
0dbd6262 60public:
519cb848 61 inline wxICONFileHandler()
0dbd6262
SC
62 {
63 m_name = "ICO icon file";
64 m_extension = "ico";
65 m_type = wxBITMAP_TYPE_ICO;
66 };
67
68 virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
69 int desiredWidth = -1, int desiredHeight = -1);
70};
519cb848 71*/
0dbd6262 72
519cb848 73class WXDLLEXPORT wxICONResourceHandler: public wxBitmapHandler
0dbd6262 74{
519cb848 75 DECLARE_DYNAMIC_CLASS(wxICONResourceHandler)
0dbd6262 76public:
519cb848 77 inline wxICONResourceHandler()
0dbd6262 78 {
519cb848
SC
79 m_name = "ICON resource";
80 m_extension = "";
81 m_type = wxBITMAP_TYPE_ICON_RESOURCE;
0dbd6262
SC
82 };
83
84 virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
85 int desiredWidth = -1, int desiredHeight = -1);
86
87};
88
0dbd6262
SC
89#endif
90 // _WX_ICON_H_