Author: jghali
Date: Thu Apr 4 17:44:08 2019
New Revision: 22929
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22929
Log:
#15630: Document scripter's getCharStyles()
Modified:
trunk/Scribus/doc/de/scripterapi-object.html
trunk/Scribus/doc/en/scripterapi-object.html
trunk/Scribus/doc/fr/scripterapi-object.html
trunk/Scribus/doc/it/scripterapi-object.html
trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
Modified: trunk/Scribus/doc/de/scripterapi-object.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22929&path=/trunk/Scribus/doc/de/scripterapi-object.html
==============================================================================
--- trunk/Scribus/doc/de/scripterapi-object.html (original)
+++ trunk/Scribus/doc/de/scripterapi-object.html Thu Apr 4 17:44:08 2019
@@ -15,10 +15,10 @@
<dd><code>createCharStyle(...)</code>
<p>Creates a character style. This function takes the following keyword
parameters:
<ul>
-<li>"name" [required] -> name of the char style to create</li>
-<li>"font" [optional] -> name of the font to use</li>
-<li>fontsize [optional] -> font size to set (double)</li>
-<li>"features" [optional] -> nearer typographic details can be defined by a
string that might contain the following phrases comma-seperated (without
spaces!):
+<li>"name" [required] -> name of the char style to create (first
parameter)</li>
+<li>"font" [optional] -> name of the font to use (second parameter)</li>
+<li>fontsize [optional] -> font size to set (double) (third parameter)</li>
+<li>"features" [optional] -> nearer typographic details can be defined by a
string that might contain the following phrases comma-separated (without
spaces!) (fourth parameter - a string):
<ul>
<li>inherit</li>
<li>bold</li>
@@ -34,16 +34,32 @@
<li>smallcaps</li>
</ul>
</li>
-<li>"fillcolor" [optional], "fillshade" [optional] -> specify fill options</li>
-<li>"strokecolor" [optional], "strokeshade" [optional] -> specify stroke
options</li>
-<li>baselineoffset [optional] -> offset of the baseline</li>
-<li>shadowxoffset [optional], shadowyoffset [optional] -> offset of the shadow
if used</li>
-<li>outlinewidth [optional] -> width of the outline if used</li>
-<li>underlineoffset [optional], underlinewidth [optional] -> underline options
if used</li>
-<li>strikethruoffset [optional], strikethruwidth [optional] -> strikethru
options if used</li>
-<li>scaleh [optional], scalev [optional] -> scale of the chars</li>
-<li>tracking [optional] -> tracking of the text</li>
-<li>"language" [optional] -> language code</li>
+<li>"fillcolor" [optional], fillshade [optional] -> specify fill options (5th
and 6th parameters - 5th is string, 6th is float 1.0 = 100%)</li>
+<li>"strokecolor" [optional], strokeshade [optional] -> specify stroke options
(7th and 8th parameters - 7th is string, 8th is float 1.0 = 100%)</li>
+<li>baselineoffset [optional] -> offset of the baseline (ninth parameter)</li>
+<li>shadowxoffset [optional], shadowyoffset [optional] -> offset of the shadow
if used (10th and 11th parameters)</li>
+<li>outlinewidth [optional] -> width of the outline if used (12th
parameter)</li>
+<li>underlineoffset [optional], underlinewidth [optional] -> underline options
if used (13th and 14th parameters)</li>
+<li>strikethruoffset [optional], strikethruwidth [optional] -> strikethru
options if used (15th and 16th parameters)</li>
+<li>scaleh [optional], scalev [optional] -> scale of the chars (17th and 18th
parameters - float values, 1.0 = 100%)</li>
+<li>tracking [optional] -> tracking of the text (19th parameter - number with
odd math, e.g. -50 = -5.0%)</li>
+<li>"language" [optional] -> language code (20th parameter - a string en =
English)</li>
+</ul>
+</p>
+<p>On a practical level, this is a challenging command to fully understand if
you wish to assign a number of settings, since keeping track of where you are,
and which kind of entry is needed (string vs number) is not easy. For some
guidance on this showing in particular how to set tracking, see the wiki page
<a href="https://wiki.scribus.net/canvas/Text_and_Text_Manipulation">Text and
Text Manipulation</a>.</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>
@@ -99,6 +115,10 @@
<li>"charstyle" [optional] -> char style to use</li>
</ul>
</p>
+<p>If you wish to skip a number of settings, unfortunately, this command will
not accept null values, i.e., a series of commas. You <i>must</i> put some
integer value for each of the potential parameters. For example, imagine you
wish to only specify a name for the Paragraph Style, and the Character Style.
Your command should be something like:</p>
+<p><strong>scribus.createParagraphStyle("MyNewStyle",0,0,0,0,0,0,0,0,0,"MyCharStyle")</strong></p>
+<p>On the other hand, if you only wanted to specify a name and linespacing
mode, you can quit whenever after you finished with non-zero data:</p>
+<p><strong>scribus.createParagraphStyle("MyOtherNewStyle",1)</strong></p>
</dd>
<dt><a name="-createPathText"><strong>createPathText</strong></a>(...)</dt>
@@ -133,6 +153,14 @@
<dt><a name="-getAllStyles"><strong>getAllStyles</strong></a>(...)</dt>
<dd><code>getAllStyles() -> list</code>
+<p>Deprecated, use getParagraphStyles() instead.</p></dd>
+
+<dt><a name="-getCharStyles"><strong>getCharStyles</strong></a>(...)</dt>
+<dd><code>getCharStyles() -> list</code>
+<p>Return a list of the names of all character styles in the current
document.</p></dd>
+
+<dt><a
name="-getParagraphStyles"><strong>getParagraphStyles</strong></a>(...)</dt>
+<dd><code>getParagraphStyles() -> list</code>
<p>Return a list of the names of all paragraph styles in the current
document.</p></dd>
<dt><a name="-objectExists"><strong>objectExists</strong></a>(...)</dt>
Modified: trunk/Scribus/doc/en/scripterapi-object.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22929&path=/trunk/Scribus/doc/en/scripterapi-object.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-object.html (original)
+++ trunk/Scribus/doc/en/scripterapi-object.html Thu Apr 4 17:44:08 2019
@@ -153,6 +153,14 @@
<dt><a name="-getAllStyles"><strong>getAllStyles</strong></a>(...)</dt>
<dd><code>getAllStyles() -> list</code>
+<p>Deprecated, use getParagraphStyles() instead.</p></dd>
+
+<dt><a name="-getCharStyles"><strong>getCharStyles</strong></a>(...)</dt>
+<dd><code>getCharStyles() -> list</code>
+<p>Return a list of the names of all character styles in the current
document.</p></dd>
+
+<dt><a
name="-getParagraphStyles"><strong>getParagraphStyles</strong></a>(...)</dt>
+<dd><code>getParagraphStyles() -> list</code>
<p>Return a list of the names of all paragraph styles in the current
document.</p></dd>
<dt><a name="-objectExists"><strong>objectExists</strong></a>(...)</dt>
Modified: trunk/Scribus/doc/fr/scripterapi-object.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22929&path=/trunk/Scribus/doc/fr/scripterapi-object.html
==============================================================================
--- trunk/Scribus/doc/fr/scripterapi-object.html (original)
+++ trunk/Scribus/doc/fr/scripterapi-object.html Thu Apr 4 17:44:08 2019
@@ -79,8 +79,15 @@
<dt><a name="-getAllStyles"><strong>getAllStyles</strong></a>(...)</dt>
<dd><tt>getAllStyles() -> liste</tt>
-<p>Retourne une liste des noms de tous les styles de paragraphe
-du document courant.</p></dd>
+<p>Obsolète. Veuillez utiliser getParagraphStyles() en lieu et
place.</p></dd>
+
+<dt><a name="-getCharStyles"><strong>getCharStyles</strong></a>(...)</dt>
+<dd><tt>getCharStyles() -> liste</tt>
+<p>Retourne une liste des noms de l'ensemble des styles de caractère du
document courant.</p></dd>
+
+<dt><a
name="-getParagraphStyles"><strong>getParagraphStyles</strong></a>(...)</dt>
+<dd><tt>getParagraphStyles() -> liste</tt>
+<p>Retourne une liste des noms de l'ensemble des styles de paragraphe du
document courant.</p></dd>
<dt><a name="-objectExists"><strong>objectExists</strong></a>(...)</dt>
<dd><tt>objectExists(["nom"]) -> booléen</tt>
Modified: trunk/Scribus/doc/it/scripterapi-object.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22929&path=/trunk/Scribus/doc/it/scripterapi-object.html
==============================================================================
--- trunk/Scribus/doc/it/scripterapi-object.html (original)
+++ trunk/Scribus/doc/it/scripterapi-object.html Thu Apr 4 17:44:08 2019
@@ -1,141 +1,172 @@
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <title>Creating and Destroying Objects</title>
-</head>
-<body>
-<h2>Creating and Destroying Objects</h2>
-
-<dl>
-
-<dt><a name="-createCharStyle"><strong>createCharStyle</strong></a>(...)</dt>
-<dd><code>createCharStyle(...)</code>
-<p>Creates a character style. This function takes the following keyword
parameters:
-<ul>
-<li>"name" [required] -> name of the char style to create</li>
-<li>"font" [optional] -> name of the font to use</li>
-<li>fontsize [optional] -> font size to set (double)</li>
-<li>"features" [optional] -> nearer typographic details can be defined by a
string that might contain the following phrases comma-seperated (without
spaces!):
-<ul>
- <li>inherit</li>
- <li>bold</li>
- <li>italic</li>
- <li>underline</li>
- <li>underlinewords</li>
- <li>strike</li>
- <li>superscript</li>
- <li>subscript</li>
- <li>outline</li>
- <li>shadowed</li>
- <li>allcaps</li>
- <li>smallcaps</li>
-</ul>
-</li>
-<li>"fillcolor" [optional], "fillshade" [optional] -> specify fill options</li>
-<li>"strokecolor" [optional], "strokeshade" [optional] -> specify stroke
options</li>
-<li>baselineoffset [optional] -> offset of the baseline</li>
-<li>shadowxoffset [optional], shadowyoffset [optional] -> offset of the shadow
if used</li>
-<li>outlinewidth [optional] -> width of the outline if used</li>
-<li>underlineoffset [optional], underlinewidth [optional] -> underline options
if used</li>
-<li>strikethruoffset [optional], strikethruwidth [optional] -> strikethru
options if used</li>
-<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="-createBezierLine"><strong>createBezierLine</strong></a>(...)</dt>
-<dd><code>createBezierLine(list, ["name"]) -> string</code>
-<p>Creates a new bezier curve and returns its name. The points for the bezier
curve are stored in the list "list" in the following order: [x1, y1, kx1, ky1,
x2, y2, kx2, ky2...xn. yn, kxn. kyn] In the points list, x and y mean the x and
y coordinates of the point and kx and ky meaning the control point for the
curve. The coordinates are given in the current measurement units of the
document (see UNIT constants). "name" should be a unique identifier for the
object because you need this name for further access to that object. If "name"
is not given Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used. May raise ValueError if an
insufficient number of points is passed or if the number of values passed don't
group into points without leftovers.</p></dd>
-
-<dt><a name="-createEllipse"><strong>createEllipse</strong></a>(...)</dt>
-<dd><code>createEllipse(x, y, width, height, ["name"]) -> string</code>
-<p>Creates a new ellipse on the current page and returns its name. The
coordinates are given in the current measurement units of the document (see
UNIT constants). "name" should be a unique identifier for the object because
you need this name for further referencing of that object. If "name" is not
given Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd></dt>
-
-<dt><a name="-createImage"><strong>createImage</strong></a>(...)</dt>
-<dd><code>createImage(x, y, width, height, ["name"]) -> string</code>
-<p>Creates a new picture frame on the current page and returns its name. The
coordinates are given in the current measurement units of the document. "name"
should be a unique identifier for the object because you need this name for
further access to that object. If "name" is not given Scribus will create one
for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
-
-<dt><a name="-createLine"><strong>createLine</strong></a>(...)</dt>
-<dd><code>createLine(x1, y1, x2, y2, ["name"]) -> string</code>
-<p>Creates a new line from the point(x1, y1) to the point(x2, y2) and returns
its name. The coordinates are given in the current measurement unit of the
document (see UNIT constants). "name" should be a unique identifier for the
object because you need this name for further access to that object. If "name"
is not given Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
-
-<dt><a
name="-createParagraphStyle"><strong>createParagraphStyle</strong></a>(...)</dt>
-<dd><code>createParagraphStyle(...)</code>
-<p>Creates a paragraph style. This function takes the following keyword
parameters:
-<ul>
-<li>"name" [required] -> specifies the name of the paragraphstyle to
create</li>
-<li>linespacingmode [optional] -> specifies the linespacing mode; possible
modes are:
-<ul>
- <li>fixed linespacing: 0</li>
- <li>automatic linespacing: 1</li>
- <li>baseline grid linespacing: 2</li>
-</ul>
-</li>
-<li>linespacing [optional] -> specifies the linespacing if using fixed
linespacing</li>
-<li>alignment [optional] -> specifies the alignment of the paragraph
-<ul>
- <li>left: 0</li>
- <li>center: 1</li>
- <li>right: 2</li>
- <li>justify: 3</li>
- <li>extend: 4</li>
-</ul>
-</li>
-<li>leftmargin [optional], rightmargin [optional] -> specify the margin</li>
-<li>gapbefore [optional], gapafter [optional] -> specify the gaps to the
heading and following paragraphs</li>
-<li>firstindent [optional] -> the indent of the first line</li>
-<li>hasdropcap [optional] -> specifies if there are caps (1 = yes, 0 = no)</li>
-<li>dropcaplines [optional] -> height (in lines) of the caps if used</li>
-<li>dropcapoffset [optional] -> offset of the caps if used</li>
-<li>"charstyle" [optional] -> char style to use</li>
-</ul>
-</p>
-</dd>
-
-<dt><a name="-createPathText"><strong>createPathText</strong></a>(...)</dt>
-<dd><code>createPathText(x, y, "textbox", "beziercurve", ["name"]) ->
string</code>
-<p>Creates a new pathText by merging the two objects "textbox" and
"beziercurve" and returns its name. The coordinates are given in the current
measurement unit of the document (see UNIT constants). "name" should be a
unique identifier for the object because you need this name for further access
to that object. If "name" is not given Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.
-May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if one or
both of the named base object don't exist.</p></dd>
-
-<dt><a name="-createPolyLine"><strong>createPolyLine</strong></a>(...)</dt>
-<dd><code>createPolyLine(list, ["name"]) -> string</code>
-<p>Creates a new polyline and returns its name. The points for the polyline
are stored in the list "list" in the following order: [x1, y1, x2, y2...xn.
yn]. The coordinates are given in the current measurement units of the document
(see UNIT constants). "name" should be a unique identifier for the object
because you need this name for further access to that object. If "name" is not
given Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used. May raise ValueError if an
insufficient number of points is passed or if the number of values passed don't
group into points without leftovers.</p></dd>
-
-<dt><a name="-createPolygon"><strong>createPolygon</strong></a>(...)</dt>
-<dd><code>createPolygon(list, ["name"]) -> string</code>
-<p>Creates a new polygon and returns its name. The points for the polygon are
stored in the list "list" in the following order: [x1, y1, x2, y2...xn. yn]. At
least three points are required. There is no need to repeat the first point to
close the polygon. The polygon is automatically closed by connecting the first
and the last point. The coordinates are given in the current measurement units
of the document (see UNIT constants). "name" should be a unique identifier for
the object because you need this name for further access to that object. If
"name" is not given Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used. May raise ValueError if an
insufficient number of points is passed or if the number of values passed don't
group into points without leftovers.</p></dd>
-
-<dt><a name="-createRect"><strong>createRect</strong></a>(...)</dt>
-<dd><code>createRect(x, y, width, height, ["name"]) -> string</code>
-<p>Creates a new rectangle on the current page and returns its name. The
coordinates are given in the current measurement units of the document (see
UNIT constants). "name" should be a unique identifier for the object because
you need this name to reference that object in future. If "name" is not given
Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
-
-<dt><a name="-createText"><strong>createText</strong></a>(...)</dt>
-<dd><code>createText(x, y, width, height, ["name"]) -> string</code>
-<p>Creates a new text frame on the actual page and returns its name. The
coordinates are given in the actual measurement unit of the document (see UNIT
constants). "name" should be a unique identifier for the object because you
need this name for further referencing of that object. If "name" is not given
Scribus will create one for you.</p>
-<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
-
-<dt><a name="-deleteObject"><strong>deleteObject</strong></a>(...)</dt>
-<dd><code>deleteObject(["name"])</code>
-<p>Deletes the item with the name "name". If "name" is not given the currently
selected item is deleted.</p></dd>
-
-<dt><a name="-getAllStyles"><strong>getAllStyles</strong></a>(...)</dt>
-<dd><code>getAllStyles() -> list</code>
-<p>Return a list of the names of all paragraph styles in the current
document.</p></dd>
-
-<dt><a name="-objectExists"><strong>objectExists</strong></a>(...)</dt>
-<dd><code>objectExists(["name"]) -> bool</code>
-<p>Test if an object with specified name really exists in the document. The
optional parameter is the object name. When no object name is given, returns
True if there is something selected.</p></dd>
-
-</dl>
-</body>
-</html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>Creating and Destroying Objects</title>
+</head>
+<style>
+@import "manual.css";
+</style>
+<body>
+<h2>Creating and Destroying Objects</h2>
+
+<dl>
+
+<dt><a name="-createCharStyle"><strong>createCharStyle</strong></a>(...)</dt>
+<dd><code>createCharStyle(...)</code>
+<p>Creates a character style. This function takes the following keyword
parameters:
+<ul>
+<li>"name" [required] -> name of the char style to create (first
parameter)</li>
+<li>"font" [optional] -> name of the font to use (second parameter)</li>
+<li>fontsize [optional] -> font size to set (double) (third parameter)</li>
+<li>"features" [optional] -> nearer typographic details can be defined by a
string that might contain the following phrases comma-separated (without
spaces!) (fourth parameter - a string):
+<ul>
+ <li>inherit</li>
+ <li>bold</li>
+ <li>italic</li>
+ <li>underline</li>
+ <li>underlinewords</li>
+ <li>strike</li>
+ <li>superscript</li>
+ <li>subscript</li>
+ <li>outline</li>
+ <li>shadowed</li>
+ <li>allcaps</li>
+ <li>smallcaps</li>
+</ul>
+</li>
+<li>"fillcolor" [optional], fillshade [optional] -> specify fill options (5th
and 6th parameters - 5th is string, 6th is float 1.0 = 100%)</li>
+<li>"strokecolor" [optional], strokeshade [optional] -> specify stroke options
(7th and 8th parameters - 7th is string, 8th is float 1.0 = 100%)</li>
+<li>baselineoffset [optional] -> offset of the baseline (ninth parameter)</li>
+<li>shadowxoffset [optional], shadowyoffset [optional] -> offset of the shadow
if used (10th and 11th parameters)</li>
+<li>outlinewidth [optional] -> width of the outline if used (12th
parameter)</li>
+<li>underlineoffset [optional], underlinewidth [optional] -> underline options
if used (13th and 14th parameters)</li>
+<li>strikethruoffset [optional], strikethruwidth [optional] -> strikethru
options if used (15th and 16th parameters)</li>
+<li>scaleh [optional], scalev [optional] -> scale of the chars (17th and 18th
parameters - float values, 1.0 = 100%)</li>
+<li>tracking [optional] -> tracking of the text (19th parameter - number with
odd math, e.g. -50 = -5.0%)</li>
+<li>"language" [optional] -> language code (20th parameter - a string en =
English)</li>
+</ul>
+</p>
+<p>On a practical level, this is a challenging command to fully understand if
you wish to assign a number of settings, since keeping track of where you are,
and which kind of entry is needed (string vs number) is not easy. For some
guidance on this showing in particular how to set tracking, see the wiki page
<a href="https://wiki.scribus.net/canvas/Text_and_Text_Manipulation">Text and
Text Manipulation</a>.</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>
+
+<dt><a name="-createBezierLine"><strong>createBezierLine</strong></a>(...)</dt>
+<dd><code>createBezierLine(list, ["name"]) -> string</code>
+<p>Creates a new bezier curve and returns its name. The points for the bezier
curve are stored in the list "list" in the following order: [x1, y1, kx1, ky1,
x2, y2, kx2, ky2...xn. yn, kxn. kyn] In the points list, x and y mean the x and
y coordinates of the point and kx and ky meaning the control point for the
curve. The coordinates are given in the current measurement units of the
document (see UNIT constants). "name" should be a unique identifier for the
object because you need this name for further access to that object. If "name"
is not given Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used. May raise ValueError if an
insufficient number of points is passed or if the number of values passed don't
group into points without leftovers.</p></dd>
+
+<dt><a name="-createEllipse"><strong>createEllipse</strong></a>(...)</dt>
+<dd><code>createEllipse(x, y, width, height, ["name"]) -> string</code>
+<p>Creates a new ellipse on the current page and returns its name. The
coordinates are given in the current measurement units of the document (see
UNIT constants). "name" should be a unique identifier for the object because
you need this name for further referencing of that object. If "name" is not
given Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd></dt>
+
+<dt><a name="-createImage"><strong>createImage</strong></a>(...)</dt>
+<dd><code>createImage(x, y, width, height, ["name"]) -> string</code>
+<p>Creates a new picture frame on the current page and returns its name. The
coordinates are given in the current measurement units of the document. "name"
should be a unique identifier for the object because you need this name for
further access to that object. If "name" is not given Scribus will create one
for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
+
+<dt><a name="-createLine"><strong>createLine</strong></a>(...)</dt>
+<dd><code>createLine(x1, y1, x2, y2, ["name"]) -> string</code>
+<p>Creates a new line from the point(x1, y1) to the point(x2, y2) and returns
its name. The coordinates are given in the current measurement unit of the
document (see UNIT constants). "name" should be a unique identifier for the
object because you need this name for further access to that object. If "name"
is not given Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
+
+<dt><a
name="-createParagraphStyle"><strong>createParagraphStyle</strong></a>(...)</dt>
+<dd><code>createParagraphStyle(...)</code>
+<p>Creates a paragraph style. This function takes the following keyword
parameters:
+<ul>
+<li>"name" [required] -> specifies the name of the paragraphstyle to
create</li>
+<li>linespacingmode [optional] -> specifies the linespacing mode; possible
modes are:
+<ul>
+ <li>fixed linespacing: 0</li>
+ <li>automatic linespacing: 1</li>
+ <li>baseline grid linespacing: 2</li>
+</ul>
+</li>
+<li>linespacing [optional] -> specifies the linespacing if using fixed
linespacing</li>
+<li>alignment [optional] -> specifies the alignment of the paragraph
+<ul>
+ <li>left: 0</li>
+ <li>center: 1</li>
+ <li>right: 2</li>
+ <li>justify: 3</li>
+ <li>extend: 4</li>
+</ul>
+</li>
+<li>leftmargin [optional], rightmargin [optional] -> specify the margin</li>
+<li>gapbefore [optional], gapafter [optional] -> specify the gaps to the
heading and following paragraphs</li>
+<li>firstindent [optional] -> the indent of the first line</li>
+<li>hasdropcap [optional] -> specifies if there are caps (1 = yes, 0 = no)</li>
+<li>dropcaplines [optional] -> height (in lines) of the caps if used</li>
+<li>dropcapoffset [optional] -> offset of the caps if used</li>
+<li>"charstyle" [optional] -> char style to use</li>
+</ul>
+</p>
+<p>If you wish to skip a number of settings, unfortunately, this command will
not accept null values, i.e., a series of commas. You <i>must</i> put some
integer value for each of the potential parameters. For example, imagine you
wish to only specify a name for the Paragraph Style, and the Character Style.
Your command should be something like:</p>
+<p><strong>scribus.createParagraphStyle("MyNewStyle",0,0,0,0,0,0,0,0,0,"MyCharStyle")</strong></p>
+<p>On the other hand, if you only wanted to specify a name and linespacing
mode, you can quit whenever after you finished with non-zero data:</p>
+<p><strong>scribus.createParagraphStyle("MyOtherNewStyle",1)</strong></p>
+</dd>
+
+<dt><a name="-createPathText"><strong>createPathText</strong></a>(...)</dt>
+<dd><code>createPathText(x, y, "textbox", "beziercurve", ["name"]) ->
string</code>
+<p>Creates a new pathText by merging the two objects "textbox" and
"beziercurve" and returns its name. The coordinates are given in the current
measurement unit of the document (see UNIT constants). "name" should be a
unique identifier for the object because you need this name for further access
to that object. If "name" is not given Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.
+May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if one or
both of the named base object don't exist.</p></dd>
+
+<dt><a name="-createPolyLine"><strong>createPolyLine</strong></a>(...)</dt>
+<dd><code>createPolyLine(list, ["name"]) -> string</code>
+<p>Creates a new polyline and returns its name. The points for the polyline
are stored in the list "list" in the following order: [x1, y1, x2, y2...xn.
yn]. The coordinates are given in the current measurement units of the document
(see UNIT constants). "name" should be a unique identifier for the object
because you need this name for further access to that object. If "name" is not
given Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used. May raise ValueError if an
insufficient number of points is passed or if the number of values passed don't
group into points without leftovers.</p></dd>
+
+<dt><a name="-createPolygon"><strong>createPolygon</strong></a>(...)</dt>
+<dd><code>createPolygon(list, ["name"]) -> string</code>
+<p>Creates a new polygon and returns its name. The points for the polygon are
stored in the list "list" in the following order: [x1, y1, x2, y2...xn. yn]. At
least three points are required. There is no need to repeat the first point to
close the polygon. The polygon is automatically closed by connecting the first
and the last point. The coordinates are given in the current measurement units
of the document (see UNIT constants). "name" should be a unique identifier for
the object because you need this name for further access to that object. If
"name" is not given Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used. May raise ValueError if an
insufficient number of points is passed or if the number of values passed don't
group into points without leftovers.</p></dd>
+
+<dt><a name="-createRect"><strong>createRect</strong></a>(...)</dt>
+<dd><code>createRect(x, y, width, height, ["name"]) -> string</code>
+<p>Creates a new rectangle on the current page and returns its name. The
coordinates are given in the current measurement units of the document (see
UNIT constants). "name" should be a unique identifier for the object because
you need this name to reference that object in future. If "name" is not given
Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
+
+<dt><a name="-createText"><strong>createText</strong></a>(...)</dt>
+<dd><code>createText(x, y, width, height, ["name"]) -> string</code>
+<p>Creates a new text frame on the actual page and returns its name. The
coordinates are given in the actual measurement unit of the document (see UNIT
constants). "name" should be a unique identifier for the object because you
need this name for further referencing of that object. If "name" is not given
Scribus will create one for you.</p>
+<p>May raise <a href="scripterapi.html#NameExistsError">NameExistsError</a> if
you explicitly pass a name that's already used.</p></dd>
+
+<dt><a name="-deleteObject"><strong>deleteObject</strong></a>(...)</dt>
+<dd><code>deleteObject(["name"])</code>
+<p>Deletes the item with the name "name". If "name" is not given the currently
selected item is deleted.</p></dd>
+
+<dt><a name="-getAllStyles"><strong>getAllStyles</strong></a>(...)</dt>
+<dd><code>getAllStyles() -> list</code>
+<p>Deprecated, use getParagraphStyles() instead.</p></dd>
+
+<dt><a name="-getCharStyles"><strong>getCharStyles</strong></a>(...)</dt>
+<dd><code>getCharStyles() -> list</code>
+<p>Return a list of the names of all character styles in the current
document.</p></dd>
+
+<dt><a
name="-getParagraphStyles"><strong>getParagraphStyles</strong></a>(...)</dt>
+<dd><code>getParagraphStyles() -> list</code>
+<p>Return a list of the names of all paragraph styles in the current
document.</p></dd>
+
+<dt><a name="-objectExists"><strong>objectExists</strong></a>(...)</dt>
+<dd><code>objectExists(["name"]) -> bool</code>
+<p>Test if an object with specified name really exists in the document. The
optional parameter is the object name. When no object name is given, returns
True if there is something selected.</p></dd>
+
+</dl>
+</body>
+</html>
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22929&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp Thu Apr 4
17:44:08 2019
@@ -333,9 +333,10 @@
{const_cast<char*>("flipObject"), scribus_flipobject, METH_VARARGS,
tr(scribus_flipobject__doc__)},
{const_cast<char*>("getActiveLayer"), (PyCFunction)scribus_getactlayer,
METH_NOARGS, tr(scribus_getactlayer__doc__)},
{const_cast<char*>("getAllObjects"), (PyCFunction)scribus_getallobj,
METH_VARARGS|METH_KEYWORDS, tr(scribus_getallobj__doc__)},
- {const_cast<char*>("getAllStyles"), (PyCFunction)scribus_getstylenames,
METH_NOARGS, tr(scribus_getstylenames__doc__)},
+ {const_cast<char*>("getAllStyles"), (PyCFunction)scribus_getstylenames,
METH_NOARGS, tr(scribus_getstylenames__doc__)}, //Deprecated
+ {const_cast<char*>("getAllText"), scribus_gettext, METH_VARARGS,
tr(scribus_gettext__doc__)},
{const_cast<char*>("getCharStyles"),
(PyCFunction)scribus_getcharstylenames, METH_NOARGS,
tr(scribus_getcharstylenames__doc__)},
- {const_cast<char*>("getAllText"), scribus_gettext, METH_VARARGS,
tr(scribus_gettext__doc__)},
+ {const_cast<char*>("getParagraphStyles"),
(PyCFunction)scribus_getstylenames, METH_NOARGS,
tr(scribus_getstylenames__doc__)},
{const_cast<char*>("getCellStyle"), scribus_getcellstyle, METH_VARARGS,
tr(scribus_getcellstyle__doc__)},
{const_cast<char*>("getCellColumnSpan"), scribus_getcellcolumnspan,
METH_VARARGS, tr(scribus_getcellcolumnspan__doc__)},
{const_cast<char*>("getCellRowSpan"), scribus_getcellrowspan,
METH_VARARGS, tr(scribus_getcellrowspan__doc__)},
_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit