LCOV - code coverage report
Current view: top level - eq/client/glx - eventHandler.h (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 1 1 100.0 %
Date: 2014-06-18 Functions: 2 2 100.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2006-2014, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                    2014, Daniel Nachbaur <danielnachbaur@gmail.com>
       4             :  *
       5             :  * This library is free software; you can redistribute it and/or modify it under
       6             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       7             :  * by the Free Software Foundation.
       8             :  *
       9             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      10             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      11             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      12             :  * details.
      13             :  *
      14             :  * You should have received a copy of the GNU Lesser General Public License
      15             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      16             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      17             :  */
      18             : 
      19             : #ifndef EQ_GLX_EVENTHANDLER_H
      20             : #define EQ_GLX_EVENTHANDLER_H
      21             : 
      22             : #include <eq/client/glx/types.h>
      23             : #include <eq/client/eventHandler.h> // base class
      24             : #include <eq/client/types.h>
      25             : 
      26             : #include <lunchbox/thread.h> // thread-safety macro
      27             : 
      28             : namespace eq
      29             : {
      30             : namespace glx
      31             : {
      32             :     /** The event handler for glX/X11 windows. */
      33             :     class EventHandler : public eq::EventHandler
      34             :     {
      35             :     public:
      36             :         /** Construct a new glX event handler. @version 1.0 */
      37             :         EventHandler( WindowIF* window );
      38             : 
      39             :         /** Destruct the glX event handler. @version 1.0 */
      40             :         virtual ~EventHandler();
      41             : 
      42             :         /**
      43             :          * Dispatch all pending events on the current thread.
      44             :          *
      45             :          * If no event handlers have been constructed by the calling thread,
      46             :          * this function does nothing. This function does not block on events.
      47             :          * @version 1.0
      48             :          */
      49             :         static void dispatch();
      50             : 
      51             :     private:
      52             :         WindowIF* const _window;
      53             : 
      54             :         bool _magellanUsed; //!< Window registered with spnav
      55             : 
      56             :         void _dispatch();
      57             :         void _processEvent( WindowEvent& event );
      58             :         uint32_t _getButtonState( XEvent& event );
      59             :         uint32_t _getButtonAction( XEvent& event );
      60             :         uint32_t _getKey( XEvent& event );
      61             : 
      62          30 :         LB_TS_VAR( _thread );
      63             :     };
      64             : }
      65             : }
      66             : #endif // EQ_GLX_EVENTHANDLER_H

Generated by: LCOV version 1.10