fix ANSI build compilation (closes #10846)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60822 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-05-30 17:02:46 +00:00
parent d90ce88c33
commit 2b25a82ebc

View File

@@ -57,10 +57,10 @@ protected:
namespace namespace
{ {
const wxScopedCharBuffer wxArtIDToStock(const wxArtID& id) wxString wxArtIDToStock(const wxArtID& id)
{ {
#define ART(wxid, gtkid) \ #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_ERROR, GTK_STOCK_DIALOG_ERROR)
ART(wxART_INFORMATION, GTK_STOCK_DIALOG_INFO) ART(wxART_INFORMATION, GTK_STOCK_DIALOG_INFO)
@@ -123,7 +123,7 @@ const wxScopedCharBuffer wxArtIDToStock(const wxArtID& id)
// allow passing GTK+ stock IDs to wxArtProvider -- if a recognized wx // 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 // ID wasn't found, pass it to GTK+ in the hope it is a GTK+ or theme
// icon name: // icon name:
return id.mb_str(); return id;
} }
GtkIconSize ArtClientToIconSize(const wxArtClient& client) GtkIconSize ArtClientToIconSize(const wxArtClient& client)
@@ -266,7 +266,7 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
const wxArtClient& client, const wxArtClient& client,
const wxSize& size) const wxSize& size)
{ {
const wxScopedCharBuffer stockid = wxArtIDToStock(id); const wxString stockid = wxArtIDToStock(id);
GtkIconSize stocksize = (size == wxDefaultSize) ? GtkIconSize stocksize = (size == wxDefaultSize) ?
ArtClientToIconSize(client) : ArtClientToIconSize(client) :
@@ -275,7 +275,7 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
if (stocksize == GTK_ICON_SIZE_INVALID) if (stocksize == GTK_ICON_SIZE_INVALID)
stocksize = GTK_ICON_SIZE_BUTTON; stocksize = GTK_ICON_SIZE_BUTTON;
GdkPixbuf *pixbuf = CreateGtkIcon(stockid, stocksize, size); GdkPixbuf *pixbuf = CreateGtkIcon(stockid.utf8_str(), stocksize, size);
if (pixbuf && size != wxDefaultSize && if (pixbuf && size != wxDefaultSize &&
(size.x != gdk_pixbuf_get_width(pixbuf) || (size.x != gdk_pixbuf_get_width(pixbuf) ||
@@ -301,11 +301,11 @@ wxIconBundle
wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id, wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
const wxArtClient& WXUNUSED(client)) const wxArtClient& WXUNUSED(client))
{ {
const wxScopedCharBuffer stockid = wxArtIDToStock(id); const wxString stockid = wxArtIDToStock(id);
// try to load the bundle as stock icon first // try to load the bundle as stock icon first
GtkStyle* style = wxGTKPrivate::GetButtonWidget()->style; 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 ) if ( iconset )
{ {
GtkIconSize *sizes; GtkIconSize *sizes;
@@ -313,7 +313,7 @@ wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
gtk_icon_set_get_sizes(iconset, &sizes, &n_sizes); gtk_icon_set_get_sizes(iconset, &sizes, &n_sizes);
wxIconBundle bundle = DoCreateIconBundle wxIconBundle bundle = DoCreateIconBundle
( (
stockid, stockid.utf8_str(),
sizes, sizes + n_sizes, sizes, sizes + n_sizes,
&CreateStockIcon &CreateStockIcon
); );
@@ -328,7 +328,7 @@ wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
gint *sizes = gtk_icon_theme_get_icon_sizes gint *sizes = gtk_icon_theme_get_icon_sizes
( (
gtk_icon_theme_get_default(), gtk_icon_theme_get_default(),
stockid stockid.utf8_str()
); );
if ( !sizes ) if ( !sizes )
return wxNullIconBundle; return wxNullIconBundle;
@@ -339,7 +339,7 @@ wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
wxIconBundle bundle = DoCreateIconBundle wxIconBundle bundle = DoCreateIconBundle
( (
stockid, stockid.utf8_str(),
sizes, last, sizes, last,
&CreateThemeIcon &CreateThemeIcon
); );