X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7528971e6bd0745f2e9f2234fc8e63235f0dba3a..d8c89c487d47c0f5a9c4a3cfe2010f04d54939f5:/src/common/platinfo.cpp diff --git a/src/common/platinfo.cpp b/src/common/platinfo.cpp index 9bf0d9c69e..a687a47862 100644 --- a/src/common/platinfo.cpp +++ b/src/common/platinfo.cpp @@ -66,7 +66,10 @@ static const wxChar* const wxOperatingSystemIdNames[] = _T("Other Unix"), _T("DOS"), - _T("OS/2") + _T("OS/2"), + + _T("PalmOS"), + _T("PalmOS(Over Linux)"), }; static const wxChar* const wxPortIdNames[] = @@ -102,8 +105,8 @@ static const wxChar* const wxEndiannessNames[] = // local functions // ---------------------------------------------------------------------------- -// returns log in base 2 of the value, this maps the enum values to the -// corresponding indices +// returns the logarithm in base 2 of 'value'; this maps the enum values to the +// corresponding indexes of the string arrays above static unsigned wxGetIndexFromEnumValue(int value) { wxCHECK_MSG( value, (unsigned)-1, _T("invalid enum value") ); @@ -156,6 +159,9 @@ bool wxPlatformInfo::operator==(const wxPlatformInfo &t) const m_osVersionMajor == t.m_osVersionMajor && m_osVersionMinor == t.m_osVersionMinor && m_os == t.m_os && + m_osDesc == t.m_osDesc && + m_ldi == t.m_ldi && + m_desktopEnv == t.m_desktopEnv && m_port == t.m_port && m_usingUniversal == t.m_usingUniversal && m_arch == t.m_arch && @@ -179,11 +185,18 @@ void wxPlatformInfo::InitForCurrentPlatform() { m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor); m_usingUniversal = traits->IsUsingUniversalWidgets(); + m_desktopEnv = traits->GetDesktopEnvironment(); } m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor); + m_osDesc = wxGetOsDescription(); m_endian = wxIsPlatformLittleEndian() ? wxENDIAN_LITTLE : wxENDIAN_BIG; m_arch = wxIsPlatform64Bit() ? wxARCH_64 : wxARCH_32; + +#ifdef __LINUX__ + m_ldi = wxGetLinuxDistributionInfo(); +#endif + // else: leave m_ldi empty } /* static */ @@ -199,6 +212,12 @@ const wxPlatformInfo& wxPlatformInfo::Get() return gs_platInfo; } +/* static */ +wxString wxPlatformInfo::GetOperatingSystemDirectory() +{ + return wxGetOSDirectory(); +} + // ---------------------------------------------------------------------------- @@ -324,11 +343,11 @@ wxArchitecture wxPlatformInfo::GetArch(const wxString &arch) wxEndianness wxPlatformInfo::GetEndianness(const wxString& end) { - wxString endl(end.Lower()); - if ( end.StartsWith(wxT("little")) ) + const wxString endl(end.Lower()); + if ( endl.StartsWith(wxT("little")) ) return wxENDIAN_LITTLE; - if ( end.StartsWith(wxT("big")) ) + if ( endl.StartsWith(wxT("big")) ) return wxENDIAN_BIG; return wxENDIAN_INVALID;