}
// Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
{
// TODO
}
else return FALSE;
}
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
static int wxBusyCursorCount = 0;
// Return TRUE if we have a colour display
bool wxColourDisplay()
{
- // TODO
- return TRUE;
+ Display *dpy = (Display*) wxGetDisplay();
+
+ if (DefaultDepth (dpy, DefaultScreen (dpy)) < 2)
+ return FALSE;
+ else
+ return TRUE;
}
// Returns depth of screen
int wxDisplayDepth()
{
- // TODO
- return 0;
+ Display *dpy = (Display*) wxGetDisplay();
+ return DefaultDepth (dpy, DefaultScreen (dpy));
}
// Get size of display
void wxDisplaySize(int *width, int *height)
{
- // TODO
+ Display *dpy = (Display*) wxGetDisplay();
+
+ *width = DisplayWidth (dpy, DefaultScreen (dpy));
+ *height = DisplayHeight (dpy, DefaultScreen (dpy));
}
/* Configurable display in Motif */
if (gs_currentDisplay)
return gs_currentDisplay;
- return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
+ if (wxTheApp && wxTheApp->GetTopLevelWidget())
+ return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
+ else if (wxTheApp)
+ return wxTheApp->GetInitialDisplay();
+ else
+ return (WXDisplay*) NULL;
}
bool wxSetDisplay(const wxString& display_name)