From: Włodzimierz Skiba Date: Tue, 30 Aug 2005 17:25:58 +0000 (+0000) Subject: Missing wxGetOsDescription() for wxMGL in response to undefined reference in wxLogs. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/99f0cdf2e9f61b3095356d3eea75082797ddae69 Missing wxGetOsDescription() for wxMGL in response to undefined reference in wxLogs. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mgl/utils.cpp b/src/mgl/utils.cpp index 981be51871..563089b2f5 100644 --- a/src/mgl/utils.cpp +++ b/src/mgl/utils.cpp @@ -60,11 +60,11 @@ void wxDisplaySizeMM(int *width, int *height) wxASSERT_MSG( g_displayDC, wxT("You must call wxApp::SetDisplayMode before using this function") ); int xDPI, yDPI; - MGL_getDotsPerInch(&xDPI, &yDPI); - - if ( width ) + MGL_getDotsPerInch(&xDPI, &yDPI); + + if ( width ) *width = (int)((g_displayDC->sizex()+1) * 25.4 / xDPI); - if ( height ) + if ( height ) *height = (int)((g_displayDC->sizey()+1) * 25.4 / yDPI); } @@ -79,7 +79,7 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height) bool wxColourDisplay() { wxASSERT_MSG( g_displayDC, wxT("You must call wxApp::SetDisplayMode before using this function") ); - + return (wxDisplayDepth() > 1); } @@ -90,6 +90,27 @@ int wxDisplayDepth() return g_displayDC->getBitsPerPixel(); } +wxString wxGetOsDescription() +{ + wxString osname( + +#if defined(__UNIX__) + _T("Unix") +#elif defined(__OS2__) + _T("OS/2") +#elif defined(__WIN32__) + _T("Windows") +#elif defined(__DOS__) + _T("DOS") +#else + _T("unknown") +#endif + + ); + + return osname; +} + #if wxUSE_GUI wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()