2003-03-22 02:56:04 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2003-06-21 13:39:40 +00:00
|
|
|
// Name: wx/cocoa/icon.h
|
2003-03-22 02:56:04 +00:00
|
|
|
// Purpose: wxIcon class
|
2004-01-27 06:01:34 +00:00
|
|
|
// Author: David Elliott
|
2003-03-22 02:56:04 +00:00
|
|
|
// Modified by:
|
2004-01-27 06:01:34 +00:00
|
|
|
// Created: 2003/08/11
|
2003-03-22 02:56:04 +00:00
|
|
|
// RCS-ID: $Id$
|
2004-01-27 06:01:34 +00:00
|
|
|
// Copyright: (c) 2003 David Elliott
|
2006-10-17 14:44:52 +00:00
|
|
|
// Licence: wxWindows licence
|
2003-03-22 02:56:04 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-01-27 06:01:34 +00:00
|
|
|
#ifndef _WX_COCOA_ICON_H__
|
|
|
|
#define _WX_COCOA_ICON_H__
|
2003-03-22 02:56:04 +00:00
|
|
|
|
2004-01-27 06:01:34 +00:00
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/gdiobj.h"
|
2003-03-22 02:56:04 +00:00
|
|
|
|
2004-01-27 06:01:34 +00:00
|
|
|
// ========================================================================
|
|
|
|
// wxIcon
|
|
|
|
// ========================================================================
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxIcon : public wxGDIObject
|
2003-03-22 02:56:04 +00:00
|
|
|
{
|
|
|
|
public:
|
2004-01-27 06:01:34 +00:00
|
|
|
wxIcon();
|
|
|
|
|
2008-01-14 18:16:37 +00:00
|
|
|
wxIcon(const char* const* data) { CreateFromXpm(data); }
|
2004-01-27 06:01:34 +00:00
|
|
|
wxIcon(const char bits[], int width , int height );
|
2008-09-21 21:09:36 +00:00
|
|
|
wxIcon(const wxString& name, int flags = wxICON_DEFAULT_TYPE,
|
|
|
|
int desiredWidth = -1, int desiredHeight = -1);
|
2004-01-27 06:01:34 +00:00
|
|
|
wxIcon(const wxIconLocation& loc)
|
|
|
|
{
|
|
|
|
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
|
|
|
|
}
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxIcon();
|
2004-01-27 06:01:34 +00:00
|
|
|
|
2008-09-21 21:09:36 +00:00
|
|
|
bool LoadFile(const wxString& name, wxBitmapType flags = wxICON_DEFAULT_TYPE,
|
|
|
|
int desiredWidth=-1, int desiredHeight=-1);
|
2004-01-27 06:01:34 +00:00
|
|
|
|
|
|
|
bool operator==(const wxIcon& icon) const
|
|
|
|
{ return m_refData == icon.m_refData; }
|
|
|
|
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }
|
|
|
|
|
|
|
|
// create from bitmap (which should have a mask unless it's monochrome):
|
|
|
|
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
|
|
|
// ctors, assignment operators...), but it's ok to have such function
|
|
|
|
void CopyFromBitmap(const wxBitmap& bmp);
|
|
|
|
|
|
|
|
int GetWidth() const;
|
|
|
|
int GetHeight() const;
|
|
|
|
|
|
|
|
WX_NSImage GetNSImage() const;
|
2008-01-14 18:16:37 +00:00
|
|
|
bool CreateFromXpm(const char* const* bits);
|
2007-12-15 17:54:20 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
2003-03-22 02:56:04 +00:00
|
|
|
};
|
|
|
|
|
2007-12-15 17:54:20 +00:00
|
|
|
#endif // _WX_COCOA_ICON_H__
|