X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64c288fa47480385ad656ae3249b5b131340c1d6..6a623422ecbead1a2f19a486f14ab174cf7b44f0:/src/common/artprov.cpp?ds=sidebyside diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index 2e8a1df31c..7661612429 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: artprov.cpp +// Name: src/common/artprov.cpp // Purpose: wxArtProvider class // Author: Vaclav Slavik // Modified by: @@ -20,16 +20,14 @@ #pragma hdrstop #endif +#include "wx/artprov.h" + #ifndef WX_PRECOMP - #include "wx/log.h" #include "wx/list.h" -#endif - -#include "wx/artprov.h" -#include "wx/hashmap.h" -#include "wx/module.h" -#if wxUSE_IMAGE -#include "wx/image.h" + #include "wx/log.h" + #include "wx/hashmap.h" + #include "wx/image.h" + #include "wx/module.h" #endif // =========================================================================== @@ -101,7 +99,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxArtProvider, wxObject) wxArtProvidersList *wxArtProvider::sm_providers = NULL; wxArtProviderCache *wxArtProvider::sm_cache = NULL; -/*static*/ void wxArtProvider::PushProvider(wxArtProvider *provider) +/*static*/ void wxArtProvider::CommonAddingProvider() { if ( !sm_providers ) { @@ -109,10 +107,21 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL; sm_cache = new wxArtProviderCache; } - sm_providers->Insert(provider); sm_cache->Clear(); } +/*static*/ void wxArtProvider::PushProvider(wxArtProvider *provider) +{ + CommonAddingProvider(); + sm_providers->Insert(provider); +} + +/*static*/ void wxArtProvider::InsertProvider(wxArtProvider *provider) +{ + CommonAddingProvider(); + sm_providers->Append(provider); +} + /*static*/ bool wxArtProvider::PopProvider() { wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") ); @@ -240,7 +249,7 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL; else if (client == wxART_BUTTON) return wxSize(16, 15); else // wxART_OTHER or perhaps a user's client, no specified size - return wxDefaultSize; + return wxDefaultSize; #endif // GTK+ 2/else }