2003-03-21 21:56:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2003-06-21 09:39:40 -04:00
|
|
|
// Name: wx/cocoa/icon.h
|
2003-03-21 21:56:04 -05:00
|
|
|
// Purpose: wxIcon class
|
2004-01-27 01:01:34 -05:00
|
|
|
// Author: David Elliott
|
2003-03-21 21:56:04 -05:00
|
|
|
// Modified by:
|
2004-01-27 01:01:34 -05:00
|
|
|
// Created: 2003/08/11
|
2003-03-21 21:56:04 -05:00
|
|
|
// RCS-ID: $Id$
|
2004-01-27 01:01:34 -05:00
|
|
|
// Copyright: (c) 2003 David Elliott
|
2006-10-17 10:44:52 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-03-21 21:56:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-01-27 01:01:34 -05:00
|
|
|
#ifndef _WX_COCOA_ICON_H__
|
|
|
|
#define _WX_COCOA_ICON_H__
|
2003-03-21 21:56:04 -05:00
|
|
|
|
2004-01-27 01:01:34 -05:00
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/gdiobj.h"
|
2003-03-21 21:56:04 -05:00
|
|
|
|
2004-01-27 01:01:34 -05:00
|
|
|
// ========================================================================
|
|
|
|
// wxIcon
|
|
|
|
// ========================================================================
|
|
|
|
class WXDLLEXPORT wxIcon: public wxGDIObject
|
2003-03-21 21:56:04 -05:00
|
|
|
{
|
2004-01-27 01:01:34 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
2003-03-21 21:56:04 -05:00
|
|
|
public:
|
2004-01-27 01:01:34 -05:00
|
|
|
wxIcon();
|
|
|
|
|
|
|
|
wxIcon(const char **data) { CreateFromXpm(data); }
|
|
|
|
wxIcon(char **data) { CreateFromXpm((const char**)data); }
|
|
|
|
wxIcon(const char bits[], int width , int height );
|
|
|
|
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
|
|
|
int desiredWidth = -1, int desiredHeight = -1);
|
|
|
|
wxIcon(const wxIconLocation& loc)
|
|
|
|
{
|
|
|
|
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
|
|
|
|
}
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxIcon();
|
2004-01-27 01:01:34 -05:00
|
|
|
|
|
|
|
bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
|
|
|
|
int desiredWidth /* = -1 */ , int desiredHeight = -1);
|
|
|
|
bool LoadFile(const wxString& name, wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
|
|
|
|
{ return LoadFile( name , flags , -1 , -1 ) ; }
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
bool Ok() const { return IsOk(); }
|
|
|
|
bool IsOk() const;
|
2004-01-27 01:01:34 -05:00
|
|
|
int GetWidth() const;
|
|
|
|
int GetHeight() const;
|
|
|
|
|
|
|
|
WX_NSImage GetNSImage() const;
|
|
|
|
bool CreateFromXpm(const char **bits);
|
2003-03-21 21:56:04 -05:00
|
|
|
};
|
|
|
|
|
2006-10-17 10:44:52 -04:00
|
|
|
#endif
|
|
|
|
// _WX_COCOA_ICON_H__
|