Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion scribus/plugins/scriptplugin/cmdmani.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,39 @@ PyObject *scribus_deselect(PyObject* /* self */)
Py_RETURN_NONE;
}

PyObject *scribus_exportableobject(PyObject* /* self */, PyObject* args)
{
char *name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
return NULL;
if(!checkHaveDocument())
return NULL;
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == NULL)
return NULL;
item->togglePrintEnabled();
if (item->locked())
return PyInt_FromLong(1);
return PyInt_FromLong(0);
}

PyObject *scribus_isexportable(PyObject* /* self */, PyObject* args)
{
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->printEnabled())
return PyBool_FromLong(1);
return PyBool_FromLong(0);
}

PyObject *scribus_lockobject(PyObject* /* self */, PyObject* args)
{
char *name = const_cast<char*>("");
Expand Down Expand Up @@ -628,6 +661,8 @@ void cmdmanidocwarnings()
<< scribus_ungroupobj__doc__ << scribus_scalegroup__doc__
<< scribus_loadimage__doc__ << scribus_scaleimage__doc__
<< scribus_setimagescale__doc__ << scribus_lockobject__doc__
<< scribus_islocked__doc__ << scribus_setscaleimagetoframe__doc__ << scribus_setimagebrightness__doc__ << scribus_setimagegrayscale__doc__ << scribus_setimageoffset__doc__
<< scribus_islocked__doc__
<< scribus_exportablebject__doc__ << scribus_isexportable__doc__ <<
scribus_setscaleimagetoframe__doc__ << scribus_setimagebrightness__doc__ << scribus_setimagegrayscale__doc__ << scribus_setimageoffset__doc__
<< scribus_flipobject__doc__;
}
21 changes: 21 additions & 0 deletions scribus/plugins/scriptplugin/cmdmani.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,27 @@ May raise WrongFrameTypeError if the target frame is not an image frame\n\
/*! Set Image Brightness. */
PyObject *scribus_setimagegrayscale(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_exportablebject__doc__,
QT_TR_NOOP("exportableObject([\"name\"]) -> bool\n\
\n\
Sets the object \"name\" as exportable if it's not (or viceversa).\n\
If \"name\" is not given the currently selected item is used. Returns true\n\
if exportable.\n\
"));
/*! (Un)Lock the object 2004/7/10 pv.*/
PyObject *scribus_exportableobject(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_isexportable__doc__,
QT_TR_NOOP("isExportable([\"name\"]) -> bool\n\
\n\
Returns true if is the object \"name\" is exportable. If \"name\" is not given the\n\
currently selected item is used.\n\
"));
/*! Status of locking 2004/7/10 pv.*/
PyObject *scribus_isexportable(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_lockobject__doc__,
QT_TR_NOOP("lockObject([\"name\"]) -> bool\n\
Expand Down
2 changes: 2 additions & 0 deletions scribus/plugins/scriptplugin/scriptplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,12 @@ PyMethodDef scribus_methods[] = {
{const_cast<char*>("isLayerLocked"), scribus_glayerlock, METH_VARARGS, tr(scribus_glayerlock__doc__)},
{const_cast<char*>("isLayerOutlined"), scribus_glayeroutline, METH_VARARGS, tr(scribus_glayeroutline__doc__)},
{const_cast<char*>("isLayerFlow"), scribus_glayerflow, METH_VARARGS, tr(scribus_glayerflow__doc__)},
{const_cast<char*>("isExportable"), scribus_isexportable, METH_VARARGS, tr(scribus_isexportable__doc__)},
{const_cast<char*>("isLocked"), scribus_islocked, METH_VARARGS, tr(scribus_islocked__doc__)},
{const_cast<char*>("linkTextFrames"), scribus_linktextframes, METH_VARARGS, tr(scribus_linktextframes__doc__)},
{const_cast<char*>("loadImage"), scribus_loadimage, METH_VARARGS, tr(scribus_loadimage__doc__)},
{const_cast<char*>("loadStylesFromFile"), scribus_loadstylesfromfile, METH_VARARGS, tr(scribus_loadstylesfromfile__doc__)},
{const_cast<char*>("exportableObject"), scribus_exportableobject, METH_VARARGS, tr(scribus_exportablebject__doc__)},
{const_cast<char*>("lockObject"), scribus_lockobject, METH_VARARGS, tr(scribus_lockobject__doc__)},
{const_cast<char*>("masterPageNames"), (PyCFunction)scribus_masterpagenames, METH_NOARGS, tr(scribus_masterpagenames__doc__)},
{const_cast<char*>("mergeTableCells"), scribus_mergetablecells, METH_VARARGS, tr(scribus_mergetablecells__doc__)},
Expand Down