Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 1384 → Rev 1387

301,3 → 301,36
return PyBool_FromLong(1);
return PyBool_FromLong(0);
PyObject *scribus_setscaleimagetoframe(PyObject */*self*/, PyObject* args, PyObject* kw)
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;
return NULL;
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == NULL)
return NULL;
if (item->PType != FRAME_IMAGE)
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
item->OwnPage->AdjustPreview(item, false);
return Py_None;
182,4 → 182,15
/*! Status of locking 2004/7/10 pv.*/
PyObject *scribus_islocked(PyObject */*self*/, PyObject* args);
QT_TR_NOOP("setScaleImageToFrame(scaletoframe, proportional=None, name=<selection>)\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\
May raise WrongFrameTypeError.\n\
PyObject *scribus_setscaleimagetoframe(PyObject */*self*/, PyObject* args, PyObject* kwargs);
872,6 → 872,7
// duplicity? {"setMultiLine", scribus_setmultiline, METH_VARARGS, "TODO: docstring"},
{const_cast<char*>("setRedraw"), scribus_setredraw, METH_VARARGS, tr(scribus_setredraw__doc__)},
// missing? {"setSelectedObject", scribus_setselobjnam, METH_VARARGS, "Returns the Name of the selecteted Object. \"nr\" if given indicates the Number of the selected Object, e.g. 0 means the first selected Object, 1 means the second selected Object and so on."},
{const_cast<char*>("setScaleImageToFrame"), (PyCFunction)scribus_setscaleimagetoframe, METH_KEYWORDS, tr(scribus_setscaleimagetoframe__doc__)},
{const_cast<char*>("setStyle"), scribus_setstyle, METH_VARARGS, tr(scribus_setstyle__doc__)},
{const_cast<char*>("setTextAlignment"), scribus_setalign, METH_VARARGS, tr(scribus_setalign__doc__)},
{const_cast<char*>("setTextColor"), scribus_settextfill, METH_VARARGS, tr(scribus_settextfill__doc__)},