![]() ![]() ![]() ![]() wxplatforminfothis class holds informations about the operating system and the toolkit that the application is running under and some basic architecture info of the machine where it's running. derived from include files <wx/platinfo.h> see also wxgetosversion, wxisplatformlittleendian, wxisplatform64bit, wxapptraits data structures the following are the operating systems which are recognized by wxwidgets and whose version can be detected at run-time. the values of the constants are chosen so that they can be combined as flags; this allows to check for operating system families like e.g. wxos_mac and wxos_unix.
enum wxoperatingsystemid { wxos_unknown = 0, // returned on error wxos_mac_os = 1 << 0, // apple mac os 8/9/x with mac paths wxos_mac_osx_darwin = 1 << 1, // apple mac os x with unix paths wxos_mac = wxos_mac_os|wxos_mac_osx_darwin, wxos_windows_9x = 1 << 2, // windows 9x family (95/98/me) wxos_windows_nt = 1 << 3, // windows nt family (nt/2000/xp) wxos_windows_micro = 1 << 4, // microwindows wxos_windows_ce = 1 << 5, // windows ce (window mobile) wxos_windows = wxos_windows_9x | wxos_windows_nt | wxos_windows_micro | wxos_windows_ce, wxos_unix_linux = 1 << 6, // linux wxos_unix_freebsd = 1 << 7, // freebsd wxos_unix_openbsd = 1 << 8, // openbsd wxos_unix_netbsd = 1 << 9, // netbsd wxos_unix_solaris = 1 << 10, // sunos wxos_unix_aix = 1 << 11, // aix wxos_unix_hpux = 1 << 12, // hp/ux wxos_unix = wxos_unix_linux | wxos_unix_freebsd | wxos_unix_openbsd | wxos_unix_netbsd | wxos_unix_solaris | wxos_unix_aix | wxos_unix_hpux, wxos_dos = 1 << 15, // microsoft dos wxos_os2 = 1 << 16 // os/2 };the list of wxwidgets ports. some of them can be used with more than a single (native) toolkit; e.g. wxwince port sources can be used with smartphones, pocket pcs and handheld devices sdks.
enum wxportid { wxport_unknown = 0, // returned on error wxport_base = 1 << 0, // wxbase, no native toolkit used wxport_msw = 1 << 1, // wxmsw, native toolkit is windows api wxport_motif = 1 << 2, // wxmotif, using [open]motif or lesstif wxport_gtk = 1 << 3, // wxgtk, using gtk+ 1.x, 2.x, gpe or maemo wxport_mgl = 1 << 4, // wxmgl, using wxuniversal wxport_x11 = 1 << 5, // wxx11, using wxuniversal wxport_os2 = 1 << 6, // wxos2, using os/2 presentation manager wxport_mac = 1 << 7, // wxmac, using carbon or classic mac api wxport_cocoa = 1 << 8, // wxcocoa, using cocoa nextstep/mac api wxport_wince = 1 << 9, // wxwince, toolkit is wince sdk api wxport_palmos = 1 << 10, // wxpalmos, toolkit is palmos api wxport_dfb = 1 << 11 // wxdfb, using wxuniversal };the architecture of the operating system (regardless of the build environment of wxwidgets library - see wxisplatform64bit documentation for more info).
enum wxarchitecture { wxarch_invalid = -1, // returned on error wxarch_32, // 32 bit wxarch_64, wxarch_max }the endian-ness of the machine.
enum wxendianness { wxendian_invalid = -1, // returned on error wxendian_big, // 4321 wxendian_little, // 1234 wxendian_pdp, // 3412 wxendian_max }members
wxplatforminfo::wxplatforminfo
wxplatforminfo::wxplatforminfowxplatforminfo() initializes the instance with the values corresponding to the currently running platform. this is a fast operation because it only requires to copy the values internally cached for the currently running platform (see also get). wxplatforminfo(wxportid pid = wxport_unknown, int tkmajor = -1, int tkminor = -1, wxoperatingsystemid id = wxos_unknown, int osmajor = -1, int osminor = -1, wxarchitecture arch = wxarch_invalid, wxendianness endian = wxendian_invalid) initializes the object using given values.
wxplatforminfo::checkosversionbool checkosversion(int major, int minor) const returns true if the os version is at least major.minor. see also getosmajorversion, getosminorversion, checktoolkitversion
wxplatforminfo::checktoolkitversionbool checktoolkitversion(int major, int minor) const returns true if the toolkit version is at least major.minor. see also gettoolkitmajorversion, gettoolkitminorversion, checkosversion
wxplatforminfo::getstatic const wxplatforminfo& get() returns the global wxplatforminfo object, initialized with the values for the currently running platform.
wxplatforminfo::getarchstatic wxarchitecture getarch(const wxstring& arch) converts the given string to a wxarchitecture enum value or to wxarch_invalid if the given string is not a valid architecture string (i.e. does not contain nor 32 nor 64 strings).
wxplatforminfo::getarchnamestatic wxstring getarchname(wxarchitecture arch) returns the name for the given wxarchitecture enumeration value. wxstring getarchname() const returns the name for the architecture of this wxplatforminfo instance.
wxplatforminfo::getarchitecturewxarchitecture getarchitecture() const returns the architecture id of this wxplatforminfo instance.
wxplatforminfo::getendiannessstatic wxendianness getendianness(const wxstring& end) converts the given string to a wxendianness enum value or to wxendian_invalid if the given string is not a valid endianness string (i.e. does not contain nor little nor big strings). wxendianness getendianness() const returns the endianness id of this wxplatforminfo instance.
wxplatforminfo::getendiannessnamestatic wxstring getendiannessname(wxendianness end) returns name for the given wxendianness enumeration value. wxstring getendiannessname() const returns the name for the endianness of this wxplatforminfo instance.
wxplatforminfo::getosmajorversionint getosmajorversion() const returns the run-time major version of the os associated with this wxplatforminfo instance. see wxgetosversion for more info. see also
wxplatforminfo::getosminorversionint getosminorversion() const returns the run-time minor version of the os associated with this wxplatforminfo instance. see wxgetosversion for more info. see also
wxplatforminfo::getoperatingsystemfamilynamestatic wxstring getoperatingsystemfamilyname(wxoperatingsystemid os) returns the operating system family name for the given wxoperatingsystemid enumeration value: unix for wxos_unix, macintosh for wxos_mac, windows for wxos_windows, dos for wxos_dos, os/2 for wxos_os2. wxstring getoperatingsystemfamilyname() const returns the operating system family name of the os associated with this wxplatforminfo instance.
wxplatforminfo::getoperatingsystemidstatic wxoperatingsystemid getoperatingsystemid(const wxstring& name) converts the given string to a wxoperatingsystemid enum value or to wxos_unknown if the given string is not a valid operating system name. wxoperatingsystemid getoperatingsystemid() const returns the operating system id of this wxplatforminfo instance.
wxplatforminfo::getoperatingsystemidnamestatic wxstring getoperatingsystemidname(wxoperatingsystemid os) returns the name for the given operating system id value. this can be a long name (e.g. microsoft windows nt); use getoperatingsystemfamilyname to retrieve a short, generic name. wxstring getoperatingsystemidname() const returns the operating system name of the os associated with this wxplatforminfo instance.
wxplatforminfo::getportidstatic wxportid getportid(const wxstring& portname) converts the given string to a wxwidgets port id value or to wxport_unknown if the given string does not match any of the wxwidgets canonical name ports ("wxgtk", "wxmsw", etc) nor any of the short wxwidgets name ports ("gtk", "msw", etc). wxportid getportid() const returns the wxwidgets port id associated with this wxplatforminfo instance.
wxplatforminfo::getportidnamestatic wxstring getportidname(wxportid port, bool usinguniversal) returns the name of the given wxwidgets port id value. the usinguniversal argument specifies whether the port is in its native or wxuniversal variant. the returned string always starts with the "wx" prefix and is a mixed-case string. wxstring getportidname() const returns the name of the wxwidgets port id associated with this wxplatforminfo instance.
wxplatforminfo::getportidshortnamestatic wxstring getportidshortname(wxportid port, bool usinguniversal) returns the short name of the given wxwidgets port id value. the usinguniversal argument specifies whether the port is in its native or wxuniversal variant. the returned string does not start with the "wx" prefix and is always lower case. wxstring getportidshortname() const returns the short name of the wxwidgets port id associated with this wxplatforminfo instance.
wxplatforminfo::gettoolkitmajorversionint gettoolkitmajorversion() const returns the run-time major version of the toolkit associated with this wxplatforminfo instance. note that if getportid returns wxport_base, then this value is zero (unless externally modified with settoolkitversion); that is, no native toolkit is in use. see wxapptraits::gettoolkitversion for more info. see also
wxplatforminfo::gettoolkitminorversionint gettoolkitminorversion() const returns the run-time minor version of the toolkit associated with this wxplatforminfo instance. note that if getportid returns wxport_base, then this value is zero (unless externally modified with settoolkitversion); that is, no native toolkit is in use. see wxapptraits::gettoolkitversion for more info. see also
wxplatforminfo::isokbool isok() const returns true if this instance is fully initialized with valid values.
wxplatforminfo::isusinguniversalwidgetsbool isusinguniversalwidgets() const returns true if this wxplatforminfo describes wxuniversal build.
wxplatforminfo::setarchitecturevoid setarchitecture(wxarchitecture n) sets the architecture enum value associated with this wxplatforminfo instance.
wxplatforminfo::setendiannessvoid setendianness(wxendianness n) sets the endianness enum value associated with this wxplatforminfo instance.
wxplatforminfo::setosversionvoid setosversion(int major, int minor) sets the version of the operating system associated with this wxplatforminfo instance.
wxplatforminfo::setoperatingsystemidvoid setoperatingsystemid(wxoperatingsystemid n) sets the operating system associated with this wxplatforminfo instance.
wxplatforminfo::setportidvoid setportid(wxportid n) sets the wxwidgets port id associated with this wxplatforminfo instance.
wxplatforminfo::settoolkitversionvoid settoolkitversion(int major, int minor) sets the version of the toolkit associated with this wxplatforminfo instance.
wxplatforminfo::operator!=bool operator!=(const wxplatforminfo& t) const inequality operator. tests all class' internal variables.
wxplatforminfo::operator==bool operator==(const wxplatforminfo& t) const equality operator. tests all class' internal variables.
|