Linux multi-monitor fullscreen support
[ryzomcore.git] / studio / src / plugins / core / Nel3DWidget / nel3d_widget.h
blob27b6dd84cf501e57d4c9e0a8971a2b931a206d66
1 // Ryzom Core MMORPG framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2012-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef NEL3D_WIDGET_H
22 #define NEL3D_WIDGET_H
24 #include "nel/misc/types_nl.h"
25 #include <string>
27 #ifdef NEL3DWIDGET
28 #undef NEL3DWIDGET
29 #endif
31 #ifdef NL_OS_WINDOWS
32 #include <QWidget>
33 #define NEL3DWIDGET QWidget
34 #else
35 #include <QGLWidget>
36 #define NEL3DWIDGET QGLWidget
37 #endif
40 #include "../core_global.h"
42 namespace NL3D
44 class UDriver;
45 class UTextContext;
48 /// Nel 3D interface to Qt
49 class CORE_EXPORT Nel3DWidget : public NEL3DWIDGET
51 Q_OBJECT
52 public:
53 Nel3DWidget( QWidget *parent = NULL );
54 virtual ~Nel3DWidget();
56 void init();
57 void createTextContext( std::string fontFile );
59 NL3D::UDriver* getDriver() const{ return driver; }
60 NL3D::UTextContext* getTextContext() const{ return textContext; }
63 // Need to return NULL paintengine to Qt so that we can
64 // render the widget normally ourselves, without the image
65 // disappearing when a widget is resized or shown on top of us
66 QPaintEngine* paintEngine() const{ return NULL; }
68 Q_SIGNALS:
69 void resize( int width, int height );
71 public Q_SLOTS:
72 void clear();
74 protected:
76 void showEvent( QShowEvent *evnt );
77 void resizeEvent( QResizeEvent *evnt );
79 #if defined(NL_OS_WINDOWS)
80 bool winEvent( MSG *message, long *result );
81 #elif defined(NL_OS_MAC)
82 bool macEvent( EventHandlerCallRef caller, EventRef event );
83 #elif defined(NL_OS_UNIX)
84 bool x11Event( XEvent *event );
85 #endif
87 private:
88 NL3D::UDriver *driver;
89 NL3D::UTextContext *textContext;
93 #endif