+wxIconBundle
+wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
+ const wxArtClient& WXUNUSED(client))
+{
+ const wxString stockid = wxArtIDToStock(id);
+
+ // try to load the bundle as stock icon first
+ GtkStyle* style = gtk_widget_get_style(wxGTKPrivate::GetButtonWidget());
+ GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid.utf8_str());
+ if ( iconset )
+ {
+ GtkIconSize *sizes;
+ gint n_sizes;
+ gtk_icon_set_get_sizes(iconset, &sizes, &n_sizes);
+ wxIconBundle bundle = DoCreateIconBundle
+ (
+ stockid.utf8_str(),
+ sizes, sizes + n_sizes,
+ &CreateStockIcon
+ );
+ g_free(sizes);
+ return bundle;
+ }
+
+ // otherwise try icon themes
+#ifdef __WXGTK26__
+ if ( !gtk_check_version(2,6,0) )
+ {
+ gint *sizes = gtk_icon_theme_get_icon_sizes
+ (
+ gtk_icon_theme_get_default(),
+ stockid.utf8_str()
+ );
+ if ( !sizes )
+ return wxNullIconBundle;
+
+ gint *last = sizes;
+ while ( *last )
+ last++;
+
+ wxIconBundle bundle = DoCreateIconBundle
+ (
+ stockid.utf8_str(),
+ sizes, last,
+ &CreateThemeIcon
+ );
+ g_free(sizes);
+ return bundle;
+ }
+#endif // __WXGTK26__
+
+ return wxNullIconBundle;
+}
+
+// ----------------------------------------------------------------------------
+// wxArtProvider::GetNativeSizeHint()
+// ----------------------------------------------------------------------------
+
+/*static*/
+wxSize wxArtProvider::GetNativeSizeHint(const wxArtClient& client)
+{
+ // Gtk has specific sizes for each client, see artgtk.cpp
+ GtkIconSize gtk_size = ArtClientToIconSize(client);
+ // no size hints for this client
+ if (gtk_size == GTK_ICON_SIZE_INVALID)
+ return wxDefaultSize;
+ gint width, height;
+ gtk_icon_size_lookup( gtk_size, &width, &height);
+ return wxSize(width, height);
+}