r23841 by jghali - Sync old Python 2.x scripter code with current scripter code

scribus-commit scribus-commit at lists.scribus.net
Tue May 26 13:35:38 UTC 2020


Author: jghali
Date: Tue May 26 13:35:38 2020
New Revision: 23841

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23841
Log:
Sync old Python 2.x scripter code with current scripter code

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdannotations.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcell.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetsetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtable.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.h
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/svgimport.cpp

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdannotations.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdannotations.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdannotations.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdannotations.cpp	Tue May 26 13:35:38 2020
@@ -52,7 +52,7 @@
 	if (item == nullptr)
 		return nullptr;
 
-	if (item->isAnnotation() == false)
+	if (!item->isAnnotation())
 	{
 		PyErr_SetString(PyExc_RuntimeError,
 			QObject::tr("Page item must be an annotation", "python error").toLocal8Bit().constData());
@@ -112,7 +112,7 @@
 	{
 		QString qnum = QString("%1").arg(action);
 		PyErr_SetString(PyExc_RuntimeError,
-			QObject::tr("Action must be be 0-9 " + qnum.toUtf8(), "python error").toLocal8Bit().constData());
+			QObject::tr("Action must be 0-9 " + qnum.toUtf8(), "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
 
@@ -123,7 +123,7 @@
 	if (item == nullptr)
 		return nullptr;
 
-	if (item->isAnnotation() == false)
+	if (!item->isAnnotation())
 	{
 		PyErr_SetString(PyExc_RuntimeError,
 			QObject::tr("Page item must be an annotation", "python error").toLocal8Bit().constData());
@@ -504,11 +504,11 @@
 	}
 	else
 	{
-		bool hasosg=false;
+		bool hasOSG = false;
 	#ifdef HAVE_OSG
-		hasosg=true;
+		hasOSG = true;
 	#endif
-		if (hasosg)
+		if (hasOSG)
 		{
 			i = m_doc->itemAdd(PageItem::OSGFrame, 
 			                   PageItem::Unspecified, 
@@ -520,7 +520,8 @@
 			                   m_doc->itemToolPrefs().imageFillColor, 
 			                   m_doc->itemToolPrefs().imageStrokeColor);
 		}
-		else{
+		else
+		{
 			PyErr_SetString(PyExc_RuntimeError,
 			QObject::tr("Doesn't have OSG can't create 3DAnnotation", "python error").toLocal8Bit().constData());
 			return nullptr;

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcell.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcell.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcell.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcell.cpp	Tue May 26 13:35:38 2020
@@ -457,12 +457,19 @@
 void cmdcelldocwarnings()
 {
 	QStringList s;
-	s << scribus_setcelltext__doc__ << scribus_getcellstyle__doc__
-	  << scribus_setcellstyle__doc__ << scribus_getcellrowspan__doc__
-	  << scribus_getcellcolumnspan__doc__ << scribus_getcellfillcolor__doc__
-	  << scribus_setcellfillcolor__doc__ << scribus_setcellleftborder__doc__
-	  << scribus_setcellrightborder__doc__ << scribus_setcelltopborder__doc__
-	  << scribus_setcellbottomborder__doc__ << scribus_setcellleftpadding__doc__
-	  << scribus_setcellrightpadding__doc__ << scribus_setcelltoppadding__doc__
-	  << scribus_setcellbottompadding__doc__;
-}
+	s << scribus_getcellcolumnspan__doc__
+	  << scribus_getcellfillcolor__doc__
+	  << scribus_getcellrowspan__doc__
+	  << scribus_getcellstyle__doc__
+	  << scribus_setcellbottomborder__doc__
+	  << scribus_setcellbottompadding__doc__
+	  << scribus_setcellfillcolor__doc__
+	  << scribus_setcellleftborder__doc__
+	  << scribus_setcellleftpadding__doc__
+	  << scribus_setcellrightborder__doc__
+	  << scribus_setcellrightpadding__doc__
+	  << scribus_setcellstyle__doc__
+	  << scribus_setcelltext__doc__  
+	  << scribus_setcelltopborder__doc__
+	  << scribus_setcelltoppadding__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.cpp	Tue May 26 13:35:38 2020
@@ -670,8 +670,25 @@
 void cmdcolordocswarnings()
 {
 	QStringList s;
-	s << scribus_colornames__doc__ << scribus_getcolor__doc__ << scribus_getcolorasrgb__doc__;
-	s << scribus_setcolor__doc__ << scribus_setcolorrgb__doc__ << scribus_setcolorcmyk__doc__;
-	s << scribus_newcolor__doc__ << scribus_newcolorrgb__doc__ << scribus_newcolorcmyk__doc__<< scribus_delcolor__doc__;
-	s << scribus_replcolor__doc__ << scribus_isspotcolor__doc__ << scribus_setspotcolor__doc__;
-}
+	s << scribus_colornames__doc__
+	  << scribus_delcolor__doc__
+	  << scribus_getcolor__doc__
+	  << scribus_getcolorasrgb__doc__
+	  << scribus_getcolorasrgbfloat__doc__
+	  << scribus_getcolorfloat__doc__
+	  << scribus_isspotcolor__doc__ 
+	  << scribus_newcolor__doc__
+	  << scribus_newcolorcmyk__doc__
+	  << scribus_newcolorcmykfloat__doc__
+	  << scribus_newcolorlab__doc__
+	  << scribus_newcolorrgb__doc__
+	  << scribus_newcolorrgbfloat__doc__
+	  << scribus_replcolor__doc__
+	  << scribus_setcolor__doc__
+	  << scribus_setcolorcmyk__doc__
+	  << scribus_setcolorcmykfloat__doc__
+	  << scribus_setcolorlab__doc__
+	  << scribus_setcolorrgb__doc__
+	  << scribus_setcolorrgbfloat__doc__
+	  << scribus_setspotcolor__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdcolor.h	Tue May 26 13:35:38 2020
@@ -235,7 +235,7 @@
 
 /*! docstring */
 PyDoc_STRVAR(scribus_newcolorlab__doc__,
-QT_TR_NOOP("defineColorLab(\"name\", r, g, b)\n\
+QT_TR_NOOP("defineColorLab(\"name\", L, a, b)\n\
 \n\
 Defines a new color \"name\" using CIELab values. The color value is defined\n\
 via three components: L = luminosity, a = green/red, b = blue/yellow. Color components\n\

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.cpp	Tue May 26 13:35:38 2020
@@ -16,7 +16,7 @@
 #include <QInputDialog>
 
 
-PyObject *scribus_newdocdia(PyObject* /* self */)
+PyObject *scribus_newdocdialog(PyObject* /* self */)
 {
 	QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	bool ret = ScCore->primaryMainWindow()->slotFileNew();
@@ -24,7 +24,7 @@
 	return PyInt_FromLong(static_cast<long>(ret));
 }
 
-PyObject *scribus_filedia(PyObject* /* self */, PyObject* args, PyObject* kw)
+PyObject *scribus_filedialog(PyObject* /* self */, PyObject* args, PyObject* kw)
 {
 	char *caption = const_cast<char*>("");
 	char *filter = const_cast<char*>("");
@@ -71,7 +71,7 @@
 	return PyString_FromString(fName.toUtf8());
 }
 
-PyObject *scribus_messdia(PyObject* /* self */, PyObject* args, PyObject* kw)
+PyObject *scribus_messagebox(PyObject* /* self */, PyObject* args, PyObject* kw)
 {
 	char *caption = const_cast<char*>("");
 	char *message = const_cast<char*>("");
@@ -106,7 +106,7 @@
 	return PyInt_FromLong(static_cast<long>(result));
 }
 
-PyObject *scribus_valdialog(PyObject* /* self */, PyObject* args)
+PyObject *scribus_valuedialog(PyObject* /* self */, PyObject* args)
 {
 	char *caption = const_cast<char*>("");
 	char *message = const_cast<char*>("");
@@ -154,6 +154,9 @@
 void cmddialogdocwarnings()
 {
 	QStringList s;
-	s << scribus_newdocdia__doc__ << scribus_filedia__doc__ << scribus_messdia__doc__;
-	s << scribus_valdialog__doc__ << scribus_newstyledialog__doc__;
+	s << scribus_filedialog__doc__
+	  << scribus_messagebox__doc__
+	  << scribus_newdocdialog__doc__ 
+	  << scribus_newstyledialog__doc__
+	  << scribus_valuedialog__doc__ ;
 }

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddialog.h	Tue May 26 13:35:38 2020
@@ -13,7 +13,7 @@
 /** Calling Dialogs from Scribus */
 
 /*! docstring */
-PyDoc_STRVAR(scribus_newdocdia__doc__,
+PyDoc_STRVAR(scribus_newdocdialog__doc__,
 QT_TR_NOOP("newDocDialog() -> bool\n\
 \n\
 Displays the \"New Document\" dialog box. Creates a new document if the user\n\
@@ -21,10 +21,10 @@
 Returns true if a new document was created.\n\
 "));
 /** Raises the Scribus New Document dialog */
-PyObject *scribus_newdocdia(PyObject * /*self*/);
+PyObject *scribus_newdocdialog(PyObject * /*self*/);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_filedia__doc__,
+PyDoc_STRVAR(scribus_filedialog__doc__,
 QT_TR_NOOP("fileDialog(\"caption\", [\"filter\", \"defaultname\", haspreview, issave, isdir]) -> string with filename\n\
 \n\
 Shows a File Open dialog box with the caption \"caption\". Files are filtered\n\
@@ -46,15 +46,15 @@
 "));
 /** Raises file dialog.
  Params - caption, filter, default name and opt. pre, mode. */
-PyObject *scribus_filedia(PyObject * /*self*/, PyObject* args, PyObject* kw);
+PyObject *scribus_filedialog(PyObject * /*self*/, PyObject* args, PyObject* kw);
 /* duplicity Sends a string into the Message Bar
 PyObject *scribus_mess(PyObject *self, PyObject* args);
 */
 
 /*! docstring */
-PyDoc_STRVAR(scribus_messdia__doc__,
+PyDoc_STRVAR(scribus_messagebox__doc__,
 QT_TR_NOOP("messageBox(\"caption\", \"message\",\n\
-    icon=ICON_NONE, button1=BUTTON_OK|BUTTONOPT_DEFAULT,\n\
+    icon=ICON_NONE, button1=BUTTON_OK|BUTTON_DEFAULT,\n\
     button2=BUTTON_NONE, button3=BUTTON_NONE) -> integer\n\
 \n\
 Displays a message box with the title \"caption\", the message \"message\", and\n\
@@ -63,23 +63,24 @@
 though setting an icon and appropriate button(s) is strongly\n\
 recommended. The message text may contain simple HTML-like markup.\n\
 \n\
-Returns the number of the button the user pressed. Button numbers start\n\
-at 1.\n\
+Returns the BUTTON_* constant value corresponding to the clicked button. For example,\n\
+if OK button is clicked, BUTTON_OK will be returned regardless of whether it is assigned to\n\
+button1, button2, or button3.\n\
 \n\
 For the icon and the button parameters there are predefined constants available\n\
 with the same names as in the Qt Documentation. These are the BUTTON_* and\n\
 ICON_* constants defined in the module. There are also two extra constants that\n\
 can be binary-ORed with button constants:\n\
-    BUTTONOPT_DEFAULT   Pressing enter presses this button.\n\
-    BUTTONOPT_ESCAPE    Pressing escape presses this button.\n\
+    BUTTON_DEFAULT   Pressing enter presses this button.\n\
+    BUTTON_ESCAPE    Pressing escape presses this button.\n\
 \n\
 Usage examples:\n\
 result = messageBox('Script failed',\n\
                     'This script only works when you have a text frame selected.',\n\
                     ICON_ERROR)\n\
 result = messageBox('Monkeys!', 'Something went ook! <i>Was it a monkey?</i>',\n\
-                    ICON_WARNING, BUTTON_YES|BUTTONOPT_DEFAULT,\n\
-                    BUTTON_NO, BUTTON_IGNORE|BUTTONOPT_ESCAPE)\n\
+                    ICON_WARNING, BUTTON_YES|BUTTON_DEFAULT,\n\
+                    BUTTON_NO, BUTTON_IGNORE|BUTTON_ESCAPE)\n\
 \n\
 Defined button and icon constants:\n\
 BUTTON_NONE, BUTTON_ABORT, BUTTON_CANCEL, BUTTON_IGNORE, BUTTON_NO,\n\
@@ -88,10 +89,10 @@
 "));
 /** Displays a message box with - caption, message, icon, button
  and two more buttons optional. */
-PyObject *scribus_messdia(PyObject * /*self*/, PyObject* args, PyObject* kw);
+PyObject *scribus_messagebox(PyObject * /*self*/, PyObject* args, PyObject* kw);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_valdialog__doc__,
+PyDoc_STRVAR(scribus_valuedialog__doc__,
 QT_TR_NOOP("valueDialog(caption, message [,defaultvalue]) -> string\n\
 \n\
 Shows the common 'Ask for string' dialog and returns its value as a string\n\
@@ -100,7 +101,7 @@
 Example: valueDialog('title', 'text in the window', 'optional')\n\
 "));
 /* 09/24/2004 petr vanek */
-PyObject *scribus_valdialog(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_valuedialog(PyObject * /*self*/, PyObject* args);
 
 
 PyDoc_STRVAR(scribus_newstyledialog__doc__,

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.cpp	Tue May 26 13:35:38 2020
@@ -123,7 +123,7 @@
 
 	ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc;
 	ScribusView* currentView = ScCore->primaryMainWindow()->view;
-	currentDoc->setBleeds(bleeds));
+	currentDoc->setBleeds(bleeds);
 	currentView->reformPages();
 	currentDoc->setModified(true);
 	currentView->DrawNew();
@@ -211,6 +211,14 @@
 	Py_RETURN_NONE;
 }
 
+PyObject *scribus_revertdoc(PyObject* /* self */)
+{
+	if (!checkHaveDocument())
+		return nullptr;
+	ScCore->primaryMainWindow()->slotFileRevert();
+	Py_RETURN_NONE;
+}
+
 PyObject *scribus_getdocname(PyObject* /* self */)
 {
 	if (!checkHaveDocument())
@@ -468,5 +476,27 @@
 void cmddocdocwarnings()
 {
 	QStringList s;
-	s << scribus_newdocument__doc__ << scribus_newdoc__doc__ <<  scribus_closedoc__doc__ << scribus_havedoc__doc__ << scribus_opendoc__doc__ << scribus_savedoc__doc__ << scribus_getdocname__doc__ << scribus_savedocas__doc__ << scribus_setinfo__doc__ <<scribus_setmargins__doc__ <<scribus_setunit__doc__ <<scribus_getunit__doc__ <<scribus_loadstylesfromfile__doc__ <<scribus_setdoctype__doc__ <<scribus_closemasterpage__doc__ <<scribus_masterpagenames__doc__ <<scribus_editmasterpage__doc__ <<scribus_createmasterpage__doc__ <<scribus_deletemasterpage__doc__ << scribus_setbaseline__doc__ << scribus_getmasterpage__doc__  << scribus_applymasterpage__doc__;
-}
+	s << scribus_applymasterpage__doc__
+	  << scribus_closedoc__doc__
+	  << scribus_closemasterpage__doc__
+	  << scribus_createmasterpage__doc__
+	  << scribus_deletemasterpage__doc__
+	  << scribus_editmasterpage__doc__ 
+	  << scribus_getdocname__doc__
+	  << scribus_getmasterpage__doc__
+	  << scribus_getunit__doc__ 
+	  << scribus_havedoc__doc__
+	  << scribus_loadstylesfromfile__doc__
+	  << scribus_masterpagenames__doc__ 
+	  << scribus_newdoc__doc__ 
+	  << scribus_newdocument__doc__
+	  << scribus_opendoc__doc__
+	  << scribus_revertdoc__doc__
+	  << scribus_savedoc__doc__
+	  << scribus_savedocas__doc__
+	  << scribus_setbaseline__doc__
+	  << scribus_setdoctype__doc__ 
+	  << scribus_setinfo__doc__
+	  << scribus_setmargins__doc__
+	  << scribus_setunit__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmddoc.h	Tue May 26 13:35:38 2020
@@ -142,6 +142,14 @@
 PyObject *scribus_savedoc(PyObject * /*self*/);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_revertdoc__doc__,
+QT_TR_NOOP("revertDoc()\n\
+\n\
+Revert the current document to its last saved state.\n\
+"));
+PyObject *scribus_revertdoc(PyObject * /*self*/);
+
+/*! docstring */
 PyDoc_STRVAR(scribus_getdocname__doc__,
 QT_TR_NOOP("getDocName() -> string\n\
 \n\
@@ -289,9 +297,9 @@
 PyObject* scribus_deletemasterpage(PyObject* self, PyObject* args);
 
 PyDoc_STRVAR(scribus_getmasterpage__doc__,
-QT_TR_NOOP("getMasterPage(nr)\n\
-\n\
-Get Master Page of the page \"nr\".\n\
+QT_TR_NOOP("getMasterPage(pageNr)\n\
+\n\
+Returns the name of master page applied to page \"nr\".\n\
 \n\
 May raise IndexError if the page number is out of range.\n\
 "));

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.cpp	Tue May 26 13:35:38 2020
@@ -229,7 +229,7 @@
 	return PyInt_FromLong(static_cast<long>(item->cornerRadius()));
 }
 
-PyObject *scribus_getimgoffset(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getimageoffset(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
@@ -242,7 +242,7 @@
 	return Py_BuildValue("(ff)", item->imageXOffset() * item->imageXScale(), item->imageYOffset() * item->imageYScale());
 }
 
-PyObject *scribus_getimgscale(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getimagescale(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
@@ -268,7 +268,7 @@
 	return PyString_FromString(item->Pfile.toUtf8());
 }
 
-PyObject *scribus_getposi(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getposition(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
@@ -452,16 +452,28 @@
 void cmdgetpropdocwarnings()
 {
 	QStringList s;
-	s << scribus_getobjecttype__doc__ << scribus_getfillcolor__doc__
+	s << scribus_getallobj__doc__
+	  << scribus_getcornerrad__doc__ 
 	  << scribus_getcustomlinestyle__doc__
-	  << scribus_getfilltrans__doc__ << scribus_getfillblend__doc__ 
-	  << scribus_getlinecolor__doc__ << scribus_getlinetrans__doc__ 
-	  << scribus_getlineblend__doc__ << scribus_getlinewidth__doc__ 
-	  << scribus_getlineshade__doc__ << scribus_getlinejoin__doc__ 
-	  << scribus_getlinecap__doc__ << scribus_getlinestyle__doc__ 
-	  << scribus_getfillshade__doc__ << scribus_getcornerrad__doc__ 
-	  << scribus_getimgscale__doc__ << scribus_getimagefile__doc__ 
-	  << scribus_getposi__doc__ << scribus_getsize__doc__ 
-	  << scribus_getrotation__doc__ <<  scribus_getallobj__doc__
-	  << scribus_getobjectattributes__doc__ << scribus_getimagecolorspace__doc__;
-}
+	  << scribus_getfillcolor__doc__
+	  << scribus_getfillblend__doc__
+	  << scribus_getfillshade__doc__ 
+	  << scribus_getfilltrans__doc__
+	  << scribus_getimagecolorspace__doc__
+	  << scribus_getimagefile__doc__
+	  << scribus_getimageoffset__doc__
+	  << scribus_getimagescale__doc__
+	  << scribus_getlinecolor__doc__ 
+	  << scribus_getlineblend__doc__ 
+	  << scribus_getlinecap__doc__
+	  << scribus_getlinejoin__doc__ 
+	  << scribus_getlineshade__doc__
+	  << scribus_getlinetrans__doc__
+	  << scribus_getlinewidth__doc__
+	  << scribus_getlinestyle__doc__ 
+	  << scribus_getobjectattributes__doc__ 
+	  << scribus_getobjecttype__doc__
+	  << scribus_getposition__doc__
+	  << scribus_getrotation__doc__
+	  << scribus_getsize__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetprop.h	Tue May 26 13:35:38 2020
@@ -187,27 +187,27 @@
 PyObject *scribus_getimagefile(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_getimgoffset__doc__,
+PyDoc_STRVAR(scribus_getimageoffset__doc__,
 	QT_TR_NOOP("getImageOffset([\"name\"]) -> (x,y)\n\
 \n\
 Returns a (x, y) tuple containing the offset values in point unit of the image\n\
 frame \"name\".  If \"name\" is not given the currently selected item is used.\n\
 "));
 /*! Returns image scale of the object */
-PyObject *scribus_getimgoffset(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_getimgscale__doc__,
+PyObject *scribus_getimageoffset(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getimagescale__doc__,
 	QT_TR_NOOP("getImageScale([\"name\"]) -> (x,y)\n\
 \n\
 Returns a (x, y) tuple containing the scaling values of the image frame\n\
 \"name\".  If \"name\" is not given the currently selected item is used.\n\
 "));
 /*! Returns image scale of the object */
-PyObject *scribus_getimgscale(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_getposi__doc__,
+PyObject *scribus_getimagescale(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getposition__doc__,
 QT_TR_NOOP("getPosition([\"name\"]) -> (x,y)\n\
 \n\
 Returns a (x, y) tuple with the position of the object \"name\".\n\
@@ -216,7 +216,7 @@
 - see UNIT_<type> for reference.\n\
 "));
 /*! Returns position of the object */
-PyObject *scribus_getposi(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getposition(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getsize__doc__,

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetsetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdgetsetprop.cpp	Tue May 26 13:35:38 2020
@@ -480,6 +480,8 @@
 void cmdgetsetpropdocwarnings()
 {
 	QStringList s;
-	s << scribus_propertyctype__doc__ << scribus_getpropertynames__doc__ << scribus_getproperty__doc__ << scribus_setproperty__doc__;
-	//Qt4 << scribus_getchildren__doc__ << scribus_getchild__doc__;
-}
+	s << scribus_getproperty__doc__
+	  << scribus_getpropertynames__doc__
+	  << scribus_propertyctype__doc__ 
+	  << scribus_setproperty__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp	Tue May 26 13:35:38 2020
@@ -47,7 +47,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
 	if (item == nullptr)
 		return nullptr;
-	if (! item->isImageFrame())
+	if (!item->isImageFrame())
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error").toLocal8Bit().constData());
 		return nullptr;
@@ -176,7 +176,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
 	if (item == nullptr)
 		return nullptr;
-	if (! item->isImageFrame())
+	if (!item->isImageFrame())
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error").toLocal8Bit().constData());
 		return nullptr;
@@ -204,7 +204,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
 	if (item == nullptr)
 		return nullptr;
-	if (! item->isImageFrame())
+	if (!item->isImageFrame())
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error").toLocal8Bit().constData());
 		return nullptr;
@@ -361,8 +361,8 @@
 		PyErr_SetString(PyExc_TypeError, QObject::tr("Need selection or argument list of items to group", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-	Selection *tempSelection=nullptr;
-	Selection *finalSelection=nullptr;
+	Selection *tempSelection = nullptr;
+	Selection *finalSelection = nullptr;
 	//uint ap = ScCore->primaryMainWindow()->doc->currentPage()->pageNr();
 	// If we were passed a list of items to group...
 	if (il != nullptr)
@@ -383,10 +383,10 @@
 			}
 			tempSelection->addItem (ic, true);
 		}
-		finalSelection=tempSelection;
+		finalSelection = tempSelection;
 	}
 	else
-		finalSelection=ScCore->primaryMainWindow()->doc->m_Selection;
+		finalSelection = ScCore->primaryMainWindow()->doc->m_Selection;
 	if (finalSelection->count() < 2)
 	{
 		// We can't very well group only one item
@@ -460,8 +460,9 @@
 		return nullptr;
 	if (!checkHaveDocument())
 		return nullptr;
-	if ((i < static_cast<int>(ScCore->primaryMainWindow()->doc->m_Selection->count())) && (i > -1))
-		return PyString_FromString(ScCore->primaryMainWindow()->doc->m_Selection->itemAt(i)->itemName().toUtf8());
+	Selection * selection = ScCore->primaryMainWindow()->doc->m_Selection;
+	if ((i < selection->count()) && (i > -1))
+		return PyString_FromString(selection->itemAt(i)->itemName().toUtf8());
 	// FIXME: Should probably return None if no selection?
 	return PyString_FromString("");
 }
@@ -565,7 +566,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(name));
 	if (item == nullptr)
 		return nullptr;
-	if (! item->isImageFrame())
+	if (!item->isImageFrame())
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error").toLocal8Bit().constData());
 		return nullptr;
@@ -635,7 +636,7 @@
 	for (int i = 0; i < curSelection->count(); ++i)
 	{
 		PageItem* it = currentDoc->m_Selection->itemAt(i);
-		if ((!it->asPolygon()) || (!it->asPolyLine()))
+		if ((!it->isPolygon()) || (!it->isPolyLine()))
 			canUniteItems = false;
 	}
 
@@ -655,15 +656,28 @@
 void cmdmanidocwarnings()
 {
 	QStringList s;
-	s << scribus_moveobjrel__doc__ << scribus_moveobjabs__doc__
-	  << scribus_rotobjrel__doc__ << scribus_rotobjabs__doc__
-	  << scribus_sizeobjabs__doc__ << scribus_getselobjnam__doc__
-	  << scribus_selcount__doc__ << scribus_selectobj__doc__
-	  << scribus_deselect__doc__ << scribus_groupobj__doc__
-	  << scribus_ungroupobj__doc__ << scribus_scalegroup__doc__
-	  << scribus_loadimage__doc__ << scribus_scaleimage__doc__
-	  << scribus_setimagescale__doc__ << scribus_lockobject__doc__
-	  << scribus_islocked__doc__ << scribus_setscaleimagetoframe__doc__ << scribus_setimagebrightness__doc__ << scribus_setimagegrayscale__doc__ << scribus_setimageoffset__doc__
+	s << scribus_combinepolygons__doc__
+	  << scribus_deselect__doc__
+	  << scribus_flipobject__doc__
+	  << scribus_getselobjnam__doc__
+	  << scribus_groupobj__doc__
+	  << scribus_islocked__doc__
+	  << scribus_loadimage__doc__
+	  << scribus_lockobject__doc__
+      << scribus_moveobjabs__doc__
+	  << scribus_moveobjrel__doc__
+	  << scribus_rotobjabs__doc__
+	  << scribus_rotobjrel__doc__
+	  << scribus_scalegroup__doc__
+	  << scribus_scaleimage__doc__
+	  << scribus_selcount__doc__
+	  << scribus_selectobj__doc__
+	  << scribus_setimagebrightness__doc__
+	  << scribus_setimagegrayscale__doc__
+	  << scribus_setimageoffset__doc__
+	  << scribus_setimagescale__doc__
 	  << scribus_setscaleframetoimage__doc__
-	  << scribus_flipobject__doc__;
-}
+	  << scribus_setscaleimagetoframe__doc__
+	  << scribus_sizeobjabs__doc__ 
+	  << scribus_ungroupobj__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp	Tue May 26 13:35:38 2020
@@ -110,8 +110,7 @@
 		// User specified no format, so use the historical default of PPM format.
 		format =  const_cast<char*>("PPM");
 	QPixmap pm = FontSample(PrefsManager::instance().appPrefs.fontPrefs.AvailFonts[QString::fromUtf8(Name)], Size, ts, Qt::white);
-	// If the user specified an empty filename, return the image data as
-	// a string. Otherwise, save it to disk.
+	// If the user specified an empty filename, return the image data as bytes. Otherwise, save it to disk.
 	if (QString::fromUtf8(FileName).isEmpty())
 	{
 		QByteArray buffer_string = "";
@@ -150,14 +149,14 @@
 {
 	if (!checkHaveDocument())
 		return nullptr;
-	PyObject *l;
-	l = PyList_New(ScCore->primaryMainWindow()->doc->Layers.count());
-	for (int lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
-		PyList_SetItem(l, lam, PyString_FromString(ScCore->primaryMainWindow()->doc->Layers[lam].Name.toUtf8()));
+	ScribusDoc* doc = ScCore->primaryMainWindow()->doc;
+	PyObject *l = PyList_New(doc->Layers.count());
+	for (int i = 0; i < doc->Layers.count(); i++)
+		PyList_SetItem(l, i, PyString_FromString(doc->Layers[i].Name.toUtf8()));
 	return l;
 }
 
-PyObject *scribus_setactlayer(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setactivelayer(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -229,7 +228,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layervisible(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayervisible(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int vis = 1;
@@ -260,7 +259,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layerprint(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayerprintable(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int vis = 1;
@@ -291,7 +290,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layerlock(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayerlocked(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int vis = 1;
@@ -322,7 +321,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layeroutline(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayeroutlined(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int vis = 1;
@@ -353,7 +352,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layerflow(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayerflow(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int vis = 1;
@@ -384,7 +383,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layerblend(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayerblendmode(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int vis = 0;
@@ -415,7 +414,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_layertrans(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setlayertransparency(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	double vis = 1.0;
@@ -446,7 +445,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_glayervisib(PyObject* /* self */, PyObject* args)
+PyObject *scribus_islayervisible(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -477,7 +476,7 @@
 	return PyInt_FromLong(static_cast<long>(i));
 }
 
-PyObject *scribus_glayerprint(PyObject* /* self */, PyObject* args)
+PyObject *scribus_islayerprintable(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -508,7 +507,7 @@
 	return PyInt_FromLong(static_cast<long>(i));
 }
 
-PyObject *scribus_glayerlock(PyObject* /* self */, PyObject* args)
+PyObject *scribus_islayerlocked(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -539,7 +538,7 @@
 	return PyInt_FromLong(static_cast<long>(i));
 }
 
-PyObject *scribus_glayeroutline(PyObject* /* self */, PyObject* args)
+PyObject *scribus_islayeroutlined(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -570,7 +569,7 @@
 	return PyInt_FromLong(static_cast<long>(i));
 }
 
-PyObject *scribus_glayerflow(PyObject* /* self */, PyObject* args)
+PyObject *scribus_islayerflow(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -601,7 +600,7 @@
 	return PyInt_FromLong(static_cast<long>(i));
 }
 
-PyObject *scribus_glayerblend(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getlayerblendmode(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -632,7 +631,7 @@
 	return PyInt_FromLong(static_cast<long>(i));
 }
 
-PyObject *scribus_glayertrans(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getlayertransparency(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
@@ -792,19 +791,34 @@
 void cmdmiscdocwarnings()
 {
 	QStringList s;
-	s << scribus_setredraw__doc__ << scribus_fontnames__doc__ 
-	  << scribus_xfontnames__doc__ << scribus_renderfont__doc__ 
-	  << scribus_getlayers__doc__ << scribus_setactlayer__doc__ 
-	  << scribus_getactlayer__doc__ << scribus_senttolayer__doc__ 
-	  << scribus_layervisible__doc__ << scribus_layerprint__doc__ 
-	  << scribus_layerlock__doc__ << scribus_layeroutline__doc__ 
-	  << scribus_layerflow__doc__ << scribus_layerblend__doc__ 
-	  << scribus_layertrans__doc__ << scribus_glayervisib__doc__ 
-	  << scribus_glayerprint__doc__ << scribus_glayerlock__doc__ 
-	  << scribus_glayeroutline__doc__ << scribus_glayerflow__doc__ 
-	  << scribus_glayerblend__doc__ << scribus_glayertrans__doc__ 
-	  << scribus_removelayer__doc__ << scribus_createlayer__doc__ 
-	  << scribus_getlanguage__doc__ << scribus_moveselectiontofront__doc__
-	  << scribus_moveselectiontoback__doc__ << scribus_filequit__doc__
-	  << scribus_savepdfoptions__doc__ << scribus_readpdfoptions__doc__;
-}
+	s << scribus_createlayer__doc__
+	  << scribus_filequit__doc__
+	  << scribus_fontnames__doc__
+	  << scribus_getactlayer__doc__ 
+	  << scribus_getlanguage__doc__
+	  << scribus_getlayerblendmode__doc__
+	  << scribus_getlayers__doc__
+	  << scribus_getlayertransparency__doc__
+	  << scribus_islayerflow__doc__
+	  << scribus_islayerlocked__doc__
+	  << scribus_islayeroutlined__doc__
+	  << scribus_islayerprintable__doc__
+	  << scribus_islayervisible__doc__
+	  << scribus_moveselectiontoback__doc__ 
+	  << scribus_moveselectiontofront__doc__
+	  << scribus_readpdfoptions__doc__
+	  << scribus_removelayer__doc__
+	  << scribus_renderfont__doc__
+	  << scribus_savepdfoptions__doc__
+	  << scribus_senttolayer__doc__
+	  << scribus_setactivelayer__doc__
+	  << scribus_setlayerblendmode__doc__
+	  << scribus_setlayerflow__doc__ 
+	  << scribus_setlayerlocked__doc__
+	  << scribus_setlayeroutlined__doc__
+	  << scribus_setlayerprintable__doc__
+	  << scribus_setlayertransparency__doc__
+	  << scribus_setlayervisible__doc__ 
+	  << scribus_setredraw__doc__  
+	  << scribus_xfontnames__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.h	Tue May 26 13:35:38 2020
@@ -73,7 +73,7 @@
 PyObject *scribus_getlayers(PyObject * /*self*/);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_setactlayer__doc__,
+PyDoc_STRVAR(scribus_setactivelayer__doc__,
 QT_TR_NOOP("setActiveLayer(\"name\")\n\
 \n\
 Sets the active layer to the layer named \"name\".\n\
@@ -82,7 +82,7 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Move into layer */
-PyObject *scribus_setactlayer(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_setactivelayer(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getactlayer__doc__,
@@ -107,7 +107,7 @@
 PyObject *scribus_senttolayer(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_layervisible__doc__,
+PyDoc_STRVAR(scribus_setlayervisible__doc__,
 QT_TR_NOOP("setLayerVisible(\"layer\", visible)\n\
 \n\
 Sets the layer \"layer\" to be visible or not. If is the visible set to false\n\
@@ -117,10 +117,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_layervisible(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_layerprint__doc__,
+PyObject *scribus_setlayervisible(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setlayerprintable__doc__,
 QT_TR_NOOP("setLayerPrintable(\"layer\", printable)\n\
 \n\
 Sets the layer \"layer\" to be printable or not. If is the\n\
@@ -130,10 +130,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_layerprint(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_layerlock__doc__,
+PyObject *scribus_setlayerprintable(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setlayerlocked__doc__,
 QT_TR_NOOP("setLayerLocked(\"layer\", locked)\n\
 \n\
 Sets the layer \"layer\" to be locked or not. If locked is set to\n\
@@ -143,10 +143,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_layerlock(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_layeroutline__doc__,
+PyObject *scribus_setlayerlocked(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setlayeroutlined__doc__,
 QT_TR_NOOP("setLayerOutlined(\"layer\", outline)\n\
 \n\
 Sets the layer \"layer\" to be locked or not. If outline is set to\n\
@@ -156,10 +156,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_layeroutline(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_layerflow__doc__,
+PyObject *scribus_setlayeroutlined(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setlayerflow__doc__,
 QT_TR_NOOP("setLayerFlow(\"layer\", flow)\n\
 \n\
 Sets the layers \"layer\"  flowcontrol to flow. If flow is set to\n\
@@ -169,10 +169,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_layerflow(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_layerblend__doc__,
+PyObject *scribus_setlayerflow(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setlayerblendmode__doc__,
 QT_TR_NOOP("setLayerBlendmode(\"layer\", blend)\n\
 \n\
 Sets the layers \"layer\"  blendmode to blend.\n\
@@ -181,10 +181,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_layerblend(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_layertrans__doc__,
+PyObject *scribus_setlayerblendmode(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setlayertransparency__doc__,
 QT_TR_NOOP("setLayerTransparency(\"layer\", trans)\n\
 \n\
 Sets the layers \"layer\"  transparency to trans.\n\
@@ -193,10 +193,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_layertrans(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayervisib__doc__,
+PyObject *scribus_setlayertransparency(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_islayervisible__doc__,
 QT_TR_NOOP("isLayerVisible(\"layer\") -> bool\n\
 \n\
 Returns whether the layer \"layer\" is visible or not, a value of True means\n\
@@ -207,10 +207,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_glayervisib(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayerprint__doc__,
+PyObject *scribus_islayervisible(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_islayerprintable__doc__,
 QT_TR_NOOP("isLayerPrintable(\"layer\") -> bool\n\
 \n\
 Returns whether the layer \"layer\" is printable or not, a value of True means\n\
@@ -221,10 +221,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer printable */
-PyObject *scribus_glayerprint(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayerlock__doc__,
+PyObject *scribus_islayerprintable(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_islayerlocked__doc__,
 QT_TR_NOOP("isLayerLocked(\"layer\") -> bool\n\
 \n\
 Returns whether the layer \"layer\" is locked or not, a value of True means\n\
@@ -235,10 +235,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_glayerlock(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayeroutline__doc__,
+PyObject *scribus_islayerlocked(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_islayeroutlined__doc__,
 QT_TR_NOOP("isLayerOutlined(\"layer\") -> bool\n\
 \n\
 Returns whether the layer \"layer\" is outlined or not, a value of True means\n\
@@ -249,10 +249,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_glayeroutline(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayerflow__doc__,
+PyObject *scribus_islayeroutlined(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_islayerflow__doc__,
 QT_TR_NOOP("isLayerFlow(\"layer\") -> bool\n\
 \n\
 Returns whether text flows around objects on layer \"layer\", a value of True means\n\
@@ -262,10 +262,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_glayerflow(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayerblend__doc__,
+PyObject *scribus_islayerflow(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getlayerblendmode__doc__,
 QT_TR_NOOP("getLayerBlendmode(\"layer\") -> int\n\
 \n\
 Returns the \"layer\" layer blendmode,\n\
@@ -274,10 +274,10 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_glayerblend(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_glayertrans__doc__,
+PyObject *scribus_getlayerblendmode(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getlayertransparency__doc__,
 QT_TR_NOOP("getLayerTransparency(\"layer\") -> float\n\
 \n\
 Returns the \"layer\" layer transparency,\n\
@@ -286,7 +286,7 @@
 May raise ValueError if the layer name isn't acceptable.\n\
 "));
 /*! Set layer visible */
-PyObject *scribus_glayertrans(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getlayertransparency(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_removelayer__doc__,

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp	Tue May 26 13:35:38 2020
@@ -31,17 +31,18 @@
 //		PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
 //		return nullptr;
 //	}
-	int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Polygon, PageItem::Rectangle,
-								pageUnitXToDocX(x), pageUnitYToDocY(y),
-								ValueToPoint(w), ValueToPoint(h),
-								ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineWidth,
-								ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeFillColor, ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineColor);
+	ScribusDoc* doc = ScCore->primaryMainWindow()->doc;
+	int i = doc->itemAdd(PageItem::Polygon, PageItem::Rectangle,
+						pageUnitXToDocX(x), pageUnitYToDocY(y),
+						ValueToPoint(w), ValueToPoint(h),
+						doc->itemToolPrefs().shapeLineWidth,
+						doc->itemToolPrefs().shapeFillColor, doc->itemToolPrefs().shapeLineColor);
 //	ScCore->primaryMainWindow()->doc->setRedrawBounding(ScCore->primaryMainWindow()->doc->Items->at(i));
 	if (strlen(Name) > 0)
 	{
 		QString objName = QString::fromUtf8(Name);
 		if (!ItemExists(objName))
-			ScCore->primaryMainWindow()->doc->Items->at(i)->setItemName(objName);
+			doc->Items->at(i)->setItemName(objName);
 	}
 	return PyString_FromString(ScCore->primaryMainWindow()->doc->Items->at(i)->itemName().toUtf8());
 }
@@ -529,10 +530,23 @@
 	Py_RETURN_NONE;
 }
 
+PyObject *scribus_gettextflowmode(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;
+
+	return PyInt_FromLong(static_cast<int>(item->textFlowMode()));
+};
 
 /* 03/21/2004 - exception raises by non existent name (subik)
  */
-PyObject *scribus_textflow(PyObject* /* self */, PyObject* args)
+PyObject *scribus_settextflowmode(PyObject* /* self */, PyObject* args)
 {
 	char *name = const_cast<char*>("");
 	int state = -1;
@@ -578,12 +592,47 @@
 	return PyBool_FromLong(static_cast<long>(false));
 }
 
+PyObject *scribus_getcharacterstyle(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 character style of a non-text frame.", "python error").toLocal8Bit().constData());
+		return NULL;
+	}
+
+	ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc;
+	StoryText&  itemText = item->itemText;
+
+	int selectionLength = itemText.selectionLength();	
+	if ((selectionLength > 0) || (currentDoc->appMode == modeEdit))
+	{
+		int cursorPos = (selectionLength > 0) ? itemText.startOfSelection() : itemText.cursorPosition();
+		const CharStyle& currentStyle = itemText.charStyle(cursorPos);
+		if (currentStyle.hasParent())
+			return PyString_FromString(currentStyle.parentStyle()->name().toUtf8());
+	}
+	else
+	{
+		const CharStyle& itemDefaultStyle = itemText.defaultStyle().charStyle();
+		if (itemDefaultStyle.hasParent())
+			return PyString_FromString(itemDefaultStyle.parentStyle()->name().toUtf8());
+	}
+	Py_RETURN_NONE;
+};
 
 /*
  * Vaclav Smilauer, 2017-21-21
  * Return style name of the object (or currently selected object)
  */
-PyObject *scribus_getstyle(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getparagraphstyle(PyObject* /* self */, PyObject* args)
 {
 	char *name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
@@ -599,11 +648,14 @@
 		return NULL;
 	}
 
-	int selectionLength = item->itemText.selectionLength();	
-	if (selectionLength > 0)
-	{
-		int selectionStart = item->itemText.startOfSelection();
-		const ParagraphStyle& currentStyle = item->itemText.paragraphStyle(selectionStart);
+	ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc;
+	StoryText&  itemText = item->itemText;
+
+	int selectionLength = itemText.selectionLength();	
+	if ((selectionLength > 0) || (currentDoc->appMode == modeEdit))
+	{
+		int cursorPos = (selectionLength > 0) ? itemText.startOfSelection() : itemText.cursorPosition();
+		const ParagraphStyle& currentStyle = itemText.paragraphStyle(cursorPos);
 		if (currentStyle.hasParent())
 			return PyString_FromString(currentStyle.parentStyle()->name().toUtf8());
 	}
@@ -623,7 +675,7 @@
  * Apply the named style to the currently selected object.
  * pv, 2004-09-13, optionaly param objectName + "check the page" stuff
  */
-PyObject *scribus_setstyle(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setparagraphstyle(PyObject* /* self */, PyObject* args)
 {
 	char *style = const_cast<char*>("");
 	char *name = const_cast<char*>("");
@@ -639,64 +691,52 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set style on a non-text frame.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-
-	// First, find the style number associated with the requested style
-	// by scanning through the styles looking for the name. If
-	// we can't find it, raise PyExc_Exception.
-	// FIXME: Should use a more specific exception.
-	bool found = false;
-	QString paraStyleName = QString::fromUtf8(style);
-	// We start at zero here because it's OK to match an internal name
+	
 	ScribusDoc*  currentDoc = ScCore->primaryMainWindow()->doc;
 	ScribusView* currentView = ScCore->primaryMainWindow()->view;
 	ScribusMainWindow* currentWin = ScCore->primaryMainWindow();
-	const StyleSet<ParagraphStyle> &docParagraphStyles = currentDoc->paragraphStyles();
-	int docParagraphStylesCount = docParagraphStyles.count();
-	for (int i=0; i < docParagraphStylesCount; ++i)
-	{
-		if (docParagraphStyles[i].name() == paraStyleName) {
-			found = true;
-			break;
-		}
-	}
-	if (!found) {
+
+	// First, check if style name provided by user is available in document
+	QString paraStyleName = QString::fromUtf8(style);
+	if (!currentDoc->paragraphStyles().contains(paraStyleName))
+	{
 		// whoops, the user specified an invalid style, complain loudly.
+		// FIXME: Should use a more specific exception.
 		PyErr_SetString(NotFoundError, QObject::tr("Style not found.","python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-	// for current item only
-	if (currentDoc->m_Selection->isEmpty() || (strlen(name) > 0))
-	{
-		// Store text selection as clearing object selection
-		// will also clear text selection
-		int selectionStart = -1;
-		int selectionLength = item->itemText.selectionLength();
-		if (selectionLength > 0)
-			selectionStart = item->itemText.startOfSelection();
-		// quick hack to always apply on the right frame - pv
-		currentView->deselectItems(true);
-		//CB I dont think we need to draw here. Its faster if we dont.
-		currentView->selectItem(item, false);
-		// Restore text selection if necessary
-		if (selectionStart >= 0)
-		{
-			item->itemText.deselectAll();
-			item->itemText.select(selectionStart, selectionLength);
-			item->HasSel = true;
-		}
-		// Now apply the style.
-		int mode = currentDoc->appMode;
-		currentDoc->appMode = modeEdit;
-		currentWin->setNewParStyle(paraStyleName);
-		currentDoc->appMode = mode;
-	}
-	else // for multiple selection
+
+	// For multiple selections or if current item has no text selected, we apply style in normal mode
+	if (currentDoc->m_Selection->isMultipleSelection() || (item->itemText.selectionLength() <= 0))
 	{
 		int mode = currentDoc->appMode;
 		currentDoc->appMode = modeNormal;
 		currentDoc->itemSelection_SetNamedParagraphStyle(paraStyleName);
 		currentDoc->appMode = mode;
-	}
+		Py_RETURN_NONE;
+	}
+
+	// For single items which have a text selection, we apply style in edit mode
+	// Store text selection as clearing object selection
+	// will also clear text selection
+	int selectionStart =  item->itemText.startOfSelection();
+	int selectionLength = item->itemText.selectionLength();
+	// Quick hack to always apply on the right frame - pv
+	currentView->deselectItems(true);
+	//CB I dont think we need to draw here. Its faster if we dont.
+	currentView->selectItem(item, false);
+	// Restore text selection if necessary
+	if (selectionStart >= 0)
+	{
+		item->itemText.deselectAll();
+		item->itemText.select(selectionStart, selectionLength);
+		item->HasSel = true;
+	}
+	// Now apply the style.
+	int mode = currentDoc->appMode;
+	currentDoc->appMode = modeEdit;
+	currentWin->setNewParStyle(paraStyleName);
+	currentDoc->appMode = mode;
 
 	Py_RETURN_NONE;
 }
@@ -722,108 +762,55 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set character style on a non-text frame.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-
-	// First, find the style number associated with the requested style
-	// by scanning through the styles looking for the name. If
-	// we can't find it, raise PyExc_Exception.
-	// FIXME: Should use a more specific exception.
-	bool found = false;
-	QString charStyleName = QString::fromUtf8(style);
-	// We start at zero here because it's OK to match an internal name
+	
 	ScribusDoc*  currentDoc = ScCore->primaryMainWindow()->doc;
 	ScribusView* currentView = ScCore->primaryMainWindow()->view;
 	ScribusMainWindow* currentWin = ScCore->primaryMainWindow();
-	const StyleSet<CharStyle> &docCharStyles = currentDoc->charStyles();
-	int docCharacterStylesCount = docCharStyles.count();
-	for (int i = 0; i < docCharacterStylesCount; ++i)
-	{
-		if (docCharStyles[i].name() == charStyleName) {
-			found = true;
-			break;
-		}
-	}
-	if (!found) {
+
+	// First, check if style name provided by user is available in document
+	QString charStyleName = QString::fromUtf8(style);
+	if (!currentDoc->charStyles().contains(charStyleName))
+	{
 		// whoops, the user specified an invalid style, complain loudly.
+		// FIXME: Should use a more specific exception.
 		PyErr_SetString(NotFoundError, QObject::tr("Character style not found.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-	// for current item only
-	if (currentDoc->m_Selection->isEmpty() || (strlen(name) > 0))
-	{
-		// Store text selection as clearing object selection
-		// will also clear text selection
-		int selectionStart = -1;
-		int selectionLength = item->itemText.selectionLength();
-		if (selectionLength > 0)
-			selectionStart = item->itemText.startOfSelection();
-		// quick hack to always apply on the right frame - pv
-		currentView->deselectItems(true);
-		//CB I dont think we need to draw here. Its faster if we dont.
-		currentView->selectItem(item, false);
-		// Restore text selection if necessary
-		if (selectionStart >= 0)
-		{
-			item->itemText.deselectAll();
-			item->itemText.select(selectionStart, selectionLength);
-			item->HasSel = true;
-		}	
-		// Now apply the style.
-		int mode = ScCore->primaryMainWindow()->doc->appMode;
-		currentDoc->appMode = modeEdit;
-		currentWin->setNewCharStyle(charStyleName);
-		currentDoc->appMode = mode;
-	}
-	else // for multiple selection
+
+	// For multiple selections or if current item has no text selected, we apply style in normal mode
+	if (currentDoc->m_Selection->isMultipleSelection() || (item->itemText.selectionLength() <= 0))
 	{
 		int mode = currentDoc->appMode;
 		currentDoc->appMode = modeNormal;
 		currentDoc->itemSelection_SetNamedCharStyle(charStyleName);
 		currentDoc->appMode = mode;
-	}
+		Py_RETURN_NONE;
+	}
+
+	// For single items which have a text selection, we apply style in edit mode
+	// Store text selection as clearing object selection
+	// will also clear text selection
+	int selectionStart =  item->itemText.startOfSelection();
+	int selectionLength = item->itemText.selectionLength();
+
+	// Quick hack to always apply on the right frame - pv
+	currentView->deselectItems(true);
+	//CB I dont think we need to draw here. Its faster if we dont.
+	currentView->selectItem(item, false);
+	// Restore text selection if necessary
+	if (selectionStart >= 0)
+	{
+		item->itemText.deselectAll();
+		item->itemText.select(selectionStart, selectionLength);
+		item->HasSel = true;
+	}	
+	// Now apply the style.
+	int mode = ScCore->primaryMainWindow()->doc->appMode;
+	currentDoc->appMode = modeEdit;
+	currentWin->setNewCharStyle(charStyleName);
+	currentDoc->appMode = mode;
 
 	Py_RETURN_NONE;
-}
-
-/*
- * Craig Ringer, 2004-09-09
- * Enumerate all known paragraph styles
- */
-PyObject *scribus_getstylenames(PyObject* /* self */)
-{
-	PyObject *styleList;
-	if (!checkHaveDocument())
-		return nullptr;
-	const auto& paragraphStyles = ScCore->primaryMainWindow()->doc->paragraphStyles();
-
-	styleList = PyList_New(0);
-	for (int i = 0; i < paragraphStyles.count(); ++i)
-	{
-		if (PyList_Append(styleList, PyString_FromString(paragraphStyles[i].name().toUtf8())))
-		{
-			// An exception will have already been set by PyList_Append apparently.
-			return nullptr;
-		}
-	}
-	return styleList;
-}
-
-PyObject *scribus_getcharstylenames(PyObject* /* self */)
-{
-	PyObject *charStyleList;
-	if (!checkHaveDocument())
-		return nullptr;
-	const auto& charStyles = ScCore->primaryMainWindow()->doc->charStyles();
-
-	charStyleList = PyList_New(0);
-	for (int i = 0; i < charStyles.count(); ++i)
-	{
-		if (PyList_Append(charStyleList, PyString_FromString(charStyles[i].name().toUtf8())))
-		{
-			// An exception will have already been set by PyList_Append apparently.
-			return nullptr;
-		}
-	}
-	return charStyleList;
 }
 
 PyObject *scribus_duplicateobject(PyObject * /* self */, PyObject *args)
@@ -848,7 +835,7 @@
 	currentWin->slotEditCopy();
 	currentWin->slotEditPaste();
 
-	Py_RETURN_NONE;
+	return PyString_FromString(currentDoc->m_Selection->itemAt(0)->itemName().toUtf8());
 }
 
 PyObject *scribus_copyobject(PyObject * /* self */, PyObject *args)
@@ -895,5 +882,27 @@
 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_getstyle__doc__ <<scribus_setstyle__doc__ <<scribus_getstylenames__doc__ <<scribus_getcharstylenames__doc__ <<scribus_duplicateobject__doc__ <<scribus_copyobject__doc__ <<scribus_pasteobject__doc__;
-}
+	s << scribus_bezierline__doc__
+	  << scribus_copyobject__doc__
+	  << scribus_deleteobj__doc__
+	  << scribus_duplicateobject__doc__
+	  << scribus_getcharacterstyle__doc__
+	  << scribus_getparagraphstyle__doc__
+	  << scribus_getstyle__doc__
+	  << scribus_newellipse__doc__
+	  << scribus_newimage__doc__
+	  << scribus_newline__doc__
+	  << scribus_newrect__doc__ 
+	  << scribus_newtable__doc__
+	  << scribus_newtext__doc__
+	  << scribus_objectexists__doc__
+	  << scribus_pasteobject__doc__
+	  << scribus_pathtext__doc__
+	  << scribus_polygon__doc__
+	  << scribus_polyline__doc__
+	  << scribus_setcharstyle__doc__
+	  << scribus_setparagraphstyle__doc__
+	  << scribus_setstyle__doc__
+	  << scribus_settextflowmode__doc__
+	  << scribus_textflowmode__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.h	Tue May 26 13:35:38 2020
@@ -195,9 +195,24 @@
  deleted else the active object erased. */
 PyObject *scribus_deleteobj(PyObject * /*self*/, PyObject* args);
 
-/*! docstring */
-PyDoc_STRVAR(scribus_textflow__doc__,
-QT_TR_NOOP("textFlowMode(\"name\" [, state])\n\
+PyDoc_STRVAR(scribus_gettextflowmode__doc__,
+QT_TR_NOOP("getTextFlowMode([\"name\"]) -> integer\n\
+\n\
+Return the current text flow mode used by item \"name\" as an integer.\n\
+If \"name\" is not given, the currently selected object is used.\n\
+\n\
+The function will return one of the following value:\n\
+- 0 : text flow around frame is disabled\n\
+- 1 : text flow around frame shape\n\
+- 2 : text flow around frame bounding box\n\
+- 3 : text flow around frame contour line\n\
+- 4 : text flow around image clip path\n\
+"));
+PyObject *scribus_gettextflowmode(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_settextflowmode__doc__,
+QT_TR_NOOP("setTextFlowMode(\"name\" [, state])\n\
 \n\
 Enables/disables \"Text Flows Around Frame\" feature for object \"name\".\n\
 Called with parameters string name and optional int \"state\" (0 <= state <= 3).\n\
@@ -207,6 +222,11 @@
 Setting \"state\" to 3 will make text flow around contour line.\n\
 If \"state\" is not passed, text flow is toggled.\n\
 "));
+PyDoc_STRVAR(scribus_textflowmode__doc__,
+QT_TR_NOOP("textFlowMode(\"name\" [, state])\n\
+\n\
+Deprecated. Use setTextFlowMode() instead.\n\
+"));
 /**
 Enables/disables "Text Flows Around Object" feature for object.
 Called with params string objectName and state 0|1|2|3.
@@ -215,7 +235,7 @@
 empty flowing is reverted.
 02/28/2004 petr vanek
  */
-PyObject *scribus_textflow(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_settextflowmode(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_objectexists__doc__,
@@ -234,79 +254,83 @@
 */
 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\
+/*! docstring */
+PyDoc_STRVAR(scribus_getcharacterstyle__doc__,
+QT_TR_NOOP("getCharacterStyle([\"name\"])\n\
+\n\
+Return name of character 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 character style is returned.\n\
+"));
+PyObject *scribus_getcharacterstyle(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getparagraphstyle__doc__,
+QT_TR_NOOP("getParagraphStyle([\"name\"])\n\
+\n\
+Return name of paragraph 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\
 "));
+
+PyDoc_STRVAR(scribus_getstyle__doc__,
+QT_TR_NOOP("getStyle([\"name\"])\n\
+\n\
+Deprecated. Use getParagraphStyle() instead.\n\
+"));
 /**
  Vaclav Smilauer, 2017-12-21
  Return style name of the object (or currently selected object)
  */
-PyObject *scribus_getstyle(PyObject * /*self*/, PyObject* args);
-
-
-/*! docstring */
+PyObject *scribus_getparagraphstyle(PyObject * /*self*/, PyObject* args);
+
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setparagraphstyle__doc__,
+QT_TR_NOOP("setParagraphStyle(\"style\" [, \"name\"])\n\
+\n\
+Apply the named paragraph \"style\" to the object named \"name\".\n\
+If  object name is not provided, style is applied on current object selection.\n\
+If multiple objects are selected or if selected object has no text selection,\n\
+style is applied on selected objects. Otherwise style is applied to the current\n\
+text selection.\n\
+"));
+
 PyDoc_STRVAR(scribus_setstyle__doc__,
 QT_TR_NOOP("setStyle(\"style\" [, \"name\"])\n\
 \n\
-Apply the named \"style\" to the object named \"name\". If object name is\n\
-given, style is applied to the current text selection in object \"name\".\n\
-If no object name is given, style is applied on selected object.\n\
+Deprecated. Use setParagraphStyle() instead.\n\
 "));
 /**
  Craig Ringer, 2004-09-09
  Apply the named style to the currently selected object.
  pv, 2004-09-13, optionaly param objectName + "check the page" stuff
  */
-PyObject *scribus_setstyle(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_setparagraphstyle(PyObject * /*self*/, PyObject* args);
 
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setcharstyle__doc__,
-	QT_TR_NOOP("setCharacterStyle(\"style\" [, \"name\"])\n\
-\n\
-Apply the named character \"style\" to the object named \"name\". If object name is\n\
-given, style is applied to the current text selection in object \"name\".\n\
-If no object name is given, style is applied on selected object.\n\
+QT_TR_NOOP("setCharacterStyle(\"style\" [, \"name\"])\n\
+\n\
+Apply the named character \"style\" to the object named \"name\".\n\
+If  object name is not provided, style is applied on current object selection.\n\
+If multiple objects are selected or if selected object has no text selection,\n\
+style is applied on selected objects. Otherwise style is applied to the current\n\
+text selection.\n\
 "));
 /**
 Apply the named character style to the currently selected object.
 */
 PyObject *scribus_setcharstyle(PyObject * /*self*/, PyObject* args);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_getstylenames__doc__,
-QT_TR_NOOP("getAllStyles() -> list\n\
-\n\
-Return a list of the names of all paragraph styles in the current document.\n\
-"));
-/**
- Craig Ringer, 2004-09-09
- Enumerate all known paragraph styles
-*/
-PyObject *scribus_getstylenames(PyObject * /*self*/);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_getcharstylenames__doc__,
-QT_TR_NOOP("getCharStyles() -> list\n\
-\n\
-Return a list of the names of all character styles in the current document.\n\
-"));
-PyObject *scribus_getcharstylenames(PyObject * /*self*/);
-
 
 /*! docstring */
 PyDoc_STRVAR(scribus_duplicateobject__doc__,
 QT_TR_NOOP("duplicateObject([\"name\"]) -> string\n\
 \n\
-creates a Duplicate of the selected Object (or Selection Group).\n\
+creates a duplicate of the selected object (or Selection Group). Returns name of new object.\n\
 "));
 /**
  Christian Hausknecht, 2006-07-12

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp	Tue May 26 13:35:38 2020
@@ -14,7 +14,7 @@
 
 #include <QApplication>
 
-PyObject *scribus_actualpage(PyObject* /* self */)
+PyObject *scribus_currentpage(PyObject* /* self */)
 {
 	if (!checkHaveDocument())
 		return nullptr;
@@ -27,8 +27,7 @@
 		return nullptr;
 	ScCore->primaryMainWindow()->view->DrawNew();
 	qApp->processEvents();
- //	Py_INCREF(Py_None);
- //	return Py_None;
+
 	Py_RETURN_NONE;
 }
 
@@ -185,7 +184,7 @@
 	return t;
 }
 
-PyObject *scribus_pagensize(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getpagensize(PyObject* /* self */, PyObject* args)
 {
 	int e;
 	if (!PyArg_ParseTuple(args, "i", &e))
@@ -209,7 +208,7 @@
 	return t;
 }
 
-PyObject *scribus_pagenmargins(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getpagenmargins(PyObject* /* self */, PyObject* args)
 {
 	int e;
 	if (!PyArg_ParseTuple(args, "i", &e))
@@ -314,8 +313,7 @@
 		}
 		currentDoc->currentPage()->guides.addHorizontal(ValueToPoint(guide), GuideManagerCore::Standard);
 	}
- 	Py_INCREF(Py_None);
- 	return Py_None;
+
 	Py_RETURN_NONE;
 }
 
@@ -367,8 +365,7 @@
 		}
 		currentDoc->currentPage()->guides.addVertical(ValueToPoint(guide), GuideManagerCore::Standard);
 	}
-// 	Py_INCREF(Py_None);
-// 	return Py_None;
+
 	Py_RETURN_NONE;
 }
 
@@ -529,13 +526,22 @@
 void cmdpagedocwarnings()
 {
 	QStringList s;
-	s << scribus_newpage__doc__        << scribus_pageposition__doc__
-	  << scribus_actualpage__doc__     << scribus_redraw__doc__
-	  << scribus_savepageeps__doc__    << scribus_deletepage__doc__
-	  << scribus_gotopage__doc__       << scribus_pagecount__doc__
-	  << scribus_getHguides__doc__     << scribus_setHguides__doc__
-	  << scribus_getVguides__doc__     << scribus_setVguides__doc__
-	  << scribus_pagedimension__doc__  << scribus_getpageitems__doc__
-	  << scribus_getpagemargins__doc__ << scribus_importpage__doc__
-	  << scribus_pagensize__doc__      << scribus_pagenmargins__doc__;
-}
+	s << scribus_currentpage__doc__
+	  << scribus_deletepage__doc__
+	  << scribus_getHguides__doc__
+	  << scribus_getVguides__doc__
+	  << scribus_getpageitems__doc__
+	  << scribus_getpagemargins__doc__
+	  << scribus_getpagensize__doc__ 
+	  << scribus_getpagetype__doc__
+	  << scribus_gotopage__doc__
+	  << scribus_importpage__doc__
+	  << scribus_newpage__doc__
+	  << scribus_pagecount__doc__
+	  << scribus_pagedimension__doc__
+	  << scribus_getpagenmargins__doc__ 
+	  << scribus_redraw__doc__
+	  << scribus_savepageeps__doc__           
+	  << scribus_setHguides__doc__
+	  << scribus_setVguides__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.h	Tue May 26 13:35:38 2020
@@ -28,14 +28,14 @@
 PyObject *scribus_newpage(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_actualpage__doc__,
+PyDoc_STRVAR(scribus_currentpage__doc__,
 QT_TR_NOOP("currentPage() -> integer\n\
 \n\
 Returns the number of the current working page. Page numbers are counted from 1\n\
 upwards, no matter what the displayed first page number of your document is.\n\
 "));
 /*! get actual page */
-PyObject *scribus_actualpage(PyObject * /*self*/);
+PyObject *scribus_currentpage(PyObject * /*self*/);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_redraw__doc__,
@@ -47,13 +47,13 @@
 PyObject *scribus_redraw(PyObject * /*self*/);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_pageposition__doc__,
+PyDoc_STRVAR(scribus_getpagetype__doc__,
 QT_TR_NOOP("getPageType() -> integer\n\
 \n\
 Returns the type of the Page, 0 means left Page, 1 is a middle Page and 2 is a right Page\n\
 "));
 /*! Go to page */
-PyObject *scribus_pageposition(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getpagetype(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_savepageeps__doc__,
@@ -157,7 +157,7 @@
 PyObject *scribus_pagedimension(PyObject * /*self*/);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_pagensize__doc__,
+PyDoc_STRVAR(scribus_getpagensize__doc__,
 QT_TR_NOOP("getPageNSize(nr) -> tuple\n\
 \n\
 Returns a tuple with a particular page's size measured in the document's current units.\n\
@@ -167,7 +167,7 @@
 returns a tuple with a particular page's size  in used system
 e.g. when is the doc in picas returns picas ;)
 */
-PyObject *scribus_pagensize(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getpagensize(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getpagemargins__doc__,
@@ -183,7 +183,7 @@
 PyObject *scribus_getpagemargins(PyObject * /*self*/);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_pagenmargins__doc__,
+PyDoc_STRVAR(scribus_getpagenmargins__doc__,
 QT_TR_NOOP("getPageNMargins(nr) -> tuple\n\
 \n\
 Returns a tuple with a particular page's margins measured in the document's current units.\n\
@@ -193,7 +193,7 @@
 returns a tuple with a particular page's size  in used system
 e.g. when is the doc in picas returns picas ;)
 */
-PyObject *scribus_pagenmargins(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getpagenmargins(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getpageitems__doc__,

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp	Tue May 26 13:35:38 2020
@@ -360,7 +360,7 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_setcornerrad(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setcornerradius(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	int w;
@@ -413,11 +413,13 @@
 		return nullptr;
 	if (!checkHaveDocument())
 		return nullptr;
+
 	PageItem *currItem = GetUniqueItem(QString::fromUtf8(Name));
 	if (currItem == nullptr)
 		return nullptr;
 	currItem->setItemName(newName);
-	Py_RETURN_NONE;
+
+	return PyString_FromString(currItem->itemName().toUtf8());
 }
 
 PyObject *scribus_setobjectattributes(PyObject* /* self */, PyObject* args)
@@ -532,14 +534,23 @@
 void cmdsetpropdocwarnings()
 {
 	QStringList s;
-	s << scribus_setgradfill__doc__  << scribus_setgradstop__doc__
+	s << scribus_setcornerradius__doc__
 	  << scribus_setcustomlinestyle__doc__
-	  << scribus_setfillcolor__doc__ << scribus_setfilltrans__doc__ 
-	  << scribus_setfillblend__doc__ << scribus_setlinecolor__doc__ 
-	  << scribus_setlinetrans__doc__ << scribus_setlineblend__doc__ 
-	  << scribus_setlinewidth__doc__ << scribus_setlineshade__doc__ 
-	  << scribus_setlinejoin__doc__  << scribus_setlinecap__doc__   
-	  << scribus_setlinestyle__doc__ << scribus_setfillshade__doc__ 
-	  << scribus_setcornerrad__doc__ << scribus_setmultiline__doc__
-	  << scribus_setnewname__doc__   << scribus_setobjectattributes__doc__;
-}
+	  << scribus_setfillblend__doc__
+	  << scribus_setfillcolor__doc__
+	  << scribus_setfillshade__doc__
+	  << scribus_setfilltrans__doc__
+	  << scribus_setgradfill__doc__ 
+	  << scribus_setgradstop__doc__
+	  << scribus_setitemname__doc__
+	  << scribus_setlineblend__doc__
+	  << scribus_setlinecap__doc__ 
+	  << scribus_setlinecolor__doc__
+	  << scribus_setlinejoin__doc__
+	  << scribus_setlineshade__doc__
+	  << scribus_setlinestyle__doc__
+	  << scribus_setlinetrans__doc__ 
+	  << scribus_setlinewidth__doc__ 
+	  << scribus_setmultiline__doc__     
+	  << scribus_setobjectattributes__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.h	Tue May 26 13:35:38 2020
@@ -183,7 +183,7 @@
 PyObject *scribus_setfillshade(PyObject * /*self*/, PyObject* args);
 
 /*! docstringscribus_setmultiline__doc__ */
-PyDoc_STRVAR(scribus_setcornerrad__doc__,
+PyDoc_STRVAR(scribus_setcornerradius__doc__,
 QT_TR_NOOP("setCornerRadius(radius, [\"name\"])\n\
 \n\
 Sets the corner radius of the object \"name\". The radius is expressed\n\
@@ -192,7 +192,7 @@
 May raise ValueError if the corner radius is negative.\n\
 "));
 /*! Set corner radius */
-PyObject *scribus_setcornerrad(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_setcornerradius(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setmultiline__doc__,
@@ -207,16 +207,16 @@
 PyObject *scribus_setmultiline(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_setnewname__doc__,
-QT_TR_NOOP("setNewName(newname, [\"name\"])\n\
-\n\
-Sets the new name of the object \"name\" to the newname.\n\
-If \"name\" is not given the currently selected item is used.\n\
-\n\
-May raise NotFoundError if the line style doesn't exist.\n\
+PyDoc_STRVAR(scribus_setitemname__doc__,
+QT_TR_NOOP("setitemname(newName, [\"name\"])\n\
+\n\
+Sets the name of object \"name\" to newName and returns the name applied.\n\
+If \"name\" is not given the currently selected item is used.\n\
+\n\
+May raise NotFoundError if the object doesn't exist.\n\
 "));
 /*! Set newname */
-PyObject *scribus_setnewname(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_setitemname(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setobjectattributes__doc__,

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.cpp	Tue May 26 13:35:38 2020
@@ -206,11 +206,11 @@
 	double strikethruOffset = dbl_min, strikethruWidth = dbl_min;
 	double tracking = dbl_min;
 	
-	if (!PyArg_ParseTupleAndKeywords(args, keywords, "es|esdesesdesddddddddddddes", keywordargs,
+	if (!PyArg_ParseTupleAndKeywords(args, keywords, "es|esdesesdesddddddddddddeses", keywordargs,
 									"utf-8", &name, "utf-8", &font, &fontSize, "utf-8", &features,
 									"utf-8", &fillColor, &fillShade, "utf-8", &strokeColor, &strokeShade, &baselineOffset, &shadowXOffset,
 									&shadowYOffset, &outlineWidth, &underlineOffset, &underlineWidth, &strikethruOffset, &strikethruWidth,
-									&scaleH, &scaleV, &tracking, "utf-8", &language))
+									&scaleH, &scaleV, &tracking, "utf-8", &language, "utf-8", &fontFeatures))
 		return nullptr;
 	
 	if (strlen(name) == 0)
@@ -396,6 +396,117 @@
 	Py_RETURN_NONE;
 }
 
+/*
+ * Craig Ringer, 2004-09-09
+ * Enumerate all known paragraph styles
+ */
+PyObject *scribus_getparagraphstyles(PyObject* /* self */)
+{
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& paragraphStyles = ScCore->primaryMainWindow()->doc->paragraphStyles();
+
+	PyObject *styleList = PyList_New(0);
+	for (int i = 0; i < paragraphStyles.count(); ++i)
+	{
+		const QString& paraStyleName = paragraphStyles[i].name();
+		if (PyList_Append(styleList, PyString_FromString(paraStyleName.toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return styleList;
+}
+
+/*
+ * Enumerate all known character styles
+ */
+PyObject *scribus_getcharstylenames(PyObject* /* self */)
+{
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& charStyles = ScCore->primaryMainWindow()->doc->charStyles();
+
+	PyObject *charStyleList = PyList_New(0);
+	for (int i = 0; i < charStyles.count(); ++i)
+	{
+		const QString& charStyleName = charStyles[i].name();
+		if (PyList_Append(charStyleList, PyString_FromString(charStyleName.toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return charStyleList;
+}
+
+/*
+ * Enumerate all known line styles
+ */
+PyObject *scribus_getlinestyles(PyObject* /* self */)
+{
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& lineStyles = ScCore->primaryMainWindow()->doc->lineStyles();
+
+	PyObject *lineStyleList = PyList_New(0);
+	auto itEnd = lineStyles.constEnd();
+	for (auto it = lineStyles.constBegin(); it != itEnd; ++it)
+	{
+		QString lineStyleName = it.key();
+		if (PyList_Append(lineStyleList, PyString_FromString(lineStyleName.toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return lineStyleList;
+}
+
+/*
+ * Enumerate all known cell styles
+ */
+PyObject *scribus_getcellstyles(PyObject* /* self */)
+{
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& cellStyles = ScCore->primaryMainWindow()->doc->cellStyles();
+
+	PyObject *styleList = PyList_New(0);
+	for (int i = 0; i < cellStyles.count(); ++i)
+	{
+		const QString& cellStyleName = cellStyles[i].name();
+		if (PyList_Append(styleList, PyString_FromString(cellStyleName.toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return styleList;
+}
+
+/*
+ * Enumerate all known table styles
+ */
+PyObject *scribus_gettablestyles(PyObject* /* self */)
+{
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& tableStyles = ScCore->primaryMainWindow()->doc->tableStyles();
+
+	PyObject *styleList = PyList_New(0);
+	for (int i = 0; i < tableStyles.count(); ++i)
+	{
+		const QString& tableStyleName = tableStyles[i].name();
+		if (PyList_Append(styleList, PyString_FromString(tableStyleName.toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return styleList;
+}
 
 /*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
 with header files structure untouched (docstrings are kept near declarations)
@@ -403,6 +514,11 @@
 void cmdstyledocwarnings()
 {
 	QStringList s;
-	s << scribus_createparagraphstyle__doc__ << scribus_createcharstyle__doc__;
-	s << scribus_createcustomlinestyle__doc__;
-}
+	s  << scribus_createcharstyle__doc__
+	   << scribus_createcustomlinestyle__doc__
+	   << scribus_createparagraphstyle__doc__
+	   << scribus_getallstyles__doc__
+	   << scribus_getcharstylenames__doc__
+	   << scribus_getlinestyles__doc__
+	   << scribus_getparagraphstyles__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdstyle.h	Tue May 26 13:35:38 2020
@@ -107,5 +107,55 @@
 "));
 PyObject *scribus_createcustomlinestyle(PyObject * /* self */, PyObject* args);
 
+/*! docstring */
+PyDoc_STRVAR(scribus_getparagraphstyles__doc__,
+QT_TR_NOOP("getParagraphStyles() -> list\n\
+\n\
+Return a list of the names of all paragraph styles in the current document.\n\
+"));
+
+PyDoc_STRVAR(scribus_getallstyles__doc__,
+QT_TR_NOOP("getAllStyles() -> list\n\
+\n\
+Deprecated. Use getParagraphStyles() instead.\n\
+"));
+/**
+ Craig Ringer, 2004-09-09
+ Enumerate all known paragraph styles
+*/
+PyObject *scribus_getparagraphstyles(PyObject * /*self*/);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getcharstylenames__doc__,
+QT_TR_NOOP("getCharStyles() -> list\n\
+\n\
+Return a list of the names of all character styles in the current document.\n\
+"));
+PyObject *scribus_getcharstylenames(PyObject * /*self*/);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getlinestyles__doc__,
+QT_TR_NOOP("getLineStyles() -> list\n\
+\n\
+Return a list of the names of all line styles in the current document.\n\
+"));
+PyObject *scribus_getlinestyles(PyObject * /*self*/);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getcellstyles__doc__,
+QT_TR_NOOP("getCellStyles() -> list\n\
+\n\
+Return a list of the names of all cell styles in the current document.\n\
+"));
+PyObject *scribus_getcellstyles(PyObject * /*self*/);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_gettablestyles__doc__,
+QT_TR_NOOP("getTableStyles() -> list\n\
+\n\
+Return a list of the names of all table styles in the current document.\n\
+"));
+PyObject *scribus_gettablestyles(PyObject * /*self*/);
+
 #endif
 

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtable.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtable.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtable.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtable.cpp	Tue May 26 13:35:38 2020
@@ -520,14 +520,23 @@
 void cmdtabledocwarnings()
 {
 	QStringList s;
-	s << scribus_gettablecolumns__doc__ << scribus_gettablerows__doc__
-	  << scribus_inserttablerows__doc__ << scribus_removetablerows__doc__
-	  << scribus_inserttablecolumns__doc__ << scribus_removetablecolumns__doc__
-	  << scribus_gettablerowheight__doc__ << scribus_gettablecolumnwidth__doc__
-	  << scribus_resizetablerow__doc__ << scribus_resizetablecolumn__doc__
-	  << scribus_mergetablecells__doc__ << scribus_settablestyle__doc__
-	  << scribus_gettablestyle__doc__ << scribus_settablefillcolor__doc__
-	  << scribus_gettablefillcolor__doc__ << scribus_settableleftborder__doc__
-	  << scribus_settablerightborder__doc__ << scribus_settabletopborder__doc__
-	  << scribus_settablebottomborder__doc__;
-}
+	s << scribus_gettablecolumns__doc__
+	  << scribus_gettablecolumnwidth__doc__
+	  << scribus_gettablefillcolor__doc__
+	  << scribus_gettablerowheight__doc__
+	  << scribus_gettablerows__doc__
+	  << scribus_gettablestyle__doc__
+	  << scribus_inserttablecolumns__doc__ 
+	  << scribus_inserttablerows__doc__
+	  << scribus_mergetablecells__doc__
+	  << scribus_removetablerows__doc__
+	  << scribus_removetablecolumns__doc__
+	  << scribus_resizetablecolumn__doc__
+	  << scribus_resizetablerow__doc__ 
+	  << scribus_settablebottomborder__doc__
+	  << scribus_settablefillcolor__doc__
+	  << scribus_settableleftborder__doc__
+	  << scribus_settablerightborder__doc__
+	  << scribus_settablestyle__doc__
+	  << scribus_settabletopborder__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp	Tue May 26 13:35:38 2020
@@ -152,7 +152,7 @@
 	return PyInt_FromLong(item->currentCharStyle().fillShade());
 }
 
-PyObject *scribus_gettextsize(PyObject* /* self */, PyObject* args)
+PyObject *scribus_gettextlength(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
@@ -338,7 +338,7 @@
 	return PyString_FromString(text.toUtf8());
 }
 
-PyObject *scribus_gettext(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getalltext(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
@@ -371,7 +371,7 @@
 	return PyString_FromString(text.toUtf8());
 }
 
-PyObject *scribus_setboxtext(PyObject* /* self */, PyObject* args)
+PyObject *scribus_settext(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
 	char *Text;
@@ -387,12 +387,12 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text of non-text frame.","python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-	QString Daten = QString::fromUtf8(Text);
-	Daten.replace("\r\n", SpecialChars::PARSEP);
-	Daten.replace(QChar('\n') , SpecialChars::PARSEP);
+	QString userText = QString::fromUtf8(Text);
+	userText.replace("\r\n", SpecialChars::PARSEP);
+	userText.replace(QChar('\n') , SpecialChars::PARSEP);
 	PyMem_Free(Text);
 	currItem->itemText.clear();
-	currItem->itemText.insertChars(0, Daten);
+	currItem->itemText.insertChars(0, userText);
 	currItem->invalidateLayout();
 
 	Py_RETURN_NONE;
@@ -427,6 +427,8 @@
 	if (pos == -1)
 		pos = item->itemText.length();
 	item->itemText.insertChars(pos, textData, true);
+	item->invalidateLayout();
+
 	Py_RETURN_NONE;
 }
 
@@ -461,6 +463,59 @@
 	gt.launchImporter(-1, fileName, false, QString("utf-8"), false, true, item);
 
 	// FIXME: PyMem_Free() - are any needed??
+	Py_RETURN_NONE;
+}
+
+PyObject *scribus_layouttext(PyObject* /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
+		return nullptr;
+	if (!checkHaveDocument())
+		return nullptr;
+	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
+	if (item == nullptr)
+		return nullptr;
+	if (!item->isTextFrame() && !item->isPathText())
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot layout text of a non-text frame.", "python error").toLocal8Bit().constData());
+		return nullptr;
+	}
+	item->layout();
+
+	Py_RETURN_NONE;
+}
+
+PyObject *scribus_layouttextchain(PyObject* /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
+		return nullptr;
+	if (!checkHaveDocument())
+		return nullptr;
+	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
+	if (item == nullptr)
+		return nullptr;
+	if (!item->isTextFrame() && !item->isPathText())
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot layout text chain for a non-text frame.", "python error").toLocal8Bit().constData());
+		return nullptr;
+	}
+
+	if (item->isPathText())
+	{
+		item->layout();
+		Py_RETURN_NONE;
+	}
+	
+	PageItem* firstFrame = item->firstInChain();
+	PageItem* nextFrame = firstFrame;
+	while (nextFrame)
+	{
+		nextFrame->layout();
+		nextFrame = nextFrame->nextInChain();
+	}
+
 	Py_RETURN_NONE;
 }
 
@@ -853,8 +908,6 @@
 	if (selcount == 0)
 	{
 		item->HasSel = false;
-//		Py_INCREF(Py_None);
-//		return Py_None;
 		Py_RETURN_NONE;
 	}
 	item->itemText.select(start, selcount, true);
@@ -912,18 +965,6 @@
 		return nullptr;
 	}
 	ApplyCharstyleHelper<QString>(item, QString::fromUtf8(Color)).apply(&CharStyle::setFillColor, 0, item->itemText.length());
-//	for (int b = 0; b < item->itemText.length(); b++)
-//	{
-//		//FIXME: doc method
-//		if (item->HasSel)
-//		{
-//			if (item->itemText.selected(b))
-//				item->itemText.item(b)->setFillColor(QString::fromUtf8(Color));
-//		}
-//		else
-//			item->itemText.item(b)->setFillColor(QString::fromUtf8(Color));
-//	}
-//	item->TxtFill = QString::fromUtf8(Color);
 	Py_RETURN_NONE;
 }
 
@@ -944,18 +985,6 @@
 		return nullptr;
 	}
 	ApplyCharstyleHelper<QString>(item, QString::fromUtf8(Color)).apply(&CharStyle::setStrokeColor, 0, item->itemText.length());
-//	for (int b = 0; b < item->itemText.length(); b++)
-//	{
-//		//FIXME:NLS use document method for this
-//		if (item->HasSel)
-//		{
-//			if (item->itemText.selected(b))
-//				item->itemText.item(b)->setStrokeColor(QString::fromUtf8(Color));
-//		}
-//		else
-//			item->itemText.item(b)->setStrokeColor(QString::fromUtf8(Color));
-//	}
-//	item->TxtStroke = QString::fromUtf8(Color);
 	Py_RETURN_NONE;
 }
 
@@ -1052,18 +1081,6 @@
 		return nullptr;
 	}
 	ApplyCharstyleHelper<double>(item, w).apply(&CharStyle::setFillShade, 0, item->itemText.length());
-//	//FIXME:NLS use document method for that
-//	for (int b = 0; b < item->itemText.length(); ++b)
-//	{
-//		if (item->HasSel)
-//		{
-//			if (item->itemText.selected(b))
-//				item->itemText.item(b)->setFillShade(w);
-//		}
-//		else
-//			item->itemText.item(b)->setFillShade(w);
-//	}
-//	item->ShTxtFill = w;
 	Py_RETURN_NONE;
 }
 
@@ -1170,7 +1187,7 @@
  * 2004-09-07 (Craig Ringer)
  * 2004-09-14 pv frame type, optional frame name param
  */
-PyObject *scribus_tracetext(PyObject* /* self */, PyObject* args)
+PyObject *scribus_outlinetext(PyObject* /* self */, PyObject* args)
 {
 	char *name = const_cast<char*>("");
 	if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
@@ -1343,25 +1360,51 @@
 void cmdtextdocwarnings()
 {
 	QStringList s;
-	s << scribus_getfontsize__doc__    << scribus_getfont__doc__
-	  << scribus_gettextlines__doc__   << scribus_gettextsize__doc__
-	  << scribus_getframetext__doc__   << scribus_gettext__doc__
-	  << scribus_getlinespace__doc__   << scribus_getcolumngap__doc__
-	  << scribus_getcolumns__doc__     << scribus_setboxtext__doc__
+	s << scribus_dehyphenatetext__doc__
+	  << scribus_deletetext__doc__
+	  << scribus_getalltext__doc__
+	  << scribus_getcolumngap__doc__
+	  << scribus_getcolumns__doc__
+	  << scribus_getfont__doc__
+	  << scribus_getfontfeatures__doc__
+	  << scribus_getfontsize__doc__
+	  << scribus_getframetext__doc__
+	  << scribus_getlinespace__doc__
+	  << scribus_gettext__doc__ // Deprecated
+	  << scribus_gettextcolor__doc__
+	  << scribus_gettextdistances__doc__
+	  << scribus_gettextlength__doc__
+	  << scribus_gettextlines__doc__
+	  << scribus_gettextshade__doc__
 	  << scribus_gettextverticalalignment__doc__
-	  << scribus_inserttext__doc__     << scribus_inserthtmltext__doc__<< scribus_setfont__doc__
-	  << scribus_setfontsize__doc__    << scribus_setlinespace__doc__
-	  << scribus_setcolumngap__doc__   << scribus_setcolumns__doc__
+	  << scribus_hyphenatetext__doc__
+	  << scribus_inserthtmltext__doc__
+	  << scribus_inserttext__doc__
+	  << scribus_ispdfbookmark__doc__
+	  << scribus_istextoverflowing__doc__
+	  << scribus_layouttext__doc__
+	  << scribus_layouttextchain__doc__
+	  << scribus_linktextframes__doc__
+	  << scribus_outlinetext__doc__
+	  << scribus_selecttext__doc__
+	  << scribus_setalign__doc__
+	  << scribus_setcolumngap__doc__
+	  << scribus_setcolumns__doc__
+	  << scribus_setdirection__doc__
+	  << scribus_setfont__doc__
+	  << scribus_setfontfeatures__doc__
+	  << scribus_setfontsize__doc__
+	  << scribus_setlinespace__doc__
+	  << scribus_setlinespacemode__doc__
+	  << scribus_setpdfbookmark__doc__
+	  << scribus_settextdistances__doc__
+	  << scribus_settext__doc__
+	  << scribus_settextfill__doc__
+	  << scribus_settextscalingh__doc__
+	  << scribus_settextscalingv__doc__
+	  << scribus_settextshade__doc__
+	  << scribus_settextstroke__doc__
 	  << scribus_settextverticalalignment__doc__
-	  << scribus_setalign__doc__       << scribus_selecttext__doc__
-	  << scribus_deletetext__doc__     << scribus_settextfill__doc__
-	  << scribus_settextstroke__doc__  << scribus_settextshade__doc__
-	  << scribus_linktextframes__doc__ << scribus_unlinktextframes__doc__
-	  << scribus_tracetext__doc__      << scribus_istextoverflowing__doc__
-	  << scribus_setpdfbookmark__doc__ << scribus_ispdfbookmark__doc__
-	  << scribus_hyphenatetext__doc__ << scribus_dehyphenatetext__doc__
-	  << scribus_gettextdistances__doc__ << scribus_settextdistances__doc__
-	  << scribus_settextscalingh__doc__ << scribus_settextscalingv__doc__
-	  << scribus_setlinespacemode__doc__ << scribus_setdirection__doc__
-	  << scribus_setfontfeatures__doc__ << scribus_getfontfeatures__doc__;
-}
+	  << scribus_tracetext__doc__
+	  << scribus_unlinktextframes__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.h	Tue May 26 13:35:38 2020
@@ -73,14 +73,14 @@
 PyObject *scribus_gettextshade(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_gettextsize__doc__,
+PyDoc_STRVAR(scribus_gettextlength__doc__,
 QT_TR_NOOP("getTextLength([\"name\"]) -> integer\n\
 \n\
 Returns the length of the text in the text frame \"name\".\n\
 If \"name\" is not given the currently selected item is used.\n\
 "));
 /*! Get text size */
-PyObject *scribus_gettextsize(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_gettextlength(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_gettextlines__doc__,
@@ -88,24 +88,39 @@
 \n\
 Returns the number of lines of the text in the text frame \"name\".\n\
 If \"name\" is not given the currently selected item is used.\n\
+\n\
+As this function depends on text layout being up-to-date, you may need to call \n\
+layoutText() or layoutTextChain() before calling this function in order to get \n\
+expected result.\n\
 "));
 /*! Get text lines */
 PyObject *scribus_gettextlines(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getframetext__doc__,
+QT_TR_NOOP("getFrameText([\"name\"]) -> string\n\
+\n\
+Returns the text visible in text frame \"name\". If this text frame has some text\n\
+selected, the selected text is returned. If \"name\" is not given the currently\n\
+selected item is used.\n\
+\n\
+This function returns only the text visible in specified frame. If you need to \n\
+retrieve the text contained in a text chain, use getAllText() instead.\n\
+\n\
+As this function depends on text layout being up-to-date, you may need to call \n\
+layoutText() or layoutTextChain() before calling this function in order to get \n\
+expected result.\n\
+"));
+PyDoc_STRVAR(scribus_gettext__doc__,
 QT_TR_NOOP("getText([\"name\"]) -> string\n\
 \n\
-Returns the text of the text frame \"name\". If this text frame has some text\n\
-selected, the selected text is returned. All text in the frame, not just\n\
-currently visible text, is returned. If \"name\" is not given the currently\n\
-selected item is used.\n\
+Deprecated. Use getFrameText() instead.\n\
 "));
 /*! Get frame text */
 PyObject *scribus_getframetext(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_gettext__doc__,
+PyDoc_STRVAR(scribus_getalltext__doc__,
 QT_TR_NOOP("getAllText([\"name\"]) -> string\n\
 \n\
 Returns the text of the text frame \"name\" and of all text frames which are\n\
@@ -114,7 +129,7 @@
 used.\n\
 "));
 /*! Get all text */
-PyObject *scribus_gettext(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getalltext(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getlinespace__doc__,
@@ -168,7 +183,7 @@
 PyObject *scribus_getcolumns(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_setboxtext__doc__,
+PyDoc_STRVAR(scribus_settext__doc__,
 QT_TR_NOOP("setText(\"text\", [\"name\"])\n\
 \n\
 Sets the text of the text frame \"name\" to the text of the string \"text\".\n\
@@ -177,7 +192,7 @@
 used.\n\
 "));
 /*! Set text */
-PyObject *scribus_setboxtext(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_settext(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_inserttext__doc__,
@@ -186,7 +201,12 @@
 Inserts the text \"text\" at the position \"pos\" into the text frame \"name\".\n\
 Text must be UTF encoded (see setText() as reference) The first character has an\n\
 index of 0. Inserting text at position -1 appends it to the frame. If \"name\" is\n\
-not given the currently selected Item is used.\n\
+not given the currently selected item is used.\n\
+\n\
+For performance reason, this function does not update text layout in any way. \n\
+As a consequence, you may need to call layoutText() or layoutTextChain() at appropriate \n\
+times after calling this function and before calling functions such as getFrameText() \n\
+or getTextLines().\n\
 \n\
 May throw IndexError for an insertion out of bounds.\n\
 "));
@@ -203,6 +223,26 @@
 "));
 /*! Insert HTML text */
 PyObject *scribus_inserthtmltext(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_layouttext__doc__,
+QT_TR_NOOP("layoutText([\"name\"])\n\
+\n\
+Relayout text in the text frame \"name\". If \"name\" is not given the currently\n\
+selected item is used.\n\
+"));
+/*! Delete text */
+PyObject *scribus_layouttext(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_layouttextchain__doc__,
+QT_TR_NOOP("layoutTextChain([\"name\"])\n\
+\n\
+Relayout the whole text chain whom the text frame \"name\" belongs.\n\
+If \"name\" is not given the currently selected item is used.\n\
+"));
+/*! Delete text */
+PyObject *scribus_layouttextchain(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setfont__doc__,
@@ -461,16 +501,20 @@
 PyObject *scribus_unlinktextframes(PyObject * self, PyObject* args);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_outlinetext__doc__,
+QT_TR_NOOP("traceText([\"name\"])\n\
+\n\
+Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\
+currently selected item is used."));
 PyDoc_STRVAR(scribus_tracetext__doc__,
 QT_TR_NOOP("traceText([\"name\"])\n\
 \n\
-Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\
-currently selected item is used."));
+Deprecated, use outlineText() instead."));
 /**
  Trace text frames via Scripter.
  2004-09-07 (Craig Ringer)
 */
-PyObject *scribus_tracetext(PyObject * self, PyObject* args);
+PyObject *scribus_outlinetext(PyObject * self, PyObject* args);
 
 PyDoc_STRVAR(scribus_istextoverflowing__doc__,
 QT_TR_NOOP("textOverflows([\"name\", nolinks]) -> integer\n\

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.h	Tue May 26 13:35:38 2020
@@ -29,6 +29,7 @@
 
 PageItem *GetItem(const QString& Name);
 void ReplaceColor(const QString& col, const QString& rep);
+
 /*!
  * @brief Returns named PageItem, or selection if name '', or exception and NULL if no item.
  *
@@ -60,6 +61,7 @@
  * @brief Returns a list of the names of all selected PageItems
  */
 QStringList getSelectedItemsByName();
+
 /*!
  * @brief Replaces the current selection by selecting all the items named in the passed QStringList
  *
@@ -68,7 +70,9 @@
  */
 bool setSelectedItemsByName(QStringList& itemNames);
 
-/// Helper method to parse a border from a list of tuples.
+/*!
+ * @brief Helper method to parse a border from a list of tuples.
+ */
 TableBorder parseBorder(PyObject* borderLines, bool* ok);
 
 

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp	Tue May 26 13:35:38 2020
@@ -1003,12 +1003,12 @@
 	for (int i=0; i<n; ++i) {
 		PyObject *tmp = PyList_GetItem(value, i);
 		if (!PyList_Check(tmp)) {
-			PyErr_SetString(PyExc_TypeError, "elemets of 'lpival' must be list of five integers.");
+			PyErr_SetString(PyExc_TypeError, "elements of 'lpival' must be list of five integers.");
 			return -1;
 		}
 		int j = PyList_Size(tmp);
 		if (j != 4) {
-			PyErr_SetString(PyExc_TypeError, "elemets of 'lpival' must have exactly four members.");
+			PyErr_SetString(PyExc_TypeError, "elements of 'lpival' must have exactly four members.");
 			return -1;
 		}
 		for ( --j; j > 0; --j) {

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.cpp	Tue May 26 13:35:38 2020
@@ -17,17 +17,18 @@
 #include <QPixmap>
 #include <cstdlib>
 
+#include "cmdutil.h"
 #include "runscriptdialog.h"
 #include "ui/helpbrowser.h"
 #include "ui/marksmanager.h"
 #include "ui/notesstyleseditor.h"
 #include "ui/propertiespalette.h" //TODO Move the calls to this to a signal
+#include "ui/contentpalette.h" //TODO Move the calls to this to a signal
 #include "ui/pagepalette.h" //TODO Move the calls to this to a signal
 #include "ui/layers.h" //TODO Move the calls to this to a signal
 #include "ui/outlinepalette.h" //TODO Move the calls to this to a signal
 #include "ui/scmessagebox.h"
 #include "ui/scmwmenumanager.h"
-#include "ui/contentpalette.h"
 #include "pconsole.h"
 #include "scraction.h"
 #include "scribuscore.h"
@@ -199,12 +200,12 @@
 	finishScriptRun();
 }
 
-void ScripterCore::StdScript(const QString& basefilename)
+void ScripterCore::StdScript(const QString& baseFilename)
 {
 	QString pfad = ScPaths::instance().scriptDir();
 	QString pfad2;
 	pfad2 = QDir::toNativeSeparators(pfad);
-	QString fn = pfad2+basefilename+".py";
+	QString fn = pfad2+baseFilename+".py";
 	QFileInfo fd(fn);
 	if (!fd.exists())
 		return;

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptercore.h	Tue May 26 13:35:38 2020
@@ -36,7 +36,7 @@
 
 public slots:
 	void runScriptDialog();
-	void StdScript(const QString& filebasename);
+	void StdScript(const QString& baseFilename);
 	void RecentScript(const QString& fn);
 	void slotRunScriptFile(const QString& fileName, bool inMainInterpreter = false);
 	void slotRunScriptFile(const QString& fileName, QStringList arguments, bool inMainInterpreter = false);
@@ -84,9 +84,9 @@
 
 	// Preferences
 	/** \brief pref: Enable access to main interpreter and 'extension scripts' */
-	bool m_enableExtPython;
+	bool m_enableExtPython {false};
 	/** \brief pref: Run 'from scribus import *' at scripter startup */
-	bool m_importAllNames;
+	bool m_importAllNames {true};
 	/** \brief pref: Load this script on startup */
 	QString m_startupScript;
 };

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.cpp	Tue May 26 13:35:38 2020
@@ -228,7 +228,7 @@
 /*static */PyObject *scribus_retval(PyObject* /*self*/, PyObject* args)
 {
 	char *Name = nullptr;
-	if (!PyArg_ParseTuple(args, (char*)"s", &Name))
+	if (!PyArg_ParseTuple(args, (char*) "s", &Name))
 		return nullptr;
 	// Because sysdefaultencoding is not utf-8, Python is returning utf-8 encoded
 	// 8-bit char* strings. Make sure Qt understands that the input is utf-8 not
@@ -305,18 +305,19 @@
 	{const_cast<char*>("createPolygon"), scribus_polygon, METH_VARARGS, tr(scribus_polygon__doc__)},
 	{const_cast<char*>("createPolyLine"), scribus_polyline, METH_VARARGS, tr(scribus_polyline__doc__)},
 	{const_cast<char*>("createRect"), scribus_newrect, METH_VARARGS, tr(scribus_newrect__doc__)},
+	{const_cast<char*>("createTable"), scribus_newtable, METH_VARARGS, tr(scribus_newtable__doc__)},
 	{const_cast<char*>("createText"), scribus_newtext, METH_VARARGS, tr(scribus_newtext__doc__)},
-	{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*>("createParagraphStyle"), (PyCFunction)scribus_createparagraphstyle, METH_VARARGS|METH_KEYWORDS, tr(scribus_createparagraphstyle__doc__)},
+	{const_cast<char*>("createCharStyle"), (PyCFunction)scribus_createcharstyle, METH_VARARGS|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*>("currentPage"), (PyCFunction)scribus_currentpage, METH_NOARGS, tr(scribus_currentpage__doc__)},
 	{const_cast<char*>("defineColor"), scribus_newcolor, METH_VARARGS, tr(scribus_newcolor__doc__)},
 	{const_cast<char*>("defineColorLab"), scribus_newcolorlab, METH_VARARGS, tr(scribus_newcolorlab__doc__) },
 	{const_cast<char*>("defineColorRGB"), scribus_newcolorrgb, METH_VARARGS, tr(scribus_newcolorrgb__doc__)},
 	{const_cast<char*>("defineColorRGBFloat"), scribus_newcolorrgb, METH_VARARGS, tr(scribus_newcolorrgbfloat__doc__)},
 	{const_cast<char*>("defineColorCMYK"), scribus_newcolorcmyk, METH_VARARGS, tr(scribus_newcolorcmyk__doc__)},
 	{const_cast<char*>("defineColorCMYKFloat"), scribus_newcolorcmykfloat, METH_VARARGS, tr(scribus_newcolorcmykfloat__doc__)},
+	{const_cast<char*>("dehyphenateText"), scribus_dehyphenatetext, METH_VARARGS, tr(scribus_dehyphenatetext__doc__)},
 	{const_cast<char*>("deleteColor"), scribus_delcolor, METH_VARARGS, tr(scribus_delcolor__doc__)},
 	{const_cast<char*>("deleteLayer"), scribus_removelayer, METH_VARARGS, tr(scribus_removelayer__doc__)},
 	{const_cast<char*>("deleteMasterPage"), scribus_deletemasterpage, METH_VARARGS, tr(scribus_deletemasterpage__doc__)},
@@ -326,48 +327,49 @@
 	{const_cast<char*>("deselectAll"), (PyCFunction)scribus_deselect, METH_NOARGS, tr(scribus_deselect__doc__)},
 	{const_cast<char*>("docChanged"), scribus_docchanged, METH_VARARGS, tr(scribus_docchanged__doc__)},
 	{const_cast<char*>("editMasterPage"), scribus_editmasterpage, METH_VARARGS, tr(scribus_editmasterpage__doc__)},
-	{const_cast<char*>("fileDialog"), (PyCFunction)scribus_filedia, METH_VARARGS|METH_KEYWORDS, tr(scribus_filedia__doc__)},
+	{const_cast<char*>("fileDialog"), (PyCFunction)scribus_filedialog, METH_VARARGS|METH_KEYWORDS, tr(scribus_filedialog__doc__)},
 	{const_cast<char*>("fileQuit"), scribus_filequit, METH_VARARGS, tr(scribus_filequit__doc__)},
 	{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__)}, //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*>("getParagraphStyles"), (PyCFunction)scribus_getstylenames, METH_NOARGS, tr(scribus_getstylenames__doc__)},
+	{const_cast<char*>("getAllStyles"), (PyCFunction)scribus_getparagraphstyles, METH_NOARGS, tr(scribus_getallstyles__doc__)}, //Deprecated
+	{const_cast<char*>("getAllText"), scribus_getalltext, METH_VARARGS, tr(scribus_getalltext__doc__)},
 	{const_cast<char*>("getCellStyle"), scribus_getcellstyle, METH_VARARGS, tr(scribus_getcellstyle__doc__)},
+	{const_cast<char*>("getCellStyles"), (PyCFunction)scribus_getcellstyles, METH_VARARGS, tr(scribus_getcellstyles__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__)},
 	{const_cast<char*>("getCellFillColor"), scribus_getcellfillcolor, METH_VARARGS, tr(scribus_getcellfillcolor__doc__)},
+	{const_cast<char*>("getCharacterStyle"), scribus_getcharacterstyle, METH_VARARGS, tr(scribus_getcharacterstyle__doc__) },
+	{const_cast<char*>("getCharStyles"), (PyCFunction)scribus_getcharstylenames, METH_NOARGS, tr(scribus_getcharstylenames__doc__)},
 	{const_cast<char*>("getColorNames"), (PyCFunction)scribus_colornames, METH_NOARGS, tr(scribus_colornames__doc__)},
 	{const_cast<char*>("getColor"), scribus_getcolor, METH_VARARGS, tr(scribus_getcolor__doc__)},
 	{const_cast<char*>("getColorFloat"), scribus_getcolorfloat, METH_VARARGS, tr(scribus_getcolorfloat__doc__)},
 	{const_cast<char*>("getColorAsRGB"), scribus_getcolorasrgb, METH_VARARGS, tr(scribus_getcolorasrgb__doc__)},
 	{const_cast<char*>("getColorAsRGBFloat"), scribus_getcolorasrgbfloat, METH_VARARGS, tr(scribus_getcolorasrgbfloat__doc__)},
 	{const_cast<char*>("isSpotColor"), scribus_isspotcolor, METH_VARARGS, tr(scribus_isspotcolor__doc__)},
-	{const_cast<char*>("setSpotColor"), scribus_setspotcolor, METH_VARARGS, tr(scribus_setspotcolor__doc__)},
-	{const_cast<char*>("getTextDistances"), scribus_gettextdistances, METH_VARARGS, tr(scribus_gettextdistances__doc__)},
 	{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*>("getDocName"), (PyCFunction)scribus_getdocname, METH_NOARGS, tr(scribus_getdocname__doc__)},
 	{const_cast<char*>("getFillColor"), scribus_getfillcolor, METH_VARARGS, tr(scribus_getfillcolor__doc__)},
+	{const_cast<char*>("getFillBlendmode"), scribus_getfillblend, METH_VARARGS, tr(scribus_getfillblend__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__)},
 	{const_cast<char*>("getFillTransparency"), scribus_getfilltrans, METH_VARARGS, tr(scribus_getfilltrans__doc__)},
+	{const_cast<char*>("getFont"), scribus_getfont, METH_VARARGS, tr(scribus_getfont__doc__)},
+	{const_cast<char*>("getFontFeatures"), scribus_getfontfeatures, METH_VARARGS, tr(scribus_getfontfeatures__doc__)},
 	{const_cast<char*>("getFontNames"), (PyCFunction)scribus_fontnames, METH_NOARGS, tr(scribus_fontnames__doc__)},
-	{const_cast<char*>("getFontFeatures"), scribus_getfontfeatures, METH_VARARGS, tr(scribus_getfontfeatures__doc__)},
-	{const_cast<char*>("getFont"), scribus_getfont, METH_VARARGS, tr(scribus_getfont__doc__)},
 	{const_cast<char*>("getFontSize"), scribus_getfontsize, METH_VARARGS, tr(scribus_getfontsize__doc__)},
+	{const_cast<char*>("getFrameText"), scribus_getframetext, METH_VARARGS, tr(scribus_getframetext__doc__)},
 	{const_cast<char*>("getGuiLanguage"), (PyCFunction)scribus_getlanguage, METH_NOARGS, tr(scribus_getlanguage__doc__)},
 	{const_cast<char*>("getHGuides"), (PyCFunction)scribus_getHguides, METH_NOARGS, tr(scribus_getHguides__doc__)},
 	{const_cast<char*>("getImageColorSpace"), scribus_getimagecolorspace, METH_VARARGS, tr(scribus_getimagecolorspace__doc__) },
 	{const_cast<char*>("getImageFile"), scribus_getimagefile, METH_VARARGS, tr(scribus_getimagefile__doc__)},
-	{const_cast<char*>("getImageOffset"), scribus_getimgoffset, METH_VARARGS, tr(scribus_getimgoffset__doc__)},
-	{const_cast<char*>("getImageScale"), scribus_getimgscale, METH_VARARGS, tr(scribus_getimgscale__doc__)},
+	{const_cast<char*>("getImageOffset"), scribus_getimageoffset, METH_VARARGS, tr(scribus_getimageoffset__doc__)},
+	{const_cast<char*>("getImageScale"), scribus_getimagescale, METH_VARARGS, tr(scribus_getimagescale__doc__)},
 	{const_cast<char*>("getLayers"), (PyCFunction)scribus_getlayers, METH_NOARGS, tr(scribus_getlayers__doc__)},
-	{const_cast<char*>("getLayerBlendmode"), scribus_glayerblend, METH_VARARGS, tr(scribus_glayerblend__doc__)},
-	{const_cast<char*>("getLayerTransparency"), scribus_glayertrans, METH_VARARGS, tr(scribus_glayertrans__doc__)},
+	{const_cast<char*>("getLayerBlendmode"), scribus_getlayerblendmode, METH_VARARGS, tr(scribus_getlayerblendmode__doc__)},
+	{const_cast<char*>("getLayerTransparency"), scribus_getlayertransparency, METH_VARARGS, tr(scribus_getlayertransparency__doc__)},
 	{const_cast<char*>("getLineCap"), scribus_getlinecap, METH_VARARGS, tr(scribus_getlinecap__doc__)},
 	{const_cast<char*>("getLineColor"), scribus_getlinecolor, METH_VARARGS, tr(scribus_getlinecolor__doc__)},
 	{const_cast<char*>("getLineShade"), scribus_getlineshade, METH_VARARGS, tr(scribus_getlineshade__doc__)},
@@ -376,30 +378,36 @@
 	{const_cast<char*>("getLineJoin"), scribus_getlinejoin, METH_VARARGS, tr(scribus_getlinejoin__doc__)},
 	{const_cast<char*>("getLineSpacing"), scribus_getlinespace, METH_VARARGS, tr(scribus_getlinespace__doc__)},
 	{const_cast<char*>("getLineStyle"), scribus_getlinestyle, METH_VARARGS, tr(scribus_getlinestyle__doc__)},
+	{const_cast<char*>("getLineStyles"), (PyCFunction)scribus_getlinestyles, METH_VARARGS, tr(scribus_getlinestyles__doc__)},
 	{const_cast<char*>("getLineWidth"), scribus_getlinewidth, METH_VARARGS, tr(scribus_getlinewidth__doc__)},
 	{const_cast<char*>("getMasterPage"), scribus_getmasterpage, METH_VARARGS, tr(scribus_getmasterpage__doc__)},
 	{const_cast<char*>("getPageItems"), (PyCFunction)scribus_getpageitems, METH_NOARGS, tr(scribus_getpageitems__doc__)},
 	{const_cast<char*>("getPageMargins"), (PyCFunction)scribus_getpagemargins, METH_NOARGS, tr(scribus_getpagemargins__doc__)},
-	{const_cast<char*>("getPageType"), (PyCFunction)scribus_pageposition, METH_VARARGS, tr(scribus_pageposition__doc__)},
+	{const_cast<char*>("getPageType"), (PyCFunction)scribus_getpagetype, METH_VARARGS, tr(scribus_getpagetype__doc__)},
 	{const_cast<char*>("getPageSize"), (PyCFunction)scribus_pagedimension, METH_NOARGS, tr(scribus_pagedimension__doc__)},
-	{const_cast<char*>("getPageNSize"), scribus_pagensize, METH_VARARGS, tr(scribus_pagensize__doc__)},
-	{const_cast<char*>("getPageNMargins"), scribus_pagenmargins, METH_VARARGS, tr(scribus_pagenmargins__doc__)},
-	{const_cast<char*>("getPosition"), scribus_getposi, METH_VARARGS, tr(scribus_getposi__doc__)},
+	{const_cast<char*>("getPageNSize"), scribus_getpagensize, METH_VARARGS, tr(scribus_getpagensize__doc__)},
+	{const_cast<char*>("getPageNMargins"), scribus_getpagenmargins, METH_VARARGS, tr(scribus_getpagenmargins__doc__)},
+	{const_cast<char*>("getParagraphStyle"), scribus_getparagraphstyle, METH_VARARGS, tr(scribus_getparagraphstyle__doc__) },
+	{const_cast<char*>("getParagraphStyles"), (PyCFunction)scribus_getparagraphstyles, METH_NOARGS, tr(scribus_getparagraphstyles__doc__)},
+	{const_cast<char*>("getPosition"), scribus_getposition, METH_VARARGS, tr(scribus_getposition__doc__)},
 	{const_cast<char*>("getRotation"), scribus_getrotation, METH_VARARGS, tr(scribus_getrotation__doc__)},
 	{const_cast<char*>("getObjectType"), scribus_getobjecttype, METH_VARARGS, tr(scribus_getobjecttype__doc__)},
 	{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*>("getStyle"), scribus_getparagraphstyle, METH_VARARGS, tr(scribus_getstyle__doc__) }, // Deprecated
 	{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__)},
 	{const_cast<char*>("getTableColumnWidth"), scribus_gettablecolumnwidth, METH_VARARGS, tr(scribus_gettablecolumnwidth__doc__)},
 	{const_cast<char*>("getTableStyle"), scribus_gettablestyle, METH_VARARGS, tr(scribus_gettablestyle__doc__)},
+	{const_cast<char*>("getTableStyles"), (PyCFunction)scribus_gettablestyles, METH_VARARGS, tr(scribus_gettablestyles__doc__)},
 	{const_cast<char*>("getTableFillColor"), scribus_gettablefillcolor, METH_VARARGS, tr(scribus_gettablefillcolor__doc__)},
-	{const_cast<char*>("getText"), scribus_getframetext, METH_VARARGS, tr(scribus_getframetext__doc__)},
+	{const_cast<char*>("getText"), scribus_getframetext, METH_VARARGS, tr(scribus_gettext__doc__)}, // Deprecated
 	{const_cast<char*>("getTextColor"), scribus_gettextcolor, METH_VARARGS, tr(scribus_gettextcolor__doc__)},
-	{const_cast<char*>("getTextLength"), scribus_gettextsize, METH_VARARGS, tr(scribus_gettextsize__doc__)},
+	{const_cast<char*>("getTextDistances"), scribus_gettextdistances, METH_VARARGS, tr(scribus_gettextdistances__doc__)},
+	{const_cast<char*>("getTextFlowMode"), scribus_gettextflowmode, METH_VARARGS, tr(scribus_gettextflowmode__doc__)},
+	{const_cast<char*>("getTextLength"), scribus_gettextlength, METH_VARARGS, tr(scribus_gettextlength__doc__)},
 	{const_cast<char*>("getTextLines"), scribus_gettextlines, METH_VARARGS, tr(scribus_gettextlines__doc__)},
 	{const_cast<char*>("getTextShade"), scribus_gettextshade, METH_VARARGS, tr(scribus_gettextshade__doc__)},
 	{const_cast<char*>("getTextVerticalAlignment"), scribus_gettextverticalalignment, METH_VARARGS, tr(scribus_gettextverticalalignment__doc__)},
@@ -409,17 +417,20 @@
 	{const_cast<char*>("gotoPage"), scribus_gotopage, METH_VARARGS, tr(scribus_gotopage__doc__)},
 	{const_cast<char*>("groupObjects"), (PyCFunction)scribus_groupobj, METH_VARARGS, tr(scribus_groupobj__doc__)},
 	{const_cast<char*>("haveDoc"), (PyCFunction)scribus_havedoc, METH_NOARGS, tr(scribus_havedoc__doc__)},
+	{const_cast<char*>("hyphenateText"), scribus_hyphenatetext, METH_VARARGS, tr(scribus_hyphenatetext__doc__)},
 	{const_cast<char*>("importPage"), scribus_importpage, METH_VARARGS, tr(scribus_importpage__doc__)},
 	{const_cast<char*>("insertTableRows"), scribus_inserttablerows, METH_VARARGS, tr(scribus_inserttablerows__doc__)},
 	{const_cast<char*>("insertTableColumns"), scribus_inserttablecolumns, METH_VARARGS, tr(scribus_inserttablecolumns__doc__)},
 	{const_cast<char*>("insertText"), scribus_inserttext, METH_VARARGS, tr(scribus_inserttext__doc__)},
 	{const_cast<char*>("insertHtmlText"), scribus_inserthtmltext, METH_VARARGS, tr(scribus_inserthtmltext__doc__)},
-	{const_cast<char*>("isLayerPrintable"), scribus_glayerprint, METH_VARARGS, tr(scribus_glayerprint__doc__)},
-	{const_cast<char*>("isLayerVisible"), scribus_glayervisib, METH_VARARGS, tr(scribus_glayervisib__doc__)},
-	{const_cast<char*>("isLayerLocked"), scribus_glayerlock, METH_VARARGS, tr(scribus_glayerlock__doc__)},
-	{const_cast<char*>("isLayerOutlined"), scribus_glayeroutline, METH_VARARGS, tr(scribus_glayeroutline__doc__)},
-	{const_cast<char*>("isLayerFlow"), scribus_glayerflow, METH_VARARGS, tr(scribus_glayerflow__doc__)},
+	{const_cast<char*>("isLayerFlow"), scribus_islayerflow, METH_VARARGS, tr(scribus_islayerflow__doc__)},
+	{const_cast<char*>("isLayerOutlined"), scribus_islayeroutlined, METH_VARARGS, tr(scribus_islayeroutlined__doc__)},
+	{const_cast<char*>("isLayerLocked"), scribus_islayerlocked, METH_VARARGS, tr(scribus_islayerlocked__doc__)},
+	{const_cast<char*>("isLayerPrintable"), scribus_islayerprintable, METH_VARARGS, tr(scribus_islayerprintable__doc__)},
+	{const_cast<char*>("isLayerVisible"), scribus_islayervisible, METH_VARARGS, tr(scribus_islayervisible__doc__)},
 	{const_cast<char*>("isLocked"), scribus_islocked, METH_VARARGS, tr(scribus_islocked__doc__)},
+	{const_cast<char*>("layoutText"), scribus_layouttext, METH_VARARGS, tr(scribus_layouttext__doc__)},
+	{const_cast<char*>("layoutTextChain"), scribus_layouttextchain, METH_VARARGS, tr(scribus_layouttextchain__doc__)},
 	{const_cast<char*>("linkTextFrames"), scribus_linktextframes, METH_VARARGS, tr(scribus_linktextframes__doc__)},
 	{const_cast<char*>("loadImage"), scribus_loadimage, METH_VARARGS, tr(scribus_loadimage__doc__)},
 	{const_cast<char*>("loadStylesFromFile"), scribus_loadstylesfromfile, METH_VARARGS, tr(scribus_loadstylesfromfile__doc__)},
@@ -427,18 +438,19 @@
 	{const_cast<char*>("masterPageNames"), (PyCFunction)scribus_masterpagenames, METH_NOARGS, tr(scribus_masterpagenames__doc__)},
 	{const_cast<char*>("mergeTableCells"), scribus_mergetablecells, METH_VARARGS, tr(scribus_mergetablecells__doc__)},
 	{const_cast<char*>("messagebarText"), scribus_messagebartext, METH_VARARGS, tr(scribus_messagebartext__doc__)},
-	{const_cast<char*>("messageBox"), (PyCFunction)scribus_messdia, METH_VARARGS|METH_KEYWORDS, tr(scribus_messdia__doc__)},
+	{const_cast<char*>("messageBox"), (PyCFunction)scribus_messagebox, METH_VARARGS|METH_KEYWORDS, tr(scribus_messagebox__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*>("newDocDialog"), (PyCFunction)scribus_newdocdialog, METH_NOARGS, tr(scribus_newdocdialog__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__)},
 	{const_cast<char*>("newPage"), scribus_newpage, METH_VARARGS, tr(scribus_newpage__doc__)},
 	{const_cast<char*>("newStyleDialog"), scribus_newstyledialog, METH_NOARGS, tr(scribus_newstyledialog__doc__)},
 	{const_cast<char*>("objectExists"),scribus_objectexists, METH_VARARGS, tr(scribus_objectexists__doc__)},
 	{const_cast<char*>("openDoc"), scribus_opendoc, METH_VARARGS, tr(scribus_opendoc__doc__)},
+	{const_cast<char*>("outlineText"), scribus_outlinetext, METH_VARARGS, tr(scribus_outlinetext__doc__)},
 	{const_cast<char*>("pageCount"), (PyCFunction)scribus_pagecount, METH_NOARGS, tr(scribus_pagecount__doc__)},
 	{const_cast<char*>("pageDimension"), (PyCFunction)scribus_pagedimension, METH_NOARGS, "Obsolete function. Don't use it."},
 	{const_cast<char*>("placeEPS"), scribus_placevec, METH_VARARGS, tr(scribus_placeeps__doc__)},
@@ -453,15 +465,15 @@
 	{const_cast<char*>("redrawAll"), (PyCFunction)scribus_redraw, METH_NOARGS, tr(scribus_redraw__doc__)},
 	{const_cast<char*>("removeTableRows"), scribus_removetablerows, METH_VARARGS, tr(scribus_removetablerows__doc__)},
 	{const_cast<char*>("removeTableColumns"), scribus_removetablecolumns, METH_VARARGS, tr(scribus_removetablecolumns__doc__)},
-	{const_cast<char*>("renderFont"), (PyCFunction)scribus_renderfont, METH_KEYWORDS, tr(scribus_renderfont__doc__)},
+	{const_cast<char*>("renderFont"), (PyCFunction)scribus_renderfont, METH_VARARGS|METH_KEYWORDS, tr(scribus_renderfont__doc__)},
 	{const_cast<char*>("replaceColor"), scribus_replcolor, METH_VARARGS, tr(scribus_replcolor__doc__)},
 	{const_cast<char*>("resizeTableColumn"), scribus_resizetablecolumn, METH_VARARGS, tr(scribus_resizetablecolumn__doc__)},
 	{const_cast<char*>("resizeTableRow"), scribus_resizetablerow, METH_VARARGS, tr(scribus_resizetablerow__doc__)},
+	{const_cast<char*>("revertDoc"), (PyCFunction)scribus_revertdoc, METH_NOARGS, tr(scribus_revertdoc__doc__)},
 	{const_cast<char*>("rotateObjectAbs"), scribus_rotobjabs, METH_VARARGS, tr(scribus_rotobjabs__doc__)},
 	{const_cast<char*>("rotateObject"), scribus_rotobjrel, METH_VARARGS, tr(scribus_rotobjrel__doc__)},
-	{const_cast<char*>("getDocName"), (PyCFunction)scribus_getdocname, METH_NOARGS, tr(scribus_getdocname__doc__)},
+	{const_cast<char*>("saveDoc"), (PyCFunction)scribus_savedoc, METH_NOARGS, tr(scribus_savedoc__doc__)},
 	{const_cast<char*>("saveDocAs"), scribus_savedocas, METH_VARARGS, tr(scribus_savedocas__doc__)},
-	{const_cast<char*>("saveDoc"), (PyCFunction)scribus_savedoc, METH_NOARGS, tr(scribus_savedoc__doc__)},
 	{const_cast<char*>("savePageAsEPS"), scribus_savepageeps, METH_VARARGS, tr(scribus_savepageeps__doc__)},
 	{const_cast<char*>("savePDFOptions"), (PyCFunction)scribus_savepdfoptions, METH_VARARGS, tr(scribus_savepdfoptions__doc__)},
 	{const_cast<char*>("scaleGroup"), scribus_scalegroup, METH_VARARGS, tr(scribus_scalegroup__doc__)},
@@ -474,7 +486,7 @@
 	{const_cast<char*>("selectObject"), scribus_selectobj, METH_VARARGS, tr(scribus_selectobj__doc__)},
 	{const_cast<char*>("selectText"), scribus_selecttext, METH_VARARGS, tr(scribus_selecttext__doc__)},
 	{const_cast<char*>("sentToLayer"), scribus_senttolayer, METH_VARARGS, tr(scribus_senttolayer__doc__)},
-	{const_cast<char*>("setActiveLayer"), scribus_setactlayer, METH_VARARGS, tr(scribus_setactlayer__doc__)},
+	{const_cast<char*>("setActiveLayer"), scribus_setactivelayer, METH_VARARGS, tr(scribus_setactivelayer__doc__)},
 	{const_cast<char*>("setPDFBookmark"), scribus_setpdfbookmark, METH_VARARGS, tr(scribus_setpdfbookmark__doc__)},
 	{const_cast<char*>("isPDFBookmark"), scribus_ispdfbookmark, METH_VARARGS, tr(scribus_ispdfbookmark__doc__)},
 	{const_cast<char*>("setTextDistances"), scribus_settextdistances, METH_VARARGS, tr(scribus_settextdistances__doc__)},
@@ -491,7 +503,7 @@
 	{const_cast<char*>("setCellBottomPadding"), scribus_setcellbottompadding, METH_VARARGS, tr(scribus_setcellbottompadding__doc__)},
 	{const_cast<char*>("setColumnGap"), scribus_setcolumngap, METH_VARARGS, tr(scribus_setcolumngap__doc__)},
 	{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*>("setCornerRadius"), scribus_setcornerradius, METH_VARARGS, tr(scribus_setcornerradius__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__)},
@@ -506,13 +518,13 @@
 	{const_cast<char*>("setGradientStop"), scribus_setgradstop, METH_VARARGS, tr(scribus_setgradstop__doc__)},
 	{const_cast<char*>("setHGuides"), scribus_setHguides, METH_VARARGS, tr(scribus_setHguides__doc__)},
 	{const_cast<char*>("setInfo"), scribus_setinfo, METH_VARARGS, tr(scribus_setinfo__doc__)},
-	{const_cast<char*>("setLayerPrintable"), scribus_layerprint, METH_VARARGS, tr(scribus_layerprint__doc__)},
-	{const_cast<char*>("setLayerVisible"), scribus_layervisible, METH_VARARGS, tr(scribus_layervisible__doc__)},
-	{const_cast<char*>("setLayerLocked"), scribus_layerlock, METH_VARARGS, tr(scribus_layerlock__doc__)},
-	{const_cast<char*>("setLayerOutlined"), scribus_layeroutline, METH_VARARGS, tr(scribus_layeroutline__doc__)},
-	{const_cast<char*>("setLayerFlow"), scribus_layerflow, METH_VARARGS, tr(scribus_layerflow__doc__)},
-	{const_cast<char*>("setLayerBlendmode"), scribus_layerblend, METH_VARARGS, tr(scribus_layerblend__doc__)},
-	{const_cast<char*>("setLayerTransparency"), scribus_layertrans, METH_VARARGS, tr(scribus_layertrans__doc__)},
+	{const_cast<char*>("setLayerBlendmode"), scribus_setlayerblendmode, METH_VARARGS, tr(scribus_setlayerblendmode__doc__)},
+	{const_cast<char*>("setLayerFlow"), scribus_setlayerflow, METH_VARARGS, tr(scribus_setlayerflow__doc__)},
+	{const_cast<char*>("setLayerLocked"), scribus_setlayerlocked, METH_VARARGS, tr(scribus_setlayerlocked__doc__)},
+	{const_cast<char*>("setLayerOutlined"), scribus_setlayeroutlined, METH_VARARGS, tr(scribus_setlayeroutlined__doc__)},
+	{const_cast<char*>("setLayerPrintable"), scribus_setlayerprintable, METH_VARARGS, tr(scribus_setlayerprintable__doc__)},
+	{const_cast<char*>("setLayerTransparency"), scribus_setlayertransparency, METH_VARARGS, tr(scribus_setlayertransparency__doc__)},
+	{const_cast<char*>("setLayerVisible"), scribus_setlayervisible, METH_VARARGS, tr(scribus_setlayervisible__doc__)},
 	{const_cast<char*>("setLineCap"), scribus_setlinecap, METH_VARARGS, tr(scribus_setlinecap__doc__)},
 	{const_cast<char*>("setLineColor"), scribus_setlinecolor, METH_VARARGS, tr(scribus_setlinecolor__doc__)},
 	{const_cast<char*>("setLineTransparency"), scribus_setlinetrans, METH_VARARGS, tr(scribus_setlinetrans__doc__)},
@@ -523,32 +535,32 @@
 	{const_cast<char*>("setLineSpacingMode"), scribus_setlinespacemode, METH_VARARGS, tr(scribus_setlinespacemode__doc__)},
 	{const_cast<char*>("setLineStyle"), scribus_setlinestyle, METH_VARARGS, tr(scribus_setlinestyle__doc__)},
 	{const_cast<char*>("setLineWidth"), scribus_setlinewidth, METH_VARARGS, tr(scribus_setlinewidth__doc__)},
-    {const_cast<char*>("setBleeds"), scribus_setbleeds, METH_VARARGS, tr(scribus_setbleeds__doc__)},
+	{const_cast<char*>("setBleeds"), scribus_setbleeds, METH_VARARGS, tr(scribus_setbleeds__doc__)},
 	{const_cast<char*>("setMargins"), scribus_setmargins, METH_VARARGS, tr(scribus_setmargins__doc__)},
 	{const_cast<char*>("setBaseLine"), scribus_setbaseline, METH_VARARGS, tr(scribus_setbaseline__doc__)},
+	{const_cast<char*>("setItemName"), scribus_setitemname, METH_VARARGS, tr(scribus_setitemname__doc__)},
 	{const_cast<char*>("setMultiLine"), scribus_setmultiline, METH_VARARGS, tr(scribus_setmultiline__doc__)},
-	{const_cast<char*>("setNewName"), scribus_setnewname, METH_VARARGS, tr(scribus_setnewname__doc__)},
-	// duplicity? {"setMultiLine", scribus_setmultiline, METH_VARARGS, "TODO: docstring"},
+	{const_cast<char*>("setNewName"), scribus_setitemname, METH_VARARGS, tr(scribus_setitemname__doc__)}, // Deprecated, was in fact never documented
 	{const_cast<char*>("setObjectAttributes"), scribus_setobjectattributes, METH_VARARGS, tr(scribus_setobjectattributes__doc__)},
 	{const_cast<char*>("setRedraw"), scribus_setredraw, METH_VARARGS, tr(scribus_setredraw__doc__)},
-	// 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__)},
+	{const_cast<char*>("setScaleImageToFrame"), (PyCFunction)scribus_setscaleimagetoframe, METH_VARARGS|METH_KEYWORDS, tr(scribus_setscaleimagetoframe__doc__)},
+	{const_cast<char*>("setStyle"), scribus_setparagraphstyle, METH_VARARGS, tr(scribus_setstyle__doc__)}, // Deprecated
 	{const_cast<char*>("setCharacterStyle"), scribus_setcharstyle, METH_VARARGS, tr(scribus_setcharstyle__doc__) },
+	{const_cast<char*>("setParagraphStyle"), scribus_setparagraphstyle, METH_VARARGS, tr(scribus_setparagraphstyle__doc__)},
+	{const_cast<char*>("setSpotColor"), scribus_setspotcolor, METH_VARARGS, tr(scribus_setspotcolor__doc__)},
 	{const_cast<char*>("setTableStyle"), scribus_settablestyle, METH_VARARGS, tr(scribus_settablestyle__doc__)},
 	{const_cast<char*>("setTableLeftBorder"), scribus_settableleftborder, METH_VARARGS, tr(scribus_settableleftborder__doc__)},
 	{const_cast<char*>("setTableRightBorder"), scribus_settablerightborder, METH_VARARGS, tr(scribus_settablerightborder__doc__)},
 	{const_cast<char*>("setTableTopBorder"), scribus_settabletopborder, METH_VARARGS, tr(scribus_settabletopborder__doc__)},
 	{const_cast<char*>("setTableBottomBorder"), scribus_settablebottomborder, METH_VARARGS, tr(scribus_settablebottomborder__doc__)},
 	{const_cast<char*>("setTableFillColor"), scribus_settablefillcolor, METH_VARARGS, tr(scribus_settablefillcolor__doc__)},
-	{const_cast<char*>("setText"), scribus_setboxtext, METH_VARARGS, tr(scribus_setboxtext__doc__)},
+	{const_cast<char*>("setText"), scribus_settext, METH_VARARGS, tr(scribus_settext__doc__)},
 	{const_cast<char*>("setTextAlignment"), scribus_setalignment, METH_VARARGS, tr(scribus_setalign__doc__)},
 	{const_cast<char*>("setTextDirection"), scribus_setdirection, METH_VARARGS, tr(scribus_setdirection__doc__)},
 	{const_cast<char*>("setTextColor"), scribus_settextfill, METH_VARARGS, tr(scribus_settextfill__doc__)},
+	{const_cast<char*>("setTextFlowMode"), scribus_settextflowmode, METH_VARARGS, tr(scribus_settextflowmode__doc__)},
 	{const_cast<char*>("setTextScalingH"), scribus_settextscalingh, METH_VARARGS, tr(scribus_settextscalingh__doc__)},
 	{const_cast<char*>("setTextScalingV"), scribus_settextscalingv, METH_VARARGS, tr(scribus_settextscalingv__doc__)},
 	{const_cast<char*>("setTextShade"), scribus_settextshade, METH_VARARGS, tr(scribus_settextshade__doc__)},
@@ -558,21 +570,21 @@
 	{const_cast<char*>("setVGuides"), scribus_setVguides, METH_VARARGS, tr(scribus_setVguides__doc__)},
 	{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*>("textFlowMode"), scribus_settextflowmode, METH_VARARGS, tr(scribus_textflowmode__doc__)}, // Deprecated
+	{const_cast<char*>("textOverflows"), (PyCFunction)scribus_istextoverflowing, METH_VARARGS|METH_KEYWORDS, tr(scribus_istextoverflowing__doc__) },
+	{const_cast<char*>("traceText"), scribus_outlinetext, METH_VARARGS, tr(scribus_tracetext__doc__)},
 	{const_cast<char*>("unGroupObject"), scribus_ungroupobj, METH_VARARGS, tr(scribus_ungroupobj__doc__)}, // Deprecated, now alias for unGroupObjects()
 	{const_cast<char*>("unGroupObjects"), 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*>("valueDialog"), scribus_valuedialog, METH_VARARGS, tr(scribus_valuedialog__doc__)},
 	{const_cast<char*>("zoomDocument"), scribus_zoomdocument, METH_VARARGS, tr(scribus_zoomdocument__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__)},
-	{const_cast<char*>("getProperty"), (PyCFunction)scribus_getproperty, METH_KEYWORDS, tr(scribus_getproperty__doc__)},
-	{const_cast<char*>("setProperty"), (PyCFunction)scribus_setproperty, METH_KEYWORDS, tr(scribus_setproperty__doc__)},
-// 	{const_cast<char*>("getChildren"), (PyCFunction)scribus_getchildren, METH_KEYWORDS, tr(scribus_getchildren__doc__)},
-// 	{const_cast<char*>("getChild"), (PyCFunction)scribus_getchild, METH_KEYWORDS, tr(scribus_getchild__doc__)},
+	{const_cast<char*>("getPropertyCType"), (PyCFunction)scribus_propertyctype, METH_VARARGS|METH_KEYWORDS, tr(scribus_propertyctype__doc__)},
+	{const_cast<char*>("getPropertyNames"), (PyCFunction)scribus_getpropertynames, METH_VARARGS|METH_KEYWORDS, tr(scribus_getpropertynames__doc__)},
+	{const_cast<char*>("getProperty"), (PyCFunction)scribus_getproperty, METH_VARARGS|METH_KEYWORDS, tr(scribus_getproperty__doc__)},
+	{const_cast<char*>("setProperty"), (PyCFunction)scribus_setproperty, METH_VARARGS|METH_KEYWORDS, tr(scribus_setproperty__doc__)},
+// 	{const_cast<char*>("getChildren"), (PyCFunction)scribus_getchildren, METH_VARARGS|METH_KEYWORDS, tr(scribus_getchildren__doc__)},
+// 	{const_cast<char*>("getChild"), (PyCFunction)scribus_getchild, METH_VARARGS|METH_KEYWORDS, tr(scribus_getchild__doc__)},
 	// by Christian Hausknecht
 	{const_cast<char*>("duplicateObject"), scribus_duplicateobject, METH_VARARGS, tr(scribus_duplicateobject__doc__)},
 	{const_cast<char*>("copyObject"), scribus_copyobject, METH_VARARGS, tr(scribus_copyobject__doc__)},

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/svgimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23841&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/svgimport.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/svgimport.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/svgimport.cpp	Tue May 26 13:35:38 2020
@@ -18,7 +18,6 @@
 #include "selection.h"
 #include "ui/propertiespalette.h"
 #include "ui/propertiespalette_line.h"
-#include "ui/propertiespalette_text.h"
 
 #include <QString>
 
@@ -67,131 +66,6 @@
 	}
 	Py_RETURN_NONE;
 }
-#if 0
-PyObject *scribus_placesvg(PyObject* /* self */, PyObject* args)
-{
-	char *Image;
-	double x = 0.0;
-	double y = 0.0;
-	if (!PyArg_ParseTuple(args, "es|dd", "utf-8", &Image, &x, &y))
-		return nullptr;
-	if (!checkHaveDocument())
-		return nullptr;
-	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_SVGIMPORT);
-	if (fmt)
-	{
-		fmt->loadFile(QString::fromUtf8(Image), 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(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
-			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
-		}
-	}
-	else
-	{
-		PyErr_SetString(PyExc_Exception, "SVG Import plugin not available");
-		return nullptr;
-	}
-	Py_RETURN_NONE;
-}
-
-PyObject *scribus_placeeps(PyObject* /* self */, PyObject* args)
-{
-	char *Image;
-	double x = 0.0;
-	double y = 0.0;
-	if (!PyArg_ParseTuple(args, "es|dd", "utf-8", &Image, &x, &y))
-		return nullptr;
-	if (!checkHaveDocument())
-		return nullptr;
-	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_PSIMPORT);
-	if (fmt)
-	{
-		fmt->loadFile(QString::fromUtf8(Image), 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(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
-			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
-		}
-	}
-	else
-	{
-		PyErr_SetString(PyExc_Exception, "EPS Import plugin not available");
-		return nullptr;
-	}
-	Py_RETURN_NONE;
-}
-
-PyObject *scribus_placesxd(PyObject* /* self */, PyObject* args)
-{
-	char *Image;
-	double x = 0.0;
-	double y = 0.0;
-	if (!PyArg_ParseTuple(args, "es|dd", "utf-8", &Image, &x, &y))
-		return nullptr;
-	if (!checkHaveDocument())
-		return nullptr;
-	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_SXDIMPORT);
-	if (fmt)
-	{
-		fmt->loadFile(QString::fromUtf8(Image), 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(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
-			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate)
-		}
-	}
-	else
-	{
-		PyErr_SetString(PyExc_Exception, "OpenOffice Import plugin not available");
-		return nullptr;
-	}
-	Py_RETURN_NONE;
-}
-
-PyObject *scribus_placeodg(PyObject* /* self */, PyObject* args)
-{
-	char *Image;
-	double x = 0.0;
-	double y = 0.0;
-	if (!PyArg_ParseTuple(args, "es|dd", "utf-8", &Image, &x, &y))
-		return NULL;
-	if (!checkHaveDocument())
-		return nullptr;
-	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_ODGIMPORT);
-	if (fmt)
-	{
-		fmt->loadFile(QString::fromUtf8(Image), 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(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
-			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate)
-		}
-	}
-	else
-	{
-		PyErr_SetString(PyExc_Exception, "OpenOffice Import plugin not available");
-		return nullptr;
-	}
-	Py_RETURN_NONE;
-}
-#endif
 
 /*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
 with header files structure untouched (docstrings are kept near declarations)
@@ -199,5 +73,9 @@
 void svgimportdocwarnings()
 {
 	QStringList s;
-	s << scribus_placevec__doc__ << scribus_placesvg__doc__ << scribus_placeeps__doc__ << scribus_placesxd__doc__ << scribus_placeodg__doc__;
+	s << scribus_placeeps__doc__
+	  << scribus_placeodg__doc__
+	  << scribus_placesvg__doc__
+	  << scribus_placesxd__doc__
+	  << scribus_placevec__doc__;
 }




More information about the scribus-commit mailing list