r22205 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 26 18:04:00 UTC 2017


Author: jghali
Date: Thu Oct 26 18:04:00 2017
New Revision: 22205

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22205
Log:
#15027: scripter commands for creating and using line styles <jurajF>

Modified:
    trunk/Scribus/doc/en/scripterapi-getobjprop.html
    trunk/Scribus/doc/en/scripterapi-object.html
    trunk/Scribus/doc/en/scripterapi-setobjprop.html
    trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.h
    trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.h
    trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
    trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp

Modified: trunk/Scribus/doc/en/scripterapi-getobjprop.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/doc/en/scripterapi-getobjprop.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-getobjprop.html	(original)
+++ trunk/Scribus/doc/en/scripterapi-getobjprop.html	Thu Oct 26 18:04:00 2017
@@ -19,13 +19,17 @@
 <dd><code>getCornerRadius(["name"]) -> integer</code>
 <p>Returns the corner radius of the object "name". The radius is expressed in points. If "name" is not given the currently selected item is used.</p></dd>
 
-<dt><a name="-getFillColor"><strong>getFillColor</strong></a>(...)</dt>
-<dd><code>getFillColor(["name"]) -> string</code>
-<p>Returns the name of the fill color of the object "name". If "name" is not given the currently selected item is used.</p></dd>
+<dt><a name="-getCustomLineStyle"><strong>getCustomLineStyle</strong></a>(...)</dt>
+<dd><code>getCustomLineStyle(styleName, ["name"])</code>
+<p>Returns the styleName of custom line style for the object. If object's "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFillBlendmode"><strong>getFillBlendmode</strong>(...)</a></dt>
 <dd><code>getFillBlendmode(["name"]) -> integer</code>
 <p>Returns the fill blendmode of the object "name". If "name" is not given the currently selected Item is used.</p></dd>
+
+<dt><a name="-getFillColor"><strong>getFillColor</strong></a>(...)</dt>
+<dd><code>getFillColor(["name"]) -> string</code>
+<p>Returns the name of the fill color of the object "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFillShade"><strong>getFillShade</strong></a>(...)</dt>
 <dd><code>getFillShade(["name"]) -> integer</code>

Modified: trunk/Scribus/doc/en/scripterapi-object.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/doc/en/scripterapi-object.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-object.html	(original)
+++ trunk/Scribus/doc/en/scripterapi-object.html	Thu Oct 26 18:04:00 2017
@@ -44,6 +44,21 @@
 <li>scaleh [optional], scalev [optional] -> scale of the chars</li>
 <li>tracking [optional] -> tracking of the text</li>
 <li>"language" [optional] -> language code</li>
+</ul>
+</p>
+</dd>
+
+<dt><a name="-createCustomLineStyle"><strong>createCustomLineStyle</strong></a>(...)</dt>
+<dd><code>createCustomLineStyle(styleName, style)</code>
+<p>Creates the custom line style 'styleName'.</p>
+<p>This function takes list of dictionary as parameter for "style". Each dictionary represent one subline within style. Dictionary can have those keys:
+<ul>
+<li>Color [optional] -> name of the color to use (string)</li>
+<li>Dash [optional] -> type of line to use (integer)</li>
+<li>LineEnd [optional] -> type of LineEnd to use (integer)</li>
+<li>LineJoin [optional] -> type of LineJoin to use (integer)</li>
+<li>Shade [optional] -> opacity of line (integer)</li>
+<li>Width [optional] -> width of line (double)</li>
 </ul>
 </p>
 </dd>

Modified: trunk/Scribus/doc/en/scripterapi-setobjprop.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/doc/en/scripterapi-setobjprop.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-setobjprop.html	(original)
+++ trunk/Scribus/doc/en/scripterapi-setobjprop.html	Thu Oct 26 18:04:00 2017
@@ -18,15 +18,19 @@
 <p>Loads the picture "picture" into the image frame "name". If "name" is not given the currently selected item is used.</p>
 <p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a> if the target frame is not an image frame</p></dd></dt>
 
