#include <netdb.h>
#include <signal.h>
-#ifdef __SVR4__
+#if defined(__SVR4__) && !defined(__HPUX__)
#include <sys/systeminfo.h>
#endif
+#if (defined(__SUNCC__) || defined(__CLCC__))
+#include <sysent.h>
+#endif
+
#include <Xm/Xm.h>
#include "wx/motif/private.h"
// Get full hostname (eg. DoDo.BSn-Germany.crg.de)
bool wxGetHostName(char *buf, int maxSize)
{
-#if defined(SVR4) && !defined(__hpux)
+#if defined(__SVR4__) && !defined(__HPUX__)
return (sysinfo (SI_HOSTNAME, buf, maxSize) != -1);
#else /* BSD Sockets */
char name[255];
wxNode *node = wxResourceCache.First ();
while (node)
{
- char *file = node->key.string;
+ const char *file = node->GetKeyString();
// If file doesn't exist, create it first.
(void)GetResourcePath(nameBuffer, file, TRUE);
size_t len;
environment = GetIniFile (filename, NULL);
len = strlen (environment);
-#if defined(SVR4) && !defined(__hpux)
+#if defined(__SVR4__) && !defined(__HPUX__)
(void) sysinfo (SI_HOSTNAME, environment + len, 1024 - len);
#else
(void) gethostname (environment + len, 1024 - len);
XFlush (display);
- for(wxNode *node = win->GetChildren()->First (); node; node = node->Next())
+ for(wxNode *node = win->GetChildren().First (); node; node = node->Next())
{
wxWindow *child = (wxWindow *) node->Data ();
wxXSetBusyCursor (child, cursor);
return (wxBusyCursorCount > 0);
}
+const char* wxGetHomeDir( wxString *home )
+{
+ *home = wxGetUserHome( wxString() );
+ if (home->IsNull()) *home = "/";
+ return *home;
+};
+
char *wxGetUserHome (const wxString& user)
{
#ifdef VMS
}
+// These functions duplicate those in wxWindow, but are needed
+// for use outside of wxWindow (e.g. wxMenu, wxMenuBar).
+
+// Change a widget's foreground and background colours.
+
+void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour)
+{
+ // When should we specify the foreground, if it's calculated
+ // by wxComputeColours?
+ // Solution: say we start with the default (computed) foreground colour.
+ // If we call SetForegroundColour explicitly for a control or window,
+ // then the foreground is changed.
+ // Therefore SetBackgroundColour computes the foreground colour, and
+ // SetForegroundColour changes the foreground colour. The ordering is
+ // important.
+
+ XtVaSetValues ((Widget) widget,
+ XmNforeground, foregroundColour.AllocColour(XtDisplay((Widget) widget)),
+ NULL);
+}
+
+void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour)
+{
+ wxComputeColours (XtDisplay((Widget) widget), & backgroundColour,
+ (wxColour*) NULL);
+
+ XtVaSetValues ((Widget) widget,
+ XmNbackground, g_itemColors[wxBACK_INDEX].pixel,
+ XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel,
+ XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel,
+ XmNforeground, g_itemColors[wxFORE_INDEX].pixel,
+ NULL);
+
+ if (changeArmColour)
+ XtVaSetValues ((Widget) widget,
+ XmNarmColor, g_itemColors[wxSELE_INDEX].pixel,
+ NULL);
+}
+
+