1. changed wxIconBundle to use m_refData and COW to make copying icon bundles

fast (which was needed for 2)
2. make it possible to return wxIconBundles from wxArtProvider
3. implement Mac-specific wxArtProvider doing (2)

(modified patch 1581960)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-07 19:59:51 +00:00
parent 0597e7f977
commit 527343602e
21 changed files with 629 additions and 160 deletions

View File

@@ -1175,7 +1175,13 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title )
void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
{
SetIcons( wxIconBundle( icon ) );
// passing wxNullIcon to SetIcon() is possible (it means that we shouldn't
// have any icon), but adding an invalid icon to wxIconBundle is not
wxIconBundle icons;
if ( icon.Ok() )
icons.AddIcon(icon);
SetIcons(icons);
}
void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
@@ -1185,15 +1191,13 @@ void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
wxTopLevelWindowBase::SetIcons( icons );
GList *list = NULL;
size_t max = icons.m_icons.GetCount();
for (size_t i = 0; i < max; i++)
const size_t numIcons = icons.GetIconCount();
for ( size_t i = 0; i < numIcons; i++ )
{
if (icons.m_icons[i].Ok())
{
list = g_list_prepend(list, icons.m_icons[i].GetPixbuf());
}
list = g_list_prepend(list, icons.GetIconByIndex(i).GetPixbuf());
}
gtk_window_set_icon_list(GTK_WINDOW(m_widget), list);
g_list_free(list);
}