From: Vadim Zeitlin Date: Wed, 9 Jul 2003 20:40:00 +0000 (+0000) Subject: attempts to fix separate compilation (didn't work) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b6ed2b860c3ffe62bc9556e799e129109b232487?ds=inline attempts to fix separate compilation (didn't work) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 345bbe9a4e..7198e49b52 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -18,7 +18,10 @@ #include "wx/utils.h" #include "wx/app.h" #include "wx/apptrait.h" -#include "wx/mac/uma.h" + +#if wxUSE_GUI + #include "wx/mac/uma.h" +#endif #include @@ -51,6 +54,7 @@ #include #endif +#if wxUSE_BASE #ifndef __DARWIN__ // defined in unix/utilsunx.cpp for Mac OS X @@ -193,11 +197,7 @@ void wxBell() SysBeep(30); } -#if defined(__WXMAC__) && !defined(__DARWIN__) int wxAppTraits::GetOSVersion(int *majorVsn, int *minorVsn) -#else -int wxGUIAppTraits::GetOSVersion(int *majorVsn, int *minorVsn) -#endif { long theSystem ; @@ -217,6 +217,9 @@ int wxGUIAppTraits::GetOSVersion(int *majorVsn, int *minorVsn) #endif } +#endif // wxUSE_BASE + +#if wxUSE_GUI // Reading and writing resources (eg WIN.INI, .Xdefaults) #if wxUSE_RESOURCES @@ -349,48 +352,6 @@ wxString wxMacFindFolder( short vol, return strDir ; } -#ifndef __DARWIN__ -wxChar *wxGetUserHome (const wxString& user) -{ - // TODO - return NULL; -} - -bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) -{ - if ( path.empty() ) - return FALSE; - - wxString p = path ; - if (p[0] == ':' ) { - p = wxGetCwd() + p ; - } - - int pos = p.Find(':') ; - if ( pos != wxNOT_FOUND ) { - p = p.Mid(1,pos) ; - } - - p = p + wxT(":") ; - - Str255 volumeName ; - XVolumeParam pb ; - - wxMacStringToPascal( p , volumeName ) ; - OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; - if ( err == noErr ) { - if ( pTotal ) { - (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; - } - if ( pFree ) { - (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; - } - } - - return err == noErr ; -} -#endif - // Check whether this window wants to process messages, e.g. Stop button // in long calculations. bool wxCheckForInterrupt(wxWindow *wnd) @@ -491,6 +452,10 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt) return wxGenericFindWindowAtPoint(pt); } +#endif // wxUSE_GUI + +#if wxUSE_BASE + wxString wxGetOsDescription() { #ifdef WXWIN_OS_DESCRIPTION @@ -501,6 +466,52 @@ wxString wxGetOsDescription() #endif } +#ifndef __DARWIN__ +wxChar *wxGetUserHome (const wxString& user) +{ + // TODO + return NULL; +} + +bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) +{ + if ( path.empty() ) + return FALSE; + + wxString p = path ; + if (p[0] == ':' ) { + p = wxGetCwd() + p ; + } + + int pos = p.Find(':') ; + if ( pos != wxNOT_FOUND ) { + p = p.Mid(1,pos) ; + } + + p = p + wxT(":") ; + + Str255 volumeName ; + XVolumeParam pb ; + + wxMacStringToPascal( p , volumeName ) ; + OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; + if ( err == noErr ) { + if ( pTotal ) { + (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; + } + if ( pFree ) { + (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; + } + } + + return err == noErr ; +} +#endif // !__DARWIN__ + +#endif // wxUSE_BASE + +#if wxUSE_GUI + //--------------------------------------------------------------------------- // wxMac Specific utility functions //--------------------------------------------------------------------------- @@ -986,3 +997,5 @@ extern bool WXDLLEXPORT wxIsDebuggerRunning() #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) +#endif // wxUSE_GUI + diff --git a/src/mac/utils.cpp b/src/mac/utils.cpp index 345bbe9a4e..7198e49b52 100644 --- a/src/mac/utils.cpp +++ b/src/mac/utils.cpp @@ -18,7 +18,10 @@ #include "wx/utils.h" #include "wx/app.h" #include "wx/apptrait.h" -#include "wx/mac/uma.h" + +#if wxUSE_GUI + #include "wx/mac/uma.h" +#endif #include @@ -51,6 +54,7 @@ #include #endif +#if wxUSE_BASE #ifndef __DARWIN__ // defined in unix/utilsunx.cpp for Mac OS X @@ -193,11 +197,7 @@ void wxBell() SysBeep(30); } -#if defined(__WXMAC__) && !defined(__DARWIN__) int wxAppTraits::GetOSVersion(int *majorVsn, int *minorVsn) -#else -int wxGUIAppTraits::GetOSVersion(int *majorVsn, int *minorVsn) -#endif { long theSystem ; @@ -217,6 +217,9 @@ int wxGUIAppTraits::GetOSVersion(int *majorVsn, int *minorVsn) #endif } +#endif // wxUSE_BASE + +#if wxUSE_GUI // Reading and writing resources (eg WIN.INI, .Xdefaults) #if wxUSE_RESOURCES @@ -349,48 +352,6 @@ wxString wxMacFindFolder( short vol, return strDir ; } -#ifndef __DARWIN__ -wxChar *wxGetUserHome (const wxString& user) -{ - // TODO - return NULL; -} - -bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) -{ - if ( path.empty() ) - return FALSE; - - wxString p = path ; - if (p[0] == ':' ) { - p = wxGetCwd() + p ; - } - - int pos = p.Find(':') ; - if ( pos != wxNOT_FOUND ) { - p = p.Mid(1,pos) ; - } - - p = p + wxT(":") ; - - Str255 volumeName ; - XVolumeParam pb ; - - wxMacStringToPascal( p , volumeName ) ; - OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; - if ( err == noErr ) { - if ( pTotal ) { - (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; - } - if ( pFree ) { - (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; - } - } - - return err == noErr ; -} -#endif - // Check whether this window wants to process messages, e.g. Stop button // in long calculations. bool wxCheckForInterrupt(wxWindow *wnd) @@ -491,6 +452,10 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt) return wxGenericFindWindowAtPoint(pt); } +#endif // wxUSE_GUI + +#if wxUSE_BASE + wxString wxGetOsDescription() { #ifdef WXWIN_OS_DESCRIPTION @@ -501,6 +466,52 @@ wxString wxGetOsDescription() #endif } +#ifndef __DARWIN__ +wxChar *wxGetUserHome (const wxString& user) +{ + // TODO + return NULL; +} + +bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) +{ + if ( path.empty() ) + return FALSE; + + wxString p = path ; + if (p[0] == ':' ) { + p = wxGetCwd() + p ; + } + + int pos = p.Find(':') ; + if ( pos != wxNOT_FOUND ) { + p = p.Mid(1,pos) ; + } + + p = p + wxT(":") ; + + Str255 volumeName ; + XVolumeParam pb ; + + wxMacStringToPascal( p , volumeName ) ; + OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; + if ( err == noErr ) { + if ( pTotal ) { + (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; + } + if ( pFree ) { + (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; + } + } + + return err == noErr ; +} +#endif // !__DARWIN__ + +#endif // wxUSE_BASE + +#if wxUSE_GUI + //--------------------------------------------------------------------------- // wxMac Specific utility functions //--------------------------------------------------------------------------- @@ -986,3 +997,5 @@ extern bool WXDLLEXPORT wxIsDebuggerRunning() #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) +#endif // wxUSE_GUI +