]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/utils.cpp
Keep wxPalmOS buildable - missing functions.
[wxWidgets.git] / src / mac / carbon / utils.cpp
index df1f155679f4289985f62e25baf16af958b80561..240161a190021d24a0f5e01cf9a4e10f27aabcc2 100644 (file)
 #endif
 #endif
 
-// ---------------------------------------------------------------------------
-// code used in both base and GUI compilation
-// ---------------------------------------------------------------------------
+#if wxUSE_BASE
 
 // our OS version is the same in non GUI and GUI cases
-static int DoGetOSVersion(int *majorVsn, int *minorVsn)
+wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn)
 {
     long theSystem;
-
-    // are there x-platform conventions ?
-
     Gestalt(gestaltSystemVersion, &theSystem);
-    if (minorVsn != NULL)
-        *minorVsn = (theSystem & 0xFF);
 
-    if (majorVsn != NULL)
+    if ( majorVsn != NULL )
         *majorVsn = (theSystem >> 8);
 
-#ifdef __DARWIN__
-    return wxMAC_DARWIN;
+    if ( minorVsn != NULL )
+        *minorVsn = (theSystem & 0xFF);
+
+#if defined( __DARWIN__ )
+    return wxOS_MAC_OSX_DARWIN;
 #else
-    return wxMAC;
+    return wxOS_MAC_OS;
 #endif
 }
 
-
-#if wxUSE_BASE
-
 // ----------------------------------------------------------------------------
 // debugging support
 // ----------------------------------------------------------------------------
@@ -370,34 +363,17 @@ void wxBell()
     SysBeep(30);
 }
 
-wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo()
-{
-    static wxToolkitInfo info;
-
-    info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor);
-    info.name = _T("wxBase");
-
-    return info;
-}
 
 #endif // wxUSE_BASE
 
 #if wxUSE_GUI
 
-wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
+wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
 {
-    static wxToolkitInfo info;
+    // We suppose that toolkit version is the same as OS version under Mac
+    wxGetOsVersion(verMaj, verMin);
 
-    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 wxPORT_MAC;
 }
 
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
@@ -1151,7 +1127,7 @@ void wxMacControl::SetRect( Rect *r )
         HIViewSetFrame ( m_controlRef , &hir );
         // eventuall we might have to do a SetVisibility( false , true );
         // before and a SetVisibility( true , true ); after
- }
+}
 
 void wxMacControl::GetRect( Rect *r )
 {