r13957 by herm - GraphicsMagick + Uniconvertor

scribus-commit scribus-commit at lists.scribus.net
Sat Sep 5 02:45:43 CEST 2009


Revision: 13957
Author: herm
Date: 2009-09-05T00:42:29.129948Z
Commit message: GraphicsMagick + Uniconvertor


Changeset: 
M  /trunk/Scribus/scribus/scimgdataloader.h
M  /trunk/Scribus/scribus/CMakeLists.txt
M  /trunk/Scribus/scribus/ui/prefs.cpp
M  /trunk/Scribus/scribus/undomanager.cpp
M  /trunk/Scribus/scribus/undomanager.h
M  /trunk/Scribus/scribus/ui/tabexternaltoolswidget.ui
M  /trunk/Scribus/scribus/util_formats.cpp
M  /trunk/Scribus/scribus/scimage.cpp
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/ui/tabexternaltoolswidget.cpp
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/util_formats.h
M  /trunk/Scribus/scribus/plugins/CMakeLists.txt
M  /trunk/Scribus/config.h.cmake
M  /trunk/Scribus/scribus/prefsmanager.h
M  /trunk/Scribus/scribus/ui/tabexternaltoolswidget.h
M  /trunk/Scribus/CMakeLists.txt
M  /trunk/Scribus/scribus/plugins/formatidlist.h

Diffs:
Index: scribus/undomanager.h
===================================================================
--- scribus/undomanager.h	(revision 13956)
+++ scribus/undomanager.h	(revision 13957)
@@ -528,6 +528,7 @@
 	static QString PathText;
 	static QString ConvertTo;
 	static QString ImportSVG;
+	static QString ImportUniconv;
 	static QString ImportEPS;
 	static QString ImportBarcode;
 	static QString ImportOOoDraw;
@@ -627,6 +628,7 @@
 	static QPixmap *ITable;
 	static QPixmap *IFont;
 	static QPixmap *ISVG;
+	static QPixmap *IUniconv;
 	static QPixmap *IEPS;
 	static QPixmap *IAI;
 	static QPixmap *IXFIG;
Index: scribus/scimgdataloader.h
===================================================================
--- scribus/scimgdataloader.h	(revision 13956)
+++ scribus/scimgdataloader.h	(revision 13957)
@@ -64,6 +64,7 @@
 	virtual bool preloadAlphaChannel(const QString& fn, int page, int res, bool& hasAlpha) = 0;
 	virtual void loadEmbeddedProfile(const QString& fn, int page = 0) = 0;
 	virtual bool loadPicture(const QString& fn, int page, int res, bool thumbnail) = 0;
+	virtual bool useRawImage() { return false; }
 };
 
 #endif
Index: scribus/util_formats.cpp
===================================================================
--- scribus/util_formats.cpp	(revision 13956)
+++ scribus/util_formats.cpp	(revision 13957)
@@ -30,8 +30,10 @@
 	m_fmts.insert(FormatsManager::SVG,  QStringList() << "svg" << "svgz");
 	m_fmts.insert(FormatsManager::AI,   QStringList() << "ai");
 	m_fmts.insert(FormatsManager::XFIG, QStringList() << "fig");
-	m_fmts.insert(FormatsManager::CVG, QStringList() << "cvg");
-	m_fmts.insert(FormatsManager::WPG, QStringList() << "wpg");
+	m_fmts.insert(FormatsManager::CVG,  QStringList() << "cvg");
+	m_fmts.insert(FormatsManager::WPG,  QStringList() << "wpg");
+	m_fmts.insert(FormatsManager::GMAGICK, QStringList() << "xbm" << "wpg" << "tga" << "ptif" << "ppm" << "pnm" << "pict" << "pgm" << "pcds" << "pcd" << "pbm" << "mng" << "ico" << "gif" << "fax" << "dpx" << "bmp" << "xcf");
+	m_fmts.insert(FormatsManager::UNICONV, QStringList() << "cdr" << "cdt" << "ccx" << "cmx" << "cgm" << "aff" << "sk" << "sk1");
 	
 	m_fmtNames[FormatsManager::EPS]  = QObject::tr("Encapsulated PostScript");
 	m_fmtNames[FormatsManager::GIF]  = QObject::tr("GIF");
