// headers
// ----------------------------------------------------------------------------
-#ifdef __VMS
-#define XtDisplay XTDISPLAY
-#endif
-
#include "wx/setup.h"
#include "wx/utils.h"
#include "wx/app.h"
#ifdef __VMS__
#pragma message disable nosimpint
#endif
-#include <Xm/Xm.h>
+
#ifdef __VMS__
#pragma message enable nosimpint
#endif
#include "wx/unix/execute.h"
-#include "wx/motif/private.h"
+#include "wx/x11/private.h"
+#include "X11/Xresource.h"
+#include "X11/Xutil.h"
// ----------------------------------------------------------------------------
// private functions
Display *display = (Display*) wxGetDisplay();
XSync (display, FALSE);
+ XFlush(display);
+ // TODO
+#if 0
+
// XtAppPending returns availability of events AND timers/inputs, which
// are processed via callbacks, so XtAppNextEvent will not return if
// there are no events. So added '& XtIMXEvent' - Sergey.
// Jan Lessner: works better when events are non-X events
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMXEvent);
}
+#endif
}
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
bool wxCheckForInterrupt(wxWindow *wnd)
{
+ wxASSERT_MSG(FALSE, "wxCheckForInterrupt not yet implemented.");
+ return FALSE;
+#if 0
wxCHECK_MSG( wnd, FALSE, "NULL window in wxCheckForInterrupt" );
Display *dpy=(Display*) wnd->GetXDisplay();
}
return hadEvents;
+#endif
}
// ----------------------------------------------------------------------------
// wxExecute stuff
// ----------------------------------------------------------------------------
-
+#if 0
static void xt_notify_end_process(XtPointer data, int *WXUNUSED(fid),
XtInputId *id)
{
return (int)id;
}
+#endif
// ----------------------------------------------------------------------------
// misc
int wxGetOsVersion(int *majorVsn, int *minorVsn)
{
+#if 0
// FIXME TODO
// This code is WRONG!! Does NOT return the
// Motif version of the libs but the X protocol
*minorVsn = ProtocolRevision (display);
return wxMOTIF_X;
+#else
+ if (majorVsn)
+ *majorVsn = 0;
+ if (minorVsn)
+ *minorVsn = 0;
+ return wxX11;
+#endif
}
// ----------------------------------------------------------------------------
}
-// Configurable display in Motif
+// Configurable display in X11
static WXDisplay *gs_currentDisplay = NULL;
static wxString gs_displayName;
{
if (gs_currentDisplay)
return gs_currentDisplay;
-
- if (wxTheApp && wxTheApp->GetTopLevelWidget())
- return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
else if (wxTheApp)
return wxTheApp->GetInitialDisplay();
else
{
gs_displayName = display_name;
- if ( !display_name )
+ if ( display_name.IsEmpty() )
{
gs_currentDisplay = NULL;
}
else
{
- Cardinal argc = 0;
-
- Display *display = XtOpenDisplay((XtAppContext) wxTheApp->GetAppContext(),
- (const char*) display_name,
- (const char*) wxTheApp->GetAppName(),
- (const char*) wxTheApp->GetClassName(),
- NULL,
-#if XtSpecificationRelease < 5
- 0, &argc,
-#else
- 0, (int *)&argc,
-#endif
- NULL);
+ Display* display = XOpenDisplay((const char*) display_name);
if (display)
{
#endif
}
-XmString wxFindAcceleratorText (const char *s)
-{
- // VZ: this function returns incorrect keysym which completely breaks kbd
- // handling
- return NULL;
-
-#if 0
- // The accelerator text is after the \t char.
- while (*s && *s != '\t')
- s++;
- if (*s == '\0')
- return (NULL);
- s++;
- XmString text = XmStringCreateSimple ((char *)s);
- return text;
-#endif
-}
-
// ----------------------------------------------------------------------------
// keycode translations
// ----------------------------------------------------------------------------
}
}
-
-// 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);
-}
-