+<dt><a name="-setCornerRadius"><strong>setCornerRadius</strong></a>(...)</dt>
+<dd><code>setCornerRadius(radius, ["name"])</code>
+<p>Sets the corner radius of the object "name". The radius is expressed in points. If "name" is not given the currently selected item is used.</p> 
+<p>May raise ValueError if the corner radius is negative.</p></dd>
+
+<dt><a name="-setCustomLineStyle"><strong>setCustomLineStyle</strong></a>(...)</dt>
+<dd><code>setCustomLineStyle(styleName, ["name"])</code>
+<p>Sets the custom line style of the object "name" to "styleName". Argument "styleName" is the name of line style as seen in Style Manager. If "name" is not given the currently selected item is used.</p></dd>
+
 <dt><a name="-setFillBlendmode"><strong>setFillBlendmode</strong>(...)</a></dt>
 <dd><code>setFillBlendmode(blendmode, ["name"])</code>
 <p>Sets the fill blendmode of the object "name" to blendmode is the name of one of the defined colors. If "name" is not given the currently selected item is used.</p></dd>
 
-<dt><a name="-setCornerRadius"><strong>setCornerRadius</strong></a>(...)</dt>
-<dd><code>setCornerRadius(radius, ["name"])</code>
-<p>Sets the corner radius of the object "name". The radius is expressed in points. If "name" is not given the currently selected item is used.</p> 
-<p>May raise ValueError if the corner radius is negative.</p></dd>
-	
 <dt><a name="-setFillColor"><strong>setFillColor</strong></a>(...)</dt>
 <dd><code>setFillColor("color", ["name"])</code>
 <p>Sets the fill color of the object "name" to the color "color". "color" is the name of one of the defined colors. If "name" is not given the currently selected item is used.</p></dd>

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp	Thu Oct 26 18:04:00 2017
@@ -80,6 +80,20 @@
 	return i != NULL ? PyInt_FromLong(static_cast<long>(i->fillBlendmode())) : NULL;
 }
 
