X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/feaa5f91e568cd4603ef5e0dc7a4b5a3584b7a04..6f26925422c2de7938509657eb981d6f752a6249:/src/common/iconbndl.cpp diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index 8fa0ccd441..e87312bc5e 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -57,19 +57,22 @@ wxIconBundle::wxIconBundle() { } +#if wxUSE_STREAMS && wxUSE_IMAGE + +#if wxUSE_FFILE || wxUSE_FILE wxIconBundle::wxIconBundle(const wxString& file, wxBitmapType type) : wxGDIObject() { AddIcon(file, type); } +#endif // wxUSE_FFILE || wxUSE_FILE -#if wxUSE_STREAMS wxIconBundle::wxIconBundle(wxInputStream& stream, wxBitmapType type) : wxGDIObject() { AddIcon(stream, type); } -#endif // wxUSE_STREAMS +#endif // wxUSE_STREAMS && wxUSE_IMAGE wxIconBundle::wxIconBundle(const wxIcon& icon) : wxGDIObject() @@ -92,6 +95,8 @@ void wxIconBundle::DeleteIcons() UnRef(); } +#if wxUSE_STREAMS && wxUSE_IMAGE + namespace { @@ -139,6 +144,8 @@ void DoAddIcon(wxIconBundle& bundle, } // anonymous namespace +#if wxUSE_FFILE || wxUSE_FILE + void wxIconBundle::AddIcon(const wxString& file, wxBitmapType type) { #ifdef __WXMAC__ @@ -154,7 +161,11 @@ void wxIconBundle::AddIcon(const wxString& file, wxBitmapType type) } #endif // __WXMAC__ +#if wxUSE_FFILE wxFFileInputStream stream(file); +#elif wxUSE_FILE + wxFileInputStream stream(file); +#endif DoAddIcon ( *this, @@ -163,12 +174,14 @@ void wxIconBundle::AddIcon(const wxString& file, wxBitmapType type) ); } -#if wxUSE_STREAMS +#endif // wxUSE_FFILE || wxUSE_FILE + void wxIconBundle::AddIcon(wxInputStream& stream, wxBitmapType type) { DoAddIcon(*this, stream, type, _("Failed to load image %d from stream.")); } -#endif // wxUSE_STREAMS + +#endif // wxUSE_STREAMS && wxUSE_IMAGE wxIcon wxIconBundle::GetIcon(const wxSize& size) const { @@ -233,7 +246,7 @@ wxIcon wxIconBundle::GetIconOfExactSize(const wxSize& size) const void wxIconBundle::AddIcon(const wxIcon& icon) { - wxCHECK_RET( icon.IsOk(), _T("invalid icon") ); + wxCHECK_RET( icon.IsOk(), wxT("invalid icon") ); AllocExclusive(); @@ -264,7 +277,7 @@ size_t wxIconBundle::GetIconCount() const wxIcon wxIconBundle::GetIconByIndex(size_t n) const { - wxCHECK_MSG( n < GetIconCount(), wxNullIcon, _T("invalid index") ); + wxCHECK_MSG( n < GetIconCount(), wxNullIcon, wxT("invalid index") ); return M_ICONBUNDLEDATA->m_icons[n]; }