29
30
currItem->SetFarbe(&tmp, c2, shade2);
30
31
currItem->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0, c2, shade2);
31
32
currItem->GrType = typ;
32
//ScMW->view->updateGradientVectors(currItem);
33
switch (currItem->GrType)
37
currItem->GrStartX = 0;
38
currItem->GrStartY = currItem->height() / 2.0;
39
currItem->GrEndX = currItem->width();
40
currItem->GrEndY = currItem->height() / 2.0;
43
currItem->GrStartX = currItem->width() / 2.0;
44
currItem->GrStartY = 0;
45
currItem->GrEndX = currItem->width() / 2.0;
46
currItem->GrEndY = currItem->height();
49
currItem->GrStartX = 0;
50
currItem->GrStartY = 0;
51
currItem->GrEndX = currItem->width();
52
currItem->GrEndY = currItem->height();
55
currItem->GrStartX = 0;
56
currItem->GrStartY = currItem->height();
57
currItem->GrEndX = currItem->width();
61
currItem->GrStartX = currItem->width() / 2.0;
62
currItem->GrStartY = currItem->height() / 2.0;
63
if (currItem->width() >= currItem->height())
65
currItem->GrEndX = currItem->width();
66
currItem->GrEndY = currItem->height() / 2.0;
70
currItem->GrEndX = currItem->width() / 2.0;
71
currItem->GrEndY = currItem->height();
77
//ScCore->primaryMainWindow()->view->updateGradientVectors(currItem);
33
78
currItem->updateGradientVectors();
34
ScMW->view->RefreshItem(currItem);
79
ScCore->primaryMainWindow()->view->RefreshItem(currItem);
80
// Py_INCREF(Py_None);
39
85
PyObject *scribus_setfillcolor(PyObject* /* self */, PyObject* args)
50
96
i->setFillColor(QString::fromUtf8(Color));
97
// Py_INCREF(Py_None);
102
PyObject *scribus_setfilltrans(PyObject* /* self */, PyObject* args)
104
char *Name = const_cast<char*>("");
106
if (!PyArg_ParseTuple(args, "d|es", &w, "utf-8", &Name))
108
if(!checkHaveDocument())
110
if ((w < 0.0) || (w > 1.0))
112
PyErr_SetString(PyExc_ValueError, QObject::tr("Transparency out of bounds, must be 0 <= transparency <= 1.","python error"));
115
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
118
i->setFillTransparency(1.0 - w);
119
// Py_INCREF(Py_None);
124
PyObject *scribus_setfillblend(PyObject* /* self */, PyObject* args)
126
char *Name = const_cast<char*>("");
128
if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
130
if(!checkHaveDocument())
132
if ((w < 0) || (w > 15))
134
PyErr_SetString(PyExc_ValueError, QObject::tr("Blendmode out of bounds, must be 0 <= blendmode <= 15.","python error"));
137
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
140
i->setFillBlendmode(w);
141
// Py_INCREF(Py_None);
55
146
PyObject *scribus_setlinecolor(PyObject* /* self */, PyObject* args)
66
157
it->setLineColor(QString::fromUtf8(Color));
158
// Py_INCREF(Py_None);
163
PyObject *scribus_setlinetrans(PyObject* /* self */, PyObject* args)
165
char *Name = const_cast<char*>("");
167
if (!PyArg_ParseTuple(args, "d|es", &w, "utf-8", &Name))
169
if(!checkHaveDocument())
171
if ((w < 0.0) || (w > 1.0))
173
PyErr_SetString(PyExc_ValueError, QObject::tr("Transparency out of bounds, must be 0 <= transparency <= 1.","python error"));
176
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
179
i->setLineTransparency(1.0 - w);
180
// Py_INCREF(Py_None);
185
PyObject *scribus_setlineblend(PyObject* /* self */, PyObject* args)
187
char *Name = const_cast<char*>("");
189
if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
191
if(!checkHaveDocument())
193
if ((w < 0) || (w > 15))
195
PyErr_SetString(PyExc_ValueError, QObject::tr("Blendmode out of bounds, must be 0 <= blendmode <= 15.","python error"));
198
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
201
i->setLineBlendmode(w);
202
// Py_INCREF(Py_None);
71
207
PyObject *scribus_setlinewidth(PyObject* /* self */, PyObject* args)
198
340
// apply rounding
199
341
currItem->setCornerRadius(w);
200
342
currItem->SetFrameRound();
201
ScMW->doc->setRedrawBounding(currItem);
202
ScMW->view->SetFrameRounded();
343
ScCore->primaryMainWindow()->doc->setRedrawBounding(currItem);
344
ScCore->primaryMainWindow()->view->SetFrameRounded();
345
// Py_INCREF(Py_None);
207
350
PyObject *scribus_setmultiline(PyObject* /* self */, PyObject* args)
215
358
PageItem *currItem = GetUniqueItem(QString::fromUtf8(Name));
216
359
if (currItem == NULL)
218
if (!ScMW->doc->MLineStyles.contains(QString::fromUtf8(Style)))
361
if (!ScCore->primaryMainWindow()->doc->MLineStyles.contains(QString::fromUtf8(Style)))
220
363
PyErr_SetString(NotFoundError, QObject::tr("Line style not found.","python error"));
223
366
currItem->NamedLStyle = QString::fromUtf8(Style);
367
// Py_INCREF(Py_None);
372
/*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
373
with header files structure untouched (docstrings are kept near declarations)
375
void cmdsetpropdocwarnings()
378
s << scribus_setgradfill__doc__ << scribus_setfillcolor__doc__ << scribus_setfilltrans__doc__ << scribus_setfillblend__doc__ << scribus_setlinecolor__doc__ << scribus_setlinetrans__doc__ << scribus_setlineblend__doc__ << scribus_setlinewidth__doc__ << scribus_setlineshade__doc__ << scribus_setlinejoin__doc__ << scribus_setlineend__doc__ << scribus_setlinestyle__doc__ << scribus_setfillshade__doc__ << scribus_setcornerrad__doc__ << scribus_setmultiline__doc__;