#pragma message enable nosimpint
#endif
-#ifdef __WXGTK20__
+#ifdef __WXGTK__
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#endif
// Suspends X11 errors. Used when we expect errors but they are not fatal
// for us.
+extern "C" {
+ static int wxX11ErrorsSuspender_handler(Display*, XErrorEvent*) { return 0; }
+}
class wxX11ErrorsSuspender
{
public:
wxX11ErrorsSuspender(Display *d) : m_display(d)
{
- m_old = XSetErrorHandler(handler);
+ m_old = XSetErrorHandler(wxX11ErrorsSuspender_handler);
}
~wxX11ErrorsSuspender()
{
private:
Display *m_display;
int (*m_old)(Display*, XErrorEvent *);
- static int handler(Display *, XErrorEvent *) { return 0; }
};
bool wxGetKeyState(wxKeyCode key)
{
+ wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+ WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
#if defined(__WXX11__)
- Display *pDisplay = wxApp::GetDisplay();
+ Display *pDisplay = (Display*) wxApp::GetDisplay();
#elif defined(__WXGTK__)
Display *pDisplay = GDK_DISPLAY();
+#elif defined(__WXMOTIF__)
+ Display *pDisplay = (Display*) (wxTheApp ? wxTheApp->GetInitialDisplay() : NULL);
#else
#error Add code to get the DISPLAY for this platform
#endif