![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
Plugins are potentially more powerful than scripts, but are more difficult to write and maintain. Unlike scripts, Plugins must be compiled for a specific platform, and will typically only be compatible with a particular version of Stellarium. We hope that the plugin system will allow third party developers to write extensions to Stellarium which might not otherwise be included in the core program, and that the system will allow for prototyping of new features before inclusion into the core.
Stellarium plugins are created from C++ code compiled separately as a dynamic library ( .so on linux, .dll in windows or .dylib on MacOSX). A plugin should contain a main class deriving from the StelModule class as well as an instance of the StelPluginInterface which allows stellarium to dynamically load it. At startup, the StelModuleMgr will load the library (provided that the .dll is put at the proper place in the stellarium file tree), and an instance of the StelModule it contains will be instanciated and added to the list of other "normal" StelModules.
Plugin developers - please note that while plugins are linked at runtime, classes used in plugins must inherit code from the core which is published under the GUN GPL. If you distribute a binary plugin, you must do so under the terms of the GNU GPL license. No sneaky closed-source shenanigans now.
/home/me/builds/stellarium. If you put the source code somewhere else, you will need to modify the following instructions accordingly.
/home/me/builds/stellarium, change into the /home/me/builds directory and fetch the extmodules files from SVN. On Linux, you can use these commands to accomplish this: cd /home/me/builds svn co https://stellarium.svn.sourceforge.net/svnroot/stellarium/trunk/extmodules
Release settings, not the Debug settings. You can do this by adding a step after doing cmake. On Windows, use the cmakegui tool, or on *nix use the ccmake tool (or just edit the CMakeCache.txt file) to set the value of CMAKE_BUILD_TYPE to Release. Then continue with the make stage.
STELROOT which contains the path to the Stellarium source code. export STELROOT=/home/me/builds/stellarium
builds/unix, on Windows it should be called builds/msys. Once made, change into it. e.g. on Linux: cd /home/me/builds/plugins/AngleMeasure mkdir -p builds/unix cd builds/unix
cmake ../.. make make install
cmake -G "MSYS Makefiles" ../.. make
To install the plugin on Linux systems, simple add a make install command after the make. This will copy the necessary files to $HOME/.stellarium/modules/AngleMeasure.
To install a plugin on Windows or OSX, you should locate the [[User Data Directory]], and then create a sub-directory called modules in it. Inside this, create a subdirectory named for the plugin, e.g. AngleMeasure. Into this directory, you should copy the following files:
module.ini file from the plugin source directory. lib<plugin-name>.so or lib<plugin-name>.dll from the src sub-directory of the builds/unix or builds/msys directory in the plugin source directory.
1.5.5