Compilation fixes for Nano-X
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -411,6 +411,7 @@ int wxApp::MainLoop()
|
|||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !wxUSE_NANOX
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// X11 predicate function for exposure compression
|
// X11 predicate function for exposure compression
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@@ -442,6 +443,8 @@ static Bool expose_predicate (Display *display, XEvent *xevent, XPointer arg)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
// wxUSE_NANOX
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Processes an X event.
|
// Processes an X event.
|
||||||
|
@@ -26,8 +26,10 @@
|
|||||||
// data
|
// data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if !wxUSE_NANOX
|
||||||
Atom g_clipboardAtom = 0;
|
Atom g_clipboardAtom = 0;
|
||||||
Atom g_targetsAtom = 0;
|
Atom g_targetsAtom = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
// the trace mask we use with wxLogTrace() - call
|
// the trace mask we use with wxLogTrace() - call
|
||||||
// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here
|
// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here
|
||||||
@@ -290,10 +292,11 @@ wxClipboard::wxClipboard()
|
|||||||
/* we use m_targetsWidget to query what formats are available */
|
/* we use m_targetsWidget to query what formats are available */
|
||||||
|
|
||||||
/* we use m_clipboardWidget to get and to offer data */
|
/* we use m_clipboardWidget to get and to offer data */
|
||||||
|
#if !wxUSE_NANOX
|
||||||
if (!g_clipboardAtom) g_clipboardAtom = XInternAtom( (Display*) wxGetDisplay(), "CLIPBOARD", False );
|
if (!g_clipboardAtom) g_clipboardAtom = XInternAtom( (Display*) wxGetDisplay(), "CLIPBOARD", False );
|
||||||
if (!g_targetsAtom) g_targetsAtom = XInternAtom( (Display*) wxGetDisplay(), "TARGETS", False );
|
if (!g_targetsAtom) g_targetsAtom = XInternAtom( (Display*) wxGetDisplay(), "TARGETS", False );
|
||||||
|
#endif
|
||||||
|
|
||||||
m_formatSupported = FALSE;
|
m_formatSupported = FALSE;
|
||||||
m_targetRequested = 0;
|
m_targetRequested = 0;
|
||||||
|
|
||||||
@@ -377,6 +380,9 @@ bool wxClipboard::SetData( wxDataObject *data )
|
|||||||
|
|
||||||
bool wxClipboard::AddData( wxDataObject *data )
|
bool wxClipboard::AddData( wxDataObject *data )
|
||||||
{
|
{
|
||||||
|
#if wxUSE_NANOX
|
||||||
|
return FALSE;
|
||||||
|
#else
|
||||||
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
|
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
|
||||||
|
|
||||||
wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
|
wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
|
||||||
@@ -440,6 +446,7 @@ bool wxClipboard::AddData( wxDataObject *data )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxClipboard::Close()
|
void wxClipboard::Close()
|
||||||
|
@@ -97,11 +97,15 @@ wxDataFormatId wxDataFormat::GetType() const
|
|||||||
|
|
||||||
wxString wxDataFormat::GetId() const
|
wxString wxDataFormat::GetId() const
|
||||||
{
|
{
|
||||||
|
#if wxUSE_NANOX
|
||||||
|
return wxEmptyString;
|
||||||
|
#else
|
||||||
char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format);
|
char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format);
|
||||||
wxString ret( t ); // this will convert from ascii to Unicode
|
wxString ret( t ); // this will convert from ascii to Unicode
|
||||||
if (t)
|
if (t)
|
||||||
XFree( t );
|
XFree( t );
|
||||||
return ret;
|
return ret;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataFormat::SetId( NativeFormat format )
|
void wxDataFormat::SetId( NativeFormat format )
|
||||||
@@ -123,20 +127,24 @@ void wxDataFormat::SetId( NativeFormat format )
|
|||||||
|
|
||||||
void wxDataFormat::SetId( const wxChar *id )
|
void wxDataFormat::SetId( const wxChar *id )
|
||||||
{
|
{
|
||||||
|
#if !wxUSE_NANOX
|
||||||
PrepareFormats();
|
PrepareFormats();
|
||||||
m_type = wxDF_PRIVATE;
|
m_type = wxDF_PRIVATE;
|
||||||
wxString tmp( id );
|
wxString tmp( id );
|
||||||
m_format = XInternAtom( (Display*) wxGetDisplay(), wxMBSTRINGCAST tmp.mbc_str(), FALSE ); // what is the string cast for?
|
m_format = XInternAtom( (Display*) wxGetDisplay(), wxMBSTRINGCAST tmp.mbc_str(), FALSE ); // what is the string cast for?
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataFormat::PrepareFormats()
|
void wxDataFormat::PrepareFormats()
|
||||||
{
|
{
|
||||||
|
#if !wxUSE_NANOX
|
||||||
if (!g_textAtom)
|
if (!g_textAtom)
|
||||||
g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE );
|
g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE );
|
||||||
if (!g_pngAtom)
|
if (!g_pngAtom)
|
||||||
g_pngAtom = XInternAtom( (Display*) wxGetDisplay(), "image/png", FALSE );
|
g_pngAtom = XInternAtom( (Display*) wxGetDisplay(), "image/png", FALSE );
|
||||||
if (!g_fileAtom)
|
if (!g_fileAtom)
|
||||||
g_fileAtom = XInternAtom( (Display*) wxGetDisplay(), "text/uri-list", FALSE );
|
g_fileAtom = XInternAtom( (Display*) wxGetDisplay(), "text/uri-list", FALSE );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
@@ -87,7 +87,10 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
|
|||||||
|
|
||||||
XSetTransientForHint( xdisplay, xwindow, xparent );
|
XSetTransientForHint( xdisplay, xwindow, xparent );
|
||||||
|
|
||||||
#if !wxUSE_NANOX
|
#if wxUSE_NANOX
|
||||||
|
// Switch off WM
|
||||||
|
wxSetWMDecorations(xwindow, 0);
|
||||||
|
#else
|
||||||
XWMHints wm_hints;
|
XWMHints wm_hints;
|
||||||
wm_hints.flags = InputHint | StateHint /* | WindowGroupHint */;
|
wm_hints.flags = InputHint | StateHint /* | WindowGroupHint */;
|
||||||
wm_hints.input = True;
|
wm_hints.input = True;
|
||||||
|
@@ -148,12 +148,44 @@ 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 | ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
|
extraFlags |
|
||||||
ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask |
|
ExposureMask |
|
||||||
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
|
KeyPressMask |
|
||||||
PropertyChangeMask );
|
KeyReleaseMask |
|
||||||
|
ButtonPressMask |
|
||||||
|
ButtonReleaseMask |
|
||||||
|
ButtonMotionMask |
|
||||||
|
EnterWindowMask |
|
||||||
|
LeaveWindowMask |
|
||||||
|
PointerMotionMask |
|
||||||
|
KeymapStateMask |
|
||||||
|
FocusChangeMask |
|
||||||
|
ColormapChangeMask |
|
||||||
|
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 );
|
wxAddWindowToTable( xwindow, (wxWindow*) this );
|
||||||
|
|
||||||
// Set background to None which will prevent X11 from clearing the
|
// Set background to None which will prevent X11 from clearing the
|
||||||
@@ -189,7 +221,14 @@ 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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user