/////////////////////////////////////////////////////////////////////////////
// Name:        guiutils.cpp
// Purpose:     GUI utilities common to libpkggui and libpmgui
// Author:      Francesco Montorsi
// Modified by:
// Created:     14/01/2007 21:21:22
// RCS-ID:      $Id: guiutils.cpp,v 1.1 2007/01/14 11:04:15 frm Exp $
// Copyright:   (c) 2007 Francesco Montorsi
// Licence:     wxWidgets license
/////////////////////////////////////////////////////////////////////////////


// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "guicmn/guiutils.h"


// ----------------------------------------------------------------------------
// utils
// ----------------------------------------------------------------------------

wxBitmap wxGetBitmapFromXPM_or_GTK2Stock(const char * const *xpm, const char *gtk2stock)
{
#ifdef __WXGTK20__
    return wxArtProvider::GetBitmap(wxString(gtk2stock, wxConvUTF8));
#else
    return wxBitmap(xpm);
#endif
}

wxBitmap wxGetBitmapFromArtProvider_or_GTK2Stock(const wxArtID &artid, const char *gtk2stock)
{
#ifdef __WXGTK20__
    return wxArtProvider::GetBitmap(wxString(gtk2stock, wxConvUTF8));
#else
    return wxArtProvider::GetBitmap(artid);
#endif
}

wxImage wxGetImageFromXPM_or_GTK2Stock(const char * const *xpm, const char *gtk2stock)
{
    return wxGetBitmapFromXPM_or_GTK2Stock(xpm, gtk2stock).ConvertToImage();
}

wxImage wxGetImageFromArtProvider_or_GTK2Stock(const wxArtID &artid, const char *gtk2stock)
{
    return wxGetBitmapFromArtProvider_or_GTK2Stock(artid, gtk2stock).ConvertToImage();
}

