? samples/Makefile
? samples/Makefile.in
? scripts/Makefile
? scripts/Makefile.in
Index: cmdmani.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp,v
retrieving revision 1.17
diff -u -r1.17 cmdmani.cpp
--- cmdmani.cpp	15 Jan 2005 18:39:13 -0000	1.17
+++ cmdmani.cpp	1 Feb 2005 17:40:11 -0000
@@ -300,4 +300,37 @@
 	if (item->Locked)
 		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;
+	if(!checkHaveDocument())
+		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->AdjustPictScale(item);
+	item->OwnPage->AdjustPreview(item, false);
+	item->OwnPage->RefreshItem(item);
+	Py_INCREF(Py_None);
+	return Py_None;
 }
Index: cmdmani.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdmani.h,v
retrieving revision 1.10
diff -u -r1.10 cmdmani.h
--- cmdmani.h	20 Dec 2004 13:10:38 -0000	1.10
+++ cmdmani.h	1 Feb 2005 17:40:11 -0000
@@ -182,4 +182,15 @@
 /*! Status of locking 2004/7/10 pv.*/
 PyObject *scribus_islocked(PyObject */*self*/, PyObject* args);
 
+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 */*self*/, PyObject* args, PyObject* kwargs);
+
 #endif
Index: scriptplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp,v
retrieving revision 1.58
diff -u -r1.58 scriptplugin.cpp
--- scriptplugin.cpp	31 Jan 2005 19:20:30 -0000	1.58
+++ scriptplugin.cpp	1 Feb 2005 17:40:11 -0000
@@ -701,6 +701,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__)},
