/branches/Version13x/Scribus/scribus/pageitem.h |
---|
39,7 → 39,16 |
{ |
Q_OBJECT |
// Properties - see http://doc.trolltech.com/3.3/properties.html |
// See the getters and setters of these properties for details on their use. |
Q_PROPERTY(QString itemName READ itemName WRITE setItemName DESIGNABLE false) |
Q_PROPERTY(QString fillColor READ fillColor WRITE setFillColor DESIGNABLE false) |
Q_PROPERTY(int fillShade READ fillShade WRITE setFillShade DESIGNABLE false) |
Q_PROPERTY(double fillTransparency READ fillTransparency WRITE setFillTransparency DESIGNABLE false) |
Q_PROPERTY(QString lineColor READ lineColor WRITE setLineColor DESIGNABLE false) |
Q_PROPERTY(int lineShade READ lineShade WRITE setLineShade DESIGNABLE false) |
Q_PROPERTY(double lineTransparency READ lineTransparency WRITE setLineTransparency DESIGNABLE false) |
Q_PROPERTY(bool locked READ locked WRITE setLocked DESIGNABLE false) |
Q_PROPERTY(bool sizeLocked READ sizeLocked WRITE setSizeLocked DESIGNABLE false) |
public: |
PageItem(ScribusDoc *pa, int art, double x, double y, double w, double h, double w2, QString fill, QString outline); |
~PageItem() {}; |
321,48 → 330,74 |
* See also PageItem::itemName() |
*/ |
void setItemName(const QString& newName); |
/** @brief Get the (name of the) fill color of the object */ |
QString fillColor() const; |
/** |
* @brief Set the fill color of the object. |
* @param newColor fill color for the object |
*/ |
void setFillColor(const QString &newColor); |
/** @brief Get the shade of the fill color */ |
int fillShade() const; |
/** |
* @brief Set the fill color shade. |
* @param newShade shade for the fill color |
*/ |
void setFillShade(int newShade); |
/** @brief Get the transparency of the fill color */ |
double fillTransparency() const; |
/** |
* @brief Set the transparency of the fill color. |
* @param newTransparency transparency of the fill color |
*/ |
void setFillTransparency(double newTransparency); |
/** @brief Get the line color of the object */ |
QString lineColor() const; |
/** |
* @brief Set the line color of the object. |
* @param newFill line color for the object |
*/ |
void setLineColor(const QString &newColor); |
/** @brief Get the line color shade */ |
int lineShade() const; |
/** |
* @brief Set the line color shade. |
* @param newColor shade for the line color |
*/ |
void setLineShade(int newShade); |
/** @brief Get the line transparency */ |
double lineTransparency() const; |
/** |
* @brief Set the transparency of the line color. |
* @param newTransparency transparency of the line color |
*/ |
void setLineTransparency(double newTransparency); |
/** @brief Flip an image horizontally. */ |
void flipImageH(); |
/** @brief Flip an image vertically */ |
void flipImageV(); |
/** @brief Lock or unlock this pageitem. */ |
void toggleLock(); |
/** @brief is the item locked ? */ |
bool locked() const; |
/** @brief Lock or unlock this pageitem */ |
void setLocked(bool isLocked); |
/** @brief Toggle lock for resizing */ |
void toggleSizeLock(); |
/** @brief Toggle lock for resizing */ |
/** @brief Is the item's size locked? */ |
bool sizeLocked() const; |
/** @brief set lock for resizing */ |
void setSizeLocked(bool isLocked); |
/** |
* @brief Check the changes to the item and add undo actions for them. |
* @param force Force the check. Do not care if mouse button or arrow key is down |
/branches/Version13x/Scribus/scribus/pageitem.cpp |
---|
2271,6 → 2271,11 |
setUName(newName); // set the name for the UndoObject too |
} |
QString PageItem::fillColor() const |
{ |
return Pcolor; |
} |
void PageItem::setFillColor(const QString &newColor) |
{ |
if (UndoManager::undoEnabled()) |
2286,6 → 2291,11 |
Pcolor = newColor; |
} |
int PageItem::fillShade() const |
{ |
return Shade; |
} |
void PageItem::setFillShade(int newShade) |
{ |
if (UndoManager::undoEnabled()) |
2301,6 → 2311,11 |
Shade = newShade; |
} |
double PageItem::fillTransparency() const |
{ |
return Transparency; |
} |
void PageItem::setFillTransparency(double newTransparency) |
{ |
if (UndoManager::undoEnabled()) |
2316,6 → 2331,11 |
Transparency = newTransparency; |
} |
QString PageItem::lineColor() const |
{ |
return Pcolor2; |
} |
void PageItem::setLineColor(const QString &newColor) |
{ |
if (UndoManager::undoEnabled()) |
2331,6 → 2351,11 |
Pcolor2 = newColor; |
} |
int PageItem::lineShade() const |
{ |
return Shade2; |
} |
void PageItem::setLineShade(int newShade) |
{ |
if (UndoManager::undoEnabled()) |
2346,6 → 2371,12 |
Shade2 = newShade; |
} |
double PageItem::lineTransparency() const |
{ |
return TranspStroke; |
} |
void PageItem::setLineTransparency(double newTransparency) |
{ |
if (UndoManager::undoEnabled()) |
2398,6 → 2429,11 |
Locked = !Locked; |
} |
bool PageItem::locked() const |
{ |
return Locked; |
} |
void PageItem::setLocked(bool isLocked) |
{ |
if (isLocked != Locked) |
2419,6 → 2455,11 |
LockRes = !LockRes; |
} |
bool PageItem::sizeLocked() const |
{ |
return LockRes; |
} |
void PageItem::setSizeLocked(bool isLocked) |
{ |
if (isLocked == LockRes) |
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp |
---|
298,3 → 298,36 |
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; |
} |
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdmani.h |
---|
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 |
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp |
---|
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__)}, |