X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8eaaeb23796c69ea0f67cbd48fc5f667d9823d0..f65d4b83d13187f8e1838abf48831d9f044efa67:/src/mac/carbon/utils.cpp diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 6e1bd0d1b4..780fee8956 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -54,6 +54,31 @@ #include #endif +// --------------------------------------------------------------------------- +// code used in both base and GUI compilation +// --------------------------------------------------------------------------- + +// our OS version is the same in non GUI and GUI cases +static int DoGetOSVersion(int *majorVsn, int *minorVsn) +{ + long theSystem ; + + // are there x-platform conventions ? + + Gestalt(gestaltSystemVersion, &theSystem) ; + if (minorVsn != NULL) { + *minorVsn = (theSystem & 0xFF ) ; + } + if (majorVsn != NULL) { + *majorVsn = (theSystem >> 8 ) ; + } +#ifdef __DARWIN__ + return wxMAC_DARWIN; +#else + return wxMAC; +#endif +} + #if wxUSE_BASE #ifndef __DARWIN__ @@ -197,50 +222,29 @@ void wxBell() SysBeep(30); } -// our OS version is the same in non GUI and GUI cases -static int DoGetOSVersion(int *majorVsn, int *minorVsn) -{ - long theSystem ; - - // are there x-platform conventions ? - - Gestalt(gestaltSystemVersion, &theSystem) ; - if (minorVsn != NULL) { - *minorVsn = (theSystem & 0xFF ) ; - } - if (majorVsn != NULL) { - *majorVsn = (theSystem >> 8 ) ; - } -#ifdef __DARWIN__ - return wxMAC_DARWIN; -#else - return wxMAC; -#endif -} - -wxToolkitInfo *wxConsoleAppTraits::GetToolkitInfo() +wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo() { static wxToolkitInfo info; - info.os = DoGetOSVersion(&info.majorVersion, &info.minorVersion); + info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor); info.name = _T("wxBase"); - return &info; + return info; } #endif // wxUSE_BASE #if wxUSE_GUI -wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo() +wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() { static wxToolkitInfo info; - info.os = DoGetOSVersion(&info.majorVersion, &info.minorVersion); + info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor); info.shortName = _T("mac"); info.name = _T("wxMac"); #ifdef __WXUNIVERSAL__ info.shortName << _T("univ"); info.name << _T("/wxUniversal"); #endif - return &info; + return info; } // Reading and writing resources (eg WIN.INI, .Xdefaults) @@ -482,7 +486,7 @@ wxString wxGetOsDescription() { #ifdef WXWIN_OS_DESCRIPTION // use configure generated description if available - return wxString("MacOS (") + WXWIN_OS_DESCRIPTION + wxString(")"); + return wxString(wxT("MacOS (")) + wxT(WXWIN_OS_DESCRIPTION) + wxString(wxT(")")); #else return wxT("MacOS") ; //TODO:define further #endif