r22654 by jghali - #15403: scripter: add getStyle() for obtaining frame style
scribus-commit
scribus-commit at lists.scribus.net
Mon Aug 27 20:57:26 UTC 2018
Author: jghali
Date: Mon Aug 27 20:57:26 2018
New Revision: 22654
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22654
Log:
#15403: scripter: add getStyle() for obtaining frame style
Modified:
trunk/Scribus/doc/en/scripterapi-manobj.html
trunk/Scribus/doc/fr/scripterapi-manobj.html
trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
Modified: trunk/Scribus/doc/en/scripterapi-manobj.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22654&path=/trunk/Scribus/doc/en/scripterapi-manobj.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-manobj.html (original)
+++ trunk/Scribus/doc/en/scripterapi-manobj.html Mon Aug 27 20:57:26 2018
@@ -15,6 +15,12 @@
<dt><a name="-duplicateObject"><strong>duplicateObject</strong>(...)</a></dt>
<dd><code>duplicateObject(["name"]) -> string</code>
<p>creates a Duplicate of the selected Object (or Selection Group).</p></dd>
+
+<dt><a name="-getStyle"><strong>getStyle</strong></a>(...)</dt>
+<dd><code>getStyle(["name"])</code>
+<p>Return name of style applied to object named \"name\". If \"name\" is not given, the currently selected object is used.<p>
+<p>If current object has a text selection, the name of style applied to start of selection is returned. Otherwise the name of the item default style is returned.</p>
+<p>May raise WrongFrameTypeError.</p></dd>
<dt><a name="-groupObjects"><strong>groupObjects</strong></a>(...)</dt>
<dd><code>groupObjects(list)</code>
Modified: trunk/Scribus/doc/fr/scripterapi-manobj.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22654&path=/trunk/Scribus/doc/fr/scripterapi-manobj.html
==============================================================================
--- trunk/Scribus/doc/fr/scripterapi-manobj.html (original)
+++ trunk/Scribus/doc/fr/scripterapi-manobj.html Mon Aug 27 20:57:26 2018
@@ -7,6 +7,12 @@
<h2>Manipuler les objets</h2>
<dl>
+
+<dt><a name="-getStyle"><strong>getStyle</strong></a>(...)</dt>
+<dd><code><a href="#-getStyle">getStyle</a>(["nom"]) -> chaîne</code>
+<p>Retourne le nom du style appliqué à l'objet "nom". Si aucun nom d'objet n'est fourni, l'élément sélectionné est utilisé.</p>
+<p>Si l'objet courant possède une sélection de texte, le nom retourné est celui du style appliqué au début de la sélection. Sinon le nom retourné est celui du style appliqué par défaut.</p>
+<p>Peut générer WrongFrameTypeError.</p></dd>
<dt><a name="-groupObjects"><strong>groupObjects</strong></a>(...)</dt>
<dd><code><a href="#-groupObjects">groupObjects</a>(liste) -> chaîne</code>
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22654&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp Mon Aug 27 20:57:26 2018
@@ -24,7 +24,7 @@
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
// if (ItemExists(QString::fromUtf8(Name)))
// {
@@ -53,7 +53,7 @@
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Polygon, PageItem::Ellipse,
pageUnitXToDocX(x),
@@ -79,7 +79,7 @@
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified,
pageUnitXToDocX(x),
@@ -104,7 +104,7 @@
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified,
pageUnitXToDocX(x),
@@ -164,7 +164,7 @@
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
x = pageUnitXToDocX(x);
y = pageUnitYToDocY(y);
@@ -226,7 +226,7 @@
// FIXME: PyList_Check failing will cause the function to return nullptr w/o an exception. Separarate out the check.
if ((!PyArg_ParseTuple(args, "O|es", &il, "utf-8", &Name)) || (!PyList_Check(il)))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
int len = PyList_Size(il);
if (len < 4)
@@ -303,7 +303,7 @@
// FIXME: PyList_Check failing will cause the function to return nullptr w/o an exception. Separarate out the check.
if ((!PyArg_ParseTuple(args, "O|es", &il, "utf-8", &Name)) || (!PyList_Check(il)))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
int len = PyList_Size(il);
if (len < 6)
@@ -384,7 +384,7 @@
// FIXME: PyList_Check failing will cause the function to return nullptr w/o an exception. Separarate out the check.
if ((!PyArg_ParseTuple(args, "O|es", &il, "utf-8", &Name)) || (!PyList_Check(il)))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
int len = PyList_Size(il);
if (len < 8)
@@ -479,7 +479,7 @@
char *PolyB = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "ddeses|es", &x, &y, "utf-8", &TextB, "utf-8", &PolyB, "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
// if (ItemExists(QString::fromUtf8(Name)))
// {
@@ -517,7 +517,7 @@
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == nullptr)
@@ -540,7 +540,7 @@
if (!PyArg_ParseTuple(args, "es|i", "utf-8", &name, &state))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
PageItem *i = GetUniqueItem(QString::fromUtf8(name));
if (i == nullptr)
@@ -552,13 +552,13 @@
else
i->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
}
- else if( state == (int) PageItem::TextFlowDisabled )
+ else if (state == (int) PageItem::TextFlowDisabled )
i->setTextFlowMode(PageItem::TextFlowDisabled);
- else if( state == (int) PageItem::TextFlowUsesFrameShape )
+ else if (state == (int) PageItem::TextFlowUsesFrameShape )
i->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
- else if( state == (int) PageItem::TextFlowUsesBoundingBox )
+ else if (state == (int) PageItem::TextFlowUsesBoundingBox )
i->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
- else if( state == (int) PageItem::TextFlowUsesContourLine )
+ else if (state == (int) PageItem::TextFlowUsesContourLine )
i->setTextFlowMode(PageItem::TextFlowUsesContourLine);
ScCore->primaryMainWindow()->view->DrawNew();
ScCore->primaryMainWindow()->slotDocCh(true);
@@ -573,12 +573,52 @@
char* name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
if (ItemExists(QString::fromUtf8(name)))
return PyBool_FromLong(static_cast<long>(true));
return PyBool_FromLong(static_cast<long>(false));
}
+
+
+/*
+ * Vaclav Smilauer, 2017-21-21
+ * Return style name of the object (or currently selected object)
+ */
+PyObject *scribus_getstyle(PyObject* /* self */, PyObject* args)
+{
+ char *name = const_cast<char*>("");
+ if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
+ return NULL;
+ if (!checkHaveDocument())
+ return NULL;
+ PageItem *item = GetUniqueItem(QString::fromUtf8(name));
+ if (item == NULL)
+ return NULL;
+ if ((item->itemType() != PageItem::TextFrame) && (item->itemType() != PageItem::PathText))
+ {
+ PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get style of a non-text frame.", "python error").toLocal8Bit().constData());
+ return NULL;
+ }
+
+ int selectionLength = item->itemText.lengthOfSelection();
+ if (selectionLength > 0)
+ {
+ int selectionStart = item->itemText.startOfSelection();
+ const ParagraphStyle& currentStyle = item->itemText.paragraphStyle(selectionStart);
+ if (currentStyle.hasParent())
+ return PyString_FromString(currentStyle.parentStyle()->name().toUtf8());
+ }
+ else
+ {
+ const ParagraphStyle& itemDefaultStyle = item->itemText.defaultStyle();
+ if (itemDefaultStyle.hasParent())
+ return PyString_FromString(itemDefaultStyle.parentStyle()->name().toUtf8());
+ }
+ Py_RETURN_NONE;
+};
+
+
/*
* Craig Ringer, 2004-09-09
@@ -591,7 +631,7 @@
char *name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "es|es", "utf-8", &style, "utf-8", &name))
return nullptr;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == nullptr)
@@ -639,7 +679,7 @@
currentView->Deselect(true);
//CB I dont think we need to draw here. Its faster if we dont.
currentView->SelectItem(item, false);
- // Restore stext selection if necessary
+ // Restore text selection if necessary
if (selectionStart >= 0)
{
item->itemText.deselectAll();
@@ -723,7 +763,7 @@
currentView->Deselect(true);
//CB I dont think we need to draw here. Its faster if we dont.
currentView->SelectItem(item, false);
- // Restore stext selection if necessary
+ // Restore text selection if necessary
if (selectionStart >= 0)
{
item->itemText.deselectAll();
@@ -755,7 +795,7 @@
PyObject *scribus_getstylenames(PyObject* /* self */)
{
PyObject *styleList;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
styleList = PyList_New(0);
for (int i=0; i < ScCore->primaryMainWindow()->doc->paragraphStyles().count(); ++i)
@@ -772,7 +812,7 @@
PyObject *scribus_getcharstylenames(PyObject* /* self */)
{
PyObject *charStyleList;
- if(!checkHaveDocument())
+ if (!checkHaveDocument())
return nullptr;
charStyleList = PyList_New(0);
for (int i=0; i < ScCore->primaryMainWindow()->doc->charStyles().count(); ++i)
@@ -792,7 +832,7 @@
if (!PyArg_ParseTuple(args, "|es", "utf-8", &name)) {
return nullptr;
}
- if(!checkHaveDocument()) {
+ if (!checkHaveDocument()) {
return nullptr;
}
// Is there a special name given? Yes -> add this to selection
@@ -817,7 +857,7 @@
if (!PyArg_ParseTuple(args, "|es", "utf-8", &name)) {
return nullptr;
}
- if(!checkHaveDocument()) {
+ if (!checkHaveDocument()) {
return nullptr;
}
// Is there a special name given? Yes -> add this to selection
@@ -841,7 +881,7 @@
if (!PyArg_ParseTuple(args, "|es", "utf-8", &name)) {
return nullptr;
}
- if(!checkHaveDocument()) {
+ if (!checkHaveDocument()) {
return nullptr;
}
@@ -858,5 +898,5 @@
void cmdobjdocwarnings()
{
QStringList s;
- s << scribus_newrect__doc__ <<scribus_newellipse__doc__ << scribus_newimage__doc__ << scribus_newtext__doc__ << scribus_newtable__doc__ << scribus_newline__doc__ <<scribus_polyline__doc__ << scribus_polygon__doc__ << scribus_bezierline__doc__ <<scribus_pathtext__doc__ <<scribus_deleteobj__doc__ <<scribus_textflow__doc__ <<scribus_objectexists__doc__ <<scribus_setstyle__doc__ <<scribus_getstylenames__doc__ <<scribus_getcharstylenames__doc__ <<scribus_duplicateobject__doc__ <<scribus_copyobject__doc__ <<scribus_pasteobject__doc__;
-}
+ s << scribus_newrect__doc__ <<scribus_newellipse__doc__ << scribus_newimage__doc__ << scribus_newtext__doc__ << scribus_newtable__doc__ << scribus_newline__doc__ <<scribus_polyline__doc__ << scribus_polygon__doc__ << scribus_bezierline__doc__ <<scribus_pathtext__doc__ <<scribus_deleteobj__doc__ <<scribus_textflow__doc__ <<scribus_objectexists__doc__ <<scribus_getstyle__doc__ <<scribus_setstyle__doc__ <<scribus_getstylenames__doc__ <<scribus_getcharstylenames__doc__ <<scribus_duplicateobject__doc__ <<scribus_copyobject__doc__ <<scribus_pasteobject__doc__;
+}
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22654&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h Mon Aug 27 20:57:26 2018
@@ -234,6 +234,24 @@
*/
PyObject *scribus_objectexists(PyObject * /*self*/, PyObject* args);
+
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getstyle__doc__,
+QT_TR_NOOP("getStyle([\"name\"])\n\
+\n\
+Return name of style applied to object named \"name\". If \"name\" is not given,\n\
+the currently selected object is used. If current object has a text selection, \n\
+the name of style applied to start of selection is returned. Otherwise the name \n\
+of the item default style is returned.\n\
+"));
+/**
+ Vaclav Smilauer, 2017-12-21
+ Return style name of the object (or currently selected object)
+ */
+PyObject *scribus_getstyle(PyObject * /*self*/, PyObject* args);
+
+
/*! docstring */
PyDoc_STRVAR(scribus_setstyle__doc__,
QT_TR_NOOP("setStyle(\"style\" [, \"name\"])\n\
@@ -249,6 +267,7 @@
*/
PyObject *scribus_setstyle(PyObject * /*self*/, PyObject* args);
+
/*! docstring */
PyDoc_STRVAR(scribus_setcharstyle__doc__,
QT_TR_NOOP("setCharacterStyle(\"style\" [, \"name\"])\n\
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22654&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp Mon Aug 27 20:57:26 2018
@@ -402,6 +402,7 @@
{const_cast<char*>("getObjectAttributes"), scribus_getobjectattributes, METH_VARARGS, tr(scribus_getobjectattributes__doc__)},
{const_cast<char*>("getSelectedObject"), scribus_getselobjnam, METH_VARARGS, tr(scribus_getselobjnam__doc__)},
{const_cast<char*>("getSize"), scribus_getsize, METH_VARARGS, tr(scribus_getsize__doc__)},
+ {const_cast<char*>("getStyle"), scribus_getstyle, METH_VARARGS, tr(scribus_getstyle__doc__) },
{const_cast<char*>("getTableRows"), scribus_gettablerows, METH_VARARGS, tr(scribus_gettablerows__doc__)},
{const_cast<char*>("getTableRowHeight"), scribus_gettablerowheight, METH_VARARGS, tr(scribus_gettablerowheight__doc__)},
{const_cast<char*>("getTableColumns"), scribus_gettablecolumns, METH_VARARGS, tr(scribus_gettablecolumns__doc__)},
@@ -444,6 +445,8 @@
{const_cast<char*>("messageBox"), (PyCFunction)scribus_messdia, METH_VARARGS|METH_KEYWORDS, tr(scribus_messdia__doc__)},
{const_cast<char*>("moveObjectAbs"), scribus_moveobjabs, METH_VARARGS, tr(scribus_moveobjabs__doc__)},
{const_cast<char*>("moveObject"), scribus_moveobjrel, METH_VARARGS, tr(scribus_moveobjrel__doc__)},
+ {const_cast<char*>("moveSelectionToBack"), (PyCFunction)scribus_moveselectiontoback, METH_NOARGS, tr(scribus_moveselectiontoback__doc__) },
+ {const_cast<char*>("moveSelectionToFront"), (PyCFunction)scribus_moveselectiontofront, METH_NOARGS, tr(scribus_moveselectiontofront__doc__) },
{const_cast<char*>("newDocDialog"), (PyCFunction)scribus_newdocdia, METH_NOARGS, tr(scribus_newdocdia__doc__)},
{const_cast<char*>("newDoc"), scribus_newdoc, METH_VARARGS, tr(scribus_newdoc__doc__)},
{const_cast<char*>("newDocument"), scribus_newdocument, METH_VARARGS, tr(scribus_newdocument__doc__)},
@@ -540,6 +543,7 @@
// missing? {"setSelectedObject", scribus_setselobjnam, METH_VARARGS, "Returns the Name of the selecteted Object. \"nr\" if given indicates the Number of the selected Object, e.g. 0 means the first selected Object, 1 means the second selected Object and so on."},
{const_cast<char*>("hyphenateText"), scribus_hyphenatetext, METH_VARARGS, tr(scribus_hyphenatetext__doc__)},
{const_cast<char*>("dehyphenateText"), scribus_dehyphenatetext, METH_VARARGS, tr(scribus_dehyphenatetext__doc__)},
+ {const_cast<char*>("scrollDocument"), scribus_scrolldocument, METH_VARARGS, tr(scribus_scrolldocument__doc__) },
{const_cast<char*>("setScaleFrameToImage"), (PyCFunction)scribus_setscaleframetoimage, METH_VARARGS, tr(scribus_setscaleframetoimage__doc__)},
{const_cast<char*>("setScaleImageToFrame"), (PyCFunction)scribus_setscaleimagetoframe, METH_KEYWORDS, tr(scribus_setscaleimagetoframe__doc__)},
{const_cast<char*>("setStyle"), scribus_setstyle, METH_VARARGS, tr(scribus_setstyle__doc__)},
@@ -563,15 +567,12 @@
{const_cast<char*>("sizeObject"), scribus_sizeobjabs, METH_VARARGS, tr(scribus_sizeobjabs__doc__)},
{const_cast<char*>("statusMessage"), scribus_messagebartext, METH_VARARGS, tr(scribus_messagebartext__doc__)},
{const_cast<char*>("textFlowMode"), scribus_textflow, METH_VARARGS, tr(scribus_textflow__doc__)},
+ {const_cast<char*>("textOverflows"), (PyCFunction)scribus_istextoverflowing, METH_KEYWORDS, tr(scribus_istextoverflowing__doc__) },
{const_cast<char*>("traceText"), scribus_tracetext, METH_VARARGS, tr(scribus_tracetext__doc__)},
{const_cast<char*>("unGroupObject"), scribus_ungroupobj, METH_VARARGS, tr(scribus_ungroupobj__doc__)},
{const_cast<char*>("unlinkTextFrames"), scribus_unlinktextframes, METH_VARARGS, tr(scribus_unlinktextframes__doc__)},
{const_cast<char*>("valueDialog"), scribus_valdialog, METH_VARARGS, tr(scribus_valdialog__doc__)},
- {const_cast<char*>("textOverflows"), (PyCFunction)scribus_istextoverflowing, METH_KEYWORDS, tr(scribus_istextoverflowing__doc__)},
{const_cast<char*>("zoomDocument"), scribus_zoomdocument, METH_VARARGS, tr(scribus_zoomdocument__doc__)},
- {const_cast<char*>("scrollDocument"), scribus_scrolldocument, METH_VARARGS, tr(scribus_scrolldocument__doc__)},
- {const_cast<char*>("moveSelectionToBack"), (PyCFunction)scribus_moveselectiontoback, METH_NOARGS, tr(scribus_moveselectiontoback__doc__)},
- {const_cast<char*>("moveSelectionToFront"), (PyCFunction)scribus_moveselectiontofront, METH_NOARGS, tr(scribus_moveselectiontofront__doc__)},
// Property magic
{const_cast<char*>("getPropertyCType"), (PyCFunction)scribus_propertyctype, METH_KEYWORDS, tr(scribus_propertyctype__doc__)},
{const_cast<char*>("getPropertyNames"), (PyCFunction)scribus_getpropertynames, METH_KEYWORDS, tr(scribus_getpropertynames__doc__)},
@@ -658,12 +659,12 @@
PyDict_SetItemString(d, const_cast<char*>("UNIT_PICAS"), PyInt_FromLong(unitIndexFromString("p")));
PyDict_SetItemString(d, const_cast<char*>("UNIT_CENTIMETRES"), PyInt_FromLong(unitIndexFromString("cm")));
PyDict_SetItemString(d, const_cast<char*>("UNIT_CICERO"), PyInt_FromLong(unitIndexFromString("c")));
- PyDict_SetItemString(d, const_cast<char*>("UNIT_PT"), PyInt_FromLong(unitIndexFromString("pt")));
- PyDict_SetItemString(d, const_cast<char*>("UNIT_MM"), PyInt_FromLong(unitIndexFromString("mm")));
- PyDict_SetItemString(d, const_cast<char*>("UNIT_IN"), PyInt_FromLong(unitIndexFromString("in")));
- PyDict_SetItemString(d, const_cast<char*>("UNIT_P"), PyInt_FromLong(unitIndexFromString("p")));
- PyDict_SetItemString(d, const_cast<char*>("UNIT_CM"), PyInt_FromLong(unitIndexFromString("cm")));
- PyDict_SetItemString(d, const_cast<char*>("UNIT_C"), PyInt_FromLong(unitIndexFromString("c")));
+ PyDict_SetItemString(d, const_cast<char*>("UNIT_PT"), PyInt_FromLong(unitIndexFromString("pt")));
+ PyDict_SetItemString(d, const_cast<char*>("UNIT_MM"), PyInt_FromLong(unitIndexFromString("mm")));
+ PyDict_SetItemString(d, const_cast<char*>("UNIT_IN"), PyInt_FromLong(unitIndexFromString("in")));
+ PyDict_SetItemString(d, const_cast<char*>("UNIT_P"), PyInt_FromLong(unitIndexFromString("p")));
+ PyDict_SetItemString(d, const_cast<char*>("UNIT_CM"), PyInt_FromLong(unitIndexFromString("cm")));
+ PyDict_SetItemString(d, const_cast<char*>("UNIT_C"), PyInt_FromLong(unitIndexFromString("c")));
PyDict_SetItemString(d, const_cast<char*>("PORTRAIT"), Py_BuildValue(const_cast<char*>("i"), portraitPage));
PyDict_SetItemString(d, const_cast<char*>("LANDSCAPE"), Py_BuildValue(const_cast<char*>("i"), landscapePage));
PyDict_SetItemString(d, const_cast<char*>("NOFACINGPAGES"), Py_BuildValue(const_cast<char*>("i"), 0));
@@ -943,6 +944,6 @@
PV */
void scriptplugindocwarnings()
{
- QStringList s;
- s <<printer__doc__<<pdffile__doc__<<imgexp__doc__<<imgexp_dpi__doc__<<imgexp_scale__doc__ <<imgexp_quality__doc__<<imgexp_filename__doc__<<imgexp_type__doc__<<imgexp_alltypes__doc__ << imgexp_save__doc__ << imgexp_saveas__doc__;
-}
+ QStringList s;
+ s <<printer__doc__<<pdffile__doc__<<imgexp__doc__<<imgexp_dpi__doc__<<imgexp_scale__doc__ <<imgexp_quality__doc__<<imgexp_filename__doc__<<imgexp_type__doc__<<imgexp_alltypes__doc__ << imgexp_save__doc__ << imgexp_saveas__doc__;
+}
More information about the scribus-commit
mailing list