Remove (now) pointless checks for __WXX11__/__WXMOTIF__ in
src/x11/utils.cpp and src/motif/utils.cpp. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -37,7 +37,6 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
// #include <netdb.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#if (defined(__SUNCC__) || defined(__CLCC__))
|
#if (defined(__SUNCC__) || defined(__CLCC__))
|
||||||
@@ -50,14 +49,8 @@
|
|||||||
|
|
||||||
#include "wx/unix/execute.h"
|
#include "wx/unix/execute.h"
|
||||||
|
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
#include <Xm/Xm.h>
|
#include <Xm/Xm.h>
|
||||||
#include "wx/motif/private.h"
|
#include "wx/motif/private.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __WXX11__
|
|
||||||
#include "wx/x11/private.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if wxUSE_RESOURCES
|
#if wxUSE_RESOURCES
|
||||||
#include "X11/Xresource.h"
|
#include "X11/Xresource.h"
|
||||||
@@ -100,7 +93,6 @@ void wxFlushEvents()
|
|||||||
|
|
||||||
XSync (display, FALSE);
|
XSync (display, FALSE);
|
||||||
|
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
// XtAppPending returns availability of events AND timers/inputs, which
|
// XtAppPending returns availability of events AND timers/inputs, which
|
||||||
// are processed via callbacks, so XtAppNextEvent will not return if
|
// are processed via callbacks, so XtAppNextEvent will not return if
|
||||||
// there are no events. So added '& XtIMXEvent' - Sergey.
|
// there are no events. So added '& XtIMXEvent' - Sergey.
|
||||||
@@ -110,18 +102,13 @@ void wxFlushEvents()
|
|||||||
// Jan Lessner: works better when events are non-X events
|
// Jan Lessner: works better when events are non-X events
|
||||||
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMXEvent);
|
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMXEvent);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
// TODO for X11
|
|
||||||
// ??
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
// Check whether this window wants to process messages, e.g. Stop button
|
// Check whether this window wants to process messages, e.g. Stop button
|
||||||
// in long calculations.
|
// in long calculations.
|
||||||
bool wxCheckForInterrupt(wxWindow *wnd)
|
bool wxCheckForInterrupt(wxWindow *wnd)
|
||||||
{
|
{
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
wxCHECK_MSG( wnd, FALSE, "NULL window in wxCheckForInterrupt" );
|
wxCHECK_MSG( wnd, FALSE, "NULL window in wxCheckForInterrupt" );
|
||||||
|
|
||||||
Display *dpy=(Display*) wnd->GetXDisplay();
|
Display *dpy=(Display*) wnd->GetXDisplay();
|
||||||
@@ -148,16 +135,13 @@ bool wxCheckForInterrupt(wxWindow *wnd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return hadEvents;
|
return hadEvents;
|
||||||
#else
|
|
||||||
wxASSERT_MSG(FALSE, "wxCheckForInterrupt not yet implemented.");
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxExecute stuff
|
// wxExecute stuff
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
static void xt_notify_end_process(XtPointer data, int *WXUNUSED(fid),
|
static void xt_notify_end_process(XtPointer data, int *WXUNUSED(fid),
|
||||||
XtInputId *id)
|
XtInputId *id)
|
||||||
{
|
{
|
||||||
@@ -170,11 +154,9 @@ static void xt_notify_end_process(XtPointer data, int *WXUNUSED(fid),
|
|||||||
|
|
||||||
XtRemoveInput(*id);
|
XtRemoveInput(*id);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
|
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
|
||||||
{
|
{
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
XtInputId id = XtAppAddInput((XtAppContext) wxTheApp->GetAppContext(),
|
XtInputId id = XtAppAddInput((XtAppContext) wxTheApp->GetAppContext(),
|
||||||
fd,
|
fd,
|
||||||
(XtPointer *) XtInputReadMask,
|
(XtPointer *) XtInputReadMask,
|
||||||
@@ -182,11 +164,6 @@ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
|
|||||||
(XtPointer) proc_data);
|
(XtPointer) proc_data);
|
||||||
|
|
||||||
return (int)id;
|
return (int)id;
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
// TODO
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -202,7 +179,6 @@ void wxBell()
|
|||||||
|
|
||||||
int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
||||||
{
|
{
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
// FIXME TODO
|
// FIXME TODO
|
||||||
// This code is WRONG!! Does NOT return the
|
// This code is WRONG!! Does NOT return the
|
||||||
// Motif version of the libs but the X protocol
|
// Motif version of the libs but the X protocol
|
||||||
@@ -214,14 +190,6 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
|||||||
*minorVsn = ProtocolRevision (display);
|
*minorVsn = ProtocolRevision (display);
|
||||||
|
|
||||||
return wxMOTIF_X;
|
return wxMOTIF_X;
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
if (majorVsn)
|
|
||||||
*majorVsn = 0;
|
|
||||||
if (minorVsn)
|
|
||||||
*minorVsn = 0;
|
|
||||||
return wxX11;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -646,16 +614,11 @@ WXDisplay *wxGetDisplay()
|
|||||||
{
|
{
|
||||||
if (gs_currentDisplay)
|
if (gs_currentDisplay)
|
||||||
return gs_currentDisplay;
|
return gs_currentDisplay;
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
if (wxTheApp && wxTheApp->GetTopLevelWidget())
|
if (wxTheApp && wxTheApp->GetTopLevelWidget())
|
||||||
return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
|
return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
|
||||||
else if (wxTheApp)
|
else if (wxTheApp)
|
||||||
return wxTheApp->GetInitialDisplay();
|
return wxTheApp->GetInitialDisplay();
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
return wxApp::GetDisplay();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSetDisplay(const wxString& display_name)
|
bool wxSetDisplay(const wxString& display_name)
|
||||||
@@ -670,7 +633,6 @@ bool wxSetDisplay(const wxString& display_name)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
Cardinal argc = 0;
|
Cardinal argc = 0;
|
||||||
|
|
||||||
Display *display = XtOpenDisplay((XtAppContext) wxTheApp->GetAppContext(),
|
Display *display = XtOpenDisplay((XtAppContext) wxTheApp->GetAppContext(),
|
||||||
@@ -692,18 +654,6 @@ bool wxSetDisplay(const wxString& display_name)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
Display* display = XOpenDisplay((char*) display_name.c_str());
|
|
||||||
|
|
||||||
if (display)
|
|
||||||
{
|
|
||||||
gs_currentDisplay = (WXDisplay*) display;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1103,7 +1053,6 @@ wxString wxGetXEventName(XEvent& event)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// accelerators
|
// accelerators
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1208,9 +1157,6 @@ XmString wxFindAcceleratorText (const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// These functions duplicate those in wxWindow, but are needed
|
|
||||||
// for use outside of wxWindow (e.g. wxMenu, wxMenuBar).
|
|
||||||
|
|
||||||
// Change a widget's foreground and background colours.
|
// Change a widget's foreground and background colours.
|
||||||
|
|
||||||
void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour)
|
void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour)
|
||||||
@@ -1259,9 +1205,6 @@ extern void wxDoChangeFont(WXWidget widget, wxFont& font)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
// __WXMOTIF__
|
|
||||||
|
|
||||||
bool wxWindowIsVisible(Window win)
|
bool wxWindowIsVisible(Window win)
|
||||||
{
|
{
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
|
@@ -66,56 +66,14 @@ void wxFlushEvents()
|
|||||||
|
|
||||||
XSync (display, FALSE);
|
XSync (display, FALSE);
|
||||||
|
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
// XtAppPending returns availability of events AND timers/inputs, which
|
|
||||||
// are processed via callbacks, so XtAppNextEvent will not return if
|
|
||||||
// there are no events. So added '& XtIMXEvent' - Sergey.
|
|
||||||
while (XtAppPending ((XtAppContext) wxTheApp->GetAppContext()) & XtIMXEvent)
|
|
||||||
{
|
|
||||||
XFlush (XtDisplay ((Widget) wxTheApp->GetTopLevelWidget()));
|
|
||||||
// Jan Lessner: works better when events are non-X events
|
|
||||||
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMXEvent);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
// TODO for X11
|
// TODO for X11
|
||||||
// ??
|
// ??
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCheckForInterrupt(wxWindow *wnd)
|
bool wxCheckForInterrupt(wxWindow *wnd)
|
||||||
{
|
{
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
wxCHECK_MSG( wnd, FALSE, "NULL window in wxCheckForInterrupt" );
|
|
||||||
|
|
||||||
Display *dpy=(Display*) wnd->GetXDisplay();
|
|
||||||
Window win=(Window) wnd->GetXWindow();
|
|
||||||
XEvent event;
|
|
||||||
XFlush(dpy);
|
|
||||||
if (wnd->GetMainWidget())
|
|
||||||
{
|
|
||||||
XmUpdateDisplay((Widget)(wnd->GetMainWidget()));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hadEvents = FALSE;
|
|
||||||
while( XCheckMaskEvent(dpy,
|
|
||||||
ButtonPressMask|ButtonReleaseMask|ButtonMotionMask|
|
|
||||||
PointerMotionMask|KeyPressMask|KeyReleaseMask,
|
|
||||||
&event) )
|
|
||||||
{
|
|
||||||
if ( event.xany.window == win )
|
|
||||||
{
|
|
||||||
hadEvents = TRUE;
|
|
||||||
|
|
||||||
XtDispatchEvent(&event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return hadEvents;
|
|
||||||
#else
|
|
||||||
wxASSERT_MSG(FALSE, "wxCheckForInterrupt not yet implemented.");
|
wxASSERT_MSG(FALSE, "wxCheckForInterrupt not yet implemented.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -124,19 +82,8 @@ bool wxCheckForInterrupt(wxWindow *wnd)
|
|||||||
|
|
||||||
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
|
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
|
||||||
{
|
{
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
XtInputId id = XtAppAddInput((XtAppContext) wxTheApp->GetAppContext(),
|
|
||||||
fd,
|
|
||||||
(XtPointer *) XtInputReadMask,
|
|
||||||
(XtInputCallbackProc) xt_notify_end_process,
|
|
||||||
(XtPointer) proc_data);
|
|
||||||
|
|
||||||
return (int)id;
|
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
// TODO
|
// TODO
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -152,7 +99,6 @@ void wxBell()
|
|||||||
|
|
||||||
int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
||||||
{
|
{
|
||||||
#ifdef __WXX11__
|
|
||||||
if (majorVsn)
|
if (majorVsn)
|
||||||
*majorVsn = 0;
|
*majorVsn = 0;
|
||||||
|
|
||||||
@@ -160,7 +106,6 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
|||||||
*minorVsn = 0;
|
*minorVsn = 0;
|
||||||
|
|
||||||
return wxX11;
|
return wxX11;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -242,16 +187,7 @@ WXDisplay *wxGetDisplay()
|
|||||||
{
|
{
|
||||||
if (gs_currentDisplay)
|
if (gs_currentDisplay)
|
||||||
return gs_currentDisplay;
|
return gs_currentDisplay;
|
||||||
#ifdef __WXMOTIF__
|
|
||||||
if (wxTheApp && wxTheApp->GetTopLevelWidget())
|
|
||||||
return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
|
|
||||||
else if (wxTheApp)
|
|
||||||
return wxTheApp->GetInitialDisplay();
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
#ifdef __WXX11__
|
|
||||||
return wxApp::GetDisplay();
|
return wxApp::GetDisplay();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSetDisplay(const wxString& display_name)
|
bool wxSetDisplay(const wxString& display_name)
|
||||||
|
Reference in New Issue
Block a user