StelMainGraphicsView.hpp   StelMainGraphicsView.hpp 
skipping to change at line 24 skipping to change at line 24
* *
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELMAINGRAPHICSVIEW_HPP_ #ifndef _STELMAINGRAPHICSVIEW_HPP_
#define _STELMAINGRAPHICSVIEW_HPP_ #define _STELMAINGRAPHICSVIEW_HPP_
#include <QGraphicsView> #include <QGraphicsView>
#include <QResizeEvent>
class QGLWidget; class QGLWidget;
class QGraphicsScene; class QResizeEvent;
//! @class StelMainGraphicsView
//! 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.
class StelMainGraphicsView : public QGraphicsView class StelMainGraphicsView : public QGraphicsView
{ {
Q_OBJECT; Q_OBJECT
public: public:
StelMainGraphicsView(QWidget* parent, int argc, char** argv); StelMainGraphicsView(QWidget* parent, int argc, char** argv);
virtual ~StelMainGraphicsView(); virtual ~StelMainGraphicsView();
//! Start the main initialization of Stellarium //! Start the main initialization of Stellarium
void init(); void init();
//! Get the StelMainGraphicsView singleton instance. //! Get the StelMainGraphicsView singleton instance.
//! @return the StelMainGraphicsView singleton instance
static StelMainGraphicsView& getInstance() {Q_ASSERT(singleton); ret urn *singleton;} static StelMainGraphicsView& getInstance() {Q_ASSERT(singleton); ret urn *singleton;}
//! Get the main QGLWidget //! Get the main QGLWidget
//! @deprecated don't use that
QGLWidget* getOpenGLWin() {return glWidget;} QGLWidget* getOpenGLWin() {return glWidget;}
//! Delete openGL textures (to call before the GLContext disappears) //! Delete openGL textures (to call before the GLContext disappears)
void deinitGL(); void deinitGL();
//! Add a new progress bar in the lower right corner of the screen. //! Add a new progress bar in the lower right corner of the screen.
//! When the progress bar is not used anymore, just delete it. //! When the progress bar is not used anymore, just delete it.
//! @return a pointer to the progress bar //! @return a pointer to the progress bar
class QProgressBar* addProgessBar(); class QProgressBar* addProgressBar();
//! Activate all the QActions associated to the widget //! Activate all the QActions associated to the widget
void activateKeyActions(bool b); void activateKeyActions(bool b);
public slots: public slots:
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// 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 shotDir changes the directory where the screenshot is saved
//! If shotDir is "" then StelFileMgr::getScreenshotDir() will be us ed //! If shotDir is "" then StelFileMgr::getScreenshotDir() will be us ed
void saveScreenShot(const QString& filePrefix="stellarium-", const Q void saveScreenShot(const QString& filePrefix="stellarium-", const Q
String& saveDir="") const; String& saveDir="");
//! Get whether colors are inverted when saving screenshot
bool getFlagInvertScreenShotColors() const {return flagInvertScreenS
hotColors;}
//! Set whether colors should be inverted when saving screenshot
void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColo
rs=b;}
protected: protected:
virtual void resizeEvent(QResizeEvent* event); virtual void resizeEvent(QResizeEvent* event);
private: signals:
//! emitted when saveScreenShot is requested with saveScreenShot().
//! doScreenshot() does the actual work (it has to do it in the main
//! thread, where as saveScreenShot() might get called from another
one.
void screenshotRequested(void);
private slots:
// Do the actual screenshot generation in the main thread with this
method.
void doScreenshot(void);
private:
//! The StelMainWindow singleton //! The StelMainWindow singleton
static StelMainGraphicsView* singleton; static StelMainGraphicsView* singleton;
//! The openGL window //! The openGL window
QGLWidget* glWidget; QGLWidget* glWidget;
class StelApp* stelApp; class StelApp* stelApp;
bool wasDeinit; bool wasDeinit;
bool flagInvertScreenShotColors;
QString screenShotPrefix;
QString screenShotDir;
}; };
#endif // _STELMAINGRAPHICSVIEW_HPP_ #endif // _STELMAINGRAPHICSVIEW_HPP_
 End of changes. 11 change blocks. 
8 lines changed or deleted 35 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/