#pragma message disable nosimpint
#endif
-#ifdef __WXMOTIF__
-#include <Xm/Xm.h>
-#endif
-
-#ifdef __VMS__
-#pragma message enable nosimpint
-#endif
-
#include "wx/unix/execute.h"
#ifdef __WXMOTIF__
+#include <Xm/Xm.h>
#include "wx/motif/private.h"
#endif
#include "wx/x11/private.h"
#endif
+#if wxUSE_RESOURCES
#include "X11/Xresource.h"
+#endif
+
#include "X11/Xutil.h"
+#ifdef __VMS__
+#pragma message enable nosimpint
+#endif
+
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
XtRemoveInput(*id);
}
+#endif
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
{
+#ifdef __WXMOTIF__
XtInputId id = XtAppAddInput((XtAppContext) wxTheApp->GetAppContext(),
fd,
(XtPointer *) XtInputReadMask,
(XtPointer) proc_data);
return (int)id;
-}
#endif
+#ifdef __WXX11__
+ // TODO
+ return 0;
+#endif
+}
// ----------------------------------------------------------------------------
// misc
void wxGetMousePosition( int* x, int* y )
{
+#if wxUSE_NANOX
+ // TODO
+ *x = 0;
+ *y = 0;
+#else
XMotionEvent xev;
Window root, child;
XQueryPointer((Display*) wxGetDisplay(),
&(xev.state));
*x = xev.x_root;
*y = xev.y_root;
+#endif
};
// Return TRUE if we have a colour display
return FALSE;
#endif
#ifdef __WXX11__
- Display* display = XOpenDisplay((const char*) display_name);
+ Display* display = XOpenDisplay((char*) display_name.c_str());
if (display)
{
void wxAllocNearestColor(Display *d,Colormap cmp,XColor *xc)
{
+#if !wxUSE_NANOX
int llp;
int screen = DefaultScreen(d);
*/
delete[] color_defs;
+#endif
}
void wxAllocColor(Display *d,Colormap cmp,XColor *xc)
}
}
+#ifdef __WXDEBUG__
+wxString wxGetXEventName(XEvent& event)
+{
+#if wxUSE_NANOX
+ wxString str(wxT("(some event)"));
+ return str;
+#else
+ int type = event.xany.type;
+ static char* event_name[] = {
+ "", "unknown(-)", // 0-1
+ "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", // 2-5
+ "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", // 6-9
+ "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", // 10-13
+ "NoExpose", "VisibilityNotify", "CreateNotify", // 14-16
+ "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest",// 17-20
+ "ReparentNotify", "ConfigureNotify", "ConfigureRequest", // 21-23
+ "GravityNotify", "ResizeRequest", "CirculateNotify", // 24-26
+ "CirculateRequest", "PropertyNotify", "SelectionClear", // 27-29
+ "SelectionRequest", "SelectionNotify", "ColormapNotify", // 30-32
+ "ClientMessage", "MappingNotify", // 33-34
+ "unknown(+)"}; // 35
+ type = wxMin(35, type); type = wxMax(1, type);
+ wxString str(event_name[type]);
+ return str;
+#endif
+}
+#endif
+
#ifdef __WXMOTIF__
// ----------------------------------------------------------------------------
// accelerators
*/
- wxBuffer[0] = '\0';
+ static char buf[256];
+ buf[0] = '\0';
char *tmp = copystring (s);
s = tmp;
char *p = tmp;
if (*p)
{
*p = '\0';
- if (wxBuffer[0])
- strcat (wxBuffer, " ");
+ if (buf[0])
+ strcat (buf, " ");
if (strcmp (s, "Alt"))
- strcat (wxBuffer, s);
+ strcat (buf, s);
else
- strcat (wxBuffer, "Meta");
+ strcat (buf, "Meta");
s = p++;
}
else
{
- strcat (wxBuffer, "<Key>");
- strcat (wxBuffer, s);
+ strcat (buf, "<Key>");
+ strcat (buf, s);
break;
}
}
delete[]tmp;
- return wxBuffer;
+ return buf;
#endif
}
#endif
// __WXMOTIF__
+
+bool wxWindowIsVisible(Window win)
+{
+ XWindowAttributes wa;
+ XGetWindowAttributes(wxGlobalDisplay(), win, &wa);
+
+ return (wa.map_state == IsViewable);
+}