Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 86 → Rev 87

/trunk/Scribus/admin/acinclude.m4.in
1060,7 → 1060,7
kde_qtsubver=1
else
kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
# following is the check if subversion isnĀ“t found in passed argument
# following is the check if subversion isnt found in passed argument
if test "$kde_qtsubver" = "$1"; then
kde_qtsubver=1
fi
3982,10 → 3982,11
 
AC_DEFUN(KDE_CHECK_PYTHON,
[
KDE_CHECK_PYTHON_INTERN("2.2",
[KDE_CHECK_PYTHON_INTERN("2.1",
[KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
])])
KDE_CHECK_PYTHON_INTERN("2.3",
[KDE_CHECK_PYTHON_INTERN("2.2",
[KDE_CHECK_PYTHON_INTERN("2.1",
[KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
])])])
])
 
AC_DEFUN(KDE_CHECK_STL_SGI,
/trunk/Scribus/ChangeLogCVS
1,4 → 1,7
Changes since Version 1.1.1
26.10.2003 Added patch for acinclude.m4 to recognize Python 2.3
Fixed issue with certain Hebrew fonts.
 
25.10.2003 Scribus can now handle Filenames with Spaces correctly.
Included Patch for BigEndian Systems.
 
/trunk/Scribus/scribus/mpalette.cpp
424,7 → 424,7
layout41 = new QGridLayout( 0, 1, 1, 0, 5, "layout41");
 
Fonts = new FontCombo(page_3, Prefs);
Fonts->setMaximumSize(200, 30);
Fonts->setMaximumSize(190, 30);
layout41->addMultiCellWidget( Fonts, 0, 0, 0, 1 );
 
Text20 = new QLabel( page_3, "Text20" );
2615,7 → 2615,10
NameEdit->setFocus();
}
else
{
CurItem->AnName = NameEdit->text();
CurItem->AutoName = false;
}
}
 
void Mpalette::fillLangCombo(QMap<QString,QString> Sprachen)
/trunk/Scribus/scribus/util.cpp
1220,6 → 1220,8
glyphIndex = FT_Get_Char_Index(face, chr);
FT_Load_Glyph( face, glyphIndex, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP );
FT_Outline_Decompose(&face->glyph->outline, &OutlineMethods, reinterpret_cast<void*>(&pts));
*x = face->glyph->metrics.horiBearingX / 64.0;
*y = face->glyph->metrics.horiBearingY / 64.0;
QWMatrix ma;
ma.scale(1, -1);
pts.map(ma);
1226,7 → 1228,5
pts.translate(0, chs);
pts2.resize(0);
pts2.putPoints(0, pts.size()-2, pts, 0);
*x = face->glyph->metrics.horiBearingX / 64.0;
*y = face->glyph->metrics.horiBearingY / 64.0;
return pts2;
}
/trunk/Scribus/scribus/pageitem.cpp
148,6 → 148,7
An_C_act = "";
An_Extern = "";
AnName = "Item"+tmp.setNum(Doc->TotalItems);
AutoName = true;
Doc->TotalItems++;
AnToolTip = "";
AnRollOver = "";
878,7 → 879,7
}
if (!Doc->RePos)
{
if (e.intersects(pf.xForm(QRect(qRound(Zli2->xco),qRound(Zli2->yco-LineSp), qRound(Zli2->wide), qRound(LineSp)))))
if (e.intersects(pf.xForm(QRect(qRound(Zli2->xco),qRound(Zli2->yco-LineSp), qRound(Zli2->wide+1), qRound(LineSp)))))
DrawZeichenS(p, Zli2);
}
}
965,7 → 966,7
}
if (!Doc->RePos)
{
if (e.intersects(pf.xForm(QRect(qRound(Zli2->xco),qRound(Zli2->yco-LineSp), qRound(Zli2->wide), qRound(LineSp)))))
if (e.intersects(pf.xForm(QRect(qRound(Zli2->xco),qRound(Zli2->yco-LineSp), qRound(Zli2->wide+1), qRound(LineSp)))))
DrawZeichenS(p, Zli2);
}
}
1386,7 → 1387,7
QWMatrix chma;
chma.scale(csi, csi);
FPointArray gly = (*Doc->AllFonts)[hl->ZFo]->GlyphArray[chr].Outlines.copy();
if (gly.size() > 4)
if (gly.size() > 3)
{
gly.map(chma);
chma = QWMatrix();
1404,8 → 1405,8
else
chma.translate(hl->xco, hl->yco-hl->Siz);
gly.map(chma);
p->setFillMode(1);
p->setupPolygon(&gly);
p->setFillMode(1);
if (hl->Farb != "None")
p->fillPath();
if ((hl->Style & 4) && (hl->Farb2 != "None"))
/trunk/Scribus/scribus/cpalette.cpp
73,7 → 73,7
 
GradLayout = new QVBoxLayout( 0, 0, 6, "GradLayout");
QFont fo = QFont(font());
fo.setPointSize(10);
fo.setPointSize(fo.pointSize()-1);
GradCombo = new QComboBox( true, this, "GradCombo" );
GradCombo->setEditable(false);
GradCombo->setFont(fo);
/trunk/Scribus/scribus/libabout/about.cpp
32,7 → 32,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = "25. October 2003 ";
QString bu = "26. October 2003 ";
#ifdef HAVE_CMS
bu += "C";
#else
151,11 → 151,5
connect( PushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) );
}
 
/*
* Destroys the object and frees any allocated resources
*/
About::~About()
{
// no need to delete child widgets, Qt does it all for us
}
 
 
/trunk/Scribus/scribus/fontcombo.cpp
45,6 → 45,9
FontCombo::FontCombo(QWidget* pa, preV *Prefs) : QComboBox(true, pa)
{
setEditable(false);
QFont f(font());
f.setPointSize(f.pointSize()-1);
setFont(f);
QStringList rlist;
rlist.clear();
SCFontsIterator it(Prefs->AvailFonts);
/trunk/Scribus/scribus/scribus.cpp
243,6 → 243,20
Prefs.SCpalv = false;
Prefs.Lpalv = false;
Prefs.Bopalv = false;
Prefs.Mpalx = 0;
Prefs.Mpaly = 0;
Prefs.Tpalx = 0;
Prefs.Tpaly = 0;
Prefs.SCpalx = 0;
Prefs.SCpaly = 0;
Prefs.SCpalw = 100;
Prefs.SCpalh = 200;
Prefs.Sepalx = 0;
Prefs.Sepaly = 0;
Prefs.Bopalx = 0;
Prefs.Bopaly = 0;
Prefs.Lpalx = 0;
Prefs.Lpaly = 0;
Prefs.PSize = 40;
Prefs.SaveAtQ = true;
Prefs.ShFrames = true;
/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
5,13 → 5,12
PyObject *scribus_newrect(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i;
char *Name = "";
if (!PyArg_ParseTuple(args, "dddd|s", &x, &y, &b, &h, &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = doc->ActPage->PaintRect(ValueToPoint(x), ValueToPoint(y),
int i = doc->ActPage->PaintRect(ValueToPoint(x), ValueToPoint(y),
ValueToPoint(b), ValueToPoint(h),
doc->Dwidth, doc->Dbrush, doc->Dpen);
doc->ActPage->SetRectFrame(doc->ActPage->Items.at(i));
23,13 → 22,12
PyObject *scribus_newellipse(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i;
char *Name = "";
if (!PyArg_ParseTuple(args, "dddd|s", &x, &y, &b, &h, &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = doc->ActPage->PaintEllipse(ValueToPoint(x), ValueToPoint(y),
int i = doc->ActPage->PaintEllipse(ValueToPoint(x), ValueToPoint(y),
ValueToPoint(b), ValueToPoint(h),
doc->Dwidth, doc->Dbrush, doc->Dpen);
doc->ActPage->SetOvalFrame(doc->ActPage->Items.at(i));
41,13 → 39,12
PyObject *scribus_newimage(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i;
char *Name = "";
if (!PyArg_ParseTuple(args, "dddd|s", &x, &y, &b, &h, &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = doc->ActPage->PaintPict(ValueToPoint(x), ValueToPoint(y), ValueToPoint(b), ValueToPoint(h));
int i = doc->ActPage->PaintPict(ValueToPoint(x), ValueToPoint(y), ValueToPoint(b), ValueToPoint(h));
doc->ActPage->SetRectFrame(doc->ActPage->Items.at(i));
if (Name != "")
doc->ActPage->Items.at(i)->AnName = QString(Name);
57,13 → 54,12
PyObject *scribus_newtext(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i;
char *Name = "";
if (!PyArg_ParseTuple(args, "dddd|s", &x, &y, &b, &h, &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = doc->ActPage->PaintText(ValueToPoint(x), ValueToPoint(y),
int i = doc->ActPage->PaintText(ValueToPoint(x), ValueToPoint(y),
ValueToPoint(b), ValueToPoint(h),
doc->Dwidth, doc->DpenText);
doc->ActPage->SetRectFrame(doc->ActPage->Items.at(i));
75,7 → 71,6
PyObject *scribus_newline(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i;
char *Name = "";
if (!PyArg_ParseTuple(args, "dddd|s", &x, &y, &b, &h, &Name))
return NULL;
85,7 → 80,7
y = ValueToPoint(y);
b = ValueToPoint(b);
h = ValueToPoint(h);
i = doc->ActPage->PaintPolyLine(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
int i = doc->ActPage->PaintPolyLine(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
PageItem *it = doc->ActPage->Items.at(i);
it->PoLine.resize(4);
it->PoLine.setPoint(0, 0, 0);
112,28 → 107,27
 
PyObject *scribus_polyline(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i = 0;
int ic, pp, len;
char *Name = "";
PyObject *il;
if ((!PyArg_ParseTuple(args, "O|s", &il, &Name)) || (!PyList_Check(il)))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
len = PyList_Size(il);
return PyString_FromString("");
int len = PyList_Size(il);
if ((len < 4) || ((len % 2) != 0))
return PyString_FromString("");
double x, y, b, h;
int i = 0;
x = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
y = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
ic = doc->ActPage->PaintPolyLine(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
int ic = doc->ActPage->PaintPolyLine(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
PageItem *it = doc->ActPage->Items.at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, 0, 0);
pp = 6;
int pp = 6;
for (i = 2; i < len - 2; i += 2)
{
b = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
171,9 → 165,6
 
PyObject *scribus_polygon(PyObject *self, PyObject* args)
{
double x, y, b, h;
int i = 0;
int ic, pp, len;
char *Name = "";
PyObject *il;
if ((!PyArg_ParseTuple(args, "O|s", &il, &Name)) || (!PyList_Check(il)))
180,19 → 171,21
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
len = PyList_Size(il);
int len = PyList_Size(il);
if ((len < 6) || ((len % 2) != 0))
return PyString_FromString("");
double x, y, b, h;
int i = 0;
x = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
y = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
ic = doc->ActPage->PaintPoly(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
int ic = doc->ActPage->PaintPoly(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
PageItem *it = doc->ActPage->Items.at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, 0, 0);
pp = 6;
int pp = 6;
for (i = 2; i < len - 2; i += 2)
{
b = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
235,9 → 228,6
 
PyObject *scribus_bezierline(PyObject *self, PyObject* args)
{
double x, y, b, h, kx, ky, kx2, ky2;
int i = 0;
int ic, pp, len;
char *Name = "";
PyObject *il;
if ((!PyArg_ParseTuple(args, "O|s", &il, &Name)) || (!PyList_Check(il)))
244,9 → 234,11
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
len = PyList_Size(il);
int len = PyList_Size(il);
if ((len < 8) || ((len % 6) != 0))
return PyString_FromString("");
double x, y, b, h, kx, ky, kx2, ky2;
int i = 0;
x = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
y = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
259,12 → 251,12
i++;
ky2 = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
ic = doc->ActPage->PaintPolyLine(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
int ic = doc->ActPage->PaintPolyLine(x, y, 1, 1, doc->Dwidth, doc->Dbrush, doc->Dpen);
PageItem *it = doc->ActPage->Items.at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, kx-x, ky-y);
pp = 6;
int pp = 6;
for (i = 6; i < len - 6; i += 6)
{
b = ValueToPoint(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
308,7 → 300,6
 
PyObject *scribus_pathtext(PyObject *self, PyObject* args)
{
int i, ii;
double x, y;
char *Name = "";
char *TextB = "";
317,8 → 308,8
return NULL;
if ((!Carrier->HaveDoc) || ((TextB == "") || (PolyB == "")))
return PyString_FromString("");
i = GetItem(QString(TextB));
ii = GetItem(QString(PolyB));
int i = GetItem(QString(TextB));
int ii = GetItem(QString(PolyB));
if ((i == -1) || (ii == -1))
return PyString_FromString("");
doc->ActPage->SelItem.clear();
335,7 → 326,6
PyObject *scribus_deleteobj(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
Py_INCREF(Py_None);
344,7 → 334,7
if (Name != "")
{
doc->ActPage->SelItem.clear();
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->SelItem.append(doc->ActPage->Items.at(i));
}
/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
11,10 → 11,7
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = GetItem(QString(Name));
if (i != -1)
return PyString_FromString(doc->ActPage->Items.at(i)->Pcolor);
else
return PyString_FromString("");
return i != -1 ? PyString_FromString(doc->ActPage->Items.at(i)->Pcolor) : PyString_FromString("");
}
 
PyObject *scribus_getlinecolor(PyObject *self, PyObject* args)
32,7 → 29,7
it = doc->ActPage->Items.at(i);
if ((it->HasSel) && ((it->PType == 4) || (it->PType == 8)))
{
for (uint b = 0; b < it->Ptext.count(); b++)
for (uint b = 0; b < it->Ptext.count(); ++b)
{
if (it->Ptext.at(b)->cselect)
return PyString_FromString(it->Ptext.at(b)->ccolor);
53,10 → 50,8
if (!Carrier->HaveDoc)
return PyFloat_FromDouble(0.0);
i = GetItem(QString(Name));
if (i != -1)
return PyFloat_FromDouble(static_cast<double>(doc->ActPage->Items.at(i)->Pwidth));
else
return PyFloat_FromDouble(0.0);
return i != -1 ? PyFloat_FromDouble(static_cast<double>(doc->ActPage->Items.at(i)->Pwidth)) :
PyFloat_FromDouble(0.0);
}
 
PyObject *scribus_getlineshade(PyObject *self, PyObject* args)
74,7 → 69,7
it = doc->ActPage->Items.at(i);
if ((it->HasSel) && ((it->PType == 4) || (it->PType == 8)))
{
for (uint b = 0; b < it->Ptext.count(); b++)
for (uint b = 0; b < it->Ptext.count(); ++b)
{
if (it->Ptext.at(b)->cselect)
return PyInt_FromLong(static_cast<long>(it->Ptext.at(b)->cshade));
95,10 → 90,8
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
if (i != -1)
return PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->PLineJoin));
else
return PyInt_FromLong(0L);
return i != 1 ? PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->PLineJoin)) :
PyInt_FromLong(0L);
}
 
PyObject *scribus_getlineend(PyObject *self, PyObject* args)
110,10 → 103,8
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
if (i != -1)
return PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->PLineEnd));
else
return PyInt_FromLong(0L);
return i != -1 ? PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->PLineEnd)) :
PyInt_FromLong(0L);
}
 
PyObject *scribus_getlinestyle(PyObject *self, PyObject* args)
125,10 → 116,8
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
if (i != -1)
return PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->PLineArt));
else
return PyInt_FromLong(0L);
return i != -1 ? PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->PLineArt)) :
PyInt_FromLong(0L);
}
 
PyObject *scribus_getfillshade(PyObject *self, PyObject* args)
140,10 → 129,8
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
if (i != -1)
return PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->Shade));
else
return PyInt_FromLong(0L);
return i != -1 ? PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->Shade)) :
PyInt_FromLong(0L);
}
 
PyObject *scribus_getcornerrad(PyObject *self, PyObject* args)
155,10 → 142,8
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
if (i != -1)
return PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->RadRect));
else
return PyInt_FromLong(0L);
return i != -1 ? PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->RadRect)) :
PyInt_FromLong(0L);
}
 
PyObject *scribus_getimgscale(PyObject *self, PyObject* args)
188,10 → 173,7
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = GetItem(QString(Name));
if (i != -1)
return PyString_FromString(doc->ActPage->Items.at(i)->Pfile);
else
return PyString_FromString("");
return i != -1 ? PyString_FromString(doc->ActPage->Items.at(i)->Pfile) : PyString_FromString("");
}
 
PyObject *scribus_getposi(PyObject *self, PyObject* args)
239,10 → 221,8
if (!Carrier->HaveDoc)
return PyFloat_FromDouble(0.0);
i = GetItem(QString(Name));
if (i != -1)
return PyFloat_FromDouble(static_cast<double>(doc->ActPage->Items.at(i)->Rot * -1));
else
return PyFloat_FromDouble(0.0);
return i != -1 ? PyFloat_FromDouble(static_cast<double>(doc->ActPage->Items.at(i)->Rot * -1)) :
PyFloat_FromDouble(0.0);
}
 
PyObject *scribus_getallobj(PyObject *self, PyObject* args)
/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
5,13 → 5,12
PyObject *scribus_getfontsize(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
32,13 → 31,12
PyObject *scribus_getfont(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
59,44 → 57,39
PyObject *scribus_gettextsize(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
i = GetItem(QString(Name));
if (i != -1)
return PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->Ptext.count()));
else
return PyInt_FromLong(0L);
int i = GetItem(QString(Name));
return i != -1 ?
PyInt_FromLong(static_cast<long>(doc->ActPage->Items.at(i)->Ptext.count())) :
PyInt_FromLong(0L);
}
 
PyObject *scribus_getlinespace(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyFloat_FromDouble(0.0);
i = GetItem(QString(Name));
if (i != -1)
return PyFloat_FromDouble(static_cast<double>(doc->ActPage->Items.at(i)->LineSp));
else
return PyFloat_FromDouble(0.0);
int i = GetItem(QString(Name));
return i != -1 ?
PyFloat_FromDouble(static_cast<double>(doc->ActPage->Items.at(i)->LineSp)) :
PyFloat_FromDouble(0.0);
}
 
PyObject *scribus_gettext(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
QString text = "";
PageItem *it;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
if (!Carrier->HaveDoc)
return PyString_FromString("");
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
QString text = "";
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
121,9 → 114,6
char *Name = "";
char *Text;
int i;
PageItem *it;
PageItem *nb;
struct Pti *hg;
if (!PyArg_ParseTuple(args, "s|s", &Text, &Name))
return NULL;
Py_INCREF(Py_None);
130,6 → 120,7
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
PageItem *it;
QString Daten = QString(Text);
if (i != -1)
{
136,7 → 127,7
it = doc->ActPage->Items.at(i);
if (it->NextBox != 0)
{
nb = it->NextBox;
PageItem *nb = it->NextBox;
while (nb != 0)
{
nb->Ptext.clear();
146,12 → 137,14
}
}
it->Ptext.clear();
for (uint a = 0; a < Daten.length(); a++)
for (uint a = 0; a < Daten.length(); ++a)
{
hg = new Pti;
struct Pti *hg = new Pti;
hg->ch = Daten.at(a);
if (hg->ch == QChar(10)) { hg->ch = QChar(13); }
if (hg->ch == QChar(9)) { hg->ch = " "; }
if (hg->ch == QChar(10))
hg->ch = QChar(13);
if (hg->ch == QChar(9))
hg->ch = " ";
hg->cfont = it->IFont;
hg->csize = it->ISize;
hg->ccolor = it->TxtFill;
178,15 → 171,14
{
char *Name = "";
char *Text;
int i, pos;
PageItem *it;
struct Pti *hg;
int pos;
if (!PyArg_ParseTuple(args, "si|s", &Text, &pos, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
QString Daten = QString(Text);
if (i != -1)
{
193,12 → 185,14
it = doc->ActPage->Items.at(i);
if ((pos < 0) && (pos > static_cast<int>(it->Ptext.count())))
return Py_None;
for (uint a = 0; a < Daten.length(); a++)
for (uint a = 0; a < Daten.length(); ++a)
{
hg = new Pti;
struct Pti *hg = new Pti;
hg->ch = Daten.at(Daten.length()-1-a);
if (hg->ch == QChar(10)) { hg->ch = QChar(13); }
if (hg->ch == QChar(9)) { hg->ch = " "; }
if (hg->ch == QChar(10))
hg->ch = QChar(13);
if (hg->ch == QChar(9))
hg->ch = " ";
hg->cfont = it->IFont;
hg->csize = it->ISize;
hg->ccolor = it->TxtFill;
227,18 → 221,18
PyObject *scribus_setalign(PyObject *self, PyObject* args)
{
char *Name = "";
int i, size, Apm;
int size;
if (!PyArg_ParseTuple(args, "i|s", &size, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if ((size > 3) || (size < 0))
return Py_None;
if ((i != -1) && (doc->ActPage->Items.at(i)->PType == 4))
{
Apm = doc->AppMode;
int Apm = doc->AppMode;
doc->ActPage->SelItem.clear();
doc->ActPage->SelItem.append(doc->ActPage->Items.at(i));
if (doc->ActPage->Items.at(i)->HasSel)
253,18 → 247,18
PyObject *scribus_setfontsize(PyObject *self, PyObject* args)
{
char *Name = "";
int i, size, Apm;
int size;
if (!PyArg_ParseTuple(args, "i|s", &size, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if ((size > 512) || (size < 1))
return Py_None;
if ((i != -1) && (doc->ActPage->Items.at(i)->PType == 4))
{
Apm = doc->AppMode;
int Apm = doc->AppMode;
doc->ActPage->SelItem.clear();
doc->ActPage->SelItem.append(doc->ActPage->Items.at(i));
if (doc->ActPage->Items.at(i)->HasSel)
280,18 → 274,17
{
char *Name = "";
char *Font = "";
int i, Apm;
if (!PyArg_ParseTuple(args, "s|s", &Font, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if ((i != -1) && (doc->ActPage->Items.at(i)->PType == 4))
{
if (Carrier->Prefs.AvailFonts.find(QString(Font)))
{
Apm = doc->AppMode;
int Apm = doc->AppMode;
doc->ActPage->SelItem.clear();
doc->ActPage->SelItem.append(doc->ActPage->Items.at(i));
if (doc->ActPage->Items.at(i)->HasSel)
308,13 → 301,12
{
char *Name = "";
double w;
int i;
if (!PyArg_ParseTuple(args, "d|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (w < 0.1))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->LineSp = w;
return Py_None;
323,32 → 315,28
PyObject *scribus_selecttext(PyObject *self, PyObject* args)
{
char *Name = "";
int i, start, ende;
PageItem *it;
int start, ende;
if (!PyArg_ParseTuple(args, "ii|s", &start, &ende, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
if ((start < 0) || ((start + ende) > static_cast<int>(it->Ptext.count()-1)))
return Py_None;
for (uint a = 0; a < it->Ptext.count(); a++)
{
for (uint a = 0; a < it->Ptext.count(); ++a)
it->Ptext.at(a)->cselect = false;
}
if (ende == 0)
{
it->HasSel = false;
return Py_None;
}
for (int aa = start; aa < (start + ende); aa++)
{
for (int aa = start; aa < (start + ende); ++aa)
it->Ptext.at(aa)->cselect = true;
}
it->HasSel = true;
return Py_None;
}
359,14 → 347,13
PyObject *scribus_deletetext(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
385,14 → 372,13
{
char *Name = "";
char *Color;
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
418,14 → 404,13
{
char *Name = "";
char *Color;
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
450,20 → 435,20
PyObject *scribus_settextshade(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
PageItem *it;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || ((w < 0) || (w > 100)))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
if ((it->PType == 4) || (it->PType == 8))
{
for (uint b = 0; b < it->Ptext.count(); b++)
for (uint b = 0; b < it->Ptext.count(); ++b)
{
if (it->HasSel)
{
/trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
6,13 → 6,12
{
char *Name = "";
char *Image;
int i;
if (!PyArg_ParseTuple(args, "s|s", &Image, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->LoadPict(QString(Image), i);
return Py_None;
22,13 → 21,12
{
char *Name = "";
double x, y;
int i;
if (!PyArg_ParseTuple(args, "dd|s", &x, &y, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if ((i != -1) && (doc->ActPage->Items.at(i)->PType == 2))
{
PageItem *b = doc->ActPage->Items.at(i);
42,13 → 40,12
{
char *Name = "";
double x, y;
int i;
if (!PyArg_ParseTuple(args, "dd|s", &x, &y, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
if (doc->ActPage->GroupSel)
62,18 → 59,18
PyObject *scribus_moveobjabs(PyObject *self, PyObject* args)
{
char *Name = "";
double x, y, x2, y2, w, h;
int i;
double x, y;
if (!PyArg_ParseTuple(args, "dd|s", &x, &y, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
if (doc->ActPage->GroupSel)
{
double x2, y2, w, h;
doc->ActPage->getGroupRect(&x2, &y2, &w, &h);
doc->ActPage->moveGroup(ValueToPoint(x) - x2, ValueToPoint(y) - y2);
}
90,13 → 87,12
{
char *Name = "";
double x;
int i;
if (!PyArg_ParseTuple(args, "d|s", &x, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->RotateItem(doc->ActPage->Items.at(i)->Rot - x, i);
return Py_None;
106,13 → 102,12
{
char *Name = "";
double x;
int i;
if (!PyArg_ParseTuple(args, "d|s", &x, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->RotateItem(x * -1.0, i);
return Py_None;
122,13 → 117,12
{
char *Name = "";
double x, y;
int i;
if (!PyArg_ParseTuple(args, "dd|s", &x, &y, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
PageItem *b = doc->ActPage->Items.at(i);
139,8 → 133,6
 
PyObject *scribus_groupobj(PyObject *self, PyObject* args)
{
int i = 0;
int ic, len;
char *Name = "";
PyObject *il = 0;
if (!PyArg_ParseTuple(args, "|O", &il))
152,13 → 144,13
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
len = PyList_Size(il);
int len = PyList_Size(il);
if (len == 0)
return Py_None;
for (i = 0; i < len; i++)
for (int i = 0; i < len; i++)
{
Name = PyString_AsString(PyList_GetItem(il, i));
ic = GetItem(QString(Name));
int ic = GetItem(QString(Name));
if (ic != -1)
doc->ActPage->SelectItemNr(ic);
}
179,14 → 171,13
 
PyObject *scribus_ungroupobj(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
char *Name = "";;
if (!PyArg_ParseTuple(args, "|s", &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
Carrier->UnGroupObj();
return Py_None;
196,7 → 187,6
{
char *Name = "";
double sc;
int i, h;
if (!PyArg_ParseTuple(args, "d|s", &sc, &Name))
return NULL;
Py_INCREF(Py_None);
205,12 → 195,12
else
if (sc == 0.0)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
doc->ActPage->Deselect();
doc->ActPage->SelectItemNr(i);
h = doc->ActPage->HowTo;
int h = doc->ActPage->HowTo;
doc->ActPage->HowTo = 1;
doc->ActPage->scaleGroup(sc, sc);
doc->ActPage->HowTo = h;
243,7 → 233,6
PyObject *scribus_selectobj(PyObject *self, PyObject* args)
{
char *Name = "";
int i;
if (!PyArg_ParseTuple(args, "s", &Name))
return NULL;
Py_INCREF(Py_None);
251,7 → 240,7
return Py_None;
if (Name == "")
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->SelectItemNr(i);
return Py_None;
/trunk/Scribus/scribus/plugins/scriptplugin/conswin.cpp
79,18 → 79,3
setCursorPosition(p, i);
return;
}
 
void ConsWin::contentsMouseReleaseEvent(QMouseEvent *)
{
return;
}
 
void ConsWin::contentsMouseMoveEvent(QMouseEvent *)
{
return;
}
 
void ConsWin::contentsMouseDoubleClickEvent(QMouseEvent *)
{
return;
}
/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
7,15 → 7,15
char *Name = "";
char *Color1;
char *Color2;
int i, typ, shade1, shade2;
int typ, shade1, shade2;
if (!PyArg_ParseTuple(args, "isisi|s", &typ, &Color1, &shade1, &Color2, &shade2, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
{
doc->ActPage->Items.at(i)->GrColor2 = QString(Color1);
doc->ActPage->Items.at(i)->GrShade2 = shade1;
doc->ActPage->Items.at(i)->GrColor = QString(Color2);
31,13 → 31,12
{
char *Name = "";
char *Color;
int i;
if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->Pcolor = QString(Color);
return Py_None;
47,14 → 46,13
{
char *Name = "";
char *Color;
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
67,13 → 65,12
{
char *Name = "";
double w;
int i;
if (!PyArg_ParseTuple(args, "d|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || ((w < 0.0) || (w > 12.0)))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->Pwidth = w;
return Py_None;
82,14 → 79,14
PyObject *scribus_setlineshade(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
PageItem *it;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || ((w < 0) || (w > 100)))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
PageItem *it;
if (i != -1)
{
it = doc->ActPage->Items.at(i);
101,13 → 98,13
PyObject *scribus_setfillshade(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || ((w < 0) || (w > 100)))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->Shade = w;
return Py_None;
116,13 → 113,13
PyObject *scribus_setlinejoin(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->PLineJoin = Qt::PenJoinStyle(w);
return Py_None;
131,13 → 128,13
PyObject *scribus_setlineend(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->PLineEnd = Qt::PenCapStyle(w);
return Py_None;
146,13 → 143,13
PyObject *scribus_setlinestyle(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
doc->ActPage->Items.at(i)->PLineArt = Qt::PenStyle(w);
return Py_None;
161,13 → 158,13
PyObject *scribus_setcornerrad(PyObject *self, PyObject* args)
{
char *Name = "";
int i, w;
int w;
if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (w < 0))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
PageItem *b = doc->ActPage->Items.at(i);
187,14 → 184,12
{
char *Name = "";
char *Color;
int i;
PageItem *it;
if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
PageItem *b = doc->ActPage->Items.at(i);
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.h
43,8 → 43,8
Q_OBJECT
 
public:
MenuTest(QWidget* parent);
~MenuTest();
MenuTest(QWidget* parent) {};
~MenuTest() {};
void ReadPlugPrefs();
void SavePlugPrefs();
PConsole *pcon;
/trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
7,12 → 7,10
double b, h, lr, tpr, btr, rr, ebr;
int unit, ds, fsl, fNr, ori;
PyObject *p, *m;
if (!PyArg_ParseTuple(args, "OOiiiii", &p, &m, &ori, &fNr, &unit, &ds, &fsl))
if ((!PyArg_ParseTuple(args, "OOiiiii", &p, &m, &ori, &fNr, &unit, &ds, &fsl)) ||
(!PyArg_ParseTuple(p, "dd", &b, &h)) ||
(!PyArg_ParseTuple(m, "dddd", &lr, &rr, &tpr, &btr)))
return NULL;
if (!PyArg_ParseTuple(p, "dd", &b, &h))
return NULL;
if (!PyArg_ParseTuple(m, "dddd", &lr, &rr, &tpr, &btr))
return NULL;
b = ValToPts(b, unit);
h = ValToPts(h, unit);
if (ori == 1)
/trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
33,10 → 33,7
int cc = 0;
if (!PyArg_ParseTuple(args, ""))
return NULL;
if (Carrier->HaveDoc)
edc = Carrier->doc->PageColors;
else
edc = Carrier->Prefs.DColors;
edc = Carrier->HaveDoc ? Carrier->doc->PageColors : Carrier->Prefs.DColors;
CListe::Iterator it;
l = PyList_New(edc.count());
for (it = edc.begin(); it != edc.end(); ++it)
56,10 → 53,7
return NULL;
if (Name == "")
return Py_BuildValue("(iiii)", 0, 0, 0, 0);
if (Carrier->HaveDoc)
edc = Carrier->doc->PageColors;
else
edc = Carrier->Prefs.DColors;
edc = Carrier->HaveDoc ? Carrier->doc->PageColors : Carrier->Prefs.DColors;
QString col = QString(Name);
if (!edc.contains(col))
return Py_BuildValue("(iiii)", 0, 0, 0, 0);
/trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
16,12 → 16,11
 
PyObject *scribus_fontnames(PyObject *self, PyObject* args)
{
PyObject *l;
int cc = 0;
if (!PyArg_ParseTuple(args, ""))
return NULL;
l = PyList_New(Carrier->Prefs.AvailFonts.count());
PyObject *l = PyList_New(Carrier->Prefs.AvailFonts.count());
SCFontsIterator it(Carrier->Prefs.AvailFonts);
int cc = 0;
for ( ; it.current() ; ++it)
{
PyList_SetItem(l, cc, PyString_FromString(it.currentKey()));
32,9 → 31,9
 
PyObject *scribus_getlayers(PyObject *self, PyObject* args)
{
PyObject *l;
if (!PyArg_ParseTuple(args, ""))
return NULL;
PyObject *l;
if (Carrier->HaveDoc)
{
l = PyList_New(doc->Layers.count());
51,13 → 50,13
PyObject *scribus_setactlayer(PyObject *self, PyObject* args)
{
char *Name = "";
int i = -1;
if (!PyArg_ParseTuple(args, "s", &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (Name == ""))
return Py_None;
for (uint lam=0; lam < doc->Layers.count(); lam++)
int i = -1;
for (uint lam=0; lam < doc->Layers.count(); ++lam)
{
if (doc->Layers[lam].Name == QString(Name))
{
83,19 → 82,18
{
char *Name = "";
char *Layer = "";
int i, la;
if (!PyArg_ParseTuple(args, "s|s", &Layer, &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (Layer == ""))
return Py_None;
i = GetItem(QString(Name));
int i = GetItem(QString(Name));
if (i != -1)
{
la = -1;
int la = -1;
PageItem *b = doc->ActPage->Items.at(i);
doc->ActPage->SelectItemNr(i);
for (uint lam=0; lam < doc->Layers.count(); lam++)
for (uint lam=0; lam < doc->Layers.count(); ++lam)
{
if (doc->Layers[lam].Name == QString(Layer))
{
116,7 → 114,7
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (Name == ""))
return Py_None;
for (uint lam=0; lam < doc->Layers.count(); lam++)
for (uint lam=0; lam < doc->Layers.count(); ++lam)
{
if (doc->Layers[lam].Name == QString(Name))
{
136,7 → 134,7
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (Name == ""))
return Py_None;
for (uint lam=0; lam < doc->Layers.count(); lam++)
for (uint lam=0; lam < doc->Layers.count(); ++lam)
{
if (doc->Layers[lam].Name == QString(Name))
{
150,11 → 148,11
PyObject *scribus_glayervisib(PyObject *self, PyObject* args)
{
char *Name = "";
int i = 0;
if (!PyArg_ParseTuple(args, "s", &Name))
return NULL;
if ((!Carrier->HaveDoc) || (Name == ""))
return PyInt_FromLong(0L);
int i = 0;
for (uint lam=0; lam < doc->Layers.count(); lam++)
{
if (doc->Layers[lam].Name == QString(Name))
169,12 → 167,12
PyObject *scribus_glayerprint(PyObject *self, PyObject* args)
{
char *Name = "";
int i = 0;
if (!PyArg_ParseTuple(args, "s", &Name))
return NULL;
if ((!Carrier->HaveDoc) || (Name == ""))
return PyInt_FromLong(0L);
for (uint lam=0; lam < doc->Layers.count(); lam++)
int i = 0;
for (uint lam=0; lam < doc->Layers.count(); ++lam)
{
if (doc->Layers[lam].Name == QString(Name))
{
188,20 → 186,18
PyObject *scribus_removelayer(PyObject *self, PyObject* args)
{
char *Name = "";
int num, num2;
if (!PyArg_ParseTuple(args, "s", &Name))
return NULL;
Py_INCREF(Py_None);
if ((!Carrier->HaveDoc) || (Name == "") || (doc->Layers.count() == 1))
return Py_None;
for (uint lam=0; lam < doc->Layers.count(); lam++)
for (uint lam=0; lam < doc->Layers.count(); ++lam)
{
if (doc->Layers[lam].Name == QString(Name))
{
QValueList<Layer>::iterator it2;
it2 = doc->Layers.at(lam);
num2 = (*it2).LNr;
num = (*it2).Level;
QValueList<Layer>::iterator it2 = doc->Layers.at(lam);
int num2 = (*it2).LNr;
int num = (*it2).Level;
doc->Layers.remove(it2);
QValueList<Layer>::iterator it;
for (uint l = 0; l < doc->Layers.count(); l++)
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
63,7 → 63,7
if (Tes->SavedRecentScripts.count() != 0)
{
uint max = QMIN(Carrier->Prefs.RecentDCount, Tes->SavedRecentScripts.count());
for (uint m = 0; m < max; m++)
for (uint m = 0; m < max; ++m)
{
QFileInfo fd(Tes->SavedRecentScripts[m]);
if (fd.exists())
98,7 → 98,7
mess += "\n" + QObject::tr("scripting Language for Scribus.");
mess += "\n\n" + QObject::tr("Programming:");
mess += "\n\t" + QObject::tr("Franz Schmid <Franz.Schmid@altmuehlnet.de>");
mess += "\n\t" + QObject::tr("Paul F. Johnson <paulf.johnson@ukonline.co.uk>");
mess += "\n\t" + QObject::tr("Paul F. Johnson <paul@all-the-johnsons.co.uk>");
mess += "\n\n" + QObject::tr("Documentation:");
mess += "\n\t" + QObject::tr("Peter Linnell <netscribe@attbi.com>");
mess += "\n\t" + QObject::tr("Franz Schmid <Franz.Schmid@altmuehlnet.de>");
105,14 → 105,6
QMessageBox::about(d, QObject::tr("About Scripter"), mess);
}
 
MenuTest::MenuTest(QWidget* parent) : QObject( parent, "bu")
{
}
 
MenuTest::~MenuTest()
{
}
 
void MenuTest::slotHelp()
{
QString pfad = PREL;
282,7 → 274,7
QString st="<SCRIPTRC></SCRIPTRC>";
docu.setContent(st);
QDomElement elem=docu.documentElement();
for (uint rd=0; rd < Tes->RecentScripts.count(); rd++)
for (uint rd=0; rd < Tes->RecentScripts.count(); ++rd)
{
QDomElement rde=docu.createElement("RECENT");
rde.setAttribute("NAME",Tes->RecentScripts[rd]);
/trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp
18,8 → 18,7
char *defName;
int pre = 0;
int mode = 0;
if (!PyArg_ParseTuple(args, "sss|ii", &caption, &filter, &defName, &pre, &mode))
return NULL;
return PyString_FromString(Carrier->CFileDialog(caption, filter, defName, static_cast<bool>(pre), static_cast<bool>(mode), 0, 0));
return !PyArg_ParseTuple(args, "sss|ii", &caption, &filter, &defName, &pre, &mode) ? NULL :
PyString_FromString(Carrier->CFileDialog(caption, filter, defName, static_cast<bool>(pre), static_cast<bool>(mode), 0, 0));
}
 
/trunk/Scribus/scribus/plugins/scriptplugin/conswin.h
32,9 → 32,9
~ConsWin() {} ;
void keyPressEvent(QKeyEvent *k);
void contentsMousePressEvent(QMouseEvent *m);
void contentsMouseReleaseEvent(QMouseEvent *);
void contentsMouseMoveEvent(QMouseEvent *);
void contentsMouseDoubleClickEvent(QMouseEvent *);
void contentsMouseReleaseEvent(QMouseEvent *) {return;}
void contentsMouseMoveEvent(QMouseEvent *) {return;}
void contentsMouseDoubleClickEvent(QMouseEvent *) {return;}
QString LastComm;
QString Prompt;
};
/trunk/Scribus/scribus/plugins/libchar/charselect.cpp
172,6 → 172,20
if (gly.size() > 4)
{
gly.map(chma);
FPoint np;
double mx = 99999.9;
double my = 99999.9;
for (uint c = 0; c < gly.size(); ++c)
{
np = gly.point(c);
if (np.x() > 900000)
continue;
if (np.x() < mx)
mx = np.x();
if (np.y() < my)
my = np.y();
}
gly.translate(-mx, 0);
p->setBrush(black);
p->setFillMode(1);
p->setupPolygon(&gly);
/trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
938,10 → 938,21
}
FirstM = false;
WasM = false;
i->addPoint(FPoint(static_cast<double>(CurrX), static_cast<double>(CurrY)));
i->addPoint(FPoint(static_cast<double>(CurrX), static_cast<double>(CurrY)));
i->addPoint(FPoint(static_cast<double>(x1), static_cast<double>(y1)));
i->addPoint(FPoint(static_cast<double>(x1), static_cast<double>(y1)));
if (i->size() > 3)
{
FPoint b1 = i->point(i->size()-4);
FPoint b2 = i->point(i->size()-3);
FPoint b3 = i->point(i->size()-2);
FPoint b4 = i->point(i->size()-1);
FPoint n1 = FPoint(CurrX, CurrY);
FPoint n2 = FPoint(x1, y1);
if ((b1 == n1) && (b2 == n1) && (b3 == n2) && (b4 == n2))
return;
}
i->addPoint(FPoint(CurrX, CurrY));
i->addPoint(FPoint(CurrX, CurrY));
i->addPoint(FPoint(x1, y1));
i->addPoint(FPoint(x1, y1));
CurrX = x1;
CurrY = y1;
PathLen += 4;
956,10 → 967,23
}
FirstM = false;
WasM = false;
i->addPoint(FPoint(static_cast<double>(CurrX), static_cast<double>(CurrY)));
i->addPoint(FPoint(static_cast<double>(x1), static_cast<double>(y1)));
i->addPoint(FPoint(static_cast<double>(x3), static_cast<double>(y3)));
i->addPoint(FPoint(static_cast<double>(x2), static_cast<double>(y2)));
if (PathLen > 3)
{
FPoint b1 = i->point(i->size()-4);
FPoint b2 = i->point(i->size()-3);
FPoint b3 = i->point(i->size()-2);
FPoint b4 = i->point(i->size()-1);
FPoint n1 = FPoint(CurrX, CurrY);
FPoint n2 = FPoint(x1, y1);
FPoint n3 = FPoint(x3, y3);
FPoint n4 = FPoint(x2, y2);
if ((b1 == n1) && (b2 == n2) && (b3 == n3) && (b4 == n4))
return;
}
i->addPoint(FPoint(CurrX, CurrY));
i->addPoint(FPoint(x1, y1));
i->addPoint(FPoint(x3, y3));
i->addPoint(FPoint(x2, y2));
CurrX = x3;
CurrY = y3;
PathLen += 4;
967,12 → 991,12
 
void SVGPlug::svgClosePath(FPointArray *i)
{
if ((PathLen == 4) || (i->point(i->size()-2).x() != static_cast<double>(StartX)) || (i->point(i->size()-2).y() != static_cast<double>(StartY)))
if ((PathLen == 4) || (i->point(i->size()-2).x() != StartX) || (i->point(i->size()-2).y() != StartY))
{
i->addPoint(i->point(i->size()-2));
i->addPoint(i->point(i->size()-3));
i->addPoint(FPoint(static_cast<double>(StartX), static_cast<double>(StartY)));
i->addPoint(FPoint(static_cast<double>(StartX), static_cast<double>(StartY)));
i->addPoint(FPoint(StartX, StartY));
i->addPoint(FPoint(StartX, StartY));
}
}
 
/trunk/Scribus/scribus/page.cpp
6150,8 → 6150,11
b->An_Extern = Buffer->An_Extern;
b->AnZiel = Buffer->AnZiel;
b->AnActType = Buffer->AnActType;
if ((Buffer->AnName != "") && (!drag) && (b->isAnnotation))
if ((Buffer->AnName != "") && (!drag))
{
b->AnName = Buffer->AnName;
b->AutoName = false;
}
b->AnToolTip = Buffer->AnToolTip;
b->AnBwid = Buffer->AnBwid;
b->AnBsty = Buffer->AnBsty;
6172,7 → 6175,6
b->AnScaleW = Buffer->AnScaleW;
b->AnBColor = Buffer->AnBColor;
b->Clip = Buffer->Clip.copy();
b->PoLine = Buffer->PoLine.copy();
b->PoShow = Buffer->PoShow;
b->BaseOffs = Buffer->BaseOffs;
b->Textflow = Buffer->Textflow;
6191,6 → 6193,7
b->Language = Buffer->Language;
if (Buffer->LayerNr != -1)
b->LayerNr = Buffer->LayerNr;
b->PoLine = Buffer->PoLine.copy();
if (b->PType != 5)
{
if ((b->PoLine.size() == 0) && (b->PType != 1))
/trunk/Scribus/scribus/tree.cpp
44,17 → 44,23
 
void Tree::slotSelect(QListViewItem* ite)
{
if (ite->text(0).startsWith(tr("Page")))
{
QStringList Sel = QStringList::split(" ", ite->text(0));
emit SelectSeite(Sel[1].toInt()-1);
}
if (ite->text(0).startsWith(tr("Item")))
{
QStringList Sel = QStringList::split(" ", ite->text(0));
QStringList Sep = QStringList::split(" ", ite->parent()->text(0));
emit SelectElement(Sep[1].toInt()-1, Sel[1].toInt()-1);
}
int sref, oref;
if (Seiten.containsRef(ite))
{
sref = Seiten.findRef(ite);
if (sref != -1)
emit SelectSeite(sref);
}
if (Elemente.containsRef(ite))
{
oref = Elemente.findRef(ite);
if (oref != -1)
{
sref = Seiten.findRef(ite->parent());
if (sref != -1)
emit SelectElement(sref, oref);
}
}
}
 
void Tree::closeEvent(QCloseEvent *ce)
88,24 → 94,16
for (b = 0; b < view->Pages.at(a)->Items.count(); b++)
{
Elemente.append(new QListViewItem(Seiten.current(), "Items"));
Elemente.current()->setText(0, tr("Item")+" "+cc.setNum(b+1));
Elemente.current()->setText(0, view->Pages.at(a)->Items.at(b)->AnName);
xp = tr("X:")+" "+cc.setNum(view->Pages.at(a)->Items.at(b)->Xpos);
yp = tr("Y:")+" "+cc.setNum(view->Pages.at(a)->Items.at(b)->Ypos);
fon = tr("Font:")+" "+view->Pages.at(a)->Items.at(b)->IFont;
switch (view->Pages.at(a)->Items.at(b)->PType)
{
case 1:
Elemente.current()->setText(1, tr("Ellipse"));
Elemente.current()->setText(2, xp+" "+yp);
break;
case 2:
Elemente.current()->setText(1, tr("Image"));
Elemente.current()->setText(2, xp+" "+yp+" "+view->Pages.at(a)->Items.at(b)->Pfile);
break;
case 3:
Elemente.current()->setText(1, tr("Rectangle"));
Elemente.current()->setText(2, xp+" "+yp);
break;
case 4:
Elemente.current()->setText(1, tr("Text"));
Elemente.current()->setText(2, xp+" "+yp+" "+fon);
114,6 → 112,18
Elemente.current()->setText(1, tr("Line"));
Elemente.current()->setText(2, xp+" "+yp);
break;
case 6:
Elemente.current()->setText(1, tr("Polygon"));
Elemente.current()->setText(2, xp+" "+yp);
break;
case 7:
Elemente.current()->setText(1, tr("Polyline"));
Elemente.current()->setText(2, xp+" "+yp);
break;
case 8:
Elemente.current()->setText(1, tr("PathText"));
Elemente.current()->setText(2, xp+" "+yp);
break;
}
}
}
/trunk/Scribus/scribus/scribusXml.cpp
1802,7 → 1802,10
}
else
ob.setAttribute("ANNOTATION",0);
ob.setAttribute("ANNAME", item->AnName);
if (!item->AutoName)
ob.setAttribute("ANNAME", item->AnName);
else
ob.setAttribute("ANNAME", "");
if(item->Textflow)
ob.setAttribute("TEXTFLOW",1);
else
2179,7 → 2182,10
}
else
ob.setAttribute("ANNOTATION",0);
ob.setAttribute("ANNAME", item->AnName);
if (!item->AutoName)
ob.setAttribute("ANNAME", item->AnName);
else
ob.setAttribute("ANNAME", "");
if(item->Textflow)
ob.setAttribute("TEXTFLOW",1);
else