+
+
+// ----------------------------------------------------------------------------
+// wxPlatformInfo-related
+// ----------------------------------------------------------------------------
+
+wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
+{
+ if ( verMaj )
+ *verMaj = gtk_major_version;
+ if ( verMin )
+ *verMin = gtk_minor_version;
+
+ return wxPORT_GTK;
+}
+
+#if wxUSE_DETECT_SM
+static wxString GetSM()
+{
+ class Dpy
+ {
+ public:
+ Dpy() { m_dpy = XOpenDisplay(NULL); }
+ ~Dpy() { if ( m_dpy ) XCloseDisplay(m_dpy); }
+
+ operator Display *() const { return m_dpy; }
+ private:
+ Display *m_dpy;
+ } dpy;
+
+ if ( !dpy )
+ return wxEmptyString;
+
+ char *client_id;
+ SmcConn smc_conn = SmcOpenConnection(NULL, NULL,
+ 999, 999,
+ 0 /* mask */, NULL /* callbacks */,
+ NULL, &client_id,
+ 0, NULL);
+
+ if ( !smc_conn )
+ return wxEmptyString;
+
+ char *vendor = SmcVendor(smc_conn);
+ wxString ret = wxString::FromAscii( vendor );
+ free(vendor);
+
+ SmcCloseConnection(smc_conn, 0, NULL);
+ free(client_id);
+
+ return ret;
+}
+#endif // wxUSE_DETECT_SM
+
+wxString wxGUIAppTraits::GetDesktopEnvironment() const
+{
+#if wxUSE_DETECT_SM
+ const wxString SM = GetSM();
+
+ if (SM == wxT("GnomeSM"))
+ return wxT("GNOME");
+
+ if (SM == wxT("KDE"))
+ return wxT("KDE");
+#endif // wxUSE_DETECT_SM
+
+ return wxEmptyString;
+}
+
+
+