+PyObject *scribus_getcustomlinestyle(PyObject* /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
+		return NULL;
+	if(!checkHaveDocument())
+		return NULL;
+	PageItem *it;
+	it = GetUniqueItem(QString::fromUtf8(Name));
+	if (it == NULL)
+		return NULL;
+	return PyString_FromString(it->customLineStyle().toUtf8());
+}
+
 PyObject *scribus_getlinecolor(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
@@ -386,6 +400,7 @@
 {
 	QStringList s;
 	s << scribus_getobjecttype__doc__ << scribus_getfillcolor__doc__
+	  << scribus_getcustomlinestyle__doc__
 	  << scribus_getfilltrans__doc__ << scribus_getfillblend__doc__ 
 	  << scribus_getlinecolor__doc__ << scribus_getlinetrans__doc__ 
 	  << scribus_getlineblend__doc__ << scribus_getlinewidth__doc__ 

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.h	Thu Oct 26 18:04:00 2017
@@ -52,6 +52,16 @@
 PyObject *scribus_getfillblend(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_getcustomlinestyle__doc__,
+QT_TR_NOOP("getCustomLineStyle([\"name\"]) -> string\n\
+\n\
+Returns the styleName of custom line style for the object. If object's \"name\" is not given the\n\
+currently selected item is used.\n\
+"));
+/*! Returns custom style of the line */
+PyObject *scribus_getcustomlinestyle(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
 PyDoc_STRVAR(scribus_getlinecolor__doc__,
 QT_TR_NOOP("getLineColor([\"name\"]) -> string\n\
 \n\

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp	Thu Oct 26 18:04:00 2017
@@ -178,6 +178,28 @@
 	Py_RETURN_NONE;
 }
 
+PyObject *scribus_setcustomlinestyle(PyObject* /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	char *Style;
+	if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Style, "utf-8", &Name))
+		return NULL;
+	if(!checkHaveDocument())
+		return NULL;
+	PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
+	if (it == NULL)
+		return NULL;
+	QString qStyle = QString::fromUtf8(Style);
+	if (! ScCore->primaryMainWindow()->doc->MLineStyles.contains(qStyle))
+	{
+		PyErr_SetString(NotFoundError, QObject::tr("Line Style not found.","python error").toLocal8Bit().constData());
+		return NULL;
+
+	}
+	it->setCustomLineStyle(qStyle);
+	Py_RETURN_NONE;
+}
+
 PyObject *scribus_setlinecolor(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
@@ -510,6 +532,7 @@
 {
 	QStringList s;
 	s << scribus_setgradfill__doc__  << scribus_setgradstop__doc__
+	  << scribus_setcustomlinestyle__doc__
 	  << scribus_setfillcolor__doc__ << scribus_setfilltrans__doc__ 
 	  << scribus_setfillblend__doc__ << scribus_setlinecolor__doc__ 
 	  << scribus_setlinetrans__doc__ << scribus_setlineblend__doc__ 

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.h	Thu Oct 26 18:04:00 2017
@@ -66,6 +66,17 @@
 PyObject *scribus_setfillblend(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_setcustomlinestyle__doc__,
+QT_TR_NOOP("setCustomLineStyle(\"styleName\", [\"name\"])\n\
+\n\
+Sets the custom line style of the object \"name\" to \"styleName\"\n\
+Argument \"styleName\" is the name of line style as seen in Style Manager\n\
+If \"name\" is not given the currently selected item is used.\n\
+"));
+/*! Set custom line style */
+PyObject *scribus_setcustomlinestyle(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
 PyDoc_STRVAR(scribus_setlinecolor__doc__,
 QT_TR_NOOP("setLineColor(\"color\", [\"name\"])\n\
 \n\
@@ -149,8 +160,10 @@
 QT_TR_NOOP("setLineStyle(style, [\"name\"])\n\
 \n\
 Sets the line style of the object \"name\" to the style \"style\". If \"name\"\n\
-is not given the currently selected item is used. There are predefined\n\
-constants for \"style\" - LINE_<style>.\n\
+is not given the currently selected item is used.\n\
+Argument for this function is number - value from 1 to 37\n\
+There are few predefined constants for \"style\" - LINE_<style>.\n\
+In Property Palette this feature is selected in box named 'Type of line'\n\
 "));
 /*! Set line end */
 PyObject *scribus_setlinestyle(PyObject * /*self*/, PyObject* args);

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp	Thu Oct 26 18:04:00 2017
@@ -170,6 +170,72 @@
 	Py_RETURN_NONE;
 }
 
+PyObject *scribus_createcustomlinestyle(PyObject * /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	PyObject *obj;
+
+	if (!PyArg_ParseTuple(args, "esO", "utf-8", &Name, &obj))
+		return NULL;
+
+	if (!PyList_Check(obj)) {
+		PyErr_SetString(PyExc_TypeError, "'style' must be list.");
+		return NULL;
+	}
+
+	multiLine ml;
+	for (int i = 0; i < PyList_Size(obj); i++) {
+		PyObject *line = PyList_GetItem(obj, i);
+		if (!PyDict_Check(line)) {
+			PyErr_SetString(PyExc_TypeError, "elements of list must be Dictionary.");
+			return NULL;
+		}
+		struct SingleLine sl;
+		PyObject *val;
+		val = PyDict_GetItemString(line, "Color");
+		if (val) {
+			sl.Color = PyString_AsString(val);
+		} else 
+			sl.Color = ScCore->primaryMainWindow()->doc->itemToolPrefs().lineColor;;
+		val = PyDict_GetItemString(line, "Dash");
+		if (val) {
+			sl.Dash = PyInt_AsLong(val);
+		} else 
+			sl.Dash = Qt::SolidLine;
+		val = PyDict_GetItemString(line, "LineEnd");
+		if (val) {
+			sl.LineEnd = PyInt_AsLong(val);
+		} else 
+			sl.LineEnd = Qt::FlatCap;
+		val = PyDict_GetItemString(line, "LineJoin");
+		if (val) {
+			sl.LineJoin = PyInt_AsLong(val);
+		} else 
+			sl.LineJoin = Qt::MiterJoin;
+		val = PyDict_GetItemString(line, "Shade");
+		if (val) {
+			sl.Shade = PyInt_AsLong(val);
+		} else 
+			sl.Shade = ScCore->primaryMainWindow()->doc->itemToolPrefs().lineColorShade;
+		val = PyDict_GetItemString(line, "Width");
+		if (val) {
+			sl.Width = PyFloat_AsDouble(val);
+		} else 
+			sl.Width = ScCore->primaryMainWindow()->doc->itemToolPrefs().lineWidth;
+
+		val = PyDict_GetItemString(line, "Shortcut");
+		if (val) {
+			ml.shortcut = PyString_AsString(val);
+		} else 
+			ml.shortcut = "";
+		ml.push_back(sl);
+	}
+	if (ml.size() > 0)
+		ScCore->primaryMainWindow()->doc->MLineStyles[Name] = ml;
+	Py_RETURN_NONE;
+}
+
+
 /*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
 with header files structure untouched (docstrings are kept near declarations)
 PV */
@@ -177,4 +243,5 @@
 {
 	QStringList s;
 	s << scribus_createparagraphstyle__doc__ << scribus_createcharstyle__doc__;
-}
+	s << scribus_createcustomlinestyle__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h	Thu Oct 26 18:04:00 2017
@@ -1,86 +1,105 @@
-/*
-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.
-02.01.2008: Joachim Neu - joachim_neu at web.de - http://www.joachim-neu.de
-*/
-#ifndef CMDSTYLE_H
-#define CMDSTYLE_H
-
-// Pulls in <Python.h> first
-#include "cmdvar.h"
-//Added by qt3to4:
-#include <QPixmap>
-
-/** Style-related Commands */
-
-/* PARAGRAPH STYLES */
-
-/*! docstring */
-PyDoc_STRVAR(scribus_createparagraphstyle__doc__,
-QT_TR_NOOP("createParagraphStyle(...)\n\n\
-Creates a paragraph style. This function takes the following keyword parameters:\n\n\
-\"name\" [required] -> specifies the name of the paragraphstyle to create\n\n\
-linespacingmode [optional] -> specifies the linespacing mode; possible modes are:\n\n\
-fixed linespacing:          0\n\n\
-automatic linespacing:      1\n\n\
-baseline grid linespacing:  2\n\n\
-linespacing [optional] -> specifies the linespacing if using fixed linespacing\n\n\
-alignment [optional] -> specifies the alignment of the paragraph\n\n\
--> left:     0\n\n\
--> center:   1\n\n\
--> right:    2\n\n\
--> justify:  3\n\n\
--> extend:   4\n\n\
-leftmargin [optional], rightmargin [optional] -> specify the margin\n\n\
-gapbefore [optional], gapafter [optional] -> specify the gaps to the heading and following paragraphs\n\n\
-firstindent [optional] -> the indent of the first line\n\n\
-hasdropcap [optional] -> specifies if there are caps (1 = yes, 0 = no)\n\n\
-dropcaplines [optional] -> height (in lines) of the caps if used\n\n\
-dropcapoffset [optional] -> offset of the caps if used\n\n\
-\"charstyle\" [optional] -> char style to use\n\n\
-"));
-/*! 02.01.2007 - 05.01.2007 : Joachim Neu : Create a paragraph style.
-  		Special thanks go to avox for helping me! */
-PyObject *scribus_createparagraphstyle(PyObject * /* self */, PyObject* args, PyObject* keywords);
-
-/* CHAR STYLES */
-
-/*! docstring */
-PyDoc_STRVAR(scribus_createcharstyle__doc__,
-QT_TR_NOOP("createCharStyle(...)\n\n\
-Creates a character style. This function takes the following keyword parameters:\n\n\
-\"name\" [required] -> name of the char style to create\n\n\
-\"font\" [optional] -> name of the font to use\n\n\
-fontsize [optional] -> font size to set (double)\n\n\
-\"features\" [optional] -> nearer typographic details can be defined by a string that might contain the following phrases comma-seperated (without spaces!):\n\n\
--> inherit\n\n\
--> bold\n\n\
--> italic\n\n\
--> underline\n\n\
--> underlinewords\n\n\
--> strike\n\n\
--> superscript\n\n\
--> subscript\n\n\
--> outline\n\n\
--> shadowed\n\n\
--> allcaps\n\n\
--> smallcaps\n\n\
-\"fillcolor\" [optional], \"fillshade\" [optional] -> specify fill options\n\n\
-\"strokecolor\" [optional], \"strokeshade\" [optional] -> specify stroke options\n\n\
-baselineoffset [optional] -> offset of the baseline\n\n\
-shadowxoffset [optional], shadowyoffset [optional] -> offset of the shadow if used\n\n\
-outlinewidth [optional] -> width of the outline if used\n\n\
-underlineoffset [optional], underlinewidth [optional] -> underline options if used\n\n\
-strikethruoffset [optional], strikethruwidth [optional] -> strikethru options if used\n\n\
-scaleh [optional], scalev [optional] -> scale of the chars\n\n\
-tracking [optional] -> tracking of the text\n\n\
-\"language\" [optional] -> language code\n\n\
-"));
-/*! 03.01.2007 - 05.01.2007 : Joachim Neu : Create a char style. 
-  		Special thanks go to avox for helping me! */
-PyObject *scribus_createcharstyle(PyObject * /* self */, PyObject* args, PyObject* keywords);
-
-#endif
-
+/*
+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.
+02.01.2008: Joachim Neu - joachim_neu at web.de - http://www.joachim-neu.de
+*/
+#ifndef CMDSTYLE_H
+#define CMDSTYLE_H
+
+// Pulls in <Python.h> first
+#include "cmdvar.h"
+//Added by qt3to4:
+#include <QPixmap>
+
+/** Style-related Commands */
+
+/* PARAGRAPH STYLES */
+
+/*! docstring */
+PyDoc_STRVAR(scribus_createparagraphstyle__doc__,
+QT_TR_NOOP("createParagraphStyle(...)\n\n\
+Creates a paragraph style. This function takes the following keyword parameters:\n\n\
+\"name\" [required] -> specifies the name of the paragraphstyle to create\n\n\
+linespacingmode [optional] -> specifies the linespacing mode; possible modes are:\n\n\
+fixed linespacing:          0\n\n\
+automatic linespacing:      1\n\n\
+baseline grid linespacing:  2\n\n\
+linespacing [optional] -> specifies the linespacing if using fixed linespacing\n\n\
+alignment [optional] -> specifies the alignment of the paragraph\n\n\
+-> left:     0\n\n\
+-> center:   1\n\n\
+-> right:    2\n\n\
+-> justify:  3\n\n\
+-> extend:   4\n\n\
+leftmargin [optional], rightmargin [optional] -> specify the margin\n\n\
+gapbefore [optional], gapafter [optional] -> specify the gaps to the heading and following paragraphs\n\n\
+firstindent [optional] -> the indent of the first line\n\n\
+hasdropcap [optional] -> specifies if there are caps (1 = yes, 0 = no)\n\n\
+dropcaplines [optional] -> height (in lines) of the caps if used\n\n\
+dropcapoffset [optional] -> offset of the caps if used\n\n\
+\"charstyle\" [optional] -> char style to use\n\n\
+"));
+/*! 02.01.2007 - 05.01.2007 : Joachim Neu : Create a paragraph style.
+  		Special thanks go to avox for helping me! */
+PyObject *scribus_createparagraphstyle(PyObject * /* self */, PyObject* args, PyObject* keywords);
+
+/* CHAR STYLES */
+
+/*! docstring */
+PyDoc_STRVAR(scribus_createcharstyle__doc__,
+QT_TR_NOOP("createCharStyle(...)\n\n\
+Creates a character style. This function takes the following keyword parameters:\n\n\
+\"name\" [required] -> name of the char style to create\n\n\
+\"font\" [optional] -> name of the font to use\n\n\
+fontsize [optional] -> font size to set (double)\n\n\
+\"features\" [optional] -> nearer typographic details can be defined by a string that might contain the following phrases comma-seperated (without spaces!):\n\n\
+-> inherit\n\n\
+-> bold\n\n\
+-> italic\n\n\
+-> underline\n\n\
+-> underlinewords\n\n\
+-> strike\n\n\
+-> superscript\n\n\
+-> subscript\n\n\
+-> outline\n\n\
+-> shadowed\n\n\
+-> allcaps\n\n\
+-> smallcaps\n\n\
+\"fillcolor\" [optional], \"fillshade\" [optional] -> specify fill options\n\n\
+\"strokecolor\" [optional], \"strokeshade\" [optional] -> specify stroke options\n\n\
+baselineoffset [optional] -> offset of the baseline\n\n\
+shadowxoffset [optional], shadowyoffset [optional] -> offset of the shadow if used\n\n\
+outlinewidth [optional] -> width of the outline if used\n\n\
+underlineoffset [optional], underlinewidth [optional] -> underline options if used\n\n\
+strikethruoffset [optional], strikethruwidth [optional] -> strikethru options if used\n\n\
+scaleh [optional], scalev [optional] -> scale of the chars\n\n\
+tracking [optional] -> tracking of the text\n\n\
+\"language\" [optional] -> language code\n\n\
+"));
+/*! 03.01.2007 - 05.01.2007 : Joachim Neu : Create a char style. 
+  		Special thanks go to avox for helping me! */
+PyObject *scribus_createcharstyle(PyObject * /* self */, PyObject* args, PyObject* keywords);
+
+/* LINE STYLES */
+
+/*! docstring */
+PyDoc_STRVAR(scribus_createcustomlinestyle__doc__,
+QT_TR_NOOP("createCustomLineStyle(styleName, style)\n\n\
+Creates the custom line style 'styleName'.\n\n\
+styleName -> name of the custom line style to create\n\n\
+This function takes list of dictionary\n\
+as parameter for \"style\". Each dictionary represent\n\
+one subline within style. Dictionary can have those keys:\n\n\
+\tColor [optional] -> name of the color to use (string)\n\n\
+\tDash [optional] -> type of line to use (integer)\n\n\
+\tLineEnd [optional] -> type of LineEnd to use (integer)\n\n\
+\tLineJoin [optional] -> type of LineJoin to use (integer)\n\n\
+\tShade [optional] -> opacity of line (integer)\n\n\
+\tWidth [optional] -> width of line (double)\n\
+"));
+PyObject *scribus_createcustomlinestyle(PyObject * /* self */, PyObject* args);
+
+#endif
+

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22205&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp	Thu Oct 26 18:04:00 2017
@@ -320,6 +320,7 @@
 	{const_cast<char*>("createTable"), scribus_newtable, METH_VARARGS, tr(scribus_newtable__doc__)},
 	{const_cast<char*>("createParagraphStyle"), (PyCFunction)scribus_createparagraphstyle, METH_KEYWORDS, tr(scribus_createparagraphstyle__doc__)},
 	{const_cast<char*>("createCharStyle"), (PyCFunction)scribus_createcharstyle, METH_KEYWORDS, tr(scribus_createcharstyle__doc__)},
+	{const_cast<char*>("createCustomLineStyle"), scribus_createcustomlinestyle, METH_VARARGS, tr(scribus_createcustomlinestyle__doc__)},
 	{const_cast<char*>("currentPage"), (PyCFunction)scribus_actualpage, METH_NOARGS, tr(scribus_actualpage__doc__)},
 	{const_cast<char*>("defineColor"), scribus_newcolor, METH_VARARGS, tr(scribus_newcolor__doc__)},
 	{const_cast<char*>("defineColorRGB"), scribus_newcolorrgb, METH_VARARGS, tr(scribus_newcolorrgb__doc__)},
@@ -354,6 +355,7 @@
 	{const_cast<char*>("getColumnGap"), scribus_getcolumngap, METH_VARARGS, tr(scribus_getcolumngap__doc__)},
 	{const_cast<char*>("getColumns"), scribus_getcolumns, METH_VARARGS, tr(scribus_getcolumns__doc__)},
 	{const_cast<char*>("getCornerRadius"), scribus_getcornerrad, METH_VARARGS, tr(scribus_getcornerrad__doc__)},
+	{const_cast<char*>("getCustomLineStyle"), scribus_getcustomlinestyle, METH_VARARGS, tr(scribus_getcustomlinestyle__doc__)},
 	{const_cast<char*>("getFillColor"), scribus_getfillcolor, METH_VARARGS, tr(scribus_getfillcolor__doc__)},
 	{const_cast<char*>("getFillShade"), scribus_getfillshade, METH_VARARGS, tr(scribus_getfillshade__doc__)},
 	{const_cast<char*>("getFillBlendmode"), scribus_getfillblend, METH_VARARGS, tr(scribus_getfillblend__doc__)},
@@ -490,6 +492,7 @@
 	{const_cast<char*>("setColumns"), scribus_setcolumns, METH_VARARGS, tr(scribus_setcolumns__doc__)},
 	{const_cast<char*>("setCornerRadius"), scribus_setcornerrad, METH_VARARGS, tr(scribus_setcornerrad__doc__)},
 	{const_cast<char*>("setCursor"), scribus_setcursor, METH_VARARGS, tr(scribus_setcursor__doc__)},
+	{const_cast<char*>("setCustomLineStyle"), scribus_setcustomlinestyle, METH_VARARGS, tr(scribus_setcustomlinestyle__doc__)},
 	{const_cast<char*>("setDocType"), scribus_setdoctype, METH_VARARGS, tr(scribus_setdoctype__doc__)},
 	{const_cast<char*>("setFillColor"), scribus_setfillcolor, METH_VARARGS, tr(scribus_setfillcolor__doc__)},
 	{const_cast<char*>("setFillTransparency"), scribus_setfilltrans, METH_VARARGS, tr(scribus_setfilltrans__doc__)},




More information about the scribus-commit mailing list