class WXDLLIMPEXP_BASE wxConfigBase;
#endif // wxUSE_CONFIG
-class WXDLLIMPEXP_BASE wxFontMapper;
+class WXDLLIMPEXP_CORE wxFontMapper;
#if wxUSE_GUI
class WXDLLIMPEXP_CORE wxWindow;
virtual ~wxFontMapperBase();
// return instance of the wxFontMapper singleton
+#if wxUSE_GUI
+ // GUI code needs to know it's a wxFontMapper because there
+ // are additional methods in the subclass.
static wxFontMapper *Get();
+#else
+ // wxBase code only cares that it's a wxFontMapperBase
+ static wxFontMapperBase *Get();
+#endif
// set the singleton to 'mapper' instance and return previous one
static wxFontMapper *Set(wxFontMapper *mapper);
DECLARE_NO_COPY_CLASS(wxFontMapper)
};
-#else // !wxUSE_GUI
-
-class WXDLLIMPEXP_BASE wxFontMapper : public wxFontMapperBase
-{
-};
-
-#endif // wxUSE_GUI/!wxUSE_GUI
+#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// global variables
public:
wxFontMapperModule() : wxModule() { }
virtual bool OnInit() { return true; }
- virtual void OnExit() { delete wxFontMapper::Set(NULL); }
+ virtual void OnExit() { delete wxFontMapperBase::Set(NULL); }
DECLARE_DYNAMIC_CLASS(wxFontMapperModule)
};
}
/* static */
-wxFontMapper *wxFontMapperBase::Get()
+// Declared as returning wxFontMapper when wxUSE_GUI=1. Unfortunately, it's
+// only implemented in wxBase library. Note that if the last resort
+// is taken and GUI code tries to treat it as a real wxFontMapper
+// then you'd be in trouble.
+wxFontMapperBase *wxFontMapperBase::Get()
{
if ( !sm_instance )
{
}
}
- return sm_instance;
+ return (wxFontMapperBase*)sm_instance;
}
/* static */