+// return the global and unique wxRendererPtr
+/*static*/ wxRendererPtr& wxRendererPtr::Get()
+{
+ static wxRendererPtr s_renderer;
+
+ return s_renderer;
+}
+
+#if wxUSE_DYNLIB_CLASS
+
+// ----------------------------------------------------------------------------
+// wxRendererFromDynLib: represents a renderer dynamically loaded from a DLL
+// ----------------------------------------------------------------------------
+
+class wxRendererFromDynLib : public wxDelegateRendererNative
+{
+public:
+ // create the object wrapping the given renderer created from this DLL
+ //
+ // we take ownership of the pointer and will delete it (and also unload the
+ // DLL) when we're deleted
+ wxRendererFromDynLib(wxDynamicLibrary& dll, wxRendererNative *renderer)
+ : wxDelegateRendererNative(*renderer),
+ m_renderer(renderer),
+ m_dllHandle(dll.Detach())
+ {
+ }
+
+ virtual ~wxRendererFromDynLib()
+ {
+ delete m_renderer;
+ wxDynamicLibrary::Unload(m_dllHandle);
+ }
+
+private:
+ wxRendererNative *m_renderer;
+ wxDllType m_dllHandle;
+};
+
+#endif // wxUSE_DYNLIB_CLASS
+