Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 14646 → Rev 14647

/trunk/Scribus/scribus/plugins/scripter/python/excepthook.ui
0,0 → 1,71
<ui version="4.0" >
<class>ExceptHookDialog</class>
<widget class="QDialog" name="ExceptHookDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>542</width>
<height>290</height>
</rect>
</property>
<property name="windowTitle" >
<string>Script error</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<layout class="QGridLayout" name="gridLayout" >
<property name="spacing" >
<number>10</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>An exception occured while running the script.</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QPushButton" name="closeButton" >
<property name="text" >
<string>&amp;Close</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="exceptionLabel" >
<property name="font" >
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Exception</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QPushButton" name="detailsButton" >
<property name="text" >
<string>&amp;Details >></string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextBrowser" name="tracebackBrowser" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>200</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
/trunk/Scribus/scribus/plugins/scripter/python/scripter_hooks.py
0,0 → 1,129
# -*- coding: utf-8 -*-
"""
This module will be a collection of functions to hook into the GUI of Scribus.
 
Currently it only provides functions to add items to a menubar.
Support for the toolbar, statusbar and dockarea have still to be implemented.
I have to think about how to provide this stuff to QtScript.
"""
 
from PyQt4.QtGui import QApplication, QMenu
 
import mikro
 
 
class MenuHooks(object):
"""
This class lets extension-scripts hook into the main menu of Scribus.
"""
 
 
def __init__(self, window=None):
self.window = window or Scripter.dialogs.mainWindow.qt
self.menubar = self.window.menuBar()
self.menus = []
 
 
def createMenu(self, title):
m = QMenu(title)
self.menus.append(m)
self.menubar.addMenu(m)
return m
 
def iter_menus(self):
for action in self.menubar.actions():
menu = action.menu()
if menu:
yield menu
 
 
def findMenu(self, title):
"""
find a menu with a given title
 
@type title: string
@param title: English title of the menu
@rtype: QMenu
@return: None if no menu was found, else the menu with title
"""
# See also http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#differences-between-pyqt-and-qt
title = QApplication.translate(mikro.classname(self.window), title)
for menu in self.iter_menus():
if menu.title() == title:
return menu
 
 
def actionForMenu(self, menu):
for action in self.menubar.actions():
if action.menu() == menu:
return action
 
 
def insertMenuBefore(self, before_menu, new_menu):
"""
Insert a menu after another menu in the menubar
 
@type: before_menu QMenu instance or title string of menu
@param before_menu: menu which should be after the newly inserted menu
@rtype: QAction instance
@return: action for inserted menu
"""
if isinstance(before_menu, basestring):
before_menu = self.findMenu(before_menu)
before_action = self.actionForMenu(before_menu)
# I have no clue why QMenuBar::insertMenu only allows
# to insert before another menu and not after a menu...
new_action = self.menubar.insertMenu(before_action, new_menu)
return new_action
 
 
def menuAfter(self, menu):
# This method is needed for insertMenuAfter because
# QMenuBar.insertMenu can only insert before another menu
previous = None
for m in self.iter_menus():
if previous and previous == menu:
return m
previous = m
 
 
def appendMenu(self, menu):
"""
Probably not that usefull
because it will add a menu after the help menu
"""
action = self.menubar.addMenu(menu)
return action
 
 
def insertMenuAfter(self, after_menu, new_menu):
"""
Insert a menu before another menu in the menubar
"""
if isinstance(after_menu, basestring):
after_menu = self.findMenu(after_menu)
after_after_menu = self.menuAfter(after_menu)
if after_after_menu:
return self.insertMenuBefore(after_after_menu, new_menu)
else:
return self.appendMenu(new_menu)
 
 
def appendItem(self, menu, item, *extra_args):
if isinstance(menu, basestring):
title = menu
menu = self.findMenu(title)
if not menu:
raise ValueError, "Menu %r not found" % title
if isinstance(item, QMenu):
action = menu.addMenu(item)
else:
action = menu.addAction(item, *extra_args)
return action
 
 
def appendSeparator(self, menu):
if isinstance(menu, basestring):
menu = self.findMenu(menu)
menu.addSeparator()
/trunk/Scribus/scribus/plugins/scripter/python/scripter_runtime.py
0,0 → 1,273
"""
This runtime module contains everything about running
Python and QtScript scripts inside Scribus.
 
Look at run_filename for details.
"""
import os
import hashlib
from ConfigParser import ConfigParser
 
import sip
from PyQt4.QtCore import QThread, QObject, QVariant
from PyQt4.QtGui import qApp, QMessageBox
from PyQt4.QtScript import QScriptEngine, QScriptValue
 
from safe_eval import checkCode
import permitdlg
 
import __main__
 
from inspect import getargspec
 
class RuntimeConfig(ConfigParser):
# I cannot use Scripter.preferences because a safe script could
# mark other scripts as safe (=allowed) although they use import and
# other (possible) dangerous stuff..
# Perhaps I will find a better solution later.
 
def __init__(self):
ConfigParser.__init__(self)
# XXX better use ScPaths->...
path = os.path.expanduser("~/.scribus/scripter")
if not os.path.exists(path):
os.makedirs(path)
self.filename = os.path.join(path, "runtime.cfg")
self.read([self.filename])
 
 
def save(self):
fp = open(self.filename, "w")
self.write(fp)
fp.close()
 
 
def set(self, section, key, value):
if not self.has_section(section):
self.add_section(section)
ConfigParser.set(self, section, key, value)
self.save()
 
def getbool(self, section, key):
value = self.get(section, key).strip().lower()
if value and value in ["true", "on", "yes", "1"]:
return True
elif value and value in ["false", "off", "no", "0"]:
return False
else:
raise ValueError, "Invalid boolean value %r" % value
 
 
runtime_config = RuntimeConfig()
 
extension_namespace = __main__.__dict__
 
 
qts_engine = None
 
# XXX share namespaces of Python and QtScript
 
class QtSRuntimeError(Exception):
pass
 
 
def qts_func_decorator(func):
def wrapper(context, engine):
args = []
(fargs, fvarargs, fvarkw, fdefaults) = getargspec(func)
if len(fargs) and fargs[0] == "self":
args.append(context.thisObject())
for i in xrange(context.argumentCount()):
args.append(context.argument(i))
try:
result = func(*args)
except Exception, e:
# XXX correct behaviour?
# http://lists.trolltech.com/qt-interest/2007-06/thread00892-0.html
return context.throwValue(QScriptValue(engine, str(e)))
if result:
return QScriptValue(engine, result)
else:
return QScriptValue()
return wrapper
 
 
@qts_func_decorator
def alert(msg_qsv):
msg = msg_qsv.toString()
QMessageBox.information(Scripter.dialogs.mainWindow.qt, "Alert", msg)
 
 
def update_qs_namespace(engine, ns):
go = engine.globalObject()
for name, value in ns.items():
if isinstance(value, QObject):
value = engine.newQObject(value)
elif callable(value):
value = engine.newFunction(value)
#elif not isinstance(value, QScriptValue):
# value = QScriptValue(engine, value)
go.setProperty(name, value)
 
def newQScriptEngine():
engine = QScriptEngine()
update_qs_namespace(engine,
{
"Application": qApp,
"Scripter": Scripter.qt,
"alert": alert
})
return engine
 
 
def run_qtscript(filename, subroutine=None, extension=False):
global qts_engine
if not extension:
engine = newQScriptEngine()
else:
engine = qts_engine = qts_engine or newQScriptEngine()
code = open(filename).read()
engine.clearExceptions()
result = engine.evaluate(code)
engine.collectGarbage()
if not engine.hasUncaughtException() and subroutine:
sub = engine.globalObject().property(subroutine)
sub.call()
if engine.hasUncaughtException():
bt = engine.uncaughtExceptionBacktrace()
raise QtSRuntimeError("%s\nTraceback:\%s" % (
str(engine.uncaughtException().toString()),
"\n".join([" %s" % l for l in list(bt)])))
 
 
def hash_source(filename, source=None):
# I gueses sha256 is safe enough without collisions?
source = source or open(filename).read()
return "%s:%s:%s" % (
os.path.basename(filename), len(filename), hashlib.sha256(source).hexdigest())
 
 
def check_python(filename):
filename = os.path.abspath(os.path.expanduser(filename))
path = os.path.dirname(filename)
# Allow files from global autoload folder by default.
# XXX Good idea?
if path == os.path.join(Scripter.path, "autoload"):
return True
code = open(filename).read()
h = hash_source(filename, code)
if runtime_config.has_option("permissions", h):
return runtime_config.getbool("permissions", h)
 
problems = checkCode(code)
if problems and len(problems) == 1 and isinstance(problems[0], SyntaxError):
return True # let's ignore it and let excepthook hande the error later
elif problems:
ok = permitdlg.ask(filename, problems)
if ok == -2: # deny and remember
runtime_config.set("permissions", h, False)
return False
elif ok == 2: # deny
return False
elif ok == -1: # allow and remember
runtime_config.set("permissions", h, True)
elif ok == 1: # allow but now remember
pass
else:
raise ValueError, "Inknown return code for permission dialog: %r" % ok
return True
 
 
def run_python(filename, subroutine=None, extension=False):
if not extension:
namespace = {
__name__: "__scribus__",
__file__: filename
}
else:
namespace = extension_namespace
if not check_python(filename):
return
execfile(filename, namespace)
if subroutine:
sub = namespace[subroutine]
sub()
if not extension:
del namespace
 
 
threads = []
 
class RunThread(QThread):
 
def __init__(self, func, *args):
QThread.__init__(self, Scripter.qt)
self.func = func
self.args = args
 
 
def run(self):
threads.append(self)
self.func(*self.args)
threads.remove(self)
 
def run_background(func, *args):
thread = RunThread(func, *args)
thread.start()
# XXX: connect done signal with cleanup?
return thread
 
 
 
def mark_keep():
"""
mark every child of Scripter.collector to keep
"""
for child in Scripter.collector.children():
if hasattr(child, "qt"): child = child.qt
child.setProperty("keep", QVariant(True))
 
 
 
def cleanup():
"""
delete every child which is not marked as keep
"""
for child in Scripter.collector.children():
if hasattr(child, "qt"): child = child.qt
v = child.property("keep")
if v and v.toBool() == True:
#print "Keeping", child
continue
print "* deleting collected", child
sip.delete(child)
 
 
 
def run_filename(filename, subroutine=None, extension=False, background=False):
"""
Call this function to run a script and nothing else.
It will do everything for you, including garbage collection
for QtScript (very simple implementation, see mark_keep and cleanup).
Running as extension uses the __main__ namespace and does not
delete objects after execution.
Running in background as a thread is not much tested and
should only be used for non-GUI scripts.
"""
mark_keep()
if background:
run_func = run_background
else:
run_func = lambda func, *args: func(*args)
if filename.endswith((".sqts", ".qts", ".sjs", ".js")):
run_func(run_qtscript, filename, subroutine, extension)
else:
run_func(run_python, filename, subroutine, extension)
if not background and not extension:
# XXX: make sure this is called if an exception occures...
cleanup()
/trunk/Scribus/scribus/plugins/scripter/python/scribusscript.py
0,0 → 1,326
"""
Loader and handler for Scribus descriptor files/headers.
They help to integrate scripts into Scribus by definining menu-entries,
shortcuts, etc. Some additional metadata gives useful information and help.
 
See doc/TUTORIAL for a detailed explanation including examples.
"""
import sys
import re
import os
from ConfigParser import ConfigParser
from StringIO import StringIO
from PyQt4.QtGui import QKeySequence, QIcon
 
import excepthook
from scripter_hooks import MenuHooks
from scripter_runtime import run_filename
 
 
class ValidationError(Exception):
pass
 
class EmptyDescriptor(ValidationError):
pass
 
 
def validate_bool(value):
lvalue = value.lower()
if lvalue in ["0", "no", "false", "off"]:
return False
elif lvalue in ["1", "yes", "true", "on"]:
return True
 
 
def validate_regex(pattern):
def check(value):
found = re.match(pattern, value)
if found:
return found.group(0)
raise ValidationError, \
"Value %r does not match regular expression pattern %r" % pattern
return check
 
 
validate_ident = validate_regex("[A-Za-z_][A-Za-z_]*")
 
 
def validate_list(value):
return value.split(",")
def validate_intlist(value):
try:
return [int(v) for v in validate_list(value)]
except ValueError, e:
raise ValidationError, "Int-validation error: %s" % e
 
 
def validate_enum(*args):
def check(value):
if value.lower() in args:
return value.lower()
raise ValidationError, "%r not in %r" % (value, args)
return check
 
 
def validate_enumlist(*args):
def check(value):
l = []
for v in value.split(","):
l.append(validate_enum(args)(v))
return l
return check
 
 
class Item(object):
_counter = 0
 
def __init__(self, name, default=None, validate=None,
required=False):
self._item_id = Item._counter
Item._counter += 1
self.name = name
self.default = default
if isinstance(validate, basestring):
validate = validate_regex
self.validate = validate or (lambda v:v)
self.required = required
 
 
def __call__(self, value, ignore_errors=False):
try:
pyvalue = self.validate(value)
except ValidationError, e:
if not ignore_errors:
raise
pyvalue = self.default
return pyvalue
 
 
 
 
class ScribusScript(object):
 
# Some items are disabled for now.
# They will be supported in a future release.
items = [
Item("name"),
Item("title"),
Item("description"),
Item("icon"),
#Item("category"),
Item("menu", "Scripter"),
#Item("context_menu"),
Item("shortcut"),
Item("filename"),
Item("subroutine"),
Item("author"),
Item("contact"),
Item("homepage"),
Item("version"),
Item("copyright", "Licensed under GPLl 2 or later"),
Item("scribus_version"),
#Item("tags", [], validate_list),
#Item("depends", [], validate_list),
#Item("requires", [], validate_enumlist(
# "document", "selection", "text", "image")),
Item("redraw", True, validate_bool),
Item("mode", "interactive", validate_enum("batch", "interactive", "extension")),
#Item("before_action"),
#Item("after_action"),
#Item("on_event"),
Item("language", "python", validate_enum("python", "qtscript")),
Item("separator_before", False, validate_bool),
Item("separator_after", False, validate_bool),
Item("background_mode", False, validate_bool),
]
 
 
def __init__(self, _data=None, **kwargs):
self.data = {}
d = dict(_data or {}, **kwargs)
for item in self.__class__.items:
self.data[item.name] = d.pop(item.name, item.default)
if d:
raise TypeError, "Unknown items: %s" % ", ".join(d.keys())
 
 
def __repr__(self):
return "<%s %r>" % (self.__class__.__name__, self.data)
 
 
def __getattr__(self, name):
return self.data[name]
def __getitem__(self, name):
return self.data[name]
 
def get(self, name, default=None):
return self.data.get(name, default)
 
def __setitem__(self, name, value):
self.data[name] = value
 
 
def install(self):
"""
currently only can create menu entries and sets shortcuts
"""
if self.menu:
mh = MenuHooks()
menu = mh.findMenu(self.menu)
if not menu:
menu = mh.createMenu(self.menu)
mh.appendMenu(menu)
if self.separator_before:
mh.appendSeparator(menu)
self.action = mh.appendItem(menu, self.title, lambda :self.run())
if self.separator_after:
mh.appendSeparator(menu)
if self.icon:
icon_filename = os.path.join(
os.path.dirname(self.filename), self.icon)
if os.path.exists(icon_filename):
self.action.setIcon(QIcon(icon_filename))
else:
print >> sys.stderr, "Icon %r not found" % icon_filename
if self.shortcut:
self.action.setShortcut(QKeySequence(self.shortcut))
 
 
def run(self, catch_errors=True):
"""
uses scripter_runtime to call a script
"""
try:
win = Scripter.activeWindow
if win:
win.redraw = self.redraw
run_filename(self.filename, self.subroutine,
extension=(self.mode == "extension"),
background=self.background_mode)
if win:
win.redraw = True
if not self.redraw:
win.update()
except:
if not catch_errors:
raise
excepthook.show_current_error("Error running %r" % os.path.basename(self.filename))
 
 
@classmethod
def parse_filename(cls, filename):
s = open(filename).read(8192)
name, ext = os.path.splitext(os.path.basename(filename))
parse = cls.filetypes[ext]
try:
obj = parse(s)
except EmptyDescriptor:
if ext in [".spy"]:
language = "python"
elif ext in [".sjs", ".sqts"]:
language = "qtscript"
obj = cls(name=name, title=name.capitalize(),
language=language)
if not obj.get("filename"):
obj["filename"] = filename
return obj
 
 
@classmethod
def parse_python(cls, source):
s = "[ScribusScript]\nlanguage=python\n"
for line in source.splitlines():
if not line.startswith("#"):
break
if line.startswith("##"):
s += line[2:].strip() + "\n"
return cls.parse(s)
 
 
@classmethod
def parse_qtscript(cls, source):
s = "[ScribusScript]\nlanguage=qtscript\n"
for line in source.splitlines():
if not line.startswith("//"):
break
if line.startswith("///"):
s += line[3:].strip() + "\n"
return cls.parse(s)
 
 
@classmethod
def parse(cls, s):
data = {}
cfg = ConfigParser()
s = "[ScribusScript]\n" + s
cfg.readfp(StringIO(s))
options = cfg.options("ScribusScript")
if not len(options):
raise EmptyDescriptor
for item in cls.items:
if not item.name in options:
if item.required:
raise ValidationError, "Option %r required but not set" % item.name
else:
continue
options.remove(item.name)
value = cfg.get("ScribusScript", item.name)
data[item.name] = item(value)
if options:
raise ValidationError, "Invalid options found: %s" % ", ".join(options)
return cls(**data)
 
 
 
ScribusScript.filetypes = {
# XXX support zip archives
".spy": ScribusScript.parse_python,
".sjs": ScribusScript.parse_qtscript,
".sqts": ScribusScript.parse_qtscript,
".scs": ScribusScript.parse
}
 
 
 
def load_filename(filename):
return ScribusScript.parse_filename(filename)
 
 
 
def load_scripts(path_or_filename):
if os.path.isdir(path_or_filename):
path = os.path.abspath(os.path.expanduser(path_or_filename))
extensions = ScribusScript.filetypes.keys()
files = [ os.path.join(path, name) for name in os.listdir(path) \
if os.path.splitext(name)[1] in extensions ]
else:
files = [ os.path.abspath(os.path.expanduser(path_or_filename)) ]
scripts = []
for filename in files:
try:
sd = load_filename(filename)
scripts.append(sd)
except:
excepthook.show_current_error("Error loading %r" % os.path.basename(filename))
return scripts
 
 
 
 
if __name__ == "__main__":
# Show script descriptor for given files
for filename in sys.argv[1:]:
script = ScribusScript.parse_filename(filename)
print filename
print script
if not sys.argv[1:]:
for sd in load_scripts("."):
print sd
/trunk/Scribus/scribus/plugins/scripter/python/update_allowed_scripts.py
0,0 → 1,28
#!/usr/bin/env python
"""
This script creates hash codes for scripts in the autload folder.
Normally permitdlg warns about imports and private attribute access.
The idea is to ship Scribus with "signed" scripts which can be safely
used although they might use unsafe statements.
"""
 
import sys
import os
import pprint
from scripter_runtime import hash_source
 
 
def main(files):
# XXX add to build process somehow?
allowed = []
for name in files:
if not name.endswith(("~", "#", ".pyc", ".pyo")):
fn = os.path.join("autoload", name)
if not os.path.isdir(fn):
allowed.append(hash_source(fn))
print "allowed_scripts = ",
pprint.pprint(allowed)
if __name__ == "__main__":
main(sys.argv[1:])
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: Scribus/scribus/plugins/scripter/python/cleanup_scripter.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/cleanup_scripter.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/cleanup_scripter.py (revision 14647)
@@ -0,0 +1,4 @@
+"""
+Nothing to do at the moment. Perhaps send signal and notify all extensions.
+"""
+print "cleanup_scripter.py called"
Index: Scribus/scribus/plugins/scripter/python/excepthook_ui.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/excepthook_ui.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/excepthook_ui.py (revision 14647)
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'excepthook.ui'
+#
+# Created: Sun Jun 15 01:19:42 2008
+# by: PyQt4 UI code generator 4.4.2
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_ExceptHookDialog(object):
+ def setupUi(self, ExceptHookDialog):
+ ExceptHookDialog.setObjectName("ExceptHookDialog")
+ ExceptHookDialog.resize(542,290)
+ self.verticalLayout = QtGui.QVBoxLayout(ExceptHookDialog)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.gridLayout = QtGui.QGridLayout()
+ self.gridLayout.setSpacing(10)
+ self.gridLayout.setObjectName("gridLayout")
+ self.label = QtGui.QLabel(ExceptHookDialog)
+ self.label.setObjectName("label")
+ self.gridLayout.addWidget(self.label,0,0,1,1)
+ self.closeButton = QtGui.QPushButton(ExceptHookDialog)
+ self.closeButton.setObjectName("closeButton")
+ self.gridLayout.addWidget(self.closeButton,0,1,1,1)
+ self.exceptionLabel = QtGui.QLabel(ExceptHookDialog)
+ font = QtGui.QFont()
+ font.setWeight(75)
+ font.setBold(True)
+ self.exceptionLabel.setFont(font)
+ self.exceptionLabel.setObjectName("exceptionLabel")
+ self.gridLayout.addWidget(self.exceptionLabel,1,0,1,1)
+ self.detailsButton = QtGui.QPushButton(ExceptHookDialog)
+ self.detailsButton.setObjectName("detailsButton")
+ self.gridLayout.addWidget(self.detailsButton,1,1,1,1)
+ self.verticalLayout.addLayout(self.gridLayout)
+ self.tracebackBrowser = QtGui.QTextBrowser(ExceptHookDialog)
+ self.tracebackBrowser.setMinimumSize(QtCore.QSize(0,200))
+ self.tracebackBrowser.setObjectName("tracebackBrowser")
+ self.verticalLayout.addWidget(self.tracebackBrowser)
+
+ self.retranslateUi(ExceptHookDialog)
+ QtCore.QMetaObject.connectSlotsByName(ExceptHookDialog)
+
+ def retranslateUi(self, ExceptHookDialog):
+ ExceptHookDialog.setWindowTitle(QtGui.QApplication.translate("ExceptHookDialog", "Script error", None, QtGui.QApplication.UnicodeUTF8))
+ self.label.setText(QtGui.QApplication.translate("ExceptHookDialog", "An exception occured while running the script.", None, QtGui.QApplication.UnicodeUTF8))
+ self.closeButton.setText(QtGui.QApplication.translate("ExceptHookDialog", "&Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.exceptionLabel.setText(QtGui.QApplication.translate("ExceptHookDialog", "Exception", None, QtGui.QApplication.UnicodeUTF8))
+ self.detailsButton.setText(QtGui.QApplication.translate("ExceptHookDialog", "&Details >>", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtGui.QApplication(sys.argv)
+ ExceptHookDialog = QtGui.QDialog()
+ ui = Ui_ExceptHookDialog()
+ ui.setupUi(ExceptHookDialog)
+ ExceptHookDialog.show()
+ sys.exit(app.exec_())
+
Index: Scribus/scribus/plugins/scripter/python/excepthook.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/excepthook.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/excepthook.py (revision 14647)
@@ -0,0 +1,95 @@
+"""
+Exception hook
+If some unexpected error occures it can be shown in a nice looking dialog.
+Especially useful is the traceback view.
+
+Things to extend: Clicking on the filename should open an editor.
+Things to consider: Mail exceptions, copy to clipboard or send to bug tracker.
+"""
+import sys
+import cgitb
+import atexit
+
+from PyQt4.QtCore import pyqtSignature, Qt
+from PyQt4.QtGui import QDialog, QApplication
+
+from excepthook_ui import Ui_ExceptHookDialog
+
+
+
+def on_error(exc_type, exc_obj, exc_tb):
+ """
+ This is the callback function for sys.excepthook
+ """
+ dlg = ExceptHookDialog(exc_type, exc_obj, exc_tb)
+ dlg.show()
+ dlg.exec_()
+
+
+
+def show_current_error(title=None):
+ """
+ Call this function to show the current error.
+ It can be used inside an except-block.
+ """
+ dlg = ExceptHookDialog(sys.exc_type, sys.exc_value, sys.exc_traceback, title)
+ dlg.show()
+ dlg.exec_()
+
+
+def install():
+ "activates the error handler"
+ sys.excepthook = on_error
+
+
+
+def uninstall():
+ "removes the error handler"
+ sys.excepthook = sys.__excepthook__
+
+atexit.register(uninstall)
+
+
+class ExceptHookDialog(QDialog):
+
+
+ def __init__(self, exc_type, exc_obj, exc_tb, title=None):
+ QDialog.__init__(self)
+ self.ui = Ui_ExceptHookDialog()
+ self.ui.setupUi(self)
+ if title:
+ self.setWindowTitle(self.windowTitle() + ": " + title)
+ self.ui.detailsButton.setCheckable(True)
+ self.setExtension(self.ui.tracebackBrowser)
+ self.setOrientation(Qt.Vertical)
+ msg = "%s: %s" % (exc_type.__name__, exc_obj)
+ self.ui.exceptionLabel.setText(msg)
+ html = cgitb.html((exc_type, exc_obj, exc_tb))
+ self.ui.tracebackBrowser.setText(html)
+ self.resize(self.sizeHint())
+
+
+ @pyqtSignature("")
+ def on_closeButton_clicked(self):
+ self.close()
+
+
+ @pyqtSignature("")
+ def on_detailsButton_clicked(self):
+ self.showExtension(self.ui.detailsButton.isChecked())
+
+
+
+if __name__ == "__main__":
+ # Some tests:
+ app = QApplication(sys.argv)
+ install()
+ print "Triggering error 1"
+ try:
+ fail = 1 / 0
+ except:
+ show_current_error("Using inside except")
+ print "Triggering error 2"
+ fail2 = 1 / 0
+ print "This will never be reached because excepthook"
+ print "complains about fail2"
Index: Scribus/scribus/plugins/scripter/python/permitdlg.ui
===================================================================
--- Scribus/scribus/plugins/scripter/python/permitdlg.ui (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/permitdlg.ui (revision 14647)
@@ -0,0 +1,138 @@
+<ui version="4.0" >
+ <class>PermitDialog</class>
+ <widget class="QDialog" name="PermitDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>603</width>
+ <height>393</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Confirm to run unsafe script</string>
+ </property>
+ <property name="sizeGripEnabled" >
+ <bool>true</bool>
+ </property>
+ <property name="modal" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QLabel" name="filenameLabel" >
+ <property name="text" >
+ <string>scriptname.py</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:8pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Attention:&lt;/span> This script file contains code which &lt;span style=" font-style:italic;">might harm &lt;/span>your system.&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You should only permit execution of this script if you are sure that it comes from a trustworthy source. &lt;/p>&lt;/body>&lt;/html></string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="detailsButton" >
+ <property name="text" >
+ <string>De&amp;tails >></string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QTextBrowser" name="problemsBrowser" >
+ <property name="html" >
+ <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;">
+&lt;p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';">&lt;/p>&lt;/body>&lt;/html></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QCheckBox" name="rememberCheck" >
+ <property name="text" >
+ <string>&amp;Remember preference for this file</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="allowButton" >
+ <property name="text" >
+ <string>&amp;Allow</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="denyButton" >
+ <property name="text" >
+ <string>&amp;Deny</string>
+ </property>
+ <property name="default" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: Scribus/scribus/plugins/scripter/python/init_scripter.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/init_scripter.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/init_scripter.py (revision 14647)
@@ -0,0 +1,92 @@
+# Add path of init_scripter to Python module search path
+import sys, os
+scripter_path = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, scripter_path)
+print >> sys.stderr, "%s added to PYTHONPATH" % scripter_path
+
+# Look for PyQt
+try:
+ from PyQt4.QtCore import PYQT_VERSION_STR, QObject, QCoreApplication
+ from PyQt4.QtGui import qApp, QMenu
+except ImportError:
+ print >> sys.stderr, "Python cannot find the Qt4 bindings."
+ print >> sys.stderr, "Please make sure, that the needed packages are installed."
+ print >> sys.stderr, "On Ubuntu and Debian(-like) distribubutions you have to install python-qt4"
+ raise
+try:
+ from PyQt4 import QtScript
+except ImportError, e:
+ print >> sys.stderr, "You seem to have Qt4 bindings without QtScript support."
+ print >> sys.stderr, "This is currently a requirement."
+ print >> sys.stderr, "Please make sure you have also libqt4-script installed."
+ raise
+
+# Shows nice looking error dialog if an unhandled exception occures.
+import excepthook
+excepthook.install()
+
+
+# Make sure PyQt is new enough
+if float(PYQT_VERSION_STR[:3]) < 4.4:
+ print >> sys.stderr, "Your installed PyQt4 is older than version 4.4"
+ print >> sys.stderr, "A newer version is needed. Please upgrade your packages."
+ raise ImportError, "PyQt4 not new enough"
+
+# Import helper modules
+from scripter_hooks import MenuHooks
+from mikro import create_pyqt_object, Error as MiKroError
+
+
+# Scripter and i18n should be available everywhere globally
+import __builtin__
+__builtin__.Scripter = create_pyqt_object(qApp).Scripter
+Scripter.qt.setParent(None)
+
+__builtin__.app = Scripter # shorter name for lazy people
+__builtin__.i18n = lambda s: unicode(QCoreApplication.translate("Scripter", s))
+Scripter.Error = MiKroError
+Scripter.path = scripter_path
+
+
+
+class ScripterMenu(QObject):
+ """
+ Scripter menu item in mainWindow menubar
+ """
+
+ def __init__(self, parent):
+ QObject.__init__(self, parent)
+ self.setObjectName("Menu")
+ self.popup = QMenu(i18n("Scripter"))
+ MenuHooks().insertMenuAfter("E&xtras", self.popup)
+ self._load_entries()
+
+
+ def _load_entries(self):
+ for path in [scripter_path, os.path.expanduser("~/.scribus/scripter/")]:
+ autoload_path = os.path.join(path, "autoload")
+ if not os.path.exists(autoload_path):
+ continue
+ sys.path.insert(0, autoload_path)
+ from scribusscript import load_scripts
+ self.autoload_scripts = scripts = load_scripts(autoload_path)
+ for sd in scripts:
+ try:
+ sd.install()
+ except:
+ excepthook.show_current_error(i18n("Error installing %r") % sd.name)
+
+
+ def addAction(self, title, callback, *args):
+ self.popup.addAction(title, callback, *args)
+
+
+ def addSeparator(self):
+ self.popup.addSeparator()
+
+
+def createMenu(mainWindow):
+ Scripter.menu = ScripterMenu(mainWindow)
+
+Scripter.connect("createMenu(QMainWindow*)", createMenu)
+
Index: Scribus/scribus/plugins/scripter/python/autoload/help.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/autoload/help.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/autoload/help.spy (revision 14647)
@@ -0,0 +1,11 @@
+## title = Get help on Scripter
+## menu = &Help
+## separator_before = True
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+URL = "http://scripterng.blogspot.com"
+
+if not QDesktopServices.openUrl(QUrl(URL)):
+ import webbrowser
+ webbrowser.open_new(URL)
Index: Scribus/scribus/plugins/scripter/python/autoload/about.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/autoload/about.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/autoload/about.spy (revision 14647)
@@ -0,0 +1,3 @@
+## title = About
+
+Scripter.aboutScripter()
Index: Scribus/scribus/plugins/scripter/python/autoload/sceditor.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/autoload/sceditor.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/autoload/sceditor.spy (revision 14647)
@@ -0,0 +1,5 @@
+## title = Script &Editor and Console
+## shortcut = Esc,e
+
+import sceditor
+sceditor.launch(Scripter.dialogs.mainWindow.qt)
Index: Scribus/scribus/plugins/scripter/python/autoload/fullscreen.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/autoload/fullscreen.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/autoload/fullscreen.spy (revision 14647)
@@ -0,0 +1,9 @@
+## name = fullscreen
+## title = Toggle fullscreen
+## shortcut = Esc, f
+
+mainWin = Scripter.dialogs.mainWindow
+if mainWin.fullScreen:
+ mainWin.showNormal()
+else:
+ mainWin.showFullScreen()
Index: Scribus/scribus/plugins/scripter/python/autoload/runfile.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/autoload/runfile.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/autoload/runfile.spy (revision 14647)
@@ -0,0 +1,40 @@
+## title = &Run script from file
+## shortcut = Esc,r
+## subroutine = run
+import os
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+from scribusscript import load_filename
+from excepthook import show_current_error
+
+RECENT_LENGTH = 5
+CONFIG_CONTEXT = "scripter"
+CONFIG_PATH = "runfile_path"
+CONFIG_RECENT = "runfile_recent"
+
+
+def run():
+ prefs = Scripter.preferences
+ examples_path = os.path.join(Scripter.path, "examples")
+ path = prefs.getString(CONFIG_CONTEXT, CONFIG_PATH) or examples_path
+
+ filename = QFileDialog.getOpenFileName(
+ Scripter.dialogs.mainWindow.qt, i18n("Run script"), path, "*.scs *.spy *.sqts *.sjs")
+ filename = str(filename)
+ if filename:
+ recent = str(prefs.getString(CONFIG_CONTEXT,CONFIG_RECENT))
+ recent = [r for r in recent.split(",") if r]
+ if len(recent) > RECENT_LENGTH:
+ del recent[0]
+ recent.append(filename)
+ prefs.setString(CONFIG_CONTEXT, CONFIG_RECENT, ",".join(recent))
+
+ path, name = os.path.split(filename)
+ prefs.setString(CONFIG_CONTEXT, CONFIG_PATH, path)
+ try:
+ script = load_filename(filename)
+ except:
+ show_current_error("Error loading script %r" % name)
+ else:
+ script.run()
Index: Scribus/scribus/plugins/scripter/python/mikro.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/mikro.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/mikro.py (revision 14647)
@@ -0,0 +1,449 @@
+# -*- coding: utf-8 -*-
+"""
+Mini Kross - a scripting solution inspired by Kross (http://kross.dipe.org/)
+Technically this is one of the most important modules in Scripter.
+Via the Qt meta object system it provides access to unwrapped objects.
+This code uses a lot of metaprogramming magic. To fully understand it,
+you have to know about metaclasses in Python
+"""
+from __future__ import with_statement
+import sip
+from PyQt4.QtCore import (
+ QMetaObject, Q_RETURN_ARG, QString, Q_ARG,
+ QObject, QVariant, Qt, SIGNAL, QMetaMethod)
+from PyQt4.QtGui import QBrush, QFont, QPixmap, qApp, QImage, QPalette
+
+
+variant_converter = {
+ # XXX QList<type>, QMap<*>, longlong
+ "QVariantList": lambda v: from_variantlist(v),
+ "QList<QVariant>": lambda v: v.toList(),
+ "int": lambda v: v.toInt()[0],
+ "double": lambda v: v.toDouble()[0],
+ "char": lambda v: v.toChar(),
+ "QByteArray": lambda v: v.toByteArray(),
+ "QString": lambda v: unicode(v.toString()),
+ "QPoint": lambda v: v.toPoint(),
+ "QPointF": lambda v: v.toPointF(),
+ "QSize": lambda v: v.toSize(),
+ "QLine": lambda v: v.toLine(),
+ "QStringList": lambda v: v.toStringList(),
+ "QTime": lambda v: v.toTime(),
+ "QDateTime": lambda v: v.toDateTime(),
+ "QDate": lambda v: v.toDate(),
+ "QLocale": lambda v: v.toLocale(),
+ "QUrl": lambda v: v.toUrl(),
+ "QRect": lambda v: v.toRect(),
+ "QBrush": lambda v: QBrush(v),
+ "QFont": lambda v: QFont(v),
+ "QPalette": lambda v: QPalette(v),
+ "QPixmap": lambda v: QPixmap(v),
+ "QImage": lambda v: QImage(v),
+ "bool": lambda v: v.toBool(),
+ "QObject*": lambda v: Scripter.fromVariant(v),
+ "QWidget*": lambda v: Scripter.fromVariant(v),
+}
+
+
+
+def from_variantlist(variantlist):
+ """
+ convert QList<QVariant> to a normal Python list
+ """
+ return [from_variant(variant) for variant in variantlist.toList()]
+
+
+
+def classname(obj):
+ """
+ return real class name
+ Unwrapped classes will be represended in PyQt by a known base class.
+ So obj.__class__.__name__ will not return the desired class name
+ """
+ return obj.metaObject().className()
+
+
+
+def from_variant(variant):
+ """
+ convert a QVariant to a Python value
+ """
+ typeName = variant.typeName()
+ convert = variant_converter.get(typeName)
+ if not convert:
+ raise ValueError, "Could not convert value to %s" % typeName
+ else:
+ return convert(variant)
+
+
+
+qtclasses = {}
+
+def supercast(obj):
+ """
+ cast a QObject subclass to the best known wrapped super class
+ """
+ if not qtclasses:
+ # To get really all Qt classes I would have to
+ # import QtNetwork, QtXml, QtSvg and QtScript, too.
+ import PyQt4
+ qtclasses.update(
+ dict([(key, value) \
+ for key, value in PyQt4.QtCore.__dict__.items() + PyQt4.QtGui.__dict__.items() \
+ if hasattr(value, "__subclasses__") and issubclass(value, QObject)])
+ )
+ try:
+ if not issubclass(value, QObject):
+ return obj
+ except TypeError:
+ # no class - no cast...
+ return obj
+ mo = obj.metaObject()
+ while mo:
+ cls = qtclasses.get(str(mo.className()))
+ if cls:
+ return sip.cast(obj, cls)
+ mo = mo.superClass()
+ # This should never be reached
+ return obj
+
+
+
+def wrap(obj, force=False):
+ """
+ If a class is not known by PyQt it will be automatically
+ casted to a known wrapped super class.
+ But that limits access to methods and propperties of this super class.
+ So instead this functions returns a wrapper class (PyQtClass)
+ which queries the metaObject and provides access to
+ all slots and all properties.
+ """
+ if isinstance(obj, QString):
+ # prefer Python strings
+ return unicode(obj)
+ elif isinstance(obj, PyQtClass):
+ # already wrapped
+ return obj
+ if obj and isinstance(obj, QObject):
+ if force or obj.__class__.__name__ != obj.metaObject().className():
+ # Ah this is an unwrapped class
+ obj = create_pyqt_object(obj)
+ return obj
+
+
+
+def is_wrapped(obj):
+ """
+ checks if a object is wrapped by PyQtClass
+ """
+ # XXX: Any better/faster check?
+ return hasattr(obj, "qt")
+
+
+
+def unwrap(obj):
+ """
+ if wrapped returns the wrapped object
+ """
+ if is_wrapped(obj):
+ obj = obj.qt
+ return obj
+
+
+
+def is_qobject(obj):
+ """
+ checks if class or wrapped class is a subclass of QObject
+ """
+ if hasattr(obj, "__bases__") and issubclass(unwrap(obj), QObject):
+ return True
+ else:
+ return False
+
+
+def is_scripter_child(qobj):
+ """
+ walk up the object tree until Scripter or the root is found
+ """
+ found = False
+ p = qobj.parent()
+ while p and not found:
+ if str(p.objectName()) == "Scripter":
+ found = True
+ break
+ else:
+ p = p.parent()
+ return found
+
+
+
+class Error(Exception):
+ """
+ Base error classed. Catch this to handle exceptions comming from C++
+ """
+
+
+
+class PyQtClass(object):
+ """
+ Base class
+ """
+
+ def __init__(self, instance):
+ self._instance = instance
+
+
+ def __del__(self):
+ """
+ If this object is deleted it should also delete the wrapped object
+ if it was created explicitly for this use.
+ """
+ qobj = self._instance
+ if is_scripter_child(qobj):
+ if len(qobj.children()):
+ print "Cannot delete", qobj, "because it has child objects"
+ #else:
+ # print "* deleting", qobj
+ # XXX: or better setdeleted ?
+ sip.delete(qobj)
+ #else:
+ # print "* NOT deleting", qobj
+
+
+ def setProperty(self, name, value):
+ self._instance.setProperty(name, QVariant(value))
+
+
+ def getProperty(self, name):
+ return wrap(self._instance.property(name))
+
+
+ def propertyNames(self):
+ return self.__class__.__properties__.keys()
+
+
+ def dynamicPropertyNames(self):
+ return self._instance.dynamicPropertyNames()
+
+
+ def metaObject(self):
+ return self._instance.metaObject()
+
+
+ def connect(self, signal, slot):
+ self._instance.connect(self._instance, SIGNAL(signal), slot)
+
+
+ def disconnect(self, signal, slot):
+ self._instance.disconnect(self._instance, SIGNAL(signal), slot)
+
+
+ def parent(self):
+ return wrap(self._instance.parent())
+
+
+ def children(self):
+ return [wrap(c) for c in self._instance.children()]
+
+
+ @property
+ def qt(self):
+ return self._instance
+
+
+ def __getitem__(self, key):
+ if isinstance(key, int):
+ length = getattr(self, "length", None)
+ if length is not None:
+ # array protocol
+ try:
+ return getattr(self, str(key))
+ except AttributeError, e:
+ raise IndexError, key
+ else:
+ return self.children()[key]
+ else:
+ return getattr(self, key)
+
+
+ def __getattr__(self, name):
+ # Make named child objects available as attributes like QtScript
+ for child in self._instance.children():
+ if str(child.objectName()) == name:
+ obj = wrap(child)
+ # save found object for faster lookup
+ setattr(self, name, obj)
+ return obj
+ # Dynamic object property?
+ variant = self._instance.property(name)
+ if variant.type() != 0:
+ return from_variant(variant)
+ raise AttributeError, name
+
+
+ @property
+ def __members__(self):
+ """
+ This method is for introspection.
+ Using dir(thispyqtclass_object) returns a list of
+ all children, methods, properties and dynamic properties.
+ """
+ names = self.__dict__.keys()
+ for c in self._instance.children():
+ child_name = str(c.objectName())
+ if child_name:
+ names.append(child_name)
+ # XXX: add unnamed childs?
+ for pn in self._instance.dynamicPropertyNames():
+ names.append(str(pn))
+ return names
+
+
+ def __enter__(self):
+ print "__enter__", self
+
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ print "__exit__", self, exc_type, exc_value, traceback
+
+
+
+
+class PyQtProperty(object):
+
+ # slots for more speed
+ __slots__ = ["meta_property", "name", "__doc__", "read_only"]
+
+
+ def __init__(self, meta_property):
+ self.meta_property = meta_property
+ self.name = meta_property.name()
+ self.read_only = not meta_property.isWritable()
+ self.__doc__ = "%s is a %s%s" % (
+ self.name, meta_property.typeName(),
+ self.read_only and " (read-only)" or ""
+ )
+
+
+ def get(self, obj):
+ return from_variant(self.meta_property.read(obj._instance))
+
+
+ def set(self, obj, value):
+ self.meta_property.write(obj._instance, QVariant(value))
+
+
+
+
+class PyQtMethod(object):
+
+ __slots__ = ["meta_method", "name", "args", "returnType", "__doc__"]
+
+
+ def __init__(self, meta_method):
+ self.meta_method = meta_method
+ self.name, args = str(meta_method.signature()).split("(", 1)
+ self.args = args[:-1].split(",")
+ self.returnType = str(meta_method.typeName())
+
+ types = [str(t) for t in meta_method.parameterTypes()]
+ names = [str(n) or "arg%i" % (i+1) \
+ for i, n in enumerate(meta_method.parameterNames())]
+ params = ", ".join("%s %s" % (t, n) for n, t in zip(types, names))
+
+ self.__doc__ = "%s(%s)%s" % (
+ self.name, params,
+ self.returnType and (" -> %s" % self.returnType) or ""
+ )
+
+
+ def instancemethod(self):
+ def wrapper(obj, *args):
+ # XXX: support kwargs?
+ qargs = [Q_ARG(t, v) for t, v in zip(self.args, args)]
+ invoke_args = [obj._instance, self.name]
+ invoke_args.append(Qt.DirectConnection)
+ rtype = self.returnType
+ if rtype:
+ invoke_args.append(Q_RETURN_ARG(rtype))
+ invoke_args.extend(qargs)
+ try:
+ result = QMetaObject.invokeMethod(*invoke_args)
+ error_msg = str(qApp.property("MIKRO_EXCEPTION").toString())
+ if error_msg:
+ # clear message
+ qApp.setProperty("MIKRO_EXCEPTION", QVariant())
+ raise Error(error_msg)
+ except RuntimeError, e:
+ raise TypeError, \
+ "%s.%s(%r) call failed: %s" % (obj, self.name, args, e)
+ return wrap(result)
+ wrapper.__doc__ = self.__doc__
+ return wrapper
+
+
+
+
+# Cache on-the-fly-created classes for better speed
+# XXX Should I use weak references?
+pyqt_classes = {}
+
+def create_pyqt_class(metaobject):
+ class_name = str(metaobject.className())
+ cls = pyqt_classes.get(class_name)
+ if cls:
+ return cls
+ attrs = {}
+
+ properties = attrs["__properties__"] = {}
+ for i in range(metaobject.propertyCount()):
+ prop = PyQtProperty(metaobject.property(i))
+ prop_name = str(prop.name)
+ #prop_name = prop_name[0].upper() + prop_name[1:]
+ if prop.read_only:
+ # XXX: write set-method which raises an error
+ properties[prop_name] = attrs[prop_name] = property(prop.get, doc=prop.__doc__)
+ else:
+ properties[prop_name] = attrs[prop_name] = property(
+ prop.get, prop.set, doc=prop.__doc__)
+
+ methods = attrs["__methods__"] = {}
+ for i in range(metaobject.methodCount()):
+ meta_method = metaobject.method(i)
+ if meta_method.methodType() != QMetaMethod.Signal:
+ method = PyQtMethod(meta_method)
+ method_name = method.name
+ if method_name in attrs:
+ # There is already a property with this name
+ # So append an underscore
+ method_name += "_"
+ instance_method = method.instancemethod()
+ instance_method.__doc__ = method.__doc__
+ methods[method_name] = attrs[method_name] = instance_method
+
+ # Python is great :)
+ # It can dynamically create a class with a base class and a dictionary
+ cls = type(class_name, (PyQtClass,), attrs)
+ pyqt_classes[class_name] = cls
+ return cls
+
+
+
+def create_pyqt_object(obj):
+ """
+ Wrap a QObject and make all slots and properties dynamically available.
+ @type obj: QObject
+ @param obj: an unwrapped QObject
+ @rtype: PyQtClass object
+ @return: dynamicaly created object with all available properties and slots
+
+ This is probably the only function you need from this module.
+ Everything else are helper functions and classes.
+ """
+ cls = create_pyqt_class(obj.metaObject())
+ return cls(obj)
+
+
+
+
+
Index: Scribus/scribus/plugins/scripter/python/permitdlg_ui.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/permitdlg_ui.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/permitdlg_ui.py (revision 14647)
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'permitdlg.ui'
+#
+# Created: Sun Aug 10 16:28:16 2008
+# by: PyQt4 UI code generator 4.4.2
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_PermitDialog(object):
+ def setupUi(self, PermitDialog):
+ PermitDialog.setObjectName("PermitDialog")
+ PermitDialog.resize(603,393)
+ PermitDialog.setSizeGripEnabled(True)
+ PermitDialog.setModal(True)
+ self.gridLayout = QtGui.QGridLayout(PermitDialog)
+ self.gridLayout.setObjectName("gridLayout")
+ self.horizontalLayout = QtGui.QHBoxLayout()
+ self.horizontalLayout.setObjectName("horizontalLayout")
+ self.verticalLayout = QtGui.QVBoxLayout()
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.filenameLabel = QtGui.QLabel(PermitDialog)
+ self.filenameLabel.setObjectName("filenameLabel")
+ self.verticalLayout.addWidget(self.filenameLabel)
+ self.label = QtGui.QLabel(PermitDialog)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
+ self.label.setSizePolicy(sizePolicy)
+ self.label.setWordWrap(True)
+ self.label.setObjectName("label")
+ self.verticalLayout.addWidget(self.label)
+ self.horizontalLayout.addLayout(self.verticalLayout)
+ self.detailsButton = QtGui.QPushButton(PermitDialog)
+ self.detailsButton.setCheckable(True)
+ self.detailsButton.setObjectName("detailsButton")
+ self.horizontalLayout.addWidget(self.detailsButton)
+ self.gridLayout.addLayout(self.horizontalLayout,0,0,1,1)
+ self.problemsBrowser = QtGui.QTextBrowser(PermitDialog)
+ self.problemsBrowser.setObjectName("problemsBrowser")
+ self.gridLayout.addWidget(self.problemsBrowser,1,0,1,1)
+ self.rememberCheck = QtGui.QCheckBox(PermitDialog)
+ self.rememberCheck.setObjectName("rememberCheck")
+ self.gridLayout.addWidget(self.rememberCheck,2,0,1,1)
+ self.horizontalLayout_2 = QtGui.QHBoxLayout()
+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
+ self.horizontalLayout_2.addItem(spacerItem)
+ self.allowButton = QtGui.QPushButton(PermitDialog)
+ self.allowButton.setObjectName("allowButton")
+ self.horizontalLayout_2.addWidget(self.allowButton)
+ self.denyButton = QtGui.QPushButton(PermitDialog)
+ self.denyButton.setDefault(True)
+ self.denyButton.setObjectName("denyButton")
+ self.horizontalLayout_2.addWidget(self.denyButton)
+ spacerItem1 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
+ self.horizontalLayout_2.addItem(spacerItem1)
+ self.gridLayout.addLayout(self.horizontalLayout_2,3,0,1,1)
+
+ self.retranslateUi(PermitDialog)
+ QtCore.QMetaObject.connectSlotsByName(PermitDialog)
+
+ def retranslateUi(self, PermitDialog):
+ PermitDialog.setWindowTitle(QtGui.QApplication.translate("PermitDialog", "Confirm to run unsafe script", None, QtGui.QApplication.UnicodeUTF8))
+ self.filenameLabel.setText(QtGui.QApplication.translate("PermitDialog", "scriptname.py", None, QtGui.QApplication.UnicodeUTF8))
+ self.label.setText(QtGui.QApplication.translate("PermitDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
+"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
+"p, li { white-space: pre-wrap; }\n"
+"</style></head><body style=\" font-family:\'Sans Serif\'; font-size:8pt; font-weight:400; font-style:normal;\">\n"
+"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Attention:</span> This script file contains code which <span style=\" font-style:italic;\">might harm </span>your system.</p>\n"
+"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
+"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">You should only permit execution of this script if you are sure that it comes from a trustworthy source. </p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
+ self.detailsButton.setText(QtGui.QApplication.translate("PermitDialog", "De&tails >>", None, QtGui.QApplication.UnicodeUTF8))
+ self.problemsBrowser.setHtml(QtGui.QApplication.translate("PermitDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
+"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
+"p, li { white-space: pre-wrap; }\n"
+"</style></head><body style=\" font-family:\'DejaVu Sans\'; font-size:8pt; font-weight:400; font-style:normal;\">\n"
+"<p style=\"-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Sans Serif\';\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
+ self.rememberCheck.setText(QtGui.QApplication.translate("PermitDialog", "&Remember preference for this file", None, QtGui.QApplication.UnicodeUTF8))
+ self.allowButton.setText(QtGui.QApplication.translate("PermitDialog", "&Allow", None, QtGui.QApplication.UnicodeUTF8))
+ self.denyButton.setText(QtGui.QApplication.translate("PermitDialog", "&Deny", None, QtGui.QApplication.UnicodeUTF8))
+
Index: Scribus/scribus/plugins/scripter/python/safe_eval.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/safe_eval.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/safe_eval.py (revision 14647)
@@ -0,0 +1,507 @@
+# Copyright (C) 2007 Jeremy S. Sanders
+# Email: Jeremy Sanders <jeremy@jeremysanders.net>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+###############################################################################
+
+# $Id: safe_eval.py 725 2008-02-12 12:27:38Z jeremysanders $
+
+"""
+'Safe' python code evaluation
+
+Based on the public domain code of Babar K. Zafar
+http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496746
+(version 0.1 or 1.2 May 27 2006)
+
+The idea is to examine the compiled ast tree and chack for invalid
+entries
+
+I have removed the timeout checking as this probably isn't a serious
+problem for veusz documents
+"""
+
+import parser
+import inspect, compiler.ast
+import thread, time
+import __builtin__
+import os.path
+
+#import numpy as N
+
+#----------------------------------------------------------------------
+# Module globals.
+#----------------------------------------------------------------------
+
+# Toggle module level debugging mode.
+DEBUG = False
+
+# List of all AST node classes in compiler/ast.py.
+all_ast_nodes = [name for (name, obj) in inspect.getmembers(compiler.ast)
+ if inspect.isclass(obj) and
+ issubclass(obj, compiler.ast.Node)]
+
+# List of all builtin functions and types (ignoring exception classes).
+all_builtins = [name for (name, obj) in inspect.getmembers(__builtin__)
+ if inspect.isbuiltin(obj) or
+ (inspect.isclass(obj) and not issubclass(obj, Exception))]
+
+#----------------------------------------------------------------------
+# Utilties.
+#----------------------------------------------------------------------
+
+def classname(obj):
+ return obj.__class__.__name__
+
+def get_node_lineno(node):
+ return (node.lineno) and node.lineno or 0
+
+#----------------------------------------------------------------------
+# Restricted AST nodes & builtins.
+#----------------------------------------------------------------------
+
+# Deny evaluation of code if the AST contain any of the following nodes:
+unallowed_ast_nodes = (
+ # 'Add', 'And',
+ # 'AssAttr', 'AssList', 'AssName', 'AssTuple',
+ # 'Assert', 'Assign', 'AugAssign',
+ 'Backquote',
+ # 'Bitand', 'Bitor', 'Bitxor', 'Break',
+ # 'CallFunc', 'Class', 'Compare', 'Const', 'Continue',
+ # 'Decorators', 'Dict', 'Discard', 'Div',
+ # 'Ellipsis', 'EmptyNode',
+ 'Exec',
+ # 'Expression', 'FloorDiv',
+ # 'For',
+ 'From',
+ # 'Function',
+ # 'GenExpr', 'GenExprFor', 'GenExprIf', 'GenExprInner',
+ # 'Getattr', 'Global', 'If',
+ 'Import',
+ # 'Invert',
+ # 'Keyword', 'Lambda', 'LeftShift',
+ # 'List', 'ListComp', 'ListCompFor', 'ListCompIf', 'Mod',
+ # 'Module',
+ # 'Mul', 'Name', 'Node', 'Not', 'Or', 'Pass', 'Power',
+ # 'Print', 'Printnl',
+ 'Raise',
+ # 'Return', 'RightShift', 'Slice', 'Sliceobj',
+ # 'Stmt', 'Sub', 'Subscript',
+ 'TryExcept', 'TryFinally',
+ # 'Tuple', 'UnaryAdd', 'UnarySub',
+ # 'While','Yield'
+ )
+
+# Deny evaluation of code if it tries to access any of the following builtins:
+unallowed_builtins = (
+ '__import__',
+ # 'abs', 'apply', 'basestring', 'bool', 'buffer',
+ # 'callable', 'chr', 'classmethod', 'cmp', 'coerce',
+ 'compile',
+ # 'complex',
+ 'delattr',
+ # 'dict',
+ 'dir',
+ # 'divmod', 'enumerate',
+ 'eval', 'execfile', 'file',
+ # 'filter', 'float', 'frozenset',
+ 'getattr', 'globals', 'hasattr',
+ # 'hash', 'hex', 'id',
+ 'input',
+ # 'int', 'intern', 'isinstance', 'issubclass', 'iter',
+ # 'len', 'list',
+ 'locals',
+ # 'long', 'map', 'max', 'min', 'object', 'oct',
+ 'open',
+ # 'ord', 'pow', 'property', 'range',
+ 'raw_input',
+ # 'reduce',
+ 'reload',
+ # 'repr', 'reversed', 'round', 'set',
+ 'setattr',
+ # 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super',
+ # 'tuple', 'type', 'unichr', 'unicode',
+ 'vars',
+ # 'xrange', 'zip'
+ )
+
+# checks there are no obvious mistakes above
+for ast_name in unallowed_ast_nodes:
+ assert ast_name in all_ast_nodes
+for name in unallowed_builtins:
+ assert name in all_builtins
+
+# faster lookup
+unallowed_ast_nodes = dict( (i, True) for i in unallowed_ast_nodes )
+unallowed_builtins = dict( (i, True) for i in unallowed_builtins )
+
+#----------------------------------------------------------------------
+# Restricted attributes.
+#----------------------------------------------------------------------
+
+# In addition to these we deny access to all lowlevel attrs (__xxx__).
+unallowed_attr = (
+ 'im_class', 'im_func', 'im_self',
+ 'func_code', 'func_defaults', 'func_globals', 'func_name',
+ 'tb_frame', 'tb_next',
+ 'f_back', 'f_builtins', 'f_code', 'f_exc_traceback',
+ 'f_exc_type', 'f_exc_value', 'f_globals', 'f_locals' )
+unallowed_attr = dict( (i, True) for i in unallowed_attr )
+
+def is_unallowed_attr(name):
+ if name == '__file__':
+ return False
+ return ( (name[:2] == '__' and name[-2:] == '__') or
+ (name in unallowed_attr) )
+
+#----------------------------------------------------------------------
+# SafeEvalVisitor.
+#----------------------------------------------------------------------
+
+class SafeEvalError(object):
+ """
+ Base class for all which occur while walking the AST.
+
+ Attributes:
+ errmsg = short decription about the nature of the error
+ lineno = line offset to where error occured in source code
+ """
+ def __init__(self, errmsg, lineno):
+ self.errmsg, self.lineno = errmsg, lineno
+ def __str__(self):
+ return "line %d : %s" % (self.lineno, self.errmsg)
+
+class SafeEvalASTNodeError(SafeEvalError):
+ "Expression/statement in AST evaluates to a restricted AST node type."
+ pass
+class SafeEvalBuiltinError(SafeEvalError):
+ "Expression/statement in tried to access a restricted builtin."
+ pass
+class SafeEvalAttrError(SafeEvalError):
+ "Expression/statement in tried to access a restricted attribute."
+ pass
+
+class SafeEvalVisitor(object):
+ """
+ Data-driven visitor which walks the AST for some code and makes
+ sure it doesn't contain any expression/statements which are
+ declared as restricted in 'unallowed_ast_nodes'. We'll also make
+ sure that there aren't any attempts to access/lookup restricted
+ builtin declared in 'unallowed_builtins'. By default we also won't
+ allow access to lowlevel stuff which can be used to dynamically
+ access non-local envrioments.
+
+ Interface:
+ walk(ast) = validate AST and return True if AST is 'safe'
+
+ Attributes:
+ errors = list of SafeEvalError if walk() returned False
+
+ Implementation:
+
+ The visitor will automatically generate methods for all of the
+ available AST node types and redirect them to self.ok or self.fail
+ reflecting the configuration in 'unallowed_ast_nodes'. While
+ walking the AST we simply forward the validating step to each of
+ node callbacks which take care of reporting errors.
+ """
+
+ def __init__(self):
+ "Initialize visitor by generating callbacks for all AST node types."
+ self.errors = []
+ for ast_name in all_ast_nodes:
+ # Don't reset any overridden callbacks.
+ if not getattr(self, 'visit' + ast_name, None):
+ if ast_name in unallowed_ast_nodes:
+ setattr(self, 'visit' + ast_name, self.fail)
+ else:
+ setattr(self, 'visit' + ast_name, self.ok)
+
+ def walk(self, ast):
+ "Validate each node in AST and return True if AST is 'safe'."
+ self.visit(ast)
+ return self.errors == []
+
+ def visit(self, node, *args):
+ "Recursively validate node and all of its children."
+ fn = getattr(self, 'visit' + classname(node))
+ if DEBUG: self.trace(node)
+ fn(node, *args)
+ for child in node.getChildNodes():
+ self.visit(child, *args)
+
+ def visitName(self, node, *args):
+ "Disallow any attempts to access a restricted builtin/attr."
+ name = node.getChildren()[0]
+ lineno = get_node_lineno(node)
+ if name in unallowed_builtins:
+ self.errors.append(SafeEvalBuiltinError( \
+ "access to builtin '%s' is denied" % name, lineno))
+ elif is_unallowed_attr(name):
+ self.errors.append(SafeEvalAttrError( \
+ "access to attribute '%s' is denied" % name, lineno))
+
+ def visitGetattr(self, node, *args):
+ "Disallow any attempts to access a restricted attribute."
+ name = node.attrname
+ lineno = get_node_lineno(node)
+ if is_unallowed_attr(name):
+ self.errors.append(SafeEvalAttrError( \
+ "access to attribute '%s' is denied" % name, lineno))
+
+ def ok(self, node, *args):
+ "Default callback for 'harmless' AST nodes."
+ pass
+
+ def fail(self, node, *args):
+ "Default callback for unallowed AST nodes."
+ lineno = get_node_lineno(node)
+ self.errors.append(SafeEvalASTNodeError( \
+ "execution of '%s' statements is denied" % classname(node),
+ lineno))
+
+ def trace(self, node):
+ "Debugging utility for tracing the validation of AST nodes."
+ print classname(node)
+ for attr in dir(node):
+ if attr[:2] != '__':
+ print ' ' * 4, "%-15.15s" % attr, getattr(node, attr)
+
+##########################################################################
+# Veusz evaluation functions
+##########################################################################
+
+def checkContextOkay(context):
+ """Check the context statements will be executed in.
+
+ Returns True if context is okay
+ """
+
+ ctx_errkeys, ctx_errors = [], []
+ for (key, obj) in context.items():
+ if inspect.isbuiltin(obj):
+ ctx_errkeys.append(key)
+ ctx_errors.append("key '%s' : unallowed builtin %s" % (key, obj))
+ if inspect.ismodule(obj):
+ ctx_errkeys.append(key)
+ ctx_errors.append("key '%s' : unallowed module %s" % (key, obj))
+
+ if ctx_errors:
+ raise SafeEvalContextException(ctx_errkeys, ctx_errors)
+
+## set up environment in dict
+#veusz_eval_context = {}
+
+# XXX disabled numpy support
+## add callables (not modules) and floats which don't override builtins
+#for name, val in N.__dict__.iteritems():
+# if ( (callable(val) or type(val)==float) and
+# name not in __builtin__.__dict__ and
+# name[:1] != '_' and name[-1:] != '_' ):
+# veusz_eval_context[name] = val
+
+## useful safe functions
+#veusz_eval_context['os_path_join'] = os.path.join
+#veusz_eval_context['os_path_dirname'] = os.path.dirname
+
+def checkCode(code):
+ """Check code, returning errors (if any) or None if okay"""
+
+ try:
+ ast = compiler.parse(code)
+ except SyntaxError, e:
+ return [e]
+ checker = SafeEvalVisitor()
+
+ if checker.walk(ast):
+ return None
+ else:
+ return checker.errors
+
+#----------------------------------------------------------------------
+# Safe 'eval' replacement.
+#----------------------------------------------------------------------
+
+class SafeEvalException(Exception):
+ "Base class for all safe-eval related errors."
+ pass
+
+class SafeEvalCodeException(SafeEvalException):
+ """
+ Exception class for reporting all errors which occured while
+ validating AST for source code in safe_eval().
+
+ Attributes:
+ code = raw source code which failed to validate
+ errors = list of SafeEvalError
+ """
+ def __init__(self, code, errors):
+ self.code, self.errors = code, errors
+ def __str__(self):
+ return '\n'.join([str(err) for err in self.errors])
+
+class SafeEvalContextException(SafeEvalException):
+ """
+ Exception class for reporting unallowed objects found in the dict
+ intended to be used as the local enviroment in safe_eval().
+
+ Attributes:
+ keys = list of keys of the unallowed objects
+ errors = list of strings describing the nature of the error
+ for each key in 'keys'
+ """
+ def __init__(self, keys, errors):
+ self.keys, self.errors = keys, errors
+ def __str__(self):
+ return '\n'.join([str(err) for err in self.errors])
+
+class SafeEvalTimeoutException(SafeEvalException):
+ """
+ Exception class for reporting that code evaluation execeeded
+ the given timelimit.
+
+ Attributes:
+ timeout = time limit in seconds
+ """
+ def __init__(self, timeout):
+ self.timeout = timeout
+ def __str__(self):
+ return "Timeout limit execeeded (%s secs) during exec" % self.timeout
+
+def exec_timed(code, context, timeout_secs):
+ """
+ Dynamically execute 'code' using 'context' as the global enviroment.
+ SafeEvalTimeoutException is raised if execution does not finish within
+ the given timelimit.
+ """
+ assert(timeout_secs > 0)
+
+ signal_finished = False
+
+ def alarm(secs):
+ def wait(secs):
+ for n in xrange(timeout_secs):
+ time.sleep(1)
+ if signal_finished: break
+ else:
+ thread.interrupt_main()
+ thread.start_new_thread(wait, (secs,))
+
+ try:
+ alarm(timeout_secs)
+ exec code in context
+ signal_finished = True
+ except KeyboardInterrupt:
+ raise SafeEvalTimeoutException(timeout_secs)
+
+def timed_safe_eval(code, context = {}, timeout_secs = 5):
+ """
+ Validate source code and make sure it contains no unauthorized
+ expression/statements as configured via 'unallowed_ast_nodes' and
+ 'unallowed_builtins'. By default this means that code is not
+ allowed import modules or access dangerous builtins like 'open' or
+ 'eval'. If code is considered 'safe' it will be executed via
+ 'exec' using 'context' as the global environment. More details on
+ how code is executed can be found in the Python Reference Manual
+ section 6.14 (ignore the remark on '__builtins__'). The 'context'
+ enviroment is also validated and is not allowed to contain modules
+ or builtins. The following exception will be raised on errors:
+
+ if 'context' contains unallowed objects =
+ SafeEvalContextException
+
+ if code is didn't validate and is considered 'unsafe' =
+ SafeEvalCodeException
+
+ if code did not execute within the given timelimit =
+ SafeEvalTimeoutException
+ """
+ ctx_errkeys, ctx_errors = [], []
+ for (key, obj) in context.items():
+ if inspect.isbuiltin(obj):
+ ctx_errkeys.append(key)
+ ctx_errors.append("key '%s' : unallowed builtin %s" % (key, obj))
+ if inspect.ismodule(obj):
+ ctx_errkeys.append(key)
+ ctx_errors.append("key '%s' : unallowed module %s" % (key, obj))
+
+ if ctx_errors:
+ raise SafeEvalContextException(ctx_errkeys, ctx_errors)
+
+ ast = compiler.parse(code)
+ checker = SafeEvalVisitor()
+
+ if checker.walk(ast):
+ exec_timed(code, context, timeout_secs)
+ else:
+ raise SafeEvalCodeException(code, checker.errors)
+
+#----------------------------------------------------------------------
+# Basic tests.
+#----------------------------------------------------------------------
+
+import unittest
+
+class TestSafeEval(unittest.TestCase):
+ def test_builtin(self):
+ # attempt to access a unsafe builtin
+ self.assertRaises(SafeEvalException,
+ timed_safe_eval, "open('test.txt', 'w')")
+
+ def test_getattr(self):
+ # attempt to get arround direct attr access
+ self.assertRaises(SafeEvalException, \
+ timed_safe_eval, "getattr(int, '__abs__')")
+
+ def test_func_globals(self):
+ # attempt to access global enviroment where fun was defined
+ self.assertRaises(SafeEvalException, \
+ timed_safe_eval, "def x(): pass; print x.func_globals")
+
+ def test_lowlevel(self):
+ # lowlevel tricks to access 'object'
+ self.assertRaises(SafeEvalException, \
+ timed_safe_eval, "().__class__.mro()[1].__subclasses__()")
+
+ def test_timeout_ok(self):
+ # attempt to exectute 'slow' code which finishes within timelimit
+ def test(): time.sleep(2)
+ env = {'test':test}
+ timed_safe_eval("test()", env, timeout_secs = 5)
+
+ def test_timeout_exceed(self):
+ # attempt to exectute code which never teminates
+ self.assertRaises(SafeEvalException, \
+ timed_safe_eval, "while 1: pass")
+
+ def test_invalid_context(self):
+ # can't pass an enviroment with modules or builtins
+ env = {'f' : __builtins__.open, 'g' : time}
+ self.assertRaises(SafeEvalException, \
+ timed_safe_eval, "print 1", env)
+
+ def test_callback(self):
+ # modify local variable via callback
+ self.value = 0
+ def test(): self.value = 1
+ env = {'test':test}
+ timed_safe_eval("test()", env)
+ self.assertEqual(self.value, 1)
+
+if __name__ == "__main__":
+ unittest.main()
+
+#----------------------------------------------------------------------
+# End unittests
+#----------------------------------------------------------------------
Index: Scribus/scribus/plugins/scripter/python/sceditor/arrow-down.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Scribus/scribus/plugins/scripter/python/sceditor/arrow-down.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: Scribus/scribus/plugins/scripter/python/sceditor/highlighter.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/highlighter.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/highlighter.py (revision 14647)
@@ -0,0 +1,193 @@
+#!/usr/bin/env python
+
+"""
+highlightedtextedit.py
+
+A PyQt custom widget example for Qt Designer.
+
+Copyright (C) 2006 David Boddie <david@boddie.org.uk>
+Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+"""
+
+from PyQt4 import QtCore, QtGui
+
+
+
+
+class PythonHighlighter(QtGui.QSyntaxHighlighter):
+
+ keywords = (
+ "and", "del", "for", "is", "raise",
+ "assert", "elif", "from", "lambda", "return",
+ "break", "else", "global", "not", "try",
+ "class", "except", "if", "or", "while",
+ "continue", "exec", "import", "pass", "yield",
+ "def", "finally", "in", "print"
+ )
+
+ def __init__(self, edit):
+ document = edit.document()
+ QtGui.QSyntaxHighlighter.__init__(self, document)
+
+ base_format = QtGui.QTextCharFormat()
+ base_format.setFont(edit.font())
+
+ self.base_format = base_format
+ self.document = document
+
+ self.updateHighlighter(base_format.font())
+
+ def highlightBlock(self, text):
+
+ self.setCurrentBlockState(0)
+
+ if text.trimmed().isEmpty():
+ self.setFormat(0, len(text), self.empty_format)
+ return
+
+ self.setFormat(0, len(text), self.base_format)
+
+ startIndex = 0
+ if self.previousBlockState() != 1:
+ startIndex = text.indexOf(self.multiLineStringBegin)
+
+ if startIndex > -1:
+ self.highlightRules(text, 0, startIndex)
+ else:
+ self.highlightRules(text, 0, len(text))
+
+ while startIndex >= 0:
+
+ endIndex = text.indexOf(self.multiLineStringEnd,
+ startIndex + len(self.multiLineStringBegin.pattern()))
+ if endIndex == -1:
+ self.setCurrentBlockState(1)
+ commentLength = text.length() - startIndex
+ else:
+ commentLength = endIndex - startIndex + \
+ self.multiLineStringEnd.matchedLength()
+ self.highlightRules(text, endIndex, len(text))
+
+ self.setFormat(startIndex, commentLength, self.multiLineStringFormat)
+ startIndex = text.indexOf(self.multiLineStringBegin,
+ startIndex + commentLength)
+
+ def highlightRules(self, text, start, finish):
+
+ for expression, format in self.rules:
+
+ index = text.indexOf(expression, start)
+ while index >= start and index < finish:
+ length = expression.matchedLength()
+ self.setFormat(index, min(length, finish - index), format)
+ index = text.indexOf(expression, index + length)
+
+ def updateFonts(self, font):
+
+ self.base_format.setFont(font)
+ self.empty_format = QtGui.QTextCharFormat(self.base_format)
+ #self.empty_format.setFontPointSize(font.pointSize()/4.0)
+
+ self.keywordFormat = QtGui.QTextCharFormat(self.base_format)
+ self.keywordFormat.setForeground(QtCore.Qt.darkBlue)
+ self.keywordFormat.setFontWeight(QtGui.QFont.Bold)
+ self.callableFormat = QtGui.QTextCharFormat(self.base_format)
+ self.callableFormat.setForeground(QtCore.Qt.darkBlue)
+ self.magicFormat = QtGui.QTextCharFormat(self.base_format)
+ self.magicFormat.setForeground(QtGui.QColor(224,128,0))
+ self.qtFormat = QtGui.QTextCharFormat(self.base_format)
+ self.qtFormat.setForeground(QtCore.Qt.blue)
+ self.qtFormat.setFontWeight(QtGui.QFont.Bold)
+ self.selfFormat = QtGui.QTextCharFormat(self.base_format)
+ self.selfFormat.setForeground(QtCore.Qt.red)
+ #self.selfFormat.setFontItalic(True)
+ self.singleLineCommentFormat = QtGui.QTextCharFormat(self.base_format)
+ self.singleLineCommentFormat.setForeground(QtCore.Qt.darkGreen)
+ self.multiLineStringFormat = QtGui.QTextCharFormat(self.base_format)
+ self.multiLineStringFormat.setBackground(
+ QtGui.QBrush(QtGui.QColor(127,127,255)))
+ self.quotationFormat1 = QtGui.QTextCharFormat(self.base_format)
+ self.quotationFormat1.setForeground(QtCore.Qt.blue)
+ self.quotationFormat2 = QtGui.QTextCharFormat(self.base_format)
+ self.quotationFormat2.setForeground(QtCore.Qt.blue)
+
+ def updateRules(self):
+
+ self.rules = []
+ self.rules += map(lambda s: (QtCore.QRegExp(r"\b"+s+r"\b"),
+ self.keywordFormat), self.keywords)
+
+ self.rules.append((QtCore.QRegExp(r"\b[A-Za-z_]+\(.*\)"), self.callableFormat))
+ self.rules.append((QtCore.QRegExp(r"\b__[a-z]+__\b"), self.magicFormat))
+ self.rules.append((QtCore.QRegExp(r"\bself\b"), self.selfFormat))
+ self.rules.append((QtCore.QRegExp(r"\bQ([A-Z][a-z]*)+\b"), self.qtFormat))
+
+ self.rules.append((QtCore.QRegExp(r"#[^\n]*"), self.singleLineCommentFormat))
+
+ self.multiLineStringBegin = QtCore.QRegExp(r'\"\"\"')
+ self.multiLineStringEnd = QtCore.QRegExp(r'\"\"\"')
+
+ self.rules.append((QtCore.QRegExp(r'\"[^\n]*\"'), self.quotationFormat1))
+ self.rules.append((QtCore.QRegExp(r"'[^\n]*'"), self.quotationFormat2))
+
+ def updateHighlighter(self, font):
+
+ self.updateFonts(font)
+ self.updateRules()
+ self.setDocument(self.document)
+
+
+class QtScriptHighlighter(PythonHighlighter):
+
+ keywords = """"
+ break for throw case function try
+ catch if typeof continue in var default instanceof void
+ delete new undefined do return while else switch with
+ finally this """.split() + \
+ ['NaN', 'Infinity', 'undefined', 'print', 'parseInt',
+ 'parseFloat', 'isNaN', 'isFinite', 'decodeURI',
+ 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
+ 'escape', 'unescape', 'version', 'gc', 'Object',
+ 'Function', 'Number', 'Boolean', 'String', 'Date', 'Array',
+ 'RegExp', 'Error', 'EvalError','RangeError', 'ReferenceError',
+ 'SyntaxError', 'TypeError', 'URIError', 'eval', 'Math',
+ 'Enumeration', 'Variant', 'QObject', 'QMetaObject']
+
+ def __init__(self, edit):
+ PythonHighlighter.__init__(self, edit)
+
+
+ def updateRules(self):
+
+ self.rules = []
+ self.rules += map(lambda s: (QtCore.QRegExp(r"\b"+s+r"\b"),
+ self.keywordFormat), self.keywords)
+
+ self.rules.append((QtCore.QRegExp(r"\b[A-Za-z_]+\(.*\)"), self.callableFormat))
+ #self.rules.append((QtCore.QRegExp(r"\b__[a-z]+__\b"), self.magicFormat))
+ self.rules.append((QtCore.QRegExp(r"\bthis\b"), self.selfFormat))
+ self.rules.append((QtCore.QRegExp(r"\bQ([A-Z][a-z]*)+\b"), self.qtFormat))
+
+ self.rules.append((QtCore.QRegExp(r"//[^\n]*"), self.singleLineCommentFormat))
+
+ # XXX quick hack to support QtScript syntax
+ self.multiLineStringBegin = QtCore.QRegExp(r'/\*')
+ self.multiLineStringEnd = QtCore.QRegExp(r'\*/')
+ self.multiLineStringFormat = self.singleLineCommentFormat
+ self.rules.append((QtCore.QRegExp(r'\"[^\n]*\"'), self.quotationFormat1))
+ self.rules.append((QtCore.QRegExp(r"'[^\n]*'"), self.quotationFormat2))
+
Index: Scribus/scribus/plugins/scripter/python/sceditor/__init__.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/__init__.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/__init__.py (revision 14647)
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+
+
+editor_main_window = None
+
+
+def launch(parent=None):
+ global editor_main_window
+ if not editor_main_window:
+ from sceditor.mainwindow import EditorMainWindow
+ editor_main_window = EditorMainWindow(parent)
+ editor_main_window.resize(640,480)
+ editor_main_window.show()
+
Index: Scribus/scribus/plugins/scripter/python/sceditor/THANKS
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/THANKS (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/THANKS (revision 14647)
@@ -0,0 +1,2 @@
+rope.zip and indenter.py by Ali Gholami Rudi, Rope, GPL
+sceditor/highlighter.py by David Boddie, included as demo in PyQt, GPL2 or later
\ No newline at end of file
Index: Scribus/scribus/plugins/scripter/python/sceditor/arrow-right.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Scribus/scribus/plugins/scripter/python/sceditor/arrow-right.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: Scribus/scribus/plugins/scripter/python/sceditor/mainwindow.ui
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/mainwindow.ui (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/mainwindow.ui (revision 14647)
@@ -0,0 +1,115 @@
+<ui version="4.0" >
+ <class>ScriptEditor</class>
+ <widget class="QMainWindow" name="ScriptEditor" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>624</width>
+ <height>449</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Script Editor</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>28</y>
+ <width>624</width>
+ <height>397</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>624</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuFile" >
+ <property name="title" >
+ <string>&amp;File</string>
+ </property>
+ <widget class="QMenu" name="menu_New" >
+ <property name="title" >
+ <string>&amp;New</string>
+ </property>
+ <addaction name="actionNewPython" />
+ <addaction name="actionNewQtScript" />
+ </widget>
+ <addaction name="menu_New" />
+ <addaction name="actionClose" />
+ <addaction name="separator" />
+ <addaction name="actionExit" />
+ </widget>
+ <widget class="QMenu" name="menuRun" >
+ <property name="title" >
+ <string>&amp;Run</string>
+ </property>
+ <addaction name="actionRun" />
+ <addaction name="actionRunConsole" />
+ </widget>
+ <addaction name="menuFile" />
+ <addaction name="menuRun" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>425</y>
+ <width>624</width>
+ <height>24</height>
+ </rect>
+ </property>
+ </widget>
+ <action name="actionClose" >
+ <property name="text" >
+ <string>&amp;Close</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+W</string>
+ </property>
+ </action>
+ <action name="actionExit" >
+ <property name="text" >
+ <string>&amp;Exit</string>
+ </property>
+ </action>
+ <action name="actionRun" >
+ <property name="text" >
+ <string>&amp;Run</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+R</string>
+ </property>
+ </action>
+ <action name="actionRunConsole" >
+ <property name="text" >
+ <string>Run script in &amp;console</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action name="actionNewPython" >
+ <property name="text" >
+ <string>Python</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action name="actionNewQtScript" >
+ <property name="text" >
+ <string>QtScript</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: Scribus/scribus/plugins/scripter/python/sceditor/console.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/console.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/console.py (revision 14647)
@@ -0,0 +1,518 @@
+import sys
+import traceback
+import re
+
+from PyQt4.QtCore import QObject, Qt
+from PyQt4.QtGui import QTextCursor, qApp, QApplication, QPlainTextEdit
+
+
+from sceditor.highlighter import PythonHighlighter, QtScriptHighlighter
+
+
+
+
+from PyQt4.QtScript import (
+ QScriptEngine, QScriptValue, QScriptValueIterator)
+
+
+class OutputWidget(QPlainTextEdit):
+
+
+ def __init__(self, parent=None, readonly=True, max_rows=1000, echo=True):
+ QPlainTextEdit.__init__(self, parent)
+ self.echo = echo
+ self.setReadOnly(readonly)
+ self.document().setMaximumBlockCount(max_rows)
+ self.attach()
+
+
+ def attach(self):
+ sys.stdout = sys.stderr = self
+
+
+ def __del__(self):
+ self.detach()
+
+
+ def detach(self):
+ sys.stdout = sys.__stdout__
+ sys.stderr = sys.__stderr__
+
+
+ def write(self, s):
+ if self.echo:
+ sys.__stdout__.write(s)
+ doc = self.document()
+ cursor = QTextCursor(doc)
+ cursor.clearSelection()
+ cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor)
+ cursor.insertText(s)
+ cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor)
+ cursor.clearSelection()
+ self.ensureCursorVisible()
+ qApp.processEvents()
+
+
+ def writelines(self, lines):
+ self.write("\n".join(lines))
+
+
+
+class ConsoleWidget(OutputWidget):
+
+
+ def __init__(self, parent=None, ps1="?", ps2=">"):
+ OutputWidget.__init__(self, parent, readonly=False)
+ self.setTabChangesFocus(False)
+ self.ps1 = ps1
+ self.ps2 = ps2
+ self.history_index = 0
+ self.history = [""]
+ self.tab_state = -1
+ print self.ps1,
+
+
+ def focusInEvent(self, event):
+ self.attach()
+ OutputWidget.focusInEvent(self, event)
+
+
+ def mousePressEvent(self, event):
+ self.setFocus()
+
+
+ def push(self, line):
+ return True
+
+
+ def keyPressEvent(self, event):
+ def remove_line():
+ cursor = self.textCursor()
+ cursor.select(QTextCursor.BlockUnderCursor)
+ cursor.removeSelectedText()
+ key = event.key()
+ modifiers = event.modifiers()
+ l = len(self.ps1)
+ line = unicode(self.document().end().previous().text())
+ ps1orps2, line = line[:l-1], line[l:]
+
+
+ if not key in [Qt.Key_Tab, Qt.Key_Backtab] and \
+ len(event.text()):
+ self.tab_state = -1
+ if key == Qt.Key_Up:
+ if self.history_index + 1 < len(self.history):
+ self.history_index += 1
+ remove_line()
+ print
+ print ps1orps2, self.history[self.history_index],
+ elif key == Qt.Key_Down:
+ if self.history_index > 0:
+ self.history_index -= 1
+ remove_line()
+ print
+ print ps1orps2, self.history[self.history_index],
+ elif key == Qt.Key_Tab:
+ if modifiers & Qt.ControlModifier:
+ print " " * 4,
+ else:
+ self.tab_state += 1
+ remove_line()
+ print
+ print ps1orps2,
+ print self.completer.complete(line, self.tab_state) or line,
+ elif key == Qt.Key_Backtab:
+ if self.tab_state >= 0:
+ self.tab_state -= 1
+ remove_line()
+ print
+ print ps1orps2,
+ print self.completer.complete(line, self.tab_state) or line,
+ elif key in [Qt.Key_Backspace, Qt.Key_Left]:
+ if self.textCursor().columnNumber() > len(ps1orps2) + 1:
+ return OutputWidget.keyPressEvent(self, event)
+ elif key == Qt.Key_Return:
+ self.moveCursor(QTextCursor.EndOfLine, QTextCursor.MoveAnchor)
+ print
+ if self.push(line):
+ print self.ps2,
+ else:
+ print self.ps1,
+ if line and line != self.history[self.history_index]:
+ self.history.insert(1, line)
+ self.history_index = 0
+ else:
+ return OutputWidget.keyPressEvent(self, event)
+
+
+
+class PythonInterpreter(object):
+
+
+ def __init__(self, name="<pyqtshell>", locals=None):
+ self.name = name
+ self.locals = locals or {}
+ self.locals["__name__"] = self.name
+ self.lines = []
+
+
+ def run(self, source, locals=None):
+ if locals == None:
+ locals = self.locals
+ code = compile(source, self.name, "exec")
+ try:
+ exec code in locals
+ except:
+ self.showtraceback()
+ try:
+ Scripter.activeWindow.redraw = True
+ Scripter.activeWindow.update()
+ except: pass
+
+
+ def push(self, line):
+ if self.lines:
+ if line:
+ self.lines.append(line)
+ return 1 # want more!
+ else:
+ line = "\n".join(self.lines) + "\n"
+ else:
+ if not line:
+ return 0
+ try:
+ code = compile(line, self.name, "single")
+ self.lines = []
+ except SyntaxError, why:
+ if why[0] == "unexpected EOF while parsing":
+ self.lines.append(line)
+ return 1 # want more!
+ else:
+ self.showtraceback()
+ except:
+ self.showtraceback()
+ else:
+ try:
+ exec code in self.locals
+ except:
+ self.showtraceback()
+ try:
+ Scripter.activeWindow.redraw = True
+ Scripter.activeWindow.update()
+ except: pass
+ return 0
+
+
+ def showtraceback(self):
+ self.lines = []
+ if sys.exc_type == SyntaxError: # and len(sys.exc_value) == 2:
+ print " File \"%s\", line %d" % (self.name, sys.exc_value[1][1])
+ print " " * (sys.exc_value[1][2] + 2) + "^"
+ print str(sys.exc_type) + ":", sys.exc_value[0]
+ else:
+ traceback.print_tb(sys.exc_traceback, None)
+ print sys.exc_type.__name__ + ":", sys.exc_value
+
+
+
+
+class PythonCompleter(object):
+
+
+ def __init__(self, namespace):
+ self.namespace = namespace
+
+
+ def complete(self, text, state):
+ if state == 0:
+ if "." in text:
+ self.matches = self.attr_matches(text)
+ else:
+ self.matches = self.global_matches(text)
+ try:
+ return self.matches[state]
+ except IndexError:
+ return None
+
+
+ def global_matches(self, text):
+ import keyword, __builtin__
+ matches = []
+ n = len(text)
+ for list in [keyword.kwlist,
+ __builtin__.__dict__,
+ self.namespace]:
+ for word in list:
+ if word[:n] == text and word != "__builtins__":
+ matches.append(word)
+ return matches
+
+
+ def attr_matches(self, text):
+ def get_class_members(cls):
+ ret = dir(cls)
+ if hasattr(cls,'__bases__'):
+ for base in cls.__bases__:
+ ret = ret + get_class_members(base)
+ return ret
+ import re
+ m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
+ if not m:
+ return
+ expr, attr = m.group(1, 3)
+ object = eval(expr, self.namespace)
+ words = dir(object)
+ if hasattr(object,'__class__'):
+ words.append('__class__')
+ words = words + get_class_members(object.__class__)
+ matches = []
+ n = len(attr)
+ for word in words:
+ if word[:n] == attr and word != "__builtins__":
+ matches.append("%s.%s" % (expr, word))
+ return matches
+
+
+
+
+
+
+
+class PythonConsole(ConsoleWidget):
+
+
+ def __init__(self, parent=None, namespace=None):
+ ConsoleWidget.__init__(self, parent, ps1=">>> ", ps2="... ")
+ self.highlighter = PythonHighlighter(self)
+ self.inter = PythonInterpreter(locals=namespace)
+ self.namespace = self.inter.locals
+ self.completer = PythonCompleter(self.namespace)
+ #print "Python", sys.version
+ #print "Autocomplete with (Shift+)Tab, insert spaces with Ctrl+Tab"
+ self.push("pass")
+
+
+ def push(self, line):
+ return self.inter.push(line)
+
+
+
+
+
+
+class QtScriptInterpreter(object):
+
+
+ def __init__(self, locals):
+ self.locals = locals
+ self.engine = self.newEngine()
+ self.code = ""
+ self.state = 0
+
+
+ def newEngine(self):
+ engine = QScriptEngine()
+ ns = engine.globalObject()
+ for name, value in self.locals.items():
+ if isinstance(value, QObject):
+ value = engine.newQObject(value)
+ elif callable(value):
+ value = engine.newFunction(value)
+ ns.setProperty(name, value)
+ return engine
+
+
+ def execute(self, code):
+ self.execute_code(code, self.engine)
+
+
+ def execute_code(self, code, engine=None):
+ engine = engine or self.newEngine()
+ result = engine.evaluate(code)
+ try:
+ Scripter.activeWindow.redraw = True
+ Scripter.activeWindow.update()
+ except: pass
+ if engine.hasUncaughtException():
+ bt = engine.uncaughtExceptionBacktrace()
+ print "Traceback:"
+ print "\n".join([" %s" % l for l in list(bt)])
+ print engine.uncaughtException().toString()
+ else:
+ if not result.isUndefined():
+ print result.toString()
+
+
+ def push(self, line):
+ if not line.strip():
+ return self.state
+ self.code = self.code + line + "\n"
+ if self.engine.canEvaluate(self.code):
+ self.execute(self.code)
+ self.code = ""
+ self.state = 0
+ else:
+ self.state = 1
+ return self.state
+
+
+js_words = [
+ 'break',
+ 'for',
+ 'throw',
+ 'case',
+ 'function',
+ 'try',
+ 'catch',
+ 'if',
+ 'typeof',
+ 'continue',
+ 'in',
+ 'var',
+ 'default',
+ 'instanceof',
+ 'void',
+ 'delete',
+ 'new',
+ 'undefined',
+ 'do',
+ 'return',
+ 'while',
+ 'else',
+ 'switch',
+ 'with',
+ 'finally',
+ 'this',
+ 'NaN',
+ 'Infinity',
+ 'undefined',
+ 'print',
+ 'parseInt',
+ 'parseFloat',
+ 'isNaN',
+ 'isFinite',
+ 'decodeURI',
+ 'decodeURIComponent',
+ 'encodeURI',
+ 'encodeURIComponent',
+ 'escape',
+ 'unescape',
+ 'version',
+ 'gc',
+ 'Object',
+ 'Function',
+ 'Number',
+ 'Boolean',
+ 'String',
+ 'Date',
+ 'Array',
+ 'RegExp',
+ 'Error',
+ 'EvalError',
+ 'RangeError',
+ 'ReferenceError',
+ 'SyntaxError',
+ 'TypeError',
+ 'URIError',
+ 'eval',
+ 'Math',
+ 'Enumeration',
+ 'Variant',
+ 'QObject',
+ 'QMetaObject']
+
+
+
+class QtScriptCompleter(object):
+
+
+ def __init__(self, engine):
+ self.engine = engine
+
+
+ def complete(self, text, state):
+ if state == 0:
+ if "." in text:
+ self.matches = self.attr_matches(text)
+ else:
+ self.matches = self.global_matches(text)
+ try:
+ return self.matches[state]
+ except IndexError:
+ return None
+
+
+
+ def attr_matches(self, text):
+ return []
+
+
+
+ def iter_obj(self, obj):
+ it = QScriptValueIterator(self.engine.globalObject())
+ while it.hasNext():
+ yield str(it.name())
+ it.next()
+
+
+ def global_matches(self, text):
+ words = list(self.iter_obj(self.engine.globalObject()))
+ words.extend(js_words)
+ l = []
+ n = len(text)
+ for w in words:
+ if w[:n] == text:
+ l.append(w)
+ return l
+
+
+
+
+
+class QtScriptConsole(ConsoleWidget):
+
+
+ def __init__(self, parent=None, namespace=None):
+ ConsoleWidget.__init__(self, parent, ps1=">>> ", ps2="... ")
+ self.highlighter = QtScriptHighlighter(self)
+ namespace = namespace or {}
+ def console_print(context, engine):
+ for i in range(context.argumentCount()):
+ print context.argument(i).toString(),
+ print
+ return QScriptValue()
+ def dir_context(context, engine):
+ if context.argumentCount() == 0:
+ obj = context.thisObject()
+ else:
+ obj = context.argument(0)
+ l = []
+ it = QScriptValueIterator(obj)
+ while it.hasNext():
+ it.next()
+ l.append(str(it.name()))
+ return QScriptValue(engine, repr(l))
+ namespace["print"] = console_print
+ namespace["dir"] = dir_context
+ namespace["Application"] = qApp
+ try:
+ namespace["Scripter"] = Scripter.qt
+ except: pass
+ self.inter = QtScriptInterpreter(namespace)
+ self.completer = QtScriptCompleter(self.inter.engine)
+
+
+
+ def push(self, line):
+ return self.inter.push(line)
+
+
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ o = QtScriptConsole()
+ #o = PythonConsole()
+ o.resize(640,480)
+ o.attach()
+ o.show()
+ app.exec_()
Index: Scribus/scribus/plugins/scripter/python/sceditor/assist.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/assist.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/assist.py (revision 14647)
@@ -0,0 +1,156 @@
+from PyQt4.QtCore import QTimer, Qt, SIGNAL
+from PyQt4.QtGui import QTextBrowser, QVBoxLayout, QListWidget, qApp, QListWidgetItem, QWidget
+
+
+class PopupWidget(QWidget):
+
+
+ def __init__(self, textedit):
+ flags = Qt.ToolTip
+ flags = Qt.Window | Qt.FramelessWindowHint | \
+ Qt.CustomizeWindowHint | Qt.X11BypassWindowManagerHint
+ QWidget.__init__(self, None, flags)
+ self.textedit = textedit
+ self.vlayout = QVBoxLayout(self)
+ self.vlayout.setContentsMargins(0, 0, 0, 0)
+ self.init_popup()
+ self.show()
+ self.hide()
+ self.active = False
+
+
+ def show(self, timeout=0, above=False):
+ self.cursor_start_col = self.textedit.textCursor().columnNumber()
+ desktop = qApp.desktop()
+ screen = desktop.screen(desktop.screenNumber(self))
+ screen_width = screen.width()
+ screen_height = screen.height()
+ win_width = self.width()
+ win_height = self.height()
+ cursorRect = self.textedit.cursorRect()
+ if above:
+ pos = self.textedit.mapToGlobal(cursorRect.topLeft())
+ pos.setY(pos.y() - win_height)
+ else:
+ pos = self.textedit.mapToGlobal(cursorRect.bottomLeft())
+ if pos.y() < 0:
+ pos = self.textedit.mapToGlobal(cursorRect.bottomLeft())
+ if pos.y() + win_height > screen_height:
+ pos = self.textedit.mapToGlobal(cursorRect.topLeft())
+ pos.setY(pos.y() - win_height)
+ if pos.x() + win_width > screen_width:
+ pos.setX(screen_width - win_width)
+
+ self.move(pos)
+ QWidget.show(self)
+ self.active = True
+ if timeout:
+ QTimer.singleShot(timeout * 1000, self.hide)
+
+
+ def hide(self):
+ self.active = False
+ QWidget.hide(self)
+
+
+
+
+
+
+class CallTip(PopupWidget):
+
+
+ def init_popup(self):
+ self.browser = QTextBrowser(self)
+ self.layout().addWidget(self.browser)
+
+
+
+
+class AutoCompleteItem(QListWidgetItem):
+
+ def __init__(self, item):
+ QListWidgetItem.__init__(self)
+ value = item.name
+ self.setText(value)
+ self.value = value
+ self.kind = item.kind
+
+
+
+class AutoComplete(PopupWidget):
+
+
+ def init_popup(self):
+ self.list = QListWidget(self)
+ self.connect(self.list,
+ SIGNAL("itemClicked(QListWidgetItem*)"),
+ self.insertItem)
+ self.layout().addWidget(self.list)
+ self.items = []
+
+
+ def insertItem(self, item):
+ self.insert()
+
+
+ def insert(self):
+ completition = self.items[self.list.currentRow()].value
+ cursor = self.textedit.textCursor()
+ col = cursor.columnNumber()
+ line = unicode(cursor.block().text())
+ i = self.cursor_start_col
+ while i > 0:
+ #print `line[i:col]`
+ if completition.startswith(line[i:col]):
+ #print "break"
+ break
+ i -= 1
+ #print col,i
+ cursor.insertText(completition[col-i:])
+ self.hide()
+
+
+ def setItems(self, proposals):
+ proposals = sorted(proposals, cmp=lambda p1,p2:cmp(p1.name,p2.name))
+ del self.items[:]
+ self.list.clear()
+ for entry in proposals:
+ i = AutoCompleteItem(entry)
+ self.list.addItem(i)
+ self.items.append(i)
+
+
+ def keyPressEvent(self, event):
+ self.list.keyPressEvent(event)
+ key = event.key()
+ text = event.text()
+ if key in [Qt.Key_Right, Qt.Key_Enter, Qt.Key_Return]:
+ text = ""
+ cursor = self.textedit.textCursor()
+ line = unicode(cursor.block().text())
+ col = cursor.columnNumber()
+ prefix = line[self.cursor_start_col:col] + unicode(text)
+
+ found = False
+ for row, item in enumerate(self.items):
+ if item.value.startswith(prefix):
+ current = self.items[self.list.currentRow()].value
+ if not current.startswith(prefix):
+ self.list.setCurrentRow(row)
+ found = True
+ break
+ if not found:
+ self.hide()
+ return
+
+ if key in [Qt.Key_Up, Qt.Key_Down, Qt.Key_PageUp, Qt.Key_PageDown]:
+ return True
+ elif key in [Qt.Key_Tab, Qt.Key_Right, Qt.Key_Enter, Qt.Key_Return]:
+ self.insert()
+ return True
+ elif not text:
+ self.hide()
+
+
+
Index: Scribus/scribus/plugins/scripter/python/sceditor/indenter.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/indenter.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/indenter.py (revision 14647)
@@ -0,0 +1,242 @@
+import re
+
+from rope.base import codeanalyze
+
+
+class TextIndenter(object):
+ """A class for formatting texts"""
+
+ def __init__(self, editor, indents=4):
+ self.editor = editor
+ self.indents = indents
+ self.line_editor = editor.line_editor()
+
+ def correct_indentation(self, lineno):
+ """Correct the indentation of a line"""
+
+ def deindent(self, lineno):
+ """Deindent the a line"""
+ current_indents = self._count_line_indents(lineno)
+ new_indents = max(0, current_indents - self.indents)
+ self._set_line_indents(lineno, new_indents)
+
+ def indent(self, lineno):
+ """Indent a line"""
+ current_indents = self._count_line_indents(lineno)
+ new_indents = current_indents + self.indents
+ self._set_line_indents(lineno, new_indents)
+
+ def entering_new_line(self, lineno):
+ """Indent a line
+
+ Uses `correct_indentation` and last line indents
+ """
+ last_line = ""
+ if lineno > 1:
+ last_line = self.line_editor.get_line(lineno - 1)
+ if last_line.strip() == '':
+ self._set_line_indents(lineno, len(last_line))
+ else:
+ self.correct_indentation(lineno)
+
+ def insert_tab(self, index):
+ """Inserts a tab in the given index"""
+ self.editor.insert(index, ' ' * self.indents)
+
+ def _set_line_indents(self, lineno, indents):
+ old_indents = self._count_line_indents(lineno)
+ indent_diffs = indents - old_indents
+ self.line_editor.indent_line(lineno, indent_diffs)
+
+ def _count_line_indents(self, lineno):
+ contents = self.line_editor.get_line(lineno)
+ result = 0
+ for x in contents:
+ if x == ' ':
+ result += 1
+ elif x == '\t':
+ result += 8
+ else:
+ break
+ return result
+
+
+class NormalIndenter(TextIndenter):
+
+ def __init__(self, editor):
+ super(NormalIndenter, self).__init__(editor)
+
+ def correct_indentation(self, lineno):
+ prev_indents = 0
+ if lineno > 1:
+ prev_indents = self._count_line_indents(lineno - 1)
+ self._set_line_indents(lineno, prev_indents)
+
+
+class PythonCodeIndenter(TextIndenter):
+
+ def __init__(self, editor, indents=4):
+ super(PythonCodeIndenter, self).__init__(editor, indents)
+
+ def _last_non_blank(self, lineno):
+ current_line = lineno - 1
+ while current_line != 1 and \
+ self.line_editor.get_line(current_line).strip() == '':
+ current_line -= 1
+ return current_line
+
+ def _get_correct_indentation(self, lineno):
+ if lineno == 1:
+ return 0
+ new_indent = self._get_base_indentation(lineno)
+
+ prev_lineno = self._last_non_blank(lineno)
+ prev_line = self.line_editor.get_line(prev_lineno)
+ if prev_lineno == lineno or prev_line.strip() == '':
+ new_indent = 0
+ current_line = self.line_editor.get_line(lineno)
+ new_indent += self._indents_caused_by_current_stmt(current_line)
+ return new_indent
+
+ def _get_base_indentation(self, lineno):
+ range_finder = _StatementRangeFinder(
+ self.line_editor, self._last_non_blank(lineno))
+ start = range_finder.get_statement_start()
+ if not range_finder.is_line_continued():
+ changes = self._indents_caused_by_prev_stmt(
+ (start, self._last_non_blank(lineno)))
+ return self._count_line_indents(start) + changes
+ if range_finder.last_open_parens():
+ open_parens = range_finder.last_open_parens()
+ parens_line = self.line_editor.get_line(open_parens[0])
+ if parens_line[open_parens[1] + 1:].strip() == '':
+ if len(range_finder.open_parens) > 1:
+ return range_finder.open_parens[-2][1] + 1
+ else:
+ return self._count_line_indents(start) + self.indents
+ return range_finder.last_open_parens()[1] + 1
+
+ start_line = self.line_editor.get_line(start)
+ if start == lineno - 1:
+ try:
+ equals_index = start_line.index(' = ') + 1
+ if start_line[equals_index + 1:].strip() == '\\':
+ return self._count_line_indents(start) + self.indents
+ return equals_index + 2
+ except ValueError:
+ match = re.search(r'(\b )|(\.)', start_line)
+ if match:
+ return match.start() + 1
+ else:
+ return len(start_line) + 1
+ else:
+ return self._count_line_indents(self._last_non_blank(lineno))
+
+ def _indents_caused_by_prev_stmt(self, stmt_range):
+ first_line = self.line_editor.get_line(stmt_range[0])
+ last_line = self.line_editor.get_line(stmt_range[1])
+ new_indent = 0
+ if self._strip(last_line).endswith(':'):
+ new_indent += self.indents
+ if self._startswith(first_line, ('return', 'raise', 'pass',
+ 'break', 'continue')):
+ new_indent -= self.indents
+ return new_indent
+
+ def _startswith(self, line, tokens):
+ line = self._strip(line)
+ for token in tokens:
+ if line == token or line.startswith(token + ' '):
+ return True
+
+ def _strip(self, line):
+ try:
+ numsign = line.rindex('#')
+ comment = line[numsign:]
+ if '\'' not in comment and '\"' not in comment:
+ line = line[:numsign]
+ except ValueError:
+ pass
+ return line.strip()
+
+ def _indents_caused_by_current_stmt(self, current_line):
+ new_indent = 0
+ if self._strip(current_line) == 'else:':
+ new_indent -= self.indents
+ if self._strip(current_line) == 'finally:':
+ new_indent -= self.indents
+ if self._startswith(current_line, ('elif',)):
+ new_indent -= self.indents
+ if self._startswith(current_line, ('except',)) and \
+ self._strip(current_line).endswith(':'):
+ new_indent -= self.indents
+ return new_indent
+
+ def correct_indentation(self, lineno):
+ """Correct the indentation of the line containing the given index"""
+ self._set_line_indents(lineno, self._get_correct_indentation(lineno))
+
+
+class _StatementRangeFinder(object):
+ """A method object for finding the range of a statement"""
+
+ def __init__(self, lines, lineno):
+ self.lines = lines
+ self.lineno = lineno
+ self.in_string = ''
+ self.open_count = 0
+ self.explicit_continuation = False
+ self.open_parens = []
+ self._analyze()
+
+ def _analyze_line(self, lineno):
+ current_line = self.lines.get_line(lineno)
+ for i, char in enumerate(current_line):
+ if char in '\'"':
+ if self.in_string == '':
+ self.in_string = char
+ if char * 3 == current_line[i:i + 3]:
+ self.in_string = char * 3
+ elif self.in_string == current_line[i:i + len(self.in_string)] and \
+ not (i > 0 and current_line[i - 1] == '\\' and
+ not (i > 1 and current_line[i - 2:i] == '\\\\')):
+ self.in_string = ''
+ if self.in_string != '':
+ continue
+ if char == '#':
+ break
+ if char in '([{':
+ self.open_count += 1
+ self.open_parens.append((lineno, i))
+ if char in ')]}':
+ self.open_count -= 1
+ if self.open_parens:
+ self.open_parens.pop()
+ if current_line and char != '#' and current_line.endswith('\\'):
+ self.explicit_continuation = True
+ else:
+ self.explicit_continuation = False
+
+ def _analyze(self):
+ last_statement = 1
+ block_start = codeanalyze.get_block_start(self.lines, self.lineno)
+ for current_line_number in range(block_start, self.lineno + 1):
+ if not self.explicit_continuation and \
+ self.open_count == 0 and self.in_string == '':
+ last_statement = current_line_number
+ self._analyze_line(current_line_number)
+ self.statement_start = last_statement
+
+ def get_statement_start(self):
+ return self.statement_start
+
+ def last_open_parens(self):
+ if not self.open_parens:
+ return None
+ return self.open_parens[-1]
+
+ def is_line_continued(self):
+ return self.open_count != 0 or self.explicit_continuation
+
+ def get_line_indents(self, line_number):
+ return self._count_line_indents(self.lines.get_line(line_number))
Index: Scribus/scribus/plugins/scripter/python/sceditor/mainwindow_ui.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/mainwindow_ui.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/mainwindow_ui.py (revision 14647)
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'mainwindow.ui'
+#
+# Created: Sat Jun 14 05:22:25 2008
+# by: PyQt4 UI code generator 4.4.2
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_ScriptEditor(object):
+ def setupUi(self, ScriptEditor):
+ ScriptEditor.setObjectName("ScriptEditor")
+ ScriptEditor.resize(624,449)
+ self.centralwidget = QtGui.QWidget(ScriptEditor)
+ self.centralwidget.setGeometry(QtCore.QRect(0,28,624,397))
+ self.centralwidget.setObjectName("centralwidget")
+ ScriptEditor.setCentralWidget(self.centralwidget)
+ self.menubar = QtGui.QMenuBar(ScriptEditor)
+ self.menubar.setGeometry(QtCore.QRect(0,0,624,28))
+ self.menubar.setObjectName("menubar")
+ self.menuFile = QtGui.QMenu(self.menubar)
+ self.menuFile.setObjectName("menuFile")
+ self.menu_New = QtGui.QMenu(self.menuFile)
+ self.menu_New.setObjectName("menu_New")
+ self.menuRun = QtGui.QMenu(self.menubar)
+ self.menuRun.setObjectName("menuRun")
+ ScriptEditor.setMenuBar(self.menubar)
+ self.statusbar = QtGui.QStatusBar(ScriptEditor)
+ self.statusbar.setGeometry(QtCore.QRect(0,425,624,24))
+ self.statusbar.setObjectName("statusbar")
+ ScriptEditor.setStatusBar(self.statusbar)
+ self.actionClose = QtGui.QAction(ScriptEditor)
+ self.actionClose.setObjectName("actionClose")
+ self.actionExit = QtGui.QAction(ScriptEditor)
+ self.actionExit.setObjectName("actionExit")
+ self.actionRun = QtGui.QAction(ScriptEditor)
+ self.actionRun.setObjectName("actionRun")
+ self.actionRunConsole = QtGui.QAction(ScriptEditor)
+ self.actionRunConsole.setObjectName("actionRunConsole")
+ self.actionNewPython = QtGui.QAction(ScriptEditor)
+ self.actionNewPython.setObjectName("actionNewPython")
+ self.actionNewQtScript = QtGui.QAction(ScriptEditor)
+ self.actionNewQtScript.setObjectName("actionNewQtScript")
+ self.menu_New.addAction(self.actionNewPython)
+ self.menu_New.addAction(self.actionNewQtScript)
+ self.menuFile.addAction(self.menu_New.menuAction())
+ self.menuFile.addAction(self.actionClose)
+ self.menuFile.addSeparator()
+ self.menuFile.addAction(self.actionExit)
+ self.menuRun.addAction(self.actionRun)
+ self.menuRun.addAction(self.actionRunConsole)
+ self.menubar.addAction(self.menuFile.menuAction())
+ self.menubar.addAction(self.menuRun.menuAction())
+
+ self.retranslateUi(ScriptEditor)
+ QtCore.QMetaObject.connectSlotsByName(ScriptEditor)
+
+ def retranslateUi(self, ScriptEditor):
+ ScriptEditor.setWindowTitle(QtGui.QApplication.translate("ScriptEditor", "Script Editor", None, QtGui.QApplication.UnicodeUTF8))
+ self.menuFile.setTitle(QtGui.QApplication.translate("ScriptEditor", "&File", None, QtGui.QApplication.UnicodeUTF8))
+ self.menu_New.setTitle(QtGui.QApplication.translate("ScriptEditor", "&New", None, QtGui.QApplication.UnicodeUTF8))
+ self.menuRun.setTitle(QtGui.QApplication.translate("ScriptEditor", "&Run", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionClose.setText(QtGui.QApplication.translate("ScriptEditor", "&Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionClose.setShortcut(QtGui.QApplication.translate("ScriptEditor", "Ctrl+W", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionExit.setText(QtGui.QApplication.translate("ScriptEditor", "&Exit", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionRun.setText(QtGui.QApplication.translate("ScriptEditor", "&Run", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionRun.setShortcut(QtGui.QApplication.translate("ScriptEditor", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionRunConsole.setText(QtGui.QApplication.translate("ScriptEditor", "Run script in &console", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionRunConsole.setShortcut(QtGui.QApplication.translate("ScriptEditor", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionNewPython.setText(QtGui.QApplication.translate("ScriptEditor", "Python", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionNewPython.setShortcut(QtGui.QApplication.translate("ScriptEditor", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionNewQtScript.setText(QtGui.QApplication.translate("ScriptEditor", "QtScript", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtGui.QApplication(sys.argv)
+ ScriptEditor = QtGui.QMainWindow()
+ ui = Ui_ScriptEditor()
+ ui.setupUi(ScriptEditor)
+ ScriptEditor.show()
+ sys.exit(app.exec_())
+
Index: Scribus/scribus/plugins/scripter/python/sceditor/dockwidget_icons.qrc
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/dockwidget_icons.qrc (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/dockwidget_icons.qrc (revision 14647)
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+<qresource>
+ <file>pin.png</file>
+ <file>arrow-right.png</file>
+ <file>arrow-down.png</file>
+</qresource>
+</RCC>
\ No newline at end of file
Index: Scribus/scribus/plugins/scripter/python/sceditor/mainwindow.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/mainwindow.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/mainwindow.py (revision 14647)
@@ -0,0 +1,121 @@
+from PyQt4.QtCore import pyqtSignature, Qt
+from PyQt4.QtGui import QMainWindow, QSplitter, QTabWidget, QApplication
+
+from sceditor.widget import PythonEditorWidget, QtScriptEditorWidget
+from sceditor.console import PythonConsole, QtScriptConsole
+from sceditor.mainwindow_ui import Ui_ScriptEditor
+
+
+import traceback
+
+
+template_py = """\
+# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
+"""
+
+class EditorMainWindow(QMainWindow):
+
+
+ def __init__(self, parent=None):
+ QMainWindow.__init__(self, parent)
+ self.ui = Ui_ScriptEditor()
+ self.ui.setupUi(self)
+ #self.connect(self.ui.actionExit, SIGNAL("triggered()"), self.exit)
+ self.splitter = QSplitter(Qt.Vertical, self)
+ self.setCentralWidget(self.splitter)
+ self.edit_tab = QTabWidget(self.splitter)
+ self.console_tab = QTabWidget(self.splitter)
+ self.py_console = PythonConsole(self.console_tab)
+ self.console_tab.addTab(self.py_console, "&Python console")
+ self.js_console = QtScriptConsole(self.console_tab)
+ self.console_tab.addTab(self.js_console, "&QtScript console")
+ self.editors = []
+ self.on_actionNewPython_triggered()
+
+
+ @pyqtSignature("")
+ def on_actionExit_triggered(self):
+ self.close()
+
+
+ @pyqtSignature("")
+ def on_actionNewPython_triggered(self):
+ pyedit = PythonEditorWidget(self.edit_tab)
+ pyedit.setPlainText(template_py)
+ self.edit_tab.addTab(pyedit, "Python")
+ self.edit_tab.setCurrentWidget(pyedit)
+ self.editors.append(pyedit)
+ self.py_console.attach()
+ self.console_tab.setCurrentIndex(0)
+ pyedit.setFocus()
+ pyedit.view.setFocus()
+
+
+ @pyqtSignature("")
+ def on_actionNewQtScript_triggered(self):
+ jsedit = QtScriptEditorWidget(self.edit_tab)
+ self.edit_tab.addTab(jsedit, "QtScript")
+ self.edit_tab.setCurrentWidget(jsedit)
+ self.editors.append(jsedit)
+ self.js_console.attach()
+ self.console_tab.setCurrentIndex(1)
+
+
+ @pyqtSignature("")
+ def on_actionClose_triggered(self):
+ edit = self.edit_tab.currentWidget()
+ if edit:
+ i = self.edit_tab.indexOf(edit)
+ self.edit_tab.removeTab(i)
+ self.editors.remove(edit)
+
+
+
+ @pyqtSignature("")
+ def on_actionRun_triggered(self):
+ self.run()
+
+
+ @pyqtSignature("")
+ def on_actionRunConsole_triggered(self):
+ self.run(True)
+
+
+ def run(self, console=False):
+ edit = self.edit_tab.currentWidget()
+ code = str(edit.toPlainText())
+ if isinstance(edit, PythonEditorWidget):
+ self.py_console.attach()
+ self.console_tab.setCurrentIndex(0)
+ if console:
+ namespace = self.py_console.namespace
+ else:
+ namespace = {}
+ try:
+ exec code in namespace
+ except Exception, e:
+ traceback.print_exc()
+ try:
+ Scripter.activeWindow.redraw = True
+ Scripter.activeWindow.update()
+ except: pass
+ else:
+ self.js_console.attach()
+ self.console_tab.setCurrentIndex(1)
+ if console:
+ self.js_console.inter.execute(code)
+ else:
+ self.js_console.inter.execute_code(code)
+
+
+
+
+if __name__ == "__main__":
+ import sys
+ app = QApplication(sys.argv)
+ win = EditorMainWindow()
+ win.resize(640, 480)
+ win.show()
+ app.exec_()
Index: Scribus/scribus/plugins/scripter/python/sceditor/dockwidget_icons.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/dockwidget_icons.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/dockwidget_icons.py (revision 14647)
@@ -0,0 +1,154 @@
+# -*- coding: utf-8 -*-
+
+# Resource object code
+#
+# Created: Mi Aug 20 05:23:34 2008
+# by: The Resource Compiler for PyQt (Qt v4.3.4)
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore
+
+qt_resource_data = "\
+\x00\x00\x02\x0d\
+\x89\
+\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
+\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
+\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
+\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x01\xbb\x00\x00\x01\xbb\
+\x01\x3a\xec\xe3\xe2\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
+\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
+\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x8a\x49\x44\
+\x41\x54\x78\xda\xdd\x93\x31\x4b\x5c\x41\x14\x85\xcf\xbc\x37\xc3\
+\x6e\x50\x57\xc5\x64\xc5\x3f\x91\xca\x56\x48\x13\x42\x04\x8d\x8b\
+\x55\xfe\x80\xe8\x3f\x90\x20\x68\x61\x93\xc2\xc2\x5a\xd1\x36\x65\
+\x92\x26\x16\x46\xc5\x22\xe5\x6a\x23\x08\x8b\x98\x14\xba\xb3\xef\
+\xe5\xed\x2a\x6f\x67\x57\x9d\xf7\xf6\x38\x3c\xd0\xca\x28\x92\x42\
+\xf0\xbb\x5c\xb8\x30\x70\x38\x9c\x3b\x57\x90\xc4\xff\xe0\xb9\x7e\
+\x5a\x01\x09\x87\x70\x60\x02\x79\x3c\x86\xaf\xb8\xa0\x23\x13\xc0\
+\x18\x16\x47\x87\x47\x3f\x59\x61\x61\x5c\xc5\x7e\x0c\xe3\xbb\x49\
+\x1a\xd4\x44\x00\x14\x00\x74\x89\xcc\x6f\x91\x45\xf4\x5e\xf6\xa1\
+\x32\x52\x59\x01\x30\x95\x09\xc0\x60\x49\xff\xd5\xd3\xa5\x52\xa9\
+\x5f\x9f\x6b\x51\x35\x55\x68\xab\x11\x7a\x21\x6a\xac\x01\xaf\x00\
+\xbc\x64\xe6\xb7\xa1\x23\xe2\xb7\x67\x70\x95\xce\xdf\x66\xc0\x9f\
+\xac\x97\x0f\xcb\x6f\xb7\x76\xb6\xac\x92\x0a\xca\x53\x90\x42\x42\
+\x75\x14\x70\x05\xa0\xe5\xba\xee\x3a\x00\x06\x6a\xc5\x34\x08\x83\
+\x12\x67\x59\xbd\xc9\x20\x83\x3f\x58\x16\x1f\xc4\x74\x77\x6f\xf7\
+\x4a\x61\xa8\xe0\xab\x54\xc1\x4f\x7d\x78\x4d\x0f\x1d\x57\x68\x3b\
+\x23\x76\x30\x0d\x8e\xc3\x39\x2e\xd8\xcd\x3b\xb7\xc0\x6f\x5c\xdf\
+\xd8\xdd\x58\x8d\xeb\x71\x2a\x13\x09\xaf\xed\x41\x9e\x4b\x20\x02\
+\x7a\xa2\x42\xd2\xfc\x63\xbe\xa7\x0b\x97\x9f\xef\x5d\xa3\x7d\x6d\
+\x67\xb6\x7f\x6d\xef\xb1\xc5\x54\x5d\x28\xb0\x4e\xe4\xce\x72\x49\
+\x27\xe2\x51\x9b\xcd\xc9\x07\xff\x01\xe7\xc9\xf8\x24\x7e\xb7\x77\
+\xb0\xdf\x90\x2d\x49\x46\xa4\x4a\x72\xc6\x34\xe2\x37\x74\x6f\x0f\
+\x0a\xdc\x84\x1a\x06\xc1\xfb\x13\x7d\x6a\x73\x2a\x9f\x34\x1b\xad\
+\x71\x2e\x53\xe3\x0e\xee\xbd\x05\xf1\x51\x4c\xe2\x85\xaf\xb8\x96\
+\x7c\xc1\x3f\x78\x06\xc7\x74\x0d\x90\x24\xc3\xdb\x6d\x74\x09\xd1\
+\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
+\x00\x00\x02\x6c\
+\x89\
+\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
+\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
+\x00\x00\x00\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\
+\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
+\xbb\x7f\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x12\x00\x00\
+\x0b\x12\x01\xd2\xdd\x7e\xfc\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
+\xd2\x0b\x01\x0d\x00\x32\x9c\x41\x83\x23\x00\x00\x01\xe9\x49\x44\
+\x41\x54\x78\xda\x85\x93\xbd\x8b\x13\x51\x14\xc5\x7f\x4f\x07\xd7\
+\xc4\x04\xb2\x90\x2d\x32\x33\x11\x41\x10\x54\x58\x85\xf8\x0f\xd8\
+\x5a\x6a\x61\x65\x63\x21\x06\x02\x3a\x29\xd2\xd8\x29\x62\x13\xc2\
+\x42\x94\x34\x61\x43\x48\x1a\x21\x56\xdb\xd8\x68\x65\xa7\x29\x76\
+\x41\x50\x41\x0c\x64\x87\xc9\x84\x7c\x1a\x21\xb3\x60\x66\x2c\xb2\
+\x6f\x36\x93\x1d\xf0\xc1\x2b\xde\xfd\x38\xe7\xde\x7b\xde\x15\xdd\
+\x6e\x17\x00\x21\x04\x42\x08\x34\x4d\xc3\xb2\x2c\xff\xbd\x7a\x57\
+\xe3\xe4\x55\x9a\xcd\x66\xc0\x09\x90\x4a\xa5\x00\xe8\x74\x3a\xb4\
+\x5a\xad\x80\x6f\x15\xc4\x30\x0c\x84\x69\x9a\x01\x06\x99\x2c\xcf\
+\x60\x30\x08\xad\x22\x91\x48\x00\x2c\x2b\x58\x67\x00\x3c\x49\x96\
+\x4c\x26\x01\x28\x95\x4a\x7e\x8c\x61\x18\xbe\x1f\xcb\xb2\xe8\xf5\
+\x7a\xd8\xb6\x4d\xbf\xdf\xf7\x01\xf6\x5f\xc7\xbc\x63\xa0\x8c\x34\
+\x66\x32\x99\x75\x1f\x4a\xa3\xd1\x08\xf4\x25\x4f\x64\xeb\x26\x3f\
+\xde\xc2\x95\xfb\x9f\xbe\xc8\xe4\x76\xbb\xcd\xbb\x67\x11\x62\xfa\
+\x6d\x60\x6f\xd9\x42\xa1\x50\xe0\x98\xe5\x0e\xf0\x5c\x02\x6c\x24\
+\xb7\xb9\x90\xba\xca\x87\x37\x2e\x49\xef\x80\x98\xae\xf2\xe7\xf0\
+\x3b\x03\xb1\x8d\x12\x4f\x9f\x0c\x14\xa8\x00\x8f\x4d\xd3\x44\x55\
+\x55\x4c\xd3\x44\xd7\x75\x66\x87\x7b\xb8\x7f\x67\x98\xfd\x23\xd4\
+\xcd\xdf\x28\x91\x34\x9e\x7b\xc4\xfe\xd7\x2e\x37\xae\xa7\xb9\x7c\
+\xeb\x09\x80\x50\x80\x2c\x50\xd5\x34\x2d\x50\xc1\xcf\xcf\x35\x46\
+\xdf\xde\x73\xf0\x6b\x41\x7a\xeb\x0c\x00\x9b\x31\x41\xc7\x76\xb9\
+\x14\xb9\xeb\xcf\x4b\x14\x8b\xc5\x80\x3c\xf9\x7c\x1e\xc0\xfb\xf8\
+\x2a\x4a\xc7\x76\x79\xb8\xe3\x04\x64\x7d\xf1\xe0\x1c\xd7\x2e\x9e\
+\xe5\xde\xcb\xf9\xb2\x83\xe1\x70\xc8\x68\x34\x62\x3c\x1e\x33\x99\
+\x4c\x7c\x15\x76\x9f\x9e\x3f\xa5\x82\xf4\xed\x3c\xda\x38\x51\xa1\
+\x5e\xaf\x87\xfd\x03\xc9\xec\x1b\xcb\xe5\xb2\x8c\x13\xb9\x5c\xce\
+\xf3\x87\x38\x9d\x4e\x03\x2d\xc4\xe3\xf1\x00\x90\xe3\x38\xa1\x3f\
+\x51\x51\x94\xa5\x8c\xb5\x5a\x2d\xb4\x02\x00\xcb\xb2\xa8\x56\xab\
+\xa7\x76\x05\xa0\x52\xa9\x90\xcd\x66\x11\xb3\xd9\x2c\xc0\x10\x8d\
+\x46\x99\xcf\xe7\xa1\xdb\xb8\x5e\x09\x80\x70\x1c\x87\xc5\x62\xf1\
+\xdf\xb5\x0d\x4b\x06\xf8\x07\xf0\x1d\xb1\x3d\x6a\xe9\x1c\x20\x00\
+\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
+\x00\x00\x02\x0f\
+\x89\
+\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
+\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
+\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
+\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x01\xbb\x00\x00\x01\xbb\
+\x01\x3a\xec\xe3\xe2\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
+\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
+\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x8c\x49\x44\
+\x41\x54\x78\xda\xa5\x93\x3f\x4b\x9b\x51\x14\x87\x7f\xe7\xfe\x79\
+\x93\x5c\xd3\x94\x1a\xad\x28\x2e\x9a\x21\x38\x04\x6a\xa1\x85\x40\
+\x1d\x05\xc9\xa4\x11\xa1\x54\x27\x33\xb4\x73\xa5\x73\xe9\x26\x01\
+\xc1\xc5\x45\x17\xe9\xd2\x51\xfc\x16\x0e\xfd\x02\x8d\x58\x11\x41\
+\x13\x93\x9a\x28\xc6\x44\xdf\x7b\xdf\xa3\x59\x2d\x89\xd1\x3c\x70\
+\xa6\x03\x0f\x9c\xdf\x39\x87\x98\x19\xbd\x20\xf0\x00\x9a\xa5\x4c\
+\x64\x3e\xb2\xf4\x6c\x01\x18\x4b\x2b\x8b\x2b\x3f\x63\x1f\x63\x5b\
+\xf4\x83\xe8\xc9\x82\x16\x66\xc0\x50\x6e\x21\xb7\x3c\x7c\x38\xfc\
+\x9b\xa6\xa9\xff\x69\x82\x08\x50\xbc\x2c\xc2\x85\x9d\xc8\xce\x66\
+\xdf\x24\x92\x89\x3f\x94\xa1\x49\xb4\x41\xe1\x21\x7d\x40\xb1\x5e\
+\x04\xa8\xd5\x54\x22\xfd\x21\x1d\x37\x2f\xcc\x1e\xcd\xd1\x67\xde\
+\xe1\xed\x47\x05\xc2\x48\x59\xb2\x25\x04\x41\xd0\x12\x40\x5b\x4d\
+\xa3\xe3\xa3\x9e\x0e\xe9\x2d\xef\x93\x97\xf6\x93\xfe\x17\xfe\xce\
+\xdc\x5e\x10\x16\xb2\x42\x15\xf8\xe4\x43\x3b\x0d\xe5\x2b\xc8\x86\
+\x84\x8e\x68\x95\x1a\x4b\xe5\x0a\xc7\xfb\x6f\x89\xe8\x3d\xdf\xd3\
+\x56\x50\xa0\x02\x6c\x60\x81\x06\x40\x17\x04\x51\x13\x70\x65\x07\
+\x73\x63\x38\x30\x01\x75\x0c\x51\x7a\x5a\x88\x41\x01\xc4\x01\xbc\
+\x04\x38\xca\x70\x21\x87\x57\x43\xfd\xd6\xc6\x83\x5f\xcd\x91\xe6\
+\x3b\xe6\x4e\x23\x78\x42\x71\x4b\x70\x05\xc0\x02\xba\xae\xd9\x67\
+\xe7\x57\x9b\xb5\xaf\xbc\xee\x36\x1e\x0d\x91\x34\xc9\xfb\x02\x08\
+\x88\x22\xea\xc2\x0d\x73\x55\x69\x54\x67\x78\xed\x76\xaf\xab\x35\
+\x4a\xad\x24\x9f\x5a\xbc\xae\x0f\x59\x7b\x14\x1c\x54\x4e\xce\xa6\
+\x38\xcf\xe5\xae\x0f\x49\x28\x21\xc7\xfe\x25\x70\xfd\xf7\x76\xf7\
+\xbc\x5a\x9e\xe0\x55\x2e\xa3\x03\xff\x7d\xa3\xca\x87\xe6\x40\x34\
+\x68\xbf\x35\x37\xd1\x05\x3d\xbf\xf3\x1d\x7f\x4b\x95\x33\x4b\xa1\
+\xe2\xc5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
+"
+
+qt_resource_name = "\
+\x00\x0e\
+\x06\x0c\x0a\x07\
+\x00\x61\
+\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2d\x00\x64\x00\x6f\x00\x77\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
+\x00\x07\
+\x07\x01\x57\xa7\
+\x00\x70\
+\x00\x69\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
+\x00\x0f\
+\x0f\x22\x64\xc7\
+\x00\x61\
+\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2d\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
+"
+
+qt_resource_struct = "\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x01\
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
+\x00\x00\x00\x22\x00\x00\x00\x00\x00\x01\x00\x00\x02\x11\
+\x00\x00\x00\x36\x00\x00\x00\x00\x00\x01\x00\x00\x04\x81\
+"
+
+def qInitResources():
+ QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+def qCleanupResources():
+ QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+qInitResources()
Index: Scribus/scribus/plugins/scripter/python/sceditor/rope.zip
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Scribus/scribus/plugins/scripter/python/sceditor/rope.zip
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: Scribus/scribus/plugins/scripter/python/sceditor/pin.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Scribus/scribus/plugins/scripter/python/sceditor/pin.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: Scribus/scribus/plugins/scripter/python/sceditor/widget.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/widget.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/widget.py (revision 14647)
@@ -0,0 +1,454 @@
+# -*- coding: utf-8 -*-
+import re
+import sys
+import os
+
+# I put the rope package into a ZIP-file to save space
+# and to keep everything clear
+path = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, os.path.join(path, "rope.zip"))
+
+
+from rope.base.project import get_no_project
+from rope.contrib.codeassist import code_assist
+
+from PyQt4.QtCore import QCoreApplication, QLine, Qt, SIGNAL
+from PyQt4.QtGui import (QTextCursor, QBrush, QFont, QPainter, QVBoxLayout,
+ QApplication, QKeyEvent, QTextBlockUserData, QPen, QPlainTextEdit,
+ QHBoxLayout, QPalette, QColor, QFrame, QWidget)
+
+from sceditor.indenter import PythonCodeIndenter
+from sceditor.assist import AutoComplete, CallTip
+
+from sceditor.highlighter import PythonHighlighter, QtScriptHighlighter
+
+
+
+
+
+
+
+
+
+class EditorBlockData(QTextBlockUserData):
+
+ def __init__(self):
+ QTextBlockUserData.__init__(self)
+
+
+
+
+
+
+class RopeEditorWrapper(object):
+
+
+ def __init__(self, editview):
+ self.editview = editview
+
+
+ def length(self):
+ return self.editview.length()
+
+
+ def line_editor(self):
+ return self
+
+
+ def _get_block(self, line_no=None):
+ cursor = self.editview.textCursor()
+ row = cursor.blockNumber()
+ if line_no == None:
+ line_no = row
+ block = cursor.block()
+ while row > line_no:
+ block = block.previous()
+ row -= 1
+ while row < line_no:
+ block = block.next()
+ row += 1
+ return block
+
+
+ def get_line(self, line_no=None):
+ return unicode(self._get_block(line_no).text())
+
+
+ def indent_line(self, line_no, indent_length):
+ block = self._get_block(line_no)
+ cursor = QTextCursor(block)
+ cursor.joinPreviousEditBlock()
+ cursor.movePosition(QTextCursor.StartOfBlock, QTextCursor.MoveAnchor)
+ if indent_length < 0:
+ for i in range(-indent_length):
+ cursor.deleteChar()
+ else:
+ cursor.insertText(" " * indent_length)
+ if indent_length:
+ cursor.movePosition(
+ QTextCursor.StartOfBlock, QTextCursor.MoveAnchor)
+ line = unicode(cursor.block().text())
+ if len(line) and line[0] == " ":
+ cursor.movePosition(
+ QTextCursor.NextWord, QTextCursor.MoveAnchor)
+ self.editview.setTextCursor(cursor)
+ cursor.endEditBlock()
+
+
+
+
+class EditorView(QPlainTextEdit):
+
+
+ def __init__(self, parent=None, text=None,
+ EditorHighlighterClass=PythonHighlighter,
+ indenter=PythonCodeIndenter):
+ QPlainTextEdit.__init__(self, parent)
+ self.setFrameStyle(QFrame.NoFrame)
+ self.setTabStopWidth(4)
+ self.setLineWrapMode(QPlainTextEdit.NoWrap)
+ font = QFont()
+ font.setFamily("lucidasanstypewriter")
+ font.setFixedPitch(True)
+ font.setPointSize(10)
+ self.setFont(font)
+ self.highlighter = EditorHighlighterClass(self)
+ if text:
+ self.setPlainText(text)
+ self.frame_style = self.frameStyle()
+ self.draw_line = True
+ self.print_width = self.fontMetrics().width("x"*78)
+ self.line_pen = QPen(QColor("lightgrey"))
+ self.last_row = self.last_col = -1
+ self.last_block = None
+ self.highlight_line = True
+ self.highlight_color = self.palette().highlight().color().light(175)
+ self.highlight_brush = QBrush(QColor(self.highlight_color))
+ self.connect(self, SIGNAL("cursorPositionChanged()"),
+ self.onCursorPositionChanged)
+ self.indenter = indenter(RopeEditorWrapper(self))
+ # True if you want to catch Emacs keys in actions
+ self.disable_shortcuts = False
+
+ self.prj = get_no_project()
+ self.prj.root = None
+ self.calltip = CallTip(self)
+ self.autocomplete = AutoComplete(self)
+
+
+ def closeEvent(self, event):
+ self.calltip.close()
+ self.autocomplete.close()
+
+
+ def isModified(self):
+ return self.document().isModified()
+
+
+ def setModified(self, flag):
+ self.document().setModified(flag)
+
+
+ def length(self):
+ return self.document().blockCount()
+
+
+ def goto(self, line_no):
+ cursor = self.textCursor()
+ block = cursor.block()
+ row = cursor.blockNumber()
+ while row > line_no:
+ block = block.previous()
+ row -= 1
+ while row < line_no:
+ block = block.next()
+ row += 1
+ cursor = QTextCursor(block)
+ self.setTextCursor(cursor)
+
+
+ def move_start_of_doc(self):
+ cursor = self.textCursor()
+ cursor.setPosition(0)
+ self.setTextCursor(cursor)
+
+
+ def move_end_of_doc(self):
+ cursor = self.textCursor()
+ block = cursor.block()
+ while block.isValid():
+ last_block = block
+ block = block.next()
+ cursor.setPosition(last_block.position())
+ cursor.movePosition(
+ QTextCursor.EndOfBlock, QTextCursor.MoveAnchor)
+ self.setTextCursor(cursor)
+
+
+ def move_start_of_row(self):
+ cursor = self.textCursor()
+ cursor.movePosition(
+ QTextCursor.StartOfBlock, QTextCursor.MoveAnchor)
+ self.setTextCursor(cursor)
+
+
+ def move_end_of_row(self):
+ cursor = self.textCursor()
+ cursor.movePosition(
+ QTextCursor.EndOfBlock, QTextCursor.MoveAnchor)
+ self.setTextCursor(cursor)
+
+
+ def highline(self, cursor):
+ self.viewport().update()
+
+
+ def onCursorPositionChanged(self):
+ cursor = self.textCursor()
+ row, col = cursor.blockNumber(), cursor.columnNumber()
+ if self.last_row != row:
+ self.last_row = row
+ if self.highlight_line:
+ self.highline(cursor)
+ if col != self.last_col:
+ self.last_col = col
+ self.emit(SIGNAL("cursorPositionChanged(int,int)"), row, col)
+
+
+ def _create_line(self):
+ x = self.print_width
+ self.line = QLine(x, 0, x, self.height())
+
+
+ def resizeEvent(self, event):
+ self._create_line()
+ QPlainTextEdit.resizeEvent(self, event)
+
+
+ def paintEvent(self, event):
+ painter = QPainter(self.viewport())
+ if self.highlight_line:
+ r = self.cursorRect()
+ r.setX(0)
+ r.setWidth(self.viewport().width())
+ painter.fillRect(r, self.highlight_brush)
+ if self.draw_line:
+ painter.setPen(self.line_pen)
+ painter.drawLine(self.line)
+ painter.end()
+ QPlainTextEdit.paintEvent(self, event)
+
+
+ def setDocument(self, document):
+ QPlainTextEdit.setDocument(self, document)
+ self.highlighter.setDocument(document)
+
+
+ def indent(self):
+ self.indenter.correct_indentation(self.textCursor().blockNumber())
+
+
+ def tab_pressed(self):
+ self.indent()
+
+
+ def dedent(self):
+ self.indenter.deindent(self.textCursor().blockNumber())
+
+
+ def backtab_pressed(self):
+ self.dedent()
+ return True
+
+
+ def backspace_pressed(self):
+ cursor = self.textCursor()
+ text = unicode(cursor.block().text())
+ col = cursor.columnNumber()
+ if col > 0 and text[:col].strip() == "":
+ self.indenter.deindent(self.textCursor().blockNumber())
+ return True
+
+
+ def autocomplete_pressed(self):
+ try:
+ items = code_assist(self.prj,
+ unicode(self.toPlainText()),
+ self.textCursor().position())
+ except Exception, e:
+ items = []
+ if items:
+ self.autocomplete.setItems(items)
+ self.autocomplete.show()
+
+
+ def after_return_pressed(self):
+ self.indenter.entering_new_line(self.textCursor().blockNumber())
+
+
+ def keyPressEvent(self, event):
+ if self.autocomplete.active:
+ if self.autocomplete.keyPressEvent(event):
+ return
+ elif self.calltip.active:
+ if self.calltip.keyPressEvent(event):
+ return
+
+ m = event.modifiers()
+ k = event.key()
+ t = event.text()
+ # Disable some shortcuts
+ if self.disable_shortcuts and \
+ m & Qt.ControlModifier and k in [Qt.Key_A, Qt.Key_R,
+ Qt.Key_C, Qt.Key_K,
+ Qt.Key_X, Qt.Key_V,
+ Qt.Key_Y, Qt.Key_Z]:
+ new_ev = QKeyEvent(event.type(), k, m, t)
+ event.ignore()
+ QCoreApplication.postEvent(self.parent(), new_ev)
+ return
+ elif k == Qt.Key_Tab:
+ if self.tab_pressed():
+ return
+ elif k == Qt.Key_Backtab:
+ if self.backtab_pressed():
+ return
+ elif k == Qt.Key_Backspace:
+ if self.backspace_pressed():
+ return
+ elif k == Qt.Key_Period or \
+ (k == Qt.Key_Space and event.modifiers() == Qt.ControlModifier):
+ QPlainTextEdit.keyPressEvent(self, event)
+ self.autocomplete_pressed()
+ return
+ elif k in [Qt.Key_ParenLeft, Qt.Key_BraceLeft, Qt.Key_BracketLeft]:
+ QPlainTextEdit.keyPressEvent(self, event)
+ self.paren_opened(k)
+ return
+ QPlainTextEdit.keyPressEvent(self, event)
+ if k == Qt.Key_Return or k == Qt.Key_Enter:
+ self.after_return_pressed()
+
+
+
+ def paren_opened(self, key):
+ close_char = {
+ Qt.Key_ParenLeft: ")",
+ Qt.Key_BraceLeft:" }",
+ Qt.Key_BracketLeft:"]"
+ }
+ cursor = self.textCursor()
+ cursor.insertText(close_char[key])
+ cursor.setPosition(cursor.position()-1)
+ self.setTextCursor(cursor)
+
+
+
+class EditorSidebar(QWidget):
+
+
+ def __init__(self, editor):
+ QWidget.__init__(self, editor)
+ self.editor = editor
+ self.view = editor.view
+ self.doc = editor.view.document
+ self.fm = self.fontMetrics()
+ self.show_line_numbers = True
+
+ self.setAutoFillBackground(True)
+ #bg = editor.view.palette().base().color()
+ #pal = QPalette()
+ #pal.setColor(self.backgroundRole(), bg)
+ #self.setPalette(pal)
+ self.setBackgroundRole(QPalette.Base)
+
+ self.connect(self.doc().documentLayout(),
+ SIGNAL("update(const QRectF &)"),
+ self.update)
+ self.connect(self.view.verticalScrollBar(),
+ SIGNAL("valueChanged(int)"),
+ self.update)
+ self.first_row = self.last_row = self.rows = 0
+ width = 10
+ if self.show_line_numbers:
+ width += self.fm.width("00000")
+ self.setFixedWidth(width)
+
+
+
+ def paintEvent(self, event):
+ QWidget.paintEvent(self, event)
+ p = QPainter(self)
+ view = self.view
+ first = view.firstVisibleBlock()
+ first_row = first.blockNumber()
+ block = first
+ row = first_row
+ y = view.contentOffset().y()
+ pageBottom = max(
+ view.height(),
+ view.verticalScrollBar().value() + view.viewport().height())
+ fm = self.fm
+ w = self.width() - 8
+ while block.isValid():
+ txt = str(row).rjust(5)
+ y = view.blockBoundingGeometry(block).y()
+ if y >= pageBottom:
+ break
+ x = w - fm.width(txt)
+ p.drawText(x, y, txt)
+ row += 1
+ block = block.next()
+ p.end()
+
+
+
+class EditorWidget(QFrame):
+
+
+ def __init__(self, parent=None, text=None,
+ EditorSidebarClass=EditorSidebar,
+ EditorViewClass=EditorView):
+ QFrame.__init__(self, parent)
+ self.view = EditorViewClass(self, text)
+ self.sidebar = EditorSidebarClass(self)
+ self.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
+ self.setLineWidth(2)
+ self.vlayout = QVBoxLayout()
+ self.vlayout.setSpacing(0)
+ self.setLayout(self.vlayout)
+ self.hlayout = QHBoxLayout()
+ self.vlayout.addLayout(self.hlayout)
+ self.hlayout.addWidget(self.sidebar)
+ self.hlayout.addWidget(self.view)
+ self.vlayout.setContentsMargins(2, 2, 2, 2)
+
+
+ def setPlainText(self, text):
+ self.view.document().setPlainText(text)
+ self.view.setModified(False)
+
+
+ def toPlainText(self):
+ return unicode(self.view.document().toPlainText())
+
+
+class PythonEditorWidget(EditorWidget):
+ pass
+
+class QtScriptEditorWidget(QPlainTextEdit):
+
+ def __init__(self, parent):
+ QPlainTextEdit.__init__(self, parent)
+ self.highlighter = QtScriptHighlighter(self)
+
+
+if __name__ == "__main__":
+ if __file__ == "<stdin>": __file__ = "./widget.py"
+ import sys
+ app = QApplication(sys.argv)
+ src = open(__file__).read()
+ edit = EditorWidget(text=src)
+ edit.resize(640,480)
+ edit.show()
+ app.exec_()
Index: Scribus/scribus/plugins/scripter/python/sceditor/dockwidget.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/sceditor/dockwidget.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/sceditor/dockwidget.py (revision 14647)
@@ -0,0 +1,429 @@
+# Ported from KoDockWidgetTitleBar.cpp which is part of KOffice
+# Copyright (c) 2007 Marijn Kruisselbrink <m.kruisselbrink@student.tue.nl>
+# Copyright (C) 2007 Thomas Zander <zander@kde.org>
+# The code is distributed under GPL 2 or any later version
+import os
+
+from PyQt4.QtCore import QPoint, QSize, Qt, QRect, SIGNAL, QTimer
+from PyQt4.QtGui import (QAbstractButton, QMainWindow, QComboBox, QStyle,
+ QPainter, QPushButton, QDockWidget, QApplication, QStylePainter,
+ QIcon, QHBoxLayout, QStyleOptionToolButton, QWidget,
+ QStyleOptionDockWidgetV2, QLayout)
+
+
+import dockwidget_icons
+
+
+def hasFeature(dockwidget, feature):
+ return dockwidget.features() & feature == feature
+
+
+
+class DockWidgetTitleBarButton(QAbstractButton):
+
+
+ def __init__(self, titlebar):
+ QAbstractButton.__init__(self, titlebar)
+ self.setFocusPolicy(Qt.NoFocus)
+
+
+ def sizeHint(self):
+ self.ensurePolished()
+ margin = self.style().pixelMetric(QStyle.PM_DockWidgetTitleBarButtonMargin, None, self)
+ if self.icon().isNull():
+ return QSize(margin, margin)
+ iconSize = self.style().pixelMetric(QStyle.PM_SmallIconSize, None, self)
+ pm = self.icon().pixmap(iconSize)
+ return QSize(pm.width() + margin, pm.height() + margin)
+
+
+ def enterEvent(self, event):
+ if self.isEnabled():
+ self.update()
+ QAbstractButton.enterEvent(self, event)
+
+
+ def leaveEvent(self, event):
+ if self.isEnabled():
+ self.update()
+ QAbstractButton.leaveEvent(self, event)
+
+
+
+ def paintEvent(self, event):
+ p = QPainter(self)
+ r = self.rect()
+ opt = QStyleOptionToolButton()
+ opt.init(self)
+ opt.state |= QStyle.State_AutoRaise
+ if self.isEnabled() and self.underMouse() and \
+ not self.isChecked() and not self.isDown():
+ opt.state |= QStyle.State_Raised
+ if self.isChecked():
+ opt.state |= QStyle.State_On
+ if self.isDown():
+ opt.state |= QStyle.State_Sunken
+ self.style().drawPrimitive(
+ QStyle.PE_PanelButtonTool, opt, p, self)
+ opt.icon = self.icon()
+ opt.subControls = QStyle.SubControls()
+ opt.activeSubControls = QStyle.SubControls()
+ opt.features = QStyleOptionToolButton.None
+ opt.arrowType = Qt.NoArrow
+ size = self.style().pixelMetric(QStyle.PM_SmallIconSize, None, self)
+ opt.iconSize = QSize(size, size)
+ self.style().drawComplexControl(QStyle.CC_ToolButton, opt, p, self)
+
+
+
+
+class DockWidgetTitleBar(QWidget):
+ # XXX: support QDockWidget.DockWidgetVerticalTitleBar feature
+
+
+ def __init__(self, dockWidget):
+ QWidget.__init__(self, dockWidget)
+ self.openIcon = QIcon(":arrow-down.png")
+ self.closeIcon = QIcon(":arrow-right.png")
+ self.pinIcon = QIcon(":pin.png")
+ q = dockWidget
+ self.floatButton = DockWidgetTitleBarButton(self)
+ self.floatButton.setIcon(q.style().standardIcon(
+ QStyle.SP_TitleBarNormalButton, None, q))
+ self.connect(self.floatButton, SIGNAL("clicked()"),
+ self.toggleFloating)
+ self.floatButton.setVisible(True)
+ self.closeButton = DockWidgetTitleBarButton(self)
+ self.closeButton.setIcon(q.style().standardIcon(
+ QStyle.SP_TitleBarCloseButton, None, q))
+ self.connect(self.closeButton, SIGNAL("clicked()"), dockWidget.close)
+ self.closeButton.setVisible(True)
+ self.collapseButton = DockWidgetTitleBarButton(self)
+ self.collapseButton.setIcon(self.openIcon)
+ self.connect(self.collapseButton, SIGNAL("clicked()"),
+ self.toggleCollapsed)
+ self.collapseButton.setVisible(True)
+ self.pinButton = DockWidgetTitleBarButton(self)
+ self.pinButton.setIcon(self.pinIcon)
+ self.pinButton.setCheckable(True)
+ self.pinButton.setChecked(True)
+ self.connect(self.pinButton, SIGNAL("clicked(bool)"), self.togglePinned)
+ self.pinButton.setVisible(True)
+ self.connect(dockWidget, SIGNAL("featuresChanged(QDockWidget.DockWidgetFeatures)"), self.featuresChanged)
+ self.featuresChanged(0)
+
+
+ def minimumSizeHint(self):
+ return self.sizeHint()
+
+
+ def sizeHint(self):
+ q = self.parentWidget()
+ mw = q.style().pixelMetric(QStyle.PM_DockWidgetTitleMargin, None, q)
+ fw = q.style().pixelMetric(QStyle.PM_DockWidgetFrameWidth, None, q)
+ closeSize = QSize(0, 0)
+ if self.closeButton:
+ closeSize = self.closeButton.sizeHint()
+ floatSize = QSize(0, 0)
+ if self.floatButton:
+ floatSize = self.floatButton.sizeHint()
+ hideSize = QSize(0, 0)
+ if self.collapseButton:
+ hideSize = self.collapseButton.sizeHint()
+ pinSize = QSize(0, 0)
+ if self.pinButton:
+ pinSize = self.pinButton.sizeHint()
+ buttonHeight = max(max(closeSize.height(), floatSize.height()),
+ hideSize.height(), pinSize.height()) + 2
+ buttonWidth = closeSize.width() + floatSize.width() + hideSize.width() + pinSize.width()
+ titleFontMetrics = q.fontMetrics()
+ fontHeight = titleFontMetrics.lineSpacing() + 2 * mw
+ height = max(buttonHeight, fontHeight)
+ width = buttonWidth + height + 4 * mw + 2 * fw
+ if hasFeature(q, QDockWidget.DockWidgetVerticalTitleBar):
+ width, height = height, width
+ return QSize(width, height)
+
+
+ def paintEvent(self, event):
+ p = QStylePainter(self)
+ q = self.parentWidget()
+ if hasFeature(q, QDockWidget.DockWidgetVerticalTitleBar):
+ fw = 1 or q.isFloating() and q.style().pixelMetric(
+ QStyle.PM_DockWidgetFrameWidth, None, q) or 0
+ mw = q.style().pixelMetric(QStyle.PM_DockWidgetTitleMargin, None, q)
+ titleOpt = QStyleOptionDockWidgetV2()
+ titleOpt.initFrom(q)
+ titleOpt.verticalTitleBar = True
+ titleOpt.rect = QRect(
+ QPoint(fw, fw + mw + \
+ self.collapseButton.size().height() + self.pinButton.size().height()),
+ QSize(
+ self.geometry().width() - (fw * 2),
+ self.geometry().height() - (fw * 2) - \
+ mw - self.collapseButton.size().height() - self.pinButton.size().height()))
+ titleOpt.title = q.windowTitle()
+ titleOpt.closable = hasFeature(q, QDockWidget.DockWidgetClosable)
+ titleOpt.floatable = hasFeature(q, QDockWidget.DockWidgetFloatable)
+ p.drawControl(QStyle.CE_DockWidgetTitle, titleOpt)
+ else:
+ fw = q.isFloating() and q.style().pixelMetric(
+ QStyle.PM_DockWidgetFrameWidth, None, q) or 0
+ mw = q.style().pixelMetric(QStyle.PM_DockWidgetTitleMargin, None, q)
+ titleOpt = QStyleOptionDockWidgetV2()
+ titleOpt.initFrom(q)
+ titleOpt.rect = QRect(
+ QPoint(fw + mw + \
+ self.collapseButton.size().width() + self.pinButton.size().width(), fw),
+ QSize(
+ self.geometry().width() - (fw * 2) - \
+ mw - self.collapseButton.size().width() - self.pinButton.size().width(),
+ self.geometry().height() - (fw * 2)))
+ titleOpt.title = q.windowTitle()
+ titleOpt.closable = hasFeature(q, QDockWidget.DockWidgetClosable)
+ titleOpt.floatable = hasFeature(q, QDockWidget.DockWidgetFloatable)
+ p.drawControl(QStyle.CE_DockWidgetTitle, titleOpt)
+
+
+ def resizeEvent(self, event):
+ q = self.parentWidget()
+ if hasFeature(q, QDockWidget.DockWidgetVerticalTitleBar):
+ fh = q.isFloating() and q.style().pixelMetric(
+ QStyle.PM_DockWidgetFrameWidth, None, q) or 0
+ opt = QStyleOptionDockWidgetV2()
+ opt.initFrom(q)
+ opt.verticalTitleBar = True
+ opt.rect = QRect(
+ QPoint(fh, 40), #self.geometry().height() - (fh * 3)),
+ QSize(
+ self.geometry().width() - (fh * 2),
+ fh * 2))
+ opt.title = q.windowTitle()
+ opt.closable = hasFeature(q, QDockWidget.DockWidgetClosable)
+ opt.floatable = hasFeature(q, QDockWidget.DockWidgetFloatable)
+ floatRect = q.style().subElementRect(
+ QStyle.SE_DockWidgetFloatButton, opt, q)
+ if not floatRect.isNull():
+ self.floatButton.setGeometry(floatRect)
+ closeRect = q.style().subElementRect(
+ QStyle.SE_DockWidgetCloseButton, opt, q)
+ if not closeRect.isNull():
+ self.closeButton.setGeometry(closeRect)
+ top = fh
+ if not floatRect.isNull():
+ top = floatRect.x()
+ elif not closeRect.isNull():
+ top = closeRect.x()
+ size = self.collapseButton.size()
+ if not closeRect.isNull():
+ size = self.closeButton.size()
+ elif not floatRect.isNull():
+ size = self.floatButton.size()
+ collapseRect = QRect(QPoint(top, fh), size)
+ self.collapseButton.setGeometry(collapseRect)
+ pinRect = QRect(QPoint(top, fh+collapseRect.height()+1), size)
+ self.pinButton.setGeometry(pinRect)
+ else:
+ fw = q.isFloating() and q.style().pixelMetric(
+ QStyle.PM_DockWidgetFrameWidth, None, q) or 0
+ opt = QStyleOptionDockWidgetV2()
+ opt.initFrom(q)
+ opt.rect = QRect(
+ QPoint(fw, fw),
+ QSize(
+ self.geometry().width() - (fw * 2),
+ self.geometry().height() - (fw * 2)))
+ opt.title = q.windowTitle()
+ opt.closable = hasFeature(q, QDockWidget.DockWidgetClosable)
+ opt.floatable = hasFeature(q, QDockWidget.DockWidgetFloatable)
+ floatRect = q.style().subElementRect(
+ QStyle.SE_DockWidgetFloatButton, opt, q)
+ if not floatRect.isNull():
+ self.floatButton.setGeometry(floatRect)
+ closeRect = q.style().subElementRect(
+ QStyle.SE_DockWidgetCloseButton, opt, q)
+ if not closeRect.isNull():
+ self.closeButton.setGeometry(closeRect)
+ top = fw
+ if not floatRect.isNull():
+ top = floatRect.y()
+ elif not closeRect.isNull():
+ top = closeRect.y()
+ size = self.collapseButton.size()
+ if not closeRect.isNull():
+ size = self.closeButton.size()
+ elif not floatRect.isNull():
+ size = self.floatButton.size()
+ collapseRect = QRect(QPoint(fw, top), size)
+ self.collapseButton.setGeometry(collapseRect)
+ pinRect = QRect(QPoint(fw + collapseRect.width() + 1, top), size)
+ self.pinButton.setGeometry(pinRect)
+
+
+ def setCollapsed(self, collapsed):
+ q = self.parentWidget()
+ if q and q.widget() and q.widget().isHidden() != collapsed:
+ self.toggleCollapsed()
+
+
+ def toggleFloating(self):
+ q = self.parentWidget()
+ q.setFloating(not q.isFloating())
+
+
+ def toggleCollapsed(self):
+ q = self.parentWidget()
+ if not q:
+ return
+ q.toggleCollapsed()
+ self.setCollapsedIcon(q.isCollapsed())
+
+
+ def setCollapsedIcon(self, flag):
+ self.collapseButton.setIcon(flag and self.openIcon or self.closeIcon)
+
+
+ def togglePinned(self, checked):
+ self.parent().setPinned(checked)
+
+
+ def featuresChanged(self, features):
+ q = self.parentWidget()
+ self.closeButton.setVisible(hasFeature(q, QDockWidget.DockWidgetClosable))
+ self.floatButton.setVisible(hasFeature(q, QDockWidget.DockWidgetFloatable))
+ # self.resizeEvent(None)
+
+
+
+class DockMainWidgetWrapper(QWidget):
+
+
+ def __init__(self, dockwidget):
+ QWidget.__init__(self, dockwidget)
+ self.widget = None
+ self.hlayout = QHBoxLayout(self)
+ self.hlayout.setSpacing(0)
+ self.hlayout.setContentsMargins(0, 0, 0, 0)
+ self.setLayout(self.hlayout)
+
+
+ def setWidget(self, widget):
+ self.widget = widget
+ self.widget_height = widget.height
+ self.layout().addWidget(widget)
+
+
+ def isCollapsed(self):
+ return self.widget.isVisible()
+
+
+ def setCollapsed(self, flag):
+ if not flag:
+ self.old_size = self.size()
+ self.layout().removeWidget(self.widget)
+ self.widget.hide()
+ if hasFeature(self.parent(), QDockWidget.DockWidgetVerticalTitleBar):
+ self.parent().setMaximumWidth(self.parent().width() - self.width())
+ else:
+ self.parent().setMaximumHeight(self.parent().height() - self.height())
+ else:
+ self.setFixedSize(self.old_size)
+ self.parent().setMinimumSize(QSize(1, 1))
+ self.parent().setMaximumSize(QSize(32768, 32768))
+ self.widget.show()
+ self.layout().addWidget(self.widget)
+ self.setMinimumSize(QSize(1, 1))
+ self.setMaximumSize(QSize(32768, 32768))
+
+
+
+class DockWidget(QDockWidget):
+
+
+ def __init__(self, *args):
+ QDockWidget.__init__(self, *args)
+ self.titleBar = DockWidgetTitleBar(self)
+ self.setTitleBarWidget(self.titleBar)
+ self.mainWidget = None
+ self.entered = False
+ self.pinned = True
+ self.shot = False
+
+
+ def enterEvent(self, event):
+ self.entered = True
+ if not self.shot and not self.isPinned() and not self.isFloating():
+ self.shot = True
+ QTimer.singleShot(500, self.autoshow)
+ return QDockWidget.enterEvent(self, event)
+
+
+ def leaveEvent(self, event):
+ self.entered = False
+ if not self.shot and not self.isPinned() and not self.isFloating():
+ self.shot = True
+ QTimer.singleShot(1000, self.autohide)
+ return QDockWidget.leaveEvent(self, event)
+
+
+ def autohide(self):
+ self.shot = False
+ if not self.entered:
+ self.setCollapsed(False)
+
+
+ def autoshow(self):
+ self.shot = False
+ if self.entered:
+ self.setCollapsed(True)
+
+
+ def isPinned(self):
+ return self.pinned
+
+
+ def setPinned(self, flag):
+ self.pinned = flag
+
+
+ def setWidget(self, widget):
+ self.mainWidget = DockMainWidgetWrapper(self)
+ self.mainWidget.setWidget(widget)
+ QDockWidget.setWidget(self, self.mainWidget)
+
+
+ def setCollapsed(self, flag):
+ self.mainWidget.setCollapsed(flag)
+ self.titleBarWidget().setCollapsedIcon(flag)
+
+
+ def isCollapsed(self):
+ return self.mainWidget.isCollapsed()
+
+
+ def toggleCollapsed(self):
+ self.setCollapsed(not self.isCollapsed())
+
+
+
+if __name__ == "__main__":
+ import sys
+ from PyQt4.QtGui import QTextEdit
+ app = QApplication(sys.argv)
+ app.setStyle("qtcurve")
+ win = QMainWindow()
+ dock1 = DockWidget("1st dockwidget", win)
+ dock1.setFeatures(dock1.features() | QDockWidget.DockWidgetVerticalTitleBar)
+ combo = QComboBox(dock1)
+ dock1.setWidget(combo)
+ win.addDockWidget(Qt.LeftDockWidgetArea, dock1)
+ dock2 = DockWidget("2nd dockwidget")
+ dock2.setFeatures(dock1.features() | QDockWidget.DockWidgetVerticalTitleBar)
+ button = QPushButton("Hello, world!", dock2)
+ dock2.setWidget(button)
+ win.addDockWidget(Qt.RightDockWidgetArea, dock2)
+ edit = QTextEdit(win)
+ win.setCentralWidget(edit)
+ win.resize(640, 480)
+ win.show()
+ app.exec_()
Index: Scribus/scribus/plugins/scripter/python/permitdlg.py
===================================================================
--- Scribus/scribus/plugins/scripter/python/permitdlg.py (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/permitdlg.py (revision 14647)
@@ -0,0 +1,83 @@
+"""
+Simple dialog which asks if you want to allow or deny execution of a script.
+A list of possible problems is show.
+The analysis is done in safe_eval which is called from scripter_runtime
+like this module.
+
+BTW, safe_eval is great module by Jeremy Sanders used inside Veusz.
+It only allows a very small subset of Python which is considered safe.
+
+XXX: Perhaps refactor some external functionality into this module
+"""
+from PyQt4.QtCore import pyqtSignature
+from PyQt4.QtGui import QDialog, QApplication
+
+from permitdlg_ui import Ui_PermitDialog
+
+
+
+class PermitDialog(QDialog):
+
+
+ def __init__(self, filename, problems):
+ QDialog.__init__(self)
+ self.ui = Ui_PermitDialog()
+ self.ui.setupUi(self)
+ # XXX: re-enable later, remember does currently not work currectly
+ self.ui.rememberCheck.hide()
+ self.ui.filenameLabel.setText(filename)
+ # XXX: only show specific reasons for found problems
+ self.ui.problemsBrowser.setText("""
+ <i>Please look into the source for further investigation.</i>
+ <ul>
+ %s
+ </ul>
+ <p>To ensure safe execution importing external modules is not allowed by default
+ because external modules could access your system directly.
+ <br/>Additonally access to "private" attributes is not allowed because accessing
+ them could trigger side-effects which may help to break out of the sandbox.<br/>
+ Unfortunately exceptions are also a security problem because they can change
+ the control flow and you could access the stack frame.</p>
+ """ % "".join(["<li>%s</li>" % p for p in problems]))
+ self.ui.problemsBrowser.hide()
+ self.resize(self.width(), self.sizeHint().height())
+
+
+ @pyqtSignature("")
+ def on_allowButton_clicked(self):
+ if self.ui.rememberCheck.isChecked():
+ self.done(-1)
+ else:
+ self.done(1)
+
+
+ @pyqtSignature("")
+ def on_denyButton_clicked(self):
+ if self.ui.rememberCheck.isChecked():
+ self.done(-2)
+ else:
+ self.done(2)
+
+
+ @pyqtSignature("")
+ def on_detailsButton_clicked(self):
+ self.ui.problemsBrowser.setVisible(self.ui.detailsButton.isChecked())
+ self.resize(self.width(), self.sizeHint().height())
+
+
+
+def ask(filename, problems):
+ """
+ Use this fuction
+ """
+ return PermitDialog(filename, problems).exec_()
+
+
+
+if __name__ == "__main__":
+ # Demo:
+ import sys
+ import safe_eval
+ problems = safe_eval.checkCode(open("permitdlg.py").read())
+ app = QApplication(sys.argv)
+ print ask("permitdlg.py", problems)
Index: Scribus/scribus/plugins/scripter/python/examples/objectexplorer.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/examples/objectexplorer.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/examples/objectexplorer.spy (revision 14647)
@@ -0,0 +1,302 @@
+## name = objectexplorer
+## title = Object Explorer
+## description = With this dialog you can see which methods and properties are available
+## shortcut = Esc,o
+## subroutine = run
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+import mikro
+import __main__
+
+
+class MethodItem(QTreeWidgetItem):
+
+ def __init__(self, parent, obj, name, return_type, args):
+ QTreeWidgetItem.__init__(self, parent, [name,
+ return_type,
+ args])
+ self.obj = obj
+ self.name = name
+ self.return_type = return_type
+ self.args = args
+
+
+ def call(self):
+ obj = mikro.create_pyqt_object(self.obj)
+ method = getattr(obj, self.name)
+ if self.args:
+ value, ok = QInputDialog.getText(
+ qApp.activeWindow(), "Call %s.%s(%s)" % (
+ obj.objectName or ("(%s-instance)" % obj.qt.metaObject().className()),
+ self.name, self.args),
+ "Arguments:")
+ if not ok:
+ return
+ value = str(value)
+ if not value:
+ return
+ try:
+ args = eval(value, __main__.__dict__)
+ if not isinstance(args, tuple):
+ args = (args,)
+ except Exception, e:
+ QMessageBox.warning(qApp.activeWindow(), "Error evaluating input", str(e))
+ return
+ else:
+ args = ()
+ result = mikro.unwrap(method(*args))
+ if isinstance(result, QObject):
+ ObjectExplorer.open(result)
+ else:
+ QMessageBox.information(
+ qApp.activeWindow(),
+ "Result of method call",
+ repr(result))
+
+
+
+class MethodList(QTreeWidget):
+
+ def __init__(self, parent):
+ QTreeWidget.__init__(self, parent)
+ self.setColumnCount(3)
+ self.setHeaderLabels(["Name", "Return-Type", "Arguments"])
+ self.connect(self,
+ SIGNAL("itemDoubleClicked(QTreeWidgetItem*, int)"),
+ self.doubleClicked)
+
+
+ def doubleClicked(self, item, col):
+ item.call()
+
+
+ def refresh(self, obj):
+ self.obj = obj
+ self.items = []
+ self.clear()
+ mo = self.obj.metaObject()
+ for i in xrange(mo.methodCount()):
+ m = mo.method(i)
+ if m.access() in [QMetaMethod.Private, QMetaMethod.Protected]:
+ continue
+ name, sig = str(m.signature()).split("(", 1)
+ if m.methodType() == QMetaMethod.Signal:
+ name += " [SIGNAL]"
+ types = [str(t) for t in m.parameterTypes()]
+ names = [str(n) or "arg%i" % (i+1) for i, n in enumerate(m.parameterNames())]
+ params = ", ".join("%s %s" % (t, n) for n, t in zip(types, names))
+ ti = MethodItem(self, self.obj,
+ name, m.typeName(), params,
+ )
+ self.items.append(ti)
+
+
+
+
+class VariantList(QObject):
+
+ def __init__(self, l):
+ QObject.__init__(self, None)
+ self.l = l
+
+ def children(self):
+ return self.l
+
+
+
+class PropertyItem(QTreeWidgetItem):
+
+
+ def __init__(self, parent, obj, name, value):
+ self.obj = obj
+ self.name = name
+ self.value = value
+ self.typeName = str(value.typeName())
+ QTreeWidgetItem.__init__(self, parent, [self.name,
+ self.value.toString(), self.typeName])
+
+
+ def open(self):
+ if self.typeName in ["QObject*", "QWidget*"]:
+ if self.value:
+ obj = mikro.from_variant(self.value)
+ ObjectExplorer.open(obj)
+ elif self.typeName == "QVariantList":
+ l = mikro.from_variant(self.value)
+ ObjectExplorer.open(VariantList(l))
+ else:
+ value, ok = QInputDialog.getText(
+ qApp.activeWindow(), "Change property",
+ self.name)
+ if not ok:
+ return
+ try:
+ value = eval(str(value), __main__.__dict__)
+ except Exception, e:
+ QMessageBox.warning(qApp.activeWindow(), "Error evaluating input", str(e))
+ return
+ obj = mikro.wrap(self.obj, True)
+ setattr(obj, self.name, value)
+ self.treeWidget().refresh(self.obj)
+
+
+
+class PropertyList(QTreeWidget):
+
+
+ def __init__(self, parent):
+ QTreeWidget.__init__(self, parent)
+ self.setColumnCount(3)
+ self.setHeaderLabels(["Name", "Value", "Type"])
+ self.connect(self,
+ SIGNAL("itemDoubleClicked(QTreeWidgetItem*, int)"),
+ self.doubleClicked)
+
+
+
+ def doubleClicked(self, item, col):
+ item.open()
+
+
+ def refresh(self, obj):
+ self.instances = []
+ self.obj = obj
+ names = [str(pn) for pn in self.obj.dynamicPropertyNames()]
+ mo = self.obj.metaObject()
+ for i in xrange(mo.propertyCount()):
+ p = mo.property(i)
+ names.append(p.name())
+ names.sort()
+ self.items = []
+ self.clear()
+ for i, n in enumerate(names):
+ ti = PropertyItem(self, self.obj, n, self.obj.property(n))
+ self.items.append(ti)
+
+
+
+class ObjectItem(QTreeWidgetItem):
+
+ def __init__(self, parent, obj):
+ QTreeWidgetItem.__init__(self, parent,
+ [obj.objectName(), obj.metaObject().className()])
+ self.obj = obj
+ self.setChildIndicatorPolicy(QTreeWidgetItem.ShowIndicator)
+ self.items = []
+
+ def refresh(self):
+ if len(self.items):
+ return
+ for child in self.obj.children():
+ oi = ObjectItem(self, child)
+ self.items.append(oi)
+
+
+
+class ObjectList(QTreeWidget):
+
+
+ def __init__(self, parent):
+ QTreeWidget.__init__(self, parent)
+ self.setRootIsDecorated(True)
+ self.setItemsExpandable(True)
+ self.setColumnCount(2)
+ self.setHeaderLabels(["Name", "Type"])
+ #self.expandToDepth(1)
+ self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self.clicked)
+
+
+ def clicked(self, item, col):
+ item.setExpanded(not item.isExpanded())
+ if item.isExpanded():
+ item.refresh()
+
+
+ def refresh(self, obj):
+ self.obj = obj
+ self.item = ObjectItem(self, self.obj)
+
+
+
+class ObjectTab(QTabWidget):
+
+
+ def __init__(self, parent):
+ QTabWidget.__init__(self, parent)
+ self.propertylist = PropertyList(self)
+ self.addTab(self.propertylist, "Properties")
+ self.methodlist = MethodList(self)
+ self.addTab(self.methodlist, "Methods")
+
+
+ def refresh(self, obj):
+ self.obj = obj
+ self.propertylist.refresh(obj)
+ self.methodlist.refresh(obj)
+
+
+
+class ObjectExplorer(QDialog):
+
+ instance = None
+
+
+ def __init__(self, obj=None):
+ QDialog.__init__(self)
+ ObjectExplorer.instance = self
+ self.splitter = QSplitter(self)
+ self.objectlist = ObjectList(self.splitter)
+ self.connect(
+ self.objectlist,
+ SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
+ self.object_clicked)
+ self.objecttab = ObjectTab(self.splitter)
+ self.resize(800, 600)
+ self.vlayout = QVBoxLayout(self)
+ self.setLayout(self.vlayout)
+ self.layout().addWidget(self.splitter)
+ if obj:
+ self.refresh(obj)
+
+
+ @classmethod
+ def open(cls, obj):
+ if cls.instance:
+ cls.instance.refresh(obj)
+ else:
+ cls.instance = cls(obj)
+ return cls.instance
+
+
+ def refresh(self, obj):
+ self.obj = mikro.unwrap(obj)
+ self.setWindowTitle("%s: %s - Object Explorer" % (
+ str(self.obj.objectName()) or "(unnamed)",
+ self.obj.metaObject().className(),
+ ))
+ self.objectlist.refresh(self.obj)
+ self.objecttab.refresh(self.obj)
+
+
+ def object_clicked(self, item, col):
+ self.objecttab.refresh(item.obj)
+
+
+
+
+def run():
+ oe = ObjectExplorer.open(Scripter)
+ oe.show()
+ while oe.isVisible():
+ qApp.processEvents()
+
+
+
+if __name__ == "__main__":
+ import sys
+ app = QApplication(sys.argv)
+ oe = ObjectExplorer()
+ oe.refresh(oe)
+ oe.exec_()
Index: Scribus/scribus/plugins/scripter/python/examples/test.sqts
===================================================================
--- Scribus/scribus/plugins/scripter/python/examples/test.sqts (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/examples/test.sqts (revision 14647)
@@ -0,0 +1,13 @@
+/// name = test
+/// title = Test Scribus scripting with QtScript
+/// subroutine = test
+
+test = function() {
+ alert("Hello, world!"); // show message in information box
+ division_null = 1/0 ; // handled by excepthook
+}
+
+// The following should create a WindowAPI object which is deleted on exit
+win = Scripter.activeWindow;
+Application.aboutQt();
+Scripter.aboutScripter();
Index: Scribus/scribus/plugins/scripter/python/examples/test.spy
===================================================================
--- Scribus/scribus/plugins/scripter/python/examples/test.spy (nonexistent)
+++ Scribus/scribus/plugins/scripter/python/examples/test.spy (revision 14647)
@@ -0,0 +1,11 @@
+## name = test
+## title = Test Scribus scripting
+## description = This script will try out some features of ScripterNG
+## subroutine = test
+
+import os # trigger security warning
+
+def test():
+ print "Hello, world!" # output text on console
+ 1/0 # handled by excepthook
+
Index: Scribus/scribus/plugins/scripter/scripter.h
===================================================================
--- Scribus/scribus/plugins/scripter/scripter.h (nonexistent)
+++ Scribus/scribus/plugins/scripter/scripter.h (revision 14647)
@@ -0,0 +1,38 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef SCRIPTER_H
+#define SCRIPTER_H
+
+#include "pluginapi.h"
+#include "scplugin.h"
+#include <scripterimpl.h>
+
+
+class PLUGIN_API Scripter : public ScPersistentPlugin
+{
+ Q_OBJECT
+
+public:
+ Scripter();
+ virtual ~Scripter();
+ virtual bool initPlugin();
+ virtual bool cleanupPlugin();
+ virtual const QString fullTrName() const;
+ virtual const AboutData* getAboutData() const;
+ virtual void deleteAboutData(const AboutData* about) const;
+ virtual void languageChange();
+ virtual void addToMainWindowMenu(ScribusMainWindow *);
+
+private:
+ ScripterImpl *scripterImpl;
+};
+
+extern "C" PLUGIN_API int scripter_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* scripter_getPlugin();
+extern "C" PLUGIN_API void scripter_freePlugin(ScPlugin* plugin);
+
+#endif
Index: Scribus/scribus/plugins/scripter/api_window.h
===================================================================
--- Scribus/scribus/plugins/scripter/api_window.h (nonexistent)
+++ Scribus/scribus/plugins/scripter/api_window.h (revision 14647)
@@ -0,0 +1,40 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef API_WINDOW_H_
+#define API_WINDOW_H_
+
+#include <QObject>
+#include <QtDebug>
+#include <QApplication>
+
+#include "scripterimpl.h"
+
+class WindowAPI : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(double zoom READ zoom WRITE setZoom);
+ Q_PROPERTY(bool redraw READ redraw WRITE setRedraw);
+
+public:
+ WindowAPI();
+ virtual ~WindowAPI();
+
+public slots:
+ // XXX: relative or absolute scrolling?
+ void scroll(int x, int y);
+ // XXX: better name?
+ void update();
+
+private:
+ void setRedraw(bool flag);
+ bool redraw();
+ // TODO: add zoomInto
+ void setZoom(double factor);
+ double zoom();
+};
+
+#endif /*API_WINDOW_H_*/
Index: Scribus/scribus/plugins/scripter/api_page.cpp
===================================================================
--- Scribus/scribus/plugins/scripter/api_page.cpp (nonexistent)
+++ Scribus/scribus/plugins/scripter/api_page.cpp (revision 14647)
@@ -0,0 +1,372 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#include "api_page.h"
+#include "pageitem.h"
+#include "selection.h"
+#include "util_math.h"
+#include "commonstrings.h"
+#include "../formatidlist.h"
+#include "loadsaveplugin.h"
+#include "ui/propertiespalette.h"
+
+
+
+PageAPI::PageAPI(QObject *parent) : QObject(COLLECTOR)
+{
+ qDebug() << "PageAPI loaded";
+ setObjectName("activePage");
+}
+
+
+
+PageAPI::~PageAPI()
+{
+ qDebug() << "PageAPI deleted";
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.remove()
+ *
+ * Removes the active page from the active document.
+ */
+void PageAPI::remove()
+{
+ if ( ScCore->primaryMainWindow()->doc->Pages->count() > 1 )
+ ScCore->primaryMainWindow()->DeletePage2(number());
+ else
+ RAISE("No pages left to remove");
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.position
+ * Property
+ * location of active page as int value (read-only)
+ */
+int PageAPI::position()
+{
+ return ScCore->primaryMainWindow()->doc->locationOfPage(number());
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.position
+ * Property
+ * int value of active page number >= 1
+ */
+int PageAPI::number()
+{
+ return ScCore->primaryMainWindow()->doc->currentPageNumber() + 1;
+}
+
+
+
+void PageAPI::setNumber(int value)
+{
+ value--;
+ if ((value < 0) || (value > static_cast<int>(ScCore->primaryMainWindow()->doc->Pages->count())-1))
+ {
+ RAISE("Page number out of range.");
+ return;
+ }
+ ScCore->primaryMainWindow()->view->GotoPage(value);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.items
+ * Property
+ * List of Item objects of active page
+ */
+QList<QVariant> PageAPI::items()
+{
+ QList<QVariant> l;
+ int num = number() - 1;
+ for (int i = 0; i<ScCore->primaryMainWindow()->doc->Items->count(); ++i)
+ {
+ if (num == ScCore->primaryMainWindow()->doc->Items->at(i)->OwnPage)
+ {
+ /*
+ new ItemAPI(this,
+ ScCore->primaryMainWindow()->doc->Items->at(i)->itemName(),
+ ScCore->primaryMainWindow()->doc->Items->at(i)->itemType(),
+ ScCore->primaryMainWindow()->doc->Items->at(i)->ItemNr
+ );
+ */
+ l.append(qVariantFromValue(
+ (QObject *)(ScCore->primaryMainWindow()->doc->Items->at(i))
+ ));
+
+ }
+ }
+ return l;
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.selection
+ * Property
+ * List of selected Item objects on active page of active document
+ */
+QList<QVariant> PageAPI::selection()
+{
+ QList<QVariant> l;
+ int num = number() - 1;
+ Selection *sel = ScCore->primaryMainWindow()->doc->m_Selection;
+ for (int i=0; i < sel->count(); i++)
+ {
+ PageItem *item = sel->itemAt(i);
+ if (num == item->OwnPage)
+ l.append(qVariantFromValue((QObject *)item));
+ }
+ return l;
+}
+
+
+// copied from scripter/cmdutil.cpp
+/// Convert an X co-ordinate part in page units to a document co-ordinate
+/// in system units.
+double pageXtoDocX(double x)
+{
+ return x + ScCore->primaryMainWindow()->doc->currentPage()->xOffset();
+}
+
+
+// copied from scripter/cmdutil.cpp
+/// Convert a Y co-ordinate part in page units to a document co-ordinate
+/// in system units. The document co-ordinates have their origin somewere
+/// up and left of the first page, where page co-ordinates have their
+/// origin on the top left of the current page.
+double pageYtoDocY(double y)
+{
+ return y + ScCore->primaryMainWindow()->doc->currentPage()->yOffset();
+}
+
+
+
+QObject *PageAPI::newItem(const PageItem::ItemType itemType,
+ const PageItem::ItemFrameType frameType,
+ const double x, const double y, const double width,
+ const double height, const double w,
+ const QString& fill, const QString& outline)
+{
+ int i = ScCore->primaryMainWindow()->doc->itemAdd(
+ itemType, frameType,
+ pageXtoDocX(x), pageYtoDocY(y),
+ width, height,
+ w, fill, outline, true);
+ return ScCore->primaryMainWindow()->doc->Items->at(i);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.newRectangle(x, y, width, height)
+ * x is a double
+ * y is a double
+ * width is a double
+ * height is a double
+ * returns Item object
+ */
+QObject *PageAPI::newRectangle(double x, double y, double width, double height)
+{
+ return newItem(
+ PageItem::Polygon, PageItem::Rectangle, x, y, width, height,
+ // @xxx: ale
+ // ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dBrush,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dPen
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineWidth,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeFillColor,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineColor);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.newEllipse(x, y, width, height)
+ * x is a double
+ * y is a double
+ * width is a double
+ * height is a double
+ * returns Item object
+ */
+QObject *PageAPI::newEllipse(double x, double y, double width, double height)
+{
+ return newItem(
+ PageItem::Polygon, PageItem::Ellipse, x, y, width, height,
+ // @xxx: ale
+ // ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dBrush,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dPen);
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineWidth,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeFillColor,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineColor);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.newImage(x, y, width, height)
+ * x is a double
+ * y is a double
+ * width is a double
+ * height is a double
+ * returns Item object
+ */
+QObject *PageAPI::newImage(double x, double y, double width, double height)
+{
+ return newItem(
+ PageItem::ImageFrame, PageItem::Unspecified, x, y, width, height,
+ 1,
+ // @xxx: ale
+ // ScCore->primaryMainWindow()->doc->toolSettings.dBrushPict,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.imageFillColor,
+ CommonStrings::None);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.newText(x, y, width, height)
+ * x is a double
+ * y is a double
+ * width is a double
+ * height is a double
+ * returns Item object
+ */
+QObject *PageAPI::newText(double x, double y, double width, double height)
+{
+ return newItem(
+ PageItem::TextFrame, PageItem::Unspecified, x, y, width, height,
+ // @xxx: ale
+ // ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineWidth,
+ CommonStrings::None,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dPenText);
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.textFont);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.newLine(x, y, width, height)
+ * x is a double
+ * y is a double
+ * width is a double
+ * height is a double
+ * returns Item object
+ */
+QObject *PageAPI::newLine(double x, double y, double width, double height)
+{
+ PageItem *item = (PageItem*)newItem(
+ PageItem::Line, PageItem::Unspecified, x, y, width, height,
+ // @xxx: ale
+ // ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dBrush,
+ // ScCore->primaryMainWindow()->doc->toolSettings.dPen);
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineWidth,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeFillColor,
+ ScCore->primaryMainWindow()->doc->itemToolPrefs.shapeLineColor);
+ item->setRotation(xy2Deg(width-x, height-y));
+ item->setWidthHeight(sqrt(pow(x-width, 2.0) + pow(y-height, 2.0)), 1.0);
+ item->Sizing = false;
+ item->updateClip();
+ return item;
+}
+
+// XXX: newPolyLine, bezierline
+
+
+void PageAPI::placeImage(const int formatid, const QString & filename, const double x, const double y)
+{
+ const FileFormat * fmt = LoadSavePlugin::getFormatById(formatid);
+ if ( fmt )
+ {
+ fmt->loadFile(filename,
+ LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+ if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
+ {
+ double x2, y2, w, h;
+ ScCore->primaryMainWindow()->doc->m_Selection->getGroupRect(
+ &x2, &y2, &w, &h);
+ ScCore->primaryMainWindow()->view->startGroupTransaction();
+ ScCore->primaryMainWindow()->doc->moveGroup(
+ pageXtoDocX(x) - x2, pageYtoDocY(y) - y2);
+ ScCore->primaryMainWindow()->view->endGroupTransaction();
+ ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
+ ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
+ ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
+ ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(
+ ScCore->primaryMainWindow()->doc);
+ }
+ } else RAISE("Format plug-in not loaded.");
+}
+
+
+// XXX: join place* into one function and set formatid according to extension
+
+
+/**
+ * Scripter.activeDocument.activePage.placeSVG(filename x, y)
+ * filename is string
+ * x is double
+ * y is double
+ * import vector graphics at given position on active page
+ */
+void PageAPI::placeSVG(const QString & filename, const double x, const double y)
+{
+ placeImage(FORMATID_SVGIMPORT, filename, x, y);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.placeODG(filename x, y)
+ * filename is string
+ * x is double
+ * y is double
+ * import vector graphics at given position on active page
+ */
+void PageAPI::placeODG(const QString & filename, const double x, const double y)
+{
+ placeImage(FORMATID_ODGIMPORT, filename, x, y);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.placeEPS(filename x, y)
+ * filename is string
+ * x is double
+ * y is double
+ * import vector graphics at given position on active page
+ */
+void PageAPI::placeEPS(const QString & filename, const double x, const double y)
+{
+ placeImage(FORMATID_PSIMPORT, filename, x, y);
+}
+
+
+
+/**
+ * Scripter.activeDocument.activePage.placeSXD(filename x, y)
+ * filename is string
+ * x is double
+ * y is double
+ * import vector graphics at given position on active page
+ */
+void PageAPI::placeSXD(const QString & filename, const double x, const double y)
+{
+ placeImage(FORMATID_SXDIMPORT, filename, x, y);
+}
Index: Scribus/scribus/plugins/scripter/api_prefs.cpp
===================================================================
--- Scribus/scribus/plugins/scripter/api_prefs.cpp (nonexistent)
+++ Scribus/scribus/plugins/scripter/api_prefs.cpp (revision 14647)
@@ -0,0 +1,151 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#include "api_prefs.h"
+
+#include "prefsfile.h"
+#include "prefscontext.h"
+#include "prefstable.h"
+#include "prefsmanager.h"
+#include "scripterimpl.h"
+
+PreferencesAPI::PreferencesAPI() : QObject(SCRIPTER)
+{
+ setObjectName("preferences");
+ qDebug() << "PreferencesAPI loaded";
+}
+
+
+
+PreferencesAPI::~PreferencesAPI()
+{
+ qDebug() << "PreferencesAPI deleted";
+}
+
+
+
+/*
+ * XXX: getContext, getUserPrefsContex, raise if hasContext = false
+ */
+PrefsContext *PreferencesAPI::prefs(const QString & context)
+{
+ return PrefsManager::instance()->prefsFile->getPluginContext(context);
+}
+
+
+
+/**
+ * Scripter.preferences.contains(context, key)
+ * context is a string of a plug-in context, e.g. "scripter"
+ * key is a string
+ *
+ * Use this to check if a preference is currently set.
+ */
+bool PreferencesAPI::contains(const QString & context, const QString & key)
+{
+ return prefs(context)->contains(key);
+}
+
+
+
+/**
+ * Scripter.preferences.getString(context, key)
+ * context is a string
+ * key is a string
+ * returns value of key as string or "" if key not found
+ */
+QString PreferencesAPI::getString(const QString & context, const QString & key)
+{
+ return prefs(context)->get(key);
+}
+
+
+
+/**
+ * Scripter.preferences.setString(context, key, value)
+ * context is string
+ * key is string
+ * value is string
+ */
+void PreferencesAPI::setString(const QString & context, const QString & key, const QString & value) {
+ prefs(context)->set(key, value);
+}
+
+
+
+/**
+ * Scripter.preferences.getInt(context, key)
+ * context is string
+ * key is string
+ * returns value of key as int or -1 if key not found
+ */
+int PreferencesAPI::getInt(const QString & context, const QString & key) {
+ return prefs(context)->getInt(key);
+}
+
+
+
+/**
+ * Scripter.preferences.setInt(context, key, value)
+ * context is string
+ * key is string
+ * value is int
+ */
+void PreferencesAPI::setInt(const QString & context, const QString & key, int value) {
+ prefs(context)->set(key, value);
+}
+
+
+
+/**
+ * Scripter.preferences.getDouble(context, key)
+ * context is string
+ * key is string
+ * returns value of key as double of -1 if key not found
+ */
+double PreferencesAPI::getDouble(const QString & context, const QString & key) {
+ return prefs(context)->getDouble(key);
+}
+
+
+
+/**
+ * Scripter.preferences.setDouble(context, key, value)
+ * context is string
+ * key is string
+ * value is double
+ */
+void PreferencesAPI::setDouble(const QString & context, const QString & key, double value) {
+ prefs(context)->set(key, value);
+}
+
+
+
+/**
+ * Scripter.preferences.getBool(context, key)
+ * context is string
+ * key is string
+ * returns value of key as bool or False if key not found
+ *
+ * Use ->Scripter.preferences.contains(context, key) if you
+ * don't know if the key exists.
+ */
+bool PreferencesAPI::getBool(const QString & context, const QString & key) {
+ return prefs(context)->getBool(key);
+}
+
+
+
+/**
+ * Scripter.preferences.setBool(context, key, value)
+ * context ist string
+ * key is string
+ * value is bool
+ */
+void PreferencesAPI::setBool(const QString & context, const QString & key, bool value) {
+ prefs(context)->set(key, value);
+}
+
Index: Scribus/scribus/plugins/scripter/api_Scripter.activeDocument.activePage.items.api
===================================================================
--- Scribus/scribus/plugins/scripter/api_Scripter.activeDocument.activePage.items.api (nonexistent)
+++ Scribus/scribus/plugins/scripter/api_Scripter.activeDocument.activePage.items.api (revision 14647)
@@ -0,0 +1,445 @@
+/**
+* Scripter.activeDocument.activePage.items[i].objectName
+* Property
+* type is QString
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].itemName
+* Property
+* type is QString
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].fillColor
+* Property
+* type is QString
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineColor
+* Property
+* type is QString
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].fillShade
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineShade
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].fillTransparency
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineTransparency
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].m_Locked
+* Property
+* type is bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].m_SizeLocked
+* Property
+* type is bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].m_ImageIsFlippedV
+* Property
+* type is bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].m_ImageIsFlippedH
+* Property
+* type is bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineWidth
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].customLineStyle
+* Property
+* type is QString
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].startArrowIndex
+* Property
+* type is int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].endArrowIndex
+* Property
+* type is int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].m_PrintEnabled
+* Property
+* type is bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].xPos
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].yPos
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].width
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].height
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].rotation
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].imageXScale
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].imageYScale
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].imageXOffset
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].imageYOffset
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].reversed
+* Property
+* type is bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].cornerRadius
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textToFrameDistLeft
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textToFrameDistRight
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textToFrameDistTop
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textToFrameDistBottom
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].ColGap
+* Property
+* type is double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].Cols
+* Property
+* type is int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].firstLineOffset
+* Property
+* type is FirstLineOffsetPolicy
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].itemType
+* Property
+* type is ItemType
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].destroyed(arg1)
+* arg1 is a QObject*
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].destroyed()
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].deleteLater()
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i]._q_reregisterTimers(arg1)
+* arg1 is a void*
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].myself(arg1)
+* arg1 is a PageItem*
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].frameType(arg1)
+* arg1 is a int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].position(arg1, arg2)
+* arg1 is a double
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].widthAndHeight(arg1, arg2)
+* arg1 is a double
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].rotation(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].colors(arg1, arg2, arg3, arg4)
+* arg1 is a QString
+* arg2 is a QString
+* arg3 is a double
+* arg4 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].gradientType(arg1)
+* arg1 is a int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].patternFill(arg1, arg2, arg3, arg4, arg5, arg6)
+* arg1 is a QString
+* arg2 is a double
+* arg3 is a double
+* arg4 is a double
+* arg5 is a double
+* arg6 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].gradientColorUpdate(arg1, arg2, arg3, arg4, arg5, arg6)
+* arg1 is a double
+* arg2 is a double
+* arg3 is a double
+* arg4 is a double
+* arg5 is a double
+* arg6 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].transparency(arg1, arg2)
+* arg1 is a double
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].blendmode(arg1, arg2)
+* arg1 is a int
+* arg2 is a int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].frameLocked(arg1)
+* arg1 is a bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].frameSizeLocked(arg1)
+* arg1 is a bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].frameFlippedH(arg1)
+* arg1 is a bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].frameFlippedV(arg1)
+* arg1 is a bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].printEnabled(arg1)
+* arg1 is a bool
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].columns(arg1, arg2)
+* arg1 is a int
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].cornerRadius(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineWidth(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineStyleCapJoin(arg1, arg2, arg3)
+* arg1 is a Qt::PenStyle
+* arg2 is a Qt::PenCapStyle
+* arg3 is a Qt::PenJoinStyle
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].lineSpacing(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textKerning(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textStyle(arg1)
+* arg1 is a int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textFont(arg1)
+* arg1 is a QString
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textSize(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textWidthScale(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textHeightScale(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textBaseLineOffset(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textOutline(arg1)
+* arg1 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textShadow(arg1, arg2)
+* arg1 is a double
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textUnderline(arg1, arg2)
+* arg1 is a double
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textStrike(arg1, arg2)
+* arg1 is a double
+* arg2 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textColor(arg1, arg2, arg3, arg4)
+* arg1 is a QString
+* arg2 is a QString
+* arg3 is a double
+* arg4 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textFormatting(arg1)
+* arg1 is a int
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].textToFrameDistances(arg1, arg2, arg3, arg4)
+* arg1 is a double
+* arg2 is a double
+* arg3 is a double
+* arg4 is a double
+*/
+
+/**
+* Scripter.activeDocument.activePage.items[i].imageOffsetScale(arg1, arg2, arg3, arg4)
+* arg1 is a double
+* arg2 is a double
+* arg3 is a double
+* arg4 is a double
+*/
Index: Scribus/scribus/plugins/scripter/api_dialogs.cpp
===================================================================
--- Scribus/scribus/plugins/scripter/api_dialogs.cpp (nonexistent)
+++ Scribus/scribus/plugins/scripter/api_dialogs.cpp (revision 14647)
@@ -0,0 +1,38 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#include "api_dialogs.h"
+
+DialogsAPI::DialogsAPI() : QObject(SCRIPTER)
+{
+ qDebug() << "DialogsAPI loaded";
+ setObjectName("dialogs");
+}
+
+
+
+DialogsAPI::~DialogsAPI()
+{
+ qDebug() << "DialogsAPI deleted";
+}
+
+
+
+/**
+ * Scripter.dialogs.alert(message)
+ * message is a string
+ *
+ * inspired by alert in Javascript
+ */
+void DialogsAPI::alert(const QString & message)
+{
+ QMessageBox::information(
+ 0, //(QWidget*)doc->scMW(),
+ tr("Alert - Scribus"),
+ message,
+ QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+ QMessageBox::NoButton);
+}
Index: Scribus/scribus/plugins/scripter/api_document.h
===================================================================
--- Scribus/scribus/plugins/scripter/api_document.h (nonexistent)
+++ Scribus/scribus/plugins/scripter/api_document.h (revision 14647)
@@ -0,0 +1,104 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef API_DOCUMENT_H_
+#define API_DOCUMENT_H_
+
+#include <QObject>
+#include <QtDebug>
+#include <QApplication>
+
+#include "scripterimpl.h"
+
+
+
+class DocumentAPI : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool available READ available);
+ Q_PROPERTY(QObject* margins READ margins);
+ Q_PROPERTY(bool modified READ modified WRITE setModified);
+ Q_PROPERTY(QObject* activePage READ activePage);
+ Q_PROPERTY(int pageCount READ pageCount);
+ Q_PROPERTY(QObject* activeItem READ activeItem);
+ Q_PROPERTY(QObject* dimensions READ dimensions);
+ Q_PROPERTY(QList<QVariant> items READ items);
+ Q_PROPERTY(QList<QVariant> selection READ selection);
+public:
+ DocumentAPI();
+ virtual ~DocumentAPI();
+
+public slots:
+ bool check();
+ bool close();
+ QList<QVariant> items();
+
+private:
+ QObject *margins();
+ bool available();
+ bool modified();
+ void setModified(bool flag);
+ QObject *activePage();
+ int pageCount();
+ QList<QVariant> selection();
+ QObject *activeItem();
+ QObject *dimensions();
+};
+
+
+class Margins : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(double top READ top WRITE setTop);
+ Q_PROPERTY(double left READ left WRITE setLeft);
+ Q_PROPERTY(double right READ right WRITE setRight);
+ Q_PROPERTY(double bottom READ bottom WRITE setBottom);
+
+public:
+ Margins(QObject *parent);
+ virtual ~Margins()
+ {
+ qDebug() << "Margins deleted";
+ };
+
+public slots:
+ void set(double lr, double tpr, double btr, double rr);
+
+private:
+ double top();
+ void setTop(double value);
+ double left();
+ void setLeft(double value);
+ double right();
+ void setRight(double value);
+ double bottom();
+ void setBottom(double value);
+
+};
+
+
+
+class Dimensions : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(double width READ width);
+ Q_PROPERTY(double height READ height);
+
+public:
+ Dimensions(QObject *parent);
+ virtual ~Dimensions()
+ {
+ qDebug() << "Dimensions deleted";
+ };
+
+private:
+ double width();
+ double height();
+ QList<QVariant> items;
+};
+
+
+#endif /*API_DOCUMENT_H_*/
Index: Scribus/scribus/plugins/scripter/scripterimpl.h
===================================================================
--- Scribus/scribus/plugins/scripter/scripterimpl.h (nonexistent)
+++ Scribus/scribus/plugins/scripter/scripterimpl.h (revision 14647)
@@ -0,0 +1,83 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef SCRIPTERIMPL_H
+#define SCRIPTERIMPL_H
+
+#include <QObject>
+#include <QtDebug>
+
+#include "pythonize.h"
+#include "scribus.h"
+#include "scribusdoc.h"
+#include "scribuscore.h"
+#include "scpaths.h"
+#include "api_prefs.h"
+#include "api_item.h"
+#include "api_page.h"
+#include "api_dialogs.h"
+#include "api_window.h"
+#include "api_document.h"
+
+// XXX make this INTO method inside a new util.cpp
+#define RAISE(msg) QApplication::instance()->setProperty("MIKRO_EXCEPTION", QVariant(msg))
+#define COLLECTOR ScripterImpl::instance()->collector()
+#define SCRIPTER ScripterImpl::instance()
+
+class QString;
+class ScribusDoc;
+
+//Q_DECLARE_METATYPE(QList<QVariant*>)
+
+class ScripterImpl : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QObject* collector READ collector);
+ Q_PROPERTY(QObject* activeDocument READ activeDocument);
+ Q_PROPERTY(QObject* activeWindow READ activeWindow);
+
+public:
+ ScripterImpl();
+ ~ScripterImpl();
+ static ScripterImpl *instance();
+ bool init();
+ bool cleanup();
+ void addToMainWindowMenu(ScribusMainWindow *mainwin);
+ QObject *collector() {
+ return collected;
+ };
+
+public slots:
+ void aboutScripter();
+ QObject *openDocument(const QString & filename);
+ QObject *newDocument(
+ double topMargin, double bottomMargin,
+ double leftMargin, double rightMargin,
+ double pageWidth, double pageHeight,
+ int orientation, int firstPageNr, int unit, int pagesType,
+ int facingPages, int firstPageOrder, int numPages);
+ QObject *fromVariant(const QVariant& v);
+ bool test();
+
+signals:
+ void createMenu(QMainWindow *mainwin);
+
+private:
+ /*
+ collected is used for dumb garbage collection.
+ Use it as a parent to make sure that your object gets deleted
+ inside the scripting environment if it is not needed anymore.
+ */
+ QObject *collected;
+ Pythonize *python;
+ static ScripterImpl *_instance;
+ QString path;
+ bool runScript(const QString & filename);
+ QObject *activeDocument();
+ QObject *activeWindow();
+};
+
+#endif
Index: Scribus/scribus/plugins/scripter/doc/research.html
===================================================================
--- Scribus/scribus/plugins/scripter/doc/research.html (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/research.html (revision 14647)
@@ -0,0 +1,794 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html class="pageview">
+
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<style type="text/css">
+
+
+/* default css */
+
+table {
+ font-size: 1em;
+ line-height: inherit;
+}
+
+
+tr {
+
+ text-align: left;
+
+}
+
+
+div, address, ol, ul, li, option, select {
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+
+p {
+ margin: 0px;
+}
+
+body {
+ margin: 6px;
+ padding: 0px;
+ font-family: Verdana, sans-serif;
+ font-size: 10pt;
+ background-color: #ffffff;
+}
+
+
+img {
+ -moz-force-broken-image-icon: 1;
+}
+
+@media screen {
+ html.pageview {
+ background-color: #f3f3f3 !important;
+ }
+
+
+
+ body {
+ min-height: 1100px;
+ }
+ * html body {
+ height: 1100px;
+ }
+ .pageview body {
+ border-top: 1px solid #ccc;
+ border-left: 1px solid #ccc;
+ border-right: 2px solid #bbb;
+ border-bottom: 2px solid #bbb;
+ width: 648px !important;
+ margin: 15px auto 25px;
+ padding: 40px 50px;
+ }
+ /* IE6 */
+ * html.pageview body {
+ overflow-x: auto;
+ }
+ /* Prevent repaint errors when scrolling in Safari. This "Star-7" css hack
+ targets Safari 3.1, but not WebKit nightlies and presumably Safari 4.
+ That's OK because this bug is fixed in WebKit nightlies/Safari 4 :-). */
+ html*#wys_frame::before {
+ content: '\A0';
+ position: fixed;
+ overflow: hidden;
+ width: 0;
+ height: 0;
+ top: 0;
+ left: 0;
+ }
+
+
+
+
+
+}
+
+h6 { font-size: 10pt }
+h5 { font-size: 11pt }
+h4 { font-size: 12pt }
+h3 { font-size: 13pt }
+h2 { font-size: 14pt }
+h1 { font-size: 16pt }
+
+blockquote {padding: 10px; border: 1px #DDD dashed }
+
+a img {border: 0}
+
+.pb {height: 1px}
+
+div.google_header, div.google_footer {
+ position: relative;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+
+/* Table of contents */
+.editor div.writely-toc {
+ background-color: #f3f3f3;
+ border: 1px solid #ccc;
+}
+.writely-toc > ol {
+ padding-left: 3em;
+ font-weight: bold;
+}
+ol.writely-toc-subheading {
+ padding-left: 1em;
+ font-weight: normal;
+}
+/* IE6 only */
+* html writely-toc ol {
+ list-style-position: inside;
+}
+.writely-toc-none {
+ list-style-type: none;
+}
+.writely-toc-decimal {
+ list-style-type: decimal;
+}
+.writely-toc-upper-alpha {
+ list-style-type: upper-alpha;
+}
+.writely-toc-lower-alpha {
+ list-style-type: lower-alpha;
+}
+.writely-toc-upper-roman {
+ list-style-type: upper-roman;
+}
+.writely-toc-lower-roman {
+ list-style-type: lower-roman;
+}
+.writely-toc-disc {
+ list-style-type: disc;
+}
+
+/* end default css */
+
+
+ /* default print css */
+
+ @media print {
+ body {
+ padding: 0;
+ margin: 0;
+ }
+
+ div.google_header, div.google_footer {
+ display: block;
+ min-height: 0;
+ border: none;
+ }
+
+ div.google_header {
+ flow: static(header);
+ }
+
+ /* used to insert page numbers */
+ div.google_header::before, div.google_footer::before {
+ position: absolute;
+ top: 0;
+ }
+
+ div.google_footer {
+ flow: static(footer);
+ }
+
+ /* always consider this element at the start of the doc */
+ div#google_footer {
+ flow: static(footer, start);
+ }
+
+ span.google_pagenumber {
+ content: counter(page);
+ }
+
+ span.google_pagecount {
+ content: counter(pages);
+ }
+
+ /* Table of contents */
+ #WritelyTableOfContents a::after {
+ content: leader('.') target-counter(attr(href), page);
+ }
+
+ #WritelyTableOfContents a {
+ text-decoration: none;
+ color: black;
+ }
+ }
+
+ @page {
+ @top {
+ content: flow(header);
+ }
+ @bottom {
+ content: flow(footer);
+ }
+ }
+ /* end default print css */
+
+
+/* custom css */
+
+
+/* end custom css */
+
+
+
+ /* ui edited css */
+
+ body {
+ font-family: Verdana;
+
+ font-size: 10.0pt;
+ line-height: normal;
+ background-color: #ffffff;
+ }
+ /* end ui edited css */
+
+
+
+/* editor CSS */
+.editor a:visited {color: #551A8B}
+.editor table.zeroBorder {border: 1px dotted gray}
+.editor table.zeroBorder td {border: 1px dotted gray}
+.editor table.zeroBorder th {border: 1px dotted gray}
+
+
+.editor div.google_header, .editor div.google_footer {
+ border: 2px #DDDDDD dashed;
+ position: static;
+ width: 100%;
+ min-height: 2em;
+}
+
+.editor .misspell {background-color: yellow}
+
+
+.editor .pb {
+ border-top: 1px dashed #C0C0C0;
+ border-bottom: 1px dashed #C0C0C0
+}
+.editor .writely-comment {
+ font-size: 9pt;
+ line-height: 1.4;
+ padding: 1px;
+ border: 1px dashed #C0C0C0
+}
+
+
+/* end editor CSS */
+</style>
+
+
+<base target="_top">
+
+</head>
+
+<body
+
+ revision="ddggcjfj_16ccjdxrcp:5">
+
+
+
+<p align=center class=western id=bl2.4 style=MARGIN-BOTTOM:0pt>
+ <font face="Verdana, sans-serif" id=bl2.5><font id=bl2.6 size=4 style=FONT-SIZE:16pt>Some
+ Research for ScripterNG</font></font>
+</p>
+<p class=western id=bl2.7 style=MARGIN-BOTTOM:0pt>
+ <br id=bl2.8>
+</p>
+<h2 class=western id=bl2.9>
+ Evaluation of current Scripter
+</h2>
+<h3 class=western id=bl2.10>
+ Written by hand
+</h3>
+<p class=western id=bl2.11>
+ This makes maintenance and extension hard if one does not know what
+ PyArg_ParseTuple&amp;friends mean. Besides this approach is very error-prone.
+</p>
+<h3 class=western id=bl2.12>
+ Imperative API – mostly
+</h3>
+<p class=western id=bl2.13>
+ The plug-in exposes mainly functions to Python. Normally it would make sense
+ that each object on the Scribus canvas is represented by a Python object.
+ Instead the API works with (unique) names as handles which have to be passed
+ as arguments to functions to access and manipulate particular canvas objects.
+ There are also inconsequences, e.g there is an object for PDF export which
+ indeed should better be a function with keyword arguments.
+</p>
+<p class=western id=bl2.14>
+ On the other hand there are good reasons for a simple imperative API. This
+ enables even beginners quick success without having to learn about
+ object-oriented programming. Therefore a new API should not use objects
+ exessively. The use of advanced techniques like factory classes should be
+ avoided.
+</p>
+<h3 class=western id=bl2.15>
+ Stateless API
+</h3>
+<p class=western id=bl2.16>
+ If a script is called, it first has to investigate the current state, if it
+ can run and how. This work should not be needed. Imagine there is a sane
+ script which resizes a selected text box and appends “lorem ipsum..”. It has
+ to do the following
+</p>
+<ul id=bl2.17>
+ <li id=bl2.18>
+ <p class=western id=bl2.19 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.20 size=2 style=FONT-SIZE:9pt>look if a document is open,
+ else exit with a meaningful message</font>
+ </p>
+ </li>
+ <li id=bl2.21>
+ <p class=western id=bl2.22 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.23 size=2 style=FONT-SIZE:9pt>look if a object is selected
+ and if it is a text object, else exit with a meaningful message</font>
+ </p>
+ </li>
+ <li id=bl2.24>
+ <p class=western id=bl2.25 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.26 size=2 style=FONT-SIZE:9pt>save current measurement
+ unit</font>
+ </p>
+ </li>
+ <li id=bl2.27>
+ <p class=western id=bl2.28 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.29 size=2 style=FONT-SIZE:9pt>set own measurement unit</font>
+ </p>
+ </li>
+ <li id=bl2.30>
+ <p class=western id=bl2.31 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.32 size=2 style=FONT-SIZE:9pt>resize text box</font>
+ </p>
+ </li>
+ <li id=bl2.33>
+ <p class=western id=bl2.34 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.35 size=2 style=FONT-SIZE:9pt>append text</font>
+ </p>
+ </li>
+ <li id=bl2.36>
+ <p class=western id=bl2.37 style=MARGIN-BOTTOM:0pt>
+ <font id=bl2.38 size=2 style=FONT-SIZE:9pt>restore old measurement
+ unit</font>
+ </p>
+ <p class=western id=bl2.39>
+ Wouldn't it be better if a script could specify in its meta-data that it
+ relies on a selected text object? Otherwise the menu entry of the script
+ should be disabled.
+ </p>
+ </li>
+</ul>
+<h3 class=western id=bl2.40>
+ Problems with measurement units
+</h3>
+<p class=western id=bl2.41>
+ As the previous example showed a script always has to lookup and change the
+ measurement units. This makes the code unnecessarily complicated. Besides,
+ understanding the complete script code requires to find the last setUnit-call
+ to know which unit is set. A better approach would be to use one defined
+ internal unit plus some helper functions for conversion.
+</p>
+<h3 class=western id=bl2.42>
+ Integration
+</h3>
+<p class=western id=bl2.43>
+ Currently to call scripts you have to browse them by filename in a standard
+ open-file-dialog. There is no title or description and scripts are not ordered
+ by any category. If you want to repeat a script, you have to find the file
+ again in the open-file-dialog. This makes working with scripts hard and the
+ typical user will probably not know what functionality is available via
+ scripts. A better way would be a script menu similar to the effects menu in
+ Inkscape
+ (<a href=http://www.ekips.org/comp/inkscape/inx/InkexEffects.png id=bl2.44>http://www.ekips.org/comp/inkscape/inx/InkexEffects.png</a>).
+ Scripts also cannot have keyboard shortcuts.
+</p>
+<h3 class=western id=bl2.45>
+ Missing features
+</h3>
+<p class=western id=bl2.46>
+ Not everything that is possible in Scribus is also possible in Scripter. These
+ limitations become noticeable sooner or later while writing scripts. This
+ should be changed little by little.
+</p>
+<h2 class=western id=bl2.47>
+</h2>
+<h2 class=western id=bl2.48 style=page-break-before:always>
+ Missing in current Scripter
+</h2>
+<ul id=bl2.49>
+ <li id=bl2.50>
+ <p class=western id=bl2.51>
+ hooks into menus, toolbars and context menus
+ </p>
+ </li>
+ <li id=bl2.52>
+ <p class=western id=bl2.53>
+ call gettext-importer plug-in
+ </p>
+ </li>
+ <li id=bl2.54>
+ <p class=western id=bl2.55>
+ access and change configuration
+ </p>
+ </li>
+ <li id=bl2.56>
+ <p class=western id=bl2.57>
+ callbacks to events (signals)
+ </p>
+ </li>
+ <li id=bl2.58>
+ <p class=western id=bl2.59>
+ more functions to work with styles and text
+ </p>
+ </li>
+ <li id=bl2.60>
+ <p class=western id=bl2.61>
+ trigger actions
+ </p>
+ </li>
+ <li id=bl2.62>
+ <p class=western id=bl2.63>
+ support for i18n – currently scripts only speak English
+ </p>
+ </li>
+</ul>
+<p class=western id=bl2.64 style=MARGIN-BOTTOM:0pt>
+ <br id=bl2.65>
+</p>
+<h2 class=western id=bl2.66>
+</h2>
+<h2 class=western id=bl2.67>
+ Evaluation of scripting in other applications
+</h2>
+<p class=western id=bl2.68>
+ It is always good to look beyond one's own nose so we can learn from other
+ people's experiences. I selected some of the major applications which all
+ support scripting.
+</p>
+<h3 class=western id=bl2.69>
+ Firefox
+</h3>
+<p class=western id=bl2.70>
+ The core of the web browser including the rendering engine is programmed in
+ C/C++. Nearly everything else is programmed in JavaScript. Support for Python
+ is planned
+ (<a href=http://wiki.mozilla.org/Gecko_1.9_Roadmap#Python_for_XUL id=bl2.71>http://wiki.mozilla.org/Gecko_1.9_Roadmap#Python_for_XUL</a>).
+ The whole user interface can be completely modified with JavaScript and a
+ XML-user interface description language (XUL).
+</p>
+<ul id=bl2.72>
+ <li id=bl2.73>
+ <p class=western id=bl2.74>
+ Screenshots of add-on manager:
+ <a href=http://wiki.mozilla.org/Firefox:Add-ons_Manager_UI_interim_rev2 id=bl2.75>http://wiki.mozilla.org/Firefox:Add-ons_Manager_UI_interim_rev2</a>
+ </p>
+ </li>
+ <li id=bl2.76>
+ <p class=western id=bl2.77>
+ Add-on repository:
+ <a href=http://addons.mozilla.org/ id=bl2.78>http://addons.mozilla.org</a>
+ </p>
+ </li>
+</ul>
+<h3 class=western id=bl2.79>
+ OpenOffice.org
+</h3>
+<p class=western id=bl2.80>
+ OOo can be extended with a VisualBasic-like language, Java and Python. With
+ the upcoming release they plan to improve extension support to a level similar
+ to Firefox. The OOo component model exposes a lot of the functionality to
+ scripts. Unfortunately this is also a problem because the API is q uite
+ complex and you have to spend a lot of time to learn and to understand it
+ completely.
+</p>
+<ul id=bl2.81>
+ <li id=bl2.82>
+ <p class=western id=bl2.83>
+ Screenshot of extension manager:
+ <a href=http://www.teamir8.com/pictures/extmng.jpg id=bl2.84>http://www.teamir8.com/pictures/extmng.jpg</a>
+ </p>
+ </li>
+ <li id=bl2.85>
+ <p class=western id=bl2.86>
+ Extensions-repository:
+ <a href=http://extensions.services.openoffice.org/ id=bl2.87>http://extensions.services.openoffice.org/</a>
+ </p>
+ </li>
+</ul>
+<h3 class=western id=bl2.88>
+ Blender
+</h3>
+<p class=western id=bl2.89>
+ This popular 3D modeler can be extended and automated with Python. It has a
+ nice object-oriented API which reflects the objects you see in Blender.
+</p>
+<ul id=bl2.90>
+ <li id=bl2.91>
+ <p class=western id=bl2.92>
+ Script-Repository:
+ <a href=http://www.blender.org/download/python-scripts/ id=bl2.93>http://www.blender.org/download/python-scripts/</a>
+ </p>
+ </li>
+ <li id=bl2.94>
+ <p class=western id=bl2.95>
+ Python-API:
+ <a href=http://www.blender.org/documentation/244PythonDoc/API_intro-module.html id=bl2.96>http://www.blender.org/documentation/244PythonDoc/API_intro-module.html</a>
+ </p>
+ </li>
+</ul>
+<h3 class=western id=bl2.97>
+ Gimp
+</h3>
+<p class=western id=bl2.98>
+ Plug-ins and scripts in Gimp are external programs. They can be programmed in
+ C, Scheme (Script-Fu, similar to Lisp in Emacs), Python and Perl.
+</p>
+<ul id=bl2.99>
+ <li id=bl2.100>
+ <p class=western id=bl2.101>
+ Scripting manual:
+ <a href=http://docs.gimp.org/en/gimp-scripting.html id=bl2.102>http://docs.gimp.org/en/gimp-scripting.html</a>
+ </p>
+ </li>
+ <li id=bl2.103>
+ <p class=western id=bl2.104>
+ Gimp Plugin Registry:
+ <a href=http://registry.gimp.org/list_content id=bl2.105>http://registry.gimp.org/list_content</a>
+ </p>
+ <p class=western id=bl2.106>
+ </p>
+ </li>
+</ul>
+<h3 class=western id=bl2.107>
+ Inkscape
+</h3>
+<p class=western id=bl2.108>
+ Inkscape can use any language for scripting because it works the Unix-way by
+ using pipes which manipulate the SVG document. But most scripts and extensions
+ seem to use Python, Perl or Bash. For Python there is a helper module called
+ inkex which helps to create extensions. For each script there is a .inx-file
+ in XML-format which describes the extension (dependencies, menu name,
+ category, etc.).
+</p>
+<p class=western id=bl2.109>
+ This approach could also be very interesting for Scribus.
+</p>
+<h3 class=western id=bl2.110>
+ KOffice
+</h3>
+<p class=western id=bl2.111>
+ Krita, KWord, and KSpread contain scripting plug-ins which support Ruby,
+ JavaScript and Python.
+</p>
+<p class=western id=bl2.112>
+ Python scripts can use PyQt to create integral GUI elements like dockwidgets.
+</p>
+<ul id=bl2.113>
+ <li id=bl2.114>
+ <p class=western id=bl2.115>
+ <a href=http://techbase.kde.org/Development/Tutorials/KSpread_Scripting id=bl2.116>http://techbase.kde.org/Development/Tutorials/KSpread_Scripting</a>
+ </p>
+ </li>
+ <li id=bl2.117>
+ <p class=western id=bl2.118>
+ <a href=http://techbase.kde.org/index.php?title=Development/Tutorials/KWord_Scripting id=bl2.119>http://techbase.kde.org/index.php?title=Development/Tutorials/KWord_Scripting</a>
+ </p>
+ </li>
+ <li id=bl2.120>
+ <p class=western id=bl2.121>
+ <a href=http://techbase.kde.org/index.php?title=Development/Tutorials/Krita_Scripting id=bl2.122>http://techbase.kde.org/index.php?title=Development/Tutorials/Krita_Scripting</a>
+ </p>
+ </li>
+</ul>
+<h3 class=western id=bl2.123>
+ Quantum GIS
+</h3>
+<p class=western id=bl2.124>
+ Quantum GIS has a totally different target group, because it is a geographical
+ application. But is interesting for this evaluation because it also uses the
+ Qt framework and strongly incorporates scripting. The QGIS code looks very
+ clean. Hence is is possible to wrap the API nearly automatically. Python
+ plug-ins can be installed from online repositories at runtime with a plug-in
+ installer. Is is also possible to write complete applications in Python which
+ use QGIS as a library.
+</p>
+<p class=western id=bl2.125>
+ In Scribus there come up questions regularly if one can use Scribus as an
+ engine for PDF creation. This would be possible if the Scribus core could be
+ used as a library from Python as well. But unfortunately we are still far away
+ from the realization of this idea.
+</p>
+<p class=western id=bl2.126 style=MARGIN-BOTTOM:0pt>
+ <br id=bl2.127>
+</p>
+<p class=western id=bl2.128 style=MARGIN-BOTTOM:0pt>
+ <br id=bl2.129>
+</p>
+<h2 class=western id=bl2.130>
+ Evaluation of scripting technologies
+</h2>
+<h3 class=western id=bl2.131>
+ Completely written by hand: Python C-API (Scribus)
+</h3>
+<p class=western id=bl2.132>
+ This will probably result in the fastest bindings. But they are not fast to
+ write. The code is very verbose because parameters need to be parsed and
+ converted, references have to be counted and errors have to be handled
+ correctly.
+</p>
+<h3 class=western id=bl2.133>
+ Bindings generators: swig, boost, sip (QGIS)
+</h3>
+<p class=western id=bl2.134>
+ Ideally you only have to copy the header files. Then the program would
+ generate the calls to the Python API. But some data structures or return types
+ are not supported in Python and so you have to write some additional code for
+ these cases. Besides every program has its flaws. Swig is not good for C++,
+ boost is hard to debug and sip has a sparse documentation. But sip is the best
+ tool if you want to use Qt because it handles Qt's special features like
+ signals/slots.
+</p>
+<h3 class=western id=bl2.135>
+ Binding languages: Pyrex/Cython
+</h3>
+<p class=western id=bl2.136>
+ You still have to write bindings but in a more friendly language which looks
+ mostly like Python and contains everything to write bindings. This is a nice
+ idea but I see no real advantage for Scribus.
+</p>
+<h3 class=western id=bl2.137>
+ Dynamic invocation: ctypes, dl-module
+</h3>
+<p class=western id=bl2.138>
+ Unfortunately this only works great with C libraries but not for C++ because
+ there is no common ABI (application binary interface).
+</p>
+<h3 class=western id=bl2.139>
+ Component models: UNO (OpenOffice), XPCOM (Firefox), Corba
+</h3>
+<p class=western id=bl2.140>
+ This is the “enterprise-solution” to the scripting problem. Methods are
+ defined in a IDL (interface description language) and are compiled with a
+ separate idl-compiler. For most projects this is totally overkill, requires a
+ strong software architecture and discipline. Distributed objects across the
+ network might be a cool feature but are normally not needed.
+</p>
+<h3 class=western id=bl2.141>
+ Qt specific: Kross (KOffice), Smoke, PythonQt
+</h3>
+<p class=western id=bl2.142>
+ The Qt meta-object-compiler (moc) generates code with meta-data which make it
+ possible to query and call properties, slots and signals at runtime. With this
+ concept no additional binding-code is needed for a scripting language to work
+ with any Qt object.<br id=bl2.143>
+ <br id=bl2.144>
+ <br id=bl2.145>
+</p>
+<p class=western id=bl2.146 style=MARGIN-BOTTOM:0pt>
+ <br id=bl2.147>
+</p>
+<p class=western id=bl2.148 style=MARGIN-BOTTOM:0pt>
+ <br id=bl2.149>
+</p>
+<h2 class=western id=bl2.150>
+ Ideas which could be done with ScripterNG
+</h2>
+<ul id=bl2.151>
+ <li id=bl2.152>
+ <p class=western id=bl2.153>
+ OpenClipArt (perhaps also Flickr etc) browser as a dockwidget with ability
+ to import media into current document
+ </p>
+ </li>
+ <li id=bl2.154>
+ <p class=western id=bl2.155>
+ create optimized PDF for the web
+ (<a href=http://wiki.scribus.net/index.php/Web_optimised_PDF id=bl2.156>http://wiki.scribus.net/index.php/Web_optimised_PDF</a>)
+ </p>
+ </li>
+ <li id=bl2.157>
+ <p class=western id=bl2.158>
+ simple IRC dockwidget for live-help and collaboration
+ </p>
+ </li>
+ <li id=bl2.159>
+ <p class=western id=bl2.160>
+ mailmerge
+ (<a href=http://www.assembla.com/wiki/show/scribusmailmerge id=bl2.161>http://www.assembla.com/wiki/show/scribusmailmerge</a>)
+ </p>
+ </li>
+ <li id=bl2.162>
+ <p class=western id=bl2.163>
+ import anything by converting foreign media formats to known formats like
+ HTML, ODT or SVG and then call the SVG-/gettext-importer plug-in: RTF
+ (unrtf, pyrtf), DOC (antiword), MathML (SVGMath,
+ <a href=http://www.grigoriev.ru/svgmath/ id=bl2.164>http://www.grigoriev.ru/svgmath/</a>),
+ vector-formats (Uniconvertor)
+ </p>
+ </li>
+ <li id=bl2.165>
+ <p class=western id=bl2.166>
+ import using OpenOffice.org-filters via UNO-bridge (requires running OOo):
+ <a href=http://websvn.kde.org/trunk/koffice/kword/plugins/scripting/scripts/oouno.py?view=markup id=bl2.167>http://websvn.kde.org/trunk/koffice/kword/plugins/scripting/scripts/oouno.py?view=markup</a>
+ </p>
+ </li>
+ <li id=bl2.168>
+ <p class=western id=bl2.169>
+ import scanned images (Sane on Unix with Python Imaging Library)
+ </p>
+ </li>
+ <li id=bl2.170>
+ <p class=western id=bl2.171>
+ script editor
+ </p>
+ </li>
+ <li id=bl2.172>
+ <p class=western id=bl2.173>
+ script debugger
+ </p>
+ </li>
+ <li id=bl2.174>
+ <p class=western id=bl2.175>
+ ghns-client (get hot new stuff) for templates
+ (<a href=http://www.kde-files.org/index.php?xcontentmode=642 id=bl2.176>http://www.kde-files.org/index.php?xcontentmode=642</a>)
+ </p>
+ </li>
+ <li id=bl2.177>
+ <p class=western id=bl2.178>
+ fullscreen feature
+ </p>
+ </li>
+ <li id=bl2.179>
+ <p class=western id=bl2.180>
+ connect to a database or CMS
+ </p>
+ </li>
+ <li id=bl2.181>
+ <p class=western id=bl2.182>
+ alternative spell checker using PyEnchant
+ </p>
+ </li>
+ <li id=bl2.183>
+ <p class=western id=bl2.184>
+ import plots from gnuplot
+ </p>
+ </li>
+ <li id=bl2.185>
+ <p class=western id=bl2.186>
+ import CSV (or Excel via antixls
+ <font face="Times New Roman, serif" id=bl2.187>-&gt;</font> CSV) into
+ table
+ </p>
+ </li>
+ <li id=bl2.188>
+ <p class=western id=bl2.189>
+ calendar wizard
+ </p>
+ </li>
+ <li id=bl2.190>
+ <p class=western id=bl2.191>
+ advanced search&amp;replace with regular expressions
+ </p>
+ </li>
+ <li id=bl2.192>
+ <p class=western id=bl2.193>
+ an alternative story editor in fullscreen format
+ </p>
+ </li>
+ <li id=bl2.194>
+ <p class=western id=bl2.195>
+ and of course a paper clip assistant ;)
+ </p>
+ </li>
+</ul>
\ No newline at end of file
Index: Scribus/scribus/plugins/scripter/doc/BUGS
===================================================================
--- Scribus/scribus/plugins/scripter/doc/BUGS (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/BUGS (revision 14647)
@@ -0,0 +1,5 @@
+sceditor
+ * wrong syntax (while typing) triggers unwanted errors with rope
+ * make sure the line numbers left of the editor are updated
+ * better highlighting for Python code
+ * problem in console when return pressed inside the line
Index: Scribus/scribus/plugins/scripter/doc/reference.html
===================================================================
--- Scribus/scribus/plugins/scripter/doc/reference.html (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/reference.html (revision 14647)
@@ -0,0 +1,1233 @@
+
+<html>
+ <head><title></title></head>
+<body>
+<h2>ScripterNG API Reference</h2>
+
+<table>
+
+<tr>
+ <td><strong>ScripterNG.aboutScripterNG()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ Like qApp.aboutQt() The quickest way to see if calling ScripterNG works.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activeItem</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>Currently active page item</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>List of Item objects of active page</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.newEllipse(x, y, width, height)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns Item object</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>x is a double</li><li>y is a double</li><li>width is a double</li><li>height is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.newImage(x, y, width, height)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns Item object</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>x is a double</li><li>y is a double</li><li>width is a double</li><li>height is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.newLine(x, y, width, height)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns Item object</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>x is a double</li><li>y is a double</li><li>width is a double</li><li>height is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.newRectangle(x, y, width, height)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns Item object</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>x is a double </li><li>y is a double</li><li>width is a double</li><li>height is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.newText(x, y, width, height)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns Item object</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>x is a double</li><li>y is a double</li><li>width is a double</li><li>height is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.placeEPS(filename x, y)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>filename is string</li><li>x is double</li><li>y is double</li><li>import vector graphics at given position on active page</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.placeODG(filename x, y)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>filename is string</li><li>x is double</li><li>y is double</li><li>import vector graphics at given position on active page</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.placeSVG(filename x, y)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>filename is string</li><li>x is double</li><li>y is double</li><li>import vector graphics at given position on active page</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.placeSXD(filename x, y)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>filename is string</li><li>x is double</li><li>y is double</li><li>import vector graphics at given position on active page</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.position</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>location of active page as int value (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.position</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>int value of active page number &gt;= 1</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.remove()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ Removes the active page from the active document.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.selection</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>List of selected Item objects on active page of active document</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.available</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>bool value if a document is active </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.check</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns True if found else False and raises error</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.close()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ closes the active document without asking save
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.dimensions</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>Dimensions object of active page </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.dimensions.height</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>height of active document in points as double (read-only, for now)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.dimensions.width</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>width of active document in points as double (read-only, for now)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.items</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>List of all Item objects of active document</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.margins</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>Margins object of active document</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.margins.set(lr, tpr, btr, rr)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>args are double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ Use this method if you want to change more than one margin at a time
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.margins.top</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>top-margin of active document as double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.margins.top</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>left-margin of active document as double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.margins.top</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>right-margin of active document as double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.margins.top</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>top-margin of active document as double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.modified</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>boolean flag if document is modified</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ If a document is modified you will be asked to save it on close or quit.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.pageCount()</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns number of pages in active document as int</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>ScripterNG.activeDocument.activePage</li><li>Property</li><li>Page object of active page in active Document</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.selection</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>List of selected Item objects on active document</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeWindow</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns a Window object if a window is open</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li></li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeWindow.redraw</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>boolean flag</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ This can be used to switch of redrawing for complex operations to safe time and reduce flicker. Don't forget to activate redrawing later. After that you can redraw the complete view with -&gt;ScripterNG.activeWindow.update()
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeWindow.scroll(x, y)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>x is an int</li><li>y is an int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ scrolls the visible view to (x, y)
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeWindow.update()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ forces a complete redraw of the view
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeWindow.zoom</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>The zoom factor is a double &gt; 0.0</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ -100.0 is special value to see the whole page.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.alert(message)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>message is a string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ inspired by alert in Javascript
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.bookmarks</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.documentChecker</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.nodes</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html
+ScripterNG.dialogs.outline
+Property
+QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.pages</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.properties</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.scrapbook</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>QDialog object - details in doc/reference_dialogs.html</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.fromVariant(variant)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns instance of QObject-subclass</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>variant is a QVariant</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ This is a helper method for PyQt Because PyQt cannot cast a variant to a QObject or QWidget I hope that will change some time.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.newDocument(topMargin, bottomMargin, leftMargin, rightMargin, pageWIdth, pageHeight, orientation, firstPageNr, pagesTypes, facingPages, firstPageOrger, numPages)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns new a new active Document object</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>topMargin is double</li><li>bottomMargin is double</li><li>leftMargin is double</li><li>rightMargin is double</li><li>pageWidth is double</li><li>pageHeight is double</li><li>orientation is int</li><li>firstPageNr is int</li><li>unit is int</li><li>pagesType is int</li><li>facingPages is int</li><li>firstPageOrder is int</li><li>numPages is int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.openDocument(filename)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns a Document object if a document is open</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>filename is a string</li><li>ScripterNG.activeDocument</li><li>Property</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.contains(context, key)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is a string of a plug-in context, e.g. "scripterng" </li><li>key is a string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ Use this to check if a preference is currently set.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.getBool(context, key)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns value of key as bool or False if key not found</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is string</li><li>key is string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ Use -&gt;ScripterNG.preferences.contains(context, key) if you don't know if the key exists.
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.getDouble(context, key)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns value of key as double of -1 if key not found</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is string</li><li>key is string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.getInt(context, key)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns value of key as int or -1 if key not found</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is string</li><li>key is string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.getString(context, key)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns value of key as string or "" if key not found</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is a string</li><li>key is a string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.setBool(context, key, value)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context ist string</li><li>key is string</li><li>value is bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.setDouble(context, key, value)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is string</li><li>key is string</li><li>value is double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.setInt(context, key, value)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is string</li><li>key is string</li><li>value is int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.preferences.setString(context, key, value)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>context is string</li><li>key is string</li><li>value is string</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+</table>
+</body>
+</html>
+
Index: Scribus/scribus/plugins/scripter/doc/LICENSE
===================================================================
--- Scribus/scribus/plugins/scripter/doc/LICENSE (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/LICENSE (revision 14647)
@@ -0,0 +1,340 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+ freedom to share and change it. By contrast, the GNU General Public
+ License is intended to guarantee your freedom to share and change free
+ software--to make sure the software is free for all its users. This
+ General Public License applies to most of the Free Software
+ Foundation's software and to any other program whose authors commit to
+ using it. (Some other Free Software Foundation software is covered by
+ the GNU Library General Public License instead.) You can apply it to
+ your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+ price. Our General Public Licenses are designed to make sure that you
+ have the freedom to distribute copies of free software (and charge for
+ this service if you wish), that you receive source code or can get it
+ if you want it, that you can change the software or use pieces of it
+ in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+ anyone to deny you these rights or to ask you to surrender the rights.
+ These restrictions translate to certain responsibilities for you if you
+ distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+ gratis or for a fee, you must give the recipients all the rights that
+ you have. You must make sure that they, too, receive or can get the
+ source code. And you must show them these terms so they know their
+ rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+ (2) offer you this license which gives you legal permission to copy,
+ distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+ that everyone understands that there is no warranty for this free
+ software. If the software is modified by someone else and passed on, we
+ want its recipients to know that what they have is not the original, so
+ that any problems introduced by others will not reflect on the original
+ authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+ patents. We wish to avoid the danger that redistributors of a free
+ program will individually obtain patent licenses, in effect making the
+ program proprietary. To prevent this, we have made it clear that any
+ patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+ modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+ a notice placed by the copyright holder saying it may be distributed
+ under the terms of this General Public License. The "Program", below,
+ refers to any such program or work, and a "work based on the Program"
+ means either the Program or any derivative work under copyright law:
+ that is to say, a work containing the Program or a portion of it,
+ either verbatim or with modifications and/or translated into another
+ language. (Hereinafter, translation is included without limitation in
+ the term "modification".) Each licensee is addressed as "you".
+
+ Activities other than copying, distribution and modification are not
+ covered by this License; they are outside its scope. The act of
+ running the Program is not restricted, and the output from the Program
+ is covered only if its contents constitute a work based on the
+ Program (independent of having been made by running the Program).
+ Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+ source code as you receive it, in any medium, provided that you
+ conspicuously and appropriately publish on each copy an appropriate
+ copyright notice and disclaimer of warranty; keep intact all the
+ notices that refer to this License and to the absence of any warranty;
+ and give any other recipients of the Program a copy of this License
+ along with the Program.
+
+ You may charge a fee for the physical act of transferring a copy, and
+ you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+ of it, thus forming a work based on the Program, and copy and
+ distribute such modifications or work under the terms of Section 1
+ above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the Program,
+ and can be reasonably considered independent and separate works in
+ themselves, then this License, and its terms, do not apply to those
+ sections when you distribute them as separate works. But when you
+ distribute the same sections as part of a whole which is a work based
+ on the Program, the distribution of the whole must be on the terms of
+ this License, whose permissions for other licensees extend to the
+ entire whole, and thus to each and every part regardless of who wrote it.
+
+ Thus, it is not the intent of this section to claim rights or contest
+ your rights to work written entirely by you; rather, the intent is to
+ exercise the right to control the distribution of derivative or
+ collective works based on the Program.
+
+ In addition, mere aggregation of another work not based on the Program
+ with the Program (or with a work based on the Program) on a volume of
+ a storage or distribution medium does not bring the other work under
+ the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+ under Section 2) in object code or executable form under the terms of
+ Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+ The source code for a work means the preferred form of the work for
+ making modifications to it. For an executable work, complete source
+ code means all the source code for all modules it contains, plus any
+ associated interface definition files, plus the scripts used to
+ control compilation and installation of the executable. However, as a
+ special exception, the source code distributed need not include
+ anything that is normally distributed (in either source or binary
+ form) with the major components (compiler, kernel, and so on) of the
+ operating system on which the executable runs, unless that component
+ itself accompanies the executable.
+
+ If distribution of executable or object code is made by offering
+ access to copy from a designated place, then offering equivalent
+ access to copy the source code from the same place counts as
+ distribution of the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense or distribute the Program is
+ void, and will automatically terminate your rights under this License.
+ However, parties who have received copies, or rights, from you under
+ this License will not have their licenses terminated so long as such
+ parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+ signed it. However, nothing else grants you permission to modify or
+ distribute the Program or its derivative works. These actions are
+ prohibited by law if you do not accept this License. Therefore, by
+ modifying or distributing the Program (or any work based on the
+ Program), you indicate your acceptance of this License to do so, and
+ all its terms and conditions for copying, distributing or modifying
+ the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+ Program), the recipient automatically receives a license from the
+ original licensor to copy, distribute or modify the Program subject to
+ these terms and conditions. You may not impose any further
+ restrictions on the recipients' exercise of the rights granted herein.
+ You are not responsible for enforcing compliance by third parties to
+ this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+ infringement or for any other reason (not limited to patent issues),
+ conditions are imposed on you (whether by court order, agreement or
+ otherwise) that contradict the conditions of this License, they do not
+ excuse you from the conditions of this License. If you cannot
+ distribute so as to satisfy simultaneously your obligations under this
+ License and any other pertinent obligations, then as a consequence you
+ may not distribute the Program at all. For example, if a patent
+ license would not permit royalty-free redistribution of the Program by
+ all those who receive copies directly or indirectly through you, then
+ the only way you could satisfy both it and this License would be to
+ refrain entirely from distribution of the Program.
+
+ If any portion of this section is held invalid or unenforceable under
+ any particular circumstance, the balance of the section is intended to
+ apply and the section as a whole is intended to apply in other
+ circumstances.
+
+ It is not the purpose of this section to induce you to infringe any
+ patents or other property right claims or to contest validity of any
+ such claims; this section has the sole purpose of protecting the
+ integrity of the free software distribution system, which is
+ implemented by public license practices. Many people have made
+ generous contributions to the wide range of software distributed
+ through that system in reliance on consistent application of that
+ system; it is up to the author/donor to decide if he or she is willing
+ to distribute software through any other system and a licensee cannot
+ impose that choice.
+
+ This section is intended to make thoroughly clear what is believed to
+ be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+ certain countries either by patents or by copyrighted interfaces, the
+ original copyright holder who places the Program under this License
+ may add an explicit geographical distribution limitation excluding
+ those countries, so that distribution is permitted only in or among
+ countries not thus excluded. In such case, this License incorporates
+ the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+ of the General Public License from time to time. Such new versions will
+ be similar in spirit to the present version, but may differ in detail to
+ address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the Program
+ specifies a version number of this License which applies to it and "any
+ later version", you have the option of following the terms and conditions
+ either of that version or of any later version published by the Free
+ Software Foundation. If the Program does not specify a version number of
+ this License, you may choose any version ever published by the Free Software
+ Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+ programs whose distribution conditions are different, write to the author
+ to ask for permission. For software which is copyrighted by the Free
+ Software Foundation, write to the Free Software Foundation; we sometimes
+ make exceptions for this. Our decision will be guided by the two goals
+ of preserving the free status of all derivatives of our free software and
+ of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+ REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+ possible use to the public, the best way to achieve this is to make it
+ free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+ to attach them to the start of each source file to most effectively
+ convey the exclusion of warranty; and each file should have at least
+ the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Also add information on how to contact you by electronic and paper mail.
+
+ If the program is interactive, make it output a short notice like this
+ when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+ The hypothetical commands `show w' and `show c' should show the appropriate
+ parts of the General Public License. Of course, the commands you use may
+ be called something other than `show w' and `show c'; they could even be
+ mouse-clicks or menu items--whatever suits your program.
+
+ You should also get your employer (if you work as a programmer) or your
+ school, if any, to sign a "copyright disclaimer" for the program, if
+ necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+ This General Public License does not permit incorporating your program into
+ proprietary programs. If your program is a subroutine library, you may
+ consider it more useful to permit linking proprietary applications with the
+ library. If this is what you want to do, use the GNU Library General
+ Public License instead of this License.
Index: Scribus/scribus/plugins/scripter/doc/reference_items.html
===================================================================
--- Scribus/scribus/plugins/scripter/doc/reference_items.html (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/reference_items.html (revision 14647)
@@ -0,0 +1,1608 @@
+
+<html>
+ <head><title></title></head>
+<body>
+<h2>ScripterNG API Reference</h2>
+
+<table>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].ColGap</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].Cols</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i]._q_reregisterTimers(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a void*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].blendmode(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li><li>arg2 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].colors(arg1, arg2, arg3, arg4)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li><li>arg2 is a QString</li><li>arg3 is a double</li><li>arg4 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].columns(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].cornerRadius</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].cornerRadius(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].customLineStyle</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].deleteLater()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].destroyed(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QObject*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].destroyed()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].endArrowIndex</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].fillColor</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].fillShade</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].fillTransparency</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].firstLineOffset</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is FirstLineOffsetPolicy </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].frameFlippedH(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].frameFlippedV(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].frameLocked(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].frameSizeLocked(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].frameType(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].gradientColorUpdate(arg1, arg2, arg3, arg4, arg5, arg6)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li><li>arg3 is a double</li><li>arg4 is a double</li><li>arg5 is a double</li><li>arg6 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].gradientType(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].height</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].imageOffsetScale(arg1, arg2, arg3, arg4)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li><li>arg3 is a double</li><li>arg4 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].imageXOffset</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].imageXScale</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].imageYOffset</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].imageYScale</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].itemName</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].itemType</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is ItemType </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineColor</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineShade</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineSpacing(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineStyleCapJoin(arg1, arg2, arg3)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a Qt::PenStyle</li><li>arg2 is a Qt::PenCapStyle</li><li>arg3 is a Qt::PenJoinStyle</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineTransparency</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineWidth</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].lineWidth(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].m_ImageIsFlippedH</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].m_ImageIsFlippedV</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].m_Locked</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].m_PrintEnabled</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].m_SizeLocked</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].myself(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a PageItem*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].objectName</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].patternFill(arg1, arg2, arg3, arg4, arg5, arg6)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li><li>arg2 is a double</li><li>arg3 is a double</li><li>arg4 is a double</li><li>arg5 is a double</li><li>arg6 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].position(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].printEnabled(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].reversed</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].rotation</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].rotation(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].startArrowIndex</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textBaseLineOffset(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textColor(arg1, arg2, arg3, arg4)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li><li>arg2 is a QString</li><li>arg3 is a double</li><li>arg4 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textFont(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textFormatting(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textHeightScale(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textKerning(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textOutline(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textShadow(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textSize(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textStrike(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textStyle(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textToFrameDistBottom</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textToFrameDistLeft</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textToFrameDistRight</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textToFrameDistTop</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textToFrameDistances(arg1, arg2, arg3, arg4)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li><li>arg3 is a double</li><li>arg4 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textUnderline(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].textWidthScale(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].transparency(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].width</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].widthAndHeight(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].xPos</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.activeDocument.activePage.items[i].yPos</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+</table>
+</body>
+</html>
+
Index: Scribus/scribus/plugins/scripter/doc/TUTORIAL
===================================================================
--- Scribus/scribus/plugins/scripter/doc/TUTORIAL (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/TUTORIAL (revision 14647)
@@ -0,0 +1,146 @@
+Here is some information how you can extend and use ScripterNG
+
+Create an API module
+====================
+
+Go to the scripterng plug-in directory and call
+ ./new_api.py test
+This will generate two files:
+ * api_test.h
+ * api_test.cpp
+from api_example.{h,cpp} as a template.
+
+The files are added to CMakeLists.txt and the header file is included
+in scripterngimpl.h
+
+Inside these files there is a class TestAPI defined. By default the
+class is a child of ScriperNGImpl and has the object-name Test.
+So the class will be automatically available under the name
+ScriperNG.Test from Python or QtScript.
+
+The class is created at start-up in scriperngimpl.cpp but you might want
+to change that. Look for the activeDocument Q_PROPERTY in scripterngimpl to
+see how to create an object on demand.
+
+To write a function which is available for scripting you have to write
+a public slot method. Allowed as parameters and as return types are
+basic types (int, bool, ..) and Qt objects. Pointers to pointers and
+complicated stuff like that does not work - but would not make any
+sense anyway...
+One caveat: If you want to return instances of QObject or QWidget you have to
+declare the base class QObject or QWidget as return type. The correct
+typecasting is done later at runtime via the Qt Meta-Object system.
+
+That's all. You do not have to know anything about the scripting
+language or about any binding api to do parameter conversation and
+validation. This is done by ScripterNG.
+
+
+
+Script Descriptor Files
+=======================
+
+These files describe a script. Its extension is .scs and you can write
+them easily by hand. Here are the possible options and their defaults:
+ name =
+ title =
+ description =
+ icon =
+ menu = ScripterNG
+ shortcut = # A valid QKeySequence as a string, see Qt4-docs
+ filename = # name of script file
+ subroutine = # additional entry point?
+ author =
+ contact =
+ homepage =
+ version =
+ copyright = # GPL2
+ scribus_version =
+ redraw = True
+ mode = interactive # allowed: batch, interactive, extension
+ language = python # allowed: python, qtscript
+ separator_before = False # in menu
+ separator_after = False # in menu
+ background_mode = False # threaded execution only for non-gui scripts
+More options are already planned and will come with a later release.
+Feedback on needed features is always welcome.
+
+If you put a script descriptor file inside the scripterng/autoload
+or ~/.scribus/scripterng/autoload folder it will be loaded at startup,
+added to the menu bar, etc.
+Every entry you see in the ScriperNG menu is already a separate script
+in autoload.
+
+You can also put the script descriptor inside a source file at the
+top in double comments. Python files have to be called .spy and look
+like this:
+ # -*- coding: utf-8 -*-
+ ## name = about
+ ## title = About ScripterNG
+ ## shortcut = Esc,a
+ # ScripterNG is a builtin and does not need to be imported
+ ScripterNG.aboutScripterNG()
+
+With QtScript (extension is .sqts) the same is possible:
+ /// name = aboutqts
+ /// title = About ScripterNG from QtScript
+ ScripterNG.aboutScripter();
+
+Support for .zip-packaged scripts is on the TODO.
+
+
+
+Writing Scripts in Python and QtScript
+======================================
+
+QtScript is the name of the EcmaScript implementation in Qt.
+It is better known under the name JavaScript. Besides its popular use in
+browsers it gained acceptance as a scripting language (e.g. in InDesign).
+See http://doc.trolltech.com/4.4/qtscript.html#ecmascript-compatibility
+for details about the Qt implementation
+If you want to write an Scribus extension you have to know how to react to
+events: http://doc.trolltech.com/4.4/signalsandslots.html
+
+If you are not sure about choosing Python or JavaScript for scripting in
+Scribus, here are some hints.
+For both languages there is a great amount of documentation and
+free articles on the internet available, e.g.:
+ * http://www.diveintopython.org/toc/index.html
+ * http://www.unix.com.ua/orelly/web/jscript/
+For a C/C++ or PHP programmer the syntax of QtScript might be more appealling
+because it's nearly the same. Python is suitable for beginners as well as computer
+scientists.
+Additionally Python provides powerful third-party libraries (database
+connectivity, file formats, ..) and gives full access to the GUI framework Qt
+used by Scribus.
+QtScript on the other hand is a safe language and without access to
+external modules it cannot access your system directly.
+
+Besides these differences the actual scripting is very similar because
+both language access the same API. The API is very intuitive. It has a
+logical object hierarchy with properties which you can read and change.
+
+Some technical details:
+ * In QtScript the garbage collector deletes C++ objects after the
+ script has finished.
+ * In Python the garbage collector can delete an object after it is
+ not used any more.
+ * Currently both languages do not share a common namespace. This
+ might change with a later release.
+
+
+
+Differences to old scripter
+===========================
+
+The new API is completely different. You have to learn something new, sorry.
+But the this API is far more logical. The object model and the heavy
+use of properties makes programming very easy.
+
+The old scripter had a function called setUnit to switch between points,
+millimeters, picas and inches. This has been removed. Every method
+now only accepts points. There will be some helper functions added at
+a later stage to convert between units. For now you might want to look
+at http://en.wikipedia.org/wiki/Point_(typography) to write your own
+converter or to start to think in points.
+
Index: Scribus/scribus/plugins/scripter/doc/reference_dialogs.html
===================================================================
--- Scribus/scribus/plugins/scripter/doc/reference_dialogs.html (nonexistent)
+++ Scribus/scribus/plugins/scripter/doc/reference_dialogs.html (revision 14647)
@@ -0,0 +1,24015 @@
+
+<html>
+ <head><title></title></head>
+<body>
+<h2>ScripterNG API Reference</h2>
+
+<table>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.ClearInhalt()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.LayerActivated(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.LayerChanged()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers._q_reregisterTimers(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a void*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers._q_showIfNotHidden()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.accept()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.acceptDrops</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.accepted()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.accessibleDescription</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.accessibleName</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.addLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.autoFillBackground</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.baseSize</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.changeBlendMode(blend)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>blend is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.changeName(row, col)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>row is a int</li><li>col is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.changeOpacity()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.childrenRect</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QRect (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.childrenRegion</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QRegion (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.close()</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns bool</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.contextMenuPolicy</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is Qt::ContextMenuPolicy </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.cursor</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QCursor </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.customContextMenuRequested(pos)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>pos is a QPoint</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.deleteLater()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.destroyed(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QObject*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.destroyed()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.done(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.downLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.dupLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.enabled</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.exec()</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns int</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.exec(newParent)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns int</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>newParent is a QWidget*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.finished(result)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>result is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.flowToggleLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.focus</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.focusPolicy</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is Qt::FocusPolicy </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.font</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QFont </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.frameGeometry</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QRect (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.frameSize</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.fullScreen</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.geometry</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QRect </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.height</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.hide()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.isActiveWindow</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.languageChange()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.layoutDirection</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is Qt::LayoutDirection </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.locale</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QLocale </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.lockLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.lower()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.markActiveLayer(layerNumber)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>layerNumber is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.markActiveLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.markLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.maximized</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.maximumHeight</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.maximumSize</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.maximumWidth</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.minimized</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.minimumHeight</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.minimumSize</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.minimumSizeHint</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.minimumWidth</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.modal</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.modal</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.mouseTracking</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.normalGeometry</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QRect (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.objectName</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.outlineToggleLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.palette</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QPalette </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.paletteShown(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.pos</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QPoint </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.printLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.raise()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.rect</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QRect (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.reject()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.reject()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.rejected()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.removeLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.repaint()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setActiveLayer(row)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>row is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setDisabled(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setEnabled(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setFocus()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setFontSize()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setHidden(hidden)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>hidden is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setPaletteShown(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setShown(shown)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>shown is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setStyleSheet(styleSheet)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>styleSheet is a QString</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setVisible(visible)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>visible is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setWindowModified(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.setWindowTitle(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.show()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.showExtension(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.showFullScreen()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.showMaximized()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.showMinimized()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.showNormal()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.size</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.sizeGripEnabled</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.sizeHint</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.sizeIncrement</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSize </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.sizePolicy</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QSizePolicy </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.statusTip</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.styleSheet</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.toggleAllfromHeader(index)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>index is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.toolTip</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.upLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.update()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.updateMicroFocus()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.updatesEnabled</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.visible</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.visibleLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.whatsThis</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.width</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowFilePath</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowIcon</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QIcon </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowIconText</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowModality</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is Qt::WindowModality </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowModified</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is bool </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowOpacity</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is double </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.windowTitle</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is QString </li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.x</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.layers.y</strong></td>
+ <td><strong>PROPERTY</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>type is int (read-only)</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.AddBookMark(ite)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>ite is a PageItem*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ApplyMasterPage()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Apply_MasterPage(pageName, pageNumber, reb)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>pageName is a QString</li><li>pageNumber is a int</li><li>reb is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Apply_MasterPage(pageName, pageNumber)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>pageName is a QString</li><li>pageNumber is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.BookMarkTxT(ite)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>ite is a PageItem*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ClipChange()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Collect(compress, withFonts, withProfiles, newDirectory)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns QString</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>compress is a bool</li><li>withFonts is a bool</li><li>withProfiles is a bool</li><li>newDirectory is a QString</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Collect(compress, withFonts, withProfiles)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns QString</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>compress is a bool</li><li>withFonts is a bool</li><li>withProfiles is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Collect(compress, withFonts)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns QString</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>compress is a bool</li><li>withFonts is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Collect(compress)</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns QString</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>compress is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.Collect()</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns QString</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.CopyPage()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.DelBookMark(ite)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>ite is a PageItem*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.DeletePage()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.DeletePage(from, to)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>from is a int</li><li>to is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.DeletePage2(pg)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>pg is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.DisableTxEdit()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.DoFileClose()</strong></td>
+ <td><strong>FUNCTION</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em>returns bool</em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.EditTabs()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.EnableTxEdit()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.GroupObj(showLockDia)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>showLockDia is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.GroupObj()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.HaveNewDoc()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.HaveNewSel(Nr)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>Nr is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ImageEffects()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.MakeFrame(f, c, vals)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>f is a int</li><li>c is a int</li><li>vals is a double*</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ManageJava()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ModifyAnnot()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.MovePage()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.PutScrap()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.PutToPatterns()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.RedoAction()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SaveAsEps()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SaveAsPDF()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SaveText()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SearchText()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SelectAll(docWideSelect)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>docWideSelect is a bool</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SelectAll()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SelectAllOnLayer()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.SetNewFont(nf)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>nf is a QString</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.StatusPic()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.StoreBookmarks()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextBase(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextFarben(arg1, arg2, arg3, arg4)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li><li>arg2 is a QString</li><li>arg3 is a double</li><li>arg4 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextIFont(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a QString</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextISize(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextOutline(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextScale(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextScaleV(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextShadow(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextStil(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a int</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextStrike(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextStyle(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a ParagraphStyle</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextUSval(arg1)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TextUnderline(arg1, arg2)</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul><li>arg1 is a double</li><li>arg2 is a double</li></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleAllGuides()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleAllPalettes()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleBase()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleBleeds()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleColumnBorders()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleFrames()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleGuides()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleLayerMarkers()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleMarks()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.TogglePics()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleRaster()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleRulerMode()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleRulers()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colspan="2">
+ <em></em>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <ul></ul>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+
+ </td>
+</tr>
+<tr><td colspan="2"><hr></td></tr>
+
+<tr>
+ <td><strong>ScripterNG.dialogs.mainWindow.ToggleStickyTools()</strong></td>
+ <td><strong>PROCEDURE</strong></td>
+</tr>
+<tr>
+ <td colsp