scripting.doxygen   scripting.doxygen 
skipping to change at line 34 skipping to change at line 34
@tableofcontents @tableofcontents
@section intro_scripts Introduction @section intro_scripts Introduction
Since version 0.10.1, Stellarium includes a scripting feature based on the Since version 0.10.1, Stellarium includes a scripting feature based on the
<a href="http://doc.qt.io/qt-5/qtscript-index.html">Qt Scripting Engine</a> . <a href="http://doc.qt.io/qt-5/qtscript-index.html">Qt Scripting Engine</a> .
This makes it possible to write small programs within Stellarium to produce This makes it possible to write small programs within Stellarium to produce
presentations, set up custom configurations, and to automate repetitive presentations, set up custom configurations, and to automate repetitive
tasks. Prior to version 0.10.0, Stellarium used a different scripting engi ne tasks. Prior to version 0.10.0, Stellarium used a different scripting engi ne
called @ref StratoScript. called StratoScript.
The core scripting language is The core scripting language is
<a href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a>, giving us ers <a href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a>, giving us ers
access to all basic ECMAScript language features such as flow control, vari ables access to all basic ECMAScript language features such as flow control, vari ables
string manipulation and so on. Interaction with Stellarium-specific feature s string manipulation and so on. Interaction with Stellarium-specific feature s
is done via a collection of objects which represent components of Stellariu m is done via a collection of objects which represent components of Stellariu m
itself. See @ref scripting_api for more details. itself. See @ref scripting_api for more details.
@section scratoscript StratoScript
Prior to version 0.10.0, Stellarium had a simple scripting engine, known as
\e StratoScript. Using \e StratoScript it was possible to record and play
back
sequences of Stellarium commands, load and display custom images, and play
sounds.
In this way it was possible to make planetarium presentations - a feature u
sed
quite widely in the small planetarium community.
However \e StratoScript lacked many features of a real programming language
-
there were no variables, no flow control and no way to introspect the state
of
Stellarium.
The replacement scripting engine implemented in the 0.10.x series addresses
these
shortcomings, at the expense of a little complexity and a new language synt
ax.
A compatibility mode which converts \e StratoScript into new scripting engi
ne on
the fly is in progress.
Note: StratoScript compatibility is a build-time option. To enable this fea
ture,
Stellarium must be built using the ENABLE_STRATOSCRIPT_COMPAT=1 option to c
make.
@section scripting_api Scripting API @section scripting_api Scripting API
Interation with Stellarium-specific functionality is done by calling the Interation with Stellarium-specific functionality is done by calling the
<b>public slots</b> of instances of a group of Stellarium's core classes. <b>public slots</b> of instances of a group of Stellarium's core classes.
- The public slots in the class StelMainScriptAPI are available via an obje ct - The public slots in the class StelMainScriptAPI are available via an obje ct
named \b core. For example, to access StelMainScriptAPI::wait() from a sc ript, named \b core. For example, to access StelMainScriptAPI::wait() from a sc ript,
use the scripting command: use the scripting command:
\code \code
core.wait(...); core.wait(...);
 End of changes. 2 change blocks. 
32 lines changed or deleted 1 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/