+/* static */
+wxRendererNative *wxRendererNative::Set(wxRendererNative *rendererNew)
+{
+ wxRendererPtr& renderer = wxRendererPtr::Get();
+
+ wxRendererNative *rendererOld = renderer.release();
+
+ renderer.reset(rendererNew);
+
+ return rendererOld;
+}
+
+
+// ----------------------------------------------------------------------------
+// Dynamic renderers loading
+// ----------------------------------------------------------------------------
+
+#if wxUSE_DYNLIB_CLASS
+
+/* static */
+wxRendererNative *wxRendererNative::Load(const wxString& name)
+{
+ wxString fullname = wxDynamicLibrary::CanonicalizePluginName(name);
+
+ wxDynamicLibrary dll(fullname);
+ if ( !dll.IsLoaded() )
+ return NULL;
+
+ // each theme DLL must export a wxCreateRenderer() function with this
+ // signature
+ typedef wxRendererNative *(*wxCreateRenderer_t)();
+
+ wxDYNLIB_FUNCTION(wxCreateRenderer_t, wxCreateRenderer, dll);
+ if ( !pfnwxCreateRenderer )
+ return NULL;
+
+ wxRendererNative *renderer = (*pfnwxCreateRenderer)();
+ if ( !renderer )
+ return NULL;
+
+ return new wxRendererFromDynLib(dll, renderer);
+}
+
+#endif // wxUSE_DYNLIB_CLASS
+