summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/scriptplugin/README.BOOST
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-01-01 11:40:09 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-01-01 11:40:09 +0000
commit7ed83b6c6666eb8b6b104c211ae7e52907350372 (patch)
tree4430b556abac0ad660a0aacf1887d77f85d8be02 /scribus/plugins/scriptplugin/README.BOOST
downloadscribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.gz
scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.xz
scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.zip
Branch 1.3.5 tree to 1.4.x tree, goodbye 1.3.x
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17163 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/plugins/scriptplugin/README.BOOST')
-rw-r--r--scribus/plugins/scriptplugin/README.BOOST50
1 files changed, 50 insertions, 0 deletions
diff --git a/scribus/plugins/scriptplugin/README.BOOST b/scribus/plugins/scriptplugin/README.BOOST
new file mode 100644
index 0000000..281c4a9
--- /dev/null
+++ b/scribus/plugins/scriptplugin/README.BOOST
@@ -0,0 +1,50 @@
+Experimental support for the use of Boost::Python has been added to the Python
+interface. All Boost code is exported in a separate module, scribus2, that is
+only created if Boost::Python is available.
+
+Currently there's no autotools support for this in Scribus, so to compile the
+scripter with this highly experimental feature you must:
+
+$ make clean
+$ make CXXFLAGS=" -Wno-extra -Wno-unused -DHAVE_BOOST_PYTHON -fexceptions " LDFLAGS=" -lboost_python "
+$ make install
+
+For more information on Boost::Python see:
+ http://www.boost.org/libs/python/doc/
+ http://www-eleves-isia.cma.fr/documentation/BoostDoc/boost_1_29_0/libs/python/doc/tutorial/
+
+It's strongly recommended that you read the FAQ at:
+ http://www.boost.org/libs/python/doc/v2/faq.html
+(probably once before reading the code, and again after).
+
+All the fun stuff is in the `scribus2' module and is used for manipulating
+paragraph styles. There are currently two (dirty hack) interfaces. One is a
+"value based" interface - ask for a /copy of/ a style, add a style by /copying/
+it into the style list, etc. The other interface is reference based - get a
+dict of references to the existing styles and modify them directly. Soon,
+hopefully, add and remove styles from the dict as if it was a Python one too.
+The value based interface is safer but clumsier; the reference based one
+can be a tad dangerous but is very handy.
+
+Examples:
+
+>>> import scribus2
+>>> p = scribus2.ParagraphStyle()
+>>> p.Vname = "testing"
+>>> scribus2.addStyle(p)
+>>> scribus2.getStyleNames()
+[ blah, blah, blah , "testing" ]
+>>> scribus2.getStylesRef()['testing'].Vname = "newname"
+>>> scribus2.getStyleNames()
+[ blah, blah, blah, "newname"]
+>>> ref = scribus2.getStyleRef("newname")
+>>> ref.Vname = "renamed"
+>>> scribus2.getStyleNames()
+[ blah, blah, blah, "renamed"]
+>>> val = scribus2.getStyleVal("renamed")
+>>> val.Vname = "doesnothing"
+>>> scribus2.getStyleNames()
+[ blah, blah, blah, "renamed"]
+>>> scribus2.addStyle(val)
+>>> scribus2.getStyleNames()
+[ blah, blah, blah, "renamed", "doesnothing"]