View Issue Details

IDProjectCategoryView StatusLast Update
0002097ScribusPlug-inspublic2005-10-02 15:12
ReporterringercAssigned Toringerc 
PrioritylowSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Platformx86 LinuxOSFedora CoreOS Version3
Product Version1.3.1cvs 
Fixed in Version1.3.1cvs 
Summary0002097: Re-write plugin API
DescriptionThe plugin API needed quite a bit of work. The new API:
   - makes it easier to extend the API w/o adding lots of new dlopen calls
   - Makes different types of plugins more easily discovered
   - Make it easier to add new types of plugin under the same general API (think gettext, fileloader, etc all using a single general API and core codebase)
   - Make it easier for plugins to export information about themsevles
   - Make it more practical for the core code to call plug-ins
   - Make it more practical for plugins to call other plugins

Future work building on this will:
   - Let plugins have prefs panels
   - Add an "about plugins" section to the help/about dialog
   - Permit plugins to be statically linked if desired
   - Provide a way to enumerate all "import" plugins and all "export" plugins,
     ask what formats they support, etc.

Some more info can be found at http://wiki.scribus.net/index.php/New_plug-in_API
Additional InformationKnown issues:
  - Untested on win32, Mac OS X (Mac OS X is pretty safe, win32 should be alright but may need a few tweaks. Known to build with gcc symbol visibility limits, which is a crucial factor for win32 compat.)
  - Win32 may need different implementation of PluginManager::getPluginName (should be trivial)
  - Plugins that return output to the main app need testing, mainly story editor's font preview. Having a hard time even figuring out what it's trying to do.
TagsNo tags attached.
Patch

Relationships

related to 0001702 closedcbradney Move Load and Save functions into a "master/slave" plugin 
related to 0001622 acknowledged questioning the import menu 
related to 0001309 assignedsubik feature: font preview should be a normal, non-modal window 
related to 0001961 closedringerc Limit symbol visibility in plug-ins for efficiency 
related to 0000015 closedjghali Windows Port 
related to 0002396 closedjghali Correct cross-DLL memory handling on win32 
related to 0002398 closedjghali Get plugins to compile on Windows (win32) 
related to 0000569 closedsubik Insert Special window is modal, complicating multiple insertions of special characters 
related to 0002931 acknowledged Metabug: SVG 

Activities

ringerc

2005-07-10 02:44

reporter   ~0005481

bumped

ringerc

2005-07-15 15:44

reporter   ~0005592

Uploaded updated plugin.h . Need to have another read over this then have a bash at an initial conversion.

ringerc

2005-07-24 12:48

reporter   ~0005693

Also need to think about cleanly handing memory between chunks of dynamically loaded code in win32.

Right now, I'm inclined to favour just loading plug-ins and never unloading them. We'd call their setup and cleanup routines, but not actually dlclose() or equivalent them. That should protect us from the worst of it. Doing anything better is likely to require a proper internal API for plugins to use, and we're just not ready for that yet.

ringerc

2005-07-25 05:51

reporter   ~0005709

This API should permit the addition of support for running scripts from the command line.

subik

2005-07-26 17:12

manager   ~0005733

Actually I agree with develz wiki stuf (more to read tomorrow).
BTW it should be possible to run plugin without "dl*" trash to be able to have e.g. non-modal dialogs/windows in plugins (as requested in RFE 1309)

ringerc

2005-08-03 08:20

reporter   ~0005854

re 0001309, that could be done now by making font preview a persistent plugin or integrating it into the core code. I'm not quite sure I understand how the involvement of dynamic linking matters to whether or not it can be a non-modal persistent window.

ringerc

2005-08-03 12:40

reporter   ~0005862

Last edited: 2005-08-04 04:08

Uploaded new version of the header, now named scplugin.h to match the contained class. It's pretty much ready I think. I really want feedback about this before I start coding, especially the new deferred execution bit (which I won't try to convert existing plugins to immediately).

FYI:

sizeof(ScPlugin): 84
sizeof(ScPersistentPlugin): 84
sizeof(ScImportExportPlugin): 104

according to:

--------
#include <scplugin.h>
#include <iostream>

using namespace std;

int main(char* argc[], int argv)
{
    cout << "sizeof(ScPlugin): " << sizeof(ScPlugin) << endl;
    cout << "sizeof(ScPersistentPlugin): " << sizeof(ScPersistentPlugin) << endl;
    cout << "sizeof(ScImportExportPlugin): " << sizeof(ScImportExportPlugin) << endl;
    return 0;
}
--------

as built with:

gcc -I. -I/usr/lib/qt-3.3/include -L/usr/lib/qt-3.3/lib -lqt-mt -o pluginsizes pluginsizes.cpp

on an AMD64 in 32bit mode. Anyway, the point is that the plugin classes consume bugger all memory, so it should be fine to keep instances of them hanging around. Plugins should implement their functionality in a separate class rather than their Plugin derivative, so the class shouldn't bloat much when subclassed by plugins.

ringerc

2005-08-03 12:49

reporter   ~0005863

That header should also have an entry:

    QString authors;

in the AboutData struct.

jghali

2005-08-03 21:27

administrator   ~0005881

Well, this header seems a nice thing to start with. The DeferredTask management will have to be carefully done, you have understood it. But if you remove plugin unloading as it seems to be your intention, this should not be utterly difficult.

Btw, as the implementation of the new api seems imminent, I think I must explicit modifications I have done to the main application code to get plugins running in my test builds. Modifications involve adding in header of classes which should be exported another header which looks like this :

#ifndef SCRIBUS_API_H
#define SCRIBUS_API_H

#ifdef _WIN32
    #ifdef COMPILE_SCRIBUS_MAIN_APP
        #define SCRIBUS_API __declspec(dllexport)
    #else
        #ifdef COMPILE_PLUGIN_AS_DLL
            #define SCRIBUS_API __declspec(dllimport)
        #else
            #define SCRIBUS_API
        #endif
    #endif
#else
    #define SCRIBUS_API
#endif

#endif

As GCC 4.0 support a kind of __declspec(dllexport) now on *nix, this header can be tuned in case compilation is done with this compiler.

Exported class and methods should be then prefixed by the SCRIBUS_API macro :
class SCRIBUS_API PageItem
{
    ...
};
bool SCRIBUS_API doThatThing(void);

This allow to produce an import library at Scribus compilation, which allow then to link plugins on win32.

ringerc

2005-08-04 03:53

reporter   ~0005885

That makes sense. I've seen that technique used in other code. I'll add that macro to the header shortly, and document the usage of it in subclasses.

ringerc

2005-08-04 04:03

reporter   ~0005887

There's a 'scribusapi.h' in 1.3cvs now. Look about right to you?

ringerc

2005-08-04 04:07

reporter   ~0005888

Fixed scplugin.h to match.

ringerc

2005-08-04 04:07

reporter   ~0005889

Reminder sent to: avox

Adding you to the monitor list on this bug.

jghali

2005-08-04 07:05

administrator   ~0005891

Hello Craig, you should not have modified scplugin.h . SCRIBUS_API should not be used in scplugin.h. When compiling a dll plugin on win32, class exported from Scribus must be defined with __declspec(dllimport) and so COMPILE_PLUGIN_AS_DLL defined, but for the whole thing to work, exported symbol from plugins must use __declspec(dllexport).

So in fact a different header should be used in plugins (for ex pluginapi.h) :

#ifndef PLUGIN_API_H
#define PLUGIN_API_H

#ifdef _WIN32
    #ifdef COMPILE_PLUGIN_AS_DLL
        #define PLUGIN_API __declspec(dllexport)
    #else
        #define PLUGIN_API
    #endif
#else
    #define PLUGIN_API
#endif

#endif

ringerc

2005-08-04 07:33

reporter   ~0005892

I thought that's what COMPILE_SCRIBUS_MAIN_APP vs COMPILE_PLUGIN_AS_DLL was for - to use __dllspec(export) or __dllspec(import) depending on whether the header is being being used in a plugin or the main app.

The main app provides scplugin.h, including an implementation of the base classes. Plugins are expected to derive their own subclasses of that interface, if nothing else to fill the const members from their constructor, and most likely to implement setup/cleanup or run methods too.

As such, presumably the main app must export the basic plugin interface, and plugins must export their own implementations while importing the main plugin interface.

I don't suppose you know of an MSDN article on this that actually tells one something useful? I have the feeling I'm missing something about how this stuff works. On *nix it's just a non-issue, as we don't have import libraries or any distinction between importing and exporting symbols, so it's kind of confusing for me.

jghali

2005-08-04 09:00

administrator   ~0005894

>>>As such, presumably the main app must export the basic plugin interface, and plugins must export their own implementations while importing the main plugin interface.

In fact the main app should just now about scplugin.h and does not need to know the singlest detail about the plugin implementation. So base classes implementation should just be made available to plugin, some kind of sdk if you want. I've sent you a private mail with an example. You may also note that in this example, I haven't even exported the single symbol neither the base classes nor from their implementations.

In the example, however, the main app got some extern "C" exported methods to create and destroy instance of plugins, knows they derive from some classe, but that's all.

A tip also, symbol names are mangled when exported on win32, espacially classes symbols. This is not important as long as you don't need to know explicitly the symbol name. If you want to access specific symbols, the best options is to prefix needed symbol with extern "C". I don't know if you can this kind of thing :

extern "C"
{
 class PLUGIN_API myClass
 {

 };
}

If not, you should consider adding to plugins two simple extern "C" methods, one for creating plugin instance, the other one to destroy it for ex:
extern "C" ScPlugin* PLUGIN_API createInstance(void);
extern "C" void PLUGIN_API destroyInstance(ScPlugin** plugin);
This methods will have then to be implemented by each plugin. Once again, the main application should know as few as possible about plugin implementation details.

ringerc

2005-08-08 09:29

reporter   ~0005932

My issue with using pure virtual methods for everything is that there are several places where it makes sense to have plug-ins inherit a default behaviour from their parent class.

Without that, each class will have to use a bunch of boilerplate stubs, eg:

QWidget* newPrefsPanelWidget()
{
    return NULL
};

which is likely to get tiresome in a hurry, especially when adding a new facility to the plugin API.

Is there a strong reason not to have implementation in the plugin class? Does that mean there are issues with data members declared there too? (If so, I'm going to flip out completely I think - it's little better than dlopen()ing a bunch of 'extern C' symbols).

jghali

2005-08-08 09:37

administrator   ~0005933

>>>Is there a strong reason not to have implementation in the plugin class?

That was not what I was meaning. What I was meaning was that ideally the main application should know only about scplugin.h and nothing else.

ringerc

2005-08-08 09:46

reporter   ~0005934

OK, I understand.

That is what I intended all along. I must have misunderstood what you meant.

Actually, that's not quite true - a large part of the purpose of this work is to make it possible for the main application or more importantly other plugins to call APIs exported by specific plugins, by using their header and dynamic_cast<>ing the ScPlugin instance to an instance of that plugin. For example, it's going to be desirable to let the scripter call image export with various options for formats and resolutions. That only matters if code wants to be aware of the functionality of a specific other plugin, though, and isn't necessary for general use. The wiki has more on this.

In general, though, the main apps should only need to care about ScPlugin and scplugin.h, not the subclasses of it defined by plugin implementations.

ringerc

2005-09-06 17:29

reporter   ~0006428

The attached diff, plus the pluginmanagerprefsgui.{cpp,h} files, are the initial implementation of the new plugin API. At this point it's probably rather buggy, it's largely untested, and the docs need some tweaks. Still, it's largely done I think.

Posting here in case anyone has any comments, since this work won't be ready to check in for a few days yet at best. I still have a lot of plugins to convert :S and a bunch of testing to do.

ringerc

2005-09-06 19:07

reporter   ~0006431

Color wheel should now work. Things seem to be behaving alright so far.

ringerc

2005-09-07 14:53

reporter   ~0006450

Last edited: 2005-09-07 16:11

Now functionally complete. Known issues:
  - Untested on win32, Mac OS X (Mac OS X is pretty safe, win32 should be alright but may need a few tweaks)
  - Win32 may need different implementation of PluginManager::getPluginName (should be trivial)
  - Plugins that return output to the main app need testing
  - Plugins with action shortcuts print:

QAction::setAccel() (NewFromDocumentTemplate) requires widget in parent chain

    ... but work fine anyway. Need to identify why, but non critical.


[craig@wallace scribus]$ diffstat ~/patch/newpluginapi.diff
... long diffstat omitted ...
 57 files changed, 2065 insertions(+), 1976 deletions(-)

2005-09-07 16:12

 

newpluginapi.diff (274,390 bytes)   
? .story.cpp.swp
? pluginmanagerprefsgui.cpp
? pluginmanagerprefsgui.h
Index: Makefile.am
===================================================================
RCS file: /cvs/Scribus/scribus/Makefile.am,v
retrieving revision 1.37.2.88
diff -u -r1.37.2.88 Makefile.am
--- Makefile.am	7 Sep 2005 16:52:08 -0000	1.37.2.88
+++ Makefile.am	7 Sep 2005 16:52:59 -0000
@@ -125,6 +125,7 @@
 	picsearch.cpp	\
 	picstatus.cpp	\
 	pluginmanager.cpp	\
+	pluginmanagerprefsgui.cpp	\
 	polygonwidget.cpp	\
 	polyprops.cpp	\
 	prefscontext.cpp	\
Index: charselect.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/charselect.cpp,v
retrieving revision 1.1.2.27
diff -u -r1.1.2.27 charselect.cpp
--- charselect.cpp	25 Jul 2005 22:28:49 -0000	1.1.2.27
+++ charselect.cpp	7 Sep 2005 16:53:00 -0000
@@ -16,7 +16,6 @@
 #include "charselect.h"
 #include "charselect.moc"
 #include "scpainter.h"
-#include "pluginmanager.h"
 
 #include "scconfig.h"
 
@@ -175,15 +174,30 @@
 	} */
 }
 
-CharSelect::CharSelect( QWidget* parent, PageItem *item, ScribusApp *pl) : QDialog( parent, "CharSelect", true, 0 )
+CharSelect::CharSelect( QWidget* parent, PageItem *item) : QDialog( parent, "CharSelect", true, 0 )
+{
+	fontInUse = ScApp->doc->CurrFont;
+	needReturn = false;
+	run(parent, item, ScApp);
+}
+
+CharSelect::CharSelect( QWidget* parent, PageItem *item, QString font) : QDialog( parent, "CharSelect", true, 0 )
 {
-	QString font;
-	if (!pl->pluginManager->dllInput.isEmpty())
-		font = pl->pluginManager->dllInput;
-	else
-		font = pl->doc->CurrFont;
 	fontInUse = font;
-	setCaption( tr( "Select Character:" )+" "+font );
+	needReturn = true;
+	run(parent, item, ScApp);
+}
+
+
+const QString & CharSelect::getCharacters()
+{
+	return m_characters;
+}
+
+
+void CharSelect::run( QWidget* /*parent*/, PageItem *item, ScribusApp *pl)
+{
+	setCaption( tr( "Select Character:" )+" "+fontInUse );
 	ite = item;
 	ap = pl;
 	setIcon(loadIcon("AppIcon.png"));
@@ -201,7 +215,7 @@
 	fontSelector->setMaximumSize(190, 30);
 	fontSelector->setCurrentText(fontInUse);
 	selectionsLayout->addWidget( fontSelector );
-	if ((ap->doc->currentParaStyle > 4) ||  (!ap->pluginManager->dllInput.isEmpty()))
+	if ((ap->doc->currentParaStyle > 4) || needReturn)
 		fontSelector->setEnabled(false);
 	rangeLabel = new QLabel( this, "fontLabel" );
 	rangeLabel->setText( tr( "Character Class:" ) );
@@ -682,9 +696,9 @@
 
 void CharSelect::insChar()
 {
-	if (!ap->pluginManager->dllInput.isEmpty())
+	if (needReturn)
 	{
-		ap->pluginManager->dllReturn += chToIns;
+		m_characters = chToIns;
 		delEdit();
 		return;
 	}
Index: charselect.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/charselect.h,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 charselect.h
--- charselect.h	10 Aug 2005 07:14:56 -0000	1.1.2.4
+++ charselect.h	7 Sep 2005 16:53:00 -0000
@@ -35,8 +35,14 @@
 	Q_OBJECT
 
 public:
-	CharSelect( QWidget* parent, PageItem *item, ScribusApp *plug );
+	CharSelect(QWidget* parent, PageItem *item);
+	CharSelect(QWidget* parent, PageItem *item, QString font);
 	~CharSelect() {};
+
+	const QString & getCharacters();
+
+	bool needReturn;
+	QString m_characters;
 	void scanFont();
 	void setupRangeCombo();
 	void generatePreview(int charClass);
@@ -97,6 +103,8 @@
 	void insChar();
 
 protected:
+	void run(QWidget* parent, PageItem* item, ScribusApp* pl);
+	
 	QVBoxLayout* zAuswahlLayout;
 	QHBoxLayout* selectionsLayout;
 	QHBoxLayout* layout1;
@@ -131,4 +139,5 @@
 	virtual void contentsMouseReleaseEvent(QMouseEvent *m);
 	virtual void contentsMousePressEvent(QMouseEvent* e);
 };
+
 #endif // QUERY_H
Index: fileloader.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/fileloader.cpp,v
retrieving revision 1.1.2.136
diff -u -r1.1.2.136 fileloader.cpp
--- fileloader.cpp	7 Sep 2005 12:20:10 -0000	1.1.2.136
+++ fileloader.cpp	7 Sep 2005 16:53:02 -0000
@@ -39,9 +39,9 @@
 	prefsManager=PrefsManager::instance();
 	FileName = fileName;
 	FileType = -1;
-	havePS = app->pluginManager->DLLexists(6);
-	haveSVG = app->pluginManager->DLLexists(10);
-	haveSXD = app->pluginManager->DLLexists(12);
+	havePS = app->pluginManager->DLLexists("importps");
+	haveSVG = app->pluginManager->DLLexists("svgimplugin");
+	haveSXD = app->pluginManager->DLLexists("oodrawimp");
 }
 
 /*!
@@ -306,19 +306,13 @@
 			ret = ReadDoc(app, FileName, prefsManager->appPrefs.AvailFonts, app->doc, app->view, app->mainWindowProgressBar);
 			break;
 		case 2:
-			app->pluginManager->dllInput = FileName;
-			app->pluginManager->callDLL( 6 );
-			ret = true;
+			ret = app->pluginManager->callImportExportPlugin("importps", FileName);
 			break;
 		case 3:
-			app->pluginManager->dllInput = FileName;
-			app->pluginManager->callDLL( 10 );
-			ret = true;
+			ret = app->pluginManager->callImportExportPlugin("svgimplugin", FileName);
 			break;
 		case 5:
-			app->pluginManager->dllInput = FileName;
-			app->pluginManager->callDLL( 12 );
-			ret = true;
+			ret = app->pluginManager->callImportExportPlugin("oodrawimp", FileName);
 			break;
 		default:
 			ret = false;
@@ -456,7 +450,6 @@
 			ReplacedFonts.clear();
 		dummyFois.clear();
 	}
-	app->pluginManager->dllInput = "";
 	return ret;
 }
 
Index: newfile.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/newfile.cpp,v
retrieving revision 1.26.2.35
diff -u -r1.26.2.35 newfile.cpp
--- newfile.cpp	1 Sep 2005 21:08:32 -0000	1.26.2.35
+++ newfile.cpp	7 Sep 2005 16:53:02 -0000
@@ -263,16 +263,7 @@
 #else
 	formats += tr("Documents (*.sla *.scd);;");
 #endif
-	if (ScApp->pluginManager->DLLexists(6))
-		formats += tr("PostScript Files (*.eps *.EPS *.ps *.PS);;");
-	if (ScApp->pluginManager->DLLexists(10))
-#ifdef HAVE_LIBZ
-		formats += tr("SVG Images (*.svg *.svgz);;");
-#else
-		formats += tr("SVG Images (*.svg);;");
-#endif
-	if (ScApp->pluginManager->DLLexists(12))
-		formats += tr("OpenOffice.org Draw (*.sxd);;");
+	formats += ScApp->pluginManager->getImportFilterString();
 	formats += tr("All Files (*)");
 	openDocFrame = new QFrame(this, "openDocFrame");
 	QVBoxLayout* openDocLayout = new QVBoxLayout(openDocFrame, 5,5, "openDocLayout");
Index: pluginmanager.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/pluginmanager.cpp,v
retrieving revision 1.1.2.22
diff -u -r1.1.2.22 pluginmanager.cpp
--- pluginmanager.cpp	5 Sep 2005 22:44:58 -0000	1.1.2.22
+++ pluginmanager.cpp	7 Sep 2005 16:53:03 -0000
@@ -1,5 +1,6 @@
 #include "pluginmanager.h"
 #include "pluginmanager.moc"
+#include "scplugin.h"
 
 #include <qdir.h>
 
@@ -27,12 +28,10 @@
 extern ScribusApp *ScApp;
 extern ScribusQApp *ScQApp;
 
-
-PluginManager::PluginManager()
+PluginManager::PluginManager() :
+	QObject(0),
+	prefs(PrefsManager::instance()->prefsFile->getPluginContext("pluginmanager"))
 {
-	dllInput = "";
-	dllReturn = "";
-	prefs = PrefsManager::instance()->prefsFile->getPluginContext("pluginmanager");
 }
 
 PluginManager::~PluginManager()
@@ -106,16 +105,37 @@
 void PluginManager::savePreferences()
 {
 	// write configuration
-	for (QMap<int, PluginData>::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
-		prefs->set(it.data().pluginFile, it.data().loadPlugin);
+	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
+		prefs->set(it.data().pluginName, it.data().enableOnStartup);
+}
+
+QCString PluginManager::getPluginName(QString fileName)
+{
+	// Must return plug-in name. Note that this may be platform dependent;
+	// it's likely to need some adjustment for platform naming schemes.
+	// It currently handles:
+	//    (lib)?pluginname(\.pluginext)?
+	QFileInfo fi(fileName);
+	QString baseName(fi.baseName());
+	if (baseName.startsWith("lib"))
+		baseName = baseName.remove(0,3);
+	if (baseName.endsWith(platformDllExtension()))
+		baseName = baseName.left(baseName.length() - 1 - platformDllExtension().length());
+	// check name
+	for (int i = 0; i < (int)baseName.length(); i++)
+		if (! baseName[i].isLetterOrNumber() && baseName[i] != '_' )
+		{
+			qDebug("Invalid character in plugin name for %s; skipping",
+					fileName.local8Bit().data());
+			return QCString();
+		}
+	return baseName.latin1();
 }
 
 void PluginManager::initPlugs()
 {
-	QString name = "";
-	int id = 0;
-	struct PluginData pda;
-	QString libPattern = QString("*.%1*").arg(PluginManager::platformDllExtension());
+	Q_ASSERT(!pluginMap.count());
+	QString libPattern = QString("*.%1*").arg(platformDllExtension());
 
 	QDir dirList(ScPaths::instance().pluginDir(),
 				 libPattern, QDir::Name,
@@ -126,318 +146,203 @@
 		ScApp->scrMenuMgr->addMenuSeparator("Extras");
 		for (uint dc = 0; dc < dirList.count(); ++dc)
 		{
-			pda.index = 0;
-			pda.pluginFile = "";
-			pda.menuID = 0;
-			pda.pluginFile = dirList[dc];
-			pda.loadPlugin = prefs->getBool(dirList[dc], true);
-
-			if (DLLname(dirList[dc], &pda.name, &pda.type, &pda.index, &id, &pda.actName, &pda.actKeySequence, &pda.actMenu, &pda.actMenuAfterName, &pda.actEnabledOnStartup, pda.loadPlugin))
+			PluginData pda;
+			pda.pluginFile = QString("%1/%2").arg(ScPaths::instance().pluginDir()).arg(dirList[dc]);
+			pda.pluginName = getPluginName(pda.pluginFile);
+			if (pda.pluginName.isNull())
+				// Couldn't determine plugname from filename. We've already complained, so
+				// move on to the next one.
+				continue;
+			pda.plugin = 0;
+			pda.pluginDLL = 0;
+			pda.enabled = false;
+			pda.enableOnStartup = prefs->getBool(pda.pluginName, true);
+			if (ScApp->splashScreen != NULL)
+				ScApp->splashScreen->setStatus(
+						tr("Plugin: loading %1", "plugin manager").arg(pda.pluginName));
+			if (loadPlugin(pda))
 			{
-				pda.actMenuText=pda.name;
-				if (ScApp->splashScreen != NULL)
-					ScApp->splashScreen->setStatus( tr("Loading: %1", "plugin manager").arg(pda.name));
-				if (pda.loadPlugin)
-				{
-					if (pda.type == Persistent || pda.type == Standard || pda.type == Import)
-					{
-						//Add in ScrAction based plugin linkage
-						//Insert DLL Action into Dictionary with values from plugin interface
-						ScApp->scrActions.insert(pda.actName, new ScrAction(ScrAction::DLL, QIconSet(), pda.name, QKeySequence(pda.actKeySequence), ScApp, pda.actName, id));
-
-						if (ScApp->scrActions[pda.actName])
-						{
-							ScApp->scrActions[pda.actName]->setEnabled(pda.actEnabledOnStartup);
-							//Connect DLL Action's activated signal with ID to Scribus DLL loader
-							connect( ScApp->scrActions[pda.actName], SIGNAL(activatedData(int)) , ScApp->pluginManager, SLOT(callDLLBySlot(int)) );
-							//Get the menu manager to add the DLL's menu item to the right menu, after the chosen existing item
-							if (pda.actMenuAfterName.isEmpty())
-								ScApp->scrMenuMgr->addMenuItem(ScApp->scrActions[pda.actName], pda.actMenu);
-							else
-								ScApp->scrMenuMgr->addMenuItemAfter(ScApp->scrActions[pda.actName], pda.actMenu, pda.actMenuAfterName);
-						}
-					}
-					else
-						qDebug( tr(QString("Old type plugins are not supported anymore")), "plugin manager");
-					pda.loaded = true;
-				} // load
-				else
-					pda.loaded = false;
-				pluginMap.insert(id, pda);
+				if (pda.enableOnStartup)
+					enablePlugin(pda);
+				pluginMap.insert(pda.pluginName, pda);
 			}
 		}
 	}
 }
 
-void PluginManager::callDLLBySlot(int pluginID)
-{
-	//Run old type 2 Import pre call code
-	if (pluginMap[pluginID].type == 7)
-	{
-		if (ScApp->HaveDoc)
-			ScApp->doc->OpenNodes = ScApp->outlinePalette->buildReopenVals();
+// After a plug-in has been initialized, this method calls its setup
+// routines and connects it to the application.
+void PluginManager::enablePlugin(PluginData & pda)
+{
+	Q_ASSERT(pda.enabled == false);
+	QString failReason;
+	if (pda.plugin->inherits("ScActionPlugin"))
+	{
+		ScActionPlugin* plugin = dynamic_cast<ScActionPlugin*>(pda.plugin);
+		Q_ASSERT(plugin);
+		pda.enabled = setupPluginActions(plugin);
+		if (!pda.enabled)
+			failReason = tr("init failed", "plugin load error");
+	}
+	else if (pda.plugin->inherits("ScPersistentPlugin"))
+	{
+		ScPersistentPlugin* plugin = dynamic_cast<ScPersistentPlugin*>(pda.plugin);
+		Q_ASSERT(plugin);
+		pda.enabled = plugin->initPlugin();
+		if (!pda.enabled)
+			failReason = tr("init failed", "plugin load error");
 	}
-
-	callDLL(pluginID);
-
-	//Run old type 2 Import post call code
-	if (pluginMap[pluginID].type == 7)
+	else
+		failReason = tr("unknown plugin type", "plugin load error");
+	if (ScApp->splashScreen != NULL)
 	{
-		if (ScApp->HaveDoc)
-		{
-			ScApp->outlinePalette->BuildTree(ScApp->doc);
-			ScApp->outlinePalette->reopenTree(ScApp->doc->OpenNodes);
-			ScApp->propertiesPalette->updateCList();
-		}
+		if (pda.enabled)
+			ScApp->splashScreen->setStatus(
+					tr("Plugin: %1 loaded", "plugin manager")
+					.arg(pda.plugin->fullTrName()));
+		else
+			ScApp->splashScreen->setStatus(
+					tr("Plugin: %1 failed to load: %2", "plugin manager")
+					.arg(pda.plugin->fullTrName()).arg(failReason));
 	}
 }
 
-void PluginManager::callDLL(int pluginID)
-{
-	void *mo;
-	struct PluginData pda;
-	pda = pluginMap[pluginID];
-	typedef void (*sdem)(QWidget *d, ScribusApp *plug);
-	sdem demo;
-	QString plugDir = ScPaths::instance().pluginDir();
-	if (pda.type != 4 && pda.type !=5)
-	{
-		plugDir += pda.pluginFile;
-		mo = loadDLL(plugDir);
-		if (!mo) return;
-	}
+bool PluginManager::setupPluginActions(ScActionPlugin* plugin)
+{
+	bool result = true;
+	//Add in ScrAction based plugin linkage
+	//Insert DLL Action into Dictionary with values from plugin interface
+	ScActionPlugin::ActionInfo ai(plugin->actionInfo());
+	ScrAction* action = new ScrAction(
+			ScrAction::DLL, ai.iconSet, ai.text, QKeySequence(ai.keySequence),
+			plugin, ai.name);
+	Q_CHECK_PTR(action);
+	ScApp->scrActions.insert(ai.name, action);
+
+	// then enable and connect up the action
+	ScApp->scrActions[ai.name]->setEnabled(ai.enabledOnStartup);
+	// Connect action's activated signal with the plugin's run method
+	result = connect( ScApp->scrActions[ai.name], SIGNAL(activated()),
+					  plugin, SLOT(run()) );
+	//Get the menu manager to add the DLL's menu item to the right menu, after the chosen existing item
+	if ( ai.menuAfterName.isEmpty() )
+		ScApp->scrMenuMgr->addMenuItem(ScApp->scrActions[ai.name], ai.menu);
 	else
-		mo = pda.index;
-
-	demo = (sdem) resolveSym(mo, "run");
-	if ( !demo )
-	{
-		unloadDLL(mo);
-		return;
-	}
-	(*demo)(ScApp, ScApp);
-	// FIXME: how is the menu organized? (*demo)(ScApp->scrActions[pluginMap[pluginID].actName], ScApp);
-	if (pda.type != 4 && pda.type != 5)
-		unloadDLL(mo);
-	if (ScApp->HaveDoc)
-		ScApp->view->DrawNew();
-}
-
-QString PluginManager::callDLLForNewLanguage(int pluginID)
-{
-	void *mo;
-	bool unload = false;
-	struct PluginData pda;
-	pda = pluginMap[pluginID];
-	typedef QString (*sdem)();
-	typedef void (*sdem0)();
-	sdem demo;
-	sdem0 demo0;
-	QString plugDir = ScPaths::instance().pluginDir();
-	if (pda.type != 4 && pda.type !=5)
-	{
-		plugDir += pda.pluginFile;
-		mo = loadDLL(plugDir);
-		if (!mo)
-			return QString::null;
-		unload = true;
-	}
-	else
-		mo = pda.index;
-
-	// Grab the menu string from the plugin again
-	demo = (sdem) resolveSym(mo, "name");
-	if ( !demo )
-	{
-		if(unload) unloadDLL(mo);
-		return QString::null;
-	}
-	QString retVal= (*demo)();	
-	//If scripter, get it to update its scrActions.
-	if (pluginID==8)
-	{
-		demo0 = (sdem0) resolveSym(mo, "languageChange");
-		if ( !demo0 )
-		{
-			if(unload) unloadDLL(mo);
-			return QString::null;
-		}
-		(*demo0)();
-	}
+		ScApp->scrMenuMgr->addMenuItemAfter(ScApp->scrActions[ai.name], ai.menu, ai.menuAfterName);
 
-	if (pda.type != 4 && pda.type != 5)
-		unloadDLL(mo);
-	return retVal;
+	return result;
 }
 
-bool PluginManager::DLLexists(int pluginID)
+bool PluginManager::DLLexists(QCString name, bool includeDisabled) const
 {
-	return pluginMap.contains(pluginID);
+	// the plugin name must be known
+	if (pluginMap.contains(name))
+		// the plugin must be loaded
+		if (pluginMap[name].plugin)
+			// and the plugin must be enabled
+			if (pluginMap[name].enabled || includeDisabled)
+				return true;
+	return false;
 }
 
-// used anywhere?
-void PluginManager::callDLLbyMenu(int pluginID)
+bool PluginManager::loadPlugin(PluginData & pda)
 {
-	QMap<int, PluginData>::Iterator it;
-	struct PluginData pda;
-	for (it = pluginMap.begin(); it != pluginMap.end(); ++it)
-	{
-		if (it.data().menuID == pluginID)
-		{
-			callDLL(it.key());
-			break;
-		}
-	}
-}
+	typedef int (*getPluginAPIVersionPtr)();
+	typedef ScPlugin* (*getPluginPtr)();
+	getPluginAPIVersionPtr getPluginAPIVersion;
+	getPluginPtr getPlugin;
 
-bool PluginManager::DLLname(QString name, QString *pluginName, PluginType *type, void **index, int *idNr, QString *actName, QString *actKeySequence, QString *actMenu, QString *actMenuAfterName, bool *actEnabledOnStartup, bool loadPlugin)
-{
-	void *mo;
-	typedef QString (*sdem0)();
-	typedef PluginType (*sdem1)();
-	typedef void (*sdem2)(QWidget *d, ScribusApp *plug);
-	typedef bool (*sdem3)();
-	typedef int (*sdemID)();
-	sdem0 demo;
-	sdem1 demo1;
-	sdem2 demo2;
-	sdem3 demo3;
-	sdemID plugID;
-	QString plugName = ScPaths::instance().pluginDir();
-	plugName += name;
+	Q_ASSERT(pda.plugin == 0);
+	Q_ASSERT(pda.pluginDLL == 0);
+	Q_ASSERT(!pda.enabled);
+	pda.plugin = 0;
 
-	mo = loadDLL(plugName);
-	if (!mo)
-	{
+	pda.pluginDLL = loadDLL(pda.pluginFile);
+	if (!pda.pluginDLL)
 		return false;
-	}
 
-	demo = (sdem0) resolveSym(mo, "name");
-	if ( !demo )
-	{
-		unloadDLL(mo);
-		return false;
-	}
-	*pluginName = (*demo)();
-	demo1 = (sdem1) resolveSym(mo, "type");
-	if ( !demo1 )
+	getPluginAPIVersion = (getPluginAPIVersionPtr)
+		resolveSym(pda.pluginDLL, pda.pluginName + "_getPluginAPIVersion");
+	if (getPluginAPIVersion)
 	{
-		unloadDLL(mo);
-		return false;
-	}
-	*type = (*demo1)();
-	*index = mo;
-	plugID = (sdemID) resolveSym(mo, "ID");
-	if ( !plugID)
-	{
-		unloadDLL(mo);
-		return false;
-	}
-	*idNr = (*plugID)();
-	//ScrAction based plugins
-	if (*type == Persistent || *type == Standard || *type == Import)
-	{
-		demo = (sdem0) resolveSym(mo, "actionName");
-		if ( !demo )
-		{
-			unloadDLL(mo);
-			return false;
-		}
-		*actName = (*demo)();
-		demo = (sdem0) resolveSym(mo, "actionKeySequence");
-		if ( !demo )
+		int gotVersion = (*getPluginAPIVersion)();
+		if ( gotVersion != PLUGIN_API_VERSION )
 		{
-			unloadDLL(mo);
-			return false;
+			qDebug("API version mismatch when loading %s: Got %i, expected %i",
+					pda.pluginFile.local8Bit().data(), gotVersion, PLUGIN_API_VERSION);
 		}
-		*actKeySequence = (*demo)();
-		demo = (sdem0) resolveSym(mo, "actionMenu");
-		if ( !demo )
+		else
 		{
-			unloadDLL(mo);
-			return false;
-		}
-		*actMenu = (*demo)();
-		demo = (sdem0) resolveSym(mo, "actionMenuAfterName");
-		if ( !demo )
-		{
-			unloadDLL(mo);
-			return false;
-		}
-		*actMenuAfterName = (*demo)();
-		demo3 = (sdem3) resolveSym(mo, "actionEnabledOnStartup");
-		if ( !demo3 )
-		{
-			unloadDLL(mo);
-			return false;
-		}
-		*actEnabledOnStartup = (*demo3)();
-	}
-	else
-	{
-		*actName = QString::null;
-		*actKeySequence = QString::null;
-		*actMenu = QString::null;
-		*actMenuAfterName = QString::null;
-		*actEnabledOnStartup = false;
-	}
-	if (*type != Persistent && *type!= Type5)
-		unloadDLL(mo);
-	else
-	{
-		if (loadPlugin)
-		{
-			demo2 = (sdem2) resolveSym(mo, "initPlug");
-			if ( !demo2)
+			getPlugin = (getPluginPtr)
+				resolveSym(pda.pluginDLL, pda.pluginName + "_getPlugin");
+			if (getPlugin)
 			{
-				unloadDLL(mo);
-				return false;
+				pda.plugin = (*getPlugin)();
+				if (!pda.plugin)
+				{
+					qDebug("Unable to get ScPlugin when loading %s",
+							pda.pluginFile.local8Bit().data());
+				}
+				else
+					return true;
 			}
-			(*demo2)(ScApp, ScApp);
 		}
 	}
-
-	return true;
+	unloadDLL(pda.pluginDLL);
+	pda.pluginDLL = 0;
+	Q_ASSERT(!pda.plugin);
+	return false;
 }
 
-void PluginManager::finalizePlugs()
+void PluginManager::cleanupPlugins()
 {
-	for (QMap<int, PluginData>::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
-		if (it.data().loaded == true)
-			finalizePlug(it.key());
+	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
+		if (it.data().enabled == true)
+			finalizePlug(it.data());
 }
 
-void PluginManager::finalizePlug(int pluginID)
+void PluginManager::finalizePlug(PluginData & pda)
 {
-	struct PluginData pda;
-	typedef void (*sdem2)();
-	sdem2 demo2;
-	PluginData plug = pluginMap[pluginID];
-	if (plug.type == Persistent || plug.type == Type5)
+	typedef void (*freePluginPtr)(ScPlugin* plugin);
+	if (pda.plugin)
+	{
+		if (pda.enabled)
+			disablePlugin(pda);
+		Q_ASSERT(!pda.enabled);
+		freePluginPtr freePlugin =
+			(freePluginPtr) resolveSym(pda.pluginDLL, pda.pluginName + "_freePlugin");
+		if ( freePlugin )
+			(*freePlugin)( pda.plugin );
+		pda.plugin = 0;
+	}
+	Q_ASSERT(!pda.enabled);
+	if (pda.pluginDLL)
 	{
-		demo2 = (sdem2) resolveSym(plug.index, "cleanUpPlug");
-		if ( demo2 )
-			(*demo2)();
-		unloadDLL(plug.index);
+		unloadDLL(pda.pluginDLL);
+		pda.pluginDLL = 0;
 	}
 }
 
-QString PluginManager::getPluginType(PluginType aType)
+void PluginManager::disablePlugin(PluginData & pda)
 {
-	switch(aType)
+	Q_ASSERT(pda.enabled);
+	Q_ASSERT(pda.plugin);
+	if (pda.plugin->inherits("ScActionPlugin"))
+	{
+		ScActionPlugin* plugin = dynamic_cast<ScActionPlugin*>(pda.plugin);
+		Q_ASSERT(plugin);
+		// FIXME: Correct way to delete action?
+		delete ScApp->scrActions[plugin->actionInfo().name];
+	}
+	else if (pda.plugin->inherits("ScPersistentPlugin"))
 	{
-		case Persistent:
-			return tr("Persistent", "plugin manager");
-			break;
-		case Import:
-			return tr("Import", "plugin manager");
-			break;
-		case Standard:
-			return tr("Standard", "plugin manager");
-			break;
-		default:
-			return tr("Unknown", "plugin manager");
+		ScPersistentPlugin* plugin = dynamic_cast<ScPersistentPlugin*>(pda.plugin);
+		Q_ASSERT(plugin);
+		plugin->cleanupPlugin();
 	}
+	else
+		Q_ASSERT(false); // We shouldn't ever have enabled an unknown plugin type.
+	pda.enabled = false;
 }
 
 QCString PluginManager::platformDllExtension()
@@ -465,13 +370,99 @@
 
 void PluginManager::languageChange()
 {
-	for (QMap<int, PluginData>::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
+	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
 	{
-		QString fromTranslator=callDLLForNewLanguage(it.key());
-		ScrAction* pluginAction=ScApp->scrActions[(*it).actName];
-		if (!fromTranslator.isNull())
-			(*it).name=fromTranslator;
-		if (pluginAction!=NULL)
-			pluginAction->setMenuText(fromTranslator);
+		ScPlugin* plugin = it.data().plugin;
+		if (plugin)
+		{
+			plugin->languageChange();
+			ScActionPlugin* ixplug = dynamic_cast<ScActionPlugin*>(plugin);
+			if (ixplug)
+			{
+				ScActionPlugin::ActionInfo ai(ixplug->actionInfo());
+				ScrAction* pluginAction = ScApp->scrActions[ai.name];
+				if (pluginAction != 0)
+					pluginAction->setMenuText( ai.text );
+			}
+		}
 	}
 }
+
+ScPlugin* PluginManager::getPlugin(const QCString pluginName, bool includeDisabled) const
+{
+	if (DLLexists(pluginName, includeDisabled))
+		return pluginMap[pluginName].plugin;
+	return 0;
+}
+
+// Compatability kludge
+bool PluginManager::callImportExportPlugin(const QCString pluginName, const QString & arg, QString & retval)
+{
+	if (callImportExportPlugin(pluginName, arg))
+	{
+		retval = dynamic_cast<ScActionPlugin*>(pluginMap[pluginName].plugin)->runResult();
+		return true;
+	}
+	return false;
+}
+
+bool PluginManager::callImportExportPlugin(const QCString pluginName, const QString & arg)
+{
+	bool result = false;
+	if (DLLexists(pluginName))
+	{
+		ScActionPlugin* plugin =
+			dynamic_cast<ScActionPlugin*>(pluginMap[pluginName].plugin);
+		if (plugin)
+			result = plugin->run(arg);
+	}
+	return result;
+}
+
+PluginManager & PluginManager::instance()
+{
+	return (*ScApp->pluginManager);
+}
+
+const QString & PluginManager::getPluginPath(const QCString pluginName) const
+{
+	// It is not legal to call this function without a valid
+	// plug in name.
+	Q_ASSERT(pluginMap.contains(pluginName));
+	return pluginMap[pluginName].pluginFile;
+}
+
+bool & PluginManager::enableOnStartup(const QCString pluginName)
+{
+	// It is not legal to call this function without a valid
+	// plug in name.
+	Q_ASSERT(pluginMap.contains(pluginName));
+	return pluginMap[pluginName].enableOnStartup;
+}
+
+QValueList<QCString> PluginManager::pluginNames(bool includeNotLoaded) const
+{
+	QValueList<QCString> names;
+	for (PluginMap::ConstIterator it = pluginMap.constBegin(); it != pluginMap.constEnd(); ++it)
+		if (includeNotLoaded || it.data().plugin != 0)
+			names.append(it.data().pluginName);
+	return names;
+}
+
+// FIXME: Temporary hack ... need a better mechanism to look up plug-ins that
+// support various formats.
+const QString PluginManager::getImportFilterString() const
+{
+	QString formats;
+	if (ScApp->pluginManager->DLLexists("importps"))
+		formats += tr("PostScript Files (*.eps *.EPS *.ps *.PS);;");
+	if (ScApp->pluginManager->DLLexists("svgimplugin"))
+#ifdef HAVE_LIBZ
+		formats += tr("SVG Images (*.svg *.svgz);;");
+#else
+		formats += tr("SVG Images (*.svg);;");
+#endif
+	if (ScApp->pluginManager->DLLexists("oodrawimp"))
+		formats += tr("OpenOffice.org Draw (*.sxd);;");
+	return formats;
+}
Index: pluginmanager.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/pluginmanager.h,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 pluginmanager.h
--- pluginmanager.h	10 Aug 2005 07:14:56 -0000	1.1.2.12
+++ pluginmanager.h	7 Sep 2005 16:53:03 -0000
@@ -18,6 +18,22 @@
  *
  */
 
+class ScPlugin;
+class ScActionPlugin;
+class ScPersistentPlugin;
+
+// Plug-in API version used to check if we can load the plug-in. This
+// does *NOT* ensure that the plug-in will be compatible with the internal
+// Scribus APIs, only that the ScPlugin class and its standard subclasses
+// will be compatible with what we expect, and that "extern C" functions
+// we need will be present and work as expected. It's a preprocessor directive
+// to make sure that it's compiled into each plugin rather than referenced
+// from the main code.
+//
+// The API version is currently simply incremented with each incompatible
+// change. Future versions may introduce a minor/major scheme if necessary.
+#define PLUGIN_API_VERSION 0x00000001
+
 class SCRIBUS_API PluginManager : public QObject
 {
 
@@ -25,113 +41,159 @@
 
 public:
 
-	/** \brief Human readable enumertion of the plugin types */
-	// FIXME: what the hell is type5?
-	enum PluginType {
-		Persistent = 4,
-		Import = 7,
-		Standard = 6,
-		Type5 = 5
-	};
-
 	/**
-	 * \brief PluginData is structure for plugin related informations.
 	 * \param pluginFile path to the share library (with name).
-	 * \param name a string which will be shown at menu
-	 * \param index black magic? FIXME
-	 * \param type PluginType element
-	 * \param menuID id for menu system
-	 * \param actName name of the action for this plugin
-	 * \param actKeySequence menu GUI key combination
-	 * \param actMenu first level menu
-	 * \param actMenuAfterName 2nd level menu
-	 * \param actEnabledOnStartup run it at start FIXME
-	 * \param loadPlugin enable or disable plugin for user
-	 * \param loaded is the plug really loaded?
+	 * \brief pluginName internal name of plug-in, used for prefix to dlsym() names
+	 * \param pluginDLL reference to plug-in data for dynamic loading
+	 * \brief PluginData is structure for plugin related informations.
+	 * \param plugin is the pointer to the plugin instance
+	 * \param setupEnable enable or disable plugin for user
+	 * \param enabled has the plug-in been set up and activated?
+	 *
+	 * Note that there are some constraints on this structure.
+	 * enabled == true depends on:
+	 *     plugin != 0 which depends on:
+	 *         pluginDLL != 0
+	 *
+	 * In other words, a plugin cannot be enabled unless we have an ScPlugin
+	 * instance for it. We can't have an ScPlugin instance for a plugin unless
+	 * it's linked.
 	 */
 
 	struct PluginData
 	{
-		QString pluginFile;// Datei;
-		QString name;
-		void *index; //Zeiger;
-		PluginType type;
-		int menuID;
-		QString actName;
-		QString actMenuText;
-		QString actKeySequence;
-		QString actMenu;
-		QString actMenuAfterName;
-		bool actEnabledOnStartup;
-		bool loadPlugin;
-		bool loaded;
+		QString pluginFile; // Datei;
+		QCString pluginName;
+		void* pluginDLL;
+		ScPlugin* plugin;
+		bool enableOnStartup;
+		bool enabled;
 	};
 
+	// Mapping of plugin names to plugin info structures.
+	typedef QMap<QCString,PluginData> PluginMap;
+
 	PluginManager();
 	~PluginManager();
 
 	// Static methods for loading, unloading plugins and resolving symbols
-	// These methods are plateform independent but implemented in a plateform dependent way
+	// These methods are platform independent, but each platform uses a different
+	// implementation.
 	static void* loadDLL( QString plugin );
 	static void* resolveSym( void* plugin, const char* sym );
 	static void  unloadDLL( void* plugin );
 
-	/*! \brief Ininitalization of all plugins. It's called at scribus start. */
+	/*! \brief Ininitalization of all plugins. It's called at scribus start.
+	 * 
+	 * This method loadDLL(...)'s each plug-in, creates a Plugin instance for
+	 * them, stores a PluginData for the plugin, sets up the plug-in's
+	 * actions, and connects them to any required signals.
+	 * It doesn't ask plug-ins to do any time-consuming setup.
+	 */
 	void initPlugs();
 
-	/*! \brief Run plugin by its id from pluginMap */
-	void callDLL(int pluginID);
-
-	/*! \brief Runs plugin's languageChange() method, and returns main menu item text if one exists */	
-	QString callDLLForNewLanguage(int pluginID);
-
-	/*! \brief Checks if is the plug in plugin map.
+	// Return a list of import filters, in the form used by a QFileDialog
+	// or similar, for all supported plug-in imported formats.
+	const QString getImportFilterString() const;
+
+	/*! \brief Checks if is the plugin is in the plugin map, is loaded, and is enabled.
+	 *
+	 * \param pluginName name of plugin to get
+	 * \param includeDisabled return true if a plugin is loaded but not enabled
 	 * \return bool
 	 */
-	bool DLLexists(int pluginID);
+	bool DLLexists(QCString pluginName, bool includeDisabled = false) const;
 
-	/*! unused/obsolete */
-	void callDLLbyMenu(int pluginID);
+	/*! \brief Returns a pointer to the requested plugin, or
+	 *         0 if not found. */
+	ScPlugin* getPlugin(QCString pluginName, bool includeDisabled) const;
 
 	/*! \brief Reads available info and fills PluginData structure */
-	bool DLLname(QString name, QString *pluginName, PluginType *type, void **index, int *idNr, QString *actName, QString *actKeySequence, QString *actMenu, QString *actMenuAfterName, bool *actEnabledOnStartup, bool loadPlugin);
+	bool loadPlugin(PluginData & pluginData);
 
 	/*! \brief Shutdowns all plugins. Called at scribus quit */
-	void finalizePlugs();
-
-	/*! \brief Shutdowns one plugin.
-	 * \param pluginID key from the pluginMap. Plugin identifier
-	 */
+	void cleanupPlugins();
 
-	void finalizePlug(int pluginID);
-	/** \brief Returns human readable plugin type */
-	QString getPluginType(PluginType aType);
-	/** \brief Saves plugin preferences */
+	/** \brief Saves pluginManager preferences */
 	void savePreferences();
 
-	/*! \brief Input variable to the plug. */
-	QString dllInput;
-	/*! \brief Returning variable from the plug. */
-	QString dllReturn;
-
-	/*! \brief Plugin mapping.
-	 * Each plugin has its record key() -> PluginData */
-	QMap<int, PluginData> pluginMap;
-
 	/*! \brief Return file extension used for shared libs on this platform */
 	static QCString platformDllExtension();
 
+	/*! \brief Call the named plugin with "arg" and return true for success.
+	 *
+	 * Note that failure might be caused by the plug-in being unknown,
+	 * the plug-in not being loaded, the plug-in not being enabled, or
+	 * by by failure of the call its self.
+	 *
+	 * This is a bit of a compatability kludge.
+	 */
+	bool callImportExportPlugin(const QCString pluginName, const QString & arg);
+
+	/*! \brief  Call the named plugin with "arg" and return true for success, storing the return string in retval
+	 *
+	 * This is a lot of a compatibility kludge. Avoid using it in new code, you should probably
+	 * prefer to dynamic_cast<> to the plugin class and call a plugin specific method.
+	 */
+	bool callImportExportPlugin(const QCString pluginName, const QString & arg, QString & retval);
+
+	/// Return a pointer to this instance.
+	//
+	// Note: for now, returns a reference to (*ScApp->pluginManager); should
+	// probably be turned into a singleton later.
+	static PluginManager & instance();
+
+	// Return the path to the file for the named plugin. An invalid
+	// plugin name is an error.
+	const QString & getPluginPath(const QCString pluginName) const;
+
+	// Whether the given plug-in will be enabled on start-up.
+	// Usable as an lvalue. An invalid plugin name is an error.
+	bool & enableOnStartup(const QCString pluginName);
+
+	// Return a list of plugin names currently known. If includeNotLoaded
+	// is true, names are returned for plug-ins that are not loaded
+	// (ie we have no ScPlugin instance for them).
+	QValueList<QCString> pluginNames(bool includeNotLoaded = false) const;
+
 public slots:
 
-	/*! not at all obsolete! */
-	void callDLLBySlot(int pluginID);
 	void languageChange();
 
-private:
+protected:
+
+	// Determines the plugin name from the file name and returns it.
+	static QCString getPluginName(QString fileName);
+
+	// Called by loadPlugin to hook the loaded plugin into the GUI,
+	// call its setup routine, etc. Not responsible for creating
+	// the ScPlugin instance or loading the plugin.
+	void enablePlugin(PluginData &);
+
+	// Called by finalizePlug when shutting down a plug-in. Unhooks
+	// the plug-in from the GUI, calls its cleanup routine, etc.
+	// DOES NOT destroy the ScPlugin instance or unload the plugin.
+	void disablePlugin(PluginData & pda);
+
+	// Called by enablePlugin to hook the loaded plugin into the GUI.
+	bool setupPluginActions(ScActionPlugin*);
+
+	/*! \brief Runs plugin's languageChange() method, and returns main menu item text if one exists */	
+	QString callDLLForNewLanguage(const PluginData & pluginData);
+
+	/*! \brief Shuts down one plug-in. The DLL may not be unloaded, but
+	 *         it is cleaned up and its ScPlugin instance is destroyed.
+	 *         The plug-in is marked unloaded in the map.
+	 *  \param pluginID key from the pluginMap. Plugin identifier
+	 */
+	void finalizePlug(PluginData & pda);
 
 	/** \brief Configuration structure */
 	PrefsContext* prefs;
 
+	/*! \brief Plugin mapping.
+	 * Each plugin has its record key() -> PluginData */
+	PluginMap pluginMap;
 };
 
 #endif
Index: prefs.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/prefs.cpp,v
retrieving revision 1.1.2.49
diff -u -r1.1.2.49 prefs.cpp
--- prefs.cpp	1 Sep 2005 21:08:32 -0000	1.1.2.49
+++ prefs.cpp	7 Sep 2005 16:53:04 -0000
@@ -28,7 +28,6 @@
 #include "tabpdfoptions.h"
 #include "fontprefs.h"
 #include "units.h"
-#include "pluginmanager.h"
 #include "pagesize.h"
 #include "docitemattrprefs.h"
 #include "tocindexprefs.h"
@@ -39,6 +38,7 @@
 #include "linecombo.h"
 #include "arrowchooser.h"
 #include "pagelayout.h"
+#include "pluginmanagerprefsgui.h"
 using namespace std;
 
 extern QPixmap loadIcon(QString nam);
@@ -692,50 +692,7 @@
 	addItem(  tr("Miscellaneous"), loadIcon("misc.png"), Misc);
 
 	// plugin manager. pv.
-	pluginManagerWidget = new QWidget(prefsWidgets, "pluginManagerWidget");
-	pluginMainLayout = new QVBoxLayout( pluginManagerWidget, 0, 5, "pluginMainLayout");
-	pluginMainLayout->setAlignment( Qt::AlignTop );
-	plugGroupBox = new QGroupBox( tr("Plugin Manager"), pluginManagerWidget, "plugGroupBox");
-	plugGroupBox->setColumnLayout(0, Qt::Vertical);
-	plugGroupBox->layout()->setSpacing(6);
-	plugGroupBox->layout()->setMargin(11);
-	plugGroupBoxLayout = new QGridLayout( plugGroupBox->layout() );
-	plugGroupBoxLayout->setAlignment(Qt::AlignTop);
-	plugLayout1 = new QVBoxLayout( 0, 0, 6, "plugLayout1");
-	pluginsList = new QListView(plugGroupBox, "pluginsList");
-	pluginsList->setAllColumnsShowFocus(true);
-	pluginsList->setShowSortIndicator(true);
-	pluginsList->addColumn( tr("Plugin"));
-	pluginsList->setColumnWidthMode(0, QListView::Maximum);
-	pluginsList->addColumn( tr("How to run"));
-	pluginsList->setColumnWidthMode(1, QListView::Maximum);
-	pluginsList->addColumn( tr("Type"));
-	pluginsList->setColumnWidthMode(2, QListView::Maximum);
-	pluginsList->addColumn( tr("Load it?"));
-	pluginsList->setColumnWidthMode(3, QListView::Maximum);
-	pluginsList->addColumn( tr("Plugin ID"));
-	pluginsList->setColumnWidthMode(4, QListView::Maximum);
-	pluginsList->addColumn( tr("File"));
-	pluginsList->setColumnWidthMode(5, QListView::Maximum);
-	for (QMap<int,PluginManager::PluginData>::Iterator it = ap->pluginManager->pluginMap.begin(); it != ap->pluginManager->pluginMap.end(); ++it)
-	{
-		QListViewItem *plugItem = new QListViewItem(pluginsList);
-		plugItem->setText(0, (*it).name.replace('&', "").replace("...", "")); // name
-		plugItem->setText(1, QString("%1 %2").arg((*it).actMenu).arg((*it).actMenuAfterName)); // menu path
-		plugItem->setText(2, ap->pluginManager->getPluginType((*it).type)); // type
-		// load at start?
-		plugItem->setPixmap(3, (*it).loadPlugin ? loadIcon("ok.png") : loadIcon("DateiClos16.png"));
-		plugItem->setText(3, (*it).loadPlugin ? tr("Yes") : tr("No"));
-		plugItem->setText(4, QString("%1").arg(it.key())); // id for developers
-		plugItem->setText(5, (*it).pluginFile); // file for developers
-	}
-	plugLayout1->addWidget(pluginsList);
-	pluginWarning = new QLabel(plugGroupBox);
-	pluginWarning->setText("<qt>" + tr("You need to restart the application to apply the changes.") + "</qt>");
-	plugLayout1->addWidget(pluginWarning);
-	plugGroupBoxLayout->addLayout(plugLayout1, 0, 0);
-	pluginMainLayout->addWidget(plugGroupBox);
-	addItem( tr("Plugins"), loadIcon("plugins.png"), pluginManagerWidget);
+	addItem( tr("Plugins"), loadIcon("plugins.png"), new PluginManagerPrefsGui(prefsWidgets) );
 
 	setDS(prefsData->FacingPages);
 	//tab order
@@ -824,8 +781,6 @@
 	connect(imageEditorChangeButton, SIGNAL(clicked()), this, SLOT(changeImageEditor()));
 	connect(CaliSlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
 	connect(buttonOk, SIGNAL(clicked()), this, SLOT(setActionHistoryLength()));
-	connect(pluginsList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)),
-			this, SLOT(changePluginLoad(QListViewItem *, const QPoint &, int)));
 	if (CMSavail)
 		connect(tabColorManagement, SIGNAL(cmsOn(bool )), this, SLOT(switchCMS(bool )));
 
@@ -1301,27 +1256,6 @@
 	tabPDF->enableCMS(enable);
 }
 
-/*! Set selected item(=plugin) un/loadable
-\author Petr Vanek
-*/
-void Preferences::changePluginLoad(QListViewItem *item, const QPoint &, int column)
-{
-	if (column != 3)
-		return;
-	if (item->text(3) == tr("Yes"))
-	{
-		item->setPixmap(3, loadIcon("DateiClos16.png"));
-		item->setText(3, tr("No"));
-		ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = false;
-	}
-	else
-	{
-		item->setPixmap(3, loadIcon("ok.png"));
-		item->setText(3, tr("Yes"));
-		ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = true;
-	}
-}
-
 void Preferences::setTOCIndexData(QWidget *widgetToShow)
 {
 	//Update the attributes list in TOC setup
Index: prefs.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/prefs.h,v
retrieving revision 1.1.2.18
diff -u -r1.1.2.18 prefs.h
--- prefs.h	10 Aug 2005 07:14:56 -0000	1.1.2.18
+++ prefs.h	7 Sep 2005 16:53:04 -0000
@@ -184,11 +184,6 @@
 	QCheckBox* useStandardLI;
 	QSpinBox* paragraphsLI;
 	QLabel* paraLabelLI;
-	//! plugin manager
-	QWidget* pluginManagerWidget;
-	QGroupBox* plugGroupBox;
-	QListView* pluginsList;
-	QLabel* pluginWarning;
 
 	double unitRatio;
 	double PFactor;
@@ -257,10 +252,6 @@
 	QGridLayout* Layout4s;
 	QHBoxLayout* groupGapLayout;
 	QGridLayout* layout4sg;
-	// plugin manager
-	QVBoxLayout* plugLayout1;
-	QVBoxLayout* pluginMainLayout;
-	QGridLayout* plugGroupBoxLayout;
 	QHBoxLayout* dsLayout4p;
 	QVBoxLayout* dsLayout4pv;
 
@@ -272,7 +263,6 @@
 private slots:
 	void setSelectedGUILang( const QString &newLang );
 	void setActionHistoryLength();
-	void changePluginLoad(QListViewItem *, const QPoint &, int);
 
 private:
 	LanguageManager langMgr;
Index: scplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/scplugin.cpp,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 scplugin.cpp
--- scplugin.cpp	6 Sep 2005 17:43:41 -0000	1.1.2.5
+++ scplugin.cpp	7 Sep 2005 16:53:04 -0000
@@ -10,10 +10,9 @@
 //                        ScPlugin                     //
 //=====================================================//
 
-ScPlugin::ScPlugin(int id, PluginType pluginType)
+ScPlugin::ScPlugin(PluginType pluginType)
 	: QObject(0),
-	pluginType(pluginType),
-	id(id)
+	pluginType(pluginType)
 {
 }
 
@@ -22,6 +21,10 @@
 	return 0;
 }
 
+ScPlugin::~ScPlugin()
+{
+}
+
 // Don't call this method; it must be overridden if the plug-in
 // returns a prefs widget.
 void ScPlugin::destroyPrefsPanelWidget(QWidget* /*prefsPanelWidget*/)
@@ -49,34 +52,38 @@
 	switch(pluginType)
 	{
 		case PluginType_Persistent:
-			return tr("Persistent", "plugin manager");
+			return tr("Persistent", "plugin manager plugin type");
 			break;
 		case PluginType_Import:
-			return tr("Import", "plugin manager");
+			return tr("Import", "plugin manager plugin type");
 			break;
 		case PluginType_Export:
-			// FIXME
-			return tr("Standard", "plugin manager");
+			return tr("Export", "plugin manager plugin type");
+			break;
+		case PluginType_Action:
+			return tr("Action", "plugin manager plugin type");
 			break;
-		default:
-			return tr("Unknown", "plugin manager");
 	}
 }
 
 //=====================================================//
-//                   ScImportExportPlugin              //
+//                   ScActionPlugin              //
 //=====================================================//
 
-ScImportExportPlugin::ScImportExportPlugin(int id, PluginType pluginType)
-	: ScPlugin(id, pluginType)
+ScActionPlugin::ScActionPlugin(PluginType pluginType)
+	: ScPlugin(pluginType)
+{
+}
+
+ScActionPlugin::~ScActionPlugin()
 {
 }
 
 // Stub for plugins that don't implement this method to inherit
 // Just calls the QIODevice version, assuming target is a file.
-bool ScImportExportPlugin::run(QString target)
+bool ScActionPlugin::run(QString target)
 {
-	int flag = id == PluginType_Import ? IO_ReadOnly : IO_WriteOnly;
+	int flag = (pluginType == PluginType_Export) ? IO_WriteOnly : IO_ReadOnly;
 	QFile f(target);
 	if (!f.exists())
 	{
@@ -100,41 +107,46 @@
 }
 
 // Stub for plugins that don't implement this method to inherit
-bool ScImportExportPlugin::run(QIODevice* /* target */)
+bool ScActionPlugin::run(QIODevice* /* target */)
 {
 	return false;
 }
 
 
 // Stub for plugins that don't implement this method to inherit
-DeferredTask* ScImportExportPlugin::runAsync(QString /* target */)
+DeferredTask* ScActionPlugin::runAsync(QString /* target */)
 {
 	return 0;
 }
 
 
 // Stub for plugins that don't implement this method to inherit
-DeferredTask* ScImportExportPlugin::runAsync(QIODevice* /* target */)
+DeferredTask* ScActionPlugin::runAsync(QIODevice* /* target */)
 {
 	return 0;
 }
 
 // Legacy code support; avoid relying on in new code.
-const QString & ScImportExportPlugin::runResult() const
+const QString & ScActionPlugin::runResult() const
 {
 	return m_runResult;
 }
 
-const ScImportExportPlugin::ActionInfo & ScImportExportPlugin::actionInfo() const
+const ScActionPlugin::ActionInfo & ScActionPlugin::actionInfo() const
 {
+	Q_ASSERT(!m_actionInfo.text.isNull());
 	return m_actionInfo;
 }
 
 //=====================================================//
-//                   ScImportExportPlugin              //
+//                   ScActionPlugin              //
 //=====================================================//
 
-ScPersistentPlugin::ScPersistentPlugin(int id)
-	: ScPlugin(id, ScPlugin::PluginType_Persistent)
+ScPersistentPlugin::ScPersistentPlugin()
+	: ScPlugin(ScPlugin::PluginType_Persistent)
+{
+}
+
+ScPersistentPlugin::~ScPersistentPlugin()
 {
 }
Index: scplugin.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/scplugin.h,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 scplugin.h
--- scplugin.h	6 Sep 2005 17:43:41 -0000	1.1.2.4
+++ scplugin.h	7 Sep 2005 16:53:04 -0000
@@ -29,7 +29,7 @@
  * the following "extern C" functions, where 'pluginname' is the base name
  * of the plug-in:
  *
- * int pluginname_pluginAPIVersion();
+ * int pluginname_getPluginAPIVersion();
  *    Return an integer indicating the plug-in API version implemented.
  *    If the version does not exactly match the running plugin API version,
  *    the plugin will not be initialised.
@@ -63,11 +63,35 @@
 	 */
 	public:
 
-		/** \brief Human readable enumertion of the plugin types */
+		/** \brief Human readable enumertion of the plugin types
+		 *
+		 * This might get replaced with checking inheritance
+		 * with QObject.
+		 *
+		 * PluginType_Persistent:
+		 *    The plug-in is loaded and initialised on app startup. No
+		 *    automatic connection to the GUI is made, and the plugin
+		 *    essentially becomes part of the application, maintaining
+		 *    its state as long as it's loaded.
+		 * 
+		 * PluginType_Import:
+		 *    The plug-in provides the facility to import file type(s).
+		 *    It keeps no state.
+		 *
+		 * PluginType_Export:
+		 *    The plugin provides a facility to export file type(s).
+		 *    It keeps no state.
+		 *
+		 * PluginType_Action:
+		 *    The plugin has a single specific action it can take that
+		 *    is not import or export. It's automatically hooked into
+		 *    the GUI and keeps no state.
+		 */
 		enum PluginType {
 			PluginType_Persistent = 4,
 			PluginType_Import = 7,
 			PluginType_Export = 8,
+			PluginType_Action = 9
 		};
 
 		// A struct providing the information returned by getAboutData(), for
@@ -96,15 +120,13 @@
 		/**
 		 * @brief ctor, returns a new ScPlugin instance
 		 *
-		 * @param id              Unique plugin ID, usually a static
-		 *                        const int defined in the plugin.
 		 * @param pluginType      plugin type enum, used by plugin
 		 *                        manager to identify plugin.
 		 *
 		 * Only the actual plugin implmementation should call this, from
 		 * its setup function.
 		 */
-		ScPlugin(int id, PluginType pluginType);
+		ScPlugin(PluginType pluginType);
 
 		/** @brief Pure virtual destructor - this is an abstract class */
 		virtual ~ScPlugin() = 0;
@@ -112,13 +134,9 @@
 		// Plug-in type, inited by ctor.
 		const PluginType pluginType;
 
-		// Plug-in ID, inited by ctor. This must be unique across all
-		// plug-ins.
-		const int id;
-
 		// Plug-in's human-readable, translated name. Please don't use this for
 		// anything except display to the user.
-		virtual const QString fullTrName() = 0;
+		virtual const QString fullTrName() const = 0;
 
 		// Methods to create and destroy the UI pane for the plugin
 		// A plugin MUST reimplment destroyPrefsPanelWidget if it
@@ -160,14 +178,14 @@
 };
 
 
-class SCRIBUS_API ScImportExportPlugin : public ScPlugin
+class SCRIBUS_API ScActionPlugin : public ScPlugin
 {
 	Q_OBJECT
 
 	/*
 	 * @brief A plug-in that's loaded for data import/export duties
 	 *
-	 * ScImportExportPlugin describes a plug-in that is loaded on demand
+	 * ScActionPlugin describes a plug-in that is loaded on demand
 	 * to perform a data import/export task such as importing an SVG
 	 * image or exporting a page to EPS format. It'll generally by unloaded
 	 * after being queried, then loaded on demand when it needs to run.
@@ -179,9 +197,10 @@
 		 *
 		 * @sa ScPlugin::ScPlugin()
 		 */
-		ScImportExportPlugin(int id, PluginType pluginType);
+		ScActionPlugin(PluginType pluginType);
+
 		// Pure virtual dtor - abstract class
-		virtual ~ScImportExportPlugin() = 0;
+		virtual ~ScActionPlugin() = 0;
 
 		// Information about actions, to be returned by actionInfo()
 		struct ActionInfo {
@@ -195,7 +214,7 @@
 		};
 
 		// Return an ActionInfo instance to the caller
-		virtual const ActionInfo & actionInfo() const = 0;
+		const ActionInfo & actionInfo() const;
 
 	public slots:
 		/**
@@ -303,6 +322,7 @@
 		const QString & runResult() const;
 
 	protected:
+		// Action info. To be set up by ctor.
 		ActionInfo m_actionInfo;
 		QString m_runResult;
 };
@@ -327,7 +347,7 @@
 		 *
 		 * @sa ScPlugin::ScPlugin()
 		 */
-		ScPersistentPlugin(int id);
+		ScPersistentPlugin();
 
 		// Pure virtual dtor for abstract class
 		virtual ~ScPersistentPlugin() = 0;
@@ -367,7 +387,7 @@
 		 *
 		 * @returns bool True for success.
 		 */
-		virtual bool cleanupPlug() = 0;
+		virtual bool cleanupPlugin() = 0;
 };
 
 #endif
Index: scribus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.cpp,v
retrieving revision 1.228.2.529
diff -u -r1.228.2.529 scribus.cpp
--- scribus.cpp	7 Sep 2005 16:33:58 -0000	1.228.2.529
+++ scribus.cpp	7 Sep 2005 16:53:10 -0000
@@ -2196,7 +2196,7 @@
 	if (scrapbookPalette->objectCount() == 0)
 		unlink(PrefsPfad+"/scrap13.scs");
 	qApp->setOverrideCursor(QCursor(ArrowCursor), true);
-	pluginManager->finalizePlugs();
+	pluginManager->cleanupPlugins();
 	exit(0);
 }
 
@@ -3494,16 +3494,7 @@
 #else
 	formats += tr("Documents (*.sla *.scd);;");
 #endif
-	if (pluginManager->DLLexists(6))
-		formats += tr("PostScript Files (*.eps *.EPS *.ps *.PS);;");
-	if (pluginManager->DLLexists(10))
-#ifdef HAVE_LIBZ
-		formats += tr("SVG Images (*.svg *.svgz);;");
-#else
-		formats += tr("SVG Images (*.svg);;");
-#endif
-	if (pluginManager->DLLexists(12))
-		formats += tr("OpenOffice.org Draw (*.sxd);;");
+	formats += pluginManager->getImportFilterString();
 	formats += tr("All Files (*)");
 	QString fileName = CFileDialog( docDir, tr("Open"), formats);
 	if (fileName.isEmpty())
@@ -9327,7 +9318,7 @@
 		PageItem *currItem = view->SelItem.at(0);
 		if ((currItem->itemType() == PageItem::TextFrame) && (doc->appMode == modeEdit))
 		{
-			CharSelect *dia = new CharSelect(this, currItem, this);
+			CharSelect *dia = new CharSelect(this, currItem);
 			dia->exec();
 			delete dia;
 		}
Index: scribus.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.h,v
retrieving revision 1.60.2.144
diff -u -r1.60.2.144 scribus.h
--- scribus.h	5 Sep 2005 22:53:16 -0000	1.60.2.144
+++ scribus.h	7 Sep 2005 16:53:11 -0000
@@ -91,6 +91,10 @@
 class TOCGenerator;
 class PrefsManager;
 
+class ScribusApp;
+
+extern ScribusApp* SCRIBUS_API ScApp;
+
 /**
   * This Class is the base class for your application. It sets up the main
   * window and providing a menubar, toolbar
@@ -567,5 +571,6 @@
 				} PDef ;
 	TOCGenerator *tocGenerator;
 };
+
 #endif
 
Index: story.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/story.cpp,v
retrieving revision 1.58.2.79
diff -u -r1.58.2.79 story.cpp
--- story.cpp	31 Aug 2005 21:30:29 -0000	1.58.2.79
+++ story.cpp	7 Sep 2005 16:53:12 -0000
@@ -2815,37 +2815,33 @@
 void StoryEditor::Do_insSp()
 {
 	blockUpdate = true;
-	ScApp->pluginManager->dllInput = Editor->CurrFont;
-	ScApp->pluginManager->dllReturn = "";
-	CharSelect *dia = new CharSelect(this, currItem, ScApp);
+	CharSelect *dia = new CharSelect(this, currItem, Editor->CurrFont);
 	dia->exec();
-	delete dia;
-	if (!ScApp->pluginManager->dllReturn.isEmpty())
+	if (!dia->getCharacters().isEmpty())
 	{
-		Editor->insChars(ScApp->pluginManager->dllReturn);
-		Editor->insert(ScApp->pluginManager->dllReturn);
+		Editor->insChars(dia->getCharacters());
+		Editor->insert(dia->getCharacters());
 	}
-	ScApp->pluginManager->dllInput = "";
-	ScApp->pluginManager->dllReturn = "";
+	delete dia;
 	blockUpdate = false;
 }
 
 void StoryEditor::Do_fontPrev()
 {
 	blockUpdate = true;
-	ScApp->pluginManager->dllInput = Editor->CurrFont;
-	ScApp->pluginManager->dllReturn = "";
-	if (ScApp->pluginManager->DLLexists(2))
+	QString retval;
+	if (ScApp->pluginManager->DLLexists("fontpreview"))
 	{
-		ScApp->pluginManager->callDLL( 2 );
-		if (!ScApp->pluginManager->dllReturn.isEmpty())
+		bool result = ScApp->pluginManager->callImportExportPlugin("fontpreview", Editor->CurrFont, retval);
+		if (result && !retval.isEmpty())
 		{
-			newTxFont(ScApp->pluginManager->dllReturn);
-			FontTools->SetFont(ScApp->pluginManager->dllReturn);
+			qDebug("Got retval");
+			newTxFont(retval);
+			FontTools->SetFont(retval);
 		}
+		else
+			qDebug("No retval");
 	}
-	ScApp->pluginManager->dllInput = "";
-	ScApp->pluginManager->dllReturn = "";
 	blockUpdate = false;
 }
 
Index: plugins/colorwheel/colorwheel.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/colorwheel/Attic/colorwheel.cpp,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 colorwheel.cpp
--- plugins/colorwheel/colorwheel.cpp	3 Jul 2005 21:50:58 -0000	1.1.2.3
+++ plugins/colorwheel/colorwheel.cpp	7 Sep 2005 16:53:13 -0000
@@ -5,51 +5,73 @@
 #include <qcursor.h>
 #include <qlistview.h>
 
-QString name()
+int colorwheel_getPluginAPIVersion()
 {
-	return QObject::tr("&Color Wheel...");
+	return PLUGIN_API_VERSION;
 }
 
-PluginManager::PluginType type()
+ScPlugin* colorwheel_getPlugin()
 {
-	return PluginManager::Standard;
+	ColorWheelPlugin* plug = new ColorWheelPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void colorwheel_freePlugin(ScPlugin* plugin)
 {
-	return 13;
+	ColorWheelPlugin* plug = dynamic_cast<ColorWheelPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-
-QString actionName()
+ColorWheelPlugin::ColorWheelPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Action)
 {
-	return "ColorWheel";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+ColorWheelPlugin::~ColorWheelPlugin() {};
+
+void ColorWheelPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ColorWheel";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("&Color Wheel...");
+	// Menu
+	m_actionInfo.menu = "Extras";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString ColorWheelPlugin::fullTrName() const
 {
-	return "Extras";
+	return QObject::tr("Color Wheel");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* ColorWheelPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void ColorWheelPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
 /** Create dialog. Everything else is handled in separated classes. */
-void run(QWidget *d, ScribusApp */*plug*/)
+bool ColorWheelPlugin::run(QString target)
 {
-	ColorWheelDialog *dlg = new ColorWheelDialog(d, "dlg", true, 0);
-	dlg->exec();
-	delete dlg;
+	Q_ASSERT(target.isNull());
+	ColorWheelDialog *dlg = new ColorWheelDialog(ScApp, "dlg", true, 0);
+	if (dlg)
+	{
+		dlg->exec();
+		delete dlg;
+		return true;
+	}
+	else
+		return false;
 }
Index: plugins/colorwheel/colorwheel.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/colorwheel/Attic/colorwheel.h,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 colorwheel.h
--- plugins/colorwheel/colorwheel.h	11 Aug 2005 16:48:03 -0000	1.1.2.2
+++ plugins/colorwheel/colorwheel.h	7 Sep 2005 16:53:13 -0000
@@ -3,9 +3,9 @@
 #define COLORWHEEL_H
 
 #include "pluginapi.h"
+#include "scplugin.h"
 
 #include "scribus.h"
-#include "pluginmanager.h"
 
 /** \brief This is a simple "Color Theory" plugin for Scribus 1.3 and later.
 Harmonious colors are colors that work well together, that produce a color
@@ -16,26 +16,25 @@
 \date April 2005
 */
 
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-
-
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-
-
-/** Returns the Type of the Plugin. */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-/** ID for plugin registry */
-extern "C" PLUGIN_API int ID();
-
-/** menu settings */
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API  bool actionEnabledOnStartup();
+class PLUGIN_API ColorWheelPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		ColorWheelPlugin();
+		virtual ~ColorWheelPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int colorwheel_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* colorwheel_getPlugin();
+extern "C" PLUGIN_API void colorwheel_freePlugin(ScPlugin* plugin);
 
 #endif
Index: plugins/fileloader/oodraw/oodrawimp.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp,v
retrieving revision 1.1.2.44
diff -u -r1.1.2.44 oodrawimp.cpp
--- plugins/fileloader/oodraw/oodrawimp.cpp	7 Sep 2005 12:20:08 -0000	1.1.2.44
+++ plugins/fileloader/oodraw/oodrawimp.cpp	7 Sep 2005 16:53:14 -0000
@@ -6,6 +6,7 @@
 #include <qdragobject.h>
 #include <qdir.h>
 #include <qstring.h>
+#include <qdom.h>
 #include <cmath>
 
 #include "oodrawimp.h"
@@ -31,90 +32,90 @@
 #include "pluginmanager.h"
 #include "util.h"
 #include "scfontmetrics.h"
+#include "stylestack.h"
 
 using namespace std;
 
-/*!
- \fn QString Name()
- \author Franz Schmid
- \date
- \brief Returns name of plugin
- \param None
- \retval QString containing name of plugin: Import SVG-Image...
- */
-QString name()
+int oodrawimp_getPluginAPIVersion()
 {
-	return QObject::tr("Import &OpenOffice.org Draw...");
+	return PLUGIN_API_VERSION;
 }
 
-/*!
- \fn int Type()
- \author Franz Schmid
- \date
- \brief Returns type of plugin
- \param None
- \retval int containing type of plugin (1: Extra, 2: Import, 3: Export, 4: )
- */
-PluginManager::PluginType type()
+ScPlugin* oodrawimp_getPlugin()
 {
-	return PluginManager::Import;
+	OODrawImportPlugin* plug = new OODrawImportPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void oodrawimp_freePlugin(ScPlugin* plugin)
 {
-	return 12;
+	OODrawImportPlugin* plug = dynamic_cast<OODrawImportPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+OODrawImportPlugin::OODrawImportPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Import)
 {
-	return "ImportOpenOfficeDraw";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+OODrawImportPlugin::~OODrawImportPlugin() {};
+
+void OODrawImportPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ImportOpenOfficeDraw";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Import &OpenOffice.org Draw...");
+	// Menu
+	m_actionInfo.menu = "FileImport";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString OODrawImportPlugin::fullTrName() const
 {
-	return "FileImport";
+	return QObject::tr("OpenOffice.org Draw Importer");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* OODrawImportPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void OODrawImportPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
-void run(QWidget *d, ScribusApp *plug)
+bool OODrawImportPlugin::run(QString fileName)
 {
-	QString fileName;
-	if (!plug->pluginManager->dllInput.isEmpty())
-		fileName = plug->pluginManager->dllInput;
-	else
+	bool interactive = false;
+	if (fileName.isEmpty())
 	{
+		interactive = true;
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("OODrawImport");
 		QString wdir = prefs->get("wdir", ".");
-		CustomFDialog diaf(d, wdir, QObject::tr("Open"), QObject::tr("OpenOffice.org Draw (*.sxd);;All Files (*)"));
+		CustomFDialog diaf(ScApp, wdir, QObject::tr("Open"), QObject::tr("OpenOffice.org Draw (*.sxd);;All Files (*)"));
 		if (diaf.exec())
 		{
 			fileName = diaf.selectedFile();
 			prefs->set("wdir", fileName.left(fileName.findRev("/")));
 		}
 		else
-			return;
+			return true;
 	}
-	if (UndoManager::undoEnabled() && plug->HaveDoc)
+	if (UndoManager::undoEnabled() && ScApp->HaveDoc)
 	{
-		UndoManager::instance()->beginTransaction(plug->doc->currentPage->getUName(),Um::IImageFrame,Um::ImportOOoDraw, fileName, Um::IImportOOoDraw);
+		UndoManager::instance()->beginTransaction(ScApp->doc->currentPage->getUName(),Um::IImageFrame,Um::ImportOOoDraw, fileName, Um::IImportOOoDraw);
 	}
-	else if (UndoManager::undoEnabled() && !plug->HaveDoc)
+	else if (UndoManager::undoEnabled() && !ScApp->HaveDoc)
 		UndoManager::instance()->setUndoEnabled(false);
-	OODPlug *dia = new OODPlug(plug, fileName);
+	OODPlug *dia = new OODPlug(fileName, interactive);
 	if (UndoManager::undoEnabled())
 		UndoManager::instance()->commit();
 	else
@@ -122,8 +123,9 @@
 	delete dia;
 }
 
-OODPlug::OODPlug( ScribusApp *plug, QString fileName )
+OODPlug::OODPlug(QString fileName, bool isInteractive )
 {
+	interactive = isInteractive;
 	QString f, f2, f3;
 	m_styles.setAutoDelete( true );
 	FileUnzip* fun = new FileUnzip(fileName);
@@ -167,7 +169,6 @@
 		QFile f1(stylePath);
 		f1.remove();
 	}
-	Prog = plug;
 	QString CurDirP = QDir::currentDirPath();
 	QFileInfo efp(fileName);
 	QDir::setCurrent(efp.dirPath());
@@ -192,44 +193,44 @@
 	QDomElement properties = style->namedItem( "style:properties" ).toElement();
 	double width = !properties.attribute( "fo:page-width" ).isEmpty() ? parseUnit(properties.attribute( "fo:page-width" ) ) : 550.0;
 	double height = !properties.attribute( "fo:page-height" ).isEmpty() ? parseUnit(properties.attribute( "fo:page-height" ) ) : 841.0;
-	if (!Prog->pluginManager->dllInput.isEmpty())
-		Prog->doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
+	if (!interactive)
+		ScApp->doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
 	else
 	{
-		if (!Prog->HaveDoc)
+		if (!ScApp->HaveDoc)
 		{
-			Prog->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom");
+			ScApp->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom");
 			ret = true;
 		}
 	}
-	if ((ret) || (!Prog->pluginManager->dllInput.isEmpty()))
+	if ((ret) || (!interactive))
 	{
 		if (width > height)
-			Prog->doc->PageOri = 1;
+			ScApp->doc->PageOri = 1;
 		else
-			Prog->doc->PageOri = 0;
-		Prog->doc->PageSize = "Custom";
+			ScApp->doc->PageOri = 0;
+		ScApp->doc->PageSize = "Custom";
 		QDomNode mpg;
 		QDomElement metaElem = inpMeta.documentElement();
 		QDomElement mp = metaElem.namedItem( "office:meta" ).toElement();
 		mpg = mp.namedItem( "dc:title" );
 		if (!mpg.isNull())
-			Prog->doc->documentInfo.setTitle(QString::fromUtf8(mpg.toElement().text()));
+			ScApp->doc->documentInfo.setTitle(QString::fromUtf8(mpg.toElement().text()));
 		mpg = mp.namedItem( "meta:initial-creator" );
 		if (!mpg.isNull())
-			Prog->doc->documentInfo.setAuthor(QString::fromUtf8(mpg.toElement().text()));
+			ScApp->doc->documentInfo.setAuthor(QString::fromUtf8(mpg.toElement().text()));
 		mpg = mp.namedItem( "dc:description" );
 		if (!mpg.isNull())
-			Prog->doc->documentInfo.setComments(QString::fromUtf8(mpg.toElement().text()));
+			ScApp->doc->documentInfo.setComments(QString::fromUtf8(mpg.toElement().text()));
 		mpg = mp.namedItem( "dc:language" );
 		if (!mpg.isNull())
-			Prog->doc->documentInfo.setLangInfo(QString::fromUtf8(mpg.toElement().text()));
+			ScApp->doc->documentInfo.setLangInfo(QString::fromUtf8(mpg.toElement().text()));
 		mpg = mp.namedItem( "meta:creation-date" );
 		if (!mpg.isNull())
-			Prog->doc->documentInfo.setDate(QString::fromUtf8(mpg.toElement().text()));
+			ScApp->doc->documentInfo.setDate(QString::fromUtf8(mpg.toElement().text()));
 		mpg = mp.namedItem( "dc:creator" );
 		if (!mpg.isNull())
-			Prog->doc->documentInfo.setContrib(QString::fromUtf8(mpg.toElement().text()));
+			ScApp->doc->documentInfo.setContrib(QString::fromUtf8(mpg.toElement().text()));
 		mpg = mp.namedItem( "meta:keywords" );
 		if (!mpg.isNull())
 		{
@@ -239,33 +240,33 @@
 				Keys += QString::fromUtf8(n.toElement().text())+", ";
 			}
 			if (Keys.length() > 2)
-				Prog->doc->documentInfo.setKeywords(Keys.left(Keys.length()-2));
+				ScApp->doc->documentInfo.setKeywords(Keys.left(Keys.length()-2));
 		}
 	}
-	Doku = Prog->doc;
+	Doku = ScApp->doc;
 	FPoint minSize = Doku->minCanvasCoordinate;
 	FPoint maxSize = Doku->maxCanvasCoordinate;
-	Prog->view->Deselect();
+	ScApp->view->Deselect();
 	Elements.clear();
 	Doku->setLoading(true);
 	Doku->DoDrawing = false;
-	Prog->view->setUpdatesEnabled(false);
-	Prog->ScriptRunning = true;
+	ScApp->view->setUpdatesEnabled(false);
+	ScApp->ScriptRunning = true;
 	qApp->setOverrideCursor(QCursor(Qt::waitCursor), true);
 	if (!Doku->PageColors.contains("Black"))
 		Doku->PageColors.insert("Black", ScColor(0, 0, 0, 255));
 	for( QDomNode drawPag = body.firstChild(); !drawPag.isNull(); drawPag = drawPag.nextSibling() )
 	{
 		QDomElement dpg = drawPag.toElement();
-		if (!Prog->pluginManager->dllInput.isEmpty())
-			Prog->view->addPage(PageCounter);
+		if (!interactive)
+			ScApp->view->addPage(PageCounter);
 		PageCounter++;
 		m_styleStack.clear();
 		fillStyleStack( dpg );
 		parseGroup( dpg );
 	}
-	Prog->view->SelItem.clear();
-	if ((Elements.count() > 1) && (Prog->pluginManager->dllInput.isEmpty()))
+	ScApp->view->SelItem.clear();
+	if ((Elements.count() > 1) && (interactive))
 	{
 		for (uint a = 0; a < Elements.count(); ++a)
 		{
@@ -274,12 +275,12 @@
 		Doku->GroupCounter++;
 	}
 	Doku->DoDrawing = true;
-	Prog->view->setUpdatesEnabled(true);
-	Prog->ScriptRunning = false;
-	if (Prog->pluginManager->dllInput.isEmpty())
+	ScApp->view->setUpdatesEnabled(true);
+	ScApp->ScriptRunning = false;
+	if (interactive)
 		Doku->setLoading(false);
 	qApp->setOverrideCursor(QCursor(Qt::arrowCursor), true);
-	if ((Elements.count() > 0) && (!ret) && (Prog->pluginManager->dllInput.isEmpty()))
+	if ((Elements.count() > 0) && (!ret) && (interactive))
 	{
 		Doku->DragP = true;
 		Doku->DraggedElem = 0;
@@ -287,14 +288,14 @@
 		for (uint dre=0; dre<Elements.count(); ++dre)
 		{
 			Doku->DragElements.append(Elements.at(dre)->ItemNr);
-			Prog->view->SelItem.append(Elements.at(dre));
+			ScApp->view->SelItem.append(Elements.at(dre));
 		}
 		ScriXmlDoc *ss = new ScriXmlDoc();
-		Prog->view->setGroupRect();
-		QDragObject *dr = new QTextDrag(ss->WriteElem(&Prog->view->SelItem, Doku, Prog->view), Prog->view->viewport());
-		Prog->view->DeleteItem();
-		Prog->view->resizeContents(qRound((maxSize.x() - minSize.x()) * Prog->view->getScale()), qRound((maxSize.y() - minSize.y()) * Prog->view->getScale()));
-		Prog->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * Prog->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * Prog->view->getScale()));
+		ScApp->view->setGroupRect();
+		QDragObject *dr = new QTextDrag(ss->WriteElem(&ScApp->view->SelItem, Doku, ScApp->view), ScApp->view->viewport());
+		ScApp->view->DeleteItem();
+		ScApp->view->resizeContents(qRound((maxSize.x() - minSize.x()) * ScApp->view->getScale()), qRound((maxSize.y() - minSize.y()) * ScApp->view->getScale()));
+		ScApp->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * ScApp->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * ScApp->view->getScale()));
 		Doku->minCanvasCoordinate = minSize;
 		Doku->maxCanvasCoordinate = maxSize;
 		dr->setPixmap(loadIcon("DragPix.xpm"));
@@ -307,9 +308,8 @@
 	else
 	{
 		Doku->setModified(false);
-		Prog->slotDocCh();
+		ScApp->slotDocCh();
 	}
-	Prog->pluginManager->dllInput = "";
 }
 
 QPtrList<PageItem> OODPlug::parseGroup(const QDomElement &e)
@@ -465,12 +465,12 @@
 			w = parseUnit(b.attribute("svg:width"));
 			h = parseUnit(b.attribute("svg:height"));
 			double corner = parseUnit(b.attribute("draw:corner-radius"));
-			z = Prog->view->PaintRect(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
+			z = ScApp->view->PaintRect(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
 			PageItem* ite = Doku->Items.at(z);
 			if (corner != 0)
 			{
 				ite->RadRect = corner;
-				Prog->view->SetFrameRound(ite);
+				ScApp->view->SetFrameRound(ite);
 			}
 		}
 		else if( STag == "draw:circle" || STag == "draw:ellipse" )
@@ -479,7 +479,7 @@
 			y = parseUnit(b.attribute("svg:y")) ;
 			w = parseUnit(b.attribute("svg:width"));
 			h = parseUnit(b.attribute("svg:height"));
-			z = Prog->view->PaintEllipse(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
+			z = ScApp->view->PaintEllipse(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
 		}
 		else if( STag == "draw:line" ) // line
 		{
@@ -487,7 +487,7 @@
 			double y1 = b.attribute( "svg:y1" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:y1" ) );
 			double x2 = b.attribute( "svg:x2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:x2" ) );
 			double y2 = b.attribute( "svg:y2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:y2" ) );
-			z = Prog->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
+			z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(4);
 			ite->PoLine.setPoint(0, FPoint(x1, y1));
@@ -502,12 +502,12 @@
 			if (!b.hasAttribute("draw:transform"))
 			{
 				ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-				Prog->view->AdjustItemSize(ite);
+				ScApp->view->AdjustItemSize(ite);
 			}
 		}
 		else if ( STag == "draw:polygon" )
 		{
-			z = Prog->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
+			z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(0);
 			appendPoints(&ite->PoLine, b);
@@ -519,12 +519,12 @@
 			if (!b.hasAttribute("draw:transform"))
 			{
 				ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-				Prog->view->AdjustItemSize(ite);
+				ScApp->view->AdjustItemSize(ite);
 			}
 		}
 		else if( STag == "draw:polyline" )
 		{
-			z = Prog->view->PaintPolyLine(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
+			z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(0);
 			appendPoints(&ite->PoLine, b);
@@ -536,20 +536,20 @@
 			if (!b.hasAttribute("draw:transform"))
 			{
 				ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-				Prog->view->AdjustItemSize(ite);
+				ScApp->view->AdjustItemSize(ite);
 			}
 		}
 		else if( STag == "draw:path" )
 		{
-			z = Prog->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
+			z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(0);
 			if (parseSVG( b.attribute( "svg:d" ), &ite->PoLine ))
 				ite->convertTo(PageItem::PolyLine);
 			if (ite->PoLine.size() < 4)
 			{
-				Prog->view->SelItem.append(ite);
-				Prog->view->DeleteItem();
+				ScApp->view->SelItem.append(ite);
+				ScApp->view->DeleteItem();
 				z = -1;
 			}
 			else
@@ -575,7 +575,7 @@
 				if (!b.hasAttribute("draw:transform"))
 				{
 					ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-					Prog->view->AdjustItemSize(ite);
+					ScApp->view->AdjustItemSize(ite);
 				}
 			}
 		}
@@ -585,7 +585,7 @@
 			y = parseUnit(b.attribute("svg:y")) ;
 			w = parseUnit(b.attribute("svg:width"));
 			h = parseUnit(b.attribute("svg:height"));
-			z = Prog->view->PaintText(BaseX+x, BaseY+y, w, h+(h*0.1), lwidth, StrokeColor);
+			z = ScApp->view->PaintText(BaseX+x, BaseY+y, w, h+(h*0.1), lwidth, StrokeColor);
 		}
 		else
 		{
@@ -643,7 +643,7 @@
 				ite->Width = wh.x();
 				ite->Height = wh.y();
 				ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-				Prog->view->AdjustItemSize(ite);
+				ScApp->view->AdjustItemSize(ite);
 			}
 			if (HaveGradient)
 			{
@@ -657,12 +657,12 @@
 						if ((GradientAngle == 0) || (GradientAngle == 180))
 						{
 							ite->GrType = 2;
-							Prog->view->updateGradientVectors(ite);
+							ScApp->view->updateGradientVectors(ite);
 						}
 						else if ((GradientAngle == 90) || (GradientAngle == 270))
 						{
 							ite->GrType = 1;
-							Prog->view->updateGradientVectors(ite);
+							ScApp->view->updateGradientVectors(ite);
 						}
 					}
 					else
@@ -726,7 +726,7 @@
 						ite->GrEndX = ite->Width / 2.0;
 						ite->GrEndY = ite->Height;
 					}
-					Prog->view->updateGradientVectors(ite);
+					ScApp->view->updateGradientVectors(ite);
 				}
 				HaveGradient = false;
 			}
@@ -897,7 +897,7 @@
 		ScColor tmp;
 		tmp.fromQColor(c);
 		Doku->PageColors.insert("FromOODraw"+c.name(), tmp);
-		Prog->propertiesPalette->Cpal->SetColors(Doku->PageColors);
+		ScApp->propertiesPalette->Cpal->SetColors(Doku->PageColors);
 		ret = "FromOODraw"+c.name();
 	}
 	return ret;
Index: plugins/fileloader/oodraw/oodrawimp.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.h,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 oodrawimp.h
--- plugins/fileloader/oodraw/oodrawimp.h	11 Aug 2005 16:48:03 -0000	1.1.2.10
+++ plugins/fileloader/oodraw/oodrawimp.h	7 Sep 2005 16:53:14 -0000
@@ -2,44 +2,47 @@
 #define OODPLUG_H
 
 #include <qobject.h>
-#include <qdom.h>
 #include <qdict.h>
 #include <qptrlist.h>
-class QWidget;
+#include "pluginapi.h"
+#include "scplugin.h"
+#include "stylestack.h"
+
+class PLUGIN_API OODrawImportPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		OODrawImportPlugin();
+		virtual ~OODrawImportPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
 
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int oodrawimp_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* oodrawimp_getPlugin();
+extern "C" PLUGIN_API void oodrawimp_freePlugin(ScPlugin* plugin);
+
+class QWidget;
 class ScribusApp;
 class ScribusDoc;
 class PageItem;
 class FPointArray;
-#include "pluginapi.h"
-#include "stylestack.h"
-#include <pluginmanager.h>
-
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugins is a import Plugin, which appears in the Import Menue
-  * 3 = the Plugins is a export Plugin, which appears in the Export Menue */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class QDomDocument;
+class QDomElement;
 
 class OODPlug : public QObject
 {
 	Q_OBJECT
 
 public:
-	OODPlug( ScribusApp *plug, QString fName );
+	OODPlug( QString fName, bool isInteractive );
 	~OODPlug();
 	void convert();
 	QPtrList<PageItem> parseGroup(const QDomElement &e);
@@ -64,7 +67,6 @@
 	void svgCurveToCubic(FPointArray *i, double x1, double y1, double x2, double y2, double x3, double y3);
 
 	ScribusDoc* Doku;
-	ScribusApp* Prog;
 	QDomDocument inpContents;
 	QDomDocument inpStyles;
 	QDomDocument inpMeta;
@@ -77,6 +79,8 @@
 	int PathLen;
 	QPtrList<PageItem> Elements;
 	bool FirstM, WasM, PathClosed, HaveMeta;
+protected:
+	bool interactive;
 };
 
 #endif
Index: plugins/fontpreview/fontpreview.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/fontpreview/fontpreview.cpp,v
retrieving revision 1.6.2.9
diff -u -r1.6.2.9 fontpreview.cpp
--- plugins/fontpreview/fontpreview.cpp	25 Jul 2005 22:28:43 -0000	1.6.2.9
+++ plugins/fontpreview/fontpreview.cpp	7 Sep 2005 16:53:14 -0000
@@ -4,63 +4,79 @@
 #include <qcursor.h>
 #include <qlistview.h>
 
-QString name()
+int fontpreview_getPluginAPIVersion()
 {
-	return QObject::tr("&Fonts Preview...");
+	return PLUGIN_API_VERSION;
 }
 
-PluginManager::PluginType type()
+ScPlugin* fontpreview_getPlugin()
 {
-	return PluginManager::Standard;
+	FontPreviewPlugin* plug = new FontPreviewPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void fontpreview_freePlugin(ScPlugin* plugin)
 {
-	return 2;
+	FontPreviewPlugin* plug = dynamic_cast<FontPreviewPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-
-QString actionName()
+FontPreviewPlugin::FontPreviewPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Action)
 {
-	return "FontsPreview";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+FontPreviewPlugin::~FontPreviewPlugin() {};
+
+void FontPreviewPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "FontPreview";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("&Font Preview...");
+	// Menu
+	m_actionInfo.menu = "Extras";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString FontPreviewPlugin::fullTrName() const
 {
-	return "Extras";
+	return QObject::tr("Font Preview");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* FontPreviewPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void FontPreviewPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
 /**
 Create dialog and insert font into Style menu when user accepts.
 */
-void run(QWidget *d, ScribusApp *plug)
+bool FontPreviewPlugin::run(QString target)
 {
 	// I don't know how many fonts user has...
 	qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
-	FontPreview *dlg = new FontPreview(plug, d, "dlg", true, 0);
+	FontPreview *dlg = new FontPreview(target);
 	qApp->restoreOverrideCursor();
 	// run it and wait for user's reaction
 	if (dlg->exec() == QDialog::Accepted)
 	{
-		if  (plug->pluginManager->dllInput.isEmpty())
-			plug->SetNewFont(dlg->fontList->currentItem()->text(0));
+		if  (target.isEmpty())
+			ScApp->SetNewFont(dlg->fontList->currentItem()->text(0));
 		else
-			plug->pluginManager->dllReturn = dlg->fontList->currentItem()->text(0);
+			m_runResult = dlg->fontList->currentItem()->text(0);
 	}
 	delete dlg;
+	return true;
 }
Index: plugins/fontpreview/fontpreview.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/fontpreview/fontpreview.h,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 fontpreview.h
--- plugins/fontpreview/fontpreview.h	11 Aug 2005 16:48:03 -0000	1.1.2.4
+++ plugins/fontpreview/fontpreview.h	7 Sep 2005 16:53:14 -0000
@@ -1,31 +1,29 @@
-#ifndef MYPLUGIN_H
-#define MYPLUGIN_H
+#ifndef FONTPREVIEW_H
+#define FONTPREVIEW_H
 
 #include "pluginapi.h"
 #include "scribus.h"
-#include "pluginmanager.h"
+#include "scplugin.h"
 
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-
-
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-
-
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugin is a Import Plugin, which appears in the Import Menue
-  * 3 = the Plugin is a Export Plugin, which appears in the Export Menue
-  * 4 = the Plugin is a resident Plugin   */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-extern "C" PLUGIN_API int ID();
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class PLUGIN_API FontPreviewPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		FontPreviewPlugin();
+		virtual ~FontPreviewPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int fontpreview_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* fontpreview_getPlugin();
+extern "C" PLUGIN_API void fontpreview_freePlugin(ScPlugin* plugin);
 
 #endif
Index: plugins/fontpreview/ui.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/fontpreview/ui.cpp,v
retrieving revision 1.8.2.22
diff -u -r1.8.2.22 ui.cpp
--- plugins/fontpreview/ui.cpp	25 Aug 2005 18:30:58 -0000	1.8.2.22
+++ plugins/fontpreview/ui.cpp	7 Sep 2005 16:53:14 -0000
@@ -1,5 +1,5 @@
 #include "ui.h"
-#include "ui.moc"
+#include "scribus.h"
 #include "pluginmanager.h"
 #include <qvariant.h>
 #include <qpushbutton.h>
@@ -27,12 +27,9 @@
  *  The dialog will by default be modeless, unless you set 'modal' to
  *  true to construct a modal dialog.
  */
-FontPreview::FontPreview(ScribusApp *carrier, QWidget* parent, const char* name, bool modal, WFlags fl)
-	: QDialog(parent, name, modal, fl)
+FontPreview::FontPreview(QString fontName)
+	: QDialog(ScApp, "FontPreview")
 {
-	this->carrier = carrier;
-	if (!name)
-		setName( "FontPreview" );
 	setIcon(loadIcon("AppIcon.png"));
 	// scribus config
 	prefs = PrefsManager::instance()->prefsFile->getPluginContext("fontpreview");
@@ -101,7 +98,7 @@
 
 	/* go through available fonts and check their properties */
 	reallyUsedFonts.clear();
-	carrier->doc->getUsedFonts(&reallyUsedFonts);
+	ScApp->doc->getUsedFonts(&reallyUsedFonts);
 	ttfFont = loadIcon("font_truetype16.png");
 	otfFont = loadIcon("font_otf16.png");
 	psFont = loadIcon("font_type1_16.png");
@@ -113,12 +110,12 @@
 
 	// set initial listitem
 	QListViewItem *item;
-	if (!carrier->pluginManager->dllInput.isEmpty())
-		item = fontList->findItem(carrier->pluginManager->dllInput, 0);
+	if (!fontName.isEmpty())
+		item = fontList->findItem(fontName, 0);
 	else
 	{
-		if (carrier->view->SelItem.count() != 0)
-			item = fontList->findItem(carrier->doc->CurrFont, 0);
+		if (ScApp->view->SelItem.count() != 0)
+			item = fontList->findItem(ScApp->doc->CurrFont, 0);
 		else
 			item = fontList->findItem(PrefsManager::instance()->appPrefs.toolSettings.defFont, 0);
 	}
@@ -242,3 +239,5 @@
 {
 	updateFontList(searchEdit->text());
 }
+
+#include "ui.moc"
Index: plugins/fontpreview/ui.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/fontpreview/ui.h,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 ui.h
--- plugins/fontpreview/ui.h	20 Apr 2005 19:18:02 -0000	1.2.2.5
+++ plugins/fontpreview/ui.h	7 Sep 2005 16:53:14 -0000
@@ -1,7 +1,8 @@
-#ifndef FONTPREVIEW_H
-#define FONTPREVIEW_H
+#ifndef FONTPREVIEW_UI_H
+#define FONTPREVIEW_UI_H
 
-#include "scribus.h"
+#include "qdialog.h"
+#include "qpixmap.h"
 
 class QVBoxLayout;
 class QHBoxLayout;
@@ -13,17 +14,17 @@
 class QLabel;
 class QSpinBox;
 class QSpacerItem;
+class QLineEdit;
+class PrefsContext;
 
 class FontPreview : public QDialog
 {
 	Q_OBJECT
 
 public:
-	FontPreview(ScribusApp *carrier, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+	FontPreview(QString fontName = QString::null);
 	~FontPreview();
 
-	/** Reference on the parent application object */
-	ScribusApp *carrier;
 	/** gui widgets */
 	QLabel* searchLabel;
 	QLineEdit* searchEdit;
Index: plugins/newfromtemplateplugin/nftemplate.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/newfromtemplateplugin/nftemplate.cpp,v
retrieving revision 1.6.2.14
diff -u -r1.6.2.14 nftemplate.cpp
--- plugins/newfromtemplateplugin/nftemplate.cpp	24 Jul 2005 20:22:01 -0000	1.6.2.14
+++ plugins/newfromtemplateplugin/nftemplate.cpp	7 Sep 2005 16:53:15 -0000
@@ -6,6 +6,7 @@
 #include <qdir.h>
 #include <qwidget.h>
 
+#include "scribus.h"
 #include "nftemplate.h"
 #include "nftemplate.moc"
 #include "nftdialog.h"
@@ -15,85 +16,88 @@
 #include "undomanager.h"
 #include "prefsmanager.h"
 
-ScribusApp* Carrier;
-QWidget* par;
-
-QString name()
+int newfromtemplateplugin_getPluginAPIVersion()
 {
-    return QObject::tr("New &from Template...");
+	return PLUGIN_API_VERSION;
 }
 
-PluginManager::PluginType type()
+ScPlugin* newfromtemplateplugin_getPlugin()
 {
-	return PluginManager::Standard;
+	NewFromTemplatePlugin* plug = new NewFromTemplatePlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void newfromtemplateplugin_freePlugin(ScPlugin* plugin)
 {
-	return 3;
+	NewFromTemplatePlugin* plug = dynamic_cast<NewFromTemplatePlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+NewFromTemplatePlugin::NewFromTemplatePlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Action)
 {
-	return "NewFromDocumentTemplate";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
-{
-	return "Ctrl+Alt+N";
-}
+NewFromTemplatePlugin::~NewFromTemplatePlugin() {};
 
-QString actionMenu()
+void NewFromTemplatePlugin::languageChange()
 {
-	return "File";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "NewFromDocumentTemplate";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("New &from Template...");
+	// Shortcut
+	m_actionInfo.keySequence = "Ctrl+Alt+N";
+	// Menu
+	m_actionInfo.menu = "File";
+	m_actionInfo.menuAfterName = "New";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenuAfterName()
+const QString NewFromTemplatePlugin::fullTrName() const
 {
-	return "New";
+	return QObject::tr("New From Template");
 }
 
-bool actionEnabledOnStartup()
-{
-	return true;
-}
-/*
-void InitPlug(QWidget *d, ScribusApp *plug)
+const ScActionPlugin::AboutData* NewFromTemplatePlugin::getAboutData() const
 {
-	Carrier = plug;
-	par = d;
-	Nft = new MenuNFT(d);
-	int id = plug->fileMenu->insertItem(QObject::tr("New &from Document Template..."), -1, plug->fileMenu->indexOf(plug->scrActions["fileNew"]->getMenuIndex())+1);
-	plug->fileMenu->connectItem(id, Nft, SLOT(RunNFTPlug()));
-	plug->fileMenu->setItemEnabled(id, 1);
+	return 0;
 }
-*/
-void cleanUpPlug()
+
+void NewFromTemplatePlugin::deleteAboutData(const AboutData* about) const
 {
 }
 
-void run(QWidget *d, ScribusApp *plug)
+bool NewFromTemplatePlugin::run(QString target)
 {
-	Carrier = plug;
-	par = d;
-	Nft = new MenuNFT(d);
+	Q_ASSERT(target.isNull());
+	Nft = new MenuNFT(ScApp);
+	Q_CHECK_PTR(Nft);
 	Nft->RunNFTPlug();
+	return true;
 }
 
 
 void MenuNFT::RunNFTPlug()
 {
-	nftdialog* nftdia = new nftdialog(par, Carrier->getGuiLanguage(), PrefsManager::instance()->appPrefs.documentTemplatesDir);
+	nftdialog* nftdia = new nftdialog(ScApp, ScApp->getGuiLanguage(), PrefsManager::instance()->appPrefs.documentTemplatesDir);
 	if (nftdia->exec())
 	{
 		qApp->setOverrideCursor(QCursor(Qt::WaitCursor), true);
-		Carrier->loadDoc(QDir::cleanDirPath(nftdia->currentDocumentTemplate->file));
-		Carrier->doc->hasName = false;
+		ScApp->loadDoc(QDir::cleanDirPath(nftdia->currentDocumentTemplate->file));
+		ScApp->doc->hasName = false;
 		UndoManager::instance()->renameStack(nftdia->currentDocumentTemplate->name);
-		Carrier->doc->DocName = nftdia->currentDocumentTemplate->name;
-		Carrier->ActWin->setCaption(QObject::tr("Document Template: ") + nftdia->currentDocumentTemplate->name);
+		ScApp->doc->DocName = nftdia->currentDocumentTemplate->name;
+		ScApp->ActWin->setCaption(QObject::tr("Document Template: ") + nftdia->currentDocumentTemplate->name);
 		QDir::setCurrent(PrefsManager::instance()->documentDir());
-		Carrier->removeRecent(QDir::cleanDirPath(nftdia->currentDocumentTemplate->file));
+		ScApp->removeRecent(QDir::cleanDirPath(nftdia->currentDocumentTemplate->file));
 		qApp->restoreOverrideCursor();
 	}
 	delete nftdia;
Index: plugins/newfromtemplateplugin/nftemplate.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/newfromtemplateplugin/nftemplate.h,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 nftemplate.h
--- plugins/newfromtemplateplugin/nftemplate.h	11 Aug 2005 16:48:04 -0000	1.2.2.5
+++ plugins/newfromtemplateplugin/nftemplate.h	7 Sep 2005 16:53:15 -0000
@@ -2,38 +2,30 @@
 #define MYPLUGIN_H
 
 #include "pluginapi.h"
-#include "scribus.h"
-#include "nftdialog.h"
-#include "pluginmanager.h"
+#include "scplugin.h"
 
 class ScrAction;
 
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-
-
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugin is a Import Plugin, which appears in the Import Menue
-  * 3 = the Plugin is a Export Plugin, which appears in the Export Menue
-  * 4 = the Plugin is a resident Plugin   */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-
-///** Initializes the Plugin if it's a Plugin of Type 4 or 5 */
-//extern "C" void InitPlug(QWidget *d, ScribusApp *plug);
-/** Type 6 plugin needs this again */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-
-/** Possible CleanUpOperations when closing the Plugin */
-extern "C" PLUGIN_API void cleanUpPlug();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class PLUGIN_API NewFromTemplatePlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		NewFromTemplatePlugin();
+		virtual ~NewFromTemplatePlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int newfromtemplateplugin_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* newfromtemplateplugin_getPlugin();
+extern "C" PLUGIN_API void newfromtemplateplugin_freePlugin(ScPlugin* plugin);
 
 class MenuNFT : public QObject
 {
Index: plugins/pixmapexport/export.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/pixmapexport/export.cpp,v
retrieving revision 1.6.2.19
diff -u -r1.6.2.19 export.cpp
--- plugins/pixmapexport/export.cpp	7 Sep 2005 12:20:08 -0000	1.6.2.19
+++ plugins/pixmapexport/export.cpp	7 Sep 2005 16:53:15 -0000
@@ -6,62 +6,80 @@
 #include <qdir.h>
 #include <qcursor.h>
 
+#include "scribus.h"
 #include "scraction.h"
 #include "menumanager.h"
 #include "pluginmanager.h"
 #include "util.h"
 
-
-QString name()
+int scribusexportpixmap_getPluginAPIVersion()
 {
-	return QObject::tr("Save as &Image...");
+	return PLUGIN_API_VERSION;
 }
 
-
-PluginManager::PluginType type()
+ScPlugin* scribusexportpixmap_getPlugin()
 {
-	return PluginManager::Standard;
+	PixmapExportPlugin* plug = new PixmapExportPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void scribusexportpixmap_freePlugin(ScPlugin* plugin)
 {
-	return 4;
+	PixmapExportPlugin* plug = dynamic_cast<PixmapExportPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+PixmapExportPlugin::PixmapExportPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Export)
 {
-	return "ExportAsImage";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+PixmapExportPlugin::~PixmapExportPlugin() {};
+
+void PixmapExportPlugin::languageChange()
 {
-	return "CTRL+SHIFT+E";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ExportAsImage";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Save as &Image...");
+	// Keyboard shortcut
+	m_actionInfo.keySequence = "CTRL+SHIFT+E";
+	// Menu
+	m_actionInfo.menu = "FileExport";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString PixmapExportPlugin::fullTrName() const
 {
-	return "FileExport";
+	return QObject::tr("Export As Image");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* PixmapExportPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void PixmapExportPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
-void run(QWidget *d, ScribusApp *plug)
+bool PixmapExportPlugin::run(QString target)
 {
+	Q_ASSERT(target.isEmpty());
 	bool res;
-	ExportBitmap *ex = new ExportBitmap(plug);
-	ExportForm *dia = new ExportForm(d, ex->pageDPI, ex->quality, ex->bitmapType);
+	ExportBitmap *ex = new ExportBitmap();
+	ExportForm *dia = new ExportForm(ScApp, ex->pageDPI, ex->quality, ex->bitmapType);
 
 	// interval widgets handling
 	QString tmp;
-	dia->RangeVal->setText(tmp.setNum(plug->doc->currentPage->pageNr()+1));
+	dia->RangeVal->setText(tmp.setNum(ScApp->doc->currentPage->pageNr()+1));
 	// main "loop"
 	if (dia->exec()==QDialog::Accepted)
 	{
@@ -72,38 +90,38 @@
 		ex->quality = dia->QualityBox->value();
 		ex->exportDir = dia->OutputDirectory->text();
 		ex->bitmapType = dia->bitmapType;
-		plug->mainWindowProgressBar->reset();
+		ScApp->mainWindowProgressBar->reset();
 		if (dia->OnePageRadio->isChecked())
 			res = ex->exportActual();
 		else
 		{
 			if (dia->AllPagesRadio->isChecked())
-				plug->parsePagesString("*", &pageNs, plug->doc->pageCount);
+				ScApp->parsePagesString("*", &pageNs, ScApp->doc->pageCount);
 			else
-				plug->parsePagesString(dia->RangeVal->text(), &pageNs, plug->doc->pageCount);
+				ScApp->parsePagesString(dia->RangeVal->text(), &pageNs, ScApp->doc->pageCount);
 			res = ex->exportInterval(pageNs);
 		}
-		plug->mainWindowProgressBar->reset();
+		ScApp->mainWindowProgressBar->reset();
 		QApplication::restoreOverrideCursor();
 		if (!res)
 		{
-			QMessageBox::warning(plug, QObject::tr("Save as Image"), QObject::tr("Error writing the output file(s)."));
-			plug->mainWindowStatusLabel->setText(QObject::tr("Error writing the output file(s)."));
+			QMessageBox::warning(ScApp, QObject::tr("Save as Image"), QObject::tr("Error writing the output file(s)."));
+			ScApp->mainWindowStatusLabel->setText(QObject::tr("Error writing the output file(s)."));
 		}
 		else
 		{
-			plug->mainWindowStatusLabel->setText(QObject::tr("Export successful."));
+			ScApp->mainWindowStatusLabel->setText(QObject::tr("Export successful."));
 		}
 	} // if accepted
 	// clean the trash
 	delete ex;
 	delete dia;
+	return true;
 }
 
 
-ExportBitmap::ExportBitmap(ScribusApp *plug)
+ExportBitmap::ExportBitmap()
 {
-	carrier = plug;
 	pageDPI = 72;
 	quality = 100;
 	enlargement = 100;
@@ -126,7 +144,7 @@
 	uint over = 0;
 	QString fileName = getFileName(pageNr);
 
-	if (!carrier->doc->Pages.at(pageNr))
+	if (!ScApp->doc->Pages.at(pageNr))
 		return false;
 
 	/* a little magic here - I need to compute the "maxGr" value...
@@ -134,10 +152,10 @@
 	* portrait and user defined sizes.
 	*/
 	double pixmapSize;
-	(carrier->doc->pageHeight > carrier->doc->pageWidth)
-			? pixmapSize = carrier->doc->pageHeight
-			: pixmapSize = carrier->doc->pageWidth;
-	QImage im = carrier->view->PageToPixmap(pageNr, qRound(pixmapSize * enlargement * (pageDPI / 72.0) / 100.0));
+	(ScApp->doc->pageHeight > ScApp->doc->pageWidth)
+			? pixmapSize = ScApp->doc->pageHeight
+			: pixmapSize = ScApp->doc->pageWidth;
+	QImage im = ScApp->view->PageToPixmap(pageNr, qRound(pixmapSize * enlargement * (pageDPI / 72.0) / 100.0));
 	int dpm = qRound(100.0 / 2.54 * pageDPI);
 	im.setDotsPerMeterY(dpm);
 	im.setDotsPerMeterX(dpm);
@@ -147,7 +165,7 @@
 /* Changed the following Code from the original QMessageBox::question to QMessageBox::warning
 	 to keep the Code compatible to Qt-3.1.x
 	 f.s 12.05.2004 */
-		over = QMessageBox::warning(carrier,
+		over = QMessageBox::warning(ScApp,
 				QObject::tr("File exists. Overwrite?"),
 				fileName +"\n"+ QObject::tr("exists already. Overwrite?"),
 				QObject::tr("No"),
@@ -166,16 +184,16 @@
 
 bool ExportBitmap::exportActual()
 {
-	return exportPage(carrier->doc->currentPage->pageNr(), true);
+	return exportPage(ScApp->doc->currentPage->pageNr(), true);
 }
 
 bool ExportBitmap::exportInterval(std::vector<int> &pageNs)
 {
 	bool res;
-	carrier->mainWindowProgressBar->setTotalSteps(pageNs.size());
+	ScApp->mainWindowProgressBar->setTotalSteps(pageNs.size());
 	for (uint a = 0; a < pageNs.size(); ++a)
 	{
-		carrier->mainWindowProgressBar->setProgress(a);
+		ScApp->mainWindowProgressBar->setProgress(a);
 		res = exportPage(pageNs[a]-1, false);
 		if (!res)
 			return false;
Index: plugins/pixmapexport/export.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/pixmapexport/export.h,v
retrieving revision 1.3.2.6
diff -u -r1.3.2.6 export.h
--- plugins/pixmapexport/export.h	11 Aug 2005 16:48:04 -0000	1.3.2.6
+++ plugins/pixmapexport/export.h	7 Sep 2005 16:53:15 -0000
@@ -3,35 +3,34 @@
 
 #include <qstring.h>
 #include <qfiledialog.h>
-#include "pluginapi.h"
-#include "scribus.h"
-#include "pluginmanager.h"
+#include <pluginapi.h>
+#include <scplugin.h>
+#include <vector>
 
 class ScrAction;
 
-/*! Calls the Plugin with the main Application window as parent
-	and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-
-
-/*! Returns the Name of the Plugin.
-	This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-
-
-/*! Returns the Type of the Plugin.
-  \retval 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  \retval 2 = the Plugin is a Import Plugin, which appears in the Import Menue
-  \retval 3 = the Plugin is a Export Plugin, which appears in the Export Menue
-  \retval 4 = the Plugin is a resident Plugin	*/
-extern "C" PLUGIN_API PluginManager::PluginType type();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class PLUGIN_API PixmapExportPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		PixmapExportPlugin();
+		virtual ~PixmapExportPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int scribusexportpixmap_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* scribusexportpixmap_getPlugin();
+extern "C" PLUGIN_API void scribusexportpixmap_freePlugin(ScPlugin* plugin);
+
+
 
 /*! Handles export. */
 class ExportBitmap: public QObject
@@ -39,7 +38,7 @@
 	Q_OBJECT
 public:
 	/*! Initializing the default export variables and attributes */
-	ExportBitmap(ScribusApp *plug);
+	ExportBitmap();
 	/*! nothing doing destructor. */
 	~ExportBitmap();
 
@@ -61,8 +60,6 @@
 	/*! Exports chosen interval of the pages */
 	bool exportInterval(std::vector<int> &pageNs);
 private:
-	/*! reference to the Scribus application object */
-	ScribusApp *carrier;
 	/*! create specified filename "docfilename-005.ext" */
 	QString getFileName(uint pageNr);
 	/*! export one specified page
Index: plugins/psimport/importps.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/psimport/importps.cpp,v
retrieving revision 1.7.2.36
diff -u -r1.7.2.36 importps.cpp
--- plugins/psimport/importps.cpp	7 Sep 2005 12:20:09 -0000	1.7.2.36
+++ plugins/psimport/importps.cpp	7 Sep 2005 16:53:15 -0000
@@ -2,6 +2,7 @@
 #include "importps.moc"
 
 #include "scconfig.h"
+#include "scribus.h"
 
 #include "customfdialog.h"
 #include "mpalette.h"
@@ -22,61 +23,69 @@
 #include "util.h"
 #include "prefsmanager.h"
 
-/*!
- \fn QString Name()
- \author Franz Schmid
- \date
- \brief Returns name of plugin
- \param None
- \retval QString containing name of plugin: Import EPS/PDF/PS...
- */
-QString name()
+int importps_getPluginAPIVersion()
 {
-	return QObject::tr("Import &EPS/PS...");
+	return PLUGIN_API_VERSION;
 }
 
-/*!
- \fn int Type()
- \author Franz Schmid
- \date
- \brief Returns type of plugin
- \param None
- \retval int containing type of plugin (1: Extra, 2: Import, 3: Export, 4: Resident Plugin)
- */
-PluginManager::PluginType type()
+ScPlugin* importps_getPlugin()
 {
-	return PluginManager::Import;
+	ImportPSPlugin* plug = new ImportPSPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void importps_freePlugin(ScPlugin* plugin)
 {
-	return 6;
+	ImportPSPlugin* plug = dynamic_cast<ImportPSPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-
-QString actionName()
+ImportPSPlugin::ImportPSPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Import)
 {
-	return "ImportPS";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+void ImportPSPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ImportPS";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Import &EPS/PS...");
+	// Menu
+	m_actionInfo.menu = "FileImport";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+ImportPSPlugin::~ImportPSPlugin() {};
+
+/*!
+ \fn QString Name()
+ \author Franz Schmid
+ \date
+ \brief Returns name of plugin
+ \param None
+ \retval QString containing name of plugin: Import EPS/PDF/PS...
+ */
+const QString ImportPSPlugin::fullTrName() const
 {
-	return "FileImport";
+	return QObject::tr("PS/EPS Importer");
 }
 
-QString actionMenuAfterName()
+
+const ScActionPlugin::AboutData* ImportPSPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void ImportPSPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
 /*!
@@ -84,45 +93,43 @@
  \author Franz Schmid
  \date
  \brief Run the EPS import
- \param d QWidget *
- \param plug ScribusApp *
+ \param fileNAme input filename, or QString::null to prompt.
  \retval None
  */
-void run(QWidget *d, ScribusApp *plug)
+bool ImportPSPlugin::run(QString fileName)
 {
-	QString fileName;
-	if (!plug->pluginManager->dllInput.isEmpty())
-	{
-		fileName = plug->pluginManager->dllInput;
+	bool interactive = fileName.isEmpty();
+	if (!interactive)
 		UndoManager::instance()->setUndoEnabled(false);
-	}
 	else
 	{
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("importps");
 		QString wdir = prefs->get("wdir", ".");
 		QString formats = QObject::tr("All Supported Formats (*.eps *.EPS *.ps *.PS);;");
 		formats += "EPS (*.eps *.EPS);;PS (*.ps *.PS);;" + QObject::tr("All Files (*)");
-		CustomFDialog diaf(d, wdir, QObject::tr("Open"), formats);
+		CustomFDialog diaf(ScApp, wdir, QObject::tr("Open"), formats);
 		if (diaf.exec())
 		{
 			fileName = diaf.selectedFile();
 			prefs->set("wdir", fileName.left(fileName.findRev("/")));
 		}
 		else
-			return;
+			return true;
 	}
-	if (UndoManager::undoEnabled() && plug->HaveDoc)
+	if (UndoManager::undoEnabled() && ScApp->HaveDoc)
 	{
-		UndoManager::instance()->beginTransaction(plug->doc->currentPage->getUName(),Um::IImageFrame,Um::ImportEPS, fileName, Um::IEPS);
+		UndoManager::instance()->beginTransaction(ScApp->doc->currentPage->getUName(),Um::IImageFrame,Um::ImportEPS, fileName, Um::IEPS);
 	}
-	else if (UndoManager::undoEnabled() && !plug->HaveDoc)
+	else if (UndoManager::undoEnabled() && !ScApp->HaveDoc)
 		UndoManager::instance()->setUndoEnabled(false);
-	EPSPlug *dia = new EPSPlug(plug, fileName);
+	EPSPlug *dia = new EPSPlug(fileName, interactive);
+	Q_CHECK_PTR(dia);
 	if (UndoManager::undoEnabled())
 		UndoManager::instance()->commit();
 	else
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;
+	return true;
 }
 
 /*!
@@ -135,8 +142,9 @@
  \param fName QString
  \retval EPSPlug plugin
  */
-EPSPlug::EPSPlug( ScribusApp *plug, QString fName )
+EPSPlug::EPSPlug(QString fName, bool isInteractive)
 {
+	interactive = isInteractive;
 	double x, y, b, h, c, m, k;
 	bool ret = false;
 	bool found = false;
@@ -229,29 +237,29 @@
 			}
 		}
 	}
-	Prog = plug;
-	if (!plug->pluginManager->dllInput.isEmpty())
+	Prog = ScApp;
+	if (!interactive)
 	{
-		Prog->doc->setPage(b-x, h-y, 0, 0, 0, 0, 0, 0, false, false);
-		Prog->view->addPage(0);
+		ScApp->doc->setPage(b-x, h-y, 0, 0, 0, 0, 0, 0, false, false);
+		ScApp->view->addPage(0);
 	}
 	else
 	{
-		if (!Prog->HaveDoc)
+		if (!ScApp->HaveDoc)
 		{
-			Prog->doFileNew(b-x, h-y, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom");
+			ScApp->doFileNew(b-x, h-y, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom");
 			ret = true;
 		}
 	}
-	if ((ret) || (!Prog->pluginManager->dllInput.isEmpty()))
+	if ((ret) || (!interactive))
 	{
 		if (b-x > h-y)
-			Prog->doc->PageOri = 1;
+			ScApp->doc->PageOri = 1;
 		else
-			Prog->doc->PageOri = 0;
-		Prog->doc->PageSize = "Custom";
+			ScApp->doc->PageOri = 0;
+		ScApp->doc->PageSize = "Custom";
 	}
-	Doku = plug->doc;
+	Doku = ScApp->doc;
 	ColorList::Iterator it;
 	for (it = CustColors.begin(); it != CustColors.end(); ++it)
 	{
@@ -263,16 +271,16 @@
 	FPoint maxSize = Doku->maxCanvasCoordinate;
 	Doku->setLoading(true);
 	Doku->DoDrawing = false;
-	Prog->view->setUpdatesEnabled(false);
-	Prog->ScriptRunning = true;
+	ScApp->view->setUpdatesEnabled(false);
+	ScApp->ScriptRunning = true;
 	qApp->setOverrideCursor(QCursor(waitCursor), true);
 	QString CurDirP = QDir::currentDirPath();
 	QDir::setCurrent(fi.dirPath());
 	if (convert(fName, x, y, b, h))
 	{
-		Prog->view->SelItem.clear();
+		ScApp->view->SelItem.clear();
 		QDir::setCurrent(CurDirP);
-		if ((Elements.count() > 1) && (plug->pluginManager->dllInput.isEmpty()))
+		if ((Elements.count() > 1) && (interactive))
 		{
 			for (uint a = 0; a < Elements.count(); ++a)
 			{
@@ -281,11 +289,11 @@
 			Doku->GroupCounter++;
 		}
 		Doku->DoDrawing = true;
-		Prog->view->setUpdatesEnabled(true);
-		Prog->ScriptRunning = false;
+		ScApp->view->setUpdatesEnabled(true);
+		ScApp->ScriptRunning = false;
 		Doku->setLoading(false);
 		qApp->setOverrideCursor(QCursor(arrowCursor), true);
-		if ((Elements.count() > 0) && (!ret) && (plug->pluginManager->dllInput.isEmpty()))
+		if ((Elements.count() > 0) && (!ret) && (interactive))
 		{
 			Doku->DragP = true;
 			Doku->DraggedElem = 0;
@@ -293,17 +301,17 @@
 			for (uint dre=0; dre<Elements.count(); ++dre)
 			{
 				Doku->DragElements.append(Elements.at(dre)->ItemNr);
-				Prog->view->SelItem.append(Elements.at(dre));
+				ScApp->view->SelItem.append(Elements.at(dre));
 			}
 			ScriXmlDoc *ss = new ScriXmlDoc();
-			Prog->view->setGroupRect();
-			QDragObject *dr = new QTextDrag(ss->WriteElem(&Prog->view->SelItem, Doku, Prog->view), Prog->view->viewport());
-			Prog->view->DeleteItem();
-			Prog->view->resizeContents(qRound((maxSize.x() - minSize.x()) * Prog->view->getScale()), qRound((maxSize.y() - minSize.y()) * Prog->view->getScale()));
-			Prog->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * Prog->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * Prog->view->getScale()));
+			ScApp->view->setGroupRect();
+			QDragObject *dr = new QTextDrag(ss->WriteElem(&ScApp->view->SelItem, Doku, ScApp->view), ScApp->view->viewport());
+			ScApp->view->DeleteItem();
+			ScApp->view->resizeContents(qRound((maxSize.x() - minSize.x()) * ScApp->view->getScale()), qRound((maxSize.y() - minSize.y()) * ScApp->view->getScale()));
+			ScApp->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * ScApp->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * ScApp->view->getScale()));
 			Doku->minCanvasCoordinate = minSize;
 			Doku->maxCanvasCoordinate = maxSize;
-			Prog->view->updateContents();
+			ScApp->view->updateContents();
 			dr->setPixmap(loadIcon("DragPix.xpm"));
 			dr->drag();
 			delete ss;
@@ -314,20 +322,19 @@
 		else
 		{
 			Doku->setModified(false);
-			Prog->slotDocCh();
+			ScApp->slotDocCh();
 		}
 	}
 	else
 	{
 		QDir::setCurrent(CurDirP);
 		Doku->DoDrawing = true;
-		Prog->view->setUpdatesEnabled(true);
-		Prog->ScriptRunning = false;
+		ScApp->view->setUpdatesEnabled(true);
+		ScApp->ScriptRunning = false;
 		qApp->setOverrideCursor(QCursor(arrowCursor), true);
 	}
-	if (plug->pluginManager->dllInput.isEmpty())
+	if (interactive)
 		Doku->setLoading(false);
-	plug->pluginManager->dllInput = "";
 }
 
 /*!
@@ -345,7 +352,7 @@
 	QString cmd1, cmd2, cmd3, tmp, tmp2, tmp3, tmp4;
 	// import.prolog do not cope with filenames containing blank spaces
 	// so take care that output filename does not (win32 compatibility)
-	QString tmpFile = getShortPathName(Prog->PrefsPfad)+ "/ps.out";
+	QString tmpFile = getShortPathName(ScApp->PrefsPfad)+ "/ps.out";
 	QString pfad = ScPaths::instance().libDir();
 	QString pfad2 = QDir::convertSeparators(pfad + "import.prolog");
 	QFileInfo fi = QFileInfo(fn);
@@ -426,9 +433,9 @@
 			QTextStream Code(&tmp, IO_ReadOnly);
 			Code >> token;
 			params = Code.read();
-			if ((lasttoken == "sp") && (!Prog->pluginManager->dllInput.isEmpty()) && (!eps))
+			if ((lasttoken == "sp") && (!interactive) && (!eps))
 			{
-				Prog->view->addPage(pagecount);
+				ScApp->view->addPage(pagecount);
 				pagecount++;
 			}
 			if (token == "n")
@@ -463,9 +470,9 @@
 					else
 					{
 						if (ClosedPath)
-							z = Prog->view->PaintPoly(0, 0, 10, 10, LineW, CurrColor, "None");
+							z = ScApp->view->PaintPoly(0, 0, 10, 10, LineW, CurrColor, "None");
 						else
-							z = Prog->view->PaintPolyLine(0, 0, 10, 10, LineW, CurrColor, "None");
+							z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, CurrColor, "None");
 						ite = Doku->Items.at(z);
 						ite->PoLine = Coords.copy();
 						ite->PoLine.translate(Doku->currentPage->xOffset(), Doku->currentPage->yOffset());
@@ -476,7 +483,7 @@
 						ite->Height = wh.y();
 						ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
 						ite->setFillTransparency(1.0 - Opacity);
-						Prog->view->AdjustItemSize(ite);
+						ScApp->view->AdjustItemSize(ite);
 						Elements.append(ite);
 					}
 					lastPath = currPath;
@@ -502,9 +509,9 @@
 					else
 					{
 						if (ClosedPath)
-							z = Prog->view->PaintPoly(0, 0, 10, 10, LineW, "None", CurrColor);
+							z = ScApp->view->PaintPoly(0, 0, 10, 10, LineW, "None", CurrColor);
 						else
-							z = Prog->view->PaintPolyLine(0, 0, 10, 10, LineW, "None", CurrColor);
+							z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, "None", CurrColor);
 						ite = Doku->Items.at(z);
 						ite->PoLine = Coords.copy();
 						ite->PoLine.translate(Doku->currentPage->xOffset(), Doku->currentPage->yOffset());
@@ -519,7 +526,7 @@
 						ite->Height = wh.y();
 						ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
 						ite->setLineTransparency(1.0 - Opacity);
-						Prog->view->AdjustItemSize(ite);
+						ScApp->view->AdjustItemSize(ite);
 						Elements.append(ite);
 					}
 					lastPath = currPath;
@@ -742,7 +749,7 @@
 	if (!found)
 	{
 		Doku->PageColors.insert("FromEPS"+tmp.name(), tmp);
-		Prog->propertiesPalette->Cpal->SetColors(Doku->PageColors);
+		ScApp->propertiesPalette->Cpal->SetColors(Doku->PageColors);
 		ret = "FromEPS"+tmp.name();
 	}
 	return ret;
Index: plugins/psimport/importps.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/psimport/importps.h,v
retrieving revision 1.2.2.8
diff -u -r1.2.2.8 importps.h
--- plugins/psimport/importps.h	11 Aug 2005 16:48:05 -0000	1.2.2.8
+++ plugins/psimport/importps.h	7 Sep 2005 16:53:15 -0000
@@ -3,33 +3,35 @@
 
 #include "pluginapi.h"
 #include "scribus.h"
-#include "pluginmanager.h"
+#include "scplugin.h"
 
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugins is a import Plugin, which appears in the Import Menue
-  * 3 = the Plugins is a export Plugin, which appears in the Export Menue */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class PLUGIN_API ImportPSPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		ImportPSPlugin();
+		virtual ~ImportPSPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int importps_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* importps_getPlugin();
+extern "C" PLUGIN_API void importps_freePlugin(ScPlugin* plugin);
 
 class EPSPlug : public QObject
 {
 	Q_OBJECT
 
 public:
-	EPSPlug( ScribusApp *plug, QString fName );
+	EPSPlug( QString fName, bool isInteractive );
 	~EPSPlug() {};
 	bool convert(QString fn, double x, double y, double b, double h);
 	void parseOutput(QString fn, bool eps);
@@ -48,6 +50,7 @@
 	bool FirstM, WasM, ClosedPath;
 	PenCapStyle CapStyle;
 	PenJoinStyle JoinStyle;
+	bool interactive;
 };
 
 #endif
Index: plugins/saveastemplateplugin/satdialog.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 satdialog.h
--- plugins/saveastemplateplugin/satdialog.h	14 Jan 2005 23:40:45 -0000	1.4.2.1
+++ plugins/saveastemplateplugin/satdialog.h	7 Sep 2005 16:53:15 -0000
@@ -28,6 +28,21 @@
 {
 	Q_OBJECT
 
+public:
+	satdialog(QWidget* parent, QString tmplName = "", int pageW = 0, int pageH = 0);
+	~satdialog();
+
+	std::vector<Pair*> cats;
+	QLineEdit* nameEdit;
+	QComboBox* catsCombo;
+	QLineEdit* psizeEdit;
+	QLineEdit* colorsEdit;
+	QTextEdit* descrEdit;
+	QTextEdit* usageEdit;
+	QLineEdit* authorEdit;
+	QLineEdit* emailEdit;
+private slots:
+	void detailClicked();
 private:
 	PrefsContext* prefs;
 	QLabel* nameLabel;
@@ -51,20 +66,6 @@
 	void writePrefs();
 	void setupCategories();
 	void setupPageSize(int w, int h);
-public:
-	std::vector<Pair*> cats;
-	QLineEdit* nameEdit;
-	QComboBox* catsCombo;
-	QLineEdit* psizeEdit;
-	QLineEdit* colorsEdit;
-	QTextEdit* descrEdit;
-	QTextEdit* usageEdit;
-	QLineEdit* authorEdit;
-	QLineEdit* emailEdit;
-	satdialog(QWidget* parent, QString tmplName = "", int pageW = 0, int pageH = 0);
-	~satdialog();
-private slots:
-	void detailClicked();
 };
 
 #endif
Index: plugins/saveastemplateplugin/satemplate.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp,v
retrieving revision 1.7.2.16
diff -u -r1.7.2.16 satemplate.cpp
--- plugins/saveastemplateplugin/satemplate.cpp	29 Jul 2005 21:34:54 -0000	1.7.2.16
+++ plugins/saveastemplateplugin/satemplate.cpp	7 Sep 2005 16:53:15 -0000
@@ -3,73 +3,79 @@
  ***************************************************************************/
 #include "satemplate.h"
 #include "satemplate.moc"
+#include "satdialog.h"
+#include "scribus.h"
 #include "prefsfile.h"
 #include "pluginmanager.h"
 #include "prefsmanager.h"
 
-ScribusApp* Carrier;
-QWidget* par;
-
-QString name()
+int saveastemplateplugin_getPluginAPIVersion()
 {
-    return QObject::tr("Save as &Template...");
+	return PLUGIN_API_VERSION;
 }
 
-PluginManager::PluginType type()
+ScPlugin* saveastemplateplugin_getPlugin()
 {
-	return PluginManager::Standard;
+	SaveAsTemplatePlugin* plug = new SaveAsTemplatePlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void saveastemplateplugin_freePlugin(ScPlugin* plugin)
 {
-	return 7;
+	SaveAsTemplatePlugin* plug = dynamic_cast<SaveAsTemplatePlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+SaveAsTemplatePlugin::SaveAsTemplatePlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Action)
 {
-	return "SaveAsDocumentTemplate";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
-{
-	return "Ctrl+Alt+S";
-}
+SaveAsTemplatePlugin::~SaveAsTemplatePlugin() {};
 
-QString actionMenu()
+void SaveAsTemplatePlugin::languageChange()
 {
-	return "File";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "SaveAsDocumentTemplate";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Save as &Template...");
+	// Shortcut
+	m_actionInfo.keySequence = "Ctrl+Alt+S";
+	// Menu
+	m_actionInfo.menu = "File";
+	m_actionInfo.menuAfterName = "SaveAs";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenuAfterName()
+const QString SaveAsTemplatePlugin::fullTrName() const
 {
-	return "SaveAs";
+	return QObject::tr("Save As Template");
 }
 
-bool actionEnabledOnStartup()
+const ScActionPlugin::AboutData* SaveAsTemplatePlugin::getAboutData() const
 {
-	return false;
+	return 0;
 }
-/*
-void InitPlug(QWidget *d, ScribusApp *plug)
+
+void SaveAsTemplatePlugin::deleteAboutData(const AboutData* about) const
 {
-	Carrier = plug;
-	par = d;
-	satm = new MenuSAT(d);
-	int id = plug->fileMenu->insertItem(QObject::tr("Save as &Template..."), -1, plug->fileMenu->indexOf(plug->M_FileSaveAs)+1);
-	plug->fileMenu->connectItem(id, satm, SLOT(RunSATPlug()));
-	plug->fileMenu->setItemEnabled(id, 0);
-	plug->MenuItemsFile.append(id);
 }
-*/
-void cleanUpPlug()
-{}
 
-void run(QWidget *d, ScribusApp *plug)
+bool SaveAsTemplatePlugin::run(QString target)
 {
-	Carrier = plug;
-	par = d;
-	Sat = new MenuSAT(d);
+	Q_ASSERT(target.isEmpty());
+	Sat = new MenuSAT();
 	Sat->RunSATPlug();
+	delete Sat;
+	Sat = 0;
+	return true;
 }
 
 void MenuSAT::RunSATPlug()
@@ -80,9 +86,9 @@
 		templates.mkdir("templates");
 	}
 	QString currentDirPath = QDir::currentDirPath();
-	QString currentFile = Carrier->doc->DocName;
-	bool hasName = Carrier->doc->hasName;
-	bool isModified = Carrier->doc->isModified();
+	QString currentFile = ScApp->doc->DocName;
+	bool hasName = ScApp->doc->hasName;
+	bool isModified = ScApp->doc->isModified();
 	QString userTemplatesDir = PrefsManager::instance()->appPrefs.documentTemplatesDir;
 	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 	QString oldCollect = dirs->get("collect", ".");
@@ -96,36 +102,36 @@
 		templatesDir = userTemplatesDir;
 	}
 	dirs->set("collect", templatesDir);
-	if (Carrier->Collect().isEmpty())
+	if (ScApp->Collect().isEmpty())
 		return;
 	if (oldCollect != ".")
 		dirs->set("collect", oldCollect);
-	QString docPath = Carrier->doc->DocName;
+	QString docPath = ScApp->doc->DocName;
 	QString docDir = docPath.left(docPath.findRev('/'));
 	QString docName = docPath.right(docPath.length() - docPath.findRev('/') - 1);
 	docName = docName.left(docName.findRev(".s"));
 
-	if (currentFile !=  Carrier->doc->DocName)
+	if (currentFile !=  ScApp->doc->DocName)
 	{
-		satdialog* satdia = new satdialog(par,docName,
-                                          static_cast<int>(Carrier->doc->pageWidth + 0.5),
-                                          static_cast<int>(Carrier->doc->pageHeight + 0.5));
+		satdialog* satdia = new satdialog(ScApp,docName,
+                                          static_cast<int>(ScApp->doc->pageWidth + 0.5),
+                                          static_cast<int>(ScApp->doc->pageHeight + 0.5));
 		if (satdia->exec())
 		{
-			sat* s = new sat(Carrier, satdia, docPath.right(docPath.length() - docPath.findRev('/') - 1),docDir);
+			sat* s = new sat(ScApp, satdia, docPath.right(docPath.length() - docPath.findRev('/') - 1),docDir);
 			s->createImages();
 			s->createTmplXml();
 			delete s;
 		}
-		// Restore the state that was before Carrier->Collect()
-		Carrier->doc->DocName = currentFile;
-		Carrier->doc->hasName = hasName;
-		Carrier->doc->setModified(isModified);
+		// Restore the state that was before ScApp->Collect()
+		ScApp->doc->DocName = currentFile;
+		ScApp->doc->hasName = hasName;
+		ScApp->doc->setModified(isModified);
 		if (isModified)
-			Carrier->ActWin->setCaption(currentFile+"*");
+			ScApp->ActWin->setCaption(currentFile+"*");
 		else
-			Carrier->ActWin->setCaption(currentFile);
-		Carrier->removeRecent(docPath);
+			ScApp->ActWin->setCaption(currentFile);
+		ScApp->removeRecent(docPath);
 		QDir::setCurrent(currentDirPath);
 		delete satdia;
 	}
Index: plugins/saveastemplateplugin/satemplate.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h,v
retrieving revision 1.5.2.7
diff -u -r1.5.2.7 satemplate.h
--- plugins/saveastemplateplugin/satemplate.h	11 Aug 2005 16:48:07 -0000	1.5.2.7
+++ plugins/saveastemplateplugin/satemplate.h	7 Sep 2005 16:53:15 -0000
@@ -4,38 +4,33 @@
 #include <qobject.h>
 #include <qdatetime.h>
 #include <qdir.h>
-#include <scribus.h>
-#include <pluginmanager.h>
 
 #include "pluginapi.h"
-#include "satdialog.h"
+#include "scplugin.h"
+
+class PLUGIN_API SaveAsTemplatePlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		SaveAsTemplatePlugin();
+		virtual ~SaveAsTemplatePlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int saveastemplateplugin_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* saveastemplateplugin_getPlugin();
+extern "C" PLUGIN_API void saveastemplateplugin_freePlugin(ScPlugin* plugin);
 
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-
-
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugin is a Import Plugin, which appears in the Import Menue
-  * 3 = the Plugin is a Export Plugin, which appears in the Export Menue
-  * 4 = the Plugin is a resident Plugin   */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-
-///** Initializes the Plugin if it's a Plugin of Type 4 or 5 */
-//extern "C" void InitPlug(QWidget *d, ScribusApp *plug);
-
-/** Possible CleanUpOperations when closing the Plugin */
-extern "C" PLUGIN_API void cleanUpPlug();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
 
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
+class satdialog;
 
 
 class MenuSAT : public QObject
@@ -43,7 +38,7 @@
 	Q_OBJECT
 
 public:
-	MenuSAT(QWidget* /*parent*/) {};
+	MenuSAT() {};
     ~MenuSAT() {};
 
 public slots:
Index: plugins/scriptplugin/cmdcolor.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp,v
retrieving revision 1.5.2.15
diff -u -r1.5.2.15 cmdcolor.cpp
--- plugins/scriptplugin/cmdcolor.cpp	28 Jul 2005 19:12:38 -0000	1.5.2.15
+++ plugins/scriptplugin/cmdcolor.cpp	7 Sep 2005 16:53:15 -0000
@@ -7,7 +7,7 @@
 	ColorList edc;
 	PyObject *l;
 	int cc = 0;
-	edc = Carrier->HaveDoc ? Carrier->doc->PageColors : PrefsManager::instance()->colorSet();
+	edc = ScApp->HaveDoc ? ScApp->doc->PageColors : PrefsManager::instance()->colorSet();
 	ColorList::Iterator it;
 	l = PyList_New(edc.count());
 	for (it = edc.begin(); it != edc.end(); ++it)
@@ -30,7 +30,7 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot get a color with an empty name.","python error"));
 		return NULL;
 	}
-	edc = Carrier->HaveDoc ? Carrier->doc->PageColors : PrefsManager::instance()->colorSet();
+	edc = ScApp->HaveDoc ? ScApp->doc->PageColors : PrefsManager::instance()->colorSet();
 	QString col = QString::fromUtf8(Name);
 	if (!edc.contains(col))
 	{
@@ -52,7 +52,7 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot get a color with an empty name.","python error"));
 		return NULL;
 	}
-	edc = Carrier->HaveDoc ? Carrier->doc->PageColors : PrefsManager::instance()->colorSet();
+	edc = ScApp->HaveDoc ? ScApp->doc->PageColors : PrefsManager::instance()->colorSet();
 	QString col = QString::fromUtf8(Name);
 	if (!edc.contains(col))
 	{
@@ -75,14 +75,14 @@
 		return NULL;
 	}
 	QString col = QString::fromUtf8(Name);
-	if (Carrier->HaveDoc)
+	if (ScApp->HaveDoc)
 	{
-		if (!Carrier->doc->PageColors.contains(col))
+		if (!ScApp->doc->PageColors.contains(col))
 		{
 			PyErr_SetString(NotFoundError, QObject::tr("Color not found in document.","python error"));
 			return NULL;
 		}
-		Carrier->doc->PageColors[col].setColor(c, m, y, k);
+		ScApp->doc->PageColors[col].setColor(c, m, y, k);
 	}
 	else
 	{
@@ -110,14 +110,14 @@
 		return NULL;
 	}
 	QString col = QString::fromUtf8(Name);
-	if (Carrier->HaveDoc)
+	if (ScApp->HaveDoc)
 		{
-			if (!Carrier->doc->PageColors.contains(col))
-				Carrier->doc->PageColors.insert(col, ScColor(c, m, y, k));
+			if (!ScApp->doc->PageColors.contains(col))
+				ScApp->doc->PageColors.insert(col, ScColor(c, m, y, k));
 			else
 				// FIXME: Given that we have a changeColour function, should we really be
 				// silently changing colours in newColour?
-				Carrier->doc->PageColors[col].setColor(c, m, y, k);
+				ScApp->doc->PageColors[col].setColor(c, m, y, k);
 		}
 	else
 		{
@@ -146,11 +146,11 @@
 	}
 	QString col = QString::fromUtf8(Name);
 	QString rep = QString::fromUtf8(Repl);
-	if (Carrier->HaveDoc)
+	if (ScApp->HaveDoc)
 	{
-		if (Carrier->doc->PageColors.contains(col) && (Carrier->doc->PageColors.contains(rep) || (rep == "None")))
+		if (ScApp->doc->PageColors.contains(col) && (ScApp->doc->PageColors.contains(rep) || (rep == "None")))
 			{
-				Carrier->doc->PageColors.remove(col);
+				ScApp->doc->PageColors.remove(col);
 				ReplaceColor(col, rep);
 			}
 		else
@@ -190,7 +190,7 @@
 	}
 	QString col = QString::fromUtf8(Name);
 	QString rep = QString::fromUtf8(Repl);
-	if (Carrier->doc->PageColors.contains(col) && (Carrier->doc->PageColors.contains(rep) || (rep == "None")))
+	if (ScApp->doc->PageColors.contains(col) && (ScApp->doc->PageColors.contains(rep) || (rep == "None")))
 		ReplaceColor(col, rep);
 	else
 	{
Index: plugins/scriptplugin/cmddialog.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp,v
retrieving revision 1.12.2.20
diff -u -r1.12.2.20 cmddialog.cpp
--- plugins/scriptplugin/cmddialog.cpp	17 Aug 2005 15:14:46 -0000	1.12.2.20
+++ plugins/scriptplugin/cmddialog.cpp	7 Sep 2005 16:53:15 -0000
@@ -9,7 +9,7 @@
 PyObject *scribus_newdocdia(PyObject* /* self */)
 {
 	QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-	bool ret = Carrier->slotFileNew();
+	bool ret = ScApp->slotFileNew();
 	QApplication::restoreOverrideCursor();
 	return PyInt_FromLong(static_cast<long>(ret));
 }
@@ -40,7 +40,7 @@
 	Due the 'isdir' parameter. CFileDialog needs the last 2 pointers
 	initialized. */
 	bool nobool = false;
-	QString fName = Carrier->CFileDialog(".",
+	QString fName = ScApp->CFileDialog(".",
 										 QString::fromUtf8(caption),
 										 QString::fromUtf8(filter),
 										 QString::fromUtf8(defName),
@@ -72,7 +72,7 @@
 	if (!PyArg_ParseTupleAndKeywords(args, kw, "eses|iiii", kwargs, "utf-8", &caption, "utf-8", &message, &ico, &butt1, &butt2, &butt3))
 		return NULL;
 	QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-	QMessageBox mb(QString::fromUtf8(caption), QString::fromUtf8(message), ico, butt1, butt2, butt3, Carrier);
+	QMessageBox mb(QString::fromUtf8(caption), QString::fromUtf8(message), ico, butt1, butt2, butt3, ScApp);
 	result = mb.exec();
 	QApplication::restoreOverrideCursor();
 	return PyInt_FromLong(static_cast<long>(result));
@@ -86,7 +86,7 @@
 	if (!PyArg_ParseTuple(args, "eses|es", "utf-8", &caption, "utf-8", &message, "utf-8", &value))
 		return NULL;
 	QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-	ValueDialog *d = new ValueDialog(Carrier, "d", true, 0);
+	ValueDialog *d = new ValueDialog(ScApp, "d", true, 0);
 	d->dialogLabel->setText(QString::fromUtf8(message));
 	d->valueEdit->setText(QString::fromUtf8(value));
 	d->setCaption(QString::fromUtf8(caption));
@@ -102,17 +102,17 @@
 	series.
 	It simulates user mouse clicking in the style dialogs. Ugly.
 	Unpleasant. Etc. But working. */
-	uint styleCount = Carrier->doc->docParagraphStyles.count();
-	StilFormate *dia2 = new StilFormate(Carrier, Carrier->doc);
+	uint styleCount = ScApp->doc->docParagraphStyles.count();
+	StilFormate *dia2 = new StilFormate(ScApp, ScApp->doc);
 	QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
 	dia2->neuesFormat();
 	QApplication::restoreOverrideCursor();
-	Carrier->saveStyles(dia2);
+	ScApp->saveStyles(dia2);
 	delete dia2;
-	if (styleCount == Carrier->doc->docParagraphStyles.count())
+	if (styleCount == ScApp->doc->docParagraphStyles.count())
 	{
 		Py_INCREF(Py_None);
 		return Py_None;
 	}
-	return PyString_FromString(Carrier->doc->docParagraphStyles[Carrier->doc->docParagraphStyles.count() - 1].Vname.utf8());
+	return PyString_FromString(ScApp->doc->docParagraphStyles[ScApp->doc->docParagraphStyles.count() - 1].Vname.utf8());
 }
Index: plugins/scriptplugin/cmddoc.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp,v
retrieving revision 1.9.2.25
diff -u -r1.9.2.25 cmddoc.cpp
--- plugins/scriptplugin/cmddoc.cpp	7 Sep 2005 12:20:09 -0000	1.9.2.25
+++ plugins/scriptplugin/cmddoc.cpp	7 Sep 2005 16:53:16 -0000
@@ -24,7 +24,7 @@
 	lr = value2pts(lr, unit);
 	rr = value2pts(rr, unit);
 	btr = value2pts(btr, unit);
-	bool ret = Carrier->doFileNew(b, h, tpr, lr, rr, btr, 0, 1, false, ds, unit, fsl, ori, fNr, "Custom");
+	bool ret = ScApp->doFileNew(b, h, tpr, lr, rr, btr, 0, 1, false, ds, unit, fsl, ori, fNr, "Custom");
 	//	qApp->processEvents();
 	return PyInt_FromLong(static_cast<long>(ret));
 }
@@ -40,11 +40,11 @@
 	lr = ValueToPoint(lr);
 	rr = ValueToPoint(rr);
 	btr = ValueToPoint(btr);
-	Carrier->doc->resetPage(tpr, lr, rr, btr, Carrier->doc->currentPageLayout);
-	Carrier->view->reformPages();
-	Carrier->doc->setModified(true);
-	Carrier->view->GotoPage(Carrier->doc->currentPage->pageNr());
-	Carrier->view->DrawNew();
+	ScApp->doc->resetPage(tpr, lr, rr, btr, ScApp->doc->currentPageLayout);
+	ScApp->view->reformPages();
+	ScApp->doc->setModified(true);
+	ScApp->view->GotoPage(ScApp->doc->currentPage->pageNr());
+	ScApp->view->DrawNew();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -53,15 +53,15 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->doc->setModified(false);
-	bool ret = Carrier->slotFileClose();
+	ScApp->doc->setModified(false);
+	bool ret = ScApp->slotFileClose();
 	qApp->processEvents();
 	return PyInt_FromLong(static_cast<long>(ret));
 }
 
 PyObject *scribus_havedoc(PyObject* /* self */)
 {
-	return PyInt_FromLong(static_cast<long>(Carrier->HaveDoc));
+	return PyInt_FromLong(static_cast<long>(ScApp->HaveDoc));
 }
 
 PyObject *scribus_opendoc(PyObject* /* self */, PyObject* args)
@@ -69,7 +69,7 @@
 	char *Name;
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &Name))
 		return NULL;
-	bool ret = Carrier->loadDoc(QString::fromUtf8(Name));
+	bool ret = ScApp->loadDoc(QString::fromUtf8(Name));
 	if (!ret)
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Failed to open document.","python error"));
@@ -83,7 +83,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->slotFileSave();
+	ScApp->slotFileSave();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -95,7 +95,7 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	bool ret = Carrier->DoFileSave(QString::fromUtf8(Name));
+	bool ret = ScApp->DoFileSave(QString::fromUtf8(Name));
 	if (!ret)
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Failed to save document.","python error"));
@@ -116,10 +116,10 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->doc->documentInfo.setAuthor(QString::fromUtf8(Author));
-	Carrier->doc->documentInfo.setTitle(QString::fromUtf8(Title));
-	Carrier->doc->documentInfo.setComments(QString::fromUtf8(Desc));
-	Carrier->slotDocCh();
+	ScApp->doc->documentInfo.setAuthor(QString::fromUtf8(Author));
+	ScApp->doc->documentInfo.setTitle(QString::fromUtf8(Title));
+	ScApp->doc->documentInfo.setComments(QString::fromUtf8(Desc));
+	ScApp->slotDocCh();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -136,7 +136,7 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Unit out of range. Use one of the scribus.UNIT_* constants.","python error"));
 		return NULL;
 	}
-	Carrier->slotChangeUnit(e);
+	ScApp->slotChangeUnit(e);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -145,7 +145,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	return PyInt_FromLong(static_cast<long>(Carrier->doc->unitIndex()));
+	return PyInt_FromLong(static_cast<long>(ScApp->doc->unitIndex()));
 }
 
 PyObject *scribus_loadstylesfromfile(PyObject* /* self */, PyObject *args)
@@ -155,7 +155,7 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->doc->loadStylesFromFile(QString::fromUtf8(fileName));
+	ScApp->doc->loadStylesFromFile(QString::fromUtf8(fileName));
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -167,13 +167,13 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	if (Carrier->doc->currentPageLayout = fp)
-		Carrier->doc->pageSets[Carrier->doc->currentPageLayout].FirstPage = fsl;
-	Carrier->view->reformPages();
-	Carrier->view->GotoPage(Carrier->doc->currentPage->pageNr()); // is this needed?
-	Carrier->view->DrawNew();   // is this needed?
-	//CB TODO Carrier->pagePalette->RebuildPage(); // is this needed?
-	Carrier->slotDocCh();
+	if (ScApp->doc->currentPageLayout = fp)
+		ScApp->doc->pageSets[ScApp->doc->currentPageLayout].FirstPage = fsl;
+	ScApp->view->reformPages();
+	ScApp->view->GotoPage(ScApp->doc->currentPage->pageNr()); // is this needed?
+	ScApp->view->DrawNew();   // is this needed?
+	//CB TODO ScApp->pagePalette->RebuildPage(); // is this needed?
+	ScApp->slotDocCh();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
Index: plugins/scriptplugin/cmdgetprop.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp,v
retrieving revision 1.8.2.18
diff -u -r1.8.2.18 cmdgetprop.cpp
--- plugins/scriptplugin/cmdgetprop.cpp	11 Jul 2005 15:40:14 -0000	1.8.2.18
+++ plugins/scriptplugin/cmdgetprop.cpp	7 Sep 2005 16:53:16 -0000
@@ -198,28 +198,28 @@
 	// have doc already
 	if (typ != -1)
 	{
-		for (uint lam2 = 0; lam2 < Carrier->doc->Items.count(); ++lam2)
+		for (uint lam2 = 0; lam2 < ScApp->doc->Items.count(); ++lam2)
 		{
-			if (Carrier->doc->Items.at(lam2)->itemType() == typ)
+			if (ScApp->doc->Items.at(lam2)->itemType() == typ)
 				counter++;
 		}
 	}
 	else
-		counter = Carrier->doc->Items.count();
+		counter = ScApp->doc->Items.count();
 
 	l = PyList_New(counter);
-	for (uint lam=0; lam < Carrier->doc->Items.count(); ++lam)
+	for (uint lam=0; lam < ScApp->doc->Items.count(); ++lam)
 	{
 		if (typ != -1)
 		{
-			if (Carrier->doc->Items.at(lam)->itemType() == typ)
+			if (ScApp->doc->Items.at(lam)->itemType() == typ)
 			{
-				PyList_SetItem(l, counter2, PyString_FromString(Carrier->doc->Items.at(lam)->itemName().utf8()));
+				PyList_SetItem(l, counter2, PyString_FromString(ScApp->doc->Items.at(lam)->itemName().utf8()));
 				counter2++;
 			}
 		}
 		else
-			PyList_SetItem(l, lam, PyString_FromString(Carrier->doc->Items.at(lam)->itemName().utf8()));
+			PyList_SetItem(l, lam, PyString_FromString(ScApp->doc->Items.at(lam)->itemName().utf8()));
 	}
 	return l;
 }
Index: plugins/scriptplugin/cmdmani.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp,v
retrieving revision 1.7.2.28
diff -u -r1.7.2.28 cmdmani.cpp
--- plugins/scriptplugin/cmdmani.cpp	7 Sep 2005 12:20:09 -0000	1.7.2.28
+++ plugins/scriptplugin/cmdmani.cpp	7 Sep 2005 16:53:16 -0000
@@ -17,7 +17,7 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Target is not an image frame.","python error"));
 		return NULL;
 	}
-	Carrier->view->LoadPict(QString::fromUtf8(Image), item->ItemNr);
+	ScApp->view->LoadPict(QString::fromUtf8(Image), item->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -40,8 +40,8 @@
 	}
 	item->LocalScX = x;
 	item->LocalScY = y;
-	Carrier->view->ChLocalSc(x, y);
-	Carrier->view->UpdatePic();
+	ScApp->view->ChLocalSc(x, y);
+	ScApp->view->UpdatePic();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -58,22 +58,22 @@
 	if (item==NULL)
 		return NULL;
 	// Grab the old selection
-	QPtrList<PageItem> oldSelection = Carrier->view->SelItem;
+	QPtrList<PageItem> oldSelection = ScApp->view->SelItem;
 	// Clear the selection
-	Carrier->view->Deselect();
+	ScApp->view->Deselect();
 	// Select the item, which will also select its group if
 	// there is one.
-	Carrier->view->SelectItemNr(item->ItemNr);
+	ScApp->view->SelectItemNr(item->ItemNr);
 	// Move the item, or items
-	if (Carrier->view->SelItem.count() > 1)
-		Carrier->view->moveGroup(ValueToPoint(x), ValueToPoint(y));
+	if (ScApp->view->SelItem.count() > 1)
+		ScApp->view->moveGroup(ValueToPoint(x), ValueToPoint(y));
 	else
-		Carrier->view->MoveItem(ValueToPoint(x), ValueToPoint(y), item);
+		ScApp->view->MoveItem(ValueToPoint(x), ValueToPoint(y), item);
 	// Now restore the selection. We just have to go through and select
 	// each and every item, unfortunately.
-	Carrier->view->Deselect();
+	ScApp->view->Deselect();
 	for ( oldSelection.first(); oldSelection.current(); oldSelection.next() )
-		Carrier->view->SelectItemNr(oldSelection.current()->ItemNr);
+		ScApp->view->SelectItemNr(oldSelection.current()->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -90,26 +90,26 @@
 	if (item == NULL)
 		return NULL;
 	// Grab the old selection
-	QPtrList<PageItem> oldSelection = Carrier->view->SelItem;
+	QPtrList<PageItem> oldSelection = ScApp->view->SelItem;
 	// Clear the selection
-	Carrier->view->Deselect();
+	ScApp->view->Deselect();
 	// Select the item, which will also select its group if
 	// there is one.
-	Carrier->view->SelectItemNr(item->ItemNr);
+	ScApp->view->SelectItemNr(item->ItemNr);
 	// Move the item, or items
-	if (Carrier->view->SelItem.count() > 1)
+	if (ScApp->view->SelItem.count() > 1)
 	{
 		double x2, y2, w, h;
-		Carrier->view->getGroupRect(&x2, &y2, &w, &h);
-		Carrier->view->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
+		ScApp->view->getGroupRect(&x2, &y2, &w, &h);
+		ScApp->view->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
 	}
 	else
-		Carrier->view->MoveItem(pageUnitXToDocX(x) - item->Xpos, pageUnitYToDocY(y) - item->Ypos, item);
+		ScApp->view->MoveItem(pageUnitXToDocX(x) - item->Xpos, pageUnitYToDocY(y) - item->Ypos, item);
 	// Now restore the selection. We just have to go through and select
 	// each and every item, unfortunately.
-	Carrier->view->Deselect();
+	ScApp->view->Deselect();
 	for ( oldSelection.first(); oldSelection.current(); oldSelection.next() )
-		Carrier->view->SelectItemNr(oldSelection.current()->ItemNr);
+		ScApp->view->SelectItemNr(oldSelection.current()->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -125,7 +125,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
 	if (item == NULL)
 		return NULL;
-	Carrier->view->RotateItem(item->Rot - x, item->ItemNr);
+	ScApp->view->RotateItem(item->Rot - x, item->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -141,7 +141,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
 	if (item == NULL)
 		return NULL;
-	Carrier->view->RotateItem(x * -1.0, item->ItemNr);
+	ScApp->view->RotateItem(x * -1.0, item->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -157,7 +157,7 @@
 	PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
 	if (item == NULL)
 		return NULL;
-	Carrier->view->SizeItem(ValueToPoint(x), ValueToPoint(y), item->ItemNr);
+	ScApp->view->SizeItem(ValueToPoint(x), ValueToPoint(y), item->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -170,7 +170,7 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	uint ap = Carrier->doc->currentPage->pageNr();
+	uint ap = ScApp->doc->currentPage->pageNr();
 	// If we were passed a list of items to group...
 	if (il != 0)
 	{
@@ -182,7 +182,7 @@
 			return NULL;
 		}
 		QStringList oldSelection = getSelectedItemsByName();
-		Carrier->view->Deselect();
+		ScApp->view->Deselect();
 		for (int i = 0; i < len; i++)
 		{
 			// FIXME: We might need to explicitly get this string as utf8
@@ -192,22 +192,22 @@
 			PageItem *ic = GetUniqueItem(QString::fromUtf8(Name));
 			if (ic == NULL)
 				return NULL;
-			Carrier->view->SelectItemNr(ic->ItemNr);
+			ScApp->view->SelectItemNr(ic->ItemNr);
 		}
-		Carrier->GroupObj();
+		ScApp->GroupObj();
 		setSelectedItemsByName(oldSelection);
 	}
 	// or if no argument list was given but there is a selection...
-	else if (Carrier->view->SelItem.count() != 0)
+	else if (ScApp->view->SelItem.count() != 0)
 	{
-		if (Carrier->view->SelItem.count() < 2)
+		if (ScApp->view->SelItem.count() < 2)
 		{
 			// We can't very well group only one item
 			PyErr_SetString(NoValidObjectError, QObject::tr("Can't group less than two items", "python error"));
 			return NULL;
 		}
-		Carrier->GroupObj();
-		Carrier->view->GotoPage(ap);
+		ScApp->GroupObj();
+		ScApp->view->GotoPage(ap);
 	}
 	else
 	{
@@ -228,7 +228,7 @@
 	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
-	Carrier->UnGroupObj();
+	ScApp->UnGroupObj();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -249,12 +249,12 @@
 	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
-	Carrier->view->Deselect();
-	Carrier->view->SelectItemNr(i->ItemNr);
-	int h = Carrier->view->HowTo;
-	Carrier->view->HowTo = 1;
-	Carrier->view->scaleGroup(sc, sc);
-	Carrier->view->HowTo = h;
+	ScApp->view->Deselect();
+	ScApp->view->SelectItemNr(i->ItemNr);
+	int h = ScApp->view->HowTo;
+	ScApp->view->HowTo = 1;
+	ScApp->view->scaleGroup(sc, sc);
+	ScApp->view->HowTo = h;
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -266,8 +266,8 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	if ((i < static_cast<int>(Carrier->view->SelItem.count())) && (i > -1))
-		return PyString_FromString(Carrier->view->SelItem.at(i)->itemName().utf8());
+	if ((i < static_cast<int>(ScApp->view->SelItem.count())) && (i > -1))
+		return PyString_FromString(ScApp->view->SelItem.at(i)->itemName().utf8());
 	else
 		// FIXME: Should probably return None if no selection?
 		return PyString_FromString("");
@@ -277,7 +277,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	return PyInt_FromLong(static_cast<long>(Carrier->view->SelItem.count()));
+	return PyInt_FromLong(static_cast<long>(ScApp->view->SelItem.count()));
 }
 
 PyObject *scribus_selectobj(PyObject* /* self */, PyObject* args)
@@ -290,7 +290,7 @@
 	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
-	Carrier->view->SelectItemNr(i->ItemNr);
+	ScApp->view->SelectItemNr(i->ItemNr);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -299,7 +299,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->view->Deselect();
+	ScApp->view->Deselect();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -363,8 +363,8 @@
 	if (proportional != -1)
 		item->AspectRatio = proportional > 0;
 	// Force the braindead app to notice the changes
-	Carrier->view->AdjustPictScale(item);
-	Carrier->view->RefreshItem(item);
+	ScApp->view->AdjustPictScale(item);
+	ScApp->view->RefreshItem(item);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
Index: plugins/scriptplugin/cmdmisc.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp,v
retrieving revision 1.12.2.26
diff -u -r1.12.2.26 cmdmisc.cpp
--- plugins/scriptplugin/cmdmisc.cpp	4 Aug 2005 22:53:31 -0000	1.12.2.26
+++ plugins/scriptplugin/cmdmisc.cpp	7 Sep 2005 16:53:16 -0000
@@ -14,7 +14,7 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->doc->DoDrawing = static_cast<bool>(e);
+	ScApp->doc->DoDrawing = static_cast<bool>(e);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -139,9 +139,9 @@
 	if(!checkHaveDocument())
 		return NULL;
 	PyObject *l;
-	l = PyList_New(Carrier->doc->Layers.count());
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); lam++)
-		PyList_SetItem(l, lam, PyString_FromString(Carrier->doc->Layers[lam].Name.utf8()));
+	l = PyList_New(ScApp->doc->Layers.count());
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); lam++)
+		PyList_SetItem(l, lam, PyString_FromString(ScApp->doc->Layers[lam].Name.utf8()));
 	return l;
 }
 
@@ -157,9 +157,9 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
 		return NULL;
 	}
-	bool found = Carrier->doc->setActiveLayer(QString::fromUtf8(Name));
+	bool found = ScApp->doc->setActiveLayer(QString::fromUtf8(Name));
 	if (found)
-		Carrier->changeLayer(Carrier->doc->activeLayer());
+		ScApp->changeLayer(ScApp->doc->activeLayer());
 	else
 	{
 		PyErr_SetString(NotFoundError, QObject::tr("Layer not found.","python error"));
@@ -173,7 +173,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	return PyString_FromString(Carrier->doc->activeLayerName().utf8());
+	return PyString_FromString(ScApp->doc->activeLayerName().utf8());
 }
 
 PyObject *scribus_senttolayer(PyObject* /* self */, PyObject* args)
@@ -192,13 +192,13 @@
 	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
-	Carrier->view->SelectItemNr(i->ItemNr);
+	ScApp->view->SelectItemNr(i->ItemNr);
 	bool found = false;
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); ++lam)
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); ++lam)
 	{
-		Carrier->view->SelectItemNr(i->ItemNr);
-		for (uint lam=0; lam < Carrier->doc->Layers.count(); ++lam)
-			if (Carrier->doc->Layers[lam].Name == QString::fromUtf8(Layer))
+		ScApp->view->SelectItemNr(i->ItemNr);
+		for (uint lam=0; lam < ScApp->doc->Layers.count(); ++lam)
+			if (ScApp->doc->Layers[lam].Name == QString::fromUtf8(Layer))
 			{
 				i->LayerNr = static_cast<int>(lam);
 				found = true;
@@ -229,11 +229,11 @@
 		return NULL;
 	}
 	bool found = false;
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); ++lam)
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); ++lam)
 	{
-		if (Carrier->doc->Layers[lam].Name == QString::fromUtf8(Name))
+		if (ScApp->doc->Layers[lam].Name == QString::fromUtf8(Name))
 		{
-			Carrier->doc->Layers[lam].isViewable = vis;
+			ScApp->doc->Layers[lam].isViewable = vis;
 			found = true;
 			break;
 		}
@@ -261,11 +261,11 @@
 		return NULL;
 	}
 	bool found = false;
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); ++lam)
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); ++lam)
 	{
-		if (Carrier->doc->Layers[lam].Name == QString::fromUtf8(Name))
+		if (ScApp->doc->Layers[lam].Name == QString::fromUtf8(Name))
 		{
-			Carrier->doc->Layers[lam].isPrintable = vis;
+			ScApp->doc->Layers[lam].isPrintable = vis;
 			found = true;
 			break;
 		}
@@ -293,11 +293,11 @@
 	}
 	int i = 0;
 	bool found = false;
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); lam++)
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); lam++)
 	{
-		if (Carrier->doc->Layers[lam].Name == QString::fromUtf8(Name))
+		if (ScApp->doc->Layers[lam].Name == QString::fromUtf8(Name))
 		{
-			i = static_cast<int>(Carrier->doc->Layers[lam].isViewable);
+			i = static_cast<int>(ScApp->doc->Layers[lam].isViewable);
 			found = true;
 			break;
 		}
@@ -324,11 +324,11 @@
 	}
 	int i = 0;
 	bool found = false;
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); ++lam)
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); ++lam)
 	{
-		if (Carrier->doc->Layers[lam].Name == QString::fromUtf8(Name))
+		if (ScApp->doc->Layers[lam].Name == QString::fromUtf8(Name))
 		{
-			i = static_cast<int>(Carrier->doc->Layers[lam].isPrintable);
+			i = static_cast<int>(ScApp->doc->Layers[lam].isPrintable);
 			found = true;
 			break;
 		}
@@ -353,17 +353,17 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
 		return NULL;
 	}
-	if (Carrier->doc->Layers.count() == 1)
+	if (ScApp->doc->Layers.count() == 1)
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Cannot remove the last layer.","python error"));
 		return NULL;
 	}
 	bool found = false;
-	for (uint lam=0; lam < Carrier->doc->Layers.count(); ++lam)
+	for (uint lam=0; lam < ScApp->doc->Layers.count(); ++lam)
 	{
-		if (Carrier->doc->Layers[lam].Name == QString::fromUtf8(Name))
+		if (ScApp->doc->Layers[lam].Name == QString::fromUtf8(Name))
 		{
-			QValueList<Layer>::iterator it2 = Carrier->doc->Layers.at(lam);
+			QValueList<Layer>::iterator it2 = ScApp->doc->Layers.at(lam);
 			int num2 = (*it2).LNr;
 			if (!num2)
 			{
@@ -372,17 +372,17 @@
 				return Py_None;
 			}
 			int num = (*it2).Level;
-			Carrier->doc->Layers.remove(it2);
+			ScApp->doc->Layers.remove(it2);
 			QValueList<Layer>::iterator it;
-			for (uint l = 0; l < Carrier->doc->Layers.count(); l++)
+			for (uint l = 0; l < ScApp->doc->Layers.count(); l++)
 			{
-				it = Carrier->doc->Layers.at(l);
+				it = ScApp->doc->Layers.at(l);
 				if ((*it).Level > num)
 					(*it).Level -= 1;
 			}
-			Carrier->LayerRemove(num2);
-			Carrier->doc->setActiveLayer(0);
-			Carrier->changeLayer(0);
+			ScApp->LayerRemove(num2);
+			ScApp->doc->setActiveLayer(0);
+			ScApp->changeLayer(0);
 			found = true;
 			break;
 		}
@@ -408,13 +408,13 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create layer without a name.","python error"));
 		return NULL;
 	}
-	Carrier->doc->addLayer(QString::fromUtf8(Name), true);
-	Carrier->changeLayer(Carrier->doc->activeLayer());
+	ScApp->doc->addLayer(QString::fromUtf8(Name), true);
+	ScApp->changeLayer(ScApp->doc->activeLayer());
 	Py_INCREF(Py_None);
 	return Py_None;
 }
 
 PyObject *scribus_getlanguage(PyObject* /* self */)
 {
-	return PyString_FromString(Carrier->getGuiLanguage().utf8());
+	return PyString_FromString(ScApp->getGuiLanguage().utf8());
 }
Index: plugins/scriptplugin/cmdobj.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp,v
retrieving revision 1.11.2.30
diff -u -r1.11.2.30 cmdobj.cpp
--- plugins/scriptplugin/cmdobj.cpp	26 Jul 2005 12:22:24 -0000	1.11.2.30
+++ plugins/scriptplugin/cmdobj.cpp	7 Sep 2005 16:53:17 -0000
@@ -16,15 +16,15 @@
 		PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
 		return NULL;
 	}
-	int i = Carrier->view->PaintRect(pageUnitXToDocX(x), pageUnitYToDocY(y),
+	int i = ScApp->view->PaintRect(pageUnitXToDocX(x), pageUnitYToDocY(y),
 									 ValueToPoint(b), ValueToPoint(h),
-									 Carrier->doc->toolSettings.dWidth,
-									 Carrier->doc->toolSettings.dBrush,
-									 Carrier->doc->toolSettings.dPen);
-	Carrier->view->SetRectFrame(Carrier->doc->Items.at(i));
+									 ScApp->doc->toolSettings.dWidth,
+									 ScApp->doc->toolSettings.dBrush,
+									 ScApp->doc->toolSettings.dPen);
+	ScApp->view->SetRectFrame(ScApp->doc->Items.at(i));
 	if (Name != "")
-		Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
-	return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
+		ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
+	return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
 }
 
 
@@ -36,19 +36,19 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	int i = Carrier->view->PaintEllipse(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
-										Carrier->doc->toolSettings.dWidth,
-										Carrier->doc->toolSettings.dBrush,
-										Carrier->doc->toolSettings.dPen);
+	int i = ScApp->view->PaintEllipse(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
+										ScApp->doc->toolSettings.dWidth,
+										ScApp->doc->toolSettings.dBrush,
+										ScApp->doc->toolSettings.dPen);
 	if (ItemExists(QString::fromUtf8(Name)))
 	{
 		PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
 		return NULL;
 	}
-	Carrier->view->SetOvalFrame(Carrier->doc->Items.at(i));
+	ScApp->view->SetOvalFrame(ScApp->doc->Items.at(i));
 	if (Name != "")
-		Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
-	return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
+		ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
+	return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
 }
 
 
@@ -60,16 +60,16 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	int i = Carrier->view->PaintPict(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h);
+	int i = ScApp->view->PaintPict(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h);
 	if (ItemExists(QString::fromUtf8(Name)))
 	{
 		PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
 		return NULL;
 	}
-	Carrier->view->SetRectFrame(Carrier->doc->Items.at(i));
+	ScApp->view->SetRectFrame(ScApp->doc->Items.at(i));
 	if (Name != "")
-		Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
-	return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
+		ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
+	return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
 }
 
 
@@ -81,18 +81,18 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	int i = Carrier->view->PaintText(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
-									 Carrier->doc->toolSettings.dWidth,
-									 Carrier->doc->toolSettings.dPenText);
+	int i = ScApp->view->PaintText(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
+									 ScApp->doc->toolSettings.dWidth,
+									 ScApp->doc->toolSettings.dPenText);
 	if (ItemExists(QString::fromUtf8(Name)))
 	{
 		PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
 		return NULL;
 	}
-	Carrier->view->SetRectFrame(Carrier->doc->Items.at(i));
+	ScApp->view->SetRectFrame(ScApp->doc->Items.at(i));
 	if (Name != "")
-		Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
-	return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
+		ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
+	return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
 }
 
 
@@ -113,8 +113,8 @@
 		PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
 		return NULL;
 	}
-	int i = Carrier->view->PaintPolyLine(x, y, 1, 1,	Carrier->doc->toolSettings.dWidth, Carrier->doc->toolSettings.dBrush, Carrier->doc->toolSettings.dPen);
-	PageItem *it = Carrier->doc->Items.at(i);
+	int i = ScApp->view->PaintPolyLine(x, y, 1, 1,	ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
+	PageItem *it = ScApp->doc->Items.at(i);
 	it->PoLine.resize(4);
 	it->PoLine.setPoint(0, 0, 0);
 	it->PoLine.setPoint(1, 0, 0);
@@ -124,15 +124,15 @@
 	if (np2.x() < 0)
 	{
 		it->PoLine.translate(-np2.x(), 0);
-		Carrier->view->MoveItem(np2.x(), 0, it);
+		ScApp->view->MoveItem(np2.x(), 0, it);
 	}
 	if (np2.y() < 0)
 	{
 		it->PoLine.translate(0, -np2.y());
-		Carrier->view->MoveItem(0, np2.y(), it);
+		ScApp->view->MoveItem(0, np2.y(), it);
 	}
-	Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), i, false, false);
-	Carrier->view->AdjustItemSize(it);
+	ScApp->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), i, false, false);
+	ScApp->view->AdjustItemSize(it);
 	if (Name != "")
 		it->setItemName(QString::fromUtf8(Name));
 	return PyString_FromString(it->itemName().utf8());
@@ -170,8 +170,8 @@
 	i++;
 	y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
 	i++;
-	int ic = Carrier->view->PaintPolyLine(x, y, 1, 1,	Carrier->doc->toolSettings.dWidth, Carrier->doc->toolSettings.dBrush, Carrier->doc->toolSettings.dPen);
-	PageItem *it = Carrier->doc->Items.at(ic);
+	int ic = ScApp->view->PaintPolyLine(x, y, 1, 1,	ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
+	PageItem *it = ScApp->doc->Items.at(ic);
 	it->PoLine.resize(2);
 	it->PoLine.setPoint(0, 0, 0);
 	it->PoLine.setPoint(1, 0, 0);
@@ -197,15 +197,15 @@
 	if (np2.x() < 0)
 	{
 		it->PoLine.translate(-np2.x(), 0);
-		Carrier->view->MoveItem(np2.x(), 0, it);
+		ScApp->view->MoveItem(np2.x(), 0, it);
 	}
 	if (np2.y() < 0)
 	{
 		it->PoLine.translate(0, -np2.y());
-		Carrier->view->MoveItem(0, np2.y(), it);
+		ScApp->view->MoveItem(0, np2.y(), it);
 	}
-	Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
-	Carrier->view->AdjustItemSize(it);
+	ScApp->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
+	ScApp->view->AdjustItemSize(it);
 	if (Name != "")
 	{
 		it->setItemName(QString::fromUtf8(Name));
@@ -245,8 +245,8 @@
 	i++;
 	y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
 	i++;
-	int ic = Carrier->view->PaintPoly(x, y, 1, 1,	Carrier->doc->toolSettings.dWidth, Carrier->doc->toolSettings.dBrush, Carrier->doc->toolSettings.dPen);
-	PageItem *it = Carrier->doc->Items.at(ic);
+	int ic = ScApp->view->PaintPoly(x, y, 1, 1,	ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
+	PageItem *it = ScApp->doc->Items.at(ic);
 	it->PoLine.resize(2);
 	it->PoLine.setPoint(0, 0, 0);
 	it->PoLine.setPoint(1, 0, 0);
@@ -277,15 +277,15 @@
 	if (np2.x() < 0)
 	{
 		it->PoLine.translate(-np2.x(), 0);
-		Carrier->view->MoveItem(np2.x(), 0, it);
+		ScApp->view->MoveItem(np2.x(), 0, it);
 	}
 	if (np2.y() < 0)
 	{
 		it->PoLine.translate(0, -np2.y());
-		Carrier->view->MoveItem(0, np2.y(), it);
+		ScApp->view->MoveItem(0, np2.y(), it);
 	}
-	Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
-	Carrier->view->AdjustItemSize(it);
+	ScApp->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
+	ScApp->view->AdjustItemSize(it);
 	if (Name != "")
 		it->setItemName(QString::fromUtf8(Name));
 	return PyString_FromString(it->itemName().utf8());
@@ -330,8 +330,8 @@
 	i++;
 	ky2 = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
 	i++;
-	int ic = Carrier->view->PaintPolyLine(x, y, 1, 1,	Carrier->doc->toolSettings.dWidth, Carrier->doc->toolSettings.dBrush, Carrier->doc->toolSettings.dPen);
-	PageItem *it = Carrier->doc->Items.at(ic);
+	int ic = ScApp->view->PaintPolyLine(x, y, 1, 1,	ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
+	PageItem *it = ScApp->doc->Items.at(ic);
 	it->PoLine.resize(2);
 	it->PoLine.setPoint(0, 0, 0);
 	it->PoLine.setPoint(1, kx-x, ky-y);
@@ -363,15 +363,15 @@
 	if (np2.x() < 0)
 	{
 		it->PoLine.translate(-np2.x(), 0);
-		Carrier->view->MoveItem(np2.x(), 0, it);
+		ScApp->view->MoveItem(np2.x(), 0, it);
 	}
 	if (np2.y() < 0)
 	{
 		it->PoLine.translate(0, -np2.y());
-		Carrier->view->MoveItem(0, np2.y(), it);
+		ScApp->view->MoveItem(0, np2.y(), it);
 	}
-	Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
-	Carrier->view->AdjustItemSize(it);
+	ScApp->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
+	ScApp->view->AdjustItemSize(it);
 	if (Name != "")
 		it->setItemName(QString::fromUtf8(Name));
 	return PyString_FromString(it->itemName().utf8());
@@ -404,12 +404,12 @@
 		PyErr_SetString(NotFoundError, QObject::tr("Object not found.","python error"));
 		return NULL;
 	}
-	Carrier->view->SelItem.clear();
-	Carrier->view->SelItem.append(Carrier->doc->Items.at(i));
-	Carrier->view->SelItem.append(Carrier->doc->Items.at(ii));
-	PageItem *it = Carrier->doc->Items.at(i);
-	Carrier->view->ToPathText();
-	Carrier->view->MoveItem(pageUnitXToDocX(x) - it->Xpos, pageUnitYToDocY(y) - it->Ypos, it);
+	ScApp->view->SelItem.clear();
+	ScApp->view->SelItem.append(ScApp->doc->Items.at(i));
+	ScApp->view->SelItem.append(ScApp->doc->Items.at(ii));
+	PageItem *it = ScApp->doc->Items.at(i);
+	ScApp->view->ToPathText();
+	ScApp->view->MoveItem(pageUnitXToDocX(x) - it->Xpos, pageUnitYToDocY(y) - it->Ypos, it);
 	if (Name != "")
 		it->setItemName(QString::fromUtf8(Name));
 	return PyString_FromString(it->itemName().utf8());
@@ -428,9 +428,9 @@
 	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
-	Carrier->view->SelItem.clear();
-	Carrier->view->SelItem.append(i);
-	Carrier->view->DeleteItem();
+	ScApp->view->SelItem.clear();
+	ScApp->view->SelItem.append(i);
+	ScApp->view->DeleteItem();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -454,8 +454,8 @@
 		i->setTextFlowsAroundFrame(!i->textFlowsAroundFrame());
 	else
 		i->setTextFlowsAroundFrame( state ? true : false);
-	Carrier->view->DrawNew();
-	Carrier->slotDocCh(true);
+	ScApp->view->DrawNew();
+	ScApp->slotDocCh(true);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -500,9 +500,9 @@
 		bool found = false;
 		uint styleid = 0;
 		// We start at zero here because it's OK to match an internal name
-		for (uint i=0; i < Carrier->doc->docParagraphStyles.count(); ++i)
+		for (uint i=0; i < ScApp->doc->docParagraphStyles.count(); ++i)
 		{
-			if (Carrier->doc->docParagraphStyles[i].Vname == QString::fromUtf8(style)) {
+			if (ScApp->doc->docParagraphStyles[i].Vname == QString::fromUtf8(style)) {
 				found = true;
 				styleid = i;
 				break;
@@ -514,10 +514,10 @@
 			return NULL;
 		}
 		// quick hack to always apply on the right frame - pv
-		Carrier->view->Deselect(true);
-		Carrier->view->SelectItemNr(item->ItemNr);
+		ScApp->view->Deselect(true);
+		ScApp->view->SelectItemNr(item->ItemNr);
 		// Now apply the style.
-		Carrier->setNewAbStyle(styleid);
+		ScApp->setNewAbStyle(styleid);
 	}
 	else
 	{
@@ -543,9 +543,9 @@
 	pv - changet to get all (with system) objects
 	FIXME: this should be a constant defined by the scribus core
 	*/
-	for (uint i=0; i < Carrier->doc->docParagraphStyles.count(); ++i)
+	for (uint i=0; i < ScApp->doc->docParagraphStyles.count(); ++i)
 	{
-		if (PyList_Append(styleList, PyString_FromString(Carrier->doc->docParagraphStyles[i].Vname.utf8())))
+		if (PyList_Append(styleList, PyString_FromString(ScApp->doc->docParagraphStyles[i].Vname.utf8())))
 		{
 			// An exception will have already been set by PyList_Append apparently.
 			return NULL;
Index: plugins/scriptplugin/cmdpage.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp,v
retrieving revision 1.11.2.21
diff -u -r1.11.2.21 cmdpage.cpp
--- plugins/scriptplugin/cmdpage.cpp	7 Sep 2005 12:20:09 -0000	1.11.2.21
+++ plugins/scriptplugin/cmdpage.cpp	7 Sep 2005 16:53:17 -0000
@@ -5,14 +5,14 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	return PyInt_FromLong(static_cast<long>(Carrier->doc->currentPage->pageNr() + 1));
+	return PyInt_FromLong(static_cast<long>(ScApp->doc->currentPage->pageNr() + 1));
 }
 
 PyObject *scribus_redraw(PyObject* /* self */)
 {
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->view->DrawNew();
+	ScApp->view->DrawNew();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -24,7 +24,7 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	bool ret = Carrier->DoSaveAsEps(QString::fromUtf8(Name));
+	bool ret = ScApp->DoSaveAsEps(QString::fromUtf8(Name));
 	if (!ret)
 	{
 		PyErr_SetString(ScribusException, QObject::tr("Failed to save EPS.","python error"));
@@ -42,12 +42,12 @@
 	if(!checkHaveDocument())
 		return NULL;
 	e--;
-	if ((e < 0) || (e > static_cast<int>(Carrier->doc->Pages.count())-1))
+	if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages.count())-1))
 	{
 		PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error"));
 		return NULL;
 	}
-	Carrier->DeletePage2(e);
+	ScApp->DeletePage2(e);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -60,12 +60,12 @@
 	if(!checkHaveDocument())
 		return NULL;
 	e--;
-	if ((e < 0) || (e > static_cast<int>(Carrier->doc->Pages.count())-1))
+	if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages.count())-1))
 	{
 		PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error"));
 		return NULL;
 	}
-	Carrier->view->GotoPage(e);
+	ScApp->view->GotoPage(e);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -79,16 +79,16 @@
 	if(!checkHaveDocument())
 		return NULL;
 	if (e < 0)
-		Carrier->slotNewPageP(Carrier->doc->Pages.count(), QString::fromUtf8(name));
+		ScApp->slotNewPageP(ScApp->doc->Pages.count(), QString::fromUtf8(name));
 	else
 	{
 		e--;
-		if ((e < 0) || (e > static_cast<int>(Carrier->doc->Pages.count())-1))
+		if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages.count())-1))
 		{
 			PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error"));
 			return NULL;
 		}
-		Carrier->slotNewPageP(e, QString::fromUtf8(name));
+		ScApp->slotNewPageP(e, QString::fromUtf8(name));
 	}
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -98,7 +98,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	return PyInt_FromLong(static_cast<long>(Carrier->doc->Pages.count()));
+	return PyInt_FromLong(static_cast<long>(ScApp->doc->Pages.count()));
 }
 
 PyObject *scribus_pagedimension(PyObject* /* self */)
@@ -108,8 +108,8 @@
 	PyObject *t;
 	t = Py_BuildValue(
 			"(dd)",
-			PointToValue(Carrier->doc->pageWidth), // it's just view scale... * Carrier->doc->Scale),
-			PointToValue(Carrier->doc->pageHeight)  // * Carrier->doc->Scale)
+			PointToValue(ScApp->doc->pageWidth), // it's just view scale... * ScApp->doc->Scale),
+			PointToValue(ScApp->doc->pageHeight)  // * ScApp->doc->Scale)
 		);
 	return t;
 }
@@ -118,16 +118,16 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	if (Carrier->doc->Items.count() == 0)
+	if (ScApp->doc->Items.count() == 0)
 		return Py_BuildValue((char*)"[]");
-	PyObject *l = PyList_New(Carrier->doc->Items.count());
+	PyObject *l = PyList_New(ScApp->doc->Items.count());
 	PyObject *row;
-	for (uint i = 0; i<Carrier->doc->Items.count(); ++i)
+	for (uint i = 0; i<ScApp->doc->Items.count(); ++i)
 	{
 		row = Py_BuildValue((char*)"(sii)",
-		                    Carrier->doc->Items.at(i)->itemName().ascii(),
-		                    Carrier->doc->Items.at(i)->itemType(),
-		                    Carrier->doc->Items.at(i)->ItemNr
+		                    ScApp->doc->Items.at(i)->itemName().ascii(),
+		                    ScApp->doc->Items.at(i)->itemType(),
+		                    ScApp->doc->Items.at(i)->ItemNr
 		                   );
 		PyList_SetItem(l, i, row);
 	} // for
@@ -138,7 +138,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	int n = Carrier->doc->currentPage->YGuides.count();
+	int n = ScApp->doc->currentPage->YGuides.count();
 	if (n == 0)
 		return Py_BuildValue((char*)"[]");
 	int i;
@@ -147,7 +147,7 @@
 	l = PyList_New(0);
 	for (i=0; i<n; i++)
 	{
-		tmp = Carrier->doc->currentPage->YGuides[i];
+		tmp = ScApp->doc->currentPage->YGuides[i];
 		guide = Py_BuildValue("d", PointToValue(tmp));
 		PyList_Append(l, guide);
 	}
@@ -169,7 +169,7 @@
 	int i, n;
 	n = PyList_Size(l);
 	double guide;
-	Carrier->doc->currentPage->YGuides.clear();
+	ScApp->doc->currentPage->YGuides.clear();
 	for (i=0; i<n; i++)
 	{
 		if (!PyArg_Parse(PyList_GetItem(l, i), "d", &guide))
@@ -177,7 +177,7 @@
 			PyErr_SetString(PyExc_TypeError, QObject::tr("argument contains non-numeric values: must be list of float values.","python error"));
 			return NULL;
 		}
-		Carrier->doc->currentPage->YGuides += ValueToPoint(guide);
+		ScApp->doc->currentPage->YGuides += ValueToPoint(guide);
 	}
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -187,7 +187,7 @@
 {
 	if(!checkHaveDocument())
 		return NULL;
-	int n = Carrier->doc->currentPage->XGuides.count();
+	int n = ScApp->doc->currentPage->XGuides.count();
 	if (n == 0)
 		return Py_BuildValue((char*)"[]");
 	int i;
@@ -196,7 +196,7 @@
 	l = PyList_New(0);
 	for (i=0; i<n; i++)
 	{
-		tmp = Carrier->doc->currentPage->XGuides[i];
+		tmp = ScApp->doc->currentPage->XGuides[i];
 		guide = Py_BuildValue("d", PointToValue(tmp));
 		PyList_Append(l, guide);
 	}
@@ -218,7 +218,7 @@
 	int i, n;
 	n = PyList_Size(l);
 	double guide;
-	Carrier->doc->currentPage->XGuides.clear();
+	ScApp->doc->currentPage->XGuides.clear();
 	for (i=0; i<n; i++)
 	{
 		if (!PyArg_Parse(PyList_GetItem(l, i), "d", &guide))
@@ -226,7 +226,7 @@
 			PyErr_SetString(PyExc_TypeError, QObject::tr("argument contains no-numeric values: must be list of float values.","python error"));
 			return NULL;
 		}
-		Carrier->doc->currentPage->XGuides += ValueToPoint(guide);
+		ScApp->doc->currentPage->XGuides += ValueToPoint(guide);
 	}
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -237,9 +237,9 @@
 	PyObject *margins = NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	margins = Py_BuildValue("ffff", PointToValue(Carrier->doc->pageMargins.Top),
-									PointToValue(Carrier->doc->pageMargins.Left),
-									PointToValue(Carrier->doc->pageMargins.Right),
-									PointToValue(Carrier->doc->pageMargins.Bottom));
+	margins = Py_BuildValue("ffff", PointToValue(ScApp->doc->pageMargins.Top),
+									PointToValue(ScApp->doc->pageMargins.Left),
+									PointToValue(ScApp->doc->pageMargins.Right),
+									PointToValue(ScApp->doc->pageMargins.Bottom));
 	return margins;
 }
Index: plugins/scriptplugin/cmdsetprop.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp,v
retrieving revision 1.8.2.18
diff -u -r1.8.2.18 cmdsetprop.cpp
--- plugins/scriptplugin/cmdsetprop.cpp	12 Aug 2005 23:27:15 -0000	1.8.2.18
+++ plugins/scriptplugin/cmdsetprop.cpp	7 Sep 2005 16:53:17 -0000
@@ -23,8 +23,8 @@
 	currItem->SetFarbe(&tmp, c2, shade2);
 	currItem->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0, c2, shade2);
 	currItem->GrType = typ;
-	Carrier->view->updateGradientVectors(currItem);
-	Carrier->view->RefreshItem(currItem);
+	ScApp->view->updateGradientVectors(currItem);
+	ScApp->view->RefreshItem(currItem);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -42,7 +42,7 @@
 		return NULL;
 	i->setFillColor(QString::fromUtf8(Color));
 	if (i->fillColor() != "None")
-		i->fillQColor = Carrier->doc->PageColors[i->fillColor()].getShadeColorProof(i->fillShade());
+		i->fillQColor = ScApp->doc->PageColors[i->fillColor()].getShadeColorProof(i->fillShade());
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -60,7 +60,7 @@
 		return NULL;
 	it->setLineColor(QString::fromUtf8(Color));
 	if (it->lineColor() != "None")
-		it->strokeQColor = Carrier->doc->PageColors[it->lineColor()].getShadeColorProof(it->lineShade());
+		it->strokeQColor = ScApp->doc->PageColors[it->lineColor()].getShadeColorProof(it->lineShade());
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -104,7 +104,7 @@
 		return NULL;
 	it->setLineShade(w);
 	if (it->lineColor() != "None")
-		it->strokeQColor = Carrier->doc->PageColors[it->lineColor()].getShadeColorProof(it->lineShade());
+		it->strokeQColor = ScApp->doc->PageColors[it->lineColor()].getShadeColorProof(it->lineShade());
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -127,7 +127,7 @@
 		return NULL;
 	i->setFillShade(w);
 	if (i->fillColor() != "None")
-		i->fillQColor = Carrier->doc->PageColors[i->fillColor()].getShadeColorProof(i->fillShade());
+		i->fillQColor = ScApp->doc->PageColors[i->fillColor()].getShadeColorProof(i->fillShade());
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -201,10 +201,10 @@
 	{
 		currItem->RadRect = w;
 		if (w > 0)
-			Carrier->view->SetFrameRound(currItem);
+			ScApp->view->SetFrameRound(currItem);
 	}
 	else
-			Carrier->view->SetRectFrame(currItem);
+			ScApp->view->SetRectFrame(currItem);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -220,7 +220,7 @@
 	PageItem *currItem = GetUniqueItem(QString::fromUtf8(Name));
 	if (currItem == NULL)
 		return NULL;
-	if (!Carrier->doc->MLineStyles.contains(QString::fromUtf8(Style)))
+	if (!ScApp->doc->MLineStyles.contains(QString::fromUtf8(Style)))
 	{
 		PyErr_SetString(NotFoundError, QObject::tr("Line style not found.","python error"));
 		return NULL;
Index: plugins/scriptplugin/cmdtext.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp,v
retrieving revision 1.19.2.41
diff -u -r1.19.2.41 cmdtext.cpp
--- plugins/scriptplugin/cmdtext.cpp	15 Jul 2005 23:14:42 -0000	1.19.2.41
+++ plugins/scriptplugin/cmdtext.cpp	7 Sep 2005 16:53:17 -0000
@@ -260,7 +260,7 @@
 			{
 				if ((itx->ch == QChar(25)) && (itx->cembedded != 0))
 				{
-					Carrier->doc->FrameItems.remove(itx->cembedded);
+					ScApp->doc->FrameItems.remove(itx->cembedded);
 					delete itx->cembedded;
 				}
 			}
@@ -273,15 +273,15 @@
 	{
 		if ((itx->ch == QChar(25)) && (itx->cembedded != 0))
 		{
-			Carrier->doc->FrameItems.remove(itx->cembedded);
+			ScApp->doc->FrameItems.remove(itx->cembedded);
 			delete itx->cembedded;
 		}
 	}
 	currItem->itemText.clear();
 	currItem->CPos = 0;
-	for (uint a = 0; a < Carrier->doc->FrameItems.count(); ++a)
+	for (uint a = 0; a < ScApp->doc->FrameItems.count(); ++a)
 	{
-		Carrier->doc->FrameItems.at(a)->ItemNr = a;
+		ScApp->doc->FrameItems.at(a)->ItemNr = a;
 	}
 	for (uint a = 0; a < Daten.length(); ++a)
 	{
@@ -289,7 +289,7 @@
 		hg->ch = Daten.at(a);
 		if (hg->ch == QChar(10))
 			hg->ch = QChar(13);
-		hg->cfont = (*Carrier->doc->AllFonts)[currItem->IFont];
+		hg->cfont = (*ScApp->doc->AllFonts)[currItem->IFont];
 		hg->csize = currItem->ISize;
 		hg->ccolor = currItem->TxtFill;
 		hg->cshade = currItem->ShTxtFill;
@@ -308,7 +308,7 @@
 		hg->cextra = 0;
 		hg->cselect = false;
 		hg->cstyle = 0;
-		hg->cab = Carrier->doc->currentParaStyle;
+		hg->cab = ScApp->doc->currentParaStyle;
 		hg->xp = 0;
 		hg->yp = 0;
 		hg->PRot = 0;
@@ -354,7 +354,7 @@
 		hg->ch = Daten.at(Daten.length()-1-a);
 		if (hg->ch == QChar(10))
 			hg->ch = QChar(13);
-		hg->cfont = (*Carrier->doc->AllFonts)[it->IFont];
+		hg->cfont = (*ScApp->doc->AllFonts)[it->IFont];
 		hg->csize = it->ISize;
 		hg->ccolor = it->TxtFill;
 		hg->cshade = it->ShTxtFill;
@@ -373,7 +373,7 @@
 		hg->cextra = 0;
 		hg->cselect = false;
 		hg->cstyle = 0;
-		hg->cab = Carrier->doc->currentParaStyle;
+		hg->cab = ScApp->doc->currentParaStyle;
 		hg->xp = 0;
 		hg->yp = 0;
 		hg->PRot = 0;
@@ -410,14 +410,14 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text alignment on a non-text frame.","python error"));
 		return NULL;
 	}
-	int Apm = Carrier->doc->appMode;
-	Carrier->view->SelItem.clear();
-	Carrier->view->SelItem.append(i);
+	int Apm = ScApp->doc->appMode;
+	ScApp->view->SelItem.clear();
+	ScApp->view->SelItem.append(i);
 	if (i->HasSel)
-		Carrier->doc->appMode = modeEdit;
-	Carrier->setNewAbStyle(alignment);
-	Carrier->doc->appMode = Apm;
-	Carrier->view->Deselect();
+		ScApp->doc->appMode = modeEdit;
+	ScApp->setNewAbStyle(alignment);
+	ScApp->doc->appMode = Apm;
+	ScApp->view->Deselect();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -444,14 +444,14 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set font size on a non-text frame.","python error"));
 		return NULL;
 	}
-	int Apm = Carrier->doc->appMode;
-	Carrier->view->SelItem.clear();
-	Carrier->view->SelItem.append(i);
+	int Apm = ScApp->doc->appMode;
+	ScApp->view->SelItem.clear();
+	ScApp->view->SelItem.append(i);
 	if (i->HasSel)
-		Carrier->doc->appMode = modeEdit;
-	Carrier->view->chFSize(qRound(size * 10.0));
-	Carrier->doc->appMode = Apm;
-	Carrier->view->Deselect();
+		ScApp->doc->appMode = modeEdit;
+	ScApp->view->chFSize(qRound(size * 10.0));
+	ScApp->doc->appMode = Apm;
+	ScApp->view->Deselect();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -474,14 +474,14 @@
 	}
 	if (PrefsManager::instance()->appPrefs.AvailFonts.find(QString::fromUtf8(Font)))
 	{
-		int Apm = Carrier->doc->appMode;
-		Carrier->view->SelItem.clear();
-		Carrier->view->SelItem.append(i);
+		int Apm = ScApp->doc->appMode;
+		ScApp->view->SelItem.clear();
+		ScApp->view->SelItem.append(i);
 		if (i->HasSel)
-			Carrier->doc->appMode = modeEdit;
-		Carrier->SetNewFont(QString::fromUtf8(Font));
-		Carrier->doc->appMode = Apm;
-		Carrier->view->Deselect();
+			ScApp->doc->appMode = modeEdit;
+		ScApp->SetNewFont(QString::fromUtf8(Font));
+		ScApp->doc->appMode = Apm;
+		ScApp->view->Deselect();
 	}
 	else
 	{
@@ -638,22 +638,22 @@
 		return NULL;
 	}
 	if (it->HasSel)
-		Carrier->deleteSelectedTextFromFrame(it);
+		ScApp->deleteSelectedTextFromFrame(it);
 	else
 	{
 		for (ScText *itx = it->itemText.first(); itx != 0; itx = it->itemText.next())
 		{
 			if ((itx->ch == QChar(25)) && (itx->cembedded != 0))
 			{
-				Carrier->doc->FrameItems.remove(itx->cembedded);
+				ScApp->doc->FrameItems.remove(itx->cembedded);
 				delete itx->cembedded;
 			}
 		}
 		it->itemText.clear();
 		it->CPos = 0;
-		for (uint a = 0; a < Carrier->doc->FrameItems.count(); ++a)
+		for (uint a = 0; a < ScApp->doc->FrameItems.count(); ++a)
 		{
-			Carrier->doc->FrameItems.at(a)->ItemNr = a;
+			ScApp->doc->FrameItems.at(a)->ItemNr = a;
 		}
 	}
 	Py_INCREF(Py_None);
@@ -810,9 +810,9 @@
 	// references to the others boxes
 	fromitem->NextBox = toitem;
 	toitem->BackBox = fromitem;
-	Carrier->view->DrawNew();
+	ScApp->view->DrawNew();
 	// enable 'save icon' stuff
-	Carrier->slotDocCh();
+	ScApp->slotDocCh();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -857,8 +857,8 @@
 	item->BackBox->NextBox = 0;
 	item->BackBox = 0;
 	// enable 'save icon' stuff
-	Carrier->slotDocCh();
-	Carrier->view->DrawNew();
+	ScApp->slotDocCh();
+	ScApp->view->DrawNew();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -884,9 +884,9 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot convert a non-text frame to outlines.","python error"));
 		return NULL;
 	}
-	Carrier->view->Deselect(true);
-	Carrier->view->SelectItemNr(item->ItemNr);
-	Carrier->view->TextToPath();
+	ScApp->view->Deselect(true);
+	ScApp->view->SelectItemNr(item->ItemNr);
+	ScApp->view->TextToPath();
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -956,10 +956,10 @@
 	if (toggle)
 	{
 		i->isAnnotation = false;
-		Carrier->AddBookMark(i);
+		ScApp->AddBookMark(i);
 	}
 	else
-		Carrier->DelBookMark(i);
+		ScApp->DelBookMark(i);
 	i->isBookmark = toggle;
 	Py_INCREF(Py_None);
 	return Py_None;
Index: plugins/scriptplugin/cmdutil.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp,v
retrieving revision 1.6.2.22
diff -u -r1.6.2.22 cmdutil.cpp
--- plugins/scriptplugin/cmdutil.cpp	7 Sep 2005 12:20:09 -0000	1.6.2.22
+++ plugins/scriptplugin/cmdutil.cpp	7 Sep 2005 16:53:17 -0000
@@ -7,26 +7,26 @@
 /// Convert a value in points to a value in the current document units
 double PointToValue(double Val)
 {
-	return pts2value(Val, Carrier->doc->unitIndex());
+	return pts2value(Val, ScApp->doc->unitIndex());
 }
 
 /// Convert a value in the current document units to a value in points
 double ValueToPoint(double Val)
 {
-	return value2pts(Val, Carrier->doc->unitIndex());
+	return value2pts(Val, ScApp->doc->unitIndex());
 }
 
 /// Convert an X co-ordinate part in page units to a document co-ordinate
 /// in system units.
 double pageUnitXToDocX(double pageUnitX)
 {
-	return ValueToPoint(pageUnitX) + Carrier->doc->currentPage->xOffset();
+	return ValueToPoint(pageUnitX) + ScApp->doc->currentPage->xOffset();
 }
 
 // Convert doc units to page units
 double docUnitXToPageX(double pageUnitX)
 {
-	return PointToValue(pageUnitX - Carrier->doc->currentPage->xOffset());
+	return PointToValue(pageUnitX - ScApp->doc->currentPage->xOffset());
 }
 
 /// Convert a Y co-ordinate part in page units to a document co-ordinate
@@ -35,28 +35,28 @@
 /// origin on the top left of the current page.
 double pageUnitYToDocY(double pageUnitY)
 {
-	return ValueToPoint(pageUnitY) + Carrier->doc->currentPage->yOffset();
+	return ValueToPoint(pageUnitY) + ScApp->doc->currentPage->yOffset();
 }
 
 double docUnitYToPageY(double pageUnitY)
 {
-	return PointToValue(pageUnitY - Carrier->doc->currentPage->yOffset());
+	return PointToValue(pageUnitY - ScApp->doc->currentPage->yOffset());
 }
 
 int GetItem(QString Name)
 {
 	if (!Name.isEmpty())
 	{
-		for (uint a = 0; a < Carrier->doc->Items.count(); a++)
+		for (uint a = 0; a < ScApp->doc->Items.count(); a++)
 		{
-			if (Carrier->doc->Items.at(a)->itemName() == Name)
+			if (ScApp->doc->Items.at(a)->itemName() == Name)
 				return static_cast<int>(a);
 		}
 	}
 	else
 	{
-		if (Carrier->view->SelItem.count() != 0)
-			return Carrier->view->SelItem.at(0)->ItemNr;
+		if (ScApp->view->SelItem.count() != 0)
+			return ScApp->view->SelItem.at(0)->ItemNr;
 	}
 	return -1;
 }
@@ -64,9 +64,9 @@
 void ReplaceColor(QString col, QString rep)
 {
 	QColor tmpc;
-	for (uint c = 0; c < Carrier->doc->Items.count(); c++)
+	for (uint c = 0; c < ScApp->doc->Items.count(); c++)
 	{
-		PageItem *ite = Carrier->doc->Items.at(c);
+		PageItem *ite = ScApp->doc->Items.at(c);
 		if (ite->itemType() == PageItem::TextFrame)
 		{
 			for (uint d = 0; d < ite->itemText.count(); d++)
@@ -92,9 +92,9 @@
 			}
 		}
 	}
-	for (uint c = 0; c < Carrier->doc->MasterItems.count(); c++)
+	for (uint c = 0; c < ScApp->doc->MasterItems.count(); c++)
 	{
-		PageItem *ite = Carrier->doc->MasterItems.at(c);
+		PageItem *ite = ScApp->doc->MasterItems.at(c);
 		if (ite->itemType() == PageItem::TextFrame)
 		{
 			for (uint d = 0; d < ite->itemText.count(); d++)
@@ -126,8 +126,8 @@
 PageItem* GetUniqueItem(QString name)
 {
 	if (name.length()==0)
-		if (Carrier->view->SelItem.count() != 0)
-			return Carrier->view->SelItem.at(0);
+		if (ScApp->view->SelItem.count() != 0)
+			return ScApp->view->SelItem.at(0);
 		else
 		{
 			PyErr_SetString(NoValidObjectError, QString("Cannot use empty string for object name when there is no selection"));
@@ -144,10 +144,10 @@
 		PyErr_SetString(PyExc_ValueError, QString("Cannot accept empty name for pageitem"));
 		return NULL;
 	}
-	for (uint j = 0; j<Carrier->doc->Items.count(); j++)
+	for (uint j = 0; j<ScApp->doc->Items.count(); j++)
 	{
-		if (name==Carrier->doc->Items.at(j)->itemName())
-			return Carrier->doc->Items.at(j);
+		if (name==ScApp->doc->Items.at(j)->itemName())
+			return ScApp->doc->Items.at(j);
 	} // for items
 	PyErr_SetString(NoValidObjectError, QString("Object not found"));
 	return NULL;
@@ -163,9 +163,9 @@
 {
 	if (name.length() == 0)
 		return false;
-	for (uint j = 0; j<Carrier->doc->Items.count(); j++)
+	for (uint j = 0; j<ScApp->doc->Items.count(); j++)
 	{
-		if (name==Carrier->doc->Items.at(j)->itemName())
+		if (name==ScApp->doc->Items.at(j)->itemName())
 			return true;
 	} // for items
 	return false;
@@ -180,7 +180,7 @@
  */
 bool checkHaveDocument()
 {
-    if (Carrier->HaveDoc)
+    if (ScApp->HaveDoc)
         return true;
     // Caller is required to check for false return from this function
     // and return NULL.
@@ -191,7 +191,7 @@
 QStringList getSelectedItemsByName()
 {
 	QStringList names;
-	QPtrListIterator<PageItem> it(Carrier->view->SelItem);
+	QPtrListIterator<PageItem> it(ScApp->view->SelItem);
 	for ( ; it.current() != 0 ; ++it)
 		names.append(it.current()->itemName());
 	return names;
@@ -199,19 +199,19 @@
 
 bool setSelectedItemsByName(QStringList& itemNames)
 {
-	Carrier->view->Deselect();
+	ScApp->view->Deselect();
 	// For each named item
 	for (QStringList::Iterator it = itemNames.begin() ; it != itemNames.end() ; it++)
 	{
 		// Search for the named item
 		PageItem* item = 0;
-		for (uint j = 0; j < Carrier->doc->Items.count(); j++)
-			if (*it == Carrier->doc->Items.at(j)->itemName())
-				item = Carrier->doc->Items.at(j);
+		for (uint j = 0; j < ScApp->doc->Items.count(); j++)
+			if (*it == ScApp->doc->Items.at(j)->itemName())
+				item = ScApp->doc->Items.at(j);
 		if (!item)
 			return false;
 		// and select it
-		Carrier->view->SelectItemNr(item->ItemNr);
+		ScApp->view->SelectItemNr(item->ItemNr);
 	}
 	return true;
 }
Index: plugins/scriptplugin/cmdvar.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdvar.h,v
retrieving revision 1.6.2.11
diff -u -r1.6.2.11 cmdvar.h
--- plugins/scriptplugin/cmdvar.h	26 Apr 2005 19:03:00 -0000	1.6.2.11
+++ plugins/scriptplugin/cmdvar.h	7 Sep 2005 16:53:18 -0000
@@ -11,9 +11,6 @@
 
 class ScripterCore;
 
-/* Static global Variables */
-extern ScribusApp* Carrier;
-
 // Globals for testing Qt properties and probably other more intresting future
 // uses.
 /** @brief A PyCObject containing a pointer to qApp */
Index: plugins/scriptplugin/guiapp.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/guiapp.cpp,v
retrieving revision 1.5.2.9
diff -u -r1.5.2.9 guiapp.cpp
--- plugins/scriptplugin/guiapp.cpp	11 Jul 2005 15:40:14 -0000	1.5.2.9
+++ plugins/scriptplugin/guiapp.cpp	7 Sep 2005 16:53:18 -0000
@@ -9,14 +9,14 @@
 	char *aText;
 	if (!PyArg_ParseTuple(args, "es", "utf-8", &aText))
 		return NULL;
-	Carrier->mainWindowStatusLabel->setText(QString::fromUtf8(aText));
+	ScApp->mainWindowStatusLabel->setText(QString::fromUtf8(aText));
 	Py_INCREF(Py_None);
 	return Py_None;
 }
 
 PyObject *scribus_progressreset(PyObject* /* self */)
 {
-	Carrier->mainWindowProgressBar->reset();
+	ScApp->mainWindowProgressBar->reset();
 	qApp->processEvents();
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -27,8 +27,8 @@
 	int steps;
 	if (!PyArg_ParseTuple(args, "i", &steps))
 		return NULL;
-	Carrier->mainWindowProgressBar->setTotalSteps(steps);
-	Carrier->mainWindowProgressBar->setProgress(0);
+	ScApp->mainWindowProgressBar->setTotalSteps(steps);
+	ScApp->mainWindowProgressBar->setProgress(0);
 	qApp->processEvents();
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -39,12 +39,12 @@
 	int position;
 	if (!PyArg_ParseTuple(args, "i", &position))
 		return NULL;
-	if (position > Carrier->mainWindowProgressBar->totalSteps())
+	if (position > ScApp->mainWindowProgressBar->totalSteps())
 	{
 		PyErr_SetString(PyExc_ValueError, QString("Tried to set progress > maximum progress"));
 		return NULL;
 	}
-	Carrier->mainWindowProgressBar->setProgress(position);
+	ScApp->mainWindowProgressBar->setProgress(position);
 	qApp->processEvents();
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -72,12 +72,12 @@
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	Carrier->slotDocCh(static_cast<bool>(aValue));
+	ScApp->slotDocCh(static_cast<bool>(aValue));
 	/*
 	if (aValue>0)
-		Carrier->slotDocCh(true);
+		ScApp->slotDocCh(true);
 	else
-		Carrier->slotDocCh(false);*/
+		ScApp->slotDocCh(false);*/
 	Py_INCREF(Py_None);
 	return Py_None;
 }
Index: plugins/scriptplugin/objimageexport.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 objimageexport.cpp
--- plugins/scriptplugin/objimageexport.cpp	7 Sep 2005 12:20:09 -0000	1.1.2.9
+++ plugins/scriptplugin/objimageexport.cpp	7 Sep 2005 16:53:18 -0000
@@ -136,10 +136,10 @@
 	* portrait and user defined sizes.
 	*/
 	double pixmapSize;
-	(Carrier->doc->pageHeight > Carrier->doc->pageWidth)
-			? pixmapSize = Carrier->doc->pageHeight
-			: pixmapSize = Carrier->doc->pageWidth;
-	QPixmap pixmap = Carrier->view->PageToPixmap(Carrier->doc->currentPage->pageNr(), qRound(pixmapSize * self->scale * (self->dpi / 72.0) / 100.0));
+	(ScApp->doc->pageHeight > ScApp->doc->pageWidth)
+			? pixmapSize = ScApp->doc->pageHeight
+			: pixmapSize = ScApp->doc->pageWidth;
+	QPixmap pixmap = ScApp->view->PageToPixmap(ScApp->doc->currentPage->pageNr(), qRound(pixmapSize * self->scale * (self->dpi / 72.0) / 100.0));
 	QImage im = pixmap.convertToImage();
 	int dpi = qRound(100.0 / 2.54 * self->dpi);
 	im.setDotsPerMeterY(dpi);
@@ -166,10 +166,10 @@
 	* portrait and user defined sizes.
 	*/
 	double pixmapSize;
-	(Carrier->doc->pageHeight > Carrier->doc->pageWidth)
-			? pixmapSize = Carrier->doc->pageHeight
-			: pixmapSize = Carrier->doc->pageWidth;
-	QPixmap pixmap = Carrier->view->PageToPixmap(Carrier->doc->currentPage->pageNr(), qRound(pixmapSize * self->scale * (self->dpi / 72.0) / 100.0));
+	(ScApp->doc->pageHeight > ScApp->doc->pageWidth)
+			? pixmapSize = ScApp->doc->pageHeight
+			: pixmapSize = ScApp->doc->pageWidth;
+	QPixmap pixmap = ScApp->view->PageToPixmap(ScApp->doc->currentPage->pageNr(), qRound(pixmapSize * self->scale * (self->dpi / 72.0) / 100.0));
 	QImage im = pixmap.convertToImage();
 	int dpi = qRound(100.0 / 2.54 * self->dpi);
 	im.setDotsPerMeterY(dpi);
Index: plugins/scriptplugin/objpdffile.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp,v
retrieving revision 1.3.2.16
diff -u -r1.3.2.16 objpdffile.cpp
--- plugins/scriptplugin/objpdffile.cpp	23 Aug 2005 23:57:51 -0000	1.3.2.16
+++ plugins/scriptplugin/objpdffile.cpp	7 Sep 2005 16:53:19 -0000
@@ -104,7 +104,7 @@
 static PyObject * PDFfile_new(PyTypeObject *type, PyObject */*args*/, PyObject */*kwds*/)
 {
 // do not create new object if there is no opened document
-	if (!Carrier->HaveDoc) {
+	if (!ScApp->HaveDoc) {
 		PyErr_SetString(PyExc_SystemError, "Need to open document first");
 		return NULL;
 	}
@@ -238,14 +238,14 @@
 
 static int PDFfile_init(PDFfile *self, PyObject */*args*/, PyObject */*kwds*/)
 {
-	if (!Carrier->HaveDoc) {
+	if (!ScApp->HaveDoc) {
 		PyErr_SetString(PyExc_SystemError, "Must open doc first");
 		return -1;
 	}
 // defaut save into file
-	QString tf = Carrier->doc->PDF_Options.Datei;
+	QString tf = ScApp->doc->PDF_Options.Datei;
 	if (tf.isEmpty()) {
-		QFileInfo fi = QFileInfo(Carrier->doc->DocName);
+		QFileInfo fi = QFileInfo(ScApp->doc->DocName);
 		tf = fi.dirPath()+"/"+fi.baseName()+".pdf";
 	}
 	PyObject *file = NULL;
@@ -270,7 +270,7 @@
 	// get all used fonts
 	QMap<QString,QFont> ReallyUsed;
 	ReallyUsed.clear();
-	Carrier->doc->getUsedFonts(&ReallyUsed);
+	ScApp->doc->getUsedFonts(&ReallyUsed);
 	// create list of all used fonts
 	QValueList<QString> tmpEm;
 	tmpEm = ReallyUsed.keys();
@@ -296,8 +296,8 @@
 	PyObject *pages = NULL;
 	int num = 0;
 	// which one should I use ???
-	// new = Carrier->view->Pages.count()
-	num = Carrier->doc->pageCount;
+	// new = ScApp->view->Pages.count()
+	num = ScApp->doc->pageCount;
 	pages = PyList_New(num);
 	if (!pages){
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'pages' attribute");
@@ -316,12 +316,12 @@
 	Py_DECREF(self->pages);
 	self->pages = pages;
 // do not print thumbnails
-	self->thumbnails = Carrier->doc->PDF_Options.Thumbnails;
+	self->thumbnails = ScApp->doc->PDF_Options.Thumbnails;
 // set automatic compression
-	self->compress = Carrier->doc->PDF_Options.Compress;
-	self->compressmtd = Carrier->doc->PDF_Options.CompressMethod;
+	self->compress = ScApp->doc->PDF_Options.Compress;
+	self->compressmtd = ScApp->doc->PDF_Options.CompressMethod;
 // use maximum image quality
-	self->quality = Carrier->doc->PDF_Options.Quality;
+	self->quality = ScApp->doc->PDF_Options.Quality;
 // default resolution
 	PyObject *resolution = NULL;
 	resolution = PyInt_FromLong(300);
@@ -333,7 +333,7 @@
 		return -1;
 	}
 // do not downsample images
-	int down = Carrier->doc->PDF_Options.RecalcPic ? Carrier->doc->PDF_Options.PicRes : 0;
+	int down = ScApp->doc->PDF_Options.RecalcPic ? ScApp->doc->PDF_Options.PicRes : 0;
 	PyObject *downsample = NULL;
 	downsample = PyInt_FromLong(down);
 	if (downsample){
@@ -344,27 +344,27 @@
 		return -1;
 	}
 	// no bookmarks
-	self->bookmarks = Carrier->doc->PDF_Options.Bookmarks;
+	self->bookmarks = ScApp->doc->PDF_Options.Bookmarks;
 	// left margin binding
-	self->binding = Carrier->doc->PDF_Options.Binding;
+	self->binding = ScApp->doc->PDF_Options.Binding;
 	// do not enable presentation effects
-	self->presentation = Carrier->doc->PDF_Options.PresentMode;
+	self->presentation = ScApp->doc->PDF_Options.PresentMode;
 	// set effects values for all pages
 	PyObject *effval = NULL;
 	num = 0;
 	// which one should I use ???
-	// new = Carrier->view->Pages.count();
-	num = Carrier->doc->pageCount;
+	// new = ScApp->view->Pages.count();
+	num = ScApp->doc->pageCount;
 	effval = PyList_New(num);
 	if (!effval){
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'effval' attribute");
 		return -1;
 	}
-	int num2 = Carrier->doc->PDF_Options.PresentVals.count();
+	int num2 = ScApp->doc->PDF_Options.PresentVals.count();
 	int i;
 	for (i = 0; i<num2; ++i) {
 		PyObject *tmp;
-		PDFPresentationData t = Carrier->doc->PDF_Options.PresentVals[i];
+		PDFPresentationData t = ScApp->doc->PDF_Options.PresentVals[i];
 		tmp = Py_BuildValue(const_cast<char*>("[iiiiii]"), t.pageEffectDuration, t.pageViewDuration, t.effectType, t.Dm, t.M, t.Di );
 		if (tmp)
 			PyList_SetItem(effval, i, tmp);
@@ -386,22 +386,22 @@
 	Py_DECREF(self->effval);
 	self->effval = effval;
 // do not save linked text frames as PDF article
-	self->article = Carrier->doc->PDF_Options.Articles;
+	self->article = ScApp->doc->PDF_Options.Articles;
 // do not encrypt file
-	self->encrypt = Carrier->doc->PDF_Options.Encrypt;
+	self->encrypt = ScApp->doc->PDF_Options.Encrypt;
 // do not Use Custom Rendering Settings
-	self->uselpi = Carrier->doc->PDF_Options.UseLPI;
-	self->usespot = Carrier->doc->PDF_Options.UseSpotColors;
-	self->domulti = Carrier->doc->PDF_Options.doMultiFile;
+	self->uselpi = ScApp->doc->PDF_Options.UseLPI;
+	self->usespot = ScApp->doc->PDF_Options.UseSpotColors;
+	self->domulti = ScApp->doc->PDF_Options.doMultiFile;
 // get default values for lpival
-	int n = Carrier->doc->PDF_Options.LPISettings.size();
+	int n = ScApp->doc->PDF_Options.LPISettings.size();
 	PyObject *lpival=PyList_New(n);
 	if (!lpival){
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'lpival' attribute");
 		return -1;
 	}
-	QMap<QString,LPIData>::Iterator it = Carrier->doc->PDF_Options.LPISettings.begin();
-	while (it != Carrier->doc->PDF_Options.LPISettings.end()) {
+	QMap<QString,LPIData>::Iterator it = ScApp->doc->PDF_Options.LPISettings.begin();
+	while (it != ScApp->doc->PDF_Options.LPISettings.end()) {
 		PyObject *tmp;
 		tmp = Py_BuildValue(const_cast<char*>("[siii]"), it.key().ascii(), it.data().Frequency, it.data().Angle, it.data().SpotFunc);
 		if (!tmp) {
@@ -416,7 +416,7 @@
 	self->lpival = lpival;
 // set owner's password
 	PyObject *owner = NULL;
-	owner = PyString_FromString(Carrier->doc->PDF_Options.PassOwner.ascii());
+	owner = PyString_FromString(ScApp->doc->PDF_Options.PassOwner.ascii());
 	if (owner){
 		Py_DECREF(self->owner);
 		self->owner = owner;
@@ -426,7 +426,7 @@
 	}
 // set user'a password
 	PyObject *user = NULL;
-	user = PyString_FromString(Carrier->doc->PDF_Options.PassUser.ascii());
+	user = PyString_FromString(ScApp->doc->PDF_Options.PassUser.ascii());
 	if (user){
 		Py_DECREF(self->user);
 		self->user = user;
@@ -435,26 +435,26 @@
 		return -1;
 	}
 // allow printing document
-	self->aprint = Carrier->doc->PDF_Options.Permissions & 4;
+	self->aprint = ScApp->doc->PDF_Options.Permissions & 4;
 // allow changing document
-	self->achange = Carrier->doc->PDF_Options.Permissions & 8;
+	self->achange = ScApp->doc->PDF_Options.Permissions & 8;
 // allow copying document
-	self->acopy = Carrier->doc->PDF_Options.Permissions & 16;
+	self->acopy = ScApp->doc->PDF_Options.Permissions & 16;
 // allow adding annotation and fields
-	self->aanot = Carrier->doc->PDF_Options.Permissions & 32;
+	self->aanot = ScApp->doc->PDF_Options.Permissions & 32;
 // use 1.4 pdf version *aka. Acrobat 5)
-	self->version = Carrier->doc->PDF_Options.Version;
+	self->version = ScApp->doc->PDF_Options.Version;
 // output destination is screen
-	self->outdst = Carrier->doc->PDF_Options.UseRGB ? 0 : 1;
+	self->outdst = ScApp->doc->PDF_Options.UseRGB ? 0 : 1;
 
-	self->profiles = Carrier->doc->PDF_Options.UseProfiles; // bool
-	self->profilei = Carrier->doc->PDF_Options.UseProfiles2; // bool
-	self->noembicc = Carrier->doc->PDF_Options.EmbeddedI; // bool
-	self->intents = Carrier->doc->PDF_Options.Intent; // int - 0 - 3
-	self->intenti = Carrier->doc->PDF_Options.Intent2; // int - 0 - 3
-	QString tp = Carrier->doc->PDF_Options.SolidProf;
-	if (!Carrier->InputProfiles.contains(tp))
-		tp = Carrier->view->Doc->CMSSettings.DefaultSolidColorProfile;
+	self->profiles = ScApp->doc->PDF_Options.UseProfiles; // bool
+	self->profilei = ScApp->doc->PDF_Options.UseProfiles2; // bool
+	self->noembicc = ScApp->doc->PDF_Options.EmbeddedI; // bool
+	self->intents = ScApp->doc->PDF_Options.Intent; // int - 0 - 3
+	self->intenti = ScApp->doc->PDF_Options.Intent2; // int - 0 - 3
+	QString tp = ScApp->doc->PDF_Options.SolidProf;
+	if (!ScApp->InputProfiles.contains(tp))
+		tp = ScApp->view->Doc->CMSSettings.DefaultSolidColorProfile;
 	PyObject *solidpr = NULL;
 	solidpr = PyString_FromString(tp.ascii());
 	if (solidpr){
@@ -464,9 +464,9 @@
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'solidpr' attribute");
 		return -1;
 	}
-	QString tp2 = Carrier->doc->PDF_Options.ImageProf;
-	if (!Carrier->InputProfiles.contains(tp2))
-		tp2 = Carrier->view->Doc->CMSSettings.DefaultSolidColorProfile;
+	QString tp2 = ScApp->doc->PDF_Options.ImageProf;
+	if (!ScApp->InputProfiles.contains(tp2))
+		tp2 = ScApp->view->Doc->CMSSettings.DefaultSolidColorProfile;
 	PyObject *imagepr = NULL;
 	imagepr = PyString_FromString(tp2.ascii());
 	if (imagepr){
@@ -476,9 +476,9 @@
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'imagepr' attribute");
 		return -1;
 	}
-	QString tp3 = Carrier->doc->PDF_Options.PrintProf;
-	if (!Carrier->PDFXProfiles.contains(tp3))
-		tp3 = Carrier->view->Doc->CMSSettings.DefaultPrinterProfile;
+	QString tp3 = ScApp->doc->PDF_Options.PrintProf;
+	if (!ScApp->PDFXProfiles.contains(tp3))
+		tp3 = ScApp->view->Doc->CMSSettings.DefaultPrinterProfile;
 	PyObject *printprofc = NULL;
 	printprofc = PyString_FromString(tp3.ascii());
 	if (printprofc){
@@ -488,7 +488,7 @@
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'printprofc' attribute");
 		return -1;
 	}
-	QString tinfo = Carrier->doc->PDF_Options.Info;
+	QString tinfo = ScApp->doc->PDF_Options.Info;
 	PyObject *info = NULL;
 	info = PyString_FromString(tinfo.ascii());
 	if (info){
@@ -498,10 +498,10 @@
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'info' attribute");
 		return -1;
 	}
-	self->bleedt = Carrier->doc->PDF_Options.BleedTop*Carrier->doc->unitRatio(); // double -
-	self->bleedl = Carrier->doc->PDF_Options.BleedLeft*Carrier->doc->unitRatio(); // double -
-	self->bleedr = Carrier->doc->PDF_Options.BleedRight*Carrier->doc->unitRatio(); // double -
-	self->bleedb = Carrier->doc->PDF_Options.BleedBottom*Carrier->doc->unitRatio(); // double -
+	self->bleedt = ScApp->doc->PDF_Options.BleedTop*ScApp->doc->unitRatio(); // double -
+	self->bleedl = ScApp->doc->PDF_Options.BleedLeft*ScApp->doc->unitRatio(); // double -
+	self->bleedr = ScApp->doc->PDF_Options.BleedRight*ScApp->doc->unitRatio(); // double -
+	self->bleedb = ScApp->doc->PDF_Options.BleedBottom*ScApp->doc->unitRatio(); // double -
 
 	return 0;
 }
@@ -621,7 +621,7 @@
 			PyErr_SetString(PyExc_TypeError, "'pages' list must contain only integers.");
 			return -1;
 		}
-		if (PyInt_AsLong(tmp) > Carrier->doc->pageCount || PyInt_AsLong(tmp) < 1) {
+		if (PyInt_AsLong(tmp) > ScApp->doc->pageCount || PyInt_AsLong(tmp) < 1) {
 			PyErr_SetString(PyExc_ValueError, "'pages' value out of range.");
 			return -1;
 		}
@@ -946,7 +946,7 @@
 
 static PyObject *PDFfile_save(PDFfile *self)
 {
-	if (!Carrier->HaveDoc) {
+	if (!ScApp->HaveDoc) {
 		PyErr_SetString(PyExc_SystemError, "Need to open document first");
 		return NULL;
 	};
@@ -955,21 +955,21 @@
 //void ScribusApp::SaveAsPDF()
 	int Components = 3;
 	QString nam = "";
-	if (Carrier->bookmarkPalette->BView->childCount() == 0)
-		Carrier->doc->PDF_Options.Bookmarks = false;
+	if (ScApp->bookmarkPalette->BView->childCount() == 0)
+		ScApp->doc->PDF_Options.Bookmarks = false;
 
 // apply fonts attribute
-	Carrier->doc->PDF_Options.EmbedList.clear();
+	ScApp->doc->PDF_Options.EmbedList.clear();
 	int n = PyList_Size(self->fonts);
 	for ( int i=0; i<n; ++i){
 		QString tmpFon;
 		tmpFon = QString(PyString_AsString(PyList_GetItem(self->fonts, i)));
-		Carrier->doc->PDF_Options.EmbedList.append(tmpFon);
+		ScApp->doc->PDF_Options.EmbedList.append(tmpFon);
 	}
 // apply file attribute
 	QString fn;
 	fn = QString(PyString_AsString(self->file));
-	Carrier->doc->PDF_Options.Datei = fn;
+	ScApp->doc->PDF_Options.Datei = fn;
 // apply pages attribute
 	std::vector<int> pageNs;
 	int nn=PyList_Size(self->pages);
@@ -977,28 +977,28 @@
 		pageNs.push_back((int)PyInt_AsLong(PyList_GetItem(self->pages, i)));
 	}
 // apply thumbnails attribute
-	Carrier->doc->PDF_Options.Thumbnails = self->thumbnails;
+	ScApp->doc->PDF_Options.Thumbnails = self->thumbnails;
 // apply compress attribute
 	self->compressmtd = minmaxi(self->compressmtd, 0, 3);
-	Carrier->doc->PDF_Options.Compress = self->compress;
-	Carrier->doc->PDF_Options.CompressMethod = self->compressmtd;
+	ScApp->doc->PDF_Options.Compress = self->compress;
+	ScApp->doc->PDF_Options.CompressMethod = self->compressmtd;
 // apply quality attribute
 	self->quality = minmaxi(self->quality, 0, 4);
-	Carrier->doc->PDF_Options.Quality = self->quality;
+	ScApp->doc->PDF_Options.Quality = self->quality;
 // apply resolusion attribute
-	Carrier->doc->PDF_Options.Resolution = PyInt_AsLong(self->resolution);
+	ScApp->doc->PDF_Options.Resolution = PyInt_AsLong(self->resolution);
 // apply downsample attribute
-	Carrier->doc->PDF_Options.RecalcPic = PyInt_AsLong(self->downsample);
-	if (Carrier->doc->PDF_Options.RecalcPic)
-		Carrier->doc->PDF_Options.PicRes = PyInt_AsLong(self->downsample);
+	ScApp->doc->PDF_Options.RecalcPic = PyInt_AsLong(self->downsample);
+	if (ScApp->doc->PDF_Options.RecalcPic)
+		ScApp->doc->PDF_Options.PicRes = PyInt_AsLong(self->downsample);
 	else
-		Carrier->doc->PDF_Options.PicRes = Carrier->doc->PDF_Options.Resolution;
+		ScApp->doc->PDF_Options.PicRes = ScApp->doc->PDF_Options.Resolution;
 // apply bookmarks attribute
-	Carrier->doc->PDF_Options.Bookmarks = self->bookmarks;
+	ScApp->doc->PDF_Options.Bookmarks = self->bookmarks;
 // apply binding attribute
-	Carrier->doc->PDF_Options.Binding = self->binding;
+	ScApp->doc->PDF_Options.Binding = self->binding;
 // apply presentation attribute
-	Carrier->doc->PDF_Options.PresentMode = self->presentation;
+	ScApp->doc->PDF_Options.PresentMode = self->presentation;
 
 	QValueList<PDFPresentationData> PresentVals;
 	PresentVals.clear();
@@ -1031,7 +1031,7 @@
 
 	}
 
-	Carrier->doc->PDF_Options.PresentVals = PresentVals;
+	ScApp->doc->PDF_Options.PresentVals = PresentVals;
 // apply lpival
 	int n2 = PyList_Size(self->lpival);
 	for (int i=0; i<n2; ++i){
@@ -1044,27 +1044,27 @@
 //			 PyErr_SetString(PyExc_SystemError, "while parsing 'lpival'. WHY THIS HAPPENED????");
 //			 return NULL;
 //		 }
-//		 Carrier->doc->PDF_Options.LPISettings[QString(s)]=lpi;
+//		 ScApp->doc->PDF_Options.LPISettings[QString(s)]=lpi;
 		QString st;
 		st = QString(PyString_AsString(PyList_GetItem(t,0)));
 		lpi.Frequency = PyInt_AsLong(PyList_GetItem(t, 1));
 		lpi.Angle = PyInt_AsLong(PyList_GetItem(t, 2));
 		lpi.SpotFunc = PyInt_AsLong(PyList_GetItem(t, 3));
-		Carrier->doc->PDF_Options.LPISettings[st]=lpi;
+		ScApp->doc->PDF_Options.LPISettings[st]=lpi;
 	}
 
-	Carrier->doc->PDF_Options.Articles = self->article;
-	Carrier->doc->PDF_Options.Encrypt = self->encrypt;
-	Carrier->doc->PDF_Options.UseLPI = self->uselpi;
-	Carrier->doc->PDF_Options.UseSpotColors = self->usespot;
-	Carrier->doc->PDF_Options.doMultiFile = self->domulti;
+	ScApp->doc->PDF_Options.Articles = self->article;
+	ScApp->doc->PDF_Options.Encrypt = self->encrypt;
+	ScApp->doc->PDF_Options.UseLPI = self->uselpi;
+	ScApp->doc->PDF_Options.UseSpotColors = self->usespot;
+	ScApp->doc->PDF_Options.doMultiFile = self->domulti;
 	self->version = minmaxi(self->version, 12, 14);
 	// FIXME: Sanity check version
-	Carrier->doc->PDF_Options.Version = (PDFOptions::PDFVersion)self->version;
+	ScApp->doc->PDF_Options.Version = (PDFOptions::PDFVersion)self->version;
 	if (self->encrypt)
 	{
 		int Perm = -64;
-		if (Carrier->doc->PDF_Options.Version == PDFOptions::PDFVersion_14)
+		if (ScApp->doc->PDF_Options.Version == PDFOptions::PDFVersion_14)
 			Perm &= ~0x00240000;
 		if (self->aprint)
 			Perm += 4;
@@ -1074,38 +1074,38 @@
 			Perm += 16;
 		if (self->aanot)
 			Perm += 32;
-		Carrier->doc->PDF_Options.Permissions = Perm;
-		Carrier->doc->PDF_Options.PassOwner = QString(PyString_AsString(self->owner));
-		Carrier->doc->PDF_Options.PassUser = QString(PyString_AsString(self->user));
+		ScApp->doc->PDF_Options.Permissions = Perm;
+		ScApp->doc->PDF_Options.PassOwner = QString(PyString_AsString(self->owner));
+		ScApp->doc->PDF_Options.PassUser = QString(PyString_AsString(self->user));
 	}
 	if (self->outdst == 0)
 	{
-		Carrier->doc->PDF_Options.UseRGB = true;
-		Carrier->doc->PDF_Options.UseProfiles = false;
-		Carrier->doc->PDF_Options.UseProfiles2 = false;
+		ScApp->doc->PDF_Options.UseRGB = true;
+		ScApp->doc->PDF_Options.UseProfiles = false;
+		ScApp->doc->PDF_Options.UseProfiles2 = false;
 	}
 	else
 	{
-		Carrier->doc->PDF_Options.UseRGB = false;
+		ScApp->doc->PDF_Options.UseRGB = false;
 #ifdef HAVE_CMS
 		if (CMSuse)
 		{
-			Carrier->doc->PDF_Options.UseProfiles = self->profiles;
-			Carrier->doc->PDF_Options.UseProfiles2 = self->profilei;
+			ScApp->doc->PDF_Options.UseProfiles = self->profiles;
+			ScApp->doc->PDF_Options.UseProfiles2 = self->profilei;
 			self->intents = minmaxi(self->intents, 0, 3);
-			Carrier->doc->PDF_Options.Intent = self->intents;
+			ScApp->doc->PDF_Options.Intent = self->intents;
 			self->intenti = minmaxi(self->intenti, 0, 3);
-			Carrier->doc->PDF_Options.Intent2 = self->intenti;
-			Carrier->doc->PDF_Options.EmbeddedI = self->noembicc;
-			Carrier->doc->PDF_Options.SolidProf = PyString_AsString(self->solidpr);
-			Carrier->doc->PDF_Options.ImageProf = PyString_AsString(self->imagepr);
-			Carrier->doc->PDF_Options.PrintProf = PyString_AsString(self->printprofc);
-			if (Carrier->doc->PDF_Options.Version == PDFOptions::PDFVersion_X3)
+			ScApp->doc->PDF_Options.Intent2 = self->intenti;
+			ScApp->doc->PDF_Options.EmbeddedI = self->noembicc;
+			ScApp->doc->PDF_Options.SolidProf = PyString_AsString(self->solidpr);
+			ScApp->doc->PDF_Options.ImageProf = PyString_AsString(self->imagepr);
+			ScApp->doc->PDF_Options.PrintProf = PyString_AsString(self->printprofc);
+			if (ScApp->doc->PDF_Options.Version == PDFOptions::PDFVersion_X3)
 			{
 // Where does compiler find cms function when I have not included header for it
 				const char *Descriptor;
 				cmsHPROFILE hIn;
-				hIn = cmsOpenProfileFromFile(Carrier->PrinterProfiles[Carrier->doc->PDF_Options.PrintProf], "r");
+				hIn = cmsOpenProfileFromFile(ScApp->PrinterProfiles[ScApp->doc->PDF_Options.PrintProf], "r");
 				Descriptor = cmsTakeProductDesc(hIn);
 				nam = QString(Descriptor);
 				if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
@@ -1115,27 +1115,27 @@
 				if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmyData)
 					Components = 3;
 				cmsCloseProfile(hIn);
-				Carrier->doc->PDF_Options.Info = PyString_AsString(self->info);
-				self->bleedt = minmaxd(self->bleedt, 0, Carrier->view->Doc->pageHeight*Carrier->view->Doc->unitRatio());
-				Carrier->doc->PDF_Options.BleedTop = self->bleedt/Carrier->view->Doc->unitRatio();
-				self->bleedl = minmaxd(self->bleedl, 0, Carrier->view->Doc->pageWidth*Carrier->view->Doc->unitRatio());
-				Carrier->doc->PDF_Options.BleedLeft = self->bleedl/Carrier->view->Doc->unitRatio();
-				self->bleedr = minmaxd(self->bleedr, 0, Carrier->view->Doc->pageWidth*Carrier->view->Doc->unitRatio());
-				Carrier->doc->PDF_Options.BleedRight = self->bleedr/Carrier->view->Doc->unitRatio();
-				self->bleedb = minmaxd(self->bleedb, 0, Carrier->view->Doc->pageHeight*Carrier->view->Doc->unitRatio());
-				Carrier->doc->PDF_Options.BleedBottom = self->bleedb/Carrier->view->Doc->unitRatio();
-				Carrier->doc->PDF_Options.Encrypt = false;
-				Carrier->doc->PDF_Options.PresentMode = false;
+				ScApp->doc->PDF_Options.Info = PyString_AsString(self->info);
+				self->bleedt = minmaxd(self->bleedt, 0, ScApp->view->Doc->pageHeight*ScApp->view->Doc->unitRatio());
+				ScApp->doc->PDF_Options.BleedTop = self->bleedt/ScApp->view->Doc->unitRatio();
+				self->bleedl = minmaxd(self->bleedl, 0, ScApp->view->Doc->pageWidth*ScApp->view->Doc->unitRatio());
+				ScApp->doc->PDF_Options.BleedLeft = self->bleedl/ScApp->view->Doc->unitRatio();
+				self->bleedr = minmaxd(self->bleedr, 0, ScApp->view->Doc->pageWidth*ScApp->view->Doc->unitRatio());
+				ScApp->doc->PDF_Options.BleedRight = self->bleedr/ScApp->view->Doc->unitRatio();
+				self->bleedb = minmaxd(self->bleedb, 0, ScApp->view->Doc->pageHeight*ScApp->view->Doc->unitRatio());
+				ScApp->doc->PDF_Options.BleedBottom = self->bleedb/ScApp->view->Doc->unitRatio();
+				ScApp->doc->PDF_Options.Encrypt = false;
+				ScApp->doc->PDF_Options.PresentMode = false;
 			}
 		}
 		else
 		{
-			Carrier->doc->PDF_Options.UseProfiles = false;
-			Carrier->doc->PDF_Options.UseProfiles2 = false;
+			ScApp->doc->PDF_Options.UseProfiles = false;
+			ScApp->doc->PDF_Options.UseProfiles2 = false;
 		}
 #else
-		Carrier->doc->PDF_Options.UseProfiles = false;
-		Carrier->doc->PDF_Options.UseProfiles2 = false;
+		ScApp->doc->PDF_Options.UseProfiles = false;
+		ScApp->doc->PDF_Options.UseProfiles2 = false;
 #endif
 
 	}
@@ -1143,12 +1143,12 @@
 	for (uint ap = 0; ap < pageNs.size(); ++ap)
 	{
 		QPixmap pm(10,10);
-		if (Carrier->doc->PDF_Options.Thumbnails)
-			pm = Carrier->view->PageToPixmap(pageNs[ap]-1, 100);
+		if (ScApp->doc->PDF_Options.Thumbnails)
+			pm = ScApp->view->PageToPixmap(pageNs[ap]-1, 100);
 		thumbs.insert(pageNs[ap], pm);
 	}
-	ReOrderText(Carrier->doc, Carrier->view);
-	if (!Carrier->getPDFDriver(fn, nam, Components, pageNs, thumbs)) {
+	ReOrderText(ScApp->doc, ScApp->view);
+	if (!ScApp->getPDFDriver(fn, nam, Components, pageNs, thumbs)) {
 		fn = "Cannot write the File: " + fn;
 		PyErr_SetString(PyExc_SystemError, fn.ascii());
 		return NULL;
Index: plugins/scriptplugin/objprinter.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objprinter.cpp,v
retrieving revision 1.4.2.16
diff -u -r1.4.2.16 objprinter.cpp
--- plugins/scriptplugin/objprinter.cpp	31 Aug 2005 21:40:05 -0000	1.4.2.16
+++ plugins/scriptplugin/objprinter.cpp	7 Sep 2005 16:53:19 -0000
@@ -53,7 +53,7 @@
 static PyObject * Printer_new(PyTypeObject *type, PyObject */*args*/, PyObject */*kwds*/)
 {
 // do not create new object if there is no opened document
-	if (!Carrier->HaveDoc) {
+	if (!ScApp->HaveDoc) {
 		PyErr_SetString(PyExc_SystemError, "Need to open document first");
 		return NULL;
 	}
@@ -174,9 +174,9 @@
 		self->printer = printer;
 	}
 // set defaul name of file to print into
-	QString tf = Carrier->doc->PDF_Options.Datei;
+	QString tf = ScApp->doc->PDF_Options.Datei;
 	if (tf.isEmpty()) {
-		QFileInfo fi = QFileInfo(Carrier->doc->DocName);
+		QFileInfo fi = QFileInfo(ScApp->doc->DocName);
 		tf = fi.dirPath()+"/"+fi.baseName()+".pdf";
 	}
 	PyObject *file = NULL;
@@ -199,10 +199,10 @@
 // set to print all pages
 	PyObject *pages = NULL;
 	int num = 0;
-	if (Carrier->HaveDoc)
+	if (ScApp->HaveDoc)
 		// which one should I use ???
-		// new = Carrier->view->Pages.count()
-		num = Carrier->doc->pageCount;
+		// new = ScApp->view->Pages.count()
+		num = ScApp->doc->pageCount;
 	pages = PyList_New(num);
 	if (pages){
 		Py_DECREF(self->pages);
@@ -361,7 +361,7 @@
 			PyErr_SetString(PyExc_TypeError, "'pages' attribute must be list containing only integers.");
 			return -1;
 		}
-		if (PyInt_AsLong(tmp) > Carrier->doc->pageCount || PyInt_AsLong(tmp) < 1) {
+		if (PyInt_AsLong(tmp) > ScApp->doc->pageCount || PyInt_AsLong(tmp) < 1) {
 			PyErr_SetString(PyExc_ValueError, "'pages' value out of range.");
 			return -1;
 		}
@@ -408,7 +408,7 @@
 // Here we actually print
 static PyObject *Printer_print(Printer *self)
 {
-	if (!Carrier->HaveDoc) {
+	if (!ScApp->HaveDoc) {
 		PyErr_SetString(PyExc_SystemError, "Need to open documetnt first");
 		return NULL;
 	}
@@ -419,7 +419,7 @@
 	bool fil, sep, color, PSfile, mirrorH, mirrorV, useICC, DoGCR;
 	PSfile = false;
 
-//    ReOrderText(Carrier->doc, Carrier->view);
+//    ReOrderText(ScApp->doc, ScApp->view);
 	prn = QString(PyString_AsString(self->printer));
 	fna = QString(PyString_AsString(self->file));
 	fil = (QString(PyString_AsString(self->printer)) == QString("File")) ? true : false;
@@ -446,26 +446,26 @@
 	printcomm = QString(PyString_AsString(self->cmd));
 	QMap<QString,QFont> ReallyUsed;
 	ReallyUsed.clear();
-	Carrier->doc->getUsedFonts(&ReallyUsed);
+	ScApp->doc->getUsedFonts(&ReallyUsed);
 	PrefsManager *prefsManager=PrefsManager::instance();
-	PSLib *dd = new PSLib(true, prefsManager->appPrefs.AvailFonts, ReallyUsed, Carrier->doc->PageColors, false, true);
+	PSLib *dd = new PSLib(true, prefsManager->appPrefs.AvailFonts, ReallyUsed, ScApp->doc->PageColors, false, true);
 	if (dd != NULL)
 	{
 		if (!fil)
-			fna = Carrier->PrefsPfad+"/tmp.ps";
+			fna = ScApp->PrefsPfad+"/tmp.ps";
 		PSfile = dd->PS_set_file(fna);
 		fna = QDir::convertSeparators(fna);
 		if (PSfile)
 		{
 			QStringList spots;
-			dd->CreatePS(Carrier->doc, Carrier->view, pageNs, sep, SepName, spots, color, mirrorH, mirrorV, useICC, DoGCR, false);
+			dd->CreatePS(ScApp->doc, ScApp->view, pageNs, sep, SepName, spots, color, mirrorH, mirrorV, useICC, DoGCR, false);
 			if (PSLevel != 3)
 			{
 				QString tmp;
 				QString opts = "-dDEVICEWIDTHPOINTS=";
-				opts += tmp.setNum(Carrier->doc->pageWidth);
+				opts += tmp.setNum(ScApp->doc->pageWidth);
 				opts += " -dDEVICEHEIGHTPOINTS=";
-				opts += tmp.setNum(Carrier->doc->pageHeight);
+				opts += tmp.setNum(ScApp->doc->pageHeight);
 				if (PSLevel == 1)
 					system("ps2ps -dLanguageLevel=1 "+opts+" \""+fna+"\" \""+fna+".tmp\"");
 				else
Index: plugins/scriptplugin/scriptercore.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp,v
retrieving revision 1.1.2.22
diff -u -r1.1.2.22 scriptercore.cpp
--- plugins/scriptplugin/scriptercore.cpp	8 Aug 2005 18:08:35 -0000	1.1.2.22
+++ plugins/scriptplugin/scriptercore.cpp	7 Sep 2005 16:53:19 -0000
@@ -30,7 +30,7 @@
 ScripterCore::ScripterCore(QWidget* parent)
 {
 	pcon = new PythonConsole(parent);
-	menuMgr = Carrier->scrMenuMgr;
+	menuMgr = ScApp->scrMenuMgr;
 	scrScripterActions.clear();
 	scrRecentScriptActions.clear();
 
@@ -130,35 +130,35 @@
 
 void ScripterCore::FinishScriptRun()
 {
-	if (Carrier->HaveDoc)
+	if (ScApp->HaveDoc)
 	{
-		Carrier->propertiesPalette->SetDoc(Carrier->doc);
-		Carrier->propertiesPalette->updateCList();
-		Carrier->propertiesPalette->Spal->setFormats(Carrier->doc);
-		Carrier->propertiesPalette->SetLineFormats(Carrier->doc);
-		Carrier->propertiesPalette->Cpal->SetColors(Carrier->doc->PageColors);
-		Carrier->layerPalette->setLayers(&Carrier->doc->Layers, Carrier->doc->activeLayer());
-		Carrier->outlinePalette->BuildTree(Carrier->doc);
-		Carrier->pagePalette->SetView(Carrier->view);
-		Carrier->pagePalette->Rebuild();
-		Carrier->doc->RePos = true;
+		ScApp->propertiesPalette->SetDoc(ScApp->doc);
+		ScApp->propertiesPalette->updateCList();
+		ScApp->propertiesPalette->Spal->setFormats(ScApp->doc);
+		ScApp->propertiesPalette->SetLineFormats(ScApp->doc);
+		ScApp->propertiesPalette->Cpal->SetColors(ScApp->doc->PageColors);
+		ScApp->layerPalette->setLayers(&ScApp->doc->Layers, ScApp->doc->activeLayer());
+		ScApp->outlinePalette->BuildTree(ScApp->doc);
+		ScApp->pagePalette->SetView(ScApp->view);
+		ScApp->pagePalette->Rebuild();
+		ScApp->doc->RePos = true;
 		QPixmap pgPix(10, 10);
 		QRect rd = QRect(0,0,9,9);
 		ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height());
-		for (uint azz=0; azz<Carrier->doc->Items.count(); ++azz)
+		for (uint azz=0; azz<ScApp->doc->Items.count(); ++azz)
 		{
-			PageItem *ite = Carrier->doc->Items.at(azz);
+			PageItem *ite = ScApp->doc->Items.at(azz);
 			if (ite->Groups.count() != 0)
-				Carrier->view->GroupOnPage(ite);
+				ScApp->view->GroupOnPage(ite);
 			else
-				ite->OwnPage = Carrier->view->OnPage(ite);
-			Carrier->view->setRedrawBounding(ite);
+				ite->OwnPage = ScApp->view->OnPage(ite);
+			ScApp->view->setRedrawBounding(ite);
 			if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText) && (!ite->Redrawn))
 			{
 				if (ite->itemType() == PageItem::PathText)
 				{
 					ite->Frame = false;
-					Carrier->view->UpdatePolyClip(ite);
+					ScApp->view->UpdatePolyClip(ite);
 					ite->DrawObj(painter, rd);
 				}
 				else
@@ -182,15 +182,15 @@
 			}
 		}
 		delete painter;
-		Carrier->doc->RePos = false;
-		if (Carrier->view->SelItem.count() != 0)
+		ScApp->doc->RePos = false;
+		if (ScApp->view->SelItem.count() != 0)
 		{
-			Carrier->view->EmitValues(Carrier->view->SelItem.at(0));
-			Carrier->HaveNewSel(Carrier->view->SelItem.at(0)->itemType());
+			ScApp->view->EmitValues(ScApp->view->SelItem.at(0));
+			ScApp->HaveNewSel(ScApp->view->SelItem.at(0)->itemType());
 		}
 		else
-			Carrier->HaveNewSel(-1);
-		Carrier->view->DrawNew();
+			ScApp->HaveNewSel(-1);
+		ScApp->view->DrawNew();
 	}
 }
 
@@ -198,7 +198,7 @@
 {
 	QString fileName;
 	QString curDirPath = QDir::currentDirPath();
-	RunScriptDialog dia( Carrier, enableExtPython );
+	RunScriptDialog dia( ScApp, enableExtPython );
 	if (dia.exec())
 	{
 		fileName = dia.selectedFile();
@@ -253,7 +253,7 @@
 	// Set up a sub-interpreter if needed:
 	if (!inMainInterpreter)
 	{
-		Carrier->ScriptRunning = true;
+		ScApp->ScriptRunning = true;
 		qApp->setOverrideCursor(QCursor(waitCursor), false);
 		// Create the sub-interpreter
 		// FIXME: This calls abort() in a Python debug build. We're doing something wrong.
@@ -262,7 +262,7 @@
 		// Chdir to the dir the script is in
 		QDir::setCurrent(fi.dirPath(true));
 		// Init the scripter module in the sub-interpreter
-		initscribus(Carrier);
+		initscribus(ScApp);
 	}
 	// Make sure sys.argv[0] is the path to the script
 	char* comm[1];
@@ -337,7 +337,7 @@
 				// Display a dialog to the user with the exception
 				QClipboard *cp = QApplication::clipboard();
 				cp->setText(errorMsg);
-				QMessageBox::warning(Carrier,
+				QMessageBox::warning(ScApp,
 									tr("Script error"),
 									tr("If you are running an official script report it at <a href=\"http://bugs.scribus.net\">bugs.scribus.net</a> please.")
 									+ "<pre>" +errorMsg + "</pre>"
@@ -353,12 +353,12 @@
 		PyEval_RestoreThread(stateo);
 		qApp->restoreOverrideCursor();
 	}
-	Carrier->ScriptRunning = false;
+	ScApp->ScriptRunning = false;
 }
 
 QString ScripterCore::slotRunScript(QString Script)
 {
-	Carrier->ScriptRunning = true;
+	ScApp->ScriptRunning = true;
 	qApp->setOverrideCursor(QCursor(waitCursor), false);
 	InValue = Script;
 	QString CurDir = QDir::currentDirPath();
@@ -368,7 +368,7 @@
 			);
 	if(PyThreadState_Get() != NULL)
 	{
-		initscribus(Carrier);
+		initscribus(ScApp);
 		if (RetVal == 0)
 			cm += (
 				"scribus._bu = cStringIO.StringIO()\n"
@@ -410,13 +410,13 @@
 		if (result == NULL)
 		{
 			PyErr_Print();
-			QMessageBox::warning(Carrier, tr("Script error"),
+			QMessageBox::warning(ScApp, tr("Script error"),
 					"<qt>" + tr("There was an internal error while trying the "
 					   "command you entered. Details were printed to "
 					   "stderr. ") + "</qt>");
 		}
 	}
-	Carrier->ScriptRunning = false;
+	ScApp->ScriptRunning = false;
 	qApp->restoreOverrideCursor();
 	return RetString;
 }
@@ -490,7 +490,7 @@
  */
 void ScripterCore::aboutScript()
 {
-	QString fname = Carrier->CFileDialog(".", tr("Examine Script"), tr("Python Scripts (*.py)"), "", 0, 0, 0, 0);
+	QString fname = ScApp->CFileDialog(".", tr("Examine Script"), tr("Python Scripts (*.py)"), "", 0, 0, 0, 0);
 	if (fname == QString::null)
 		return;
 	QFileInfo fi = QFileInfo(fname);
@@ -571,7 +571,7 @@
 	if (PyRun_SimpleString(cmd.data()))
 	{
 		PyErr_Print();
-		QMessageBox::warning(Carrier, tr("Script error"),
+		QMessageBox::warning(ScApp, tr("Script error"),
 				tr("Setting up the Python plugin failed. "
 				   "Error details were printed to stderr. "));
 		return false;
Index: plugins/scriptplugin/scriptplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp,v
retrieving revision 1.33.2.71
diff -u -r1.33.2.71 scriptplugin.cpp
--- plugins/scriptplugin/scriptplugin.cpp	23 Aug 2005 17:20:08 -0000	1.33.2.71
+++ plugins/scriptplugin/scriptplugin.cpp	7 Sep 2005 16:53:20 -0000
@@ -58,6 +58,7 @@
 #include <qregexp.h>
 #include <qtextstream.h>
 #include <cstdlib>
+#include "pluginmanager.h"
 
 #include <iostream>
 
@@ -80,53 +81,55 @@
 QString InValue;
 int RetVal;
 
-QString name()
+int scriptplugin_getPluginAPIVersion()
 {
-	return QObject::tr("S&cripter Manual...");
+	return PLUGIN_API_VERSION;
 }
 
-PluginManager::PluginType type()
+ScPlugin* scriptplugin_getPlugin()
 {
-	return PluginManager::Persistent;
+	ScriptPlugin* plug = new ScriptPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void scriptplugin_freePlugin(ScPlugin* plugin)
 {
-	return 8;
+	ScriptPlugin* plug = dynamic_cast<ScriptPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+ScriptPlugin::ScriptPlugin() : ScPersistentPlugin()
 {
-	return "Scripter";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
-{
-	return "";
-}
+ScriptPlugin::~ScriptPlugin() {};
 
-QString actionMenu()
+void ScriptPlugin::languageChange()
 {
-	return "Help";
+	if (scripterCore)
+		scripterCore->languageChange();
 }
 
-QString actionMenuAfterName()
+const QString ScriptPlugin::fullTrName() const
 {
-	return "Manual";
+	return QObject::tr("Scripter");
 }
 
-bool actionEnabledOnStartup()
+const ScActionPlugin::AboutData* ScriptPlugin::getAboutData() const
 {
-	return true;
+	return 0;
 }
 
-void languageChange()
+void ScriptPlugin::deleteAboutData(const AboutData* about) const
 {
-	if (scripterCore)
-		scripterCore->languageChange();
 }
 
-void initPlug(QWidget *d, ScribusApp *plug)
+bool ScriptPlugin::initPlugin()
 {
 	QString cm;
 	Py_Initialize();
@@ -135,31 +138,35 @@
 		qDebug("Failed to set default encoding to utf-8.\n");
 		PyErr_Clear();
 	}
-	Carrier = plug;
 	RetVal = 0;
 
-	scripterCore = new ScripterCore(d);
-	initscribus(Carrier);
+	scripterCore = new ScripterCore(ScApp);
+	Q_CHECK_PTR(scripterCore);
+	initscribus(ScApp);
 	scripterCore->setupMainInterpreter();
 	scripterCore->initExtensionScripts();
 	scripterCore->runStartupScript();
+	return true;
 }
 
-void cleanUpPlug()
+bool ScriptPlugin::cleanupPlugin()
 {
 	if (scripterCore)
 		delete scripterCore;
 	Py_Finalize();
+	return true;
 }
 
-void run(QWidget* /*d*/, ScribusApp* /*plug*/)
+/*  TEMPORARILY DISABLED
+void run()
 {
 	QString pfad = ScPaths::instance().docDir();
 	QString pfad2;
 	pfad2 = QDir::convertSeparators(pfad + "en/Scripter/index.html");
-	HelpBrowser *dia = new HelpBrowser(0, QObject::tr("Online Reference"), Carrier->getGuiLanguage(), "scripter");
+	HelpBrowser *dia = new HelpBrowser(0, QObject::tr("Online Reference"), ScApp->getGuiLanguage(), "scripter");
 	dia->show();
 }
+*/
 
 
 /****************************************************************************************/
@@ -579,7 +586,7 @@
 	else
 		qDebug("Couldn't parse version string '%s' in scripter", VERSION);
 
-	Carrier = pl;
+	ScApp = pl;
 	// Function aliases for compatibility
 	// We need to import the __builtins__, warnings and exceptions modules to be able to run
 	// the generated Python functions from inside the `scribus' module's context.
@@ -673,10 +680,10 @@
 	Py_DECREF(wrappedQApp);
 	wrappedQApp = NULL;
 
-	wrappedMainWindow = wrapQObject(Carrier);
+	wrappedMainWindow = wrapQObject(ScApp);
 	if (!wrappedMainWindow)
 	{
-		qDebug("Failed to wrap up Carrier");
+		qDebug("Failed to wrap up ScApp");
 		PyErr_Print();
 	}
 	// Push it into the module dict, stealing a ref in the process
Index: plugins/scriptplugin/scriptplugin.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/scriptplugin.h,v
retrieving revision 1.5.2.13
diff -u -r1.5.2.13 scriptplugin.h
--- plugins/scriptplugin/scriptplugin.h	18 May 2005 12:28:28 -0000	1.5.2.13
+++ plugins/scriptplugin/scriptplugin.h	7 Sep 2005 16:53:20 -0000
@@ -1,35 +1,31 @@
 #ifndef SCRIPTPLUG_H
 #define SCRIPTPLUG_H
 
-#include "pluginmanager.h"
-
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" void run(QWidget *d, ScribusApp *plug);
-
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" QString name();
-
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugin is a Import Plugin, which appears in the Import Menue
-  * 3 = the Plugin is a Export Plugin, which appears in the Export Menue
-  * 4 = the Plugin is a resident Plugin   */
-extern "C" PluginManager::PluginType type();
-extern "C" int ID();
-extern "C" QString actionName();
-extern "C" QString actionKeySequence();
-extern "C" QString actionMenu();
-extern "C" QString actionMenuAfterName();
-extern "C" bool actionEnabledOnStartup();
-extern "C" void languageChange();
-
-/** Initializes the Plugin if it's a Plugin of Type 4 */
-extern "C" void initPlug(QWidget *d, ScribusApp *plug);
-
-/** Possible CleanUpOperations when closing the Plugin */
-extern "C" void cleanUpPlug();
+#include "cmdvar.h"
+#include "scplugin.h"
+#include "pluginapi.h"
+
+class PLUGIN_API ScriptPlugin : public ScPersistentPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		ScriptPlugin();
+		virtual ~ScriptPlugin();
+		virtual bool initPlugin();
+		virtual bool cleanupPlugin();
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int scriptplugin_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* scriptplugin_getPlugin();
+extern "C" PLUGIN_API void scriptplugin_freePlugin(ScPlugin* plugin);
 
 /** Some useful Subroutines */
 static PyObject *scribus_retval(PyObject *self, PyObject* args);
Index: plugins/scriptplugin/svgimport.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/Attic/svgimport.cpp,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 svgimport.cpp
--- plugins/scriptplugin/svgimport.cpp	29 Jul 2005 21:34:54 -0000	1.1.2.2
+++ plugins/scriptplugin/svgimport.cpp	7 Sep 2005 16:53:20 -0000
@@ -9,18 +9,17 @@
 PyObject *scribus_importsvg(PyObject* /* self */, PyObject* args)
 {
 	char *aText;
-	if (!PyArg_ParseTuple(args, "es", "utf-8", &aText))
+	if (!PyArg_ParseTuple(args, const_cast<char*>("es"), const_cast<char*>("utf-8"), &aText))
 		return NULL;
 
 	if(!checkHaveDocument())
 		return NULL;
 
-	if (!Carrier->pluginManager->DLLexists(10))
+	if (!ScApp->pluginManager->DLLexists("svgimplugin"))
 		return NULL;
 
-	Carrier->pluginManager->dllInput = QString::fromUtf8(aText);
-	Carrier->pluginManager->callDLL(10);
-	Carrier->doc->setLoading(false);
+	ScApp->pluginManager->callImportExportPlugin("svgimplugin", QString::fromUtf8(aText));
+	ScApp->doc->setLoading(false);
 
 	Py_INCREF(Py_None);
 	return Py_None;
Index: plugins/short-words/shortwords.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/short-words/shortwords.cpp,v
retrieving revision 1.1.2.14
diff -u -r1.1.2.14 shortwords.cpp
--- plugins/short-words/shortwords.cpp	7 Sep 2005 12:20:09 -0000	1.1.2.14
+++ plugins/short-words/shortwords.cpp	7 Sep 2005 16:53:20 -0000
@@ -13,6 +13,8 @@
 #include "shortwords.moc"
 #include "version.h"
 #include "vlnadialog.h"
+#include "configuration.h"
+#include "parse.h"
 #include "pluginmanager.h"
 #include "scpaths.h"
 #include "scribus.h"
@@ -24,54 +26,69 @@
 #include <qdir.h>
 #include <qcheckbox.h>
 
-extern ScribusApp SCRIBUS_API *ScApp;
-
-
-QString name()
+int scribusshortwords_getPluginAPIVersion()
 {
-	return QObject::tr("Short &Words...", "short words plugin");
+	return PLUGIN_API_VERSION;
 }
 
-PluginManager::PluginType type()
+ScPlugin* scribusshortwords_getPlugin()
 {
-	return PluginManager::Standard;
+	ShortWordsPlugin* plug = new ShortWordsPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void scribusshortwords_freePlugin(ScPlugin* plugin)
 {
-	return 11;
+	ShortWordsPlugin* plug = dynamic_cast<ShortWordsPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+ShortWordsPlugin::ShortWordsPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Action)
 {
-	return "ShortWords";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+ShortWordsPlugin::~ShortWordsPlugin() {};
+
+void ShortWordsPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ShortWords";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Short &Words...", "short words plugin");
+	// Menu
+	m_actionInfo.menu = "Extras";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString ShortWordsPlugin::fullTrName() const
 {
-	return "Extras";
+	return QObject::tr("Short Words");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* ShortWordsPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void ShortWordsPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
-void run(QWidget */*d*/, ScribusApp */*plug*/)
+bool ShortWordsPlugin::run(QString target)
 {
+	Q_ASSERT(target.isEmpty());
 	ShortWords *sw = new ShortWords();
 	/*delete sw;
 	delete trans;*/
+	return true;
 }
 
 ShortWords::ShortWords()
Index: plugins/short-words/shortwords.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/short-words/shortwords.h,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 shortwords.h
--- plugins/short-words/shortwords.h	28 Aug 2005 14:04:50 -0000	1.1.2.7
+++ plugins/short-words/shortwords.h	7 Sep 2005 16:53:20 -0000
@@ -9,46 +9,38 @@
 or documentation
 */
 
-#ifndef _SCRIBUS_SHORTWORDS_H_
-#define _SCRIBUS_SHORTWORDS_H_
+#ifndef SCRIBUS_SHORTWORDS_H
+#define SCRIBUS_SHORTWORDS_H
 
 #include "scconfig.h"
 #include "pluginapi.h"
-#include "configuration.h"
-#include "parse.h"
-#include "vlnadialog.h"
-#include "pluginmanager.h"
-#include "scribus.h"
-
-/** Calls the Plugin with the main Application window as parent
-and the main Application Class as parameter. Loads translator too.
-*/
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-
-
-/** Returns the Name of the Plugin.
- This name appears in the relevant Menue-Entrys
- */
-extern "C" PLUGIN_API QString name();
-
-
-/** Returns the Type of the Plugin.
-  \retval 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-
-/** Returns the Id of the Plugin.
-  \retval 11 = id from the plugin registry
- */
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+#include "scplugin.h"
+
+
+class PLUGIN_API ShortWordsPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		ShortWordsPlugin();
+		virtual ~ShortWordsPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int scribusshortwords_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* scribusshortwords_getPlugin();
+extern "C" PLUGIN_API void scribusshortwords_freePlugin(ScPlugin* plugin);
+
 
 class Parse;
+class Config;
 
 /** \brief This is Short Words plugin main class.
 It contains main logic. */
Index: plugins/svgexplugin/svgexplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp,v
retrieving revision 1.25.2.27
diff -u -r1.25.2.27 svgexplugin.cpp
--- plugins/svgexplugin/svgexplugin.cpp	7 Sep 2005 12:20:09 -0000	1.25.2.27
+++ plugins/svgexplugin/svgexplugin.cpp	7 Sep 2005 16:53:21 -0000
@@ -19,7 +19,6 @@
 #include <qtextstream.h>
 
 #include "svgexplugin.h"
-#include "svgexplugin.moc"
 
 #include "scconfig.h"
 
@@ -34,60 +33,60 @@
 #include "pluginmanager.h"
 #include "util.h"
 
-/*!
- \fn QString Name()
- \author Franz Schmid
- \date
- \brief Returns name of plugin
- \param None
- \retval QString containing name of plugin: Save Page as SVG...
- */
-QString name()
+int svgexplugin_getPluginAPIVersion()
 {
-  return QObject::tr("Save Page as &SVG...");
+	return PLUGIN_API_VERSION;
 }
 
-/*!
- \fn int Type()
- \author Franz Schmid
- \date
- \brief Returns type of plugin
- \param None
- \retval int containing type of plugin (1: Extra, 2: Import, 3: Export, 4: )
- */
-PluginManager::PluginType type()
+ScPlugin* svgexplugin_getPlugin()
 {
-	return PluginManager::Standard;
+	SVGExportPlugin* plug = new SVGExportPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void svgexplugin_freePlugin(ScPlugin* plugin)
 {
-	return 9;
+	SVGExportPlugin* plug = dynamic_cast<SVGExportPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+SVGExportPlugin::SVGExportPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Export)
 {
-	return "ExportAsSVG";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+SVGExportPlugin::~SVGExportPlugin() {};
+
+void SVGExportPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ExportAsSVG";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Save Page as &SVG...");
+	// Menu
+	m_actionInfo.menu = "FileExport";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString SVGExportPlugin::fullTrName() const
 {
-	return "FileExport";
+	return QObject::tr("SVG Export");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* SVGExportPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void SVGExportPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
 /*!
@@ -99,17 +98,18 @@
  \param plug ScribusApp *
  \retval None
  */
-void run(QWidget *d, ScribusApp *plug)
+bool SVGExportPlugin::run(QString filename)
 {
-	if (plug->HaveDoc)
+	Q_ASSERT(filename.isEmpty());
+	if (ScApp->HaveDoc)
 	{
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("svgex");
 		QString wdir = prefs->get("wdir", ".");
-		QString defaultName = getFileNameByPage(plug->doc->currentPage->pageNr(), "svg");
+		QString defaultName = getFileNameByPage(ScApp->doc->currentPage->pageNr(), "svg");
 #ifdef HAVE_LIBZ
-		QString fileName = plug->CFileDialog(wdir, QObject::tr("Save as"), QObject::tr("SVG-Images (*.svg *.svgz);;All Files (*)"), defaultName, false, false, true);
+		QString fileName = ScApp->CFileDialog(wdir, QObject::tr("Save as"), QObject::tr("SVG-Images (*.svg *.svgz);;All Files (*)"), defaultName, false, false, true);
 #else
-		QString fileName = plug->CFileDialog(wdir, QObject::tr("Save as"), QObject::tr("SVG-Images (*.svg);;All Files (*)"), defaultName, false, false);
+		QString fileName = ScApp->CFileDialog(wdir, QObject::tr("Save as"), QObject::tr("SVG-Images (*.svg);;All Files (*)"), defaultName, false, false);
 #endif
 		if (!fileName.isEmpty())
 		{
@@ -117,20 +117,21 @@
 			QFile f(fileName);
 			if (f.exists())
 			{
-				int exit=QMessageBox::warning(d, QObject::tr("Warning"),
+				int exit=QMessageBox::warning(ScApp, QObject::tr("Warning"),
 					QObject::tr("Do you really want to overwrite the File:\n%1 ?").arg(fileName),
 					QObject::tr("Yes"),
 					QObject::tr("No"),
 					0, 0, 1);
 				if (exit != 0)
-					return;
+					return true;
 			}
-			SVGExPlug *dia = new SVGExPlug(plug, fileName);
+			SVGExPlug *dia = new SVGExPlug(fileName);
 			delete dia;
 		}
 		else
-			return;
+			return true;
 	}
+	return true;
 }
 
 /*!
@@ -143,24 +144,24 @@
  \param fName QString
  \retval SVGExPlug plugin
  */
-SVGExPlug::SVGExPlug( ScribusApp *plug, QString fName )
+SVGExPlug::SVGExPlug( QString fName )
 {
 	QDomDocument docu("svgdoc");
 	QString vo = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
 	QString st = "<svg></svg>";
 	docu.setContent(st);
 	QDomElement elem = docu.documentElement();
-	elem.setAttribute("width", FToStr(plug->doc->pageWidth)+"pt");
-	elem.setAttribute("height", FToStr(plug->doc->pageHeight)+"pt");
+	elem.setAttribute("width", FToStr(ScApp->doc->pageWidth)+"pt");
+	elem.setAttribute("height", FToStr(ScApp->doc->pageHeight)+"pt");
 	elem.setAttribute("xmlns", "http://www.w3.org/2000/svg");
 	elem.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");
 	Page *Seite;
 	GradCount = 0;
 	ClipCount = 0;
-	Seite = plug->doc->MasterPages.at(plug->doc->MasterNames[plug->doc->currentPage->MPageNam]);
-	ProcessPage(plug, Seite, &docu, &elem);
-	Seite = plug->doc->currentPage;
-	ProcessPage(plug, Seite, &docu, &elem);
+	Seite = ScApp->doc->MasterPages.at(ScApp->doc->MasterNames[ScApp->doc->currentPage->MPageNam]);
+	ProcessPage(Seite, &docu, &elem);
+	Seite = ScApp->doc->currentPage;
+	ProcessPage(Seite, &docu, &elem);
 #ifdef HAVE_LIBZ
 	if(fName.right(2) == "gz")
 		{
@@ -206,7 +207,7 @@
  \param elem QDomElement *
  \retval None
  */
-void SVGExPlug::ProcessPage(ScribusApp *plug, Page *Seite, QDomDocument *docu, QDomElement *elem)
+void SVGExPlug::ProcessPage(Page *Seite, QDomDocument *docu, QDomElement *elem)
 {
 	QString tmp, trans, fill, stroke, strokeW, strokeLC, strokeLJ, strokeDA, gradi, Clipi, chx;
 	uint d;
@@ -221,15 +222,15 @@
 	gradi = "Grad";
 	Clipi = "Clip";
 	QPtrList<PageItem> Items;
-	Page* SavedAct = plug->doc->currentPage;
-	plug->doc->currentPage = Seite;
+	Page* SavedAct = ScApp->doc->currentPage;
+	ScApp->doc->currentPage = Seite;
 	if (Seite->PageNam.isEmpty())
-		Items = plug->doc->DocItems;
+		Items = ScApp->doc->DocItems;
 	else
-		Items = plug->doc->MasterItems;
-	for (uint la = 0; la < plug->doc->Layers.count(); la++)
+		Items = ScApp->doc->MasterItems;
+	for (uint la = 0; la < ScApp->doc->Layers.count(); la++)
 		{
-		Level2Layer(plug->doc, &ll, Lnr);
+		Level2Layer(ScApp->doc, &ll, Lnr);
 		if (ll.isPrintable)
 			{
 			for(uint j = 0; j < Items.count(); ++j)
@@ -249,7 +250,7 @@
 					continue;
 				if ((Item->fillColor() != "None") || (Item->GrType != 0))
 				{
-					fill = "fill:"+SetFarbe(Item->fillColor(), Item->fillShade(), plug)+";";
+					fill = "fill:"+SetFarbe(Item->fillColor(), Item->fillShade())+";";
 					if (Item->GrType != 0)
 					{
 						defi = docu->createElement("defs");
@@ -308,7 +309,7 @@
 							QDomElement itcl = docu->createElement("stop");
 							itcl.setAttribute("offset", FToStr(cstops.at(cst)->rampPoint*100)+"%");
 							itcl.setAttribute("stop-opacity", FToStr(cstops.at(cst)->opacity));
-							itcl.setAttribute("stop-color", SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade, plug));
+							itcl.setAttribute("stop-color", SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade));
 							grad.appendChild(itcl);
 						}
 						defi.appendChild(grad);
@@ -323,7 +324,7 @@
 					fill = "fill:none;";
 				if (Item->lineColor() != "None")
 				{
-					stroke = "stroke:"+SetFarbe(Item->lineColor(), Item->lineShade(), plug)+";";
+					stroke = "stroke:"+SetFarbe(Item->lineColor(), Item->lineShade())+";";
 					if (Item->lineTransparency() != 0)
 						stroke += " stroke-opacity:"+FToStr(1.0 - Item->lineTransparency())+";";
 				}
@@ -431,12 +432,12 @@
 							ob.setAttribute("d", SetClipPath(Item)+"Z");
 							ob.setAttribute("style", fill);
 							gr.appendChild(ob);
-							multiLine ml = plug->doc->MLineStyles[Item->NamedLStyle];
+							multiLine ml = ScApp->doc->MLineStyles[Item->NamedLStyle];
 							for (int it = ml.size()-1; it > -1; it--)
 							{
 								ob = docu->createElement("path");
 								ob.setAttribute("d", SetClipPath(Item)+"Z");
-								ob.setAttribute("style", GetMultiStroke(plug, &ml[it], Item));
+								ob.setAttribute("style", GetMultiStroke(&ml[it], Item));
 								gr.appendChild(ob);
 							}
 						}
@@ -485,12 +486,12 @@
 						}
 						else
 						{
-							multiLine ml = plug->doc->MLineStyles[Item->NamedLStyle];
+							multiLine ml = ScApp->doc->MLineStyles[Item->NamedLStyle];
 							for (int it = ml.size()-1; it > -1; it--)
 							{
 								ob = docu->createElement("path");
 								ob.setAttribute("d", SetClipPath(Item)+"Z");
-								ob.setAttribute("style", "fill:none; "+GetMultiStroke(plug, &ml[it], Item));
+								ob.setAttribute("style", "fill:none; "+GetMultiStroke(&ml[it], Item));
 								gr.appendChild(ob);
 							}
 						}
@@ -503,12 +504,12 @@
 						}
 						else
 						{
-							multiLine ml = plug->doc->MLineStyles[Item->NamedLStyle];
+							multiLine ml = ScApp->doc->MLineStyles[Item->NamedLStyle];
 							for (int it = ml.size()-1; it > -1; it--)
 							{
 								ob = docu->createElement("path");
 								ob.setAttribute("d", SetClipPath(Item));
-								ob.setAttribute("style", GetMultiStroke(plug, &ml[it], Item));
+								ob.setAttribute("style", GetMultiStroke(&ml[it], Item));
 								gr.appendChild(ob);
 							}
 						}
@@ -536,7 +537,7 @@
 							tp = docu->createElement("tspan");
 							tp.setAttribute("x", FToStr(hl->xp)+"pt");
 							tp.setAttribute("y", FToStr(hl->yp)+"pt");
-							SetTextProps(&tp, hl, plug);
+							SetTextProps(&tp, hl);
 							tp1 = docu->createTextNode(chx);
 							tp.appendChild(tp1);
 							ob.appendChild(tp);
@@ -550,12 +551,12 @@
 						}
 						else
 						{
-							multiLine ml = plug->doc->MLineStyles[Item->NamedLStyle];
+							multiLine ml = ScApp->doc->MLineStyles[Item->NamedLStyle];
 							for (int it = ml.size()-1; it > -1; it--)
 							{
 								ob = docu->createElement("path");
 								ob.setAttribute("d", "M 0 0 L "+FToStr(Item->Width)+" 0");
-								ob.setAttribute("style", GetMultiStroke(plug, &ml[it], Item));
+								ob.setAttribute("style", GetMultiStroke(&ml[it], Item));
 								gr.appendChild(ob);
 							}
 						}
@@ -571,12 +572,12 @@
 							}
 							else
 							{
-								multiLine ml = plug->doc->MLineStyles[Item->NamedLStyle];
+								multiLine ml = ScApp->doc->MLineStyles[Item->NamedLStyle];
 								for (int it = ml.size()-1; it > -1; it--)
 								{
 									ob = docu->createElement("path");
 									ob.setAttribute("d", SetClipPath(Item));
-									ob.setAttribute("style", GetMultiStroke(plug, &ml[it], Item));
+									ob.setAttribute("style", GetMultiStroke(&ml[it], Item));
 									gr.appendChild(ob);
 								}
 							}
@@ -598,7 +599,7 @@
 							tp2 = docu->createElement("tspan");
 							tp2.setAttribute("dx", FToStr(hl->xp)+"pt");
 							tp2.setAttribute("dy", FToStr(hl->yp)+"pt");
-							SetTextProps(&tp2, hl, plug);
+							SetTextProps(&tp2, hl);
 							tp1 = docu->createTextNode(chx);
 							tp2.appendChild(tp1);
 							tp.appendChild(tp2);
@@ -616,7 +617,7 @@
 		}
 		Lnr++;
 	}
-	plug->doc->currentPage = SavedAct;
+	ScApp->doc->currentPage = SavedAct;
 }
 
 /*!
@@ -729,22 +730,22 @@
  \param plug ScribusApp *
  \retval None
  */
-void SVGExPlug::SetTextProps(QDomElement *tp, struct ScText *hl, ScribusApp *plug)
+void SVGExPlug::SetTextProps(QDomElement *tp, struct ScText *hl)
 {
 	int chst = hl->cstyle & 127;
 	if (hl->ccolor != "None")
-		tp->setAttribute("fill", SetFarbe(hl->ccolor, hl->cshade, plug));
+		tp->setAttribute("fill", SetFarbe(hl->ccolor, hl->cshade));
 	else
 		tp->setAttribute("fill", "none");
 	if ((hl->cstroke != "None") && (chst & 4))
 		{
-		tp->setAttribute("stroke", SetFarbe(hl->cstroke, hl->cshade2, plug));
-		tp->setAttribute("stroke-width", FToStr((*plug->doc->AllFonts)[hl->cfont->SCName]->strokeWidth * (hl->csize / 10.0))+"pt");
+		tp->setAttribute("stroke", SetFarbe(hl->cstroke, hl->cshade2));
+		tp->setAttribute("stroke-width", FToStr((*ScApp->doc->AllFonts)[hl->cfont->SCName]->strokeWidth * (hl->csize / 10.0))+"pt");
 		}
 	else
 		tp->setAttribute("stroke", "none");
 	tp->setAttribute("font-size", (hl->csize / 10.0));
-	tp->setAttribute("font-family", (*plug->doc->AllFonts)[hl->cfont->SCName]->Family);
+	tp->setAttribute("font-family", (*ScApp->doc->AllFonts)[hl->cfont->SCName]->Family);
 	if (chst != 0)
 		{
 		if (chst & 64)
@@ -768,9 +769,9 @@
  \param plug ScribusApp *
  \retval QString Colour settings
  */
-QString SVGExPlug::SetFarbe(QString farbe, int shad, ScribusApp *plug)
+QString SVGExPlug::SetFarbe(QString farbe, int shad)
 {
-	return plug->doc->PageColors[farbe].getShadeColorProof(shad).name();
+	return ScApp->doc->PageColors[farbe].getShadeColorProof(shad).name();
 }
 
 /*!
@@ -783,10 +784,10 @@
  \param Item PageItem *
  \retval QString Stroke settings
  */
-QString SVGExPlug::GetMultiStroke(ScribusApp *plug, struct SingleLine *sl, PageItem *Item)
+QString SVGExPlug::GetMultiStroke(struct SingleLine *sl, PageItem *Item)
 {
 	QString tmp = "fill:none; ";
-	tmp += "stroke:"+SetFarbe(sl->Color, sl->Shade, plug)+"; ";
+	tmp += "stroke:"+SetFarbe(sl->Color, sl->Shade)+"; ";
 	if (Item->fillTransparency() != 0)
 		tmp += " stroke-opacity:"+FToStr(1.0 - Item->fillTransparency())+"; ";
 	tmp += "stroke-width:"+FToStr(sl->Width)+"pt; ";
@@ -860,3 +861,5 @@
 SVGExPlug::~SVGExPlug()
 {
 }
+
+#include "svgexplugin.moc"
Index: plugins/svgexplugin/svgexplugin.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/svgexplugin/svgexplugin.h,v
retrieving revision 1.4.2.8
diff -u -r1.4.2.8 svgexplugin.h
--- plugins/svgexplugin/svgexplugin.h	11 Aug 2005 16:48:08 -0000	1.4.2.8
+++ plugins/svgexplugin/svgexplugin.h	7 Sep 2005 16:53:21 -0000
@@ -4,49 +4,51 @@
 #include <qobject.h>
 #include <qdom.h>
 #include "pluginapi.h"
-#include "pluginmanager.h"
+#include "scplugin.h"
 
 class QString;
 class ScribusApp;
 class PageItem;
 class Page;
 
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugins is a import Plugin, which appears in the Import Menue
-  * 3 = the Plugins is a export Plugin, which appears in the Export Menue */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class PLUGIN_API SVGExportPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		SVGExportPlugin();
+		virtual ~SVGExportPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int svgexplugin_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* svgexplugin_getPlugin();
+extern "C" PLUGIN_API void svgexplugin_freePlugin(ScPlugin* plugin);
 
 class SVGExPlug : public QObject
 {
     Q_OBJECT
 
 public:
-    SVGExPlug( ScribusApp *plug, QString fName );
+    SVGExPlug( QString fName );
     ~SVGExPlug();
 
 private:
-		void ProcessPage(ScribusApp *plug, Page *Seite, QDomDocument *docu, QDomElement *elem);
+		void ProcessPage(Page *Seite, QDomDocument *docu, QDomElement *elem);
 		QString SetClipPathImage(PageItem *ite);
 		QString SetClipPath(PageItem *ite);
 		QString FToStr(double c);
 		QString IToStr(int c);
-		void SetTextProps(QDomElement *tp, struct ScText *hl, ScribusApp *plug);
-		QString SetFarbe(QString farbe, int shad, ScribusApp *plug);
-		QString GetMultiStroke(ScribusApp *plug, struct SingleLine *sl, PageItem *Item);
+		void SetTextProps(QDomElement *tp, struct ScText *hl);
+		QString SetFarbe(QString farbe, int shad);
+		QString GetMultiStroke(struct SingleLine *sl, PageItem *Item);
 		int GradCount;
 		int ClipCount;
 };
Index: plugins/svgimplugin/svgplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp,v
retrieving revision 1.31.2.54
diff -u -r1.31.2.54 svgplugin.cpp
--- plugins/svgimplugin/svgplugin.cpp	7 Sep 2005 12:20:09 -0000	1.31.2.54
+++ plugins/svgimplugin/svgplugin.cpp	7 Sep 2005 16:53:22 -0000
@@ -5,6 +5,7 @@
 
 #include "customfdialog.h"
 #include "color.h"
+#include "scribus.h"
 #include "scribusXml.h"
 #include "mpalette.h"
 #include "prefsfile.h"
@@ -22,122 +23,123 @@
 #include "util.h"
 #include "scfontmetrics.h"
 #include "prefsmanager.h"
+#include "pageitem.h"
+#include "scribusdoc.h"
 
 using namespace std;
 
-/*!
- \fn QString Name()
- \author Franz Schmid
- \date
- \brief Returns name of plugin
- \param None
- \retval QString containing name of plugin: Import SVG-Image...
- */
-QString name()
+int svgimplugin_getPluginAPIVersion()
 {
-	return QObject::tr("Import &SVG...");
+	return PLUGIN_API_VERSION;
 }
 
-/*!
- \fn int Type()
- \author Franz Schmid
- \date
- \brief Returns type of plugin
- \param None
- \retval int containing type of plugin (1: Extra, 2: Import, 3: Export, 4: )
- */
-PluginManager::PluginType type()
+ScPlugin* svgimplugin_getPlugin()
 {
-	return PluginManager::Import;
+	SVGImportPlugin* plug = new SVGImportPlugin();
+	Q_CHECK_PTR(plug);
+	return plug;
 }
 
-int ID()
+void svgimplugin_freePlugin(ScPlugin* plugin)
 {
-	return 10;
+	SVGImportPlugin* plug = dynamic_cast<SVGImportPlugin*>(plugin);
+	Q_ASSERT(plug);
+	delete plug;
 }
 
-QString actionName()
+SVGImportPlugin::SVGImportPlugin() :
+	ScActionPlugin(ScPlugin::PluginType_Import)
 {
-	return "ImportSVG";
+	// Set action info in languageChange, so we only have to do
+	// it in one place.
+	languageChange();
 }
 
-QString actionKeySequence()
+SVGImportPlugin::~SVGImportPlugin() {};
+
+void SVGImportPlugin::languageChange()
 {
-	return "";
+	// Note that we leave the unused members unset. They'll be initialised
+	// with their default ctors during construction.
+	// Action name
+	m_actionInfo.name = "ImportSVG";
+	// Action text for menu, including accel
+	m_actionInfo.text = tr("Import &SVG...");
+	// Menu
+	m_actionInfo.menu = "FileImport";
+	m_actionInfo.enabledOnStartup = true;
 }
 
-QString actionMenu()
+const QString SVGImportPlugin::fullTrName() const
 {
-	return "FileImport";
+	return QObject::tr("SVG Import");
 }
 
-QString actionMenuAfterName()
+const ScActionPlugin::AboutData* SVGImportPlugin::getAboutData() const
 {
-	return "";
+	return 0;
 }
 
-bool actionEnabledOnStartup()
+void SVGImportPlugin::deleteAboutData(const AboutData* about) const
 {
-	return true;
 }
 
 /*!
- \fn void Run(QWidget *d, ScribusApp *plug)
+ \fn void Run(QString filename)
  \author Franz Schmid
  \date
  \brief Run the SVG import
- \param d QWidget *
- \param plug ScribusApp *
- \retval None
+ \retval true for success
  */
-void run(QWidget *d, ScribusApp *plug)
+bool SVGImportPlugin::run(QString filename)
 {
-	QString fileName;
-	if (!plug->pluginManager->dllInput.isEmpty())
-		fileName = plug->pluginManager->dllInput;
-	else
+	bool interactive = false;
+	if (filename.isEmpty())
 	{
+		interactive = true;
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("SVGPlugin");
 		QString wdir = prefs->get("wdir", ".");
 #ifdef HAVE_LIBZ
-		CustomFDialog diaf(d, wdir, QObject::tr("Open"), QObject::tr("SVG-Images (*.svg *.svgz);;All Files (*)"));
+		CustomFDialog diaf(ScApp, wdir, QObject::tr("Open"), QObject::tr("SVG-Images (*.svg *.svgz);;All Files (*)"));
 #else
-		CustomFDialog diaf(d, wdir, QObject::tr("Open"), QObject::tr("SVG-Images (*.svg);;All Files (*)"));
+		CustomFDialog diaf(ScApp, wdir, QObject::tr("Open"), QObject::tr("SVG-Images (*.svg);;All Files (*)"));
 #endif
 		if (diaf.exec())
 		{
-			fileName = diaf.selectedFile();
-			prefs->set("wdir", fileName.left(fileName.findRev("/")));
+			filename = diaf.selectedFile();
+			prefs->set("wdir", filename.left(filename.findRev("/")));
 		}
 		else
-			return;
+			return true;
 	}
-	if (UndoManager::undoEnabled() && plug->HaveDoc)
+	if (UndoManager::undoEnabled() && ScApp->HaveDoc)
 	{
-		UndoManager::instance()->beginTransaction(plug->doc->currentPage->getUName(),Um::IImageFrame,Um::ImportSVG, fileName, Um::ISVG);
+		UndoManager::instance()->beginTransaction(ScApp->doc->currentPage->getUName(),Um::IImageFrame,Um::ImportSVG, filename, Um::ISVG);
 	}
-	else if (UndoManager::undoEnabled() && !plug->HaveDoc)
+	else if (UndoManager::undoEnabled() && !ScApp->HaveDoc)
 		UndoManager::instance()->setUndoEnabled(false);
-	SVGPlug *dia = new SVGPlug(plug, fileName);
+	SVGPlug *dia = new SVGPlug(filename, interactive);
+	Q_CHECK_PTR(dia);
 	if (UndoManager::undoEnabled())
 		UndoManager::instance()->commit();
 	else
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;
+	return true;
 }
 
 /*!
- \fn SVGPlug::SVGPlug( QWidget* parent, ScribusApp *plug, QString fName )
+ \fn SVGPlug::SVGPlug( QString fName )
  \author Franz Schmid
  \date
  \brief Create the SVG importer window
- \param parent QWidget *
- \param plug ScribusApp *
  \param fName QString
  \retval SVGPlug plugin
  */
-SVGPlug::SVGPlug( ScribusApp *plug, QString fName )
+SVGPlug::SVGPlug( QString fName, bool isInteractive ) :
+	QObject(ScApp)
 {
+	interactive = isInteractive;
 	QString f = "";
 #ifdef HAVE_LIBZ
 	if(fName.right(2) == "gz")
@@ -162,7 +164,6 @@
 #endif
 	if(!inpdoc.setContent(f))
 		return;
-	Prog = plug;
 	m_gc.setAutoDelete( true );
 	QString CurDirP = QDir::currentDirPath();
 	QFileInfo efp(fName);
@@ -188,36 +189,36 @@
 	double width = !docElem.attribute("width").isEmpty() ? parseUnit(docElem.attribute( "width" )) : 550.0;
 	double height = !docElem.attribute("height").isEmpty() ? parseUnit(docElem.attribute( "height" )) : 841.0;
 	Conversion = 0.8;
-	if (!Prog->pluginManager->dllInput.isEmpty())
+	if (!interactive)
 	{
-		Prog->doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
-		Prog->view->addPage(0);
+		ScApp->doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
+		ScApp->view->addPage(0);
 	}
 	else
 	{
-		if (!Prog->HaveDoc)
+		if (!ScApp->HaveDoc)
 		{
-			Prog->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom");
+			ScApp->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom");
 			ret = true;
 		}
 	}
-	if ((ret) || (!Prog->pluginManager->dllInput.isEmpty()))
+	if ((ret) || (!interactive))
 	{
 		if (width > height)
-			Prog->doc->PageOri = 1;
+			ScApp->doc->PageOri = 1;
 		else
-			Prog->doc->PageOri = 0;
-		Prog->doc->PageSize = "Custom";
+			ScApp->doc->PageOri = 0;
+		ScApp->doc->PageSize = "Custom";
 	}
-	Doku = Prog->doc;
+	Doku = ScApp->doc;
 	FPoint minSize = Doku->minCanvasCoordinate;
 	FPoint maxSize = Doku->maxCanvasCoordinate;
-	Prog->view->Deselect();
+	ScApp->view->Deselect();
 	Elements.clear();
 	Doku->setLoading(true);
 	Doku->DoDrawing = false;
-	Prog->view->setUpdatesEnabled(false);
-	Prog->ScriptRunning = true;
+	ScApp->view->setUpdatesEnabled(false);
+	ScApp->ScriptRunning = true;
 	qApp->setOverrideCursor(QCursor(waitCursor), true);
 	gc->Family = Doku->toolSettings.defFont;
 	if (!Doku->PageColors.contains("Black"))
@@ -243,7 +244,7 @@
 		haveViewBox = true;
 	}
 	parseGroup( docElem );
-	Prog->view->SelItem.clear();
+	ScApp->view->SelItem.clear();
 	if (Elements.count() > 1)
 	{
 		for (uint a = 0; a < Elements.count(); ++a)
@@ -253,12 +254,12 @@
 		Doku->GroupCounter++;
 	}
 	Doku->DoDrawing = true;
-	Prog->view->setUpdatesEnabled(true);
-	Prog->ScriptRunning = false;
-	if (Prog->pluginManager->dllInput.isEmpty())
+	ScApp->view->setUpdatesEnabled(true);
+	ScApp->ScriptRunning = false;
+	if (interactive)
 		Doku->setLoading(false);
 	qApp->setOverrideCursor(QCursor(arrowCursor), true);
-	if ((Elements.count() > 0) && (!ret) && (Prog->pluginManager->dllInput.isEmpty()))
+	if ((Elements.count() > 0) && (!ret) && (interactive))
 	{
 		Doku->DragP = true;
 		Doku->DraggedElem = 0;
@@ -266,14 +267,14 @@
 		for (uint dre=0; dre<Elements.count(); ++dre)
 		{
 			Doku->DragElements.append(Elements.at(dre)->ItemNr);
-			Prog->view->SelItem.append(Elements.at(dre));
+			ScApp->view->SelItem.append(Elements.at(dre));
 		}
 		ScriXmlDoc *ss = new ScriXmlDoc();
-		Prog->view->setGroupRect();
-		QDragObject *dr = new QTextDrag(ss->WriteElem(&Prog->view->SelItem, Doku, Prog->view), Prog->view->viewport());
-		Prog->view->DeleteItem();
-		Prog->view->resizeContents(qRound((maxSize.x() - minSize.x()) * Prog->view->getScale()), qRound((maxSize.y() - minSize.y()) * Prog->view->getScale()));
-		Prog->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * Prog->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * Prog->view->getScale()));
+		ScApp->view->setGroupRect();
+		QDragObject *dr = new QTextDrag(ss->WriteElem(&ScApp->view->SelItem, Doku, ScApp->view), ScApp->view->viewport());
+		ScApp->view->DeleteItem();
+		ScApp->view->resizeContents(qRound((maxSize.x() - minSize.x()) * ScApp->view->getScale()), qRound((maxSize.y() - minSize.y()) * ScApp->view->getScale()));
+		ScApp->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * ScApp->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * ScApp->view->getScale()));
 		Doku->minCanvasCoordinate = minSize;
 		Doku->maxCanvasCoordinate = maxSize;
 		dr->setPixmap(loadIcon("DragPix.xpm"));
@@ -286,7 +287,7 @@
 	else
 	{
 		Doku->setModified(false);
-		Prog->slotDocCh();
+		ScApp->slotDocCh();
 	}
 }
 
@@ -381,12 +382,12 @@
 			double ry = b.attribute( "ry" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "ry" ) );
 			SvgStyle *gc = m_gc.current();
 			parseStyle( gc, b );
-			z = Prog->view->PaintRect(BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol);
+			z = ScApp->view->PaintRect(BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			PageItem* ite = Doku->Items.at(z);
 			if ((rx != 0) || (ry != 0))
 			{
 				ite->RadRect = QMAX(rx, ry);
-				Prog->view->SetFrameRound(ite);
+				ScApp->view->SetFrameRound(ite);
 			}
 			QWMatrix mm = QWMatrix();
 			mm.translate(x, y);
@@ -404,7 +405,7 @@
 			double y = parseUnit( b.attribute( "cy" ) ) - ry;
 			SvgStyle *gc = m_gc.current();
 			parseStyle( gc, b );
-			z = Prog->view->PaintEllipse(BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
+			z = ScApp->view->PaintEllipse(BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			PageItem* ite = Doku->Items.at(z);
 			QWMatrix mm = QWMatrix();
 			mm.translate(x, y);
@@ -421,7 +422,7 @@
 			double y		= parseUnit( b.attribute( "cy" ) ) - r;
 			SvgStyle *gc = m_gc.current();
 			parseStyle( gc, b );
-			z = Prog->view->PaintEllipse(BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
+			z = ScApp->view->PaintEllipse(BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			PageItem* ite = Doku->Items.at(z);
 			QWMatrix mm = QWMatrix();
 			mm.translate(x, y);
@@ -439,7 +440,7 @@
 			double y2 = b.attribute( "y2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "y2" ) );
 			SvgStyle *gc = m_gc.current();
 			parseStyle( gc, b );
-			z = Prog->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
+			z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(4);
 			ite->PoLine.setPoint(0, FPoint(x1, y1));
@@ -459,15 +460,15 @@
 			addGraphicContext();
 			SvgStyle *gc = m_gc.current();
 			parseStyle( gc, b );
-			z = Prog->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
+			z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(0);
 			if (parseSVG( b.attribute( "d" ), &ite->PoLine ))
 				ite->convertTo(PageItem::PolyLine);
 			if (ite->PoLine.size() < 4)
 			{
-				Prog->view->SelItem.append(ite);
-				Prog->view->DeleteItem();
+				ScApp->view->SelItem.append(ite);
+				ScApp->view->DeleteItem();
 				z = -1;
 			}
 		}
@@ -477,9 +478,9 @@
 			SvgStyle *gc = m_gc.current();
 			parseStyle( gc, b );
 			if( b.tagName() == "polygon" )
-				z = Prog->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
+				z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			else
-				z = Prog->view->PaintPolyLine(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
+				z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
 			PageItem* ite = Doku->Items.at(z);
 			ite->PoLine.resize(0);
 			bool bFirst = true;
@@ -535,9 +536,9 @@
 			double y = b.attribute( "y" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "y" ) );
 			double w = b.attribute( "width" ).isEmpty() ? 1.0 : parseUnit( b.attribute( "width" ) );
 			double h = b.attribute( "height" ).isEmpty() ? 1.0 : parseUnit( b.attribute( "height" ) );
-			z = Prog->view->PaintPict(x+BaseX, y+BaseY, w, h);
+			z = ScApp->view->PaintPict(x+BaseX, y+BaseY, w, h);
 			if (!fname.isEmpty())
-				Prog->view->LoadPict(fname, z);
+				ScApp->view->LoadPict(fname, z);
 			PageItem* ite = Doku->Items.at(z);
 			if (ImgClip.size() != 0)
 				ite->PoLine = ImgClip.copy();
@@ -592,7 +593,7 @@
 					ite->Width = wh.x();
 					ite->Height = wh.y();
 					ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-					Prog->view->AdjustItemSize(ite);
+					ScApp->view->AdjustItemSize(ite);
 					break;
 				}
 			}
@@ -1441,7 +1442,7 @@
 		ScColor tmp;
 		tmp.fromQColor(c);
 		Doku->PageColors.insert("FromSVG"+c.name(), tmp);
-		Prog->propertiesPalette->Cpal->SetColors(Doku->PageColors);
+		ScApp->propertiesPalette->Cpal->SetColors(Doku->PageColors);
 		ret = "FromSVG"+c.name();
 	}
 	return ret;
@@ -1884,7 +1885,7 @@
 	struct ScText *hg;
 	QPainter p;
 	QPtrList<PageItem> GElements;
-	p.begin(Prog->view->viewport());
+	p.begin(ScApp->view->viewport());
 	QFont ff(Doku->UsedFonts[m_gc.current()->Family]);
 	ff.setPointSize(QMAX(qRound(m_gc.current()->FontSize / 10.0), 1));
 	p.setFont(ff);
@@ -1903,7 +1904,7 @@
 			addGraphicContext();
 			SvgStyle *gc = m_gc.current();
 			parseStyle(gc, tspan);
-			int z = Prog->view->PaintText(x, y, 10, 10, gc->LWidth, gc->FillCol);
+			int z = ScApp->view->PaintText(x, y, 10, 10, gc->LWidth, gc->FillCol);
 			PageItem* ite = Doku->Items.at(z);
 			ite->Extra = 0;
 			ite->TExtra = 0;
@@ -1911,7 +1912,7 @@
 			ite->RExtra = 0;
 			ite->LineSp = gc->FontSize / 10.0 + 2;
 			ite->Height = ite->LineSp+desc+2;
-			Prog->SetNewFont(gc->Family);
+			ScApp->SetNewFont(gc->Family);
 			QWMatrix mm = gc->matrix;
 			if( (!tspan.attribute("x").isEmpty()) && (!tspan.attribute("y").isEmpty()) )
 			{
@@ -1993,13 +1994,13 @@
 				}
 			}
 			ite->Width = QMAX(ite->Width, tempW);
-			Prog->view->SetRectFrame(ite);
+			ScApp->view->SetRectFrame(ite);
 			ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-			Prog->view->SelItem.append(ite);
-			Prog->view->HowTo = 1;
-			Prog->view->setGroupRect();
-			Prog->view->scaleGroup(mm.m11(), mm.m22());
-			Prog->view->Deselect();
+			ScApp->view->SelItem.append(ite);
+			ScApp->view->HowTo = 1;
+			ScApp->view->setGroupRect();
+			ScApp->view->scaleGroup(mm.m11(), mm.m22());
+			ScApp->view->Deselect();
 			ite->Ypos -= asce * mm.m22();
 			if( !e.attribute("id").isEmpty() )
 				ite->setItemName(" "+e.attribute("id"));
@@ -2013,9 +2014,9 @@
 			/*			if (gc->Gradient != 0)
 						{
 							ite->fill_gradient = gc->GradCo;
-							Prog->view->SelItem.append(ite);
-							Prog->view->ItemGradFill(gc->Gradient, gc->GCol2, 100, gc->GCol1, 100);
-							Prog->view->SelItem.clear();
+							ScApp->view->SelItem.append(ite);
+							ScApp->view->ItemGradFill(gc->Gradient, gc->GCol2, 100, gc->GCol1, 100);
+							ScApp->view->SelItem.clear();
 						} */
 			GElements.append(ite);
 			Elements.append(ite);
@@ -2025,14 +2026,14 @@
 	else
 	{
 		SvgStyle *gc = m_gc.current();
-		int z = Prog->view->PaintText(x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, gc->FillCol);
+		int z = ScApp->view->PaintText(x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, gc->FillCol);
 		PageItem* ite = Doku->Items.at(z);
 		ite->Extra = 0;
 		ite->TExtra = 0;
 		ite->BExtra = 0;
 		ite->RExtra = 0;
 		ite->LineSp = gc->FontSize / 10.0 + 2;
-		Prog->SetNewFont(gc->Family);
+		ScApp->SetNewFont(gc->Family);
 		ite->IFont = gc->Family;
 		ite->TxtFill = gc->FillCol;
 		ite->ShTxtFill = 100;
@@ -2087,7 +2088,7 @@
 			ite->Width += RealCWidth(Doku, hg->cfont, hg->ch, hg->csize)+1;
 			ite->Height = ite->LineSp+desc+2;
 		}
-		Prog->view->SetRectFrame(ite);
+		ScApp->view->SetRectFrame(ite);
 		if( !e.attribute("id").isEmpty() )
 			ite->setItemName(" "+e.attribute("id"));
 		ite->setFillTransparency(gc->Transparency);
@@ -2100,9 +2101,9 @@
 		/*		if (gc->Gradient != 0)
 				{
 					ite->fill_gradient = gc->GradCo;
-					Prog->view->SelItem.append(ite);
-					Prog->view->ItemGradFill(gc->Gradient, gc->GCol2, 100, gc->GCol1, 100);
-					Prog->view->SelItem.clear();
+					ScApp->view->SelItem.append(ite);
+					ScApp->view->ItemGradFill(gc->Gradient, gc->GCol2, 100, gc->GCol1, 100);
+					ScApp->view->SelItem.clear();
 				} */
 		GElements.append(ite);
 		Elements.append(ite);
Index: plugins/svgimplugin/svgplugin.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/svgimplugin/svgplugin.h,v
retrieving revision 1.6.2.11
diff -u -r1.6.2.11 svgplugin.h
--- plugins/svgimplugin/svgplugin.h	11 Aug 2005 16:48:08 -0000	1.6.2.11
+++ plugins/svgimplugin/svgplugin.h	7 Sep 2005 16:53:22 -0000
@@ -4,30 +4,34 @@
 #include <qdom.h>
 #include <qptrstack.h>
 #include "pluginapi.h"
-#include "scribus.h"
+#include "scplugin.h"
 #include "vgradient.h"
-#include "pluginmanager.h"
 
 class PrefsManager;
 
-/** Calls the Plugin with the main Application window as parent
-  * and the main Application Class as parameter */
-extern "C" PLUGIN_API void run(QWidget *d, ScribusApp *plug);
-/** Returns the Name of the Plugin.
-  * This name appears in the relevant Menue-Entrys */
-extern "C" PLUGIN_API QString name();
-/** Returns the Type of the Plugin.
-  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
-  * 2 = the Plugins is a import Plugin, which appears in the Import Menue
-  * 3 = the Plugins is a export Plugin, which appears in the Export Menue */
-extern "C" PLUGIN_API PluginManager::PluginType type();
-extern "C" PLUGIN_API int ID();
-
-extern "C" PLUGIN_API QString actionName();
-extern "C" PLUGIN_API QString actionKeySequence();
-extern "C" PLUGIN_API QString actionMenu();
-extern "C" PLUGIN_API QString actionMenuAfterName();
-extern "C" PLUGIN_API bool actionEnabledOnStartup();
+class PLUGIN_API SVGImportPlugin : public ScActionPlugin
+{
+	Q_OBJECT
+
+	public:
+		// Standard plugin implementation
+		SVGImportPlugin();
+		virtual ~SVGImportPlugin();
+		virtual bool run(QString target = QString::null);
+		virtual const QString fullTrName() const;
+		virtual const AboutData* getAboutData() const;
+		virtual void deleteAboutData(const AboutData* about) const;
+		virtual void languageChange();
+
+		// Special features (none)
+};
+
+extern "C" PLUGIN_API int svgimplugin_getPluginAPIVersion();
+extern "C" PLUGIN_API ScPlugin* svgimplugin_getPlugin();
+extern "C" PLUGIN_API void svgimplugin_freePlugin(ScPlugin* plugin);
+
+class PageItem;
+class ScribusDoc;
 
 class GradientHelper
 {
@@ -134,7 +138,7 @@
 	Q_OBJECT
 
 public:
-	SVGPlug( ScribusApp *plug, QString fName );
+	SVGPlug(QString fname, bool isInteractive);
 	~SVGPlug();
 	void convert();
 	void addGraphicContext();
@@ -161,7 +165,6 @@
 	QPtrList<PageItem> parseText(double x, double y, const QDomElement &e);
 
 	ScribusDoc* Doku;
-	ScribusApp* Prog;
 	QDomDocument inpdoc;
 	double CurrX, CurrY, StartX, StartY, Conversion;
 	int PathLen;
@@ -174,6 +177,7 @@
 	double viewScaleX;
 	double viewScaleY;
 	bool haveViewBox;
+	bool interactive;
 };
 
 #endif
newpluginapi.diff (274,390 bytes)   

2005-09-07 16:13

 

pluginmanagerprefsgui.cpp (4,102 bytes)   
#include "pluginmanagerprefsgui.h"
#include "pluginmanager.h"
#include "scplugin.h"

#include "qlayout.h"
#include "qlistview.h"
#include "qgroupbox.h"
#include "qlabel.h"

PluginManagerPrefsGui::PluginManagerPrefsGui(QWidget * parent)
	: QWidget(parent, "pluginManagerWidget", 0)
{
	PluginManager& pluginManager(PluginManager::instance());
	pluginMainLayout = new QVBoxLayout( this, 0, 5, "pluginMainLayout");
	pluginMainLayout->setAlignment( Qt::AlignTop );
	plugGroupBox = new QGroupBox( tr("Plugin Manager"), this, "plugGroupBox");
	plugGroupBox->setColumnLayout(0, Qt::Vertical);
	plugGroupBox->layout()->setSpacing(6);
	plugGroupBox->layout()->setMargin(11);
	plugGroupBoxLayout = new QGridLayout( plugGroupBox->layout() );
	plugGroupBoxLayout->setAlignment(Qt::AlignTop);
	plugLayout1 = new QVBoxLayout( 0, 0, 6, "plugLayout1");
	pluginsList = new QListView(plugGroupBox, "pluginsList");
	pluginsList->setAllColumnsShowFocus(true);
	pluginsList->setShowSortIndicator(true);
	pluginsList->addColumn( tr("Plugin"));
	pluginsList->setColumnWidthMode(0, QListView::Maximum);
	pluginsList->addColumn( tr("How to run"));
	pluginsList->setColumnWidthMode(1, QListView::Maximum);
	pluginsList->addColumn( tr("Type"));
	pluginsList->setColumnWidthMode(2, QListView::Maximum);
	pluginsList->addColumn( tr("Load it?"));
	pluginsList->setColumnWidthMode(3, QListView::Maximum);
	pluginsList->addColumn( tr("Plugin ID"));
	pluginsList->setColumnWidthMode(4, QListView::Maximum);
	pluginsList->addColumn( tr("File"));
	pluginsList->setColumnWidthMode(5, QListView::Maximum);
	// Get a list of all internal plugin names, then loop over them and add
	// each one to the plugin list.
	QValueList<QCString> pluginNames(pluginManager.pluginNames());
	for (QValueList<QCString>::Iterator it = pluginNames.begin(); it != pluginNames.end(); ++it)
	{
		QListViewItem *plugItem = new QListViewItem(pluginsList);
		// Get the plugin, even if it's loaded but disabled
		ScPlugin* plugin = pluginManager.getPlugin(*it, true);
		Q_ASSERT(plugin); // all the returned names should represent loaded plugins
		plugItem->setText(0, plugin->fullTrName());
		if (plugin->inherits("ScActionPlugin"))
		{
			ScActionPlugin* ixplug = dynamic_cast<ScActionPlugin*>(plugin);
			Q_ASSERT(ixplug);
			ScActionPlugin::ActionInfo ai(ixplug->actionInfo());
			plugItem->setText(1, QString("%1 %2").arg(ai.menu).arg(ai.menuAfterName)); // menu path
		}
		else
		{
			// Resident plug-ins don't have predefined actions
			plugItem->setText(1, QString(""));
		}
		plugItem->setText(2, plugin->pluginTypeName());
		// load at start?
		bool onstart = pluginManager.enableOnStartup(*it);
		plugItem->setPixmap(3, onstart ? loadIcon("ok.png") : loadIcon("DateiClos16.png"));
		plugItem->setText(3, onstart ? tr("Yes") : tr("No"));
		plugItem->setText(4, QString("%1").arg(*it)); // plugname for developers
		plugItem->setText(5, pluginManager.getPluginPath(*it)); // file path for developers
	}
	plugLayout1->addWidget(pluginsList);
	pluginWarning = new QLabel(plugGroupBox);
	pluginWarning->setText("<qt>" + tr("You need to restart the application to apply the changes.") + "</qt>");
	plugLayout1->addWidget(pluginWarning);
	plugGroupBoxLayout->addLayout(plugLayout1, 0, 0);
	pluginMainLayout->addWidget(plugGroupBox);
	connect(pluginsList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)),
			this, SLOT(changePluginLoad(QListViewItem *, const QPoint &, int)));
}

PluginManagerPrefsGui::~PluginManagerPrefsGui()
{
}

/*! Set selected item(=plugin) un/loadable
\author Petr Vanek
*/
void PluginManagerPrefsGui::changePluginLoad(QListViewItem *item, const QPoint &, int column)
{
	PluginManager& pluginManager(PluginManager::instance());
	if (column != 3)
		return;
	if (item->text(3) == tr("Yes"))
	{
		item->setPixmap(3, loadIcon("DateiClos16.png"));
		item->setText(3, tr("No"));
		pluginManager.enableOnStartup(item->text(4).latin1()) = false;
	}
	else
	{
		item->setPixmap(3, loadIcon("ok.png"));
		item->setText(3, tr("Yes"));
		pluginManager.enableOnStartup(item->text(4).latin1()) = true;
	}
}

#include "pluginmanagerprefsgui.moc"
pluginmanagerprefsgui.cpp (4,102 bytes)   

2005-09-07 16:14

 

pluginmanagerprefsgui.h (792 bytes)   
#ifndef PLUGINMANAGERPREFS_H
#define PLUGINMANAGERPREFS_H

#include "qwidget.h"
#include "pluginmanager.h"

class QVBoxLayout;
class QGroupBox;
class QGridLayout;
class QListView;
class QLabel;
class QListViewItem;

class PluginManagerPrefsGui : public QWidget
{
	Q_OBJECT

	public:
		PluginManagerPrefsGui(QWidget * parent);
		~PluginManagerPrefsGui();

	public slots:
		void changePluginLoad(QListViewItem *item, const QPoint &, int column);

	protected:
		QVBoxLayout* pluginMainLayout;
		QGroupBox* plugGroupBox;
		QGridLayout* plugGroupBoxLayout;
		QVBoxLayout* plugLayout1;
		QListView* pluginsList;
		QLabel* pluginWarning;

		// Friend of PluginManager that lets us poke in the protected
		// PluginManager::pluginMap directly.
		PluginManager::PluginMap & getPluginMap();
};

#endif
pluginmanagerprefsgui.h (792 bytes)   

ringerc

2005-09-07 18:36

reporter   ~0006454

QAction::setAccel() resolved. Further known issues tracked in "additional info".

ringerc

2005-09-07 18:48

reporter   ~0006455

New plug-in API is now in CVS. Much of the design is explained on the wiki (slightly dated) and in scplugin.h .

http://wiki.scribus.net/index.php/New_plug-in_API

In particular, the patch:
  - moves plug-ins to new C++ plug-in interface based on inheritance.
  - Reduces the use of dlopen() to very early setup and late teardown
  - massively reworks pluginmanager.{cpp,h} for the new API. Additional
    sanity checks are included, and the code should be more readable now
    too.
  - Lets plug-ins expose their own custom interfaces to other plugins and
    the core app.
  - eliminates plugin IDs; plugins now have names derived from their filename.
  - makes all plugins use the global static ScApp to get the main window, rather
    than having to pass it around all the time.

There's still a bit of compat code in there, but that can be sorted out bit by bit now that the intrusive changes are in CVS. The main changes don't implement, but lay the groundwork for, the other improvements discussed above.

ringerc

2005-09-07 19:30

reporter   ~0006456

scribus131cvs$ diffstat ~/patch/newpluginapi.diff
 Makefile.am | 1
 charselect.cpp | 36 +
 charselect.h | 11
 fileloader.cpp | 19
 newfile.cpp | 11
 pluginmanager.cpp | 563 +++++++++++++--------------
 pluginmanager.h | 198 ++++++---
 plugins/colorwheel/colorwheel.cpp | 64 ++-
 plugins/colorwheel/colorwheel.h | 43 +-
 plugins/fileloader/oodraw/oodrawimp.cpp | 198 ++++-----
 plugins/fileloader/oodraw/oodrawimp.h | 56 +-
 plugins/fontpreview/fontpreview.cpp | 60 +-
 plugins/fontpreview/fontpreview.h | 48 +-
 plugins/fontpreview/ui.cpp | 21 -
 plugins/fontpreview/ui.h | 13
 plugins/newfromtemplateplugin/nftemplate.cpp | 90 ++--
 plugins/newfromtemplateplugin/nftemplate.h | 50 +-
 plugins/pixmapexport/export.cpp | 98 ++--
 plugins/pixmapexport/export.h | 55 +-
 plugins/psimport/importps.cpp | 183 ++++----
 plugins/psimport/importps.h | 43 +-
 plugins/saveastemplateplugin/satdialog.h | 29 -
 plugins/saveastemplateplugin/satemplate.cpp | 114 ++---
 plugins/saveastemplateplugin/satemplate.h | 53 +-
 plugins/scriptplugin/cmdcolor.cpp | 28 -
 plugins/scriptplugin/cmddialog.cpp | 18
 plugins/scriptplugin/cmddoc.cpp | 52 +-
 plugins/scriptplugin/cmdgetprop.cpp | 14
 plugins/scriptplugin/cmdmani.cpp | 90 ++--
 plugins/scriptplugin/cmdmisc.cpp | 74 +--
 plugins/scriptplugin/cmdobj.cpp | 132 +++---
 plugins/scriptplugin/cmdpage.cpp | 62 +-
 plugins/scriptplugin/cmdsetprop.cpp | 18
 plugins/scriptplugin/cmdtext.cpp | 84 ++--
 plugins/scriptplugin/cmdutil.cpp | 56 +-
 plugins/scriptplugin/cmdvar.h | 3
 plugins/scriptplugin/guiapp.cpp | 18
 plugins/scriptplugin/objimageexport.cpp | 16
 plugins/scriptplugin/objpdffile.cpp | 238 +++++------
 plugins/scriptplugin/objprinter.cpp | 30 -
 plugins/scriptplugin/scriptercore.cpp | 70 +--
 plugins/scriptplugin/scriptplugin.cpp | 69 +--
 plugins/scriptplugin/scriptplugin.h | 54 +-
 plugins/scriptplugin/svgimport.cpp | 9
 plugins/short-words/shortwords.cpp | 57 +-
 plugins/short-words/shortwords.h | 62 +-
 plugins/svgexplugin/svgexplugin.cpp | 165 ++++---
 plugins/svgexplugin/svgexplugin.h | 50 +-
 plugins/svgimplugin/svgplugin.cpp | 225 +++++-----
 plugins/svgimplugin/svgplugin.h | 48 +-
 prefs.cpp | 70 ---
 prefs.h | 10
 scplugin.cpp | 56 +-
 scplugin.h | 54 +-
 scraction.h | 2
 scribus.cpp | 15
 scribus.h | 5
 story.cpp | 32 -
 58 files changed, 2066 insertions(+), 1977 deletions(-)

ringerc

2005-09-08 06:38

reporter   ~0006469

There's a lot more that can be done on plugin API and on plugins now
that the new plugin API is in place, particularly:
  - Updating the documentation and sample plugins to reflect the new
    plugin API; and
  - Populating the about data in the plugins then writing a
    Help->About Plug-ins (I suggest modelling it on Acroread 7's); and
  - Using the new hooks to get prefs widgets from plugins to add
    their prefs panels to the prefs dialog; and
  - Giving scripter a prefs panel for startup scripts, ext script
    enable, and perhaps later console prefs; and
  - Tweaking pluginmanager.cpp and the build code to support statically
    linking plugins (good for distro-neutral static build, maybe for
    win32 as well); and
  - Letting plug-ins be enabled and disabled at runtime (?); and
  - Adding API to let import and export plugins report their supported
    formats, format names, filter strings, etc; and
  - Moving all plugin's implementation classes into separate headers
    from the ScPlugin subclass, so they're invisible to the main app
    if it talks to that plugin; and
  - Converting fontpreview to provide a special call for story.cpp's
    use rather than using the compat kludge currently in place; and
  - Once the new import/export format discovery is in place, removing
    specific knowledge of importps and other format plugins from
    fileloader etc; and
  - Looking for a way to get rid of the need to hand-redefine
    pluginname_getPluginAPIVersion(), pluginname_getPlugin(),
    and pluginname_freePlugin() for each plugin, given that the
    code in each is essentially identical except for name prefix and
    ScPlugin subclass name.

I'll split some of those out into other bugs later; others are just ideas / reminders.

ringerc

2005-09-08 06:46

reporter   ~0006470

Jean, does the way I've done the symbol import and export look right for win32 to you?

Issue History

Date Modified Username Field Change
2005-06-15 11:51 ringerc New Issue
2005-06-15 11:51 ringerc Relationship added related to 0001752
2005-06-15 11:52 ringerc Relationship added related to 0001702
2005-06-15 11:52 ringerc Relationship deleted related to 0001752
2005-06-15 11:53 ringerc Relationship added parent of 0001622
2005-06-28 19:13 plinnell Category - => Plug-ins
2005-07-10 02:44 ringerc Note Added: 0005481
2005-07-10 02:44 ringerc Product Version 1.3.0cvs => 1.3.1cvs
2005-07-10 02:44 ringerc Description Updated
2005-07-15 15:43 ringerc File Added: plugin.h
2005-07-15 15:44 ringerc Note Added: 0005592
2005-07-24 12:48 ringerc Note Added: 0005693
2005-07-25 05:51 ringerc Note Added: 0005709
2005-07-26 17:12 subik Note Added: 0005733
2005-07-26 17:12 subik Relationship added parent of 0001309
2005-08-03 08:20 ringerc Note Added: 0005854
2005-08-03 12:32 ringerc File Added: scplugin.h
2005-08-03 12:40 ringerc Note Added: 0005862
2005-08-03 12:49 ringerc Note Added: 0005863
2005-08-03 21:27 jghali Note Added: 0005881
2005-08-04 03:53 ringerc Note Added: 0005885
2005-08-04 04:01 ringerc Relationship added related to 0001961
2005-08-04 04:03 ringerc Note Added: 0005887
2005-08-04 04:06 ringerc File Deleted: scplugin.h
2005-08-04 04:06 ringerc File Added: scplugin.h
2005-08-04 04:07 ringerc Note Added: 0005888
2005-08-04 04:07 ringerc Note Added: 0005889
2005-08-04 04:08 ringerc Note Edited: 0005862
2005-08-04 07:05 jghali Note Added: 0005891
2005-08-04 07:33 ringerc Note Added: 0005892
2005-08-04 09:00 jghali Note Added: 0005894
2005-08-05 17:37 ringerc Relationship added related to 0000015
2005-08-08 07:52 ringerc Relationship added related to 0002396
2005-08-08 09:29 ringerc Note Added: 0005932
2005-08-08 09:37 jghali Note Added: 0005933
2005-08-08 09:46 ringerc Note Added: 0005934
2005-08-10 09:14 ringerc Relationship added related to 0002398
2005-08-12 05:33 subik Relationship added related to 0000569
2005-09-06 17:24 ringerc File Deleted: plugin.h
2005-09-06 17:24 ringerc File Deleted: scplugin.h
2005-09-06 17:25 ringerc File Added: scplugin.h
2005-09-06 17:25 ringerc File Added: scplugin.cpp
2005-09-06 17:25 ringerc File Added: pluginmanagerprefsgui.cpp
2005-09-06 17:26 ringerc File Added: pluginmanagerprefsgui.h
2005-09-06 17:26 ringerc File Added: newpluginapi.diff
2005-09-06 17:26 ringerc File Deleted: scplugin.h
2005-09-06 17:26 ringerc File Deleted: scplugin.cpp
2005-09-06 17:29 ringerc Note Added: 0006428
2005-09-06 17:43 ringerc File Deleted: newpluginapi.diff
2005-09-06 17:44 ringerc File Added: newpluginapi.diff
2005-09-06 17:45 ringerc Description Updated
2005-09-06 19:06 ringerc File Deleted: newpluginapi.diff
2005-09-06 19:06 ringerc File Added: newpluginapi.diff
2005-09-06 19:07 ringerc Note Added: 0006431
2005-09-07 14:49 ringerc File Deleted: newpluginapi.diff
2005-09-07 14:50 ringerc File Added: newpluginapi.diff
2005-09-07 14:53 ringerc Note Added: 0006450
2005-09-07 16:11 ringerc Note Edited: 0006450
2005-09-07 16:11 ringerc Note Edited: 0006450
2005-09-07 16:12 ringerc File Deleted: newpluginapi.diff
2005-09-07 16:12 ringerc File Added: newpluginapi.diff
2005-09-07 16:12 ringerc File Deleted: pluginmanagerprefsgui.cpp
2005-09-07 16:13 ringerc File Deleted: pluginmanagerprefsgui.h
2005-09-07 16:13 ringerc File Added: pluginmanagerprefsgui.cpp
2005-09-07 16:14 ringerc File Added: pluginmanagerprefsgui.h
2005-09-07 17:58 ringerc Description Updated
2005-09-07 18:36 ringerc Note Added: 0006454
2005-09-07 18:39 ringerc Additional Information Updated
2005-09-07 18:48 ringerc Note Added: 0006455
2005-09-07 18:51 ringerc Description Updated
2005-09-07 18:58 ringerc Additional Information Updated
2005-09-07 19:30 ringerc Note Added: 0006456
2005-09-08 06:38 ringerc Note Added: 0006469
2005-09-08 06:38 ringerc Relationship replaced related to 0001622
2005-09-08 06:39 ringerc Relationship replaced related to 0001309
2005-09-08 06:39 ringerc Status assigned => resolved
2005-09-08 06:39 ringerc Resolution open => fixed
2005-09-08 06:39 ringerc Fixed in Version => 1.3.1cvs
2005-09-08 06:46 ringerc Note Added: 0006470
2005-10-02 15:12 plinnell Status resolved => closed
2006-05-17 19:17 christoph_s Relationship added related to 0002931