Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
cmdmisc.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_setredraw__doc__, QT_TR_NOOP("setRedraw(bool)\n\ \n\ Disables page redraw when bool = False, otherwise redrawing is enabled.\n\ This change will persist even after the script exits, so make sure to call\n\ setRedraw(True) in a finally: clause at the top level of your script.\n\ "))
 Other Commands.
PyObject * scribus_setredraw (PyObject *, PyObject *args)
 Enable/disable page redrawing.
 PyDoc_STRVAR (scribus_fontnames__doc__, QT_TR_NOOP("getFontNames() -> list\n\ \n\ Returns a list with the names of all available fonts.\n\ "))
 docstring
PyObject * scribus_fontnames (PyObject *)
 simple list of font names.
 PyDoc_STRVAR (scribus_xfontnames__doc__, QT_TR_NOOP("getXFontNames() -> list of tuples\n\ \n\ Returns a larger font info. It's a list of the tuples with:\n\ [ (Scribus name, Family, Real name, subset (1|0), embed PS (1|0), font file), (...), ... ]\n\ "))
 docstring
PyObject * scribus_xfontnames (PyObject *)
 return a list of the tuples with Scribus name, Family, Real name, subset (1|0), embed PS (1|0), font file
 PyDoc_STRVAR (scribus_renderfont__doc__, QT_TR_NOOP("renderFont(\"name\", \"filename\", \"sample\", size, format=\"PPM\") -> bool\n\ \n\ Creates an image preview of font \"name\" with given text \"sample\" and size.\n\ If \"filename\" is not \"\", image is saved into \"filename\". Otherwise\n\ image data is returned as a string. The optional \"format\" argument\n\ specifies the image format to generate, and supports any format allowed\n\ by QPixmap.save(). Common formats are PPM, JPEG, PNG and XPM.\n\ \n\ May raise NotFoundError if the specified font can't be found.\n\ May raise ValueError if an empty sample or filename is passed.\n\ "))
 docstring
PyObject * scribus_renderfont (PyObject *, PyObject *args, PyObject *kw)
 Font example to image.
 PyDoc_STRVAR (scribus_getlayers__doc__, QT_TR_NOOP("getLayers() -> list\n\ \n\ Returns a list with the names of all defined layers.\n\ "))
 docstring
PyObject * scribus_getlayers (PyObject *)
 List of the layers.
 PyDoc_STRVAR (scribus_setactlayer__doc__, QT_TR_NOOP("setActiveLayer(\"name\")\n\ \n\ Sets the active layer to the layer named \"name\".\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_setactlayer (PyObject *, PyObject *args)
 Move into layer.
 PyDoc_STRVAR (scribus_getactlayer__doc__, QT_TR_NOOP("getActiveLayer() -> string\n\ \n\ Returns the name of the current active layer.\n\ "))
 docstring
PyObject * scribus_getactlayer (PyObject *)
 Get layer name.
 PyDoc_STRVAR (scribus_senttolayer__doc__, QT_TR_NOOP("sentToLayer(\"layer\" [, \"name\"])\n\ \n\ Sends the object \"name\" to the layer \"layer\". The layer must exist.\n\ If \"name\" is not given the currently selected item is used.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_senttolayer (PyObject *, PyObject *args)
 Move object from one layer to other one.
 PyDoc_STRVAR (scribus_layervisible__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\ the layer is invisible.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layervisible (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_layerprint__doc__, QT_TR_NOOP("setLayerPrintable(\"layer\", printable)\n\ \n\ Sets the layer \"layer\" to be printable or not. If is the\n\ printable set to false the layer won't be printed.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layerprint (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_layerlock__doc__, QT_TR_NOOP("setLayerLocked(\"layer\", locked)\n\ \n\ Sets the layer \"layer\" to be locked or not. If locked is set to\n\ true the layer will be locked.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layerlock (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_layeroutline__doc__, QT_TR_NOOP("setLayerOutlined(\"layer\", outline)\n\ \n\ Sets the layer \"layer\" to be locked or not. If outline is set to\n\ true the layer will be displayed outlined.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layeroutline (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_layerflow__doc__, QT_TR_NOOP("setLayerFlow(\"layer\", flow)\n\ \n\ Sets the layers \"layer\" flowcontrol to flow. If flow is set to\n\ true text in layers above this one will flow around objects on this layer.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layerflow (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_layerblend__doc__, QT_TR_NOOP("setLayerBlendmode(\"layer\", blend)\n\ \n\ Sets the layers \"layer\" blendmode to blend.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layerblend (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_layertrans__doc__, QT_TR_NOOP("setLayerTransparency(\"layer\", trans)\n\ \n\ Sets the layers \"layer\" transparency to trans.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_layertrans (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_glayervisib__doc__, QT_TR_NOOP("isLayerVisible(\"layer\") -> bool\n\ \n\ Returns whether the layer \"layer\" is visible or not, a value of True means\n\ that the layer \"layer\" is visible, a value of False means that the layer\n\ \"layer\" is invisible.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayervisib (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_glayerprint__doc__, QT_TR_NOOP("isLayerPrintable(\"layer\") -> bool\n\ \n\ Returns whether the layer \"layer\" is printable or not, a value of True means\n\ that the layer \"layer\" can be printed, a value of False means that printing\n\ the layer \"layer\" is disabled.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayerprint (PyObject *, PyObject *args)
 Set layer printable.
 PyDoc_STRVAR (scribus_glayerlock__doc__, QT_TR_NOOP("isLayerLocked(\"layer\") -> bool\n\ \n\ Returns whether the layer \"layer\" is locked or not, a value of True means\n\ that the layer \"layer\" is editable, a value of False means that the layer\n\ \"layer\" is locked.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayerlock (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_glayeroutline__doc__, QT_TR_NOOP("isLayerOutlined(\"layer\") -> bool\n\ \n\ Returns whether the layer \"layer\" is outlined or not, a value of True means\n\ that the layer \"layer\" is outlined, a value of False means that the layer\n\ \"layer\" is normal.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayeroutline (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_glayerflow__doc__, QT_TR_NOOP("isLayerFlow(\"layer\") -> bool\n\ \n\ Returns whether text flows around objects on layer \"layer\", a value of True means\n\ that text flows around, a value of False means that the text does not flow around.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayerflow (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_glayerblend__doc__, QT_TR_NOOP("getLayerBlendmode(\"layer\") -> int\n\ \n\ Returns the \"layer\" layer blendmode,\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayerblend (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_glayertrans__doc__, QT_TR_NOOP("getLayerTransparency(\"layer\") -> float\n\ \n\ Returns the \"layer\" layer transparency,\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_glayertrans (PyObject *, PyObject *args)
 Set layer visible.
 PyDoc_STRVAR (scribus_removelayer__doc__, QT_TR_NOOP("deleteLayer(\"layer\")\n\ \n\ Deletes the layer with the name \"layer\". Nothing happens if the layer doesn't\n\ exists or if it's the only layer in the document.\n\ \n\ May raise NotFoundError if the layer can't be found.\n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_removelayer (PyObject *, PyObject *args)
 Remove layer.
 PyDoc_STRVAR (scribus_createlayer__doc__, QT_TR_NOOP("createLayer(layer)\n\ \n\ Creates a new layer with the name \"name\".\n\ \n\ May raise ValueError if the layer name isn't acceptable.\n\ "))
 docstring
PyObject * scribus_createlayer (PyObject *, PyObject *args)
 New layer.
 PyDoc_STRVAR (scribus_getlanguage__doc__, QT_TR_NOOP("getGuiLanguage() -> string\n\ \n\ Returns a string with the -lang value.\n\ "))
 docstring
PyObject * scribus_getlanguage (PyObject *)
 Language of the GUI.

Function Documentation

PyDoc_STRVAR ( scribus_setredraw__doc__  ,
QT_TR_NOOP("setRedraw(bool)\n\\n\Disables page redraw when bool = False, otherwise redrawing is enabled.\n\This change will persist even after the script exits, so make sure to call\n\setRedraw(True) in a finally: clause at the top level of your script.\n\")   
)

Other Commands.

docstring

PyDoc_STRVAR ( scribus_fontnames__doc__  ,
QT_TR_NOOP("getFontNames() -> list\n\\n\Returns a list with the names of all available fonts.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_xfontnames__doc__  ,
QT_TR_NOOP("getXFontNames() -> list of tuples\n\\n\Returns a larger font info. It's a list of the tuples with:\n\[ (Scribus name, Family, Real name, subset (1|0), embed PS (1|0), font file), (...), ... ]\n\")   
)

docstring

PyDoc_STRVAR ( scribus_renderfont__doc__  ,
QT_TR_NOOP("renderFont(\"name\", \"filename\", \"sample\", size, format=\"PPM\") -> bool\n\\n\Creates an image preview of font \"name\" with given text \"sample\" and size.\n\If \"filename\" is not \"\", image is saved into \"filename\". Otherwise\n\image data is returned as a string. The optional \"format\" argument\n\specifies the image format to generate, and supports any format allowed\n\by QPixmap.save(). Common formats are PPM, JPEG, PNG and XPM.\n\\n\May raise NotFoundError if the specified font can't be found.\n\May raise ValueError if an empty sample or filename is passed.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getlayers__doc__  ,
QT_TR_NOOP("getLayers() -> list\n\\n\Returns a list with the names of all defined layers.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setactlayer__doc__  ,
QT_TR_NOOP("setActiveLayer(\"name\")\n\\n\Sets the active layer to the layer named \"name\".\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getactlayer__doc__  ,
QT_TR_NOOP("getActiveLayer() -> string\n\\n\Returns the name of the current active layer.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_senttolayer__doc__  ,
QT_TR_NOOP("sentToLayer(\"layer\" [, \"name\"])\n\\n\Sends the object \"name\" to the layer \"layer\". The layer must exist.\n\If \"name\" is not given the currently selected item is used.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layervisible__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\the layer is invisible.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layerprint__doc__  ,
QT_TR_NOOP("setLayerPrintable(\"layer\", printable)\n\\n\Sets the layer \"layer\" to be printable or not. If is the\n\printable set to false the layer won't be printed.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layerlock__doc__  ,
QT_TR_NOOP("setLayerLocked(\"layer\", locked)\n\\n\Sets the layer \"layer\" to be locked or not. If locked is set to\n\true the layer will be locked.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layeroutline__doc__  ,
QT_TR_NOOP("setLayerOutlined(\"layer\", outline)\n\\n\Sets the layer \"layer\" to be locked or not. If outline is set to\n\true the layer will be displayed outlined.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layerflow__doc__  ,
QT_TR_NOOP("setLayerFlow(\"layer\", flow)\n\\n\Sets the layers \"layer\" flowcontrol to flow. If flow is set to\n\true text in layers above this one will flow around objects on this layer.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layerblend__doc__  ,
QT_TR_NOOP("setLayerBlendmode(\"layer\", blend)\n\\n\Sets the layers \"layer\" blendmode to blend.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_layertrans__doc__  ,
QT_TR_NOOP("setLayerTransparency(\"layer\", trans)\n\\n\Sets the layers \"layer\" transparency to trans.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayervisib__doc__  ,
QT_TR_NOOP("isLayerVisible(\"layer\") -> bool\n\\n\Returns whether the layer \"layer\" is visible or not, a value of True means\n\that the layer \"layer\" is visible, a value of False means that the layer\n\\"layer\" is invisible.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayerprint__doc__  ,
QT_TR_NOOP("isLayerPrintable(\"layer\") -> bool\n\\n\Returns whether the layer \"layer\" is printable or not, a value of True means\n\that the layer \"layer\" can be printed, a value of False means that printing\n\the layer \"layer\" is disabled.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayerlock__doc__  ,
QT_TR_NOOP("isLayerLocked(\"layer\") -> bool\n\\n\Returns whether the layer \"layer\" is locked or not, a value of True means\n\that the layer \"layer\" is editable, a value of False means that the layer\n\\"layer\" is locked.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayeroutline__doc__  ,
QT_TR_NOOP("isLayerOutlined(\"layer\") -> bool\n\\n\Returns whether the layer \"layer\" is outlined or not, a value of True means\n\that the layer \"layer\" is outlined, a value of False means that the layer\n\\"layer\" is normal.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayerflow__doc__  ,
QT_TR_NOOP("isLayerFlow(\"layer\") -> bool\n\\n\Returns whether text flows around objects on layer \"layer\", a value of True means\n\that text flows around, a value of False means that the text does not flow around.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayerblend__doc__  ,
QT_TR_NOOP("getLayerBlendmode(\"layer\") -> int\n\\n\Returns the \"layer\" layer blendmode,\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_glayertrans__doc__  ,
QT_TR_NOOP("getLayerTransparency(\"layer\") -> float\n\\n\Returns the \"layer\" layer transparency,\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_removelayer__doc__  ,
QT_TR_NOOP("deleteLayer(\"layer\")\n\\n\Deletes the layer with the name \"layer\". Nothing happens if the layer doesn't\n\exists or if it's the only layer in the document.\n\\n\May raise NotFoundError if the layer can't be found.\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_createlayer__doc__  ,
QT_TR_NOOP("createLayer(layer)\n\\n\Creates a new layer with the name \"name\".\n\\n\May raise ValueError if the layer name isn't acceptable.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getlanguage__doc__  ,
QT_TR_NOOP("getGuiLanguage() -> string\n\\n\Returns a string with the -lang value.\n\")   
)

docstring

PyObject* scribus_createlayer ( PyObject *  ,
PyObject *  args 
)

New layer.

Definition at line 734 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create layer without a name.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->doc->addLayer(QString::fromUtf8(Name), true);
       ScCore->primaryMainWindow()->changeLayer(ScCore->primaryMainWindow()->doc->activeLayer());
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_fontnames ( PyObject *  )

simple list of font names.

Definition at line 30 of file cmdmisc.cpp.

{
       int cc2 = 0;
       SCFontsIterator it2(PrefsManager::instance()->appPrefs.AvailFonts);
       for ( ; it2.hasNext() ; it2.next())
       {
              if (it2.current().usable())
                     cc2++;
       }
       PyObject *l = PyList_New(cc2);
       SCFontsIterator it(PrefsManager::instance()->appPrefs.AvailFonts);
       int cc = 0;
       for ( ; it.hasNext() ; it.next())
       {
              if (it.current().usable())
              {
                     PyList_SetItem(l, cc, PyString_FromString(it.currentKey().utf8()));
                     cc++;
              }
       }
       return l;
}

Here is the call graph for this function:

PyObject* scribus_getactlayer ( PyObject *  )

Get layer name.

Definition at line 182 of file cmdmisc.cpp.

{
       if(!checkHaveDocument())
              return NULL;
       return PyString_FromString(ScCore->primaryMainWindow()->doc->activeLayerName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_getlanguage ( PyObject *  )

Language of the GUI.

Definition at line 753 of file cmdmisc.cpp.

{
       return PyString_FromString(ScCore->getGuiLanguage().utf8());
}

Here is the call graph for this function:

PyObject* scribus_getlayers ( PyObject *  )

List of the layers.

Definition at line 146 of file cmdmisc.cpp.

{
       if(!checkHaveDocument())
              return NULL;
       PyObject *l;
       l = PyList_New(ScCore->primaryMainWindow()->doc->Layers.count());
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
              PyList_SetItem(l, lam, PyString_FromString(ScCore->primaryMainWindow()->doc->Layers[lam].Name.utf8()));
       return l;
}

Here is the call graph for this function:

PyObject* scribus_glayerblend ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 615 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       int i = 0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = ScCore->primaryMainWindow()->doc->Layers[lam].blendMode;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i));
}

Here is the call graph for this function:

PyObject* scribus_glayerflow ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 584 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       int i = 0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = static_cast<int>(ScCore->primaryMainWindow()->doc->Layers[lam].flowControl);
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i));
}

Here is the call graph for this function:

PyObject* scribus_glayerlock ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 522 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       int i = 0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = static_cast<int>(ScCore->primaryMainWindow()->doc->Layers[lam].isEditable);
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i));
}

Here is the call graph for this function:

PyObject* scribus_glayeroutline ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 553 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       int i = 0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = static_cast<int>(ScCore->primaryMainWindow()->doc->Layers[lam].outlineMode);
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i));
}

Here is the call graph for this function:

PyObject* scribus_glayerprint ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 491 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       int i = 0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = static_cast<int>(ScCore->primaryMainWindow()->doc->Layers[lam].isPrintable);
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i));
}

Here is the call graph for this function:

PyObject* scribus_glayertrans ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 646 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       double i = 1.0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = ScCore->primaryMainWindow()->doc->Layers[lam].transparency;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyFloat_FromDouble(i);
}

Here is the call graph for this function:

PyObject* scribus_glayervisib ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 460 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       int i = 0;
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); lam++)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     i = static_cast<int>(ScCore->primaryMainWindow()->doc->Layers[lam].isViewable);
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i));
}

Here is the call graph for this function:

PyObject* scribus_layerblend ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 394 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       int vis = 0;
       if (!PyArg_ParseTuple(args, "esi", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QString("Cannot have an empty layer name"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].blendMode = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_layerflow ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 361 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       int vis = 1;
       if (!PyArg_ParseTuple(args, "esi", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].flowControl = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_layerlock ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 295 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       int vis = 1;
       if (!PyArg_ParseTuple(args, "esi", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].isEditable = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_layeroutline ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 328 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       int vis = 1;
       if (!PyArg_ParseTuple(args, "esi", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].outlineMode = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_layerprint ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 262 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       int vis = 1;
       if (!PyArg_ParseTuple(args, "esi", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].isPrintable = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_layertrans ( PyObject *  ,
PyObject *  args 
)

Set layer printable.

Definition at line 427 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       double vis = 1.0;
       if (!PyArg_ParseTuple(args, "esd", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QString("Cannot have an empty layer name"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].transparency = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_layervisible ( PyObject *  ,
PyObject *  args 
)

Set layer visible.

Definition at line 229 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       int vis = 1;
       if (!PyArg_ParseTuple(args, "esi", "utf-8", &Name, &vis))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QString("Cannot have an empty layer name"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     ScCore->primaryMainWindow()->doc->Layers[lam].isViewable = vis;
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_removelayer ( PyObject *  ,
PyObject *  args 
)

Remove layer.

Definition at line 677 of file cmdmisc.cpp.

{
//FIXME: Use the docs remove layer code
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       if (ScCore->primaryMainWindow()->doc->Layers.count() == 1)
       {
              PyErr_SetString(ScribusException, QObject::tr("Cannot remove the last layer.","python error"));
              return NULL;
       }
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
              {
                     QValueList<Layer>::iterator it2 = ScCore->primaryMainWindow()->doc->Layers.at(lam);
                     int num2 = (*it2).LNr;
                     if (!num2)
                     {
                            // FIXME: WTF DOES THIS DO?
                            Py_INCREF(Py_None);
                            return Py_None;
                     }
                     int num = (*it2).Level;
                     ScCore->primaryMainWindow()->doc->Layers.remove(it2);
                     QValueList<Layer>::iterator it;
                     for (uint l = 0; l < ScCore->primaryMainWindow()->doc->Layers.count(); l++)
                     {
                            it = ScCore->primaryMainWindow()->doc->Layers.at(l);
                            if ((*it).Level > num)
                                   (*it).Level -= 1;
                     }
                     ScCore->primaryMainWindow()->doc->removeLayer(num2);
                     ScCore->primaryMainWindow()->doc->setActiveLayer(0);
                     ScCore->primaryMainWindow()->changeLayer(0);
                     found = true;
                     break;
              }
       }
       if (!found)
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_renderfont ( PyObject *  ,
PyObject *  args,
PyObject *  kw 
)

Font example to image.

Definition at line 77 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       char *FileName = const_cast<char*>("");
       char *Sample = const_cast<char*>("");
       char *format = NULL;
       int Size;
       bool ret = false;
       char *kwargs[] = {const_cast<char*>("fontname"),
                                     const_cast<char*>("filename"),
                                     const_cast<char*>("sample"),
                                     const_cast<char*>("size"),
                                     const_cast<char*>("format"),
                                     NULL};
       if (!PyArg_ParseTupleAndKeywords(args, kw, "esesesi|es", kwargs,
                            "utf-8", &Name, "utf-8", &FileName, "utf-8", &Sample, &Size, "ascii", &format))
              return NULL;
       if (!PrefsManager::instance()->appPrefs.AvailFonts.contains(QString::fromUtf8(Name)))
       {
              PyErr_SetString(NotFoundError, QObject::tr("Font not found.","python error"));
              return NULL;
       }
       QString ts = QString::fromUtf8(Sample);
       if (ts.isEmpty())
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot render an empty sample.","python error"));
              return NULL;
       }
       if (!format)
              // User specified no format, so use the historical default of PPM format.
              format = "PPM";
       QPixmap pm = FontSample(PrefsManager::instance()->appPrefs.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 (QString::fromUtf8(FileName).isEmpty())
       {
              QCString buffer_string = "";
              QBuffer buffer(buffer_string);
              buffer.open(IO_WriteOnly);
              bool ret = pm.save(&buffer, format);
              if (!ret)
              {
                     PyErr_SetString(ScribusException, QObject::tr("Unable to save pixmap","scripter error"));
                     return NULL;
              }
              int bufferSize = buffer.size();
              buffer.close();
              // Now make a Python string from the data we generated
              PyObject* stringPython = PyString_FromStringAndSize(buffer_string,bufferSize);
              // Return even if the result is NULL (error) since an exception will have been
              // set in that case.
              return stringPython;
       }
       else
       // Save the pixmap to a file, since the filename is non-empty
       {
              ret = pm.save(QString::fromUtf8(FileName), format);
              if (!ret)
              {
                     PyErr_SetString(PyExc_Exception, QObject::tr("Unable to save pixmap","scripter error"));
                     return NULL;
              }
              // For historical reasons, we need to return true on success.
//            Py_INCREF(Py_True);
//            return Py_True;
              Py_RETURN_TRUE;
       }
}

Here is the call graph for this function:

PyObject* scribus_senttolayer ( PyObject *  ,
PyObject *  args 
)

Move object from one layer to other one.

Definition at line 189 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       char *Layer = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Layer, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Layer == "")
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       ScCore->primaryMainWindow()->view->SelectItemNr(i->ItemNr);
       bool found = false;
       for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
       {
              ScCore->primaryMainWindow()->view->SelectItemNr(i->ItemNr);
              for (uint lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
                     if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Layer))
                     {
                            i->LayerNr = static_cast<int>(lam);
                            found = true;
                            break;
                     }
       }
       if (!found)
       {
              PyErr_SetString(ScribusException, QString("Layer not found"));
              return NULL;
       }

//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setactlayer ( PyObject *  ,
PyObject *  args 
)

Move into layer.

Definition at line 157 of file cmdmisc.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (Name == 0)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
              return NULL;
       }
       bool found = ScCore->primaryMainWindow()->doc->setActiveLayer(QString::fromUtf8(Name));
       if (found)
              ScCore->primaryMainWindow()->changeLayer(ScCore->primaryMainWindow()->doc->activeLayer());
       else
       {
              PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setredraw ( PyObject *  ,
PyObject *  args 
)

Enable/disable page redrawing.

Definition at line 17 of file cmdmisc.cpp.

{
       int e;
       if (!PyArg_ParseTuple(args, "i", &e))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       ScCore->primaryMainWindow()->doc->DoDrawing = static_cast<bool>(e);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_xfontnames ( PyObject *  )

return a list of the tuples with Scribus name, Family, Real name, subset (1|0), embed PS (1|0), font file

Definition at line 53 of file cmdmisc.cpp.

{
       PyObject *l = PyList_New(PrefsManager::instance()->appPrefs.AvailFonts.count());
       SCFontsIterator it(PrefsManager::instance()->appPrefs.AvailFonts);
       int cc = 0;
       PyObject *row;
       for ( ; it.hasNext() ; it.next())
       {
              row = Py_BuildValue((char*)"(sssiis)",
                                                 it.currentKey().utf8().data(),
                                                 it.current().family().utf8().data(),
                                                 it.current().psName().utf8().data(),
                                                 it.current().subset(),
                                                 it.current().embedPs(),
                                                 it.current().fontFilePath().utf8().data()
                                          );
              PyList_SetItem(l, cc, row);
              cc++;
       } // for
       return l;
}