\latexignore{\rtfignore{\wxheading{Members}}}
-\membersection{wxAppTraits::GetToolkitVersion}\label{wxapptraitsgettoolkitversion}
+\membersection{wxAppTraits::CreateFontMapper}\label{wxapptraitscreatefontmapper}
-\func{virtual wxPortId}{GetToolkitVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}}
+\func{virtual wxFontMapper *}{CreateFontMapper}{\void}
-Returns the wxWidgets port ID used by the running program and eventually
-fills the given pointers with the values of the major and minor digits
-of the native toolkit currently used.
+Creates the global font mapper object used for encodings/charset mapping.
-E.g. if your program is using wxGTK port this function will return wxPORT_GTK and
-put in given pointers the versions of the GTK library in use.
-See \helpref{wxPlatformInfo}{wxplatforminfo} for more details.
+\membersection{wxAppTraits::CreateLogTarget}\label{wxapptraitscreatelogtarget}
+\func{virtual wxLog *}{CreateLogTarget}{\void}
-\membersection{wxAppTraits::HasStderr}\label{wxapptraitshasstderr}
+Creates the default log target for the application.
-\func{virtual bool}{HasStderr}{\void}
-Returns \true if {\tt fprintf(stderr)} goes somewhere, \false otherwise.
+\membersection{wxAppTraits::CreateMessageOutput}\label{wxapptraitscreatemessageoutput}
+\func{virtual wxMessageOutput *}{CreateMessageOutput}{\void}
+Creates the global object used for printing out messages.
-\membersection{wxAppTraits::ShowAssertDialog}\label{wxapptraitsshowassertdialog}
-\func{virtual bool}{ShowAssertDialog}{\param{const wxString \&}{ msg}}
+\membersection{wxAppTraits::CreateRenderer}\label{wxapptraitscreaterenderer}
-Shows the assert dialog with the specified message in GUI mode or just prints
-the string to stderr in console mode.
+\func{virtual wxRendererNative *}{CreateRenderer}{\void}
-Returns \true to suppress subsequent asserts, \false to continue as before.
+Returns the renderer to use for drawing the generic controls (return value may be \NULL
+in which case the default renderer for the current platform is used);
+this is used in GUI mode only and always returns \NULL in console.
+NOTE: returned pointer will be deleted by the caller.
\membersection{wxAppTraits::GetStandardPaths}\label{wxapptraitsgetstandardpaths}
Returns the wxStandardPaths object for the application.
It's normally the same for wxBase and wxGUI except in the case of wxMac and wxCocoa.
+\membersection{wxAppTraits::GetToolkitVersion}\label{wxapptraitsgettoolkitversion}
+\func{virtual wxPortId}{GetToolkitVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}}
-\membersection{wxAppTraits::CreateRenderer}\label{wxapptraitscreaterenderer}
-
-\func{virtual wxRendererNative *}{CreateRenderer}{\void}
-
-Returns the renderer to use for drawing the generic controls (return value may be \NULL
-in which case the default renderer for the current platform is used);
-this is used in GUI mode only and always returns \NULL in console.
-
-NOTE: returned pointer will be deleted by the caller.
-
-
+Returns the wxWidgets port ID used by the running program and eventually
+fills the given pointers with the values of the major and minor digits
+of the native toolkit currently used.
-\membersection{wxAppTraits::CreateLogTarget}\label{wxapptraitscreatelogtarget}
+E.g. if your program is using wxGTK port this function will return wxPORT_GTK and
+put in given pointers the versions of the GTK library in use.
-\func{virtual wxLog *}{CreateLogTarget}{\void}
+See \helpref{wxPlatformInfo}{wxplatforminfo} for more details.
-Creates the default log target for the application.
+\membersection{wxAppTraits::HasStderr}\label{wxapptraitshasstderr}
+\func{virtual bool}{HasStderr}{\void}
-\membersection{wxAppTraits::CreateMessageOutput}\label{wxapptraitscreatemessageoutput}
+Returns \true if {\tt fprintf(stderr)} goes somewhere, \false otherwise.
-\func{virtual wxMessageOutput *}{CreateMessageOutput}{\void}
-Creates the global object used for printing out messages.
+\membersection{wxAppTraits::IsUsingUniversalWidgets}\label{wxapptraitsisusinguniversalwidgets}
+\constfunc{bool}{IsUsingUniversalWidgets}{\void}
+Returns \true if the library was built as wxUniversal. Always returns
+\false for wxBase-only apps.
-\membersection{wxAppTraits::CreateFontMapper}\label{wxapptraitscreatefontmapper}
-\func{virtual wxFontMapper *}{CreateFontMapper}{\void}
+\membersection{wxAppTraits::ShowAssertDialog}\label{wxapptraitsshowassertdialog}
-Creates the global font mapper object used for encodings/charset mapping.
+\func{virtual bool}{ShowAssertDialog}{\param{const wxString \&}{ msg}}
+Shows the assert dialog with the specified message in GUI mode or just prints
+the string to stderr in console mode.
+Returns \true to suppress subsequent asserts, \false to continue as before.
\membersection{wxPlatformInfo::GetPortIdName}\label{wxplatforminfogetportidname}
-\func{static wxString}{GetPortIdName}{\param{wxPortId }{port}}
+\func{static wxString}{GetPortIdName}{\param{wxPortId }{port}, \param{bool }{usingUniversal}}
-Returns the name of the given wxWidgets port ID value. The returned string always starts with
-the "wx" prefix and is a mixed-case string.
+Returns the name of the given wxWidgets port ID value. The \arg{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.
\constfunc{wxString}{GetPortIdName}{\void}
\membersection{wxPlatformInfo::GetPortIdShortName}\label{wxplatforminfogetportidshortname}
-\func{static wxString}{GetPortIdShortName}{\param{wxPortId }{port}}
+\func{static wxString}{GetPortIdShortName}{\param{wxPortId }{port}, \param{bool }{usingUniversal}}
+
+Returns the short name of the given wxWidgets port ID value. The
+\arg{usingUniversal} argument specifies whether the port is in its native or
+wxUniversal variant.
-Returns the short name of the given wxWidgets port ID value. The returned string does not start with
-the "wx" prefix and is always lower case.
+The returned string does not start with the "wx" prefix and is always lower
+case.
\constfunc{wxString}{GetPortIdShortName}{\void}
\membersection{wxPlatformInfo::IsUsingUniversalWidgets}\label{wxplatforminfoisusinguniversalwidgets}
-\func{bool}{IsUsingUniversalWidgets}{\void}
+\constfunc{bool}{IsUsingUniversalWidgets}{\void}
-Returns \true if \_\_WXUNIVERSAL\_\_ symbol is defined. Note that this function always
-returns a constant value defined at compile-time and exists just for completeness.
+Returns \true if this wxPlatformInfo describes wxUniversal build.
\membersection{wxPlatformInfo::SetArchitecture}\label{wxplatforminfosetarchitecture}
// returns wxPORT_BASE for console applications and one of the remaining
// wxPORT_* values for GUI applications.
virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const = 0;
+
+ // return true if the port is using wxUniversal for the GUI, false if not
+ virtual bool IsUsingUniversalWidgets() const = 0;
};
// ----------------------------------------------------------------------------
virtual void RemoveFromPendingDelete(wxObject *object);
// the GetToolkitVersion for console application is always the same
- wxPortId GetToolkitVersion(int *verMaj, int *verMin) const
+ virtual wxPortId GetToolkitVersion(int *verMaj, int *verMin) const
{
// no toolkits (wxBase is for console applications without GUI support)
// NB: zero means "no toolkit", -1 means "not initialized yet"
if (verMin) *verMin = 0;
return wxPORT_BASE;
}
+
+ virtual bool IsUsingUniversalWidgets() const { return false; }
};
// ----------------------------------------------------------------------------
virtual void ScheduleForDestroy(wxObject *object);
virtual void RemoveFromPendingDelete(wxObject *object);
+
+ virtual bool IsUsingUniversalWidgets() const
+ {
+ #ifdef __WXUNIVERSAL__
+ return true;
+ #else
+ return false;
+ #endif
+ }
};
#endif // wxUSE_GUI
wxOperatingSystemId id = wxOS_UNKNOWN,
int osMajor = -1, int osMinor = -1,
wxArchitecture arch = wxARCH_INVALID,
- wxEndianness endian = wxENDIAN_INVALID);
+ wxEndianness endian = wxENDIAN_INVALID,
+ bool usingUniversal = false);
// default copy ctor, assignment operator and dtor are ok
static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os);
static wxString GetOperatingSystemIdName(wxOperatingSystemId os);
- static wxString GetPortIdName(wxPortId port);
- static wxString GetPortIdShortName(wxPortId port);
+ static wxString GetPortIdName(wxPortId port, bool usingUniversal);
+ static wxString GetPortIdShortName(wxPortId port, bool usingUniversal);
static wxString GetArchName(wxArchitecture arch);
static wxString GetEndiannessName(wxEndianness end);
int GetToolkitMinorVersion() const
{ return m_tkVersionMinor; }
+ bool IsUsingUniversalWidgets() const
+ { return m_usingUniversal; }
+
wxOperatingSystemId GetOperatingSystemId() const
{ return m_os; }
wxPortId GetPortId() const
wxString GetOperatingSystemIdName() const
{ return GetOperatingSystemIdName(m_os); }
wxString GetPortIdName() const
- { return GetPortIdName(m_port); }
+ { return GetPortIdName(m_port, m_usingUniversal); }
wxString GetPortIdShortName() const
- { return GetPortIdShortName(m_port); }
+ { return GetPortIdShortName(m_port, m_usingUniversal); }
wxString GetArchName() const
{ return GetArchName(m_arch); }
wxString GetEndiannessName() const
m_arch != wxARCH_INVALID && m_endian != wxENDIAN_INVALID;
}
- static bool IsUsingUniversalWidgets()
- {
- #ifdef __WXUNIVERSAL__
- return true;
- #else
- return false;
- #endif
- }
-
protected:
// OS stuff
// name of the wxWidgets port
wxPortId m_port;
+ // is using wxUniversal widgets?
+ bool m_usingUniversal;
+
// others
// -----------------
wxFAIL_MSG( _T("failed to initialize wxPlatformInfo") );
m_port = wxPORT_UNKNOWN;
+ m_usingUniversal = false;
m_tkVersionMajor =
m_tkVersionMinor = 0;
}
else
{
m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor);
+ m_usingUniversal = traits->IsUsingUniversalWidgets();
}
m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor);
wxPlatformInfo::wxPlatformInfo(wxPortId pid, int tkMajor, int tkMinor,
wxOperatingSystemId id, int osMajor, int osMinor,
wxArchitecture arch,
- wxEndianness endian)
+ wxEndianness endian,
+ bool usingUniversal)
{
m_tkVersionMajor = tkMajor;
m_tkVersionMinor = tkMinor;
m_port = pid;
+ m_usingUniversal = usingUniversal;
m_os = id;
m_osVersionMajor = osMajor;
m_osVersionMinor == t.m_osVersionMinor &&
m_os == t.m_os &&
m_port == t.m_port &&
+ m_usingUniversal == t.m_usingUniversal &&
m_arch == t.m_arch &&
m_endian == t.m_endian;
}
return wxOperatingSystemIdNames[idx];
}
-wxString wxPlatformInfo::GetPortIdName(wxPortId port)
+wxString wxPlatformInfo::GetPortIdName(wxPortId port, bool usingUniversal)
{
const unsigned idx = wxGetIndexFromEnumValue(port);
wxString ret = wxPortIdNames[idx];
- if ( IsUsingUniversalWidgets() )
+ if ( usingUniversal )
ret += wxT("/wxUniversal");
return ret;
}
-wxString wxPlatformInfo::GetPortIdShortName(wxPortId port)
+wxString wxPlatformInfo::GetPortIdShortName(wxPortId port, bool usingUniversal)
{
const unsigned idx = wxGetIndexFromEnumValue(port);
wxString ret = wxPortIdNames[idx];
ret = ret.Mid(2).Lower(); // remove 'wx' prefix
- if ( IsUsingUniversalWidgets() )
+ if ( usingUniversal )
ret += wxT("univ");
return ret;
if ( wxPortIdNames[i].CmpNoCase(str) == 0 )
return current;
- if ( GetPortIdShortName(current).CmpNoCase(str) == 0 )
+ if ( GetPortIdShortName(current, true).CmpNoCase(str) == 0 ||
+ GetPortIdShortName(current, false).CmpNoCase(str) == 0 )
return current;
}