[Scribus] Scripter API

Henning Schröder henning.schroeder
Tue Jan 1 17:03:15 CET 2008


Hi!

On Dec 30, 2007 10:56 PM, Joachim Neu <joachim_neu at web.de> wrote:
> Hm. I don't want this discussion to fall asleep again. ;)
> So: What can/shall/must I do to help? Please anyone give me an advice
> what to do as I'm a real novice.

To give all a small update. I worked little bit on ScripterNG:
 * building is easier now because I split up the plugin
 * before building the plugin you now have to build a generic Python
extension for PyQt embedding called epyqt
 * Javascript (QtScript) is now supported and can also call the C++ API
 * as an iterim solution the Javascript code can also call the
functions of the old scriptplugin (at least some of them - the rest
will follow soon)
 * the plugin now contains a scripting console for Python and
Javascript, so testing becomes easier
* to show how easy exporting functions to ScripterNG is, I added an
example for preferences
  * to implement a preferences API I created api_prefs.{cpp,h} and
added them to CMakeLists
  * the functions are public slots of an object called PreferencesAPI
where I set the objectName to Preferences and made it a child of the
application object.
  * the only thing left was creating an PreferencesAPI instance in
scripterngimpl.cpp
  * no extra glue code is needed, it just works now in the Python and
Javascript console
     Application.Preferences.setString("foo", "bar");
print(Application.Preferences.getString("foo"))


To test it you need
 * get http://henning.cco-ev.de/scribus/epyqt.tar.bz2
 * extract files
 * call python configure.py
 * make
 * sudo make install
 * get http://henning.cco-ev.de/scribus/scripterng.tar.bz2
 * extract to the plugins folder
 * add the subdirectory in CMakeLists.txt
 * compile and install Scribus
 * run Scribus
 * open/create document
 * go to the Extras menu, click on ScripterNG and press OK if you want
to launch the console

If you want to access my bzr repository you have to remove .tar.bz2
from the URLs


Greets
Henning



More information about the scribus mailing list