StelModule.hpp   StelModule.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 _STELMODULE_HPP_ #ifndef _STELMODULE_HPP_
#define _STELMODULE_HPP_ #define _STELMODULE_HPP_
#include "config.h"
#include <QString> #include <QString>
#include <QObject> #include <QObject>
// Predeclaration // Predeclaration
class StelCore; class StelCore;
class QSettings; class QSettings;
//! This is the common base class for all the main components of stellarium . //! This is the common base class for all the main components of stellarium .
//! Standard StelModules are the one displaying the stars, the constellatio ns, the planets etc.. //! Standard StelModules are the one displaying the stars, the constellatio ns, the planets etc..
//! Every new module derived class should implement the methods defined in StelModule.hpp. //! Every new module derived class should implement the methods defined in StelModule.hpp.
skipping to change at line 51 skipping to change at line 53
//! laguageChanged() //! laguageChanged()
//! Update i18n strings from english names according to current global s ky and application language. //! Update i18n strings from english names according to current global s ky and application language.
//! This method also reload the proper fonts depending on the language. //! This method also reload the proper fonts depending on the language.
//! The translation shall be done using the StelTranslator provided by t he StelApp singleton instance. //! The translation shall be done using the StelTranslator provided by t he StelApp singleton instance.
//! skyCultureChanged(const QString&) //! skyCultureChanged(const QString&)
//! Update sky culture, i.e. load data if necessary and translate them t o current sky language if needed. //! Update sky culture, i.e. load data if necessary and translate them t o current sky language if needed.
//! colorSchemeChanged(const QString&) //! colorSchemeChanged(const QString&)
//! Load the given color style //! Load the given color style
class StelModule : public QObject class StelModule : public QObject
{ {
Q_OBJECT
// Do not add Q_OBJECT here!! // Do not add Q_OBJECT here!!
// This make this class compiled by the Qt moc compiler and for some unknown reasons makes it impossible to dynamically // This make this class compiled by the Qt moc compiler and for some unknown reasons makes it impossible to dynamically
// load plugins on windows. // load plugins on windows.
public: public:
StelModule() {;} StelModule() {;}
virtual ~StelModule() {;} virtual ~StelModule() {;}
//! Initialize itself. //! Initialize itself.
//! If the initialization takes significant time, the progress shoul d be displayed on the loading bar. //! If the initialization takes significant time, the progress shoul d be displayed on the loading bar.
virtual void init() = 0; virtual void init() = 0;
//! Called before the module will be deleted, and before the rendere //! Called before the module will be delete, and before the openGL c
r is destroyed. ontext is suppressed.
//! Deinitialize all textures in this method. //! Deinitialize all openGL texture in this method.
virtual void deinit() {;} virtual void deinit() {;}
//! Execute all the drawing functions for this module. //! Execute all the drawing functions for this module.
//! @param core the core to use for the drawing //! @param core the core to use for the drawing
//! @param renderer Renderer to draw with. virtual void draw(StelCore* core) {Q_UNUSED(core);}
virtual void draw(StelCore* core, class StelRenderer* renderer)
{
Q_UNUSED(core);
Q_UNUSED(renderer);
}
//! Iterate through the drawing sequence.
//! This allow us to split the slow drawing operation into small par
ts,
//! we can then decide to pause the painting for this frame and used
the cached image instead.
//! @return true if we should continue drawing (by calling the metho
d again)
virtual bool drawPartial(StelCore* core, class StelRenderer* rendere
r);
//! Update the module with respect to the time. //! Update the module with respect to the time.
//! @param deltaTime the time increment in second since last call. //! @param deltaTime the time increment in second since last call.
virtual void update(double deltaTime) = 0; virtual void update(double deltaTime) = 0;
//! Get the version of the module, default is stellarium main versio n //! Get the version of the module, default is stellarium main versio n
virtual QString getModuleVersion() const; virtual QString getModuleVersion() const;
//! Get the name of the module author //! Get the name of the module author
virtual QString getAuthorName() const {return "Stellarium's Team";} virtual QString getAuthorName() const {return "Stellarium's Team";}
skipping to change at line 112 skipping to change at line 104
//! Handle mouse moves. Please note that most of the interactions wi ll be done through the GUI module. //! Handle mouse moves. Please note that most of the interactions wi ll be done through the GUI module.
//! @return true if the event was intercepted //! @return true if the event was intercepted
virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {Q_U NUSED(x); Q_UNUSED(y); Q_UNUSED(b); return false;} virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {Q_U NUSED(x); Q_UNUSED(y); Q_UNUSED(b); return false;}
//! Handle key events. Please note that most of the interactions wil l be done through the GUI module. //! Handle key events. Please note that most of the interactions wil l be done through the GUI module.
//! @param e the Key event //! @param e the Key event
//! @return set the event as accepted if it was intercepted //! @return set the event as accepted if it was intercepted
virtual void handleKeys(class QKeyEvent* e) {Q_UNUSED(e);} virtual void handleKeys(class QKeyEvent* e) {Q_UNUSED(e);}
//! Handle pinch gesture events.
//! @param scale the value of the pinch gesture.
//! @param started define whether the pinch has just started.
//! @return true if the event was intercepted.
virtual bool handlePinch(qreal scale, bool started) {Q_UNUSED(scale)
; Q_UNUSED(started); return false;}
//! Enum used when selecting objects to define whether to add to, re place, or remove from the existing selection list. //! Enum used when selecting objects to define whether to add to, re place, or remove from the existing selection list.
enum StelModuleSelectAction enum StelModuleSelectAction
{ {
AddToSelection, //!< Add the StelObject to the current l ist of selected ones. AddToSelection, //!< Add the StelObject to the current l ist of selected ones.
ReplaceSelection, //!< Set the StelObject as the new l ist of selected ones. ReplaceSelection, //!< Set the StelObject as the new l ist of selected ones.
RemoveFromSelection //!< Subtract the StelObject from the cu rrent list of selected ones. RemoveFromSelection //!< Subtract the StelObject from the cu rrent list of selected ones.
}; };
//! Define the possible action for which an order is defined //! Define the possible action for which an order is defined
enum StelModuleActionName enum StelModuleActionName
skipping to change at line 142 skipping to change at line 140
//! the stars module will be drawn before the constellations //! the stars module will be drawn before the constellations
//! @param actionName the name of the action for which we want the c all order //! @param actionName the name of the action for which we want the c all order
//! @return the value defining the order. The closer to 0 the earlie r the module's action will be called //! @return the value defining the order. The closer to 0 the earlie r the module's action will be called
virtual double getCallOrder(StelModuleActionName actionName) const { Q_UNUSED(actionName); return 0;} virtual double getCallOrder(StelModuleActionName actionName) const { Q_UNUSED(actionName); return 0;}
//! Detect or show the configuration GUI elements for the module. T his is to be used with //! Detect or show the configuration GUI elements for the module. T his is to be used with
//! plugins to display a configuration dialog from the plugin list w indow. //! plugins to display a configuration dialog from the plugin list w indow.
//! @param show if true, make the configuration GUI visible. If fal se, hide the config GUI if there is one. //! @param show if true, make the configuration GUI visible. If fal se, hide the config GUI if there is one.
//! @return true if the module has a configuration GUI, else false. //! @return true if the module has a configuration GUI, else false.
virtual bool configureGui(bool show=true) {Q_UNUSED(show); return fa lse;} virtual bool configureGui(bool show=true) {Q_UNUSED(show); return fa lse;}
protected:
//! convenience methods to add an action to the StelActionMgr object
.
class StelAction* addAction(const QString& id, const QString& groupI
d, const QString& text,
QObject* target, const char* slot,
const QString& shortcut="", const QStrin
g& altShortcut="");
//! convenience methods to add an action to the StelActionMgr object
.
class StelAction* addAction(const QString& id, const QString& groupI
d, const QString& text,
const char* slot,
const QString& shortcut="", const QStrin
g& altShortcut="") {
return addAction(id, groupId, text, this, slot, shortcut, al
tShortcut);
}
}; };
Q_DECLARE_METATYPE(StelModule::StelModuleSelectAction)
#endif // _STELMODULE_HPP_ #endif // _STELMODULE_HPP_
 End of changes. 7 change blocks. 
20 lines changed or deleted 38 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/