StelMainView.hpp   StelMainView.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _STELMAINGRAPHICSVIEW_HPP_ #ifndef _STELMAINGRAPHICSVIEW_HPP_
#define _STELMAINGRAPHICSVIEW_HPP_ #define _STELMAINGRAPHICSVIEW_HPP_
#include <QDeclarativeView>
#include <QCoreApplication> #include <QCoreApplication>
#include <QGraphicsView>
#include <QEventLoop> #include <QEventLoop>
#include <QOpenGLContext> #include <QOpenGLContext>
// This define (only used here and in StelMainView.cpp) is temporarily used // This define (only used here and in StelMainView.cpp) is temporarily used
// to allow uncompromised compiling while the migration to the new QOpenGL. .. classes // to allow uncompromised compiling while the migration to the new QOpenGL. .. classes
// has not been done. As soon as Qt5.4 is out, we should finish this migrat ion process! // has not been done. As soon as Qt5.4 is out, we should finish this migrat ion process!
#define STEL_USE_NEW_OPENGL_WIDGETS 0 #define STEL_USE_NEW_OPENGL_WIDGETS 0
class QDeclarativeItem;
#if STEL_USE_NEW_OPENGL_WIDGETS #if STEL_USE_NEW_OPENGL_WIDGETS
class QOpenGLWidget; class QOpenGLWidget;
class StelQOpenGLWidget; class StelQOpenGLWidget;
#else #else
class QGLWidget; class QGLWidget;
class StelQGLWidget; class StelQGLWidget;
#endif #endif
class QMoveEvent; class QMoveEvent;
class QResizeEvent; class QResizeEvent;
class StelGuiBase; class StelGuiBase;
class QMoveEvent; class QMoveEvent;
class QSettings; class QSettings;
//! @class StelMainView //! @class StelMainView
//! Reimplement a QGraphicsView for Stellarium. //! Reimplement a QGraphicsView for Stellarium.
//! It is the class creating the singleton GL Widget, the main StelApp inst ance as well as the main GUI. //! It is the class creating the singleton GL Widget, the main StelApp inst ance as well as the main GUI.
class StelMainView : public QDeclarativeView class StelMainView : public QGraphicsView
{ {
friend class StelGuiItem; friend class StelGuiItem;
friend class StelSkyItem; friend class StelSkyItem;
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen) Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen)
public: public:
StelMainView(QWidget* parent = NULL); StelMainView(QWidget* parent = NULL);
virtual ~StelMainView(); virtual ~StelMainView();
skipping to change at line 78 skipping to change at line 77
//! Get the StelMainView singleton instance. //! Get the StelMainView singleton instance.
static StelMainView& getInstance() {Q_ASSERT(singleton); return *sin gleton;} static StelMainView& getInstance() {Q_ASSERT(singleton); return *sin gleton;}
//! Delete openGL textures (to call before the GLContext disappears) //! Delete openGL textures (to call before the GLContext disappears)
void deinitGL(); void deinitGL();
//! Return focus to the sky item. To be used when we close a dialog . //! Return focus to the sky item. To be used when we close a dialog .
void focusSky(); void focusSky();
//! Return the parent gui widget, this should be used as parent to a ll //! Return the parent gui widget, this should be used as parent to a ll
//! the StelDialog instances. //! the StelDialog instances.
QGraphicsWidget* getGuiWidget() const {return guiWidget;} QGraphicsWidget* getGuiWidget() const {return guiItem;}
//! Return mouse position coordinates //! Return mouse position coordinates
QPoint getMousePos(); QPoint getMousePos();
public slots: public slots:
//! Set whether fullscreen is activated or not //! Set whether fullscreen is activated or not
void setFullScreen(bool); void setFullScreen(bool);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Specific methods // Specific methods
//! Save a screen shot. //! Save a screen shot.
//! The format of the file, and hence the filename extension //! The format of the file, and hence the filename extension
//! depends on the architecture and build type. //! depends on the architecture and build type.
//! @arg filePrefix changes the beginning of the file name //! @arg filePrefix changes the beginning of the file name
//! @arg shotDir changes the directory where the screenshot is saved //! @arg saveDir changes the directory where the screenshot is saved
//! If shotDir is "" then StelFileMgr::getScreenshotDir() will be us //! If saveDir is "" then StelFileMgr::getScreenshotDir() will be us
ed ed
void saveScreenShot(const QString& filePrefix="stellarium-", const Q String& saveDir=""); void saveScreenShot(const QString& filePrefix="stellarium-", const Q String& saveDir="");
//! Get whether colors are inverted when saving screenshot //! Get whether colors are inverted when saving screenshot
bool getFlagInvertScreenShotColors() const {return flagInvertScreenS hotColors;} bool getFlagInvertScreenShotColors() const {return flagInvertScreenS hotColors;}
//! Set whether colors should be inverted when saving screenshot //! Set whether colors should be inverted when saving screenshot
void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColo rs=b;} void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColo rs=b;}
//! Get the state of the mouse cursor timeout flag //! Get the state of the mouse cursor timeout flag
bool getFlagCursorTimeout() {return flagCursorTimeout;} bool getFlagCursorTimeout() {return flagCursorTimeout;}
//! Get the mouse cursor timeout in seconds //! Get the mouse cursor timeout in seconds
skipping to change at line 140 skipping to change at line 139
protected: protected:
virtual void mouseMoveEvent(QMouseEvent* event); virtual void mouseMoveEvent(QMouseEvent* event);
virtual void mousePressEvent(QMouseEvent* event); virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event); virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void keyPressEvent(QKeyEvent* event); virtual void keyPressEvent(QKeyEvent* event);
virtual void keyReleaseEvent(QKeyEvent* event); virtual void keyReleaseEvent(QKeyEvent* event);
virtual void wheelEvent(QWheelEvent* wheelEvent); virtual void wheelEvent(QWheelEvent* wheelEvent);
virtual void moveEvent(QMoveEvent* event); virtual void moveEvent(QMoveEvent* event);
virtual void closeEvent(QCloseEvent* event); virtual void closeEvent(QCloseEvent* event);
virtual void resizeEvent(QResizeEvent* event);
//! Update the mouse pointer state and schedule next redraw. //! Update the mouse pointer state and schedule next redraw.
//! This method is called automatically by Qt. //! This method is called automatically by Qt.
virtual void drawBackground(QPainter* painter, const QRectF &rect); virtual void drawBackground(QPainter* painter, const QRectF &rect);
signals: signals:
//! emitted when saveScreenShot is requested with saveScreenShot(). //! emitted when saveScreenShot is requested with saveScreenShot().
//! doScreenshot() does the actual work (it has to do it in the main //! doScreenshot() does the actual work (it has to do it in the main
//! thread, where as saveScreenShot() might get called from another one. //! thread, where as saveScreenShot() might get called from another one.
void screenshotRequested(void); void screenshotRequested(void);
private slots: private slots:
// Do the actual screenshot generation in the main thread with this method. // Do the actual screenshot generation in the main thread with this method.
void doScreenshot(void); void doScreenshot(void);
void minFpsChanged(); void minFpsChanged();
void updateNightModeProperty();
private: private:
//! Start the display loop //! Start the display loop
void startMainLoop(); void startMainLoop();
//! provide extended OpenGL diagnostics in logfile. //! provide extended OpenGL diagnostics in logfile.
void dumpOpenGLdiagnostics() const; void dumpOpenGLdiagnostics() const;
//! Startup diagnostics, providing test for various circumstances of bad OS/OpenGL driver combinations //! Startup diagnostics, providing test for various circumstances of bad OS/OpenGL driver combinations
//! to provide feedback to the user about bad OpenGL drivers. //! to provide feedback to the user about bad OpenGL drivers.
#if STEL_USE_NEW_OPENGL_WIDGETS #if STEL_USE_NEW_OPENGL_WIDGETS
void processOpenGLdiagnosticsAndWarnings(QSettings *conf, StelQOpenG LWidget* glWidget) const; void processOpenGLdiagnosticsAndWarnings(QSettings *conf, StelQOpenG LWidget* glWidget) const;
#else #else
void processOpenGLdiagnosticsAndWarnings(QSettings *conf, StelQGLWid get* glWidget) const; void processOpenGLdiagnosticsAndWarnings(QSettings *conf, StelQGLWid get* glWidget) const;
#endif #endif
//! The StelMainView singleton //! The StelMainView singleton
static StelMainView* singleton; static StelMainView* singleton;
//! This is created by the StelGuiItem, but need to be publicly QGraphicsWidget* rootItem;
//! accessible so that StelDialog instances can reparent to it. QGraphicsWidget* skyItem;
QGraphicsWidget *guiWidget; QGraphicsWidget* guiItem;
QDeclarativeItem* skyItem; QGraphicsEffect* nightModeEffect;
//! The openGL window //! The openGL window
#if STEL_USE_NEW_OPENGL_WIDGETS #if STEL_USE_NEW_OPENGL_WIDGETS
StelQOpenGLWidget* glWidget; StelQOpenGLWidget* glWidget;
#else #else
StelQGLWidget* glWidget; StelQGLWidget* glWidget;
#endif #endif
StelGuiBase* gui; StelGuiBase* gui;
class StelApp* stelApp; class StelApp* stelApp;
 End of changes. 10 change blocks. 
12 lines changed or deleted 12 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/