StelModule.hpp   StelModule.hpp 
skipping to change at line 38 skipping to change at line 38
class QSettings; class QSettings;
class StelStyle; class StelStyle;
//! 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.
//! Once a module is registered into the StelModuleMgr, it is automatically managed by the program. //! Once a module is registered into the StelModuleMgr, it is automatically managed by the program.
//! It can be called using the GETSTELMODULE macro, passing as argument its name, which is also the QObject name //! It can be called using the GETSTELMODULE macro, passing as argument its name, which is also the QObject name
//! Because StelModules are very generic components, it is also possible to load them dynamically, //! Because StelModules are very generic components, it is also possible to load them dynamically,
//! thus enabling creation of external plug-ins for stellarium. //! thus enabling creation of external plug-ins for stellarium.
//! @author Fabien Chereau //! @sa StelObjectModule for StelModule managing collections of StelObject.
//! @sa @ref plugins for documentation on how to develop external plugins.
class StelModule : public QObject class StelModule : public QObject
{ {
// 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
// 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;
//! 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
virtual void draw(StelCore* core) = 0; virtual void draw(StelCore* core) = 0;
//! 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;
//! Update i18n strings from english names according to current glob al sky and application language. //! Update i18n strings from english names according to current glob al sky and application language.
//! This method also reload the proper fonts depending on the langua ge. //! This method also reload the proper fonts depending on the langua ge.
//! The translation shall be done using the Translator provided by t he StelApp singleton instance. //! The translation shall be done using the StelTranslator provided by the StelApp singleton instance.
virtual void updateI18n() {;} virtual void updateI18n() {;}
//! Update sky culture, i.e. load data if necessary and translate th em to current sky language if needed. //! Update sky culture, i.e. load data if necessary and translate th em to current sky language if needed.
virtual void updateSkyCulture() {;} virtual void updateSkyCulture() {;}
//! 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 92 skipping to change at line 96
//! 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) {ret urn false;} virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {ret urn 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 event the Key event //! @param event 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* event) {return;} virtual void handleKeys(class QKeyEvent* event) {return;}
//! Enum used when selecting objects to define whether to add to, re //! Enum used when selecting objects to define whether to add to, re
place, or remove from place, or remove from the existing selection list.
//! the existing selection list.
enum StelModuleSelectAction enum StelModuleSelectAction
{ {
AddToSelection, AddToSelection, //!< Add the StelObject to the current l
ReplaceSelection, ist of selected ones.
RemoveFromSelection ReplaceSelection, //!< Set the StelObject as the new l
ist of selected ones.
RemoveFromSelection //!< Subtract the StelObject from the cu
rrent list of selected ones.
}; };
//! Indicate that the user requested selection of StelObjects. //! Indicate that the user requested selection of StelObjects.
//! The StelModule should then manage by themself how they handle th e event //! The StelModule should then manage by themself how they handle th e event
//! @param action define if the user requested that the objects are added to the selection or just replace it //! @param action define if the user requested that the objects are added to the selection or just replace it
virtual void selectedObjectChangeCallBack(StelModuleSelectAction act ion=ReplaceSelection) {;} virtual void selectedObjectChangeCallBack(StelModuleSelectAction act ion=ReplaceSelection) {;}
//! Load the given color style //! Load the given color style
//! @param style the style object containing all necessary informati on on how to style widgets and text //! @param style the style object containing all necessary informati on on how to style widgets and text
virtual void setStelStyle(const StelStyle& style) {;} virtual void setStelStyle(const StelStyle& style) {;}
//! This method is called for all StelModules when the GL window is resized //! This method is called for all StelModules when the GL window is resized
virtual void glWindowHasBeenResized(int w, int h) {;} virtual void glWindowHasBeenResized(int w, int h) {;}
//! Define the possible action for which an order is defined //! Define the possible action for which an order is defined
enum StelModuleActionName enum StelModuleActionName
{ {
ActionDraw, ActionDraw, //!< Action associated to the draw(
ActionUpdate, ) method
ActionHangleMouseClicks, ActionUpdate, //!< Action associated to the updat
ActionHandleMouseMoves, e() method
ActionHandleKeys ActionHandleMouseClicks, //!< Action associated to the handl
eMouseClicks() method
ActionHandleMouseMoves, //!< Action associated to the handl
eMouseMoves() method
ActionHandleKeys //!< Action associated to the handl
eKeys() method
}; };
//! Return the value defining the order of call for the given action //! Return the value defining the order of call for the given action
//! For example if stars.callOrder[ActionDraw] == 10 and constellati on.callOrder[ActionDraw] == 11, //! For example if stars.callOrder[ActionDraw] == 10 and constellati on.callOrder[ActionDraw] == 11,
//! 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 { return 0;} virtual double getCallOrder(StelModuleActionName actionName) const { return 0;}
}; };
 End of changes. 6 change blocks. 
13 lines changed or deleted 25 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/