? 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.7.2.16
diff -u -r1.7.2.16 cmdmani.cpp
--- cmdmani.cpp	1 Feb 2005 10:41:40 -0000	1.7.2.16
+++ cmdmani.cpp	1 Feb 2005 17:34:54 -0000
@@ -297,4 +318,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
+	Carrier->view->AdjustPictScale(item);
+	Carrier->view->AdjustPreview(item, false);
+	Carrier->view->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.3.2.6
diff -u -r1.3.2.6 cmdmani.h
--- cmdmani.h	20 Dec 2004 13:10:00 -0000	1.3.2.6
+++ cmdmani.h	1 Feb 2005 17:34:54 -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.33.2.33
diff -u -r1.33.2.33 scriptplugin.cpp
--- scriptplugin.cpp	31 Jan 2005 19:26:34 -0000	1.33.2.33
+++ scriptplugin.cpp	1 Feb 2005 17:34:54 -0000
@@ -762,6 +762,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__)},
