Equalizer  2.1.0
Parallel Rendering Framework
qt/window.h
1 
2 /* Copyright (c) 2014-2016, 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 <QObject> // base class
24 #include <QScreen>
25 #include <eq/glWindow.h> // base class
26 #include <eq/qt/types.h>
27 
28 namespace eq
29 {
30 namespace qt
31 {
32 namespace detail
33 {
34 class Window;
35 }
36 
38 class WindowIF : public GLWindow
39 {
40 public:
41  WindowIF(NotifierInterface& parent, const WindowSettings& settings)
42  : GLWindow(parent, settings)
43  {
44  }
45  virtual ~WindowIF() {}
47  virtual bool processEvent(EventType type, QEvent*)
48  {
49  return GLWindow::processEvent(type);
50  }
51 
53  virtual bool processEvent(EventType type, QEvent*, SizeEvent& event)
54  {
55  return GLWindow::processEvent(type, event);
56  }
57 
59  virtual bool processEvent(EventType type, QEvent*, PointerEvent& event)
60  {
61  return GLWindow::processEvent(type, event);
62  }
63 
65  virtual bool processEvent(EventType type, QEvent*, KeyEvent& event)
66  {
67  return GLWindow::processEvent(type, event);
68  }
69 
71  virtual bool processEvent(EventType type)
72  {
73  return GLWindow::processEvent(type);
74  }
75 };
76 
78 class Window : public QObject, public WindowIF
79 {
80  Q_OBJECT
81 
82 public:
99  EQ_API Window(NotifierInterface& parent, const WindowSettings& settings,
100  QScreen* screen, QThread* thread);
101 
103  EQ_API ~Window() final;
104 
116  EQ_API bool configInit() override;
117 
119  EQ_API void configExit() override;
120 
122 
129  EQ_API QOpenGLContext* getContext() const;
130 
134  EQ_API void makeCurrent(const bool cache = true) const override;
135 
137  EQ_API void doneCurrent() const override;
138 
140  EQ_API void swapBuffers() override;
141 
143  EQ_API void joinNVSwapBarrier(const uint32_t group,
144  const uint32_t barrier) override;
145 
147  EQ_API void leaveNVSwapBarrier();
148 
150  EQ_API bool processEvent(EventType type, QEvent* qEvent,
151  SizeEvent& event) override;
153 
165  EQ_API QObject* getEventProcessor();
166 
168  void moveContextToThread(QThread* thread);
169 
170 signals:
171  void destroyImpl(detail::Window*);
172 
173 private:
174  detail::Window* const _impl;
175 
176  void _resize(const PixelViewport& pvp) override;
177 };
178 }
179 }
180 #endif // EQ_QT_WINDOW_H
virtual bool processEvent(EventType type, QEvent *, PointerEvent &event)
Process a mouse event.
Definition: qt/window.h:59
A set of settings to setup an eq::SystemWindow.
The interface defining the minimum functionality for a Qt window.
Definition: qt/window.h:38
Equalizer default implementation of a Qt window.
Definition: qt/window.h:78
virtual bool processEvent(EventType type, QEvent *)
Process a stateless event.
Definition: qt/window.h:47
A system window for OpenGL rendering.
Definition: glWindow.h:39
virtual bool processEvent(EventType type, QEvent *, SizeEvent &event)
Process a (re)size event.
Definition: qt/window.h:53
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:65
virtual bool processEvent(EventType type)
Process a stateless event.
Definition: qt/window.h:71