+/*static*/
+wxIconBundle wxArtProvider::GetIconBundle(const wxArtID& id, const wxArtClient& client)
+{
+ wxIconBundle iconbundle(DoGetIconBundle(id, client));
+
+ if ( iconbundle.IsOk() )
+ {
+ return iconbundle;
+ }
+ else
+ {
+ // fall back to single-icon bundle
+ return wxIconBundle(GetIcon(id, client));
+ }
+}
+
+/*static*/
+wxIconBundle wxArtProvider::DoGetIconBundle(const wxArtID& id, const wxArtClient& client)
+{
+ // safety-check against writing client,id,size instead of id,client,size:
+ wxASSERT_MSG( client.Last() == wxT('C'), wxT("invalid 'client' parameter") );
+
+ wxCHECK_MSG( sm_providers, wxNullIconBundle, wxT("no wxArtProvider exists") );
+
+ wxString hashId = wxArtProviderCache::ConstructHashID(id, client);
+
+ wxIconBundle iconbundle;
+ if ( !sm_cache->GetIconBundle(hashId, &iconbundle) )
+ {
+ for (wxArtProvidersList::compatibility_iterator node = sm_providers->GetFirst();
+ node; node = node->GetNext())
+ {
+ iconbundle = node->GetData()->CreateIconBundle(id, client);
+ if ( iconbundle.IsOk() )
+ break;
+ }
+
+ sm_cache->PutIconBundle(hashId, iconbundle);
+ }
+
+ return iconbundle;
+}
+