moved wxIcon implementation for ports where it's identical to wxBitmap to generic/icon.{cpp,h} so that the same code is not duplicated several times

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2006-08-09 17:59:30 +00:00
parent bc023abbbb
commit 71451a6d16
11 changed files with 194 additions and 484 deletions

View File

@@ -1,16 +1,16 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose: wxIcon class
// Name: wx/generic/icon.h
// Purpose: wxIcon implementation for ports where it's same as wxBitmap
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ICON_H_
#define _WX_ICON_H_
#ifndef _WX_GENERIC_ICON_H_
#define _WX_GENERIC_ICON_H_
#include "wx/bitmap.h"
@@ -18,38 +18,44 @@
// wxIcon
//-----------------------------------------------------------------------------
#ifndef wxICON_DEFAULT_BITMAP_TYPE
#define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_XPM
#endif
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{
public:
wxIcon();
wxIcon( const char **bits, int width=-1, int height=-1 );
wxIcon( char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to
// distinguish between multiple icons in a resource.
wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM,
wxIcon( const wxString& filename,
wxBitmapType type = wxICON_DEFAULT_BITMAP_TYPE,
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
wxBitmap(filename, type)
{
}
wxIcon( char **bits, int width=-1, int height=-1 );
wxIcon(const wxIconLocation& loc)
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
{
}
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }
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);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif
// _WX_ICON_H_
#endif // _WX_GENERIC_ICON_H_

View File

@@ -1,60 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKICONH__
#define __GTKICONH__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon;
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{
public:
wxIcon();
wxIcon( const char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to
// distinguish between multiple icons in a resource.
wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM,
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
wxBitmap(filename, type)
{
}
wxIcon( char **bits, int width=-1, int height=-1 );
wxIcon(const wxIconLocation& loc)
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
{
}
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);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif // __GTKICONH__

View File

@@ -1,60 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk1/icon.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKICONH__
#define __GTKICONH__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon;
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{
public:
wxIcon();
wxIcon( const char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to
// distinguish between multiple icons in a resource.
wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM,
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
wxBitmap(filename, type)
{
}
wxIcon( char **bits, int width=-1, int height=-1 );
wxIcon(const wxIconLocation& loc)
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
{
}
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);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif // __GTKICONH__

View File

@@ -21,13 +21,14 @@
#elif defined(__WXMOTIF__)
#include "wx/motif/icon.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/icon.h"
#include "wx/generic/icon.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/icon.h"
#include "wx/generic/icon.h"
#elif defined(__WXX11__)
#include "wx/x11/icon.h"
#include "wx/generic/icon.h"
#elif defined(__WXMGL__)
#include "wx/mgl/icon.h"
#define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_ICO_RESOURCE
#include "wx/generic/icon.h"
#elif defined(__WXMAC__)
#include "wx/mac/icon.h"
#elif defined(__WXCOCOA__)

View File

@@ -1,58 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_ICON_H__
#define __WX_ICON_H__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxIcon;
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxIcon: public wxBitmap
{
public:
wxIcon() : wxBitmap() {}
wxIcon(const char **bits, int width=-1, int height=-1);
wxIcon(char **bits, int width=-1, int height=-1);
// For compatibility with wxMSW where desired size is sometimes required to
// distinguish between multiple icons in a resource.
wxIcon(const wxString& filename, int type = wxBITMAP_TYPE_ICO_RESOURCE,
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
wxBitmap(filename, (wxBitmapType)type) {}
wxIcon(const wxIconLocation& loc)
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
{
}
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);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif // __WX_ICON_H__