X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSVTK%2FSVTK_RenderWindowInteractor.cxx;h=c6278f7c2665cbe197a689dd12bafa7907d2a69f;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=55e3b3cb9c0f015812b3e07353191f2ef07a53a2;hpb=8d6a98a5c2f66655d1f4738afc7fffd914e59ad4;p=modules%2Fgui.git diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 55e3b3cb9..c6278f7c2 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -34,7 +34,7 @@ // QT Includes // Put Qt includes before the X11 includes which #define the symbol None // (see SVTK_SpaceMouse.h) to avoid the compilation error. -#ifndef WIN32 +#if !defined(WIN32) && !defined(__APPLE__) #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include #endif @@ -84,7 +84,7 @@ QVTK_RenderWindowInteractor myRenderWindow->Delete(); myRenderWindow->DoubleBufferOn(); -#ifndef WIN32 +#if !defined WIN32 && !defined __APPLE__ myRenderWindow->SetDisplayId((void*)QX11Info::display()); #endif myRenderWindow->SetWindowId((void*)winId()); @@ -112,7 +112,7 @@ QVTK_RenderWindowInteractor QVTK_RenderWindowInteractor ::~QVTK_RenderWindowInteractor() { -#ifndef WIN32 +#if !defined WIN32 && !defined __APPLE__ #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) SVTK_SpaceMouseX* aSpaceMouse = SVTK_SpaceMouseX::getInstance(); if ( aSpaceMouse && aSpaceMouse->isSpaceMouseOn() ) @@ -415,7 +415,7 @@ QVTK_RenderWindowInteractor { QWidget::focusInEvent( event ); -#ifndef WIN32 +#if !defined WIN32 && !defined __APPLE__ // register set space mouse events receiver #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) SVTK_SpaceMouseX* aSpaceMouse = SVTK_SpaceMouseX::getInstance(); @@ -451,7 +451,7 @@ QVTK_RenderWindowInteractor { QWidget::focusOutEvent( event ); -#ifndef WIN32 +#if !defined WIN32 && !defined __APPLE__ #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // unregister set space mouse events receiver SVTK_SpaceMouseX* aSpaceMouse = SVTK_SpaceMouseX::getInstance(); @@ -467,7 +467,7 @@ QVTK_RenderWindowInteractor // TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#ifdef WIN32 +#if defined(WIN32) /*! To handle native Win32 events (from such devices as SpaceMouse) @@ -478,8 +478,7 @@ bool QVTK_RenderWindowInteractor::winEvent( MSG* msg, long* result ) return QWidget::winEvent( msg, result); } -#else - +#elif !defined(__APPLE__) /*! To handle native X11 events (from such devices as SpaceMouse) */ @@ -513,14 +512,20 @@ QVTK_RenderWindowInteractor } #endif -#else + +#else // QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + bool QVTK_RenderWindowInteractor ::nativeEvent(const QByteArray& eventType, void* message, long* result) { +#if defined(WIN32) + // TODO: WIN32-related implementation +#elif !defined(__APPLE__) if ( eventType == "xcb_generic_event_t" ) { xcb_generic_event_t* ev = static_cast(message); #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + // TODO: this code is never called if ( SVTK_SpaceMouseX* aSpaceMouse = SVTK_SpaceMouseX::getInstance() ) #else if ( SVTK_SpaceMouseXCB* aSpaceMouse = SVTK_SpaceMouseXCB::getInstance() ) @@ -530,6 +535,7 @@ bool QVTK_RenderWindowInteractor { SVTK_SpaceMouse::MoveEvent anEvent; #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + // TODO: this code is never called int type = aSpaceMouse->translateEvent( QX11Info::display(), xEvent, &anEvent, 1.0, 1.0 ); #else int type = aSpaceMouse->translateEvent( QX11Info::connection(), (xcb_client_message_event_t*)ev, &anEvent, 1.0, 1.0 ); @@ -549,7 +555,7 @@ bool QVTK_RenderWindowInteractor } } } - +#endif return QWidget::nativeEvent( eventType, message, result ); } #endif