// Author: Julian Smart
// Modified by:
// Created: 17/09/98
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
+// (c) 2013 Rob Bresalier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#pragma hdrstop
#endif
+#include "wx/private/eventloopsourcesmanager.h"
+
// ============================================================================
// declarations
// ============================================================================
#pragma message disable nosimpint
#endif
-#include "wx/unix/execute.h"
-
#include "wx/x11/private.h"
#include "X11/Xutil.h"
// ----------------------------------------------------------------------------
// Emit a beeeeeep
-#ifndef __EMX__
-// on OS/2, we use the wxBell from wxBase library (src/os2/utils.cpp)
void wxBell()
{
// Use current setting for the bell
XBell ((Display*) wxGetDisplay(), 0);
}
-#endif
wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
{
{
if (!XAllocColor(d,cmp,xc))
{
- // cout << "wxAllocColor : Warning : Can not allocate color, attempt find nearest !\n";
+ // cout << "wxAllocColor : Warning : Cannot allocate color, attempt find nearest !\n";
wxAllocNearestColor(d,cmp,xc);
}
}
-#ifdef __WXDEBUG__
wxString wxGetXEventName(XEvent& event)
{
#if wxUSE_NANOX
return str;
#else
int type = event.xany.type;
- static char* event_name[] = {
+ static const char* event_name[] = {
"", "unknown(-)", // 0-1
"KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", // 2-5
"MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", // 6-9
return wxString::FromAscii(event_name[type]);
#endif
}
-#endif
-bool wxWindowIsVisible(Window win)
+#if wxUSE_EVENTLOOP_SOURCE
+
+class wxX11EventLoopSourcesManager : public wxEventLoopSourcesManagerBase
{
- XWindowAttributes wa;
- XGetWindowAttributes(wxGlobalDisplay(), win, &wa);
+public:
+ wxEventLoopSource *
+ AddSourceForFD(int WXUNUSED(fd),
+ wxEventLoopSourceHandler* WXUNUSED(handler),
+ int WXUNUSED(flags))
+ {
+ wxFAIL_MSG("Monitoring FDs in the main loop is not implemented in wxX11");
- return (wa.map_state == IsViewable);
+ return NULL;
+ }
+};
+
+wxEventLoopSourcesManagerBase* wxGUIAppTraits::GetEventLoopSourcesManager()
+{
+ static wxX11EventLoopSourcesManager s_eventLoopSourcesManager;
+
+ return &s_eventLoopSourcesManager;
}
+
+#endif // wxUSE_EVENTLOOP_SOURCE