@@ -47,8 +49,10 @@
 	m_fmtNames[FormatsManager::SVG]  = QObject::tr("Scalable Vector Graphics");
 	m_fmtNames[FormatsManager::AI]   = QObject::tr("Adobe Illustrator");
 	m_fmtNames[FormatsManager::XFIG] = QObject::tr("Xfig File");
-	m_fmtNames[FormatsManager::CVG] = QObject::tr("Calamus Cvg File");
-	m_fmtNames[FormatsManager::WPG] = QObject::tr("Word Perfect Wpg File");
+	m_fmtNames[FormatsManager::CVG]  = QObject::tr("Calamus Cvg File");
+	m_fmtNames[FormatsManager::WPG]  = QObject::tr("Word Perfect Wpg File");
+	m_fmtNames[FormatsManager::GMAGICK] = QObject::tr("GraphicsMagick File");
+	m_fmtNames[FormatsManager::UNICONV] = QObject::tr("UniConvertor File");
 	
 	m_fmtMimeTypes.insert(FormatsManager::EPS,  QStringList() << "application/postscript");
 	m_fmtMimeTypes.insert(FormatsManager::GIF,  QStringList() << "image/gif");
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 13956)
+++ scribus/prefsmanager.cpp	(revision 13957)
@@ -350,6 +350,7 @@
 	appPrefs.PrPr_InkThreshold = 250;
 	appPrefs.extToolPrefs.imageEditorExecutable = "gimp";
 	appPrefs.extToolPrefs.extBrowserExecutable = "";
+	appPrefs.extToolPrefs.uniconvExecutable = "uniconv";
 	appPrefs.extToolPrefs.latexConfigs = LatexConfigCache::defaultConfigs();
 	appPrefs.extToolPrefs.latexCommands.clear();
 	appPrefs.extToolPrefs.latexEditorExecutable = "";
@@ -999,6 +1000,11 @@
 	appPrefs.extToolPrefs.extBrowserExecutable=executableName;
 }
 
+void PrefsManager::setUniconvExecutable(const QString& executableName)
+{
+	appPrefs.extToolPrefs.uniconvExecutable=executableName;
+}
+
 void PrefsManager::setLatexConfigs(const QStringList& configs)
 {
 	appPrefs.extToolPrefs.latexConfigs=configs;
@@ -1499,6 +1505,7 @@
 	dc8Ex.setAttribute("AlphaGraphics", static_cast<int>(appPrefs.extToolPrefs.gs_AntiAliasGraphics));
 	dc8Ex.setAttribute("AlphaText", static_cast<int>(appPrefs.extToolPrefs.gs_AntiAliasText));
 	dc8Ex.setAttribute("Resolution", appPrefs.extToolPrefs.gs_Resolution);
+	dc8Ex.setAttribute("Uniconv", uniconvExecutable());
 	dc8Ex.setAttribute("LatexEditor", latexEditorExecutable());
 	dc8Ex.setAttribute("LatexResolution", latexResolution());
 	dc8Ex.setAttribute("LatexForceDpi", static_cast<int>(appPrefs.extToolPrefs.latexForceDpi));
@@ -2149,6 +2156,7 @@
 			appPrefs.extToolPrefs.latexStartWithEmptyFrames = static_cast<bool>(dc.attribute("LatexStartWithEmptyFrames", "0").toInt());
 			setImageEditorExecutable(dc.attribute("GIMP", "gimp"));
 			setExtBrowserExecutable(dc.attribute("WebBrowser", ""));
+			setUniconvExecutable(dc.attribute("Uniconv", "uniconv"));
 			setLatexEditorExecutable(dc.attribute("LatexEditor", ""));
 			QStringList configs;
 			QDomNodeList configNodes = dc.elementsByTagName("LatexConfig");
Index: scribus/prefsmanager.h
===================================================================
--- scribus/prefsmanager.h	(revision 13956)
+++ scribus/prefsmanager.h	(revision 13957)
@@ -125,12 +125,14 @@
 	void setGhostscriptExecutable(const QString&);
 	void setImageEditorExecutable(const QString&);
 	void setExtBrowserExecutable(const QString&);
+	void setUniconvExecutable(const QString&);
 	void setLatexConfigs(const QStringList&);
 	void setLatexCommands(const QMap<QString, QString>& commands) { appPrefs.extToolPrefs.latexCommands=commands; }
 	void setLatexEditorExecutable(const QString&);
 	QString ghostscriptExecutable() const {return appPrefs.extToolPrefs.gs_exe;};
 	QString imageEditorExecutable() const {return appPrefs.extToolPrefs.imageEditorExecutable;};
 	QString extBrowserExecutable() const {return appPrefs.extToolPrefs.extBrowserExecutable;};
+	QString uniconvExecutable() const {return appPrefs.extToolPrefs.uniconvExecutable;}
 	QStringList latexConfigs() const {return appPrefs.extToolPrefs.latexConfigs;}
 	QMap<QString, QString> latexCommands() const {return appPrefs.extToolPrefs.latexCommands;}
 	QString latexEditorExecutable() const {return appPrefs.extToolPrefs.latexEditorExecutable;}
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 13956)
+++ scribus/prefsstructs.h	(revision 13957)
@@ -286,6 +286,7 @@
 	int gs_Resolution;
 	QString imageEditorExecutable;
 	QString extBrowserExecutable;
+	QString uniconvExecutable;
 	QStringList latexConfigs;
 	QMap<QString, QString> latexCommands;
 	QString latexEditorExecutable;
Index: scribus/util_formats.h
===================================================================
--- scribus/util_formats.h	(revision 13956)
+++ scribus/util_formats.h	(revision 13957)
@@ -38,8 +38,8 @@
 		{
 			ALLIMAGES 		= 1|2|4|8|16|32|64|128|256|512|1024|2048|4096|8192|16384|32768,
 			IMAGESIMGFRAME	= 1|2|4|16|32|64|128|256|512,  // all Types suitable for Image Frames
-			VECTORIMAGES	= 1|64|1024|2048|16384|32768,  // All pure vector image types
-			RASTORIMAGES	= 2|4|8|32|512,  // All pure rastor image types
+			VECTORIMAGES	= 1|64|1024|2048|16384|32768|131072,  // All pure vector image types
+			RASTORIMAGES	= 2|4|8|32|512|65536,  // All pure rastor image types
 			EPS				= 1,      // Encapsulated PostScript
 			GIF				= 2,      // GIF files
 			JPEG			= 4,      // JPEG
@@ -54,8 +54,10 @@
 			SVG				= 2048,   // SVG files
 			AI				= 4096,   // Adobe Illustrator files
 			XFIG			= 8192,   // Xfig files
-			CVG			= 16384,   // Calamus Cvg files
-			WPG			= 32768,   // Word Perfect WPG files
+			CVG				= 16384,  // Calamus Cvg files
+			WPG				= 32768,  // Word Perfect WPG files
+			GMAGICK			= 65536,  // GraphicsMagick
+			UNICONV			= 131072, // UniConvertor
 		};
 	
 /*
Index: scribus/scimage.cpp
===================================================================
--- scribus/scimage.cpp	(revision 13956)
+++ scribus/scimage.cpp	(revision 13957)
@@ -12,6 +12,7 @@
 #include "scpaths.h"
 #include "scribuscore.h"
 #include "scimgdataloader_gimp.h"
+#include "scimgdataloader_gmagick.h"
 #include "scimgdataloader_jpeg.h"
 #include "scimgdataloader_ps.h"
 #include "scimgdataloader_psd.h"
@@ -1810,9 +1811,14 @@
 	else if (ext == "pat")
 		pDataLoader = new ScImgDataLoader_GIMP();
 	else
+	#ifdef GMAGICK_FOUND
+		#warning "Compiling with GraphicsMagick support!"
+		pDataLoader = new ScImgDataLoader_GMagick();
+	#else
 		pDataLoader = new ScImgDataLoader_QT();
+	#endif
 
-	if	(pDataLoader)
+	if (pDataLoader)
 	{
 		bool hasAlpha    = false;
 		bool alphaLoaded = pDataLoader->preloadAlphaChannel(fn, page, gsRes, hasAlpha);
@@ -1822,7 +1828,7 @@
 			return alphaLoaded;
 		}
 		QImage rImage;
-		if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+		if (pDataLoader->useRawImage() || extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
 		{
 			if (pDataLoader->imageInfoRecord().valid)
 			{
@@ -1917,8 +1923,12 @@
 		pDataLoader = new ScImgDataLoader_TIFF();
 	else if (extensionIndicatesJPEG(ext))
 		pDataLoader = new ScImgDataLoader_JPEG();
+	#ifdef FOUND_GMAGICK
+	else
+		pDataLoader = new ScImgDataLoader_GMagick();
+	#endif
 
-	if	(pDataLoader)
+	if (pDataLoader)
 	{
 		pDataLoader->loadEmbeddedProfile(fn, page);
 		QByteArray embeddedProfile = pDataLoader->embeddedProfile();
@@ -1996,9 +2006,13 @@
 	else if (ext == "pat")
 		pDataLoader.reset( new ScImgDataLoader_GIMP() );
 	else
+	#ifdef GMAGICK_FOUND
+		pDataLoader.reset( new ScImgDataLoader_GMagick() );
+	#else
 		pDataLoader.reset( new ScImgDataLoader_QT() );
+	#endif
 
-	if	(pDataLoader->loadPicture(fn, page, gsRes, (requestType == Thumbnail)))
+	if (pDataLoader->loadPicture(fn, page, gsRes, (requestType == Thumbnail)))
 	{
 		QImage::operator=(pDataLoader->image());
 		imgInfo = pDataLoader->imageInfoRecord();
@@ -2033,7 +2047,7 @@
 		return false;
 	}
 
-	if (!(extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext)))
+	if (!(extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())) //TODO: Unsure about this one!
 	{
 		if (isNull())
 			return  ret;
@@ -2108,7 +2122,7 @@
 		int inputProfColorSpace = static_cast<int>(cmsGetColorSpace(inputProf));
 		if ( inputProfColorSpace == icSigRgbData )
 			inputProfFormat = isPsdTiff ? TYPE_RGBA_8 : TYPE_BGRA_8; // Later make tiff and psd loader use TYPE_BGRA_8
-		else if (( inputProfColorSpace == icSigCmykData ) && isPsdTiff)
+		else if (( inputProfColorSpace == icSigCmykData ) && (isPsdTiff || pDataLoader->useRawImage()))
 		{
 			if (pDataLoader->r_image.channels() == 5)
 				inputProfFormat = (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1));
@@ -2148,7 +2162,7 @@
 				xform = scCmsCreateTransform(inputProf, inputProfFormat, screenProf, TYPE_BGRA_8, cmSettings.intent(), cmsFlags);
 			else
 			{
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 				{
 					QImage::operator=(pDataLoader->r_image.convertToQImage(false));
 					profileName = imgInfo.profileName;
@@ -2186,7 +2200,7 @@
 			break;
 		case RawData: // no Conversion just raw Data
 			xform = 0;
-			if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+			if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 			{
 				QImage::operator=(pDataLoader->r_image.convertToQImage(true, true));
 				profileName = imgInfo.profileName;
@@ -2201,7 +2215,7 @@
 		}
 		if (xform)
 		{
-			if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+			if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 			{
 				QImage::operator=(QImage(pDataLoader->r_image.width(), pDataLoader->r_image.height(), QImage::Format_ARGB32));
 				profileName = imgInfo.profileName;
@@ -2216,7 +2230,7 @@
 			for (int i = 0; i < height(); i++)
 			{
 				LPBYTE ptr = scanLine(i);
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 					ptr2 = pDataLoader->r_image.scanLine(i);
 				if ( inputProfFormat == TYPE_GRAY_8 && (reqType != CMYKData) )
 				{
@@ -2245,7 +2259,7 @@
 				}
 				else
 				{
-					if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+					if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage()) //TODO: Unsure about this one
 					{
 						cmsDoTransform(xform, ptr2, ptr, width());
 					}
@@ -2254,7 +2268,7 @@
 				}
 				// if transforming from CMYK to RGB, flatten the alpha channel
 				// which will still contain the black channel
-				if (!(extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext)))
+				if (!(extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage()))
 				{
 					QRgb alphaFF = qRgba(0,0,0,255);
 					QRgb *p;
@@ -2323,7 +2337,7 @@
 		case CMYKData:
 			if (!isCMYK)
 			{
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 				{
 					QImage::operator=(pDataLoader->r_image.convertToQImage(false));
 					profileName = imgInfo.profileName;
@@ -2351,7 +2365,7 @@
 			}
 			else
 			{
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 				{
 					QImage::operator=(pDataLoader->r_image.convertToQImage(true, true));
 					profileName = imgInfo.profileName;
@@ -2369,7 +2383,7 @@
 		case Thumbnail:
 			if (isCMYK)
 			{
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 				{
 					QImage::operator=(pDataLoader->r_image.convertToQImage(true));
 					profileName = imgInfo.profileName;
@@ -2400,7 +2414,7 @@
 			}
 			else
 			{
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 				{
 					QImage::operator=(pDataLoader->r_image.convertToQImage(false));
 					profileName = imgInfo.profileName;
@@ -2414,7 +2428,7 @@
 			}
 			break;
 		case RawData:
-				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext))
+				if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
 				{
 					QImage::operator=(pDataLoader->r_image.convertToQImage(true, true));
 					profileName = imgInfo.profileName;
Index: scribus/ui/tabexternaltoolswidget.ui
===================================================================
--- scribus/ui/tabexternaltoolswidget.ui	(revision 13956)
+++ scribus/ui/tabexternaltoolswidget.ui	(revision 13957)
@@ -6,13 +6,13 @@
     <x>0</x>
     <y>0</y>
     <width>688</width>
-    <height>614</height>
+    <height>668</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>External Tools</string>
   </property>
-  <layout class="QVBoxLayout" >
+  <layout class="QVBoxLayout" name="verticalLayout" >
    <item>
     <widget class="QGroupBox" name="psToolGroupBox" >
      <property name="title" >
@@ -250,6 +250,54 @@
     </widget>
    </item>
    <item>
+    <widget class="QGroupBox" name="UniconvertorGroupBox" >
+     <property name="toolTip" >
+      <string>Web Browser to launch with links from the Help system</string>
+     </property>
+     <property name="title" >
+      <string>Uniconvertor</string>
+     </property>
+     <layout class="QGridLayout" name="_2" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item row="0" column="2" >
+       <widget class="QPushButton" name="uniconvToolChangeButton" >
+        <property name="text" >
+         <string>&amp;Change...</string>
+        </property>
+        <property name="shortcut" >
+         <string>Alt+C</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" >
+       <widget class="QLineEdit" name="uniconvToolLineEdit" >
+        <property name="toolTip" >
+         <string>&lt;qt>File system location for your web browser. This is used for external links from the Help system.&lt;/qt></string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="uniconvLabel" >
+        <property name="text" >
+         <string>Name of &amp;Executable:</string>
+        </property>
+        <property name="wordWrap" >
+         <bool>false</bool>
+        </property>
+        <property name="buddy" >
+         <cstring>extBrowserToolLineEdit</cstring>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
     <widget class="QGroupBox" name="latexToolGroupBox" >
      <property name="title" >
       <string>Render Frames</string>
Index: scribus/ui/tabexternaltoolswidget.cpp
===================================================================
--- scribus/ui/tabexternaltoolswidget.cpp	(revision 13956)
+++ scribus/ui/tabexternaltoolswidget.cpp	(revision 13957)
@@ -28,10 +28,12 @@
 #include <QFileDialog>
 #include <QInputDialog>
 #include <QProcess>
+#include <QMessageBox>
 #include "util_ghostscript.h"
 #include "scpaths.h"
 #include "prefsstructs.h"
 #include "latexhelpers.h"
+#include "commonstrings.h"
 
 TabExternalToolsWidget::TabExternalToolsWidget(struct ApplicationPrefs *prefsData, QWidget* parent)
 : QWidget(parent)
@@ -45,6 +47,7 @@
 	connect(extBrowserToolChangeButton, SIGNAL(clicked()), this, SLOT(changeExtBrowserTool()));
 	connect(latexEditorChangeButton, SIGNAL(clicked()), this, SLOT(changeLatexEditor()));
 	connect(rescanButton, SIGNAL(clicked()), this, SLOT(rescanForTools()));
+	connect(uniconvToolChangeButton, SIGNAL(clicked()), this, SLOT(changeUniconvTool()));
 	connect(latexConfigUpButton, SIGNAL(clicked()), this, SLOT(upButtonPressed()));
 	connect(latexConfigDownButton, SIGNAL(clicked()), this, SLOT(downButtonPressed()));
 	connect(latexConfigAddButton, SIGNAL(clicked()), this, SLOT(addConfig()));
@@ -71,6 +74,11 @@
 	return QDir::fromNativeSeparators(extBrowserToolLineEdit->text()); 
 }
 
+const QString TabExternalToolsWidget::newUniconvTool() const 
+{
+	return QDir::fromNativeSeparators(uniconvToolLineEdit->text());
+}
+
 const QString TabExternalToolsWidget::newLatexEditor() const
 {
 	return QDir::fromNativeSeparators(latexEditorLineEdit->text());
@@ -95,6 +103,7 @@
 	psResolutionSpinBox->setValue(prefsData->extToolPrefs.gs_Resolution);
 	imageToolLineEdit->setText(QDir::convertSeparators(prefsData->extToolPrefs.imageEditorExecutable));
 	extBrowserToolLineEdit->setText(QDir::convertSeparators(prefsData->extToolPrefs.extBrowserExecutable));
+	uniconvToolLineEdit->setText(QDir::convertSeparators(prefsData->extToolPrefs.uniconvExecutable));
 	latexResolutionSpinBox->setValue(prefsData->extToolPrefs.latexResolution);
 	latexEditorLineEdit->setText(prefsData->extToolPrefs.latexEditorExecutable);
 	latexForceDpiCheckBox->setCheckState(prefsData->extToolPrefs.latexForceDpi?Qt::Checked:Qt::Unchecked);
@@ -132,6 +141,14 @@
 		extBrowserToolLineEdit->setText( QDir::convertSeparators(s) );
 }
 
+void TabExternalToolsWidget::changeUniconvTool()
+{
+	QFileInfo fi(uniconvToolLineEdit->text());
+	QString s = QFileDialog::getOpenFileName(this, tr("Locate the uniconvertor executable"), fi.path());
+	if (!s.isEmpty())
+		uniconvToolLineEdit->setText( QDir::convertSeparators(s) );
+}
+
 void TabExternalToolsWidget::changeLatexEditor()
 {
 	QFileInfo fi(latexEditorLineEdit->text());
@@ -242,6 +259,17 @@
 	
 	if (!fileInPath(imageToolLineEdit->text()))
 		imageToolLineEdit->setText("gimp");
+
+	if (!fileInPath(uniconvToolLineEdit->text())) {
+		if (fileInPath("uniconvertor")) {
+			uniconvToolLineEdit->setText("uniconvertor");
+		} else if (fileInPath("uniconv")) {
+			uniconvToolLineEdit->setText("uniconv");
+		} else {
+			QMessageBox::warning(0, CommonStrings::trWarning, tr("Uniconvertor executable not found!"), 1, 0, 0);
+			uniconvToolLineEdit->setText("");
+		}
+	}
 	
 	if (!fileInPath(latexEditorLineEdit->text())) {
 		QStringList editors;
Index: scribus/ui/prefs.cpp
===================================================================
--- scribus/ui/prefs.cpp	(revision 13956)
+++ scribus/ui/prefs.cpp	(revision 13957)
@@ -415,6 +415,7 @@
 	prefsManager->appPrefs.docSetupPrefs.bleeds.Right = tabDocument->marginGroup->rightBleed();
 	prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].FirstPage = tabDocument->docLayout->firstPage->currentIndex();
 
+	prefsManager->setUniconvExecutable(tabExtTools->newUniconvTool());
 	prefsManager->setImageEditorExecutable(tabExtTools->newImageTool());
 	prefsManager->setExtBrowserExecutable(tabExtTools->newExtBrowserTool());
 	prefsManager->appPrefs.extToolPrefs.gs_AntiAliasGraphics = tabExtTools->newAntialiasGraphics();
Index: scribus/ui/tabexternaltoolswidget.h
===================================================================
--- scribus/ui/tabexternaltoolswidget.h	(revision 13956)
+++ scribus/ui/tabexternaltoolswidget.h	(revision 13957)
@@ -45,6 +45,7 @@
 		const QString newPSTool() const;
 		const QString newImageTool() const;
 		const QString newExtBrowserTool() const;
+		const QString newUniconvTool() const;
 		const QString newLatexEditor() const;
 		const QStringList newLatexConfigs() const;
 		const QMap<QString, QString> newLatexCommands() const;
@@ -64,6 +65,7 @@
 		void changePostScriptTool();
 		void changeImageTool();
 		void changeExtBrowserTool();
+		void changeUniconvTool();
 		void changeLatexEditor();
 		void rescanForTools();
 		void upButtonPressed();
Index: scribus/plugins/formatidlist.h
===================================================================
--- scribus/plugins/formatidlist.h	(revision 13956)
+++ scribus/plugins/formatidlist.h	(revision 13957)
@@ -24,6 +24,7 @@
 #define FORMATID_XFIGIMPORT  106
 #define FORMATID_CVGIMPORT  107
 #define FORMATID_WPGIMPORT  108
+#define FORMATID_UNICONVIMPORT 109
 #define FORMATID_PDFIMPORT 120
 
 // EXPORT
Index: scribus/plugins/CMakeLists.txt
===================================================================
--- scribus/plugins/CMakeLists.txt	(revision 13956)
+++ scribus/plugins/CMakeLists.txt	(revision 13957)
@@ -14,6 +14,7 @@
 ADD_SUBDIRECTORY(short-words)
 ADD_SUBDIRECTORY(svgexplugin)
 ADD_SUBDIRECTORY(svgimplugin)
+ADD_SUBDIRECTORY(uniconvertorplugin)
 ADD_SUBDIRECTORY(wmfimplugin)
 ADD_SUBDIRECTORY(xfigimplugin)
 ADD_SUBDIRECTORY(cvgimplugin)
Index: scribus/undomanager.cpp
===================================================================
--- scribus/undomanager.cpp	(revision 13956)
+++ scribus/undomanager.cpp	(revision 13957)
@@ -899,6 +899,7 @@
 	UndoManager::PathText           = tr("Text on a Path");
 	UndoManager::ConvertTo          = tr("Convert to");
 	UndoManager::ImportSVG          = tr("Import SVG image");
+	UndoManager::ImportUniconv      = tr("Import Uniconvertor image");
 	UndoManager::ImportEPS          = tr("Import EPS image");
 	UndoManager::ImportBarcode      = tr("Import Barcode");
 	UndoManager::ImportOOoDraw      = tr("Import OpenOffice.org Draw image");
@@ -999,6 +1000,7 @@
 	UndoManager::IFont            = new QPixmap(iconDir + "u_font.png");
 	UndoManager::IImportOOoDraw   = new QPixmap(iconDir + "ooo_draw.png");
 	UndoManager::ISVG             = new QPixmap(iconDir + "u_svg.png");
+	UndoManager::IUniconv         = new QPixmap(iconDir + "u_svg.png"); // using the icon for SVG for now
 	UndoManager::IEPS             = new QPixmap(iconDir + "u_eps.png");
 	UndoManager::IAI              = new QPixmap(iconDir + "u_eps.png"); // using the icon for EPS for now
 	UndoManager::IXFIG            = new QPixmap(iconDir + "u_eps.png"); // using the icon for EPS for now
@@ -1099,6 +1101,7 @@
 QString UndoManager::PathText           = "";
 QString UndoManager::ConvertTo          = "";
 QString UndoManager::ImportSVG          = "";
+QString UndoManager::ImportUniconv      = "";
 QString UndoManager::ImportEPS          = "";
 QString UndoManager::ImportBarcode      = "";
 QString UndoManager::ImportOOoDraw      = "";
@@ -1193,6 +1196,7 @@
 QPixmap *UndoManager::IArrow           = 0;
 QPixmap *UndoManager::IFont            = 0;
 QPixmap *UndoManager::ISVG             = 0;
+QPixmap *UndoManager::IUniconv         = 0;
 QPixmap *UndoManager::IEPS             = 0;
 QPixmap *UndoManager::IAI              = 0;
 QPixmap *UndoManager::IXFIG            = 0;
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt	(revision 13956)
+++ scribus/CMakeLists.txt	(revision 13957)
@@ -631,6 +631,7 @@
   scimagestructs.cpp
   scimgdataloader.cpp
   scimgdataloader_gimp.cpp
+  scimgdataloader_gmagick.cpp
   scimgdataloader_jpeg.cpp
   scimgdataloader_pdf.cpp
   scimgdataloader_ps.cpp
@@ -810,6 +811,13 @@
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${FREETYPE_INCLUDE_DIRS}
 )
+INCLUDE_DIRECTORIES(
+  BEFORE ${GMAGICK_INCLUDES}
+)
+MESSAGE(STATUS "${GMAGICK_LIBRARIES}, ${GMAGICK_INCLUDES}, ${GMAGICK_LDFLAGS}")
+LINK_DIRECTORIES(
+    ${GMAGICK_LDFLAGS}
+)
 
 IF(HAVE_PODOFO)
   INCLUDE_DIRECTORIES(
@@ -908,6 +916,7 @@
   ${JPEG_LIBRARIES}
   ${ZLIB_LIBRARIES}
   ${WIN32_ONLY_LIBS}
+  ${GMAGICK_LIBRARIES}
 )
 
 IF(WIN32)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 13956)
+++ CMakeLists.txt	(revision 13957)
@@ -653,6 +653,14 @@
 ENDIF(LIBPODOFO_FOUND)
 #>>PoDoFo for AI PDF import
 
+SET(GMAGICK_DIR ${CMAKE_MODULE_PATH})
+FIND_PACKAGE(GMAGICK)
+IF(GMAGICK_FOUND)
+  MESSAGE("GraphicksMagick++ Library Found OK")
+ELSE(GMAGICK_FOUND)
+  MESSAGE("GraphicksMagick++ Library NOT found! Building without additional image format support!")
+ENDIF(GMAGICK_FOUND)
+
 ##############################################################################################################
 ########## Include Setup                                                                            ##########
 
Index: config.h.cmake
===================================================================
--- config.h.cmake	(revision 13956)
+++ config.h.cmake	(revision 13957)
@@ -31,3 +31,4 @@
 #cmakedefine FT_FREETYPE_H
 #cmakedefine COMPILE_PYTHON 1
 #cmakedefine WORDS_BIGENDIAN 1
+#cmakedefine GMAGICK_FOUND 1




More information about the scribus-commit mailing list