Equalizer  2.0.0
Parallel Rendering Framework
qt/window.h
1 
2 /* Copyright (c) 2014-2015, Daniel Nachbaur <danielnachbaur@gmail.com>
3  * Stefan.Eilemann@epfl.ch
4  * Juan Hernando <jhernando@fi.upm.es>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef EQ_QT_WINDOW_H
21 #define EQ_QT_WINDOW_H
22 
23 #include <eq/qt/types.h>
24 #include <eq/glWindow.h> // base class
25 #include <QObject> // base class
26 #include <QScreen>
27 
28 namespace eq
29 {
30 namespace qt
31 {
32 namespace detail { class Window; }
33 
35 class WindowIF : public GLWindow
36 {
37 public:
38  WindowIF( NotifierInterface& parent,
39  const WindowSettings& settings ) : GLWindow( parent, settings ) {}
40  virtual ~WindowIF() {}
41 
43  virtual bool processEvent( EventType type, QEvent* )
44  { return GLWindow::processEvent( type ); }
45 
47  virtual bool processEvent( EventType type, QEvent*, SizeEvent& event )
48  { return GLWindow::processEvent( type, event ); }
49 
51  virtual bool processEvent( EventType type, QEvent*, PointerEvent& event )
52  { return GLWindow::processEvent( type, event ); }
53 
55  virtual bool processEvent( EventType type, QEvent*, KeyEvent& event )
56  { return GLWindow::processEvent( type, event ); }
57 
59  virtual bool processEvent( EventType type )
60  { return GLWindow::processEvent( type ); }
61 };
62 
64 class Window : public QObject, public WindowIF
65 {
66  Q_OBJECT
67 
68 public:
85  EQ_API Window( NotifierInterface& parent, const WindowSettings& settings,
86  QScreen* screen, QThread* thread );
87 
89  EQ_API ~Window() final;
90 
102  EQ_API bool configInit() override;
103 
105  EQ_API void configExit() override;
106 
108 
115  EQ_API QOpenGLContext* getContext() const;
116 
120  EQ_API void makeCurrent( const bool cache = true ) const override;
121 
123  EQ_API void doneCurrent() const override;
124 
126  EQ_API void swapBuffers() override;
127 
129  EQ_API void joinNVSwapBarrier( const uint32_t group,
130  const uint32_t barrier ) override;
131 
133  EQ_API void leaveNVSwapBarrier();
134 
136  EQ_API bool processEvent( EventType type, QEvent* qEvent, SizeEvent& event )
137  override;
139 
151  EQ_API QObject* getEventProcessor();
152 
154  void moveContextToThread( QThread* thread );
155 
156 signals:
157  void destroyImpl( detail::Window* );
158 
159 private:
160  detail::Window* const _impl;
161 };
162 }
163 }
164 #endif // EQ_QT_WINDOW_H
virtual bool processEvent(EventType type, QEvent *, PointerEvent &event)
Process a mouse event.
Definition: qt/window.h:51
A set of settings to setup an eq::SystemWindow.
The interface defining the minimum functionality for a Qt window.
Definition: qt/window.h:35
Equalizer default implementation of a Qt window.
Definition: qt/window.h:64
virtual bool processEvent(EventType type, QEvent *)
Process a stateless event.
Definition: qt/window.h:43
A system window for OpenGL rendering.
Definition: glWindow.h:36
virtual bool processEvent(EventType type, QEvent *, SizeEvent &event)
Process a (re)size event.
Definition: qt/window.h:47
A base class for notifying errors and events.
EQ_API bool processEvent(EventType type)
Process a stateless event.
The Equalizer client library.
Definition: eq/agl/types.h:23
virtual bool processEvent(EventType type, QEvent *, KeyEvent &event)
Process a keyboard event.
Definition: qt/window.h:55
virtual bool processEvent(EventType type)
Process a stateless event.
Definition: qt/window.h:59