X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bed67b7f86529116a17047e8e6c30c0f5ccef6a4..a8f234d2a9fcaf55a1360bc81503039c4ed766db:/src/os2/utils.cpp?ds=sidebyside diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index 22e8837796..f779879590 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -45,7 +45,7 @@ #include #endif -static const wxChar WX_SECTION[] = _T("wxWindows"); +static const wxChar WX_SECTION[] = _T("wxWidgets"); static const wxChar eHOSTNAME[] = _T("HostName"); static const wxChar eUSERID[] = _T("UserId"); static const wxChar eUSERNAME[] = _T("UserName"); @@ -95,7 +95,7 @@ bool wxGetHostName( wxStrncpy(zBuf, zSysname, nMaxSize - 1); zBuf[nMaxSize] = _T('\0'); #endif - return *zBuf ? TRUE : FALSE; + return *zBuf ? true : false; } // Get user ID e.g. jacs @@ -108,9 +108,9 @@ bool wxGetUserId( long lrc; // UPM procs return 0 on success lrc = U32ELOCU((unsigned char*)zBuf, (unsigned long *)&nType); - if (lrc == 0) return TRUE; + if (lrc == 0) return true; #endif - return FALSE; + return false; } bool wxGetUserName( @@ -125,13 +125,14 @@ bool wxGetUserName( #else wxStrncpy(zBuf, _T("Unknown User"), nMaxSize); #endif - return TRUE; + return true; } int wxKill( long lPid , wxSignal eSig , wxKillError* peError +, int flags ) { return((int)::DosKillProcess(0, (PID)lPid)); @@ -200,11 +201,23 @@ bool wxShell( bool wxShutdown(wxShutdownFlags wFlags) { // TODO - return FALSE; + 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) -long wxGetFreeMemory() +wxMemorySize wxGetFreeMemory() { void* pMemptr = NULL; ULONG lSize; @@ -214,8 +227,8 @@ long wxGetFreeMemory() lMemFlags = PAG_FREE; rc = ::DosQueryMem(pMemptr, &lSize, &lMemFlags); if (rc != 0) - return -1L; - return (long)lSize; + lSize = -1L; + return (wxMemorySize)lSize; } // ---------------------------------------------------------------------------- @@ -227,14 +240,14 @@ bool wxGetEnv(const wxString& var, wxString *value) // wxGetenv is defined as getenv() wxChar *p = wxGetenv(var); if ( !p ) - return FALSE; + return false; if ( value ) { *value = p; } - return TRUE; + return true; } bool wxSetEnv(const wxString& variable, const wxChar *value) @@ -256,17 +269,24 @@ bool wxSetEnv(const wxString& variable, const wxChar *value) return putenv(buf) == 0; #else // no way to set an env var - return FALSE; + return false; #endif } -void wxUsleep( +void wxMilliSleep( unsigned long ulMilliseconds ) { ::DosSleep(ulMilliseconds); } +void wxMicroSleep( + unsigned long ulMicroseconds +) +{ + ::DosSleep(ulMicroseconds/1000); +} + void wxSleep( int nSecs ) @@ -353,9 +373,9 @@ void wxAppTraits::TerminateGui(unsigned long ulHab) wxToolkitInfo & wxConsoleAppTraits::GetToolkitInfo() { - static wxToolkitInfo vInfo; - ULONG ulSysInfo[QSV_MAX] = {0}; - APIRET ulrc; + static wxToolkitInfo vInfo; + ULONG ulSysInfo[QSV_MAX] = {0}; + APIRET ulrc; vInfo.name = _T("wxBase"); ulrc = ::DosQuerySysInfo( 1L