+
+
+
+// ----------------------------------------------------------------------------
+// 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()
+{
+ Display *dpy;
+ SmcConn smc_conn;
+ char *vendor;
+ char *client_id_ret;
+ dpy = XOpenDisplay(NULL);
+
+ smc_conn = SmcOpenConnection(NULL, NULL,
+ 999, 999,
+ 0 /* mask */, NULL /* callbacks */,
+ NULL, &client_id_ret, 0, NULL);
+
+ vendor = SmcVendor(smc_conn);
+ wxString ret = wxString::FromAscii( vendor );
+ free(vendor);
+
+ SmcCloseConnection(smc_conn, 0, NULL);
+ free(client_id_ret);
+
+ XCloseDisplay(dpy);
+
+ return ret;
+}
+#endif
+
+wxString wxGUIAppTraits::GetDesktopEnvironment() const
+{
+#if wxUSE_DETECT_SM
+ wxString SM = GetSM();
+
+ if (SM == wxT("GnomeSM"))
+ return wxT("GNOME");
+
+ if (SM == wxT("KDE"))
+ return wxT("KDE");
+#endif
+
+ return wxEmptyString;
+}
+
+
+