CompassMarks.hpp   CompassMarks.hpp 
skipping to change at line 27 skipping to change at line 27
*/ */
#ifndef COMPASSMARKS_HPP_ #ifndef COMPASSMARKS_HPP_
#define COMPASSMARKS_HPP_ #define COMPASSMARKS_HPP_
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelModule.hpp" #include "StelModule.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include <QFont> #include <QFont>
class QPixmap;
class StelButton; class StelButton;
//! This is an example of a plug-in which can be dynamically loaded into st //! Main class of the Compass Marks plug-in.
ellarium //! Provides a ring of marks indicating azimuth on the horizon,
//! like a compass dial.
class CompassMarks : public StelModule class CompassMarks : public StelModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool marksVisible READ getCompassMarks WRITE setCompassMa rks NOTIFY compassMarksChanged)
public: public:
CompassMarks(); CompassMarks();
virtual ~CompassMarks(); virtual ~CompassMarks();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void update(double deltaTime); virtual void update(double deltaTime);
virtual void draw(StelCore* core, class StelRenderer* renderer); virtual void draw(StelCore* core);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
bool getCompassMarks() const {return markFader;}
public slots: public slots:
void setCompassMarks(bool b); void setCompassMarks(bool b);
//! Load the plug-in's settings from the configuration file.
//! Settings are kept in the "CompassMarks" section in Stellarium's
//! configuration file. If no such section exists, it will load defa
ult
//! values.
//! @see saveSettings(), restoreDefaultSettings()
void loadConfiguration();
//! Save the plug-in's settings to the configuration file.
//! @warning markColor is not saved.
//! @todo find a way to save color values without "rounding drift"
//! (this is especially important for restoring default color values
).
//! @see loadSettings(), restoreDefaultSettings()
void saveConfiguration();
void restoreDefaultConfiguration();
signals:
void compassMarksChanged(bool);
private slots: private slots:
void cardinalPointsChanged(bool b); void cardinalPointsChanged(bool b);
private: private:
// Font used for displaying our text QSettings* conf;
//! Whether the marks should be displayed at startup.
bool displayedAtStartup;
//! Font used for displaying bearing numbers.
QFont font; QFont font;
Vec3f markColor; Vec3f markColor;
LinearFader markFader; LinearFader markFader;
QPixmap* pxmapGlow;
QPixmap* pxmapOnIcon;
QPixmap* pxmapOffIcon;
StelButton* toolbarButton; StelButton* toolbarButton;
bool cardinalPointsState; bool cardinalPointsState;
}; };
#include "fixx11h.h"
#include <QObject> #include <QObject>
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
//! This class is used by Qt to manage a plug-in interface //! This class is used by Qt to manage a plug-in interface
class CompassMarksStelPluginInterface : public QObject, public StelPluginIn terface class CompassMarksStelPluginInterface : public QObject, public StelPluginIn terface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "stellarium.StelGuiPluginInterface/1.0")
Q_INTERFACES(StelPluginInterface) Q_INTERFACES(StelPluginInterface)
public: public:
virtual StelModule* getStelModule() const; virtual StelModule* getStelModule() const;
virtual StelPluginInfo getPluginInfo() const; virtual StelPluginInfo getPluginInfo() const;
}; };
#endif /*COMPASSMARKS_HPP_*/ #endif /*COMPASSMARKS_HPP_*/
 End of changes. 10 change blocks. 
9 lines changed or deleted 30 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/