if test "$wxUSE_NANOX" = "yes"; then
TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
- TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DLINUX=1 -DUNIX=1 -O -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
+ TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DLINUX=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
else
GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link"
#define GXnand GR_MODE_NAND
#define GXset GR_MODE_SET
-inline void wxNoop() { /* Do nothing */ }
-
#define XSynchronize(display,sync)
#define XDefaultRootWindow(d) GR_ROOT_WINDOW_ID
#define RootWindowOfScreen(s) GR_ROOT_WINDOW_ID
int XConfigureWindow(Display* display, Window w, int mask, XWindowChanges* changes);
int XTranslateCoordinates(Display* display, Window srcWindow, Window destWindow, int srcX, int srcY, int* destX, int* destY, Window* childReturn);
+void wxNoop();
+
#ifdef __cplusplus
}
#endif
if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour))
return NULL;
+#if wxUSE_NANOX
+ unsigned char r = (unsigned char)(xcolour.red);
+ unsigned char g = (unsigned char)(xcolour.green);
+ unsigned char b = (unsigned char)(xcolour.blue);
+#else
unsigned char r = (unsigned char)(xcolour.red >> 8);
unsigned char g = (unsigned char)(xcolour.green >> 8);
unsigned char b = (unsigned char)(xcolour.blue >> 8);
-
+#endif
+
wxColour *col = new wxColour(r, g, b);
Append(colour, col);
wxWindow* win = NULL;
Window window = XEventGetWindow(event);
Window actualWindow = window;
-
+
// Find the first wxWindow that corresponds to this event window
// Because we're receiving events after a window
// has been destroyed, assume a 1:1 match between
if (!win)
return;
+#ifdef __WXDEBUG__
+ wxString windowClass = win->GetClassInfo()->GetClassName();
+#endif
+
switch (event->type)
{
case KeyPress:
if (event->update.utype == GR_UPDATE_SIZE)
#endif
{
+ //wxLogDebug("ConfigureNotify: %s", windowClass.c_str());
wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
sizeEvent.SetEventObject( win );
#if !wxUSE_NANOX
case PropertyNotify:
{
+ //wxLogDebug("PropertyNotify: %s", windowClass.c_str());
HandlePropertyChange(_event);
return;
}
#endif
case Expose:
{
+ //wxLogDebug("Expose: %s", windowClass.c_str());
win->GetUpdateRegion().Union( XExposeEventGetX(event), XExposeEventGetY(event),
XExposeEventGetWidth(event), XExposeEventGetHeight(event));
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
{
m_refData = new wxColourRefData();
+#if wxUSE_NANOX
+ M_COLDATA->m_color.red = ((unsigned short)red) ;
+ M_COLDATA->m_color.green = ((unsigned short)green) ;
+ M_COLDATA->m_color.blue = ((unsigned short)blue) ;
+#else
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
+#endif
M_COLDATA->m_color.pixel = 0;
}
AllocExclusive();
m_refData = new wxColourRefData();
+#if wxUSE_NANOX
+ M_COLDATA->m_color.red = ((unsigned short)red) ;
+ M_COLDATA->m_color.green = ((unsigned short)green) ;
+ M_COLDATA->m_color.blue = ((unsigned short)blue) ;
+#else
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
+#endif
M_COLDATA->m_color.pixel = 0;
}
{
wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+#if wxUSE_NANOX
+ return (unsigned char) M_COLDATA->m_color.red ;
+#else
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
+#endif
}
unsigned char wxColour::Green() const
{
wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+#if wxUSE_NANOX
+ return (unsigned char) M_COLDATA->m_color.green ;
+#else
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
+#endif
}
unsigned char wxColour::Blue() const
{
wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+#if wxUSE_NANOX
+ return (unsigned char) M_COLDATA->m_color.blue ;
+#else
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
+#endif
}
void wxColour::CalcPixel( WXColormap cmap )
XSetFillStyle( (Display*) m_display, (GC) m_textGC, FillSolid );
+#if wxUSE_NANOX
+ // By default, draw transparently
+ GrSetGCUseBackground((GC) m_textGC, FALSE);
+#endif
+
/* m_penGC */
m_pen.GetColour().CalcPixel( m_cmap );
XSetForeground( (Display*) m_display, (GC) m_penGC, m_pen.GetColour().GetPixel() );
m_backgroundMode = mode;
+#if wxUSE_NANOX
+ GrSetGCUseBackground((GC) m_textGC, mode == wxTRANSPARENT ? FALSE : TRUE);
+#endif
+
if (!m_window) return;
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
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 */
m_backgroundColour.CalcPixel( (WXColormap) cm );
m_hasBgCol = TRUE;
+ wxSize size2(size);
+ if (size2.x == -1)
+ size2.x = 100;
+ if (size2.y == -1)
+ size2.y = 100;
+
+ wxPoint pos2(pos);
+ if (pos2.x == -1)
+ pos2.x = 100;
+ if (pos2.y == -1)
+ pos2.y = 100;
+
#if !wxUSE_NANOX
XSetWindowAttributes xattributes;
XSizeHints size_hints;
xattributes.override_redirect = False;
#endif
- wxSize size2(size);
- if (size2.x == -1)
- size2.x = 100;
- if (size2.y == -1)
- size2.y = 100;
-
- wxPoint pos2(pos);
- if (pos2.x == -1)
- pos2.x = 100;
- if (pos2.y == -1)
- pos2.y = 100;
-
#if wxUSE_NANOX
long backColor, foreColor;
backColor = GR_RGB(m_backgroundColour.Red(), m_backgroundColour.Green(), m_backgroundColour.Blue());
extraFlags |= GR_EVENT_MASK_CLOSE_REQ;
#endif
-#if wxUSE_NANOX
XSelectInput( xdisplay, xwindow,
extraFlags |
ExposureMask |
StructureNotifyMask |
PropertyChangeMask
);
-#else
- XSelectInput( xdisplay, xwindow,
- extraFlags |
- ExposureMask |
- KeyPressMask |
- KeyReleaseMask |
- ButtonPressMask |
- ButtonReleaseMask |
- ButtonMotionMask |
- EnterWindowMask |
- LeaveWindowMask |
- PointerMotionMask |
- KeymapStateMask |
- FocusChangeMask |
- ColormapChangeMask |
- StructureNotifyMask |
- PropertyChangeMask
- );
-#endif
wxAddWindowToTable( xwindow, (wxWindow*) this );
XSetWMProtocols( xdisplay, xwindow, wm_protocols, 2);
#endif
-#if 0 // wxUSE_NANOX
- GR_WM_PROPERTIES props;
- props.flags = GR_WM_FLAGS_TITLE;
- props.title = (GR_CHAR*) "Hello";
- GrSetWMProperties(xwindow, &props);
-#else
wxSetWMDecorations( xwindow, style);
-#endif
SetTitle(title);
GR_WM_PROPERTIES wmProp;
wmProp.flags = 0;
+ wmProp.props = 0;
if (style & wxRESIZE_BORDER)
{
{
if (!m_updateRegion.IsEmpty())
{
+ // wxLogDebug("wxWindowX11::Update: %s", GetClassInfo()->GetClassName());
// Actually send erase events.
SendEraseEvents();
wxEraseEvent erase_event( GetId(), &dc );
erase_event.SetEventObject( this );
-
+
if (!GetEventHandler()->ProcessEvent(erase_event))
{
Window xwindow = (Window) GetMainWindow();
wxPaintEvent paint_event( GetId() );
paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( paint_event );
-
- m_updateRegion.Clear();
+ m_updateRegion.Clear();
m_clipPaintRegion = FALSE;
}