Skip to content

Commit

Permalink
Removed support of StratoScript
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Apr 13, 2015
1 parent 927baac commit 2a7dfed
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 399 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ IF(ENABLE_SCRIPTING)
IF(ENABLE_SCRIPT_CONSOLE)
ADD_DEFINITIONS(-DENABLE_SCRIPT_CONSOLE)
ENDIF()
SET(ENABLE_STRATOSCRIPT_COMPAT 0 CACHE BOOL "Set to 1 or true if you want to build the Stratoscript compatibility mode")
ELSE()
ADD_DEFINITIONS(-DDISABLE_SCRIPTING)
ENDIF()
Expand Down Expand Up @@ -277,10 +276,6 @@ IF(NOT RELEASE_BUILD)
ENDIF()
ENDIF()

IF(ENABLE_STRATOSCRIPT_COMPAT)
ADD_DEFINITIONS(-DENABLE_STRATOSCRIPT_COMPAT)
ENDIF()

CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/data/stellarium.exe.manifest.cmake ${CMAKE_SOURCE_DIR}/data/stellarium.exe.manifest @ONLY)

### [Optional] Embed icon in the Windows executable ###
Expand Down
23 changes: 1 addition & 22 deletions doc/scripting.doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Since version 0.10.1, Stellarium includes a scripting feature based on the
This makes it possible to write small programs within Stellarium to produce
presentations, set up custom configurations, and to automate repetitive
tasks. Prior to version 0.10.0, Stellarium used a different scripting engine
called @ref StratoScript.
called StratoScript.

The core scripting language is
<a href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a>, giving users
Expand All @@ -40,27 +40,6 @@ string manipulation and so on. Interaction with Stellarium-specific features
is done via a collection of objects which represent components of Stellarium
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 used
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 syntax.

A compatibility mode which converts \e StratoScript into new scripting engine on
the fly is in progress.

Note: StratoScript compatibility is a build-time option. To enable this feature,
Stellarium must be built using the ENABLE_STRATOSCRIPT_COMPAT=1 option to cmake.

@section scripting_api Scripting API

Interation with Stellarium-specific functionality is done by calling the
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ IF(ENABLE_SCRIPTING)
scripting/StelScriptOutput.hpp
scripting/StelScriptOutput.cpp
scripting/StelScriptMgr.cpp
scripting/StratoscriptPreprocessor.cpp
scripting/StelScriptMgr.hpp
scripting/ScreenImageMgr.hpp
scripting/ScreenImageMgr.cpp
Expand Down
16 changes: 0 additions & 16 deletions src/gui/ScriptConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ void ScriptConsole::createDialogContent()
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptStopped()), this, SLOT(scriptEnded()));
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptDebug(const QString&)), this, SLOT(appendLogLine(const QString&)));
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptOutput(const QString&)), this, SLOT(appendOutputLine(const QString&)));
#ifndef ENABLE_STRATOSCRIPT_COMPAT
ui->preprocessSTSButton->setHidden(true);
#else
connect(ui->preprocessSTSButton, SIGNAL(clicked()), this, SLOT(preprocessScript()));
#endif
ui->tabs->setCurrentIndex(0);
ui->scriptEdit->setFocus();
}
Expand Down Expand Up @@ -163,13 +158,6 @@ void ScriptConsole::preprocessScript()
qDebug() << "Preprocessing with SSC proprocessor";
StelApp::getInstance().getScriptMgr().preprocessScript(src, dest, ui->includeEdit->text());
}
#ifdef ENABLE_STRATOSCRIPT_COMPAT
else if (sender() == ui->preprocessSTSButton)
{
qDebug() << "Preprocessing with STS proprocessor";
StelApp::getInstance().getScriptMgr().preprocessStratoScript(src, dest, ui->includeEdit->text());
}
#endif
else
qWarning() << "WARNING: unknown preprocessor type";

Expand Down Expand Up @@ -313,9 +301,5 @@ void ScriptConsole::rowColumnChanged()

QString ScriptConsole::getFileMask()
{
#ifdef ENABLE_STRATOSCRIPT_COMPAT
return "(*.ssc *.sts *.inc)";
#else
return "(*.ssc *.inc)";
#endif
}
20 changes: 0 additions & 20 deletions src/gui/scriptConsole.ui
Original file line number Diff line number Diff line change
Expand Up @@ -269,26 +269,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="preprocessSTSButton">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>pre-process script using STS preprocessor</string>
</property>
<property name="text">
<string notr="true">STS</string>
</property>
<property name="icon">
<iconset resource="../../data/gui/guiRes.qrc">
<normaloff>:/graphicGui/btFlipVertical-off.png</normaloff>:/graphicGui/btFlipVertical-off.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
Expand Down
8 changes: 0 additions & 8 deletions src/scripting/StelScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ QStringList StelScriptMgr::getScriptList()
QStringList scriptFiles;

QSet<QString> files = StelFileMgr::listContents("scripts", StelFileMgr::File, true);
#ifdef ENABLE_STRATOSCRIPT_COMPAT
QRegExp fileRE("^.*\\.(ssc|sts)$");
#else // ENABLE_STRATOSCRIPT_COMPAT
QRegExp fileRE("^.*\\.ssc$");
#endif // ENABLE_STRATOSCRIPT_COMPAT
foreach(const QString& f, files)
{
if (fileRE.exactMatch(f))
Expand Down Expand Up @@ -347,10 +343,6 @@ bool StelScriptMgr::runScript(const QString& fileName, const QString& includePat
bool ok = false;
if (fileName.endsWith(".ssc"))
ok = preprocessScript(fic, preprocessedScript, scriptDir);
#ifdef ENABLE_STRATOSCRIPT_COMPAT
else if (fileName.endsWith(".sts"))
ok = preprocessStratoScript(fic, preprocessedScript, scriptDir);
#endif
if (!ok)
{
return false;
Expand Down
4 changes: 0 additions & 4 deletions src/scripting/StelScriptMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ private slots:
//! The name of the action is of the form: "actionScript/<script-path>"
void initActions();

#ifdef ENABLE_STRATOSCRIPT_COMPAT
bool preprocessStratoScript(QFile& input, QString& output, const QString& scriptDir);
#endif

//! This function is for use with getName, getAuthor and getLicense.
//! @param s the script id
//! @param id the command line id, e.g. "Name"
Expand Down
Loading

0 comments on commit 2a7dfed

Please sign in to comment.