Nano-X changes: removed spurious -O for Nano-X configuration;
got colour working in Nano-X (uses 8 bit RGB values, not 16 bit); now sets font background mode correctly; window management call correction git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1904,7 +1904,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
|
|||||||
|
|
||||||
if test "$wxUSE_NANOX" = "yes"; then
|
if test "$wxUSE_NANOX" = "yes"; then
|
||||||
TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
|
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"
|
GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
|
||||||
else
|
else
|
||||||
GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link"
|
GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link"
|
||||||
|
@@ -111,8 +111,6 @@ typedef struct {
|
|||||||
#define GXnand GR_MODE_NAND
|
#define GXnand GR_MODE_NAND
|
||||||
#define GXset GR_MODE_SET
|
#define GXset GR_MODE_SET
|
||||||
|
|
||||||
inline void wxNoop() { /* Do nothing */ }
|
|
||||||
|
|
||||||
#define XSynchronize(display,sync)
|
#define XSynchronize(display,sync)
|
||||||
#define XDefaultRootWindow(d) GR_ROOT_WINDOW_ID
|
#define XDefaultRootWindow(d) GR_ROOT_WINDOW_ID
|
||||||
#define RootWindowOfScreen(s) GR_ROOT_WINDOW_ID
|
#define RootWindowOfScreen(s) GR_ROOT_WINDOW_ID
|
||||||
@@ -344,6 +342,8 @@ Status XGetWindowAttributes(Display* display, Window w,
|
|||||||
int XConfigureWindow(Display* display, Window w, int mask, XWindowChanges* changes);
|
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);
|
int XTranslateCoordinates(Display* display, Window srcWindow, Window destWindow, int srcX, int srcY, int* destX, int* destY, Window* childReturn);
|
||||||
|
|
||||||
|
void wxNoop();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -381,9 +381,15 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour)
|
|||||||
if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour))
|
if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour))
|
||||||
return NULL;
|
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 r = (unsigned char)(xcolour.red >> 8);
|
||||||
unsigned char g = (unsigned char)(xcolour.green >> 8);
|
unsigned char g = (unsigned char)(xcolour.green >> 8);
|
||||||
unsigned char b = (unsigned char)(xcolour.blue >> 8);
|
unsigned char b = (unsigned char)(xcolour.blue >> 8);
|
||||||
|
#endif
|
||||||
|
|
||||||
wxColour *col = new wxColour(r, g, b);
|
wxColour *col = new wxColour(r, g, b);
|
||||||
Append(colour, col);
|
Append(colour, col);
|
||||||
|
@@ -468,6 +468,10 @@ void wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
if (!win)
|
if (!win)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
wxString windowClass = win->GetClassInfo()->GetClassName();
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
@@ -506,6 +510,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
if (event->update.utype == GR_UPDATE_SIZE)
|
if (event->update.utype == GR_UPDATE_SIZE)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
//wxLogDebug("ConfigureNotify: %s", windowClass.c_str());
|
||||||
wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
|
wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
|
||||||
sizeEvent.SetEventObject( win );
|
sizeEvent.SetEventObject( win );
|
||||||
|
|
||||||
@@ -515,6 +520,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
#if !wxUSE_NANOX
|
#if !wxUSE_NANOX
|
||||||
case PropertyNotify:
|
case PropertyNotify:
|
||||||
{
|
{
|
||||||
|
//wxLogDebug("PropertyNotify: %s", windowClass.c_str());
|
||||||
HandlePropertyChange(_event);
|
HandlePropertyChange(_event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -573,6 +579,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
#endif
|
#endif
|
||||||
case Expose:
|
case Expose:
|
||||||
{
|
{
|
||||||
|
//wxLogDebug("Expose: %s", windowClass.c_str());
|
||||||
win->GetUpdateRegion().Union( XExposeEventGetX(event), XExposeEventGetY(event),
|
win->GetUpdateRegion().Union( XExposeEventGetX(event), XExposeEventGetY(event),
|
||||||
XExposeEventGetWidth(event), XExposeEventGetHeight(event));
|
XExposeEventGetWidth(event), XExposeEventGetHeight(event));
|
||||||
|
|
||||||
|
@@ -137,9 +137,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
|
|||||||
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
||||||
{
|
{
|
||||||
m_refData = new wxColourRefData();
|
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.red = ((unsigned short)red) << SHIFT;
|
||||||
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
||||||
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
||||||
|
#endif
|
||||||
M_COLDATA->m_color.pixel = 0;
|
M_COLDATA->m_color.pixel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,9 +215,15 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue )
|
|||||||
AllocExclusive();
|
AllocExclusive();
|
||||||
|
|
||||||
m_refData = new wxColourRefData();
|
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.red = ((unsigned short)red) << SHIFT;
|
||||||
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
||||||
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
||||||
|
#endif
|
||||||
M_COLDATA->m_color.pixel = 0;
|
M_COLDATA->m_color.pixel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,21 +231,33 @@ unsigned char wxColour::Red() const
|
|||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
|
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);
|
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Green() const
|
unsigned char wxColour::Green() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
|
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);
|
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Blue() const
|
unsigned char wxColour::Blue() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
|
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);
|
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::CalcPixel( WXColormap cmap )
|
void wxColour::CalcPixel( WXColormap cmap )
|
||||||
|
@@ -255,6 +255,11 @@ void wxWindowDC::SetUpDC()
|
|||||||
|
|
||||||
XSetFillStyle( (Display*) m_display, (GC) m_textGC, FillSolid );
|
XSetFillStyle( (Display*) m_display, (GC) m_textGC, FillSolid );
|
||||||
|
|
||||||
|
#if wxUSE_NANOX
|
||||||
|
// By default, draw transparently
|
||||||
|
GrSetGCUseBackground((GC) m_textGC, FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* m_penGC */
|
/* m_penGC */
|
||||||
m_pen.GetColour().CalcPixel( m_cmap );
|
m_pen.GetColour().CalcPixel( m_cmap );
|
||||||
XSetForeground( (Display*) m_display, (GC) m_penGC, m_pen.GetColour().GetPixel() );
|
XSetForeground( (Display*) m_display, (GC) m_penGC, m_pen.GetColour().GetPixel() );
|
||||||
@@ -1714,6 +1719,10 @@ void wxWindowDC::SetBackgroundMode( int mode )
|
|||||||
|
|
||||||
m_backgroundMode = mode;
|
m_backgroundMode = mode;
|
||||||
|
|
||||||
|
#if wxUSE_NANOX
|
||||||
|
GrSetGCUseBackground((GC) m_textGC, mode == wxTRANSPARENT ? FALSE : TRUE);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!m_window) return;
|
if (!m_window) return;
|
||||||
|
|
||||||
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
|
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
|
||||||
|
@@ -433,5 +433,13 @@ int XTranslateCoordinates(Display* display, Window srcWindow, Window destWindow,
|
|||||||
return 1;
|
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
|
#endif
|
||||||
/* wxUSE_NANOX */
|
/* wxUSE_NANOX */
|
||||||
|
@@ -101,6 +101,18 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
|
|||||||
m_backgroundColour.CalcPixel( (WXColormap) cm );
|
m_backgroundColour.CalcPixel( (WXColormap) cm );
|
||||||
m_hasBgCol = TRUE;
|
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
|
#if !wxUSE_NANOX
|
||||||
XSetWindowAttributes xattributes;
|
XSetWindowAttributes xattributes;
|
||||||
XSizeHints size_hints;
|
XSizeHints size_hints;
|
||||||
@@ -118,18 +130,6 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
|
|||||||
xattributes.override_redirect = False;
|
xattributes.override_redirect = False;
|
||||||
#endif
|
#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
|
#if wxUSE_NANOX
|
||||||
long backColor, foreColor;
|
long backColor, foreColor;
|
||||||
backColor = GR_RGB(m_backgroundColour.Red(), m_backgroundColour.Green(), m_backgroundColour.Blue());
|
backColor = GR_RGB(m_backgroundColour.Red(), m_backgroundColour.Green(), m_backgroundColour.Blue());
|
||||||
@@ -148,7 +148,6 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
|
|||||||
extraFlags |= GR_EVENT_MASK_CLOSE_REQ;
|
extraFlags |= GR_EVENT_MASK_CLOSE_REQ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_NANOX
|
|
||||||
XSelectInput( xdisplay, xwindow,
|
XSelectInput( xdisplay, xwindow,
|
||||||
extraFlags |
|
extraFlags |
|
||||||
ExposureMask |
|
ExposureMask |
|
||||||
@@ -166,25 +165,6 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
|
|||||||
StructureNotifyMask |
|
StructureNotifyMask |
|
||||||
PropertyChangeMask
|
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 );
|
wxAddWindowToTable( xwindow, (wxWindow*) this );
|
||||||
|
|
||||||
@@ -221,14 +201,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
|
|||||||
XSetWMProtocols( xdisplay, xwindow, wm_protocols, 2);
|
XSetWMProtocols( xdisplay, xwindow, wm_protocols, 2);
|
||||||
#endif
|
#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);
|
wxSetWMDecorations( xwindow, style);
|
||||||
#endif
|
|
||||||
|
|
||||||
SetTitle(title);
|
SetTitle(title);
|
||||||
|
|
||||||
@@ -423,6 +396,7 @@ bool wxSetWMDecorations(Window w, long style)
|
|||||||
GR_WM_PROPERTIES wmProp;
|
GR_WM_PROPERTIES wmProp;
|
||||||
|
|
||||||
wmProp.flags = 0;
|
wmProp.flags = 0;
|
||||||
|
wmProp.props = 0;
|
||||||
|
|
||||||
if (style & wxRESIZE_BORDER)
|
if (style & wxRESIZE_BORDER)
|
||||||
{
|
{
|
||||||
|
@@ -960,6 +960,7 @@ void wxWindowX11::Update()
|
|||||||
{
|
{
|
||||||
if (!m_updateRegion.IsEmpty())
|
if (!m_updateRegion.IsEmpty())
|
||||||
{
|
{
|
||||||
|
// wxLogDebug("wxWindowX11::Update: %s", GetClassInfo()->GetClassName());
|
||||||
// Actually send erase events.
|
// Actually send erase events.
|
||||||
SendEraseEvents();
|
SendEraseEvents();
|
||||||
|
|
||||||
@@ -1024,7 +1025,6 @@ void wxWindowX11::SendPaintEvents()
|
|||||||
GetEventHandler()->ProcessEvent( paint_event );
|
GetEventHandler()->ProcessEvent( paint_event );
|
||||||
|
|
||||||
m_updateRegion.Clear();
|
m_updateRegion.Clear();
|
||||||
|
|
||||||
m_clipPaintRegion = FALSE;
|
m_clipPaintRegion = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user