You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdevelop/parts/scripting
Timothy Pearson c0b24fe164
Rename a number of libraries and executables to avoid conflicts with KDE4
12 years ago
..
CMakeLists.txt Additional renaming of kde to tde 13 years ago
Makefile.am Additional renaming of kde to tde 13 years ago
README Update XDG information in support of bug report 892. 13 years ago
kdevscripting.desktop Branding: KDevelop -> TDevelop, fix menu 13 years ago
kdevscripting.rc Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. 15 years ago
scriptingglobalconfig.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 12 years ago
scriptingglobalconfig.h Remove spurious TQ_OBJECT instances 13 years ago
scriptingglobalconfigbase.ui Rename KDEHOME and KDEDIR 13 years ago
scriptingpart.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 12 years ago
scriptingpart.h Remove spurious TQ_OBJECT instances 13 years ago

README

KScript In KDevelop

KScriptInterface allows us to have a generic way to add scripting languages to TDE applications.  KScriptInterface is not really a scripting language per say, but an interface so that applications can embed scripting languages without explicitly linking to them.  This allows all runtime linkage to the different interpreters.  Currently the most effective way for scripts to communicate with applications is via DCOP.  KScriptInterface script engines provide some convinences methods to access the dcop interfaces of the embedding application.  

In KDevelop we have the ability to use scripts written for Kate, since the KateText interface is fully exported to DCOP.  By default KDevelop will import Kate scripts.  Users can also add other search paths for loading scripts.

To add a new script to KDevelop you need two parts.  The first part is a simple desktop file that has the meta-information for the script.  The basic format is like this:
[Desktop Entry]
Encoding=UTF-8
Type=Service
Name=Import Weather
Comment=Import current weather icon graphic into an album.
Type=ShellScript/bash
X-TDE-ScriptName=importweather.sh

The "Name" is the part that will appear in the TDevelop "Scripts" menu, and the "X-TDE-ScriptName" is the name of the script you wish to attach to that menu action.  The last part the "Type" is the type of the script runner you wish to execute the script with.
                          
The second part is the actual script that has a script runner.  Currently shell and KJSEmbed are supported, but Kommander support is rumored to be happening.  There are also perl and python script runners in kdenonbeta.