+#endif // wxUSE_DISPLAY
+
+// ----------------------------------------------------------------------------
+// globals
+// ----------------------------------------------------------------------------
+
+// the factory object used by wxDisplay
+//
+// created on demand and destroyed by wxDisplayModule
+static wxDisplayFactory *gs_factory = NULL;
+
+// ----------------------------------------------------------------------------
+// wxDisplayImplSingle: trivial implementation working for main display only
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl
+{
+public:
+ wxDisplayImplSingle() : wxDisplayImpl(0) { }
+
+ virtual wxRect GetGeometry() const
+ {
+ wxRect r;
+ wxDisplaySize(&r.width, &r.height);
+ return r;
+ }
+
+ virtual wxRect GetClientArea() const { return wxGetClientDisplayRect(); }
+
+ virtual wxString GetName() const { return wxString(); }
+
+#if wxUSE_DISPLAY
+ // no video modes support for us, provide just the stubs
+
+ virtual wxArrayVideoModes GetModes(const wxVideoMode& WXUNUSED(mode)) const
+ {
+ return wxArrayVideoModes();
+ }
+
+ virtual wxVideoMode GetCurrentMode() const { return wxVideoMode(); }
+
+ virtual bool ChangeMode(const wxVideoMode& WXUNUSED(mode)) { return false; }
+#endif // wxUSE_DISPLAY
+
+
+ DECLARE_NO_COPY_CLASS(wxDisplayImplSingle)
+};
+
+// ----------------------------------------------------------------------------
+// wxDisplayModule is used to cleanup gs_factory
+// ----------------------------------------------------------------------------
+
+class wxDisplayModule : public wxModule
+{
+public:
+ virtual bool OnInit() { return true; }
+ virtual void OnExit()
+ {
+ if ( gs_factory )
+ {
+ delete gs_factory;
+ gs_factory = NULL;
+ }
+ }
+
+ DECLARE_DYNAMIC_CLASS(wxDisplayModule)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxDisplayModule, wxModule)
+