Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
include/eq/client/qt/window.h
1 
2 /* Copyright (c) 2014, Daniel Nachbaur <danielnachbaur@gmail.com>
3  * 2014, Stefan.Eilemann@epfl.ch
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_QT_WINDOW_H
20 #define EQ_QT_WINDOW_H
21 
22 #include <eq/client/qt/types.h>
23 #include <eq/client/glWindow.h> // base class
24 #include <boost/function/function1.hpp> // used as parameter
25 
26 namespace eq
27 {
28 namespace qt
29 {
30 namespace detail { class Window; }
31 
33 class WindowIF : public GLWindow
34 {
35 public:
36  WindowIF( NotifierInterface& parent,
37  const WindowSettings& settings ) : GLWindow( parent, settings ) {}
38  ~WindowIF() override {}
39 
40 # pragma clang diagnostic push
41 # pragma clang diagnostic ignored "-Woverloaded-virtual"
42 
43  virtual bool processEvent( const WindowEvent& event ) = 0;
44 # pragma clang diagnostic pop
45 };
46 
48 class Window : public WindowIF
49 {
50 public:
55  typedef boost::function< void( QGLWidget* ) > DeleteGLWidgetFunc;
56 
64  Window( NotifierInterface& parent, const WindowSettings& settings,
65  QGLWidget* glWidget, DeleteGLWidgetFunc deleteGLWidget = 0 );
66 
68  ~Window() final;
69 
78  bool configInit() override;
79 
81  void configExit() override;
82 
84  EQ_API virtual void initEventHandler();
85 
87  EQ_API virtual void exitEventHandler();
89 
93  void makeCurrent( const bool cache = true ) const override;
94 
96  void swapBuffers() override;
97 
99  void joinNVSwapBarrier( const uint32_t group,
100  const uint32_t barrier ) override;
101 
103  void leaveNVSwapBarrier();
104 
105  QGLWidget* getQGLWidget() const;
106  GLWidget* getGLWidget() const;
107 
109  EQ_API bool processEvent( const WindowEvent& event ) override;
111 
112 private:
113  detail::Window* const _impl;
114 };
115 }
116 }
117 #endif // EQ_QT_WINDOW_H
void swapBuffers() override
EQ_API bool processEvent(const WindowEvent &event) override
bool configInit() override
Initialize this window for the Qt window system.
virtual bool processEvent(const WindowEvent &event)=0
Process the given event.
A set of settings to setup an eq::SystemWindow.
boost::function< void(QGLWidget *) > DeleteGLWidgetFunc
Function invoked to delete the QGLWidget from the destructor.
~Window() final
Destruct this Qt window.
The interface defining the minimum functionality for a Qt window.
Window(NotifierInterface &parent, const WindowSettings &settings, QGLWidget *glWidget, DeleteGLWidgetFunc deleteGLWidget=0)
Construct a new Qt system window.
Equalizer default implementation of a Qt window.
void configExit() override
EQ_API GLWindow(NotifierInterface &parent, const WindowSettings &settings)
Construct a new OpenGL window.
A system window for OpenGL rendering.
Definition: glWindow.h:36
A base class for notifying errors and events.
virtual EQ_API void exitEventHandler()
void joinNVSwapBarrier(const uint32_t group, const uint32_t barrier) override
Implementation untested for Qt.
A window-system event for a qt::WindowIF.
void makeCurrent(const bool cache=true) const override
virtual EQ_API void initEventHandler()
void leaveNVSwapBarrier()
Implementation untested for Qt.