r17638 by jainbasil - fixed issues with allText method, changed classnames
scribus-commit
scribus-commit at lists.scribus.net
Tue Jun 26 10:12:14 UTC 2012
Author: jainbasil
Date: Tue Jun 26 10:12:14 2012
New Revision: 17638
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17638
Log:
fixed issues with allText method, changed classnames
Modified:
trunk/Scribus/Scribus.pro
trunk/Scribus/scribus/plugins/scripter/api_color.cpp
trunk/Scribus/scribus/plugins/scripter/api_color.h
trunk/Scribus/scribus/plugins/scripter/api_dialogs.cpp
trunk/Scribus/scribus/plugins/scripter/api_dialogs.h
trunk/Scribus/scribus/plugins/scripter/api_document.cpp
trunk/Scribus/scribus/plugins/scripter/api_document.h
trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
trunk/Scribus/scribus/plugins/scripter/api_item.cpp
trunk/Scribus/scribus/plugins/scripter/api_item.h
trunk/Scribus/scribus/plugins/scripter/api_layer.cpp
trunk/Scribus/scribus/plugins/scripter/api_layer.h
trunk/Scribus/scribus/plugins/scripter/api_page.cpp
trunk/Scribus/scribus/plugins/scripter/api_page.h
trunk/Scribus/scribus/plugins/scripter/api_printer.h
trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
trunk/Scribus/scribus/plugins/scripter/api_textitem.h
trunk/Scribus/scribus/plugins/scripter/api_window.cpp
trunk/Scribus/scribus/plugins/scripter/api_window.h
trunk/Scribus/scribus/plugins/scripter/scripterimpl.cpp
Modified: trunk/Scribus/Scribus.pro
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/Scribus.pro
==============================================================================
--- trunk/Scribus/Scribus.pro (original)
+++ trunk/Scribus/Scribus.pro Tue Jun 26 10:12:14 2012
@@ -1105,7 +1105,14 @@
scribus/styles/cellstyle.attrdefs.cxx \
scribus/main_nix.cpp \
scribus/main_win32.cpp \
- scribus/styles/linestyle.attrdefs.cxx
+ scribus/styles/linestyle.attrdefs.cxx \
+ scribus/plugins/scripter/utils.h \
+ scribus/plugins/scripter/new_api.py \
+ scribus/plugins/scripter/api_textitem.h \
+ scribus/plugins/scripter/api_printer.h \
+ scribus/plugins/scripter/api_layer.h \
+ scribus/plugins/scripter/api_imageitem.h \
+ scribus/plugins/scripter/api_imageexport.h
FORMS += scribus/ui/aboutplugins.ui \
scribus/ui/aligndistribute.ui \
scribus/ui/arcvectorbase.ui \
@@ -2127,7 +2134,13 @@
scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp \
scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp \
scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp \
- scribus/plugins/tools/2geomtools/pathalongpath/pathdialog.cpp
+ scribus/plugins/tools/2geomtools/pathalongpath/pathdialog.cpp \
+ scribus/plugins/scripter/utils.cpp \
+ scribus/plugins/scripter/api_textitem.cpp \
+ scribus/plugins/scripter/api_printer.cpp \
+ scribus/plugins/scripter/api_layer.cpp \
+ scribus/plugins/scripter/api_imageitem.cpp \
+ scribus/plugins/scripter/api_imageexport.cpp
RESOURCES += scribus/plugins/scripter/python/sceditor/dockwidget_icons.qrc
TRANSLATIONS += resources/translations/po/scribus.af.ts \
resources/translations/po/scribus.ar.ts \
@@ -2173,3 +2186,17 @@
resources/translations/po/scribus.uk.ts \
resources/translations/po/scribus.zh_CN.ts \
resources/translations/po/scribus.zh_TW.ts
+
+OTHER_FILES += \
+ scribus/plugins/scripter/README.txt \
+ scribus/plugins/scripter/dynapidocs.spy \
+ scribus/plugins/scripter/CMakeLists.txt \
+ scribus/plugins/scripter/apidocs.py \
+ scribus/plugins/scripter/api_Scripter.dialogs.scrapbook.api \
+ scribus/plugins/scripter/api_Scripter.dialogs.properties.api \
+ scribus/plugins/scripter/api_Scripter.dialogs.pages.api \
+ scribus/plugins/scripter/api_Scripter.dialogs.outline.api \
+ scribus/plugins/scripter/api_Scripter.dialogs.nodes.api \
+ scribus/plugins/scripter/api_Scripter.dialogs.mainWindow.api \
+ scribus/plugins/scripter/api_Scripter.dialogs.layers.api \
+ scribus/plugins/scripter/api_Scripter.activeDocument.activePage.items.api
Modified: trunk/Scribus/scribus/plugins/scripter/api_color.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_color.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_color.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_color.cpp Tue Jun 26 10:12:14 2012
@@ -15,35 +15,35 @@
#include "sccolor.h"
#include "utils.h"
-ScColorWrapper::ScColorWrapper(ScColor *l, QString n) : QObject(COLLECTOR)
+ColorAPI::ColorAPI(ScColor *l, QString n) : QObject(COLLECTOR)
{
- qDebug() << "ScColorWrapper loaded";
- setObjectName("scColorWrapper");
+ qDebug() << "ColorAPI loaded";
+ setObjectName("ColorAPI");
color = l;
colorName = n;
}
-QString ScColorWrapper::name()
+QString ColorAPI::name()
{
return colorName;
}
-void ScColorWrapper::setName(QString name)
+void ColorAPI::setName(QString name)
{
colorName = name;
}
-bool ScColorWrapper::isSpotColor()
+bool ColorAPI::isSpotColor()
{
return color->isSpotColor();
}
-void ScColorWrapper::setSpotColor(bool value)
+void ColorAPI::setSpotColor(bool value)
{
color->setSpotColor(value);
}
-void ScColorWrapper::replace(QString replace)
+void ColorAPI::replace(QString replace)
{
if(replace.isEmpty())
{
@@ -59,7 +59,7 @@
}
}
-void ScColorWrapper::remove(QString replace)
+void ColorAPI::remove(QString replace)
{
if (ScCore->primaryMainWindow()->HaveDoc)
{
@@ -89,7 +89,7 @@
}
}
-void ScColorWrapper::changeCMYK(int c, int m, int y, int k)
+void ColorAPI::changeCMYK(int c, int m, int y, int k)
{
if(ScCore->primaryMainWindow()->HaveDoc)
{
@@ -110,7 +110,7 @@
}
}
-void ScColorWrapper::changeRGB(int r, int g, int b)
+void ColorAPI::changeRGB(int r, int g, int b)
{
if(ScCore->primaryMainWindow()->HaveDoc)
{
@@ -131,7 +131,7 @@
}
}
-ScColorWrapper::~ScColorWrapper()
+ColorAPI::~ColorAPI()
{
qDebug() << "ScColorWrapper deleted";
-}
+}
Modified: trunk/Scribus/scribus/plugins/scripter/api_color.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_color.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_color.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_color.h Tue Jun 26 10:12:14 2012
@@ -17,16 +17,16 @@
#include "scripterimpl.h"
#include "sccolor.h"
-class ScColorWrapper : public QObject
+class ColorAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(bool spotColor READ isSpotColor WRITE setSpotColor);
- Q_PROPERTY(QString name READ name WRITE setName);
+ Q_PROPERTY(bool spotColor READ isSpotColor WRITE setSpotColor)
+ Q_PROPERTY(QString name READ name WRITE setName)
public:
- ScColorWrapper(ScColor *l, QString n);
- virtual ~ScColorWrapper();
+ ColorAPI(ScColor *l, QString n);
+ virtual ~ColorAPI();
public slots:
bool isSpotColor();
Modified: trunk/Scribus/scribus/plugins/scripter/api_dialogs.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_dialogs.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_dialogs.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_dialogs.cpp Tue Jun 26 10:12:14 2012
@@ -15,14 +15,10 @@
setObjectName("dialogs");
}
-
-
DialogsAPI::~DialogsAPI()
{
qDebug() << "DialogsAPI deleted";
}
-
-
/**
* Scripter.dialogs.alert(message)
Modified: trunk/Scribus/scribus/plugins/scripter/api_dialogs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_dialogs.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_dialogs.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_dialogs.h Tue Jun 26 10:12:14 2012
@@ -16,16 +16,16 @@
class DialogsAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(QWidget* mainWindow READ mainWindow);
- Q_PROPERTY(QWidget* properties READ properties);
- Q_PROPERTY(QWidget* nodes READ nodes);
- Q_PROPERTY(QWidget* outline READ outline);
- Q_PROPERTY(QWidget* scrapbook READ scrapbook);
- Q_PROPERTY(QWidget* layers READ layers);
- Q_PROPERTY(QWidget* documentChecker READ documentChecker);
- Q_PROPERTY(QWidget* pages READ pages);
- Q_PROPERTY(QWidget* bookmarks READ bookmarks);
- Q_PROPERTY(bool newDocument READ newDocument);
+ Q_PROPERTY(QWidget* mainWindow READ mainWindow)
+ Q_PROPERTY(QWidget* properties READ properties)
+ Q_PROPERTY(QWidget* nodes READ nodes)
+ Q_PROPERTY(QWidget* outline READ outline)
+ Q_PROPERTY(QWidget* scrapbook READ scrapbook)
+ Q_PROPERTY(QWidget* layers READ layers)
+ Q_PROPERTY(QWidget* documentChecker READ documentChecker)
+ Q_PROPERTY(QWidget* pages READ pages)
+ Q_PROPERTY(QWidget* bookmarks READ bookmarks)
+ Q_PROPERTY(bool newDocument READ newDocument)
public:
DialogsAPI();
virtual ~DialogsAPI();
Modified: trunk/Scribus/scribus/plugins/scripter/api_document.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_document.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_document.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_document.cpp Tue Jun 26 10:12:14 2012
@@ -159,7 +159,7 @@
*/
QObject *DocumentAPI::activePage()
{
- return new ScribusPage(this);
+ return new PageAPI(this);
}
@@ -177,17 +177,17 @@
PageItem* item = ScCore->primaryMainWindow()->doc->m_Selection->itemAt(0);
if(item->asTextFrame())
{
- ScribusTextItem *textItem = new ScribusTextItem(item->asTextFrame());
+ TextAPI *textItem = new TextAPI(item->asTextFrame());
return textItem;
}
else if(item->asImageFrame())
{
- ScribusImageItem *imageItem = new ScribusImageItem(item->asImageFrame());
+ ImageAPI *imageItem = new ImageAPI(item->asImageFrame());
return imageItem;
}
else
{
- ScribusItem *otherItem = new ScribusItem(item);
+ ItemAPI *otherItem = new ItemAPI(item);
return otherItem;
}
}
@@ -220,17 +220,17 @@
PageItem *item = sel->itemAt(i);
if (item->asTextFrame())
{
- ScribusTextItem *textItem = new ScribusTextItem(item->asTextFrame());
+ TextAPI *textItem = new TextAPI(item->asTextFrame());
l.append(qVariantFromValue((QObject *)(textItem)));
}
else if(item->asImageFrame())
{
- ScribusImageItem *imageItem = new ScribusImageItem(item->asImageFrame());
+ ImageAPI *imageItem = new ImageAPI(item->asImageFrame());
l.append(qVariantFromValue((QObject *)(imageItem)));
}
else
{
- ScribusItem *otherItem = new ScribusItem(item);
+ ItemAPI *otherItem = new ItemAPI(item);
l.append(qVariantFromValue(
(QObject *)(otherItem)
));
@@ -263,17 +263,17 @@
PageItem *item = ScCore->primaryMainWindow()->doc->Items->at(i);
if (item->asTextFrame())
{
- ScribusTextItem *textItem = new ScribusTextItem(item->asTextFrame());
+ TextAPI *textItem = new TextAPI(item->asTextFrame());
l.append(qVariantFromValue((QObject *)(textItem)));
}
else if(item->asImageFrame())
{
- ScribusImageItem *imageItem = new ScribusImageItem(item->asImageFrame());
+ ImageAPI *imageItem = new ImageAPI(item->asImageFrame());
l.append(qVariantFromValue((QObject *)(imageItem)));
}
else
{
- ScribusItem *otherItem = new ScribusItem(item);
+ ItemAPI *otherItem = new ItemAPI(item);
l.append(qVariantFromValue(
(QObject *)(otherItem)
));
@@ -302,7 +302,7 @@
for (int i = 0; i<ScCore->primaryMainWindow()->doc->Layers.count() ; ++i)
{
ScLayer *L = &(ScCore->primaryMainWindow()->doc->Layers[i]);
- ScribusLayer *layer = new ScribusLayer(L);
+ LayerAPI *layer = new LayerAPI(L);
l.append(qVariantFromValue((QObject *)(layer)));
}
return l;
@@ -310,7 +310,7 @@
QObject *DocumentAPI::newLayer(QString name)
{
- ScribusLayer *l = new ScribusLayer(ScCore->primaryMainWindow()->doc->Layers.newLayer(name));
+ LayerAPI *l = new LayerAPI(ScCore->primaryMainWindow()->doc->Layers.newLayer(name));
return (QObject *)(l);
}
@@ -352,7 +352,7 @@
if (ScCore->primaryMainWindow()->doc->Layers[i].Name == ScCore->primaryMainWindow()->doc->activeLayerName())
{
ScLayer *L = &(ScCore->primaryMainWindow()->doc->Layers[i]);
- return new ScribusLayer(L);
+ return new LayerAPI(L);
}
}
return NULL;
@@ -386,7 +386,7 @@
for (it = names.begin(); it != names.end(); ++it)
{
ScColor *value = &(names[it.key()]);
- ScColorWrapper *color = new ScColorWrapper(value, it.key());
+ ColorAPI *color = new ColorAPI(value, it.key());
l.append(qVariantFromValue((QObject *)(color)));
}
return l;
@@ -394,7 +394,7 @@
QObject *DocumentAPI::getColor(QString name)
{
- return new ScColorWrapper(&(ScCore->primaryMainWindow()->doc->PageColors[name]), name);
+ return new ColorAPI(&(ScCore->primaryMainWindow()->doc->PageColors[name]), name);
}
QObject *DocumentAPI::newColorCMYK(QString name, int c, int m, int y, int k)
Modified: trunk/Scribus/scribus/plugins/scripter/api_document.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_document.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_document.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_document.h Tue Jun 26 10:12:14 2012
@@ -18,21 +18,21 @@
class DocumentAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString name READ getName);
- Q_PROPERTY(bool available READ available);
- Q_PROPERTY(QObject* margins READ margins);
- Q_PROPERTY(bool modified READ modified WRITE setModified);
- Q_PROPERTY(QObject* activePage READ activePage);
- Q_PROPERTY(int pageCount READ pageCount);
- Q_PROPERTY(QObject* activeItem READ activeItem);
- Q_PROPERTY(QObject* dimensions READ dimensions);
- Q_PROPERTY(QList<QVariant> items READ items);
- Q_PROPERTY(QList<QVariant> selection READ selection);
- Q_PROPERTY(int selectionCount READ selectionCount);
- Q_PROPERTY(QList<QVariant> colors READ colors);
- Q_PROPERTY(QList<QVariant> layers READ layers);
- Q_PROPERTY(QList<QVariant> masterPages READ masterPages);
- Q_PROPERTY(QList<QVariant> styles READ styles);
+ Q_PROPERTY(QString name READ getName)
+ Q_PROPERTY(bool available READ available)
+ Q_PROPERTY(QObject* margins READ margins)
+ Q_PROPERTY(bool modified READ modified WRITE setModified)
+ Q_PROPERTY(QObject* activePage READ activePage)
+ Q_PROPERTY(int pageCount READ pageCount)
+ Q_PROPERTY(QObject* activeItem READ activeItem)
+ Q_PROPERTY(QObject* dimensions READ dimensions)
+ Q_PROPERTY(QList<QVariant> items READ items)
+ Q_PROPERTY(QList<QVariant> selection READ selection)
+ Q_PROPERTY(int selectionCount READ selectionCount)
+ Q_PROPERTY(QList<QVariant> colors READ colors)
+ Q_PROPERTY(QList<QVariant> layers READ layers)
+ Q_PROPERTY(QList<QVariant> masterPages READ masterPages)
+ Q_PROPERTY(QList<QVariant> styles READ styles)
public:
DocumentAPI();
@@ -47,50 +47,29 @@
QList<QVariant> layers(); //TODO move this to private section
void setInformation(QString author, QString title, QString desc);
- /**
- * Layer functions related to activeDocument
- */
QObject *newLayer(QString name);
void removeLayer(QString name);
QObject *getActiveLayer();
QString getActiveLayerName();
void setActiveLayer(QString name);
- /**
- * Color functions related to activeDocument
- */
QObject *newColorCMYK(QString name, int c, int m, int y, int k);
QObject *newColorRGB(QString name, int r, int g, int b);
QObject *getColor(QString name);
- /**
- * Export As Image
- */
QList<QVariant> supportedImageTypes();
bool exportAsImages(QString dirName, QString type, double scale, double quality, double dpi, bool overwrite);
- /**
- * Printer function
- */
QObject* Printer();
- /**
- * Master Pages
- */
QList<QVariant> masterPages();
void createMasterPage(QString name);
void deleteMasterPage(QString name);
void closeMasterPage(QString name);
void editMasterPage(QString name);
- /**
- * Styles
- */
void loadStylesFromFile(QString name);
- /**
- * Selection
- */
void moveSelectionToFront()
{
ScCore->primaryMainWindow()->doc->sendItemSelectionToBack();
@@ -101,14 +80,11 @@
ScCore->primaryMainWindow()->doc->sendItemSelectionToBack();
}
- /**
- * Methods on PageItems
- */
QObject* selectItem(QString name);
void deleteItem(QString name);
bool itemExists(QString name);
void deselectItems();
- //methods related to grouped items
+
QString groupItems(QList<QVariant> list);
void unGroupItems(QString name);
void scaleGroup(double factor, QString name);
@@ -133,17 +109,17 @@
class Margins : public QObject
{
Q_OBJECT
- Q_PROPERTY(double top READ top WRITE setTop);
- Q_PROPERTY(double left READ left WRITE setLeft);
- Q_PROPERTY(double right READ right WRITE setRight);
- Q_PROPERTY(double bottom READ bottom WRITE setBottom);
+ Q_PROPERTY(double top READ top WRITE setTop)
+ Q_PROPERTY(double left READ left WRITE setLeft)
+ Q_PROPERTY(double right READ right WRITE setRight)
+ Q_PROPERTY(double bottom READ bottom WRITE setBottom)
public:
Margins(QObject *parent);
virtual ~Margins()
{
qDebug() << "Margins deleted";
- };
+ }
public slots:
void set(double lr, double tpr, double btr, double rr);
@@ -165,15 +141,16 @@
class Dimensions : public QObject
{
Q_OBJECT
- Q_PROPERTY(double width READ width);
- Q_PROPERTY(double height READ height);
+ Q_PROPERTY(double width READ width)
+ Q_PROPERTY(double height READ height)
public:
Dimensions(QObject *parent);
- virtual ~Dimensions()
+
+ virtual ~Dimensions()
{
qDebug() << "Dimensions deleted";
- };
+ }
private:
double width();
Modified: trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&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 10:12:14 2012
@@ -12,59 +12,59 @@
#include "ui/propertiespalette.h"
#include "ui/propertiespalette_image.h"
-ScribusImageItem::ScribusImageItem(PageItem_ImageFrame* im) : ScribusItem(im)
+ImageAPI::ImageAPI(PageItem_ImageFrame* im) : ItemAPI(im)
{
qDebug() << "ImageitemAPI loaded";
- setObjectName("imageItem");
+ setObjectName("ImageItemAPI");
item = im;
}
-double ScribusImageItem::imageXScale()
+double ImageAPI::imageXScale()
{
return item->imageXScale();
}
-void ScribusImageItem::setImageXScale(double value)
+void ImageAPI::setImageXScale(double value)
{
item->setImageXScale(value);
}
-double ScribusImageItem::imageYScale()
+double ImageAPI::imageYScale()
{
return item->imageYScale();
}
-void ScribusImageItem::setImageYScale(double value)
+void ImageAPI::setImageYScale(double value)
{
item->setImageYScale(value);
}
-double ScribusImageItem::imageXOffset()
+double ImageAPI::imageXOffset()
{
return item->imageXOffset();
}
-void ScribusImageItem::setImageXOffset(double value)
+void ImageAPI::setImageXOffset(double value)
{
item->setImageXOffset(value);
}
-double ScribusImageItem::imageYOffset()
+double ImageAPI::imageYOffset()
{
return item->imageYOffset();
}
-void ScribusImageItem::setImageYOffset(double value)
+void ImageAPI::setImageYOffset(double value)
{
item->setImageYOffset(value);
}
-void ScribusImageItem::loadImage(QString filename)
+void ImageAPI::loadImage(QString filename)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -78,7 +78,35 @@
ScCore->primaryMainWindow()->doc->loadPict(filename, item);
}
-void ScribusImageItem::scaleImage(double x, double y)
+void ImageAPI::scaleImage(double x, double y)
+{
+ if (!checkHaveDocument())
+ RAISE("No document open");
+ if (item == NULL)
+ return;
+ if (! item->asImageFrame())
+ {
+ RAISE("Specified item not an image frame.");
+ return;
+ }
+
+ Selection tempSelection(*ScCore->primaryMainWindow()->doc->m_Selection);
+ bool hadOrigSelection = (tempSelection.count() != 0);
+
+ ScCore->primaryMainWindow()->doc->m_Selection->clear();
+ ScCore->primaryMainWindow()->view->Deselect();
+ ScCore->primaryMainWindow()->view->SelectItem(item);
+
+ ScCore->primaryMainWindow()->doc->itemSelection_SetImageScale(x, y);
+ ScCore->primaryMainWindow()->doc->updatePic();
+
+ // Now restore the selection.
+ ScCore->primaryMainWindow()->view->Deselect();
+ if (hadOrigSelection)
+ *ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
+}
+
+void ImageAPI::setImageOffset(double x, double y)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -101,8 +129,10 @@
// there is one.
ScCore->primaryMainWindow()->view->SelectItem(item);
- // scale
- ScCore->primaryMainWindow()->doc->itemSelection_SetImageScale(x, y); //CB why when this is done above?
+ // offset
+ double newOffsetX = x / ((item->imageXScale() != 0.0) ? item->imageXScale() : 1);
+ double newOffsetY = y / ((item->imageYScale() != 0.0) ? item->imageYScale() : 1);
+ ScCore->primaryMainWindow()->doc->itemSelection_SetImageOffset(newOffsetX, newOffsetY); //CB why when this is done above?
ScCore->primaryMainWindow()->doc->updatePic();
// Now restore the selection.
@@ -111,42 +141,7 @@
*ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
}
-void ScribusImageItem::setImageOffset(double x, double y)
-{
- if (!checkHaveDocument())
- RAISE("No document open");
- if (item == NULL)
- return;
- if (! item->asImageFrame())
- {
- RAISE("Specified item not an image frame.");
- return;
- }
-
- // Grab the old selection - but use it only where is there any
- Selection tempSelection(*ScCore->primaryMainWindow()->doc->m_Selection);
- bool hadOrigSelection = (tempSelection.count() != 0);
-
- ScCore->primaryMainWindow()->doc->m_Selection->clear();
- // Clear the selection
- ScCore->primaryMainWindow()->view->Deselect();
- // Select the item, which will also select its group if
- // there is one.
- ScCore->primaryMainWindow()->view->SelectItem(item);
-
- // offset
- double newOffsetX = x / ((item->imageXScale() != 0.0) ? item->imageXScale() : 1);
- double newOffsetY = y / ((item->imageYScale() != 0.0) ? item->imageYScale() : 1);
- ScCore->primaryMainWindow()->doc->itemSelection_SetImageOffset(newOffsetX, newOffsetY); //CB why when this is done above?
- ScCore->primaryMainWindow()->doc->updatePic();
-
- // Now restore the selection.
- ScCore->primaryMainWindow()->view->Deselect();
- if (hadOrigSelection)
- *ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
-}
-
-void ScribusImageItem::setImageBrightness(double n)
+void ImageAPI::setImageBrightness(double n)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -169,7 +164,7 @@
ScCore->primaryMainWindow()->doc->updatePic();
}
-void ScribusImageItem::setImageGrayscale()
+void ImageAPI::setImageGrayscale()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -190,7 +185,7 @@
ScCore->primaryMainWindow()->doc->updatePic();
}
-void ScribusImageItem::setScaleImageToFrame(bool scaletoframe, bool Proportional)
+void ImageAPI::setScaleImageToFrame(bool scaletoframe, bool Proportional)
{
bool scaleToFrame = false;
bool proportional = true;
@@ -223,7 +218,7 @@
item->update();
}
-ScribusImageItem::~ScribusImageItem()
+ImageAPI::~ImageAPI()
{
qDebug() << "ImageitemAPI deleted";
}
Modified: trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&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 10:12:14 2012
@@ -15,7 +15,7 @@
#include "api_item.h"
#include "pageitem_imageframe.h"
-class ScribusImageItem : public ScribusItem
+class ImageAPI : public ItemAPI
{
Q_OBJECT
Q_PROPERTY(double imageXScale READ imageXScale WRITE setImageXScale)
@@ -23,8 +23,8 @@
Q_PROPERTY(double imageXOffset READ imageXOffset WRITE setImageXOffset)
Q_PROPERTY(double imageYOffset READ imageYOffset WRITE setImageYOffset)
public:
- ScribusImageItem(PageItem_ImageFrame* im);
- virtual ~ScribusImageItem();
+ ImageAPI(PageItem_ImageFrame* im);
+ virtual ~ImageAPI();
public slots:
void loadImage(QString filename);
Modified: trunk/Scribus/scribus/plugins/scripter/api_item.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_item.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_item.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_item.cpp Tue Jun 26 10:12:14 2012
@@ -9,252 +9,252 @@
#include "undomanager.h"
#include "selection.h"
-ScribusItem::ScribusItem(PageItem* it) : QObject(COLLECTOR)
+ItemAPI::ItemAPI(PageItem* it) : QObject(COLLECTOR)
{
qDebug() << "ItemAPI loaded";
- setObjectName("item");
+ setObjectName("ItemAPI");
item = it;
}
-QString ScribusItem::itemName()
+QString ItemAPI::name()
{
return item->itemName();
}
-void ScribusItem::setItemName(QString name)
+void ItemAPI::setName(QString name)
{
item->setItemName(name);
}
-QString ScribusItem::fillColor()
+QString ItemAPI::fillColor()
{
return item->fillColor();
}
-void ScribusItem::setFillColor(QString color)
+void ItemAPI::setFillColor(QString color)
{
item->setFillColor(color);
}
-QString ScribusItem::lineColor()
+QString ItemAPI::lineColor()
{
return item->lineColor();
}
-void ScribusItem::setLineColor(QString color)
+void ItemAPI::setLineColor(QString color)
{
item->setLineColor(color);
}
-double ScribusItem::fillShade()
+double ItemAPI::fillShade()
{
return item->fillShade();
}
-void ScribusItem::setFillShade(double value)
+void ItemAPI::setFillShade(double value)
{
item->setFillShade(value);
}
-double ScribusItem::lineShade()
+double ItemAPI::lineShade()
{
return item->lineShade();
}
-void ScribusItem::setLineShade(double value)
+void ItemAPI::setLineShade(double value)
{
item->setLineShade(value);
}
-double ScribusItem::fillTransparency()
+double ItemAPI::fillTransparency()
{
return item->fillTransparency();
}
-void ScribusItem::setFillTransparency(double value)
+void ItemAPI::setFillTransparency(double value)
{
item->setFillTransparency(value);
}
-double ScribusItem::lineTransparency()
+double ItemAPI::lineTransparency()
{
return item->lineTransparency();
}
-void ScribusItem::setLineTransparency(double value)
+void ItemAPI::setLineTransparency(double value)
{
item->setLineTransparency(value);
}
-bool ScribusItem::locked()
+bool ItemAPI::locked()
{
return item->locked();
}
-void ScribusItem::setLocked(bool value)
+void ItemAPI::setLocked(bool value)
{
item->setLocked(value);
}
-bool ScribusItem::sizeLocked()
+bool ItemAPI::sizeLocked()
{
return item->sizeLocked();
}
-void ScribusItem::setSizeLocked(bool value)
+void ItemAPI::setSizeLocked(bool value)
{
item->setSizeLocked(value);
}
-bool ScribusItem::imageFlippedV()
+bool ItemAPI::imageFlippedV()
{
return item->imageFlippedV();
}
-void ScribusItem::setImageFlippedV(bool value)
+void ItemAPI::setImageFlippedV(bool value)
{
item->setImageFlippedV(value);
}
-bool ScribusItem::imageFlippedH()
+bool ItemAPI::imageFlippedH()
{
return item->imageFlippedH();
}
-void ScribusItem::setImageFlippedH(bool value)
+void ItemAPI::setImageFlippedH(bool value)
{
item->setImageFlippedH(value);
}
-double ScribusItem::lineWidth()
+double ItemAPI::lineWidth()
{
return item->lineWidth();
}
-void ScribusItem::setLineWidth(double value)
+void ItemAPI::setLineWidth(double value)
{
item->setLineWidth(value);
}
-QString ScribusItem::customLineStyle()
+QString ItemAPI::customLineStyle()
{
return item->customLineStyle();
}
-void ScribusItem::setCustomLineStyle(QString name)
+void ItemAPI::setCustomLineStyle(QString name)
{
item->setCustomLineStyle(name);
}
-int ScribusItem::startArrowIndex()
+int ItemAPI::startArrowIndex()
{
return item->startArrowIndex();
}
-void ScribusItem::setStartArrowIndex(int value)
+void ItemAPI::setStartArrowIndex(int value)
{
item->setStartArrowIndex(value);
}
-int ScribusItem::endArrowIndex()
+int ItemAPI::endArrowIndex()
{
return item->endArrowIndex();
}
-void ScribusItem::setEndArrowIndex(int value)
+void ItemAPI::setEndArrowIndex(int value)
{
item->setEndArrowIndex(value);
}
-bool ScribusItem::printEnabled()
+bool ItemAPI::printEnabled()
{
return item->printEnabled();
}
-void ScribusItem::setPrintEnabled(bool value)
+void ItemAPI::setPrintEnabled(bool value)
{
item->setPrintEnabled(value);
}
-double ScribusItem::xPos()
+double ItemAPI::xPos()
{
return item->xPos();
}
-void ScribusItem::setXPos(double value)
+void ItemAPI::setXPos(double value)
{
item->setXPos(value);
}
-double ScribusItem::yPos()
+double ItemAPI::yPos()
{
return item->yPos();
}
-void ScribusItem::setYPos(double value)
+void ItemAPI::setYPos(double value)
{
item->setYPos(value);
}
-double ScribusItem::width()
+double ItemAPI::width()
{
return item->width();
}
-void ScribusItem::setWidth(double value)
+void ItemAPI::setWidth(double value)
{
item->setWidth(value);
}
-double ScribusItem::height()
+double ItemAPI::height()
{
return item->height();
}
-void ScribusItem::setHeight(double value)
+void ItemAPI::setHeight(double value)
{
item->setHeight(value);
}
-double ScribusItem::rotation()
+double ItemAPI::rotation()
{
return item->rotation();
}
-void ScribusItem::setRotation(double rotation)
+void ItemAPI::setRotation(double rotation)
{
item->setRotation(rotation);
}
-bool ScribusItem::reversed()
+bool ItemAPI::reversed()
{
return item->reversed();
}
-void ScribusItem::setReversed(bool value)
+void ItemAPI::setReversed(bool value)
{
item->setReversed(value);
}
-double ScribusItem::cornerRadius()
+double ItemAPI::cornerRadius()
{
return item->cornerRadius();
}
-void ScribusItem::setCornerRadius(double value)
+void ItemAPI::setCornerRadius(double value)
{
item->setCornerRadius(value);
}
-double ScribusItem::columnGap()
+double ItemAPI::columnGap()
{
return item->columnGap();
}
-void ScribusItem::setColumnGap(double value)
+void ItemAPI::setColumnGap(double value)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -265,12 +265,12 @@
item->ColGap = ValueToPoint(value);
}
-int ScribusItem::columns()
+int ItemAPI::columns()
{
return item->columns();
}
-void ScribusItem::setColumns(int value)
+void ItemAPI::setColumns(int value)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -286,7 +286,7 @@
* Methods
*/
-void ScribusItem::move(double dx, double dy)
+void ItemAPI::move(double dx, double dy)
{
if (!checkHaveDocument())
return;
@@ -320,7 +320,7 @@
}
-void ScribusItem::moveAbs(double x, double y)
+void ItemAPI::moveAbs(double x, double y)
{
if (!checkHaveDocument())
return;
@@ -352,7 +352,7 @@
*ScCore->primaryMainWindow()->doc->m_Selection=tempSelection;
}
-void ScribusItem::resize(double width, double height)
+void ItemAPI::resize(double width, double height)
{
if (!checkHaveDocument())
return;
@@ -361,7 +361,7 @@
ScCore->primaryMainWindow()->doc->SizeItem(ValueToPoint(width), ValueToPoint(height), item);
}
-void ScribusItem::rotate(double rot)
+void ItemAPI::rotate(double rot)
{
if (!checkHaveDocument())
return;
@@ -370,7 +370,7 @@
ScCore->primaryMainWindow()->doc->RotateItem(item->rotation() - rot, item);
}
-void ScribusItem::rotateAbs(double rot)
+void ItemAPI::rotateAbs(double rot)
{
if (!checkHaveDocument())
return;
@@ -380,7 +380,7 @@
}
-ScribusItem::~ScribusItem()
+ItemAPI::~ItemAPI()
{
qDebug() << "ItemAPI deleted";
}
Modified: trunk/Scribus/scribus/plugins/scripter/api_item.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_item.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_item.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_item.h Tue Jun 26 10:12:14 2012
@@ -13,10 +13,10 @@
#include "scripterimpl.h"
-class ScribusItem : public QObject
+class ItemAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString itemName READ itemName WRITE setItemName)
+ Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString fillColor READ fillColor WRITE setFillColor)
Q_PROPERTY(QString lineColor READ lineColor WRITE setLineColor)
Q_PROPERTY(double fillShade READ fillShade WRITE setFillShade)
@@ -44,8 +44,8 @@
Q_PROPERTY(int columns READ columns WRITE setColumns)
public:
- ScribusItem(PageItem *it);
- virtual ~ScribusItem();
+ ItemAPI(PageItem *it);
+ virtual ~ItemAPI();
public slots:
void move(double dx, double dy);
@@ -60,8 +60,8 @@
/**
* Properties
*/
- QString itemName();
- void setItemName(QString name);
+ QString name();
+ void setName(QString name);
QString fillColor();
void setFillColor(QString color);
Modified: trunk/Scribus/scribus/plugins/scripter/api_layer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_layer.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_layer.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_layer.cpp Tue Jun 26 10:12:14 2012
@@ -9,7 +9,7 @@
#include "api_textitem.h"
#include "api_imageitem.h"
-ScribusLayer::ScribusLayer(ScLayer *l) : QObject(COLLECTOR)
+LayerAPI::LayerAPI(ScLayer *l) : QObject(COLLECTOR)
{
qDebug() << "ScLayerWrapper loaded";
setObjectName("layer");
@@ -17,109 +17,109 @@
}
-QString ScribusLayer::getName()
+QString LayerAPI::getName()
{
return innerLayer->Name;
}
-void ScribusLayer::setName(QString name)
+void LayerAPI::setName(QString name)
{
innerLayer->Name = name;
}
-int ScribusLayer::getID()
+int LayerAPI::getID()
{
return innerLayer->ID;
}
-int ScribusLayer::getLevel()
+int LayerAPI::getLevel()
{
return innerLayer->Level;
}
-void ScribusLayer::setLevel(int level)
+void LayerAPI::setLevel(int level)
{
innerLayer->Level = level;
}
-bool ScribusLayer::isPrintable()
+bool LayerAPI::isPrintable()
{
return innerLayer->isPrintable;
}
-void ScribusLayer::setPrintable(bool value)
+void LayerAPI::setPrintable(bool value)
{
innerLayer->isPrintable = value;
}
-bool ScribusLayer::isViewable()
+bool LayerAPI::isViewable()
{
return innerLayer->isViewable;
}
-void ScribusLayer::setViewable(bool value)
+void LayerAPI::setViewable(bool value)
{
innerLayer->isViewable = value;
}
-bool ScribusLayer::isEditable()
+bool LayerAPI::isEditable()
{
return innerLayer->isEditable;
}
-void ScribusLayer::setEditable(bool value)
+void LayerAPI::setEditable(bool value)
{
innerLayer->isEditable = value;
}
-bool ScribusLayer::getFlowControl()
+bool LayerAPI::getFlowControl()
{
return innerLayer->flowControl;
}
-void ScribusLayer::setFlowControl(bool value)
+void LayerAPI::setFlowControl(bool value)
{
innerLayer->flowControl = value;
}
-bool ScribusLayer::getOutlineMode()
+bool LayerAPI::getOutlineMode()
{
return innerLayer->outlineMode;
}
-void ScribusLayer::setOutlineMode(bool value)
+void LayerAPI::setOutlineMode(bool value)
{
innerLayer->outlineMode = value;
}
-double ScribusLayer::getTransparency()
+double LayerAPI::getTransparency()
{
return innerLayer->transparency;
}
-void ScribusLayer::setTransparency(double value)
+void LayerAPI::setTransparency(double value)
{
innerLayer->transparency = value;
}
-int ScribusLayer::getBlendMode()
+int LayerAPI::getBlendMode()
{
return innerLayer->blendMode;
}
-void ScribusLayer::setBlendMode(int value)
+void LayerAPI::setBlendMode(int value)
{
innerLayer->blendMode = value;
}
-bool ScribusLayer::isActive()
+bool LayerAPI::isActive()
{
if (ScCore->primaryMainWindow()->doc->activeLayerName() == innerLayer->Name)
return true;
return false;
}
-void ScribusLayer::setActive(bool value)
+void LayerAPI::setActive(bool value)
{
if (value)
{
@@ -134,7 +134,7 @@
*
*/
-QList< QVariant > ScribusLayer::items()
+QList< QVariant > LayerAPI::items()
{
QList<QVariant> l;
for (int i = 0; i<ScCore->primaryMainWindow()->doc->Items->count(); ++i)
@@ -144,17 +144,17 @@
{
if (item->asTextFrame())
{
- ScribusTextItem *textItem = new ScribusTextItem(item->asTextFrame());
+ TextAPI *textItem = new TextAPI(item->asTextFrame());
l.append(qVariantFromValue((QObject *)(textItem)));
}
else if (item->asImageFrame())
{
- ScribusImageItem *imageItem = new ScribusImageItem(item->asImageFrame());
+ ImageAPI *imageItem = new ImageAPI(item->asImageFrame());
l.append(qVariantFromValue((QObject *)(imageItem)));
}
else
{
- ScribusItem *otherItem = new ScribusItem(item);
+ ItemAPI *otherItem = new ItemAPI(item);
l.append(qVariantFromValue(
(QObject *)(otherItem)
));
@@ -164,7 +164,7 @@
return l;
}
-ScribusLayer::~ScribusLayer()
+LayerAPI::~LayerAPI()
{
qDebug() << "ScribusLayer deleted";
}
Modified: trunk/Scribus/scribus/plugins/scripter/api_layer.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_layer.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_layer.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_layer.h Tue Jun 26 10:12:14 2012
@@ -19,30 +19,29 @@
* all properties of ScLayer defined via Q_PROPERTY
*/
-class ScribusLayer : public QObject
+class LayerAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString name READ getName WRITE setName);
+ Q_PROPERTY(QString name READ getName WRITE setName)
Q_PROPERTY(int id READ getID)
- Q_PROPERTY(int level READ getLevel WRITE setLevel);
- Q_PROPERTY(bool printable READ isPrintable WRITE setPrintable);
- Q_PROPERTY(bool viewable READ isViewable WRITE setViewable);
- Q_PROPERTY(bool editable READ isEditable WRITE setEditable);
- Q_PROPERTY(bool flowControl READ getFlowControl WRITE setFlowControl);
- Q_PROPERTY(bool outlineMode READ getOutlineMode WRITE setOutlineMode);
- Q_PROPERTY(double transparency READ getTransparency WRITE setTransparency);
- Q_PROPERTY(int blendMode READ getBlendMode WRITE setBlendMode);
- Q_PROPERTY(bool active READ isActive WRITE setActive);
-
- Q_PROPERTY(QList<QVariant> items READ items);
+ Q_PROPERTY(int level READ getLevel WRITE setLevel)
+ Q_PROPERTY(bool printable READ isPrintable WRITE setPrintable)
+ Q_PROPERTY(bool viewable READ isViewable WRITE setViewable)
+ Q_PROPERTY(bool editable READ isEditable WRITE setEditable)
+ Q_PROPERTY(bool flowControl READ getFlowControl WRITE setFlowControl)
+ Q_PROPERTY(bool outlineMode READ getOutlineMode WRITE setOutlineMode)
+ Q_PROPERTY(double transparency READ getTransparency WRITE setTransparency)
+ Q_PROPERTY(int blendMode READ getBlendMode WRITE setBlendMode)
+ Q_PROPERTY(bool active READ isActive WRITE setActive)
+ Q_PROPERTY(QList<QVariant> items READ items)
private:
ScLayer *innerLayer;
public:
- ScribusLayer(ScLayer *l);
- virtual ~ScribusLayer();
+ LayerAPI(ScLayer *l);
+ virtual ~LayerAPI();
QList<QVariant> items();
Modified: trunk/Scribus/scribus/plugins/scripter/api_page.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_page.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_page.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_page.cpp Tue Jun 26 10:12:14 2012
@@ -20,7 +20,7 @@
-ScribusPage::ScribusPage(QObject *parent) : QObject(COLLECTOR)
+PageAPI::PageAPI(QObject *parent) : QObject(COLLECTOR)
{
qDebug() << "PageAPI loaded";
setObjectName("page");
@@ -28,7 +28,7 @@
-ScribusPage::~ScribusPage()
+PageAPI::~PageAPI()
{
qDebug() << "PageAPI deleted";
}
@@ -40,7 +40,7 @@
*
* Removes the active page from the active document.
*/
-void ScribusPage::remove()
+void PageAPI::remove()
{
if (ScCore->primaryMainWindow()->doc->Pages->count() > 1)
ScCore->primaryMainWindow()->deletePage2(number());
@@ -55,7 +55,7 @@
* Property
* location of active page as int value (read-only)
*/
-int ScribusPage::position()
+int PageAPI::position()
{
return ScCore->primaryMainWindow()->doc->locationOfPage(number());
}
@@ -67,14 +67,14 @@
* Property
* int value of active page number >= 1
*/
-int ScribusPage::number()
+int PageAPI::number()
{
return ScCore->primaryMainWindow()->doc->currentPageNumber() + 1;
}
-void ScribusPage::setNumber(int value)
+void PageAPI::setNumber(int value)
{
value--;
if ((value < 0) || (value > static_cast<int>(ScCore->primaryMainWindow()->doc->Pages->count())-1))
@@ -92,7 +92,7 @@
* Property
* List of Item objects of active page
*/
-QList<QVariant> ScribusPage::items()
+QList<QVariant> PageAPI::items()
{
QList<QVariant> l;
int num = number() - 1;
@@ -108,12 +108,12 @@
*/
if (item->asTextFrame())
{
- l.append(qVariantFromValue((QObject *)(new ScribusTextItem(item->asTextFrame()))));
+ l.append(qVariantFromValue((QObject *)(new TextAPI(item->asTextFrame()))));
}
else
{
l.append(qVariantFromValue(
- (QObject *)(new ScribusItem(item))
+ (QObject *)(new ItemAPI(item))
));
}
}
@@ -128,7 +128,7 @@
* Property
* List of selected Item objects on active page of active document
*/
-QList<QVariant> ScribusPage::selection()
+QList<QVariant> PageAPI::selection()
{
QList<QVariant> l;
int num = number() - 1;
@@ -140,11 +140,11 @@
{
if (item->asTextFrame())
{
- l.append(qVariantFromValue((QObject*)(new ScribusTextItem(item->asTextFrame()))));
+ l.append(qVariantFromValue((QObject*)(new TextAPI(item->asTextFrame()))));
}
else
{
- l.append(qVariantFromValue((QObject*)(new ScribusItem(item))));
+ l.append(qVariantFromValue((QObject*)(new ItemAPI(item))));
}
}
}
@@ -155,7 +155,7 @@
// copied from scripter/cmdutil.cpp
/// Convert an X co-ordinate part in page units to a document co-ordinate
/// in system units.
-double ScribusPage::pageXtoDocX(double x)
+double PageAPI::pageXtoDocX(double x)
{
return x + ScCore->primaryMainWindow()->doc->currentPage()->xOffset();
}
@@ -166,12 +166,12 @@
/// in system units. The document co-ordinates have their origin somewere
/// up and left of the first page, where page co-ordinates have their
/// origin on the top left of the current page.
-double ScribusPage::pageYtoDocY(double y)
+double PageAPI::pageYtoDocY(double y)
{
return y + ScCore->primaryMainWindow()->doc->currentPage()->yOffset();
}
-PageItem *ScribusPage::newItem(const PageItem::ItemType itemType,
+PageItem *PageAPI::newItem(const PageItem::ItemType itemType,
const PageItem::ItemFrameType frameType,
const double x, const double y, const double width,
const double height, const double w,
@@ -195,14 +195,14 @@
* height is a double
* returns Item object
*/
-QObject *ScribusPage::newRectangle(double x, double y, double width, double height)
+QObject *PageAPI::newRectangle(double x, double y, double width, double height)
{
PageItem *item = newItem(
PageItem::Polygon, PageItem::Rectangle, x, y, width, height,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineWidth,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeFillColor,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineColor);
- return new ScribusItem(item);
+ return new ItemAPI(item);
}
@@ -215,14 +215,14 @@
* height is a double
* returns Item object
*/
-QObject *ScribusPage::newEllipse(double x, double y, double width, double height)
+QObject *PageAPI::newEllipse(double x, double y, double width, double height)
{
PageItem *item = newItem(
PageItem::Polygon, PageItem::Ellipse, x, y, width, height,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineWidth,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeFillColor,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineColor);
- return new ScribusItem(item);
+ return new ItemAPI(item);
}
@@ -235,7 +235,7 @@
* height is a double
* returns Item object
*/
-QObject *ScribusPage::newImage(double x, double y, double width, double height)
+QObject *PageAPI::newImage(double x, double y, double width, double height)
{
PageItem *item = newItem(
PageItem::ImageFrame, PageItem::Unspecified, x, y, width, height,
@@ -244,7 +244,7 @@
// ScCore->primaryMainWindow()->doc->toolSettings.dBrushPict,
ScCore->primaryMainWindow()->doc->itemToolPrefs().imageFillColor,
CommonStrings::None);
- return new ScribusImageItem(item->asImageFrame());
+ return new ImageAPI(item->asImageFrame());
}
@@ -257,14 +257,14 @@
* height is a double
* returns Item object
*/
-QObject *ScribusPage::newText(double x, double y, double width, double height)
+QObject *PageAPI::newText(double x, double y, double width, double height)
{
PageItem *item = newItem(
PageItem::TextFrame, PageItem::Unspecified, x, y, width, height,
ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineWidth,
CommonStrings::None,
ScCore->primaryMainWindow()->doc->itemToolPrefs().textFont);
- return new ScribusTextItem(item->asTextFrame());
+ return new TextAPI(item->asTextFrame());
}
@@ -277,7 +277,7 @@
* height is a double
* returns Item object
*/
-QObject *ScribusPage::newLine(double x, double y, double width, double height)
+QObject *PageAPI::newLine(double x, double y, double width, double height)
{
PageItem *item = (PageItem*)newItem(
PageItem::Line, PageItem::Unspecified, x, y, width, height,
@@ -288,13 +288,13 @@
item->setWidthHeight(sqrt(pow(x-width, 2.0) + pow(y-height, 2.0)), 1.0);
item->Sizing = false;
item->updateClip();
- return new ScribusItem(item);
+ return new ItemAPI(item);
}
// XXX: newPolyLine, bezierline
-void ScribusPage::placeImage(const int formatid, const QString & filename, const double x, const double y)
+void PageAPI::placeImage(const int formatid, const QString & filename, const double x, const double y)
{
const FileFormat * fmt = LoadSavePlugin::getFormatById(formatid);
if (fmt)
@@ -330,7 +330,7 @@
* y is double
* import vector graphics at given position on active page
*/
-void ScribusPage::placeSVG(const QString & filename, const double x, const double y)
+void PageAPI::placeSVG(const QString & filename, const double x, const double y)
{
placeImage(FORMATID_SVGIMPORT, filename, x, y);
}
@@ -344,7 +344,7 @@
* y is double
* import vector graphics at given position on active page
*/
-void ScribusPage::placeODG(const QString & filename, const double x, const double y)
+void PageAPI::placeODG(const QString & filename, const double x, const double y)
{
placeImage(FORMATID_ODGIMPORT, filename, x, y);
}
@@ -358,7 +358,7 @@
* y is double
* import vector graphics at given position on active page
*/
-void ScribusPage::placeEPS(const QString & filename, const double x, const double y)
+void PageAPI::placeEPS(const QString & filename, const double x, const double y)
{
placeImage(FORMATID_PSIMPORT, filename, x, y);
}
@@ -372,7 +372,7 @@
* y is double
* import vector graphics at given position on active page
*/
-void ScribusPage::placeSXD(const QString & filename, const double x, const double y)
+void PageAPI::placeSXD(const QString & filename, const double x, const double y)
{
placeImage(FORMATID_SXDIMPORT, filename, x, y);
}
@@ -382,7 +382,7 @@
* Scripter.activeDocument.activePage.savePageAsEPS(filename)
* filename is QString
*/
-void ScribusPage::savePageAsEPS(const QString &filename)
+void PageAPI::savePageAsEPS(const QString &filename)
{
QString epsError;
bool ret = ScCore->primaryMainWindow()->DoSaveAsEps(filename, epsError);
@@ -394,7 +394,7 @@
* Scripter.activeDocument.activePage.type
* Returns 0 if LeftPage, 1 if Middle Page, 2 for Right Page
*/
-int ScribusPage::type()
+int PageAPI::type()
{
return ScCore->primaryMainWindow()->doc->locationOfPage(number());
}
Modified: trunk/Scribus/scribus/plugins/scripter/api_page.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_page.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_page.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_page.h Tue Jun 26 10:12:14 2012
@@ -14,18 +14,14 @@
#include "scripterimpl.h"
-class ScribusPage : public QObject
+class PageAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(int number READ number WRITE setNumber);
- Q_PROPERTY(int position READ position);
- Q_PROPERTY(QList<QVariant> items READ items);
- Q_PROPERTY(QList<QVariant> selection READ selection);
- Q_PROPERTY(int type READ type);
-public:
- ScribusPage(QObject *parent);
- virtual ~ScribusPage();
-
+ Q_PROPERTY(int number READ number WRITE setNumber)
+ Q_PROPERTY(int position READ position)
+ Q_PROPERTY(QList<QVariant> items READ items)
+ Q_PROPERTY(QList<QVariant> selection READ selection)
+ Q_PROPERTY(int type READ type)
public slots:
void remove();
@@ -39,6 +35,10 @@
void placeEPS(const QString & filename, const double x, const double y);
void placeSXD(const QString & filename, const double x, const double y);
void savePageAsEPS(const QString & filename);
+
+public:
+ PageAPI(QObject *parent);
+ virtual ~PageAPI();
private:
int position();
Modified: trunk/Scribus/scribus/plugins/scripter/api_printer.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_printer.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_printer.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_printer.h Tue Jun 26 10:12:14 2012
@@ -16,17 +16,17 @@
class PrinterAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString printer READ getPrinter WRITE setPrinter);
- Q_PROPERTY(QString file READ getFile WRITE setFile);
- Q_PROPERTY(QString cmd READ getCmd WRITE setCmd);
- Q_PROPERTY(QString separation READ getSeparation WRITE setSeparation);
- Q_PROPERTY(QList<QVariant> pages READ getPages WRITE setPages);
- Q_PROPERTY(bool color READ isColor WRITE setColor);
- Q_PROPERTY(bool useICC READ getUseICC WRITE setUseICC);
- Q_PROPERTY(int psLevel READ getPsLevel WRITE setPsLevel);
- Q_PROPERTY(bool mph READ getMph WRITE setMph);
- Q_PROPERTY(bool mpv READ getMpv WRITE setMpv);
- Q_PROPERTY(bool ucr READ getUcr WRITE setUcr);
+ Q_PROPERTY(QString printer READ getPrinter WRITE setPrinter)
+ Q_PROPERTY(QString file READ getFile WRITE setFile)
+ Q_PROPERTY(QString cmd READ getCmd WRITE setCmd)
+ Q_PROPERTY(QString separation READ getSeparation WRITE setSeparation)
+ Q_PROPERTY(QList<QVariant> pages READ getPages WRITE setPages)
+ Q_PROPERTY(bool color READ isColor WRITE setColor)
+ Q_PROPERTY(bool useICC READ getUseICC WRITE setUseICC)
+ Q_PROPERTY(int psLevel READ getPsLevel WRITE setPsLevel)
+ Q_PROPERTY(bool mph READ getMph WRITE setMph)
+ Q_PROPERTY(bool mpv READ getMpv WRITE setMpv)
+ Q_PROPERTY(bool ucr READ getUcr WRITE setUcr)
public:
PrinterAPI();
virtual ~PrinterAPI();
Modified: trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp Tue Jun 26 10:12:14 2012
@@ -12,14 +12,14 @@
#include "hyphenator.h"
#include "scripterimpl.h"
-ScribusTextItem::ScribusTextItem(PageItem_TextFrame* inner) : ScribusItem(inner)
+TextAPI::TextAPI(PageItem_TextFrame* inner) : ItemAPI(inner)
{
qDebug() << "TextItemWrapper loaded";
setObjectName("textItem");
item = inner;
}
-QString ScribusTextItem::font()
+QString TextAPI::font()
{
if (item->HasSel)
{
@@ -32,7 +32,7 @@
return item->currentCharStyle().font().scName();
}
-void ScribusTextItem::setFont(QString name)
+void TextAPI::setFont(QString name)
{
if (PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts.contains(name))
{
@@ -52,7 +52,7 @@
}
-double ScribusTextItem::fontSize()
+double TextAPI::fontSize()
{
if (item->HasSel)
{
@@ -67,7 +67,7 @@
}
}
-void ScribusTextItem::setFontSize(double size)
+void TextAPI::setFontSize(double size)
{
int Apm = ScCore->primaryMainWindow()->doc->appMode;
ScCore->primaryMainWindow()->doc->m_Selection->clear();
@@ -79,7 +79,7 @@
ScCore->primaryMainWindow()->view->Deselect();
}
-void ScribusTextItem::setText(QString text)
+void TextAPI::setText(QString text)
{
text.replace("\r\n", SpecialChars::PARSEP);
text.replace(QChar('\n') , SpecialChars::PARSEP);
@@ -95,7 +95,7 @@
ScCore->primaryMainWindow()->view->DrawNew();
}
-QString ScribusTextItem::text()
+QString TextAPI::text()
{
QString text = "";
for (int a = 0; a < item->itemText.length(); a++)
@@ -113,22 +113,22 @@
return text;
}
-int ScribusTextItem::textLines()
+int TextAPI::textLines()
{
return item->itemText.lines();
}
-int ScribusTextItem::textLength()
+int TextAPI::textLength()
{
return item->itemText.length();
}
-double ScribusTextItem::lineSpacing()
+double TextAPI::lineSpacing()
{
return item->currentStyle().lineSpacing();
}
-void ScribusTextItem::setLineSpacing(double value)
+void TextAPI::setLineSpacing(double value)
{
int Apm = ScCore->primaryMainWindow()->doc->appMode;
ScCore->primaryMainWindow()->doc->m_Selection->clear();
@@ -140,7 +140,7 @@
ScCore->primaryMainWindow()->view->Deselect();
}
-QList<QVariant> ScribusTextItem::distances()
+QList<QVariant> TextAPI::distances()
{
QList<QVariant> l;
l.append(pts2value(item->textToFrameDistLeft(), ScCore->primaryMainWindow()->doc->unitIndex()));
@@ -150,7 +150,7 @@
return l;
}
-void ScribusTextItem::insertText(QString text, int position)
+void TextAPI::insertText(QString text, int position)
{
text.replace("\r\n", SpecialChars::PARSEP);
text.replace(QChar('\n') , SpecialChars::PARSEP);
@@ -171,7 +171,7 @@
ScCore->primaryMainWindow()->view->DrawNew();
}
-void ScribusTextItem::setLineSpacingMode(int mode)
+void TextAPI::setLineSpacingMode(int mode)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -190,7 +190,7 @@
ScCore->primaryMainWindow()->view->Deselect();
}
-void ScribusTextItem::setDistances(double left, double right, double top, double bottom)
+void TextAPI::setDistances(double left, double right, double top, double bottom)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -202,7 +202,7 @@
item->setTextToFrameDist(ValueToPoint(left), ValueToPoint(right), ValueToPoint(top), ValueToPoint(bottom));
}
-void ScribusTextItem::setTextAlignment(int alignment)
+void TextAPI::setTextAlignment(int alignment)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -220,7 +220,7 @@
ScCore->primaryMainWindow()->view->Deselect();
}
-void ScribusTextItem::setTextColor(QString color)
+void TextAPI::setTextColor(QString color)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -237,7 +237,7 @@
}
}
-void ScribusTextItem::setTextStroke(QString color)
+void TextAPI::setTextStroke(QString color)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -254,7 +254,7 @@
}
}
-void ScribusTextItem::setTextScalingV(double value)
+void TextAPI::setTextScalingV(double value)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -274,7 +274,7 @@
}
-void ScribusTextItem::setTextScalingH(double value)
+void TextAPI::setTextScalingH(double value)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -294,7 +294,7 @@
}
-void ScribusTextItem::setTextShade(int w)
+void TextAPI::setTextShade(int w)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -315,7 +315,7 @@
}
}
-void ScribusTextItem::selectText(int start, int selcount)
+void TextAPI::selectText(int start, int selcount)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -343,7 +343,7 @@
item->HasSel = true;
}
-void ScribusTextItem::linkToTextFrame(QString name2)
+void TextAPI::linkToTextFrame(QString name2)
{
if(name2.isEmpty())
{
@@ -382,7 +382,7 @@
ScCore->primaryMainWindow()->slotDocCh();
}
-void ScribusTextItem::unLinkTextFrames()
+void TextAPI::unLinkTextFrames()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -397,7 +397,7 @@
ScCore->primaryMainWindow()->view->DrawNew();
}
-bool ScribusTextItem::deleteText()
+bool TextAPI::deleteText()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -413,7 +413,7 @@
}
}
-bool ScribusTextItem::traceText()
+bool TextAPI::traceText()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -422,9 +422,10 @@
ScCore->primaryMainWindow()->view->Deselect(true);
ScCore->primaryMainWindow()->view->SelectItem(item);
ScCore->primaryMainWindow()->view->TextToPath();
-}
-
-int ScribusTextItem::textOverFlows(bool checkLinks)
+ return true;
+}
+
+int TextAPI::textOverFlows(bool checkLinks)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -458,7 +459,7 @@
return item->frameOverflows();
}
-bool ScribusTextItem::hyphenate()
+bool TextAPI::hyphenate()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -466,7 +467,7 @@
return true;
}
-bool ScribusTextItem::dehyphenate()
+bool TextAPI::dehyphenate()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -474,7 +475,7 @@
return false;
}
-bool ScribusTextItem::PDFBookMark()
+bool TextAPI::PDFBookMark()
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -483,7 +484,7 @@
return false;
}
-void ScribusTextItem::setPDFBookMark(bool toggle)
+void TextAPI::setPDFBookMark(bool toggle)
{
if (!checkHaveDocument())
RAISE("No document open");
@@ -501,7 +502,7 @@
item->isBookmark = toggle;
}
-ScribusTextItem::~ScribusTextItem()
+TextAPI::~TextAPI()
{
qDebug() << "TextItemWrapper deleted";
}
Modified: trunk/Scribus/scribus/plugins/scripter/api_textitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&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 10:12:14 2012
@@ -15,7 +15,7 @@
#include "pageitem_textframe.h"
#include "api_item.h"
-class ScribusTextItem : public ScribusItem
+class TextAPI : public ItemAPI
{
Q_OBJECT
@@ -24,8 +24,7 @@
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(int textLines READ textLines)
Q_PROPERTY(int textLength READ textLength)
- Q_PROPERTY(QString allText READ allText)
- Q_PROPERTY(double lineSpacing READ lineSpacing WRITE setLineSpacing)
+ Q_PROPERTY(double lineSpacing READ lineSpacing WRITE setLineSpacing)
Q_PROPERTY(QList<QVariant> distances READ distances)
Q_PROPERTY(bool deleteText READ deleteText)
Q_PROPERTY(bool traceText READ traceText)
@@ -34,8 +33,8 @@
Q_PROPERTY(bool PDFBookMark READ PDFBookMark WRITE setPDFBookMark)
public:
- ScribusTextItem(PageItem_TextFrame* inner);
- ~ScribusTextItem();
+ TextAPI(PageItem_TextFrame* inner);
+ ~TextAPI();
public slots:
void insertText(QString text, int position);
@@ -62,9 +61,8 @@
int textLines();
int textLength();
- QString allText();
- double lineSpacing();
+ double lineSpacing();
void setLineSpacing(double value);
QList<QVariant> distances();
Modified: trunk/Scribus/scribus/plugins/scripter/api_window.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_window.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_window.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_window.cpp Tue Jun 26 10:12:14 2012
@@ -7,7 +7,7 @@
#include "api_window.h"
#include "canvas.h"
-ScribusWindow::ScribusWindow() : QObject(COLLECTOR)
+WindowAPI::WindowAPI() : QObject(COLLECTOR)
{
qDebug() << "WindowAPI loaded";
// XXX: support other windows later
@@ -16,7 +16,7 @@
-ScribusWindow::~ScribusWindow()
+WindowAPI::~WindowAPI()
{
qDebug() << "WindowAPI deleted";
}
@@ -29,7 +29,7 @@
*
* -100.0 is special value to see the whole page.
*/
-void ScribusWindow::setZoom(double factor)
+void WindowAPI::setZoom(double factor)
{
if (factor > 0.0 || factor == -100.0)
ScCore->primaryMainWindow()->slotZoom(factor);
@@ -39,7 +39,7 @@
-double ScribusWindow::zoom()
+double WindowAPI::zoom()
{
// XXX: better use the following?
// ScCore->primaryMainWindow()->view->m_canvas->scale()/Prefs->DisScale*100
@@ -57,7 +57,7 @@
*
* scrolls the visible view to (x, y)
*/
-void ScribusWindow::scroll(int x, int y)
+void WindowAPI::scroll(int x, int y)
{
ScCore->primaryMainWindow()->view->scrollBy(x, y);
}
@@ -69,7 +69,7 @@
*
* forces a complete redraw of the view
*/
-void ScribusWindow::update()
+void WindowAPI::update()
{
ScCore->primaryMainWindow()->view->DrawNew();
}
@@ -86,14 +86,14 @@
* After that you can redraw the complete view with
* ->Scripter.activeWindow.update()
*/
-void ScribusWindow::setRedraw(bool flag)
+void WindowAPI::setRedraw(bool flag)
{
ScCore->primaryMainWindow()->doc->DoDrawing = flag;
}
-bool ScribusWindow::redraw()
+bool WindowAPI::redraw()
{
return ScCore->primaryMainWindow()->doc->DoDrawing;
}
Modified: trunk/Scribus/scribus/plugins/scripter/api_window.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/api_window.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_window.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_window.h Tue Jun 26 10:12:14 2012
@@ -13,15 +13,15 @@
#include "scripterimpl.h"
-class ScribusWindow : public QObject
+class WindowAPI : public QObject
{
Q_OBJECT
- Q_PROPERTY(double zoom READ zoom WRITE setZoom);
- Q_PROPERTY(bool redraw READ redraw WRITE setRedraw);
+ Q_PROPERTY(double zoom READ zoom WRITE setZoom)
+ Q_PROPERTY(bool redraw READ redraw WRITE setRedraw)
public:
- ScribusWindow();
- virtual ~ScribusWindow();
+ WindowAPI();
+ virtual ~WindowAPI();
public slots:
// XXX: relative or absolute scrolling?
Modified: trunk/Scribus/scribus/plugins/scripter/scripterimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17638&path=/trunk/Scribus/scribus/plugins/scripter/scripterimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/scripterimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/scripterimpl.cpp Tue Jun 26 10:12:14 2012
@@ -146,7 +146,7 @@
QObject *ScripterImpl::activeWindow()
{
if (ScCore->primaryMainWindow()->HaveDoc)
- return new ScribusWindow();
+ return new WindowAPI();
else
return NULL;
}
@@ -165,7 +165,7 @@
for (it = names.begin(); it != names.end(); ++it)
{
ScColor *value = &(names[it.key()]);
- ScColorWrapper *color = new ScColorWrapper(value, it.key());
+ ColorAPI *color = new ColorAPI(value, it.key());
l.append(qVariantFromValue((QObject *)(color)));
}
return l;
More information about the scribus-commit
mailing list