* nanox.c
*
* Replacements for some comomon Xlib functions
+ * Licence: The wxWindows licence
*/
#include "wx/setup.h"
#if wxUSE_NANOX
-#ifdef __GNUG__
-#pragma implementation "Xlib.h"
-#endif
-
#include <ctype.h>
#include <malloc.h>
#include <string.h>
+#include <stdio.h>
#include "wx/defs.h"
#include "wx/x11/nanox/X11/Xlib.h"
XWindowAttributes* window_attributes)
{
GR_WINDOW_INFO info;
+ Window parent = 0;
+ GrFlush();
GrGetWindowInfo(w, & info);
window_attributes->x = info.x;
window_attributes->override_redirect = FALSE;
window_attributes->screen = NULL;
+ /* We need to check if any parents are unmapped,
+ * or we will report a window as mapped when it is not.
+ */
+ parent = info.parent;
+ while (parent)
+ {
+ GrGetWindowInfo(parent, & info);
+ if (info.mapped == 0)
+ window_attributes->map_state = IsUnmapped;
+
+ parent = info.parent;
+ }
+
return 1;
}
static XErrorHandler* g_ErrorHandler = NULL;
-static void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep)
+void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep)
{
if (g_ErrorHandler)
{
XFontStruct* fontInfo = malloc(sizeof(XFontStruct));
fontInfo->fid = GrCreateFont(fontName, 0, 0);
GrGetFontInfo(fontInfo->fid, & fontInfo->info);
+ printf("Warning: should not call XLoadQueryFont since font spec is not used in Nano-X.\n");
return fontInfo;
}
return 1;
}
+/* Should not really be necessary but in no-optimize mode
+ * gcc complains that wxNoop is not found if wxNoop is inline.
+ */
+
+void wxNoop()
+{
+}
+
#endif
/* wxUSE_NANOX */