namespace
{
-const wxScopedCharBuffer wxArtIDToStock(const wxArtID& id)
+wxString wxArtIDToStock(const wxArtID& id)
{
#define ART(wxid, gtkid) \
- if (id == wxid) return wxScopedCharBuffer::CreateNonOwned(gtkid);
+ if (id == wxid) return gtkid;
ART(wxART_ERROR, GTK_STOCK_DIALOG_ERROR)
ART(wxART_INFORMATION, GTK_STOCK_DIALOG_INFO)
ART(wxART_UNDO, GTK_STOCK_UNDO)
ART(wxART_REDO, GTK_STOCK_REDO)
+ ART(wxART_CLOSE, GTK_STOCK_CLOSE)
ART(wxART_QUIT, GTK_STOCK_QUIT)
ART(wxART_FIND, GTK_STOCK_FIND)
// allow passing GTK+ stock IDs to wxArtProvider -- if a recognized wx
// ID wasn't found, pass it to GTK+ in the hope it is a GTK+ or theme
// icon name:
- return id.mb_str();
+ return id;
}
GtkIconSize ArtClientToIconSize(const wxArtClient& client)
const wxArtClient& client,
const wxSize& size)
{
- const wxScopedCharBuffer stockid = wxArtIDToStock(id);
+ const wxString stockid = wxArtIDToStock(id);
GtkIconSize stocksize = (size == wxDefaultSize) ?
ArtClientToIconSize(client) :
if (stocksize == GTK_ICON_SIZE_INVALID)
stocksize = GTK_ICON_SIZE_BUTTON;
- GdkPixbuf *pixbuf = CreateGtkIcon(stockid, stocksize, size);
+ GdkPixbuf *pixbuf = CreateGtkIcon(stockid.utf8_str(), stocksize, size);
if (pixbuf && size != wxDefaultSize &&
(size.x != gdk_pixbuf_get_width(pixbuf) ||
wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
const wxArtClient& WXUNUSED(client))
{
- const wxScopedCharBuffer stockid = wxArtIDToStock(id);
+ const wxString stockid = wxArtIDToStock(id);
// try to load the bundle as stock icon first
GtkStyle* style = wxGTKPrivate::GetButtonWidget()->style;
- GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid);
+ GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid.utf8_str());
if ( iconset )
{
GtkIconSize *sizes;
gtk_icon_set_get_sizes(iconset, &sizes, &n_sizes);
wxIconBundle bundle = DoCreateIconBundle
(
- stockid,
+ stockid.utf8_str(),
sizes, sizes + n_sizes,
&CreateStockIcon
);
gint *sizes = gtk_icon_theme_get_icon_sizes
(
gtk_icon_theme_get_default(),
- stockid
+ stockid.utf8_str()
);
if ( !sizes )
return wxNullIconBundle;
wxIconBundle bundle = DoCreateIconBundle
(
- stockid,
+ stockid.utf8_str(),
sizes, last,
&CreateThemeIcon
);