Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
cmdmani.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_moveobjrel__doc__, QT_TR_NOOP("moveObject(dx, dy [, \"name\"])\n\ \n\ Moves the object \"name\" by dx and dy relative to its current position. The\n\ distances are expressed in the current measurement unit of the document (see\n\ UNIT constants). If \"name\" is not given the currently selected item is used.\n\ If the object \"name\" belongs to a group, the whole group is moved.\n\ "))
 Manipulating Objects.
PyObject * scribus_moveobjrel (PyObject *, PyObject *args)
 Move REL the object.
 PyDoc_STRVAR (scribus_moveobjabs__doc__, QT_TR_NOOP("moveObjectAbs(x, y [, \"name\"])\n\ \n\ Moves the object \"name\" to a new location. The coordinates are expressed in\n\ the current measurement unit of the document (see UNIT constants). If \"name\"\n\ is not given the currently selected item is used. If the object \"name\"\n\ belongs to a group, the whole group is moved.\n\ "))
 docstring
PyObject * scribus_moveobjabs (PyObject *, PyObject *args)
 Move ABS the object.
 PyDoc_STRVAR (scribus_rotobjrel__doc__, QT_TR_NOOP("rotateObject(rot [, \"name\"])\n\ \n\ Rotates the object \"name\" by \"rot\" degrees relatively. The object is\n\ rotated by the vertex that is currently selected as the rotation point - by\n\ default, the top left vertext at zero rotation. Positive values mean counter\n\ clockwise rotation when the default rotation point is used. If \"name\" is not\n\ given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_rotobjrel (PyObject *, PyObject *args)
 Rotate REL the object.
 PyDoc_STRVAR (scribus_rotobjabs__doc__, QT_TR_NOOP("rotateObjectAbs(rot [, \"name\"])\n\ \n\ Sets the rotation of the object \"name\" to \"rot\". Positive values\n\ mean counter clockwise rotation. If \"name\" is not given the currently\n\ selected item is used.\n\ "))
 docstring
PyObject * scribus_rotobjabs (PyObject *, PyObject *args)
 Rotate ABS the object.
 PyDoc_STRVAR (scribus_sizeobjabs__doc__, QT_TR_NOOP("sizeObject(width, height [, \"name\"])\n\ \n\ Resizes the object \"name\" to the given width and height. If \"name\"\n\ is not given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_sizeobjabs (PyObject *, PyObject *args)
 Resize ABS the object.
 PyDoc_STRVAR (scribus_getselobjnam__doc__, QT_TR_NOOP("getSelectedObject([nr]) -> string\n\ \n\ Returns the name of the selected object. \"nr\" if given indicates the number\n\ of the selected object, e.g. 0 means the first selected object, 1 means the\n\ second selected Object and so on.\n\ "))
 docstring
PyObject * scribus_getselobjnam (PyObject *, PyObject *args)
 Returns name of the selected object.
 PyDoc_STRVAR (scribus_selcount__doc__, QT_TR_NOOP("selectionCount() -> integer\n\ \n\ Returns the number of selected objects.\n\ "))
 docstring
PyObject * scribus_selcount (PyObject *)
 Returns count of the selected object.
 PyDoc_STRVAR (scribus_selectobj__doc__, QT_TR_NOOP("selectObject(\"name\")\n\ \n\ Selects the object with the given \"name\".\n\ "))
 docstring
PyObject * scribus_selectobj (PyObject *, PyObject *args)
 Count selection.
 PyDoc_STRVAR (scribus_deselect__doc__, QT_TR_NOOP("deselectAll()\n\ \n\ Deselects all objects in the whole document.\n\ "))
 docstring
PyObject * scribus_deselect (PyObject *)
 Remove all selection.
 PyDoc_STRVAR (scribus_groupobj__doc__, QT_TR_NOOP("groupObjects(list)\n\ \n\ Groups the objects named in \"list\" together. \"list\" must contain the names\n\ of the objects to be grouped. If \"list\" is not given the currently selected\n\ items are used.\n\ "))
 docstring
PyObject * scribus_groupobj (PyObject *, PyObject *args)
 Group objects named in list.
 PyDoc_STRVAR (scribus_ungroupobj__doc__, QT_TR_NOOP("unGroupObjects(\"name\")\n\n\ Destructs the group the object \"name\" belongs to.\ If \"name\" is not given the currently selected item is used."))
 docstring
PyObject * scribus_ungroupobj (PyObject *, PyObject *args)
 Ungroup objects named in list.
 PyDoc_STRVAR (scribus_scalegroup__doc__, QT_TR_NOOP("scaleGroup(factor [,\"name\"])\n\ \n\ Scales the group the object \"name\" belongs to. Values greater than 1 enlarge\n\ the group, values smaller than 1 make the group smaller e.g a value of 0.5\n\ scales the group to 50 % of its original size, a value of 1.5 scales the group\n\ to 150 % of its original size. The value for \"factor\" must be greater than\n\ 0. If \"name\" is not given the currently selected item is used.\n\ \n\ May raise ValueError if an invalid scale factor is passed.\n\ "))
 docstring
PyObject * scribus_scalegroup (PyObject *, PyObject *args)
 Scale group with object name.
 PyDoc_STRVAR (scribus_loadimage__doc__, QT_TR_NOOP("loadImage(\"filename\" [, \"name\"])\n\ \n\ Loads the picture \"picture\" into the image frame \"name\". If \"name\" is\n\ not given the currently selected item is used.\n\ \n\ May raise WrongFrameTypeError if the target frame is not an image frame\n\ "))
 docstring
PyObject * scribus_loadimage (PyObject *, PyObject *args)
 Loads image file into frame.
 PyDoc_STRVAR (scribus_scaleimage__doc__, QT_TR_NOOP("scaleImage(x, y [, \"name\"])\n\ \n\ Sets the scaling factors of the picture in the image frame \"name\".\n\ If \"name\" is not given the currently selected item is used. A number of 1\n\ means 100 %.\n\ \n\ May raise WrongFrameTypeError if the target frame is not an image frame\n\ "))
 docstring
PyObject * scribus_scaleimage (PyObject *, PyObject *args)
 Scale Image.
 PyDoc_STRVAR (scribus_lockobject__doc__, QT_TR_NOOP("lockObject([\"name\"]) -> bool\n\ \n\ Locks the object \"name\" if it's unlocked or unlock it if it's locked.\n\ If \"name\" is not given the currently selected item is used. Returns true\n\ if locked.\n\ "))
 docstring
PyObject * scribus_lockobject (PyObject *, PyObject *args)
 (Un)Lock the object 2004/7/10 pv.
 PyDoc_STRVAR (scribus_islocked__doc__, QT_TR_NOOP("isLocked([\"name\"]) -> bool\n\ \n\ Returns true if is the object \"name\" locked. If \"name\" is not given the\n\ currently selected item is used.\n\ "))
 docstring
PyObject * scribus_islocked (PyObject *, PyObject *args)
 Status of locking 2004/7/10 pv.
 PyDoc_STRVAR (scribus_setscaleimagetoframe__doc__, QT_TR_NOOP("setScaleImageToFrame(scaletoframe, proportional=None, name=<selection>)\n\ \n\ Sets the scale to frame on the selected or specified image frame to `scaletoframe'.\n\ If `proportional' is specified, set fixed aspect ratio scaling to `proportional'.\n\ Both `scaletoframe' and `proportional' are boolean.\n\ \n\ May raise WrongFrameTypeError.\n\ "))
PyObject * scribus_setscaleimagetoframe (PyObject *, PyObject *args, PyObject *kwargs)

Function Documentation

PyDoc_STRVAR ( scribus_moveobjrel__doc__  ,
QT_TR_NOOP("moveObject(dx, dy [, \"name\"])\n\\n\Moves the object \"name\" by dx and dy relative to its current position. The\n\distances are expressed in the current measurement unit of the document (see\n\UNIT constants). If \"name\" is not given the currently selected item is used.\n\If the object \"name\" belongs to a group, the whole group is moved.\n\")   
)

Manipulating Objects.

docstring

PyDoc_STRVAR ( scribus_moveobjabs__doc__  ,
QT_TR_NOOP("moveObjectAbs(x, y [, \"name\"])\n\\n\Moves the object \"name\" to a new location. The coordinates are expressed in\n\the current measurement unit of the document (see UNIT constants). If \"name\"\n\is not given the currently selected item is used. If the object \"name\"\n\belongs to a group, the whole group is moved.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_rotobjrel__doc__  ,
QT_TR_NOOP("rotateObject(rot [, \"name\"])\n\\n\Rotates the object \"name\" by \"rot\" degrees relatively. The object is\n\rotated by the vertex that is currently selected as the rotation point - by\n\default, the top left vertext at zero rotation. Positive values mean counter\n\clockwise rotation when the default rotation point is used. If \"name\" is not\n\given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_rotobjabs__doc__  ,
QT_TR_NOOP("rotateObjectAbs(rot [, \"name\"])\n\\n\Sets the rotation of the object \"name\" to \"rot\". Positive values\n\mean counter clockwise rotation. If \"name\" is not given the currently\n\selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_sizeobjabs__doc__  ,
QT_TR_NOOP("sizeObject(width, height [, \"name\"])\n\\n\Resizes the object \"name\" to the given width and height. If \"name\"\n\is not given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getselobjnam__doc__  ,
QT_TR_NOOP("getSelectedObject([nr]) -> string\n\\n\Returns the name of the selected object. \"nr\" if given indicates the number\n\of the selected object, e.g. 0 means the first selected object, 1 means the\n\second selected Object and so on.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_selcount__doc__  ,
QT_TR_NOOP("selectionCount() -> integer\n\\n\Returns the number of selected objects.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_selectobj__doc__  ,
QT_TR_NOOP("selectObject(\"name\")\n\\n\Selects the object with the given \"name\".\n\")   
)

docstring

PyDoc_STRVAR ( scribus_deselect__doc__  ,
QT_TR_NOOP("deselectAll()\n\\n\Deselects all objects in the whole document.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_groupobj__doc__  ,
QT_TR_NOOP("groupObjects(list)\n\\n\Groups the objects named in \"list\" together. \"list\" must contain the names\n\of the objects to be grouped. If \"list\" is not given the currently selected\n\items are used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_ungroupobj__doc__  ,
QT_TR_NOOP("unGroupObjects(\"name\")\n\n\Destructs the group the object \"name\" belongs to.\If \"name\" is not given the currently selected item is used.")   
)

docstring

PyDoc_STRVAR ( scribus_scalegroup__doc__  ,
QT_TR_NOOP("scaleGroup(factor [,\"name\"])\n\\n\Scales the group the object \"name\" belongs to. Values greater than 1 enlarge\n\the group, values smaller than 1 make the group smaller e.g a value of 0.5\n\scales the group to 50 % of its original size, a value of 1.5 scales the group\n\to 150 % of its original size. The value for \"factor\" must be greater than\n\0. If \"name\" is not given the currently selected item is used.\n\\n\May raise ValueError if an invalid scale factor is passed.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_loadimage__doc__  ,
QT_TR_NOOP("loadImage(\"filename\" [, \"name\"])\n\\n\Loads the picture \"picture\" into the image frame \"name\". If \"name\" is\n\not given the currently selected item is used.\n\\n\May raise WrongFrameTypeError if the target frame is not an image frame\n\")   
)

docstring

PyDoc_STRVAR ( scribus_scaleimage__doc__  ,
QT_TR_NOOP("scaleImage(x, y [, \"name\"])\n\\n\Sets the scaling factors of the picture in the image frame \"name\".\n\If \"name\" is not given the currently selected item is used. A number of 1\n\means 100 %.\n\\n\May raise WrongFrameTypeError if the target frame is not an image frame\n\")   
)

docstring

PyDoc_STRVAR ( scribus_lockobject__doc__  ,
QT_TR_NOOP("lockObject([\"name\"]) -> bool\n\\n\Locks the object \"name\" if it's unlocked or unlock it if it's locked.\n\If \"name\" is not given the currently selected item is used. Returns true\n\if locked.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_islocked__doc__  ,
QT_TR_NOOP("isLocked([\"name\"]) -> bool\n\\n\Returns true if is the object \"name\" locked. If \"name\" is not given the\n\currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setscaleimagetoframe__doc__  ,
QT_TR_NOOP("setScaleImageToFrame(scaletoframe, proportional=None, name=<selection>)\n\\n\Sets the scale to frame on the selected or specified image frame to `scaletoframe'.\n\If `proportional' is specified, set fixed aspect ratio scaling to `proportional'.\n\Both `scaletoframe' and `proportional' are boolean.\n\\n\May raise WrongFrameTypeError.\n\")   
)
PyObject* scribus_deselect ( PyObject *  )

Remove all selection.

Definition at line 326 of file cmdmani.cpp.

{
       if(!checkHaveDocument())
              return NULL;
       ScCore->primaryMainWindow()->view->Deselect();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_getselobjnam ( PyObject *  ,
PyObject *  args 
)

Returns name of the selected object.

Definition at line 289 of file cmdmani.cpp.

{
       int i = 0;
       if (!PyArg_ParseTuple(args, "|i", &i))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if ((i < static_cast<int>(ScCore->primaryMainWindow()->doc->m_Selection->count())) && (i > -1))
              return PyString_FromString(ScCore->primaryMainWindow()->doc->m_Selection->itemAt(i)->itemName().utf8());
       else
              // FIXME: Should probably return None if no selection?
              return PyString_FromString("");
}

Here is the call graph for this function:

PyObject* scribus_groupobj ( PyObject *  ,
PyObject *  args 
)

Group objects named in list.

Definition at line 189 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       PyObject *il = 0;
       if (!PyArg_ParseTuple(args, "|O", &il))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       uint ap = ScCore->primaryMainWindow()->doc->currentPage()->pageNr();
       // If we were passed a list of items to group...
       if (il != 0)
       {
              int len = PyList_Size(il);
              if (len < 2)
              {
                     // We can't very well group only one item
                     PyErr_SetString(NoValidObjectError, QObject::tr("Cannot group less than two items", "python error"));
                     return NULL;
              }
              QStringList oldSelection = getSelectedItemsByName();
              ScCore->primaryMainWindow()->view->Deselect();
              for (int i = 0; i < len; i++)
              {
                     // FIXME: We might need to explicitly get this string as utf8
                     // but as sysdefaultencoding is utf8 it should be a no-op to do
                     // so anyway.
                     Name = PyString_AsString(PyList_GetItem(il, i));
                     PageItem *ic = GetUniqueItem(QString::fromUtf8(Name));
                     if (ic == NULL)
                            return NULL;
                     ScCore->primaryMainWindow()->view->SelectItemNr(ic->ItemNr);
              }
              ScCore->primaryMainWindow()->GroupObj();
              setSelectedItemsByName(oldSelection);
       }
       // or if no argument list was given but there is a selection...
       else if (ScCore->primaryMainWindow()->doc->m_Selection->count() != 0)
       {
              if (ScCore->primaryMainWindow()->doc->m_Selection->count() < 2)
              {
                     // We can't very well group only one item
                     PyErr_SetString(NoValidObjectError, QObject::tr("Can't group less than two items", "python error"));
                     return NULL;
              }
              ScCore->primaryMainWindow()->GroupObj();
              ScCore->primaryMainWindow()->view->GotoPage(ap);
       }
       else
       {
              PyErr_SetString(PyExc_TypeError, QObject::tr("Need selection or argument list of items to group", "python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_islocked ( PyObject *  ,
PyObject *  args 
)

Status of locking 2004/7/10 pv.

Definition at line 352 of file cmdmani.cpp.

{
       char *name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
              return NULL;
       // FIXME: Rather than toggling the lock, we should probably let the user set the lock state
       // and instead provide a different function like toggleLock()
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(name));
       if (item == NULL)
              return NULL;
       if (item->locked())
              return PyBool_FromLong(1);
       return PyBool_FromLong(0);
}

Here is the call graph for this function:

PyObject* scribus_loadimage ( PyObject *  ,
PyObject *  args 
)

Loads image file into frame.

Definition at line 13 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       char *Image;
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Image, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item == NULL)
              return NULL;
       if (!item->asImageFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Target is not an image frame.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->doc->LoadPict(QString::fromUtf8(Image), item->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_lockobject ( PyObject *  ,
PyObject *  args 
)

(Un)Lock the object 2004/7/10 pv.

Definition at line 336 of file cmdmani.cpp.

{
       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;
       item->toggleLock();
       if (item->locked())
              return PyInt_FromLong(1);
       return PyInt_FromLong(0);
}

Here is the call graph for this function:

PyObject* scribus_moveobjabs ( PyObject *  ,
PyObject *  args 
)

Move ABS the object.

Definition at line 97 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double x, y;
       if (!PyArg_ParseTuple(args, "dd|es", &x, &y, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item == NULL)
              return NULL;
       // Grab the old selection
       //QPtrList<PageItem> oldSelection = ScCore->primaryMainWindow()->view->SelItem;
       //int tempList=ScCore->primaryMainWindow()->doc->selection->backupToTempList(0);
       Selection tempSelection(*ScCore->primaryMainWindow()->doc->m_Selection);
       // Clear the selection
       ScCore->primaryMainWindow()->view->Deselect();
       // Select the item, which will also select its group if
       // there is one.
       ScCore->primaryMainWindow()->view->SelectItemNr(item->ItemNr);
       // Move the item, or items
       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->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
       }
       else
              ScCore->primaryMainWindow()->doc->MoveItem(pageUnitXToDocX(x) - item->xPos(), pageUnitYToDocY(y) - item->yPos(), item);
       // Now restore the selection. We just have to go through and select
       // each and every item, unfortunately.
       //ScCore->primaryMainWindow()->doc->selection->restoreFromTempList(0, tempList);
       *ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
       //ScCore->primaryMainWindow()->view->Deselect();
       //for ( oldSelection.first(); oldSelection.current(); oldSelection.next() )
//            ScCore->primaryMainWindow()->view->SelectItemNr(oldSelection.current()->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_moveobjrel ( PyObject *  ,
PyObject *  args 
)

Move REL the object.

Definition at line 59 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double x, y;
       if (!PyArg_ParseTuple(args, "dd|es", &x, &y, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item==NULL)
              return NULL;
       // Grab the old selection
       //QPtrList<PageItem> oldSelection = ScCore->primaryMainWindow()->view->SelItem;
       //int tempList=ScCore->primaryMainWindow()->doc->selection->backupToTempList(0);
       Selection tempSelection(*ScCore->primaryMainWindow()->doc->m_Selection);
       ScCore->primaryMainWindow()->doc->m_Selection->clear();
       // Clear the selection
       ScCore->primaryMainWindow()->view->Deselect();
       // Select the item, which will also select its group if
       // there is one.
       ScCore->primaryMainWindow()->view->SelectItemNr(item->ItemNr);
       // Move the item, or items
       if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
              ScCore->primaryMainWindow()->view->moveGroup(ValueToPoint(x), ValueToPoint(y));
       else
              ScCore->primaryMainWindow()->doc->MoveItem(ValueToPoint(x), ValueToPoint(y), item);
       // Now restore the selection. We just have to go through and select
       // each and every item, unfortunately.
       //ScCore->primaryMainWindow()->doc->selection->restoreFromTempList(0, tempList);
       *ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
       //ScCore->primaryMainWindow()->view->Deselect();
       //for ( oldSelection.first(); oldSelection.current(); oldSelection.next() )
       //     ScCore->primaryMainWindow()->view->SelectItemNr(oldSelection.current()->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_rotobjabs ( PyObject *  ,
PyObject *  args 
)

Rotate ABS the object.

Definition at line 155 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double x;
       if (!PyArg_ParseTuple(args, "d|es", &x, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item == NULL)
              return NULL;
       ScCore->primaryMainWindow()->doc->RotateItem(x * -1.0, item->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_rotobjrel ( PyObject *  ,
PyObject *  args 
)

Rotate REL the object.

Definition at line 138 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double x;
       if (!PyArg_ParseTuple(args, "d|es", &x, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item == NULL)
              return NULL;
       ScCore->primaryMainWindow()->doc->RotateItem(item->rotation() - x, item->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_scalegroup ( PyObject *  ,
PyObject *  args 
)

Scale group with object name.

Definition at line 262 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double sc;
       if (!PyArg_ParseTuple(args, "d|es", &sc, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (sc == 0.0)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot scale by 0%.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       ScCore->primaryMainWindow()->view->Deselect();
       ScCore->primaryMainWindow()->view->SelectItemNr(i->ItemNr);
       int h = ScCore->primaryMainWindow()->view->frameResizeHandle;
       ScCore->primaryMainWindow()->view->frameResizeHandle = 1;
       ScCore->primaryMainWindow()->view->scaleGroup(sc, sc);
       ScCore->primaryMainWindow()->view->frameResizeHandle = h;
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_scaleimage ( PyObject *  ,
PyObject *  args 
)

Scale Image.

Definition at line 35 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double x, y;
       if (!PyArg_ParseTuple(args, "dd|es", &x, &y, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item == NULL)
              return NULL;
       if (! item->asImageFrame())
       {
              PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error"));
              return NULL;
       }
       item->setImageXYScale(x, y);
       ScCore->primaryMainWindow()->doc->itemSelection_SetImageScale(x, y); //CB why when this is done above?
       ScCore->primaryMainWindow()->doc->updatePic();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_selcount ( PyObject *  )

Returns count of the selected object.

Definition at line 303 of file cmdmani.cpp.

{
       if(!checkHaveDocument())
              return NULL;
       return PyInt_FromLong(static_cast<long>(ScCore->primaryMainWindow()->doc->m_Selection->count()));
}

Here is the call graph for this function:

PyObject* scribus_selectobj ( PyObject *  ,
PyObject *  args 
)

Count selection.

Definition at line 310 of file cmdmani.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()->view->SelectItemNr(i->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setscaleimagetoframe ( PyObject *  ,
PyObject *  args,
PyObject *  kwargs 
)

Definition at line 369 of file cmdmani.cpp.

{
       char *name = const_cast<char*>("");
       long int scaleToFrame = 0;
       long int proportional = 1;
       char* kwargs[] = {"scaletoframe", "proportional", "name", NULL};
       if (!PyArg_ParseTupleAndKeywords(args, kw, "i|ies", kwargs, &scaleToFrame, &proportional, "utf-8", &name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(name));
       if (item == NULL)
              return NULL;
       if (! item->asImageFrame())
       {
              PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error"));
              return NULL;
       }
       // Set the item to scale if appropriate. ScaleType 1 is free
       // scale, 0 is scale to frame.
       item->ScaleType = scaleToFrame == 0;
       // Now, if the user has chosen to set the proportional mode,
       // set it. 1 is proportional, 0 is free aspect.
       if (proportional != -1)
              item->AspectRatio = proportional > 0;
       // Force the braindead app to notice the changes
       
       //FIXME emit or something so we dont need this
       ScCore->primaryMainWindow()->propertiesPalette->setLvalue(item->imageXScale(), item->imageYScale(), item->imageXOffset(), item->imageYOffset());
       item->AdjustPictScale();
       //ScCore->primaryMainWindow()->view->AdjustPictScale(item);
       
       ScCore->primaryMainWindow()->view->RefreshItem(item);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_sizeobjabs ( PyObject *  ,
PyObject *  args 
)

Resize ABS the object.

Definition at line 172 of file cmdmani.cpp.

{
       char *Name = const_cast<char*>("");
       double x, y;
       if (!PyArg_ParseTuple(args, "dd|es", &x, &y, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
       if (item == NULL)
              return NULL;
       ScCore->primaryMainWindow()->doc->SizeItem(ValueToPoint(x), ValueToPoint(y), item->ItemNr);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_ungroupobj ( PyObject *  ,
PyObject *  args 
)

Ungroup objects named in list.

Definition at line 246 of file cmdmani.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()->UnGroupObj();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function: