X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ea92b4d7792987769774ac381685dae15c70454..67193066b2d16ca36529216f70d093690d7e1123:/src/mac/classic/utils.cpp diff --git a/src/mac/classic/utils.cpp b/src/mac/classic/utils.cpp index 979ac71cb0..7078e7a3c7 100644 --- a/src/mac/classic/utils.cpp +++ b/src/mac/classic/utils.cpp @@ -1,29 +1,30 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp +// Name: src/mac/classic/utils.cpp // Purpose: Various utilities // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -// Note: this is done in utilscmn.cpp now. -// #pragma implementation "utils.h" -#endif +#include "wx/wxprec.h" -#include "wx/setup.h" #include "wx/utils.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/intl.h" + #include "wx/app.h" + #if wxUSE_GUI + #include "wx/font.h" + #endif +#endif + #include "wx/apptrait.h" #if wxUSE_GUI #include "wx/mac/uma.h" - #include "wx/font.h" -#else - #include "wx/intl.h" #endif #include @@ -190,18 +191,6 @@ bool wxShutdown(wxShutdownFlags wFlags) return false; } -wxPowerType wxGetPowerType() -{ - // TODO - return wxPOWER_UNKNOWN; -} - -wxBatteryState wxGetBatteryState() -{ - // TODO - return wxBATTERY_UNKNOWN_STATE; -} - // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) wxMemorySize wxGetFreeMemory() { @@ -343,7 +332,7 @@ extern wxCursor gMacCurrentCursor ; wxCursor gMacStoredActiveCursor ; // Set the cursor to the busy cursor for all windows -void wxBeginBusyCursor(wxCursor *cursor) +void wxBeginBusyCursor(const wxCursor *cursor) { if (gs_wxBusyCursorCount++ == 0) { @@ -376,7 +365,7 @@ bool wxIsBusy() #if wxUSE_BASE -wxString wxMacFindFolder( short vol, +wxString wxMacFindFolderNoSeparator( short vol, OSType folderType, Boolean createFolder) { @@ -389,12 +378,19 @@ wxString wxMacFindFolder( short vol, FSSpec file ; if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr ) { - strDir = wxMacFSSpec2MacFilename( &file ) + wxFILE_SEP_PATH ; + strDir = wxMacFSSpec2MacFilename( &file ); } } return strDir ; } +wxString wxMacFindFolder( short vol, + OSType folderType, + Boolean createFolder) +{ + return wxMacFindFolderNoSeparator(vol, folderType, createFolder) + wxFILE_SEP_PATH; +} + #endif // wxUSE_BASE #if wxUSE_GUI @@ -533,7 +529,7 @@ wxChar *wxGetUserHome (const wxString& user) return NULL; } -bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) +bool wxGetDiskSpace(const wxString& path, wxDiskspaceSize_t *pTotal, wxDiskspaceSize_t *pFree) { if ( path.empty() ) return false; @@ -557,10 +553,10 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; if ( err == noErr ) { if ( pTotal ) { - (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; + (*pTotal) = wxDiskspaceSize_t( pb.ioVTotalBytes ) ; } if ( pFree ) { - (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; + (*pFree) = wxDiskspaceSize_t( pb.ioVFreeBytes ) ; } } @@ -1215,7 +1211,7 @@ void wxMacConvertNewlines10To13( char * data ) void wxMacConvertNewlines13To10( wxString * data ) { - size_t len = data->Length() ; + size_t len = data->length() ; if ( len == 0 || wxStrchr(data->c_str(),0x0d)==NULL) return ; @@ -1229,9 +1225,9 @@ void wxMacConvertNewlines13To10( wxString * data ) void wxMacConvertNewlines10To13( wxString * data ) { - size_t len = data->Length() ; + size_t len = data->length() ; - if ( data->Length() == 0 || wxStrchr(data->c_str(),0x0a)==NULL) + if ( data->empty() || wxStrchr(data->c_str(),0x0a)==NULL) return ; wxString temp(*data) ; @@ -1404,4 +1400,3 @@ extern bool WXDLLEXPORT wxIsDebuggerRunning() #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) #endif // wxUSE_GUI -