X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/619e0d43b19948edf1d1098eb5f2cbc768f74762..239c2e9674c8c6b9f0fd3d6fb94e2381691651b5:/src/mac/carbon/utils.cpp diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index f234da7456..2e2ffd6c4a 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -11,7 +11,6 @@ #ifdef __GNUG__ // Note: this is done in utilscmn.cpp now. -// #pragma implementation // #pragma implementation "utils.h" #endif @@ -27,9 +26,12 @@ #include #include +#include "MoreFiles.h" +#include "MoreFilesExtras.h" + #ifndef __DARWIN__ -# include "morefile.h" -# include "moreextr.h" +#include +#include #endif #ifndef __DARWIN__ @@ -109,12 +111,25 @@ bool wxGetUserName(char *buf, int maxSize) return TRUE; } -int wxKill(long pid, wxSignal sig) +int wxKill(long pid, wxSignal sig , wxKillError *rc ) { // TODO return 0; } +WXDLLEXPORT bool wxGetEnv(const wxString& var, wxString *value) +{ + // TODO : under classic there is no environement support, under X yes + return false ; +} + +// set the env var name to the given value, return TRUE on success +WXDLLEXPORT bool wxSetEnv(const wxString& var, const wxChar *value) +{ + // TODO : under classic there is no environement support, under X yes + return false ; +} + // // Execute a program in an Interactive Shell // @@ -132,11 +147,11 @@ long wxGetFreeMemory() void wxUsleep(unsigned long milliseconds) { - clock_t start = clock() ; - do - { - YieldToAnyThread() ; - } while( clock() - start < milliseconds / CLOCKS_PER_SEC ) ; + clock_t start = clock() ; + do + { + YieldToAnyThread() ; + } while( clock() - start < milliseconds / CLOCKS_PER_SEC ) ; } void wxSleep(int nSecs) @@ -193,11 +208,22 @@ void wxBell() int wxGetOsVersion(int *majorVsn, int *minorVsn) { - long theSystem ; - Gestalt(gestaltSystemVersion, &theSystem) ; - *minorVsn = (theSystem & 0xFF ) ; - *majorVsn = (theSystem >> 8 ) ; // are there x-platform conventions ? - return wxMACINTOSH; + 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 } // Reading and writing resources (eg WIN.INI, .Xdefaults) @@ -320,10 +346,9 @@ bool wxIsBusy() return (wxBusyCursorCount > 0); } -#ifndef __DARWIN__ -wxString wxMacFindFolder( short vol, - OSType folderType, - Boolean createFolder) +wxString wxMacFindFolder( short vol, + OSType folderType, + Boolean createFolder) { short vRefNum ; long dirID ; @@ -334,12 +359,11 @@ wxString wxMacFindFolder( short vol, FSSpec file ; if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr ) { - strDir = wxMacFSSpec2MacFilename( &file ) + ":" ; + strDir = wxMacFSSpec2MacFilename( &file ) + wxFILE_SEP_PATH ; } } return strDir ; } -#endif #ifndef __DARWIN__ char *wxGetUserHome (const wxString& user) @@ -347,9 +371,7 @@ char *wxGetUserHome (const wxString& user) // TODO return NULL; } -#endif -#ifndef __DARWIN__ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) { if ( path.empty() ) @@ -461,3 +483,14 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt) { return wxGenericFindWindowAtPoint(pt); } + +wxString wxGetOsDescription() +{ +#ifdef WXWIN_OS_DESCRIPTION + // use configure generated description if available + return wxString("MacOS (") + WXWIN_OS_DESCRIPTION + wxString(")"); +#else + return "MacOS" ; //TODO:define further +#endif +} +