Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
cmdobj.h File Reference
#include "cmdvar.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 PyDoc_STRVAR (scribus_newrect__doc__, QT_TR_NOOP("createRect(x, y, width, height, [\"name\"]) -> string\n\ \n\ Creates a new rectangle on the current page and returns its name. The\n\ coordinates are given in the current measurement units of the document\n\ (see UNIT constants). \"name\" should be a unique identifier for the object\n\ because you need this name to reference that object in future. If \"name\"\n\ is not given Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ "))
 Object related Commands.
PyObject * scribus_newrect (PyObject *, PyObject *args)
 Creates a rectangular with params X, Y (base position) b, h (width, height) and optional name of the object.
 PyDoc_STRVAR (scribus_newellipse__doc__, QT_TR_NOOP("createEllipse(x, y, width, height, [\"name\"]) -> string\n\ \n\ Creates a new ellipse on the current page and returns its name.\n\ The coordinates are given in the current measurement units of the document\n\ (see UNIT constants). \"name\" should be a unique identifier for the object\n\ because you need this name for further referencing of that object. If \"name\"\n\ is not given Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ "))
 docstring
PyObject * scribus_newellipse (PyObject *, PyObject *args)
 Creates an ellipse with x, y, b and h - name optionally params.
 PyDoc_STRVAR (scribus_newimage__doc__, QT_TR_NOOP("createImage(x, y, width, height, [\"name\"]) -> string\n\ \n\ Creates a new picture frame on the current page and returns its name. The\n\ coordinates are given in the current measurement units of the document.\n\ \"name\" should be a unique identifier for the object because you need this\n\ name for further access to that object. If \"name\" is not given Scribus will\n\ create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ "))
 docstring
PyObject * scribus_newimage (PyObject *, PyObject *args)
 Creates an image frame - x, y, b, h and opt.
 PyDoc_STRVAR (scribus_newtext__doc__, QT_TR_NOOP("createText(x, y, width, height, [\"name\"]) -> string\n\ \n\ Creates a new text frame on the actual page and returns its name.\n\ The coordinates are given in the actual measurement unit of the document (see\n\ UNIT constants). \"name\" should be a unique identifier for the object because\n\ you need this name for further referencing of that object. If \"name\" is not\n\ given Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ "))
 docstring
PyObject * scribus_newtext (PyObject *, PyObject *args)
 Creates a text frame - x, y, b, h and opt.
 PyDoc_STRVAR (scribus_newline__doc__, QT_TR_NOOP("createLine(x1, y1, x2, y2, [\"name\"]) -> string\n\ \n\ Creates a new line from the point(x1, y1) to the point(x2, y2) and returns\n\ its name. The coordinates are given in the current measurement unit of the\n\ document (see UNIT constants). \"name\" should be a unique identifier for the\n\ object because you need this name for further access to that object. If\n\ \"name\" is not given Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ "))
 docstring
PyObject * scribus_newline (PyObject *, PyObject *args)
 Creates a line object - x, y, b, h and opt.
 PyDoc_STRVAR (scribus_polyline__doc__, QT_TR_NOOP("createPolyLine(list, [\"name\"]) -> string\n\ \n\ Creates a new polyline and returns its name. The points for the polyline are\n\ stored in the list \"list\" in the following order: [x1, y1, x2, y2...xn. yn].\n\ The coordinates are given in the current measurement units of the document (see\n\ UNIT constants). \"name\" should be a unique identifier for the object because\n\ you need this name for further access to that object. If \"name\" is not given\n\ Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ May raise ValueError if an insufficient number of points is passed or if\n\ the number of values passed don't group into points without leftovers.\n\ "))
 docstring
PyObject * scribus_polyline (PyObject *, PyObject *args)
 Creates a polygon line - list with points and opt.
 PyDoc_STRVAR (scribus_polygon__doc__, QT_TR_NOOP("createPolygon(list, [\"name\"]) -> string\n\ \n\ Creates a new polygon and returns its name. The points for the polygon are\n\ stored in the list \"list\" in the following order: [x1, y1, x2, y2...xn. yn].\n\ At least three points are required. There is no need to repeat the first point\n\ to close the polygon. The polygon is automatically closed by connecting the\n\ first and the last point. The coordinates are given in the current measurement\n\ units of the document (see UNIT constants). \"name\" should be a unique\n\ identifier for the object because you need this name for further access to that\n\ object. If \"name\" is not given Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ May raise ValueError if an insufficient number of points is passed or if\n\ the number of values passed don't group into points without leftovers.\n\ "))
 docstring
PyObject * scribus_polygon (PyObject *, PyObject *args)
 Creates a polygon - list with points and opt.
 PyDoc_STRVAR (scribus_bezierline__doc__, QT_TR_NOOP("createBezierLine(list, [\"name\"]) -> string\n\ \n\ Creates a new bezier curve and returns its name. The points for the bezier\n\ curve are stored in the list \"list\" in the following order:\n\ [x1, y1, kx1, ky1, x2, y2, kx2, ky2...xn. yn, kxn. kyn]\n\ In the points list, x and y mean the x and y coordinates of the point and kx\n\ and ky meaning the control point for the curve. The coordinates are given in\n\ the current measurement units of the document (see UNIT constants). \"name\"\n\ should be a unique identifier for the object because you need this name for\n\ further access to that object. If \"name\" is not given Scribus will create one\n\ for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ May raise ValueError if an insufficient number of points is passed or if\n\ the number of values passed don't group into points without leftovers.\n\ "))
 docstring
PyObject * scribus_bezierline (PyObject *, PyObject *args)
 Creates a Bezier line - list with points and opt.
 PyDoc_STRVAR (scribus_pathtext__doc__, QT_TR_NOOP("createPathText(x, y, \"textbox\", \"beziercurve\", [\"name\"]) -> string\n\ \n\ Creates a new pathText by merging the two objects \"textbox\" and\n\ \"beziercurve\" and returns its name. The coordinates are given in the current\n\ measurement unit of the document (see UNIT constants). \"name\" should be a\n\ unique identifier for the object because you need this name for further access\n\ to that object. If \"name\" is not given Scribus will create one for you.\n\ \n\ May raise NameExistsError if you explicitly pass a name that's already used.\n\ May raise NotFoundError if one or both of the named base object don't exist.\n\ "))
 docstring
PyObject * scribus_pathtext (PyObject *, PyObject *args)
 Joins 2 objects - textframe and line - into text on path.
 PyDoc_STRVAR (scribus_deleteobj__doc__, QT_TR_NOOP("deleteObject([\"name\"])\n\ \n\ Deletes the item with the name \"name\". If \"name\" is not given the currently\n\ selected item is deleted.\n\ "))
 docstring
PyObject * scribus_deleteobj (PyObject *, PyObject *args)
 Deletes an object - if is the name given the named object is deleted else the active object erased.
 PyDoc_STRVAR (scribus_textflow__doc__, QT_TR_NOOP("textFlowMode(\"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\ Setting \"state\" to 0 will disable text flow.\n\ Setting \"state\" to 1 will make text flow around object frame.\n\ Setting \"state\" to 2 will make text flow around bounding box.\n\ Setting \"state\" to 3 will make text flow around contour line.\n\ If \"state\" is not passed, text flow is toggled.\n\ "))
 docstring
PyObject * scribus_textflow (PyObject *, PyObject *args)
 Enables/disables "Text Flows Around Object" feature for object.
 PyDoc_STRVAR (scribus_objectexists__doc__, QT_TR_NOOP("objectExists([\"name\"]) -> bool\n\ \n\ Test if an object with specified name really exists in the document.\n\ The optional parameter is the object name. When no object name is given,\n\ returns True if there is something selected.\n\ "))
 docstring
PyObject * scribus_objectexists (PyObject *, PyObject *args)
 User test if an object with specified name really exists in the doc.
 PyDoc_STRVAR (scribus_setstyle__doc__, QT_TR_NOOP("setStyle(\"style\" [, \"name\"])\n\ \n\ Apply the named \"style\" to the object named \"name\". If is no object name\n\ given, it's applied on the selected object.\n\ "))
 docstring
PyObject * scribus_setstyle (PyObject *, PyObject *args)
 Craig Ringer, 2004-09-09 Apply the named style to the currently selected object.
 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\ "))
 docstring
PyObject * scribus_getstylenames (PyObject *)
 Craig Ringer, 2004-09-09 Enumerate all known paragraph styles.
 PyDoc_STRVAR (scribus_duplicateobject__doc__, QT_TR_NOOP("duplicateObject([\"name\"]) -> string\n\ \n\ creates a Duplicate of the selected Object (or Selection Group).\n\ "))
 docstring
PyObject * scribus_duplicateobject (PyObject *, PyObject *args)
 Christian Hausknecht, 2006-07-12 duplicate an object.
PyObject * scribus_getframetype (PyObject *self, PyObject *args, PyObject *kw)

Function Documentation

PyDoc_STRVAR ( scribus_newrect__doc__  ,
QT_TR_NOOP("createRect(x, y, width, height, [\"name\"]) -> string\n\\n\Creates a new rectangle on the current page and returns its name. The\n\coordinates are given in the current measurement units of the document\n\(see UNIT constants). \"name\" should be a unique identifier for the object\n\because you need this name to reference that object in future. If \"name\"\n\is not given Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\")   
)

Object related Commands.

docstring

PyDoc_STRVAR ( scribus_newellipse__doc__  ,
QT_TR_NOOP("createEllipse(x, y, width, height, [\"name\"]) -> string\n\\n\Creates a new ellipse on the current page and returns its name.\n\The coordinates are given in the current measurement units of the document\n\(see UNIT constants). \"name\" should be a unique identifier for the object\n\because you need this name for further referencing of that object. If \"name\"\n\is not given Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_newimage__doc__  ,
QT_TR_NOOP("createImage(x, y, width, height, [\"name\"]) -> string\n\\n\Creates a new picture frame on the current page and returns its name. The\n\coordinates are given in the current measurement units of the document.\n\\"name\" should be a unique identifier for the object because you need this\n\name for further access to that object. If \"name\" is not given Scribus will\n\create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_newtext__doc__  ,
QT_TR_NOOP("createText(x, y, width, height, [\"name\"]) -> string\n\\n\Creates a new text frame on the actual page and returns its name.\n\The coordinates are given in the actual measurement unit of the document (see\n\UNIT constants). \"name\" should be a unique identifier for the object because\n\you need this name for further referencing of that object. If \"name\" is not\n\given Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_newline__doc__  ,
QT_TR_NOOP("createLine(x1, y1, x2, y2, [\"name\"]) -> string\n\\n\Creates a new line from the point(x1, y1) to the point(x2, y2) and returns\n\its name. The coordinates are given in the current measurement unit of the\n\document (see UNIT constants). \"name\" should be a unique identifier for the\n\object because you need this name for further access to that object. If\n\\"name\" is not given Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_polyline__doc__  ,
QT_TR_NOOP("createPolyLine(list, [\"name\"]) -> string\n\\n\Creates a new polyline and returns its name. The points for the polyline are\n\stored in the list \"list\" in the following order: [x1, y1, x2, y2...xn. yn].\n\The coordinates are given in the current measurement units of the document (see\n\UNIT constants). \"name\" should be a unique identifier for the object because\n\you need this name for further access to that object. If \"name\" is not given\n\Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\May raise ValueError if an insufficient number of points is passed or if\n\the number of values passed don't group into points without leftovers.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_polygon__doc__  ,
QT_TR_NOOP("createPolygon(list, [\"name\"]) -> string\n\\n\Creates a new polygon and returns its name. The points for the polygon are\n\stored in the list \"list\" in the following order: [x1, y1, x2, y2...xn. yn].\n\At least three points are required. There is no need to repeat the first point\n\to close the polygon. The polygon is automatically closed by connecting the\n\first and the last point. The coordinates are given in the current measurement\n\units of the document (see UNIT constants). \"name\" should be a unique\n\identifier for the object because you need this name for further access to that\n\object. If \"name\" is not given Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\May raise ValueError if an insufficient number of points is passed or if\n\the number of values passed don't group into points without leftovers.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_bezierline__doc__  ,
QT_TR_NOOP("createBezierLine(list, [\"name\"]) -> string\n\\n\Creates a new bezier curve and returns its name. The points for the bezier\n\curve are stored in the list \"list\" in the following order:\n\[x1, y1, kx1, ky1, x2, y2, kx2, ky2...xn. yn, kxn. kyn]\n\In the points list, x and y mean the x and y coordinates of the point and kx\n\and ky meaning the control point for the curve. The coordinates are given in\n\the current measurement units of the document (see UNIT constants). \"name\"\n\should be a unique identifier for the object because you need this name for\n\further access to that object. If \"name\" is not given Scribus will create one\n\for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\May raise ValueError if an insufficient number of points is passed or if\n\the number of values passed don't group into points without leftovers.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_pathtext__doc__  ,
QT_TR_NOOP("createPathText(x, y, \"textbox\", \"beziercurve\", [\"name\"]) -> string\n\\n\Creates a new pathText by merging the two objects \"textbox\" and\n\\"beziercurve\" and returns its name. The coordinates are given in the current\n\measurement unit of the document (see UNIT constants). \"name\" should be a\n\unique identifier for the object because you need this name for further access\n\to that object. If \"name\" is not given Scribus will create one for you.\n\\n\May raise NameExistsError if you explicitly pass a name that's already used.\n\May raise NotFoundError if one or both of the named base object don't exist.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_deleteobj__doc__  ,
QT_TR_NOOP("deleteObject([\"name\"])\n\\n\Deletes the item with the name \"name\". If \"name\" is not given the currently\n\selected item is deleted.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_textflow__doc__  ,
QT_TR_NOOP("textFlowMode(\"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\Setting \"state\" to 0 will disable text flow.\n\Setting \"state\" to 1 will make text flow around object frame.\n\Setting \"state\" to 2 will make text flow around bounding box.\n\Setting \"state\" to 3 will make text flow around contour line.\n\If \"state\" is not passed, text flow is toggled.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_objectexists__doc__  ,
QT_TR_NOOP("objectExists([\"name\"]) -> bool\n\\n\Test if an object with specified name really exists in the document.\n\The optional parameter is the object name. When no object name is given,\n\returns True if there is something selected.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setstyle__doc__  ,
QT_TR_NOOP("setStyle(\"style\" [, \"name\"])\n\\n\Apply the named \"style\" to the object named \"name\". If is no object name\n\given, it's applied on the selected object.\n\")   
)

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\")   
)

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\")   
)

docstring

PyObject* scribus_bezierline ( PyObject *  ,
PyObject *  args 
)

Creates a Bezier line - list with points and opt.

name as params.

Definition at line 330 of file cmdobj.cpp.

{
       char *Name = const_cast<char*>("");
       PyObject *il;
       // FIXME: PyList_Check failing will cause the function to return NULL w/o an exception. Separarate out the check.
       if ((!PyArg_ParseTuple(args, "O|es", &il, "utf-8", &Name)) || (!PyList_Check(il)))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       int len = PyList_Size(il);
       if (len < 8)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Point list must contain at least four points (eight values).","python error"));
              return NULL;
       }
       if ((len % 6) != 0)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Point list must have a multiple of six values.","python error"));
              return NULL;
       }
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       double x, y, w, h, kx, ky, kx2, ky2;
       int i = 0;
       x = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       kx = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       ky = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       kx2 = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       ky2 = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       //int ic = ScCore->primaryMainWindow()->view->PaintPolyLine(x, y, 1, 1,      ScCore->primaryMainWindow()->doc->toolSettings.dWidth, ScCore->primaryMainWindow()->doc->toolSettings.dBrush, ScCore->primaryMainWindow()->doc->toolSettings.dPen);
       int ic = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1,       ScCore->primaryMainWindow()->doc->toolSettings.dWidth, ScCore->primaryMainWindow()->doc->toolSettings.dBrush, ScCore->primaryMainWindow()->doc->toolSettings.dPen, true);
       PageItem *it = ScCore->primaryMainWindow()->doc->Items->at(ic);
       it->PoLine.resize(2);
       it->PoLine.setPoint(0, 0, 0);
       it->PoLine.setPoint(1, kx-x, ky-y);
       int pp = 6;
       for (i = 6; i < len - 6; i += 6)
       {
              w = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
              h = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+1))));
              kx = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+2))));
              ky = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+3))));
              kx2 = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+4))));
              ky2 = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+5))));
              it->PoLine.resize(pp);
              it->PoLine.setPoint(pp-4, w-x, h-y);
              it->PoLine.setPoint(pp-3, kx-x, ky-y);
              it->PoLine.setPoint(pp-2, it->PoLine.point(pp-4));
              it->PoLine.setPoint(pp-1, kx2-x, ky2-y);
              pp += 4;
       }
       pp -= 2;
       w = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-6))));
       h = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-5))));
       kx = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-4))));
       ky = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-3))));
       it->PoLine.resize(pp);
       it->PoLine.setPoint(pp-2, w-x, h-y);
       it->PoLine.setPoint(pp-1, kx-x, ky-y);
       FPoint np2 = getMinClipF(&it->PoLine);
       if (np2.x() < 0)
       {
              it->PoLine.translate(-np2.x(), 0);
              ScCore->primaryMainWindow()->doc->MoveItem(np2.x(), 0, it);
       }
       if (np2.y() < 0)
       {
              it->PoLine.translate(0, -np2.y());
              ScCore->primaryMainWindow()->doc->MoveItem(0, np2.y(), it);
       }
       ScCore->primaryMainWindow()->doc->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false);
       ScCore->primaryMainWindow()->doc->AdjustItemSize(it);
       if (Name != "")
              it->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(it->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_deleteobj ( PyObject *  ,
PyObject *  args 
)

Deletes an object - if is the name given the named object is deleted else the active object erased.

Definition at line 458 of file cmdobj.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       ScCore->primaryMainWindow()->doc->m_Selection->clear();
       ScCore->primaryMainWindow()->doc->m_Selection->addItem(i);
       ScCore->primaryMainWindow()->doc->itemSelection_DeleteItem();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_duplicateobject ( PyObject *  ,
PyObject *  args 
)

Christian Hausknecht, 2006-07-12 duplicate an object.

Definition at line 617 of file cmdobj.cpp.

{
       char* name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &name)) {
              return NULL;
       }
       if(!checkHaveDocument()) {
              return NULL;
       }
       // Is there a special name given? Yes -> add this to selection
       PageItem *i = GetUniqueItem(QString::fromUtf8(name));
       if (i != NULL) {
              ScCore->primaryMainWindow()->doc->m_Selection->clear();
              ScCore->primaryMainWindow()->doc->m_Selection->addItem(i);
       }
       else
              return NULL;
       // do the duplicate
       ScCore->primaryMainWindow()->slotEditCopy();
       ScCore->primaryMainWindow()->slotEditPaste();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_getframetype ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
PyObject* scribus_getstylenames ( PyObject *  )

Craig Ringer, 2004-09-09 Enumerate all known paragraph styles.

Definition at line 600 of file cmdobj.cpp.

{
       PyObject *styleList;
       if(!checkHaveDocument())
              return NULL;
       styleList = PyList_New(0);
       for (uint i=0; i < ScCore->primaryMainWindow()->doc->paragraphStyles().count(); ++i)
       {
              if (PyList_Append(styleList, PyString_FromString(ScCore->primaryMainWindow()->doc->paragraphStyles()[i].name().utf8())))
              {
                     // An exception will have already been set by PyList_Append apparently.
                     return NULL;
              }
       }
       return styleList;
}

Here is the call graph for this function:

PyObject* scribus_newellipse ( PyObject *  ,
PyObject *  args 
)

Creates an ellipse with x, y, b and h - name optionally params.

Definition at line 40 of file cmdobj.cpp.

{
       double x, y, w, h;
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Polygon, PageItem::Ellipse,
                                                                      pageUnitXToDocX(x),
                                                                      pageUnitYToDocY(y),
                                                                      ValueToPoint(w),
                                                                      ValueToPoint(h),
                                                                      ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
                                                                      ScCore->primaryMainWindow()->doc->toolSettings.dBrush,
                                                                      ScCore->primaryMainWindow()->doc->toolSettings.dPen,
                                                                      true);
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->doc->setRedrawBounding(ScCore->primaryMainWindow()->doc->Items->at(i));
       if (Name != "")
              ScCore->primaryMainWindow()->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(ScCore->primaryMainWindow()->doc->Items->at(i)->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_newimage ( PyObject *  ,
PyObject *  args 
)

Creates an image frame - x, y, b, h and opt.

name.

Definition at line 69 of file cmdobj.cpp.

{
       double x, y, w, h;
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified,
                                                               pageUnitXToDocX(x),
                                                               pageUnitYToDocY(y),
                                                               ValueToPoint(w),
                                                               ValueToPoint(h),
                                                               1, ScCore->primaryMainWindow()->doc->toolSettings.dBrushPict,
                                                               CommonStrings::None, true);
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->doc->setRedrawBounding(ScCore->primaryMainWindow()->doc->Items->at(i));
       if (Name != "")
              ScCore->primaryMainWindow()->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(ScCore->primaryMainWindow()->doc->Items->at(i)->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_newline ( PyObject *  ,
PyObject *  args 
)

Creates a line object - x, y, b, h and opt.

name.

Definition at line 122 of file cmdobj.cpp.

{
       double x, y, w, h;
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       x = pageUnitXToDocX(x);
       y = pageUnitYToDocY(y);
       w = pageUnitXToDocX(w);
       h = pageUnitYToDocY(h);
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError,
                                          QObject::tr("An object with the requested name already exists.",
                                                               "python error"));
              return NULL;
       }
       int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Line, PageItem::Unspecified,
                                                    x, y, w, h,
                                                    ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
                                                    ScCore->primaryMainWindow()->doc->toolSettings.dBrush,
                                                    ScCore->primaryMainWindow()->doc->toolSettings.dPen, true);
       PageItem *it = ScCore->primaryMainWindow()->doc->Items->at(i);
       it->setRotation(xy2Deg(w-x, h-y));
       it->setWidthHeight(sqrt(pow(x-w, 2.0) + pow(y-h, 2.0)), 1.0);
       it->Sizing = false;
       it->updateClip();
       ScCore->primaryMainWindow()->doc->setRedrawBounding(it);
/* WTF? maybe I'll examine who's author later. Or maybe I'll remove it later ;)
       it->PoLine.resize(4);
       it->PoLine.setPoint(0, 0, 0);
       it->PoLine.setPoint(1, 0, 0);
       it->PoLine.setPoint(2, w-x, h-y);
       it->PoLine.setPoint(3, w-x, h-y);
       FPoint np2 = getMinClipF(&it->PoLine);
       if (np2.x() < 0)
       {
              it->PoLine.translate(-np2.x(), 0);
              ScCore->primaryMainWindow()->view->MoveItem(np2.x(), 0, it);
       }
       if (np2.y() < 0)
       {
              it->PoLine.translate(0, -np2.y());
              ScCore->primaryMainWindow()->view->MoveItem(0, np2.y(), it);
       }
       ScCore->primaryMainWindow()->view->SizeItem(it->PoLine.WidthHeight().x(),
                                           it->PoLine.WidthHeight().y(), i, false, false, false);
       ScCore->primaryMainWindow()->view->AdjustItemSize(it);*/
       if (Name != "")
              it->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(it->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_newrect ( PyObject *  ,
PyObject *  args 
)

Creates a rectangular with params X, Y (base position) b, h (width, height) and optional name of the object.

Definition at line 15 of file cmdobj.cpp.

{
       double x, y, w, h;
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Polygon, PageItem::Rectangle,
                                                        pageUnitXToDocX(x), pageUnitYToDocY(y),
                                                        ValueToPoint(w), ValueToPoint(h),
                                                        ScCore->primaryMainWindow()->doc->toolSettings.dWidth,
                                                        ScCore->primaryMainWindow()->doc->toolSettings.dBrush, ScCore->primaryMainWindow()->doc->toolSettings.dPen, true);
       ScCore->primaryMainWindow()->doc->setRedrawBounding(ScCore->primaryMainWindow()->doc->Items->at(i));
       if (Name != "")
              ScCore->primaryMainWindow()->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(ScCore->primaryMainWindow()->doc->Items->at(i)->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_newtext ( PyObject *  ,
PyObject *  args 
)

Creates a text frame - x, y, b, h and opt.

name.

Definition at line 96 of file cmdobj.cpp.

{
       double x, y, w, h;
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified,
                                                        pageUnitXToDocX(x),
                                                        pageUnitYToDocY(y),
                                                        ValueToPoint(w),
                                                        ValueToPoint(h),
                                                        ScCore->primaryMainWindow()->doc->toolSettings.dWidth, CommonStrings::None,
                                                        ScCore->primaryMainWindow()->doc->toolSettings.dPenText, true);
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->doc->setRedrawBounding(ScCore->primaryMainWindow()->doc->Items->at(i));
       if (Name != "")
              ScCore->primaryMainWindow()->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(ScCore->primaryMainWindow()->doc->Items->at(i)->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_objectexists ( PyObject *  ,
PyObject *  args 
)

User test if an object with specified name really exists in the doc.

Object name as param. 03/29/2004 petr vanek ObjectName is now optional. When none set, search for selection... 07/11/2004 pv

Definition at line 514 of file cmdobj.cpp.

{
       char* name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (ItemExists(QString::fromUtf8(name)))
              return PyBool_FromLong(static_cast<long>(true));
       return PyBool_FromLong(static_cast<long>(false));
}

Here is the call graph for this function:

PyObject* scribus_pathtext ( PyObject *  ,
PyObject *  args 
)

Joins 2 objects - textframe and line - into text on path.

Uses x, y (base of the new object), name of the text frame, name of the line and opt. new name as params.

Definition at line 420 of file cmdobj.cpp.

{
       double x, y;
       char *Name = const_cast<char*>("");
       char *TextB = const_cast<char*>("");
       char *PolyB = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "ddeses|es", &x, &y, "utf-8", &TextB, "utf-8", &PolyB, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       //FIXME: Why use GetItem not GetUniqueItem? Maybe use GetUniqueItem and use the exceptions
       // its sets for us?
       int i = GetItem(QString::fromUtf8(TextB));
       int ii = GetItem(QString::fromUtf8(PolyB));
       if ((i == -1) || (ii == -1))
       {
              PyErr_SetString(NotFoundError, QObject::tr("Object not found.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->doc->m_Selection->clear();
       ScCore->primaryMainWindow()->doc->m_Selection->addItem(ScCore->primaryMainWindow()->doc->Items->at(i));
       ScCore->primaryMainWindow()->doc->m_Selection->addItem(ScCore->primaryMainWindow()->doc->Items->at(ii));
       PageItem *it = ScCore->primaryMainWindow()->doc->Items->at(i);
       ScCore->primaryMainWindow()->view->ToPathText();
       ScCore->primaryMainWindow()->doc->MoveItem(pageUnitXToDocX(x) - it->xPos(), pageUnitYToDocY(y) - it->yPos(), it);
       if (Name != "")
              it->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(it->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_polygon ( PyObject *  ,
PyObject *  args 
)

Creates a polygon - list with points and opt.

name as params.

Definition at line 253 of file cmdobj.cpp.

{
       char *Name = const_cast<char*>("");
       PyObject *il;
       // FIXME: PyList_Check failing will cause the function to return NULL w/o an exception. Separarate out the check.
       if ((!PyArg_ParseTuple(args, "O|es", &il, "utf-8", &Name)) || (!PyList_Check(il)))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       int len = PyList_Size(il);
       if (len < 6)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Point list must contain at least three points (six values).","python error"));
              return NULL;
       }
       if ((len % 2) != 0)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Point list must contain an even number of values.","python error"));
              return NULL;
       }
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       double x, y, w, h;
       int i = 0;
       x = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       int ic = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, 1, 1, ScCore->primaryMainWindow()->doc->toolSettings.dWidth, ScCore->primaryMainWindow()->doc->toolSettings.dBrush, ScCore->primaryMainWindow()->doc->toolSettings.dPen, true);
       PageItem *it = ScCore->primaryMainWindow()->doc->Items->at(ic);
       it->PoLine.resize(2);
       it->PoLine.setPoint(0, 0, 0);
       it->PoLine.setPoint(1, 0, 0);
       int pp = 6;
       for (i = 2; i < len - 2; i += 2)
       {
              w = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
              h = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+1))));
              it->PoLine.resize(pp);
              it->PoLine.setPoint(pp-4, w-x, h-y);
              it->PoLine.setPoint(pp-3, w-x, h-y);
              it->PoLine.setPoint(pp-2, w-x, h-y);
              it->PoLine.setPoint(pp-1, w-x, h-y);
              pp += 4;
       }
       w = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-2))));
       h = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-1))));
       it->PoLine.resize(pp);
       it->PoLine.setPoint(pp-4, w-x, h-y);
       it->PoLine.setPoint(pp-3, w-x, h-y);
       it->PoLine.setPoint(pp-2, w-x, h-y);
       it->PoLine.setPoint(pp-1, w-x, h-y);
       pp += 2;
       it->PoLine.resize(pp);
       it->PoLine.setPoint(pp-2, 0, 0);
       it->PoLine.setPoint(pp-1, 0, 0);
       FPoint np2 = getMinClipF(&it->PoLine);
       if (np2.x() < 0)
       {
              it->PoLine.translate(-np2.x(), 0);
              ScCore->primaryMainWindow()->doc->MoveItem(np2.x(), 0, it);
       }
       if (np2.y() < 0)
       {
              it->PoLine.translate(0, -np2.y());
              ScCore->primaryMainWindow()->doc->MoveItem(0, np2.y(), it);
       }
       ScCore->primaryMainWindow()->doc->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false);
       ScCore->primaryMainWindow()->doc->AdjustItemSize(it);
       if (Name != "")
              it->setItemName(QString::fromUtf8(Name));
       return PyString_FromString(it->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_polyline ( PyObject *  ,
PyObject *  args 
)

Creates a polygon line - list with points and opt.

name as params.

Definition at line 178 of file cmdobj.cpp.

{
       char *Name = const_cast<char*>("");
       PyObject *il;
       // FIXME: PyList_Check failing will cause the function to return NULL w/o an exception. Separarate out the check.
       if ((!PyArg_ParseTuple(args, "O|es", &il, "utf-8", &Name)) || (!PyList_Check(il)))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       int len = PyList_Size(il);
       if (len < 4)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Point list must contain at least two points (four values).","python error"));
              return NULL;
       }
       if ((len % 2) != 0)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Point list must contain an even number of values.","python error"));
              return NULL;
       }
       if (ItemExists(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
              return NULL;
       }
       double x, y, w, h;
       int i = 0;
       x = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
       i++;
       int ic = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1,       ScCore->primaryMainWindow()->doc->toolSettings.dWidth, ScCore->primaryMainWindow()->doc->toolSettings.dBrush, ScCore->primaryMainWindow()->doc->toolSettings.dPen, true);
       PageItem *it = ScCore->primaryMainWindow()->doc->Items->at(ic);
       it->PoLine.resize(2);
       it->PoLine.setPoint(0, 0, 0);
       it->PoLine.setPoint(1, 0, 0);
       int pp = 6;
       for (i = 2; i < len - 2; i += 2)
       {
              w = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
              h = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i+1))));
              it->PoLine.resize(pp);
              it->PoLine.setPoint(pp-4, w-x, h-y);
              it->PoLine.setPoint(pp-3, w-x, h-y);
              it->PoLine.setPoint(pp-2, w-x, h-y);
              it->PoLine.setPoint(pp-1, w-x, h-y);
              pp += 4;
       }
       pp -= 2;
       w = pageUnitXToDocX(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-2))));
       h = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, len-1))));
       it->PoLine.resize(pp);
       it->PoLine.setPoint(pp-2, w-x, h-y);
       it->PoLine.setPoint(pp-1, w-x, h-y);
       FPoint np2 = getMinClipF(&it->PoLine);
       if (np2.x() < 0)
       {
              it->PoLine.translate(-np2.x(), 0);
              ScCore->primaryMainWindow()->doc->MoveItem(np2.x(), 0, it);
       }
       if (np2.y() < 0)
       {
              it->PoLine.translate(0, -np2.y());
              ScCore->primaryMainWindow()->doc->MoveItem(0, np2.y(), it);
       }
       ScCore->primaryMainWindow()->doc->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false);
       ScCore->primaryMainWindow()->doc->AdjustItemSize(it);
       if (Name != "")
       {
              it->setItemName(QString::fromUtf8(Name));
       }
       return PyString_FromString(it->itemName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_setstyle ( PyObject *  ,
PyObject *  args 
)

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

Definition at line 531 of file cmdobj.cpp.

{
       char *style = const_cast<char*>("");
       char *name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &style, "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))
       {
              // 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;
              uint styleid = 0;
              // We start at zero here because it's OK to match an internal name
              uint docParagraphStylesCount=ScCore->primaryMainWindow()->doc->paragraphStyles().count();
              for (uint i=0; i < docParagraphStylesCount; ++i)
              {
                     if (ScCore->primaryMainWindow()->doc->paragraphStyles()[i].name() == QString::fromUtf8(style)) {
                            found = true;
                            styleid = i;
                            break;
                     }
              }
              if (!found) {
                     // whoops, the user specified an invalid style, complain loudly.
                     PyErr_SetString(NotFoundError, QObject::tr("Style not found.","python error"));
                     return NULL;
              }
              // for current item only
              if (ScCore->primaryMainWindow()->doc->m_Selection->count() == 0 || name != "")
              {
                     // quick hack to always apply on the right frame - pv
                     ScCore->primaryMainWindow()->view->Deselect(true);
                     //CB I dont think we need to draw here. Its faster if we dont.
                     ScCore->primaryMainWindow()->view->SelectItem(item, false);
                     // Now apply the style.
                     int mode = ScCore->primaryMainWindow()->doc->appMode;
                     ScCore->primaryMainWindow()->doc->appMode = modeEdit;
                     ScCore->primaryMainWindow()->setNewParStyle(QString::fromUtf8(style));
                     ScCore->primaryMainWindow()->doc->appMode = mode;
              }
              else // for multiple selection
              {
                     int mode = ScCore->primaryMainWindow()->doc->appMode;
                     ScCore->primaryMainWindow()->doc->appMode = modeNormal;
                     ScCore->primaryMainWindow()->doc->itemSelection_ApplyParagraphStyle(ScCore->primaryMainWindow()->doc->paragraphStyles()[styleid]);
                     ScCore->primaryMainWindow()->doc->appMode = mode;
              }
       }
       else
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set style on a non-text frame.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_textflow ( PyObject *  ,
PyObject *  args 
)

Enables/disables "Text Flows Around Object" feature for object.

Called with params string objectName and state 0|1|2|3. When set to 0 disable flowing, 1 text flows around frame, 2 around bounding box, 3 around contour line. When is second param empty flowing is reverted. 02/28/2004 petr vanek

Definition at line 479 of file cmdobj.cpp.

{
       char *name = const_cast<char*>("");
       int state = -1;

       if (!PyArg_ParseTuple(args, "es|i", "utf-8", &name, &state))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(name));
       if (i == NULL)
              return NULL;
       if (state == -1)
       {
              if (i->textFlowAroundObject())
                     i->setTextFlowMode(PageItem::TextFlowDisabled);
              else
                     i->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
       }
       else if( state == (int) PageItem::TextFlowDisabled )
              i->setTextFlowMode(PageItem::TextFlowDisabled);
       else if( state == (int) PageItem::TextFlowUsesFrameShape )
              i->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
       else if( state == (int) PageItem::TextFlowUsesBoundingBox )
              i->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
       else if( state == (int) PageItem::TextFlowUsesContourLine )
              i->setTextFlowMode(PageItem::TextFlowUsesContourLine);
       ScCore->primaryMainWindow()->view->DrawNew();
       ScCore->primaryMainWindow()->slotDocCh(true);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function: