Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2434 → Rev 2435

/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
1,6 → 1,6
 
#include "cmddoc.h"
#include "cmdutil.h"
#include "units.h"
#include "documentinformation.h"
 
PyObject *scribus_newdoc(PyObject */*self*/, PyObject* args)
12,8 → 12,8
(!PyArg_ParseTuple(p, "dd", &b, &h)) ||
(!PyArg_ParseTuple(m, "dddd", &lr, &rr, &tpr, &btr)))
return NULL;
b = ValToPts(b, unit);
h = ValToPts(h, unit);
b = value2pts(b, unit);
h = value2pts(h, unit);
if (ori == 1)
{
ebr = b;
20,10 → 20,10
b = h;
h = ebr;
}
tpr = ValToPts(tpr, unit);
lr = ValToPts(lr, unit);
rr = ValToPts(rr, unit);
btr = ValToPts(btr, unit);
tpr = value2pts(tpr, unit);
lr = value2pts(lr, unit);
rr = value2pts(rr, unit);
btr = value2pts(btr, unit);
bool ret = Carrier->doFileNew(b, h, tpr, lr, rr, btr, 0, 1, false, ds, unit, fsl, ori, fNr, "Custom");
// qApp->processEvents();
return PyInt_FromLong(static_cast<long>(ret));
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdutil.h
5,7 → 5,6
#include "cmdvar.h"
 
double PointToValue(double Val);
double ValToPts(double Val, int ein);
double ValueToPoint(double Val);
 
/// Convert an X co-ordinate part in page units to a document co-ordinate
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
451,10 → 451,11
// Done with exception setup
 
// CONSTANTS
PyDict_SetItemString(d, const_cast<char*>("UNIT_POINTS"), Py_BuildValue(const_cast<char*>("i"), 0));
PyDict_SetItemString(d, const_cast<char*>("UNIT_MILLIMETERS"), Py_BuildValue(const_cast<char*>("i"), 1));
PyDict_SetItemString(d, const_cast<char*>("UNIT_INCHES"), Py_BuildValue(const_cast<char*>("i"), 2));
PyDict_SetItemString(d, const_cast<char*>("UNIT_PICAS"), Py_BuildValue(const_cast<char*>("i"), 3));
PyDict_SetItemString(d, const_cast<char*>("UNIT_POINTS"), PyInt_FromLong(unitIndexFromString("pt")));
PyDict_SetItemString(d, const_cast<char*>("UNIT_MILLIMETERS"), PyInt_FromLong(unitIndexFromString("mm")));
PyDict_SetItemString(d, const_cast<char*>("UNIT_INCHES"), PyInt_FromLong(unitIndexFromString("in")));
PyDict_SetItemString(d, const_cast<char*>("UNIT_PICAS"), PyInt_FromLong(unitIndexFromString("p")));
PyDict_SetItemString(d, const_cast<char*>("UNIT_CENTIMETRES"), PyInt_FromLong(unitIndexFromString("cm")));
PyDict_SetItemString(d, const_cast<char*>("PORTRAIT"), Py_BuildValue(const_cast<char*>("i"), 0));
PyDict_SetItemString(d, const_cast<char*>("LANDSCAPE"), Py_BuildValue(const_cast<char*>("i"), 1));
PyDict_SetItemString(d, const_cast<char*>("NOFACINGPAGES"), Py_BuildValue(const_cast<char*>("i"), 0));