r17639 by jainbasil - Fix attribute issues in ImageAPI
scribus-commit
scribus-commit at lists.scribus.net
Tue Jun 26 12:16:06 UTC 2012
Author: jainbasil
Date: Tue Jun 26 12:16:05 2012
New Revision: 17639
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17639
Log:
Fix attribute issues in ImageAPI
Modified:
trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
trunk/Scribus/scribus/plugins/scripter/api_textitem.h
Modified: trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17639&path=/trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp Tue Jun 26 12:16:05 2012
@@ -20,51 +20,71 @@
}
-double ImageAPI::imageXScale()
+double ImageAPI::xScale()
{
return item->imageXScale();
}
-void ImageAPI::setImageXScale(double value)
+void ImageAPI::setXScale(double value)
{
item->setImageXScale(value);
}
-double ImageAPI::imageYScale()
+double ImageAPI::yScale()
{
return item->imageYScale();
}
-void ImageAPI::setImageYScale(double value)
+void ImageAPI::setYScale(double value)
{
item->setImageYScale(value);
}
-double ImageAPI::imageXOffset()
+double ImageAPI::xOffset()
{
return item->imageXOffset();
}
-void ImageAPI::setImageXOffset(double value)
+void ImageAPI::setXOffset(double value)
{
item->setImageXOffset(value);
}
-double ImageAPI::imageYOffset()
+double ImageAPI::yOffset()
{
return item->imageYOffset();
}
-void ImageAPI::setImageYOffset(double value)
+void ImageAPI::setYOffset(double value)
{
item->setImageYOffset(value);
}
-
-void ImageAPI::loadImage(QString filename)
+void ImageAPI::setGrayscale()
+{
+ if (!checkHaveDocument())
+ RAISE("No document open");
+ if (item == NULL)
+ return;
+ if (! item->asImageFrame())
+ {
+ RAISE("Specified item not an image frame.");
+ return;
+ }
+
+ ImageEffect ef;
+ ef.effectCode = ScImage::EF_GRAYSCALE;
+
+ item->effectsInUse.append(ef);
+ item->pixm.applyEffect(item->effectsInUse, ScCore->primaryMainWindow()->doc->PageColors, false);
+
+ ScCore->primaryMainWindow()->doc->updatePic();
+}
+
+void ImageAPI::load(QString filename)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -78,7 +98,7 @@
ScCore->primaryMainWindow()->doc->loadPict(filename, item);
}
-void ImageAPI::scaleImage(double x, double y)
+void ImageAPI::scale(double x, double y)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -106,7 +126,7 @@
*ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
}
-void ImageAPI::setImageOffset(double x, double y)
+void ImageAPI::offset(double x, double y)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -141,7 +161,7 @@
*ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
}
-void ImageAPI::setImageBrightness(double n)
+void ImageAPI::setBrightness(double n)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -164,28 +184,7 @@
ScCore->primaryMainWindow()->doc->updatePic();
}
-void ImageAPI::setImageGrayscale()
-{
- if (!checkHaveDocument())
- RAISE("No document open");
- if (item == NULL)
- return;
- if (! item->asImageFrame())
- {
- RAISE("Specified item not an image frame.");
- return;
- }
-
- ImageEffect ef;
- ef.effectCode = ScImage::EF_GRAYSCALE;
-
- item->effectsInUse.append(ef);
- item->pixm.applyEffect(item->effectsInUse, ScCore->primaryMainWindow()->doc->PageColors, false);
-
- ScCore->primaryMainWindow()->doc->updatePic();
-}
-
-void ImageAPI::setScaleImageToFrame(bool scaletoframe, bool Proportional)
+void ImageAPI::scaleToFrame(bool scaletoframe, bool Proportional)
{
bool scaleToFrame = false;
bool proportional = true;
Modified: trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17639&path=/trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_imageitem.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_imageitem.h Tue Jun 26 12:16:05 2012
@@ -18,38 +18,39 @@
class ImageAPI : public ItemAPI
{
Q_OBJECT
- Q_PROPERTY(double imageXScale READ imageXScale WRITE setImageXScale)
- Q_PROPERTY(double imageYScale READ imageYScale WRITE setImageYScale)
- Q_PROPERTY(double imageXOffset READ imageXOffset WRITE setImageXOffset)
- Q_PROPERTY(double imageYOffset READ imageYOffset WRITE setImageYOffset)
+ Q_PROPERTY(double xScale READ xScale WRITE setXScale)
+ Q_PROPERTY(double yScale READ yScale WRITE setYScale)
+ Q_PROPERTY(double xOffset READ xOffset WRITE setXOffset)
+ Q_PROPERTY(double yOffset READ yOffset WRITE setYOffset)
+
public:
ImageAPI(PageItem_ImageFrame* im);
virtual ~ImageAPI();
public slots:
- void loadImage(QString filename);
- void scaleImage(double x, double y);
- void setImageOffset(double x, double y);
- void setImageBrightness(double n);
- void setImageGrayscale();
- void setScaleImageToFrame(bool scaletoframe, bool Proportional);
+ void load(QString filename);
+ void scale(double x, double y);
+ void offset(double x, double y);
+ void setBrightness(double n);
+ void setGrayscale();
+ void scaleToFrame(bool scaletoframe, bool Proportional);
private:
PageItem_ImageFrame* item;
- double imageXScale();
- void setImageXScale(double value);
+ double xScale();
+ void setXScale(double value);
- double imageYScale();
- void setImageYScale(double value);
+ double yScale();
+ void setYScale(double value);
- double imageXOffset();
- void setImageXOffset(double value);
+ double xOffset();
+ void setXOffset(double value);
- double imageYOffset();
- void setImageYOffset(double value);
+ double yOffset();
+ void setYOffset(double value);
};
#endif /*API_IMAGEITEM_H_*/
Modified: trunk/Scribus/scribus/plugins/scripter/api_textitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17639&path=/trunk/Scribus/scribus/plugins/scripter/api_textitem.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_textitem.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_textitem.h Tue Jun 26 12:16:05 2012
@@ -49,6 +49,7 @@
void selectText(int start, int selcount);
void linkToTextFrame(QString name2);
void unLinkTextFrames();
+
private:
QString font();
void setFont(QString name);
More information about the scribus-commit
mailing list