r16732 by fschmid - Added the possibility to invert patterns for masks.

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 30 09:09:55 UTC 2011


Author: fschmid
Date: Sat Jul 30 09:09:55 2011
New Revision: 16732

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16732
Log:
Added the possibility to invert patterns for masks.
Fixed more issues with pattern masks in the PDF export.

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_group.cpp
    trunk/Scribus/scribus/pageitem_imageframe.cpp
    trunk/Scribus/scribus/pageitem_symbol.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/about.cpp
    trunk/Scribus/scribus/ui/transparencypalette.cpp
    trunk/Scribus/scribus/ui/transparencypalette.ui

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sat Jul 30 09:09:55 2011
@@ -1543,7 +1543,7 @@
 				else
 					p->setGradientMask(VGradient::radial, FPoint(GrMaskStartX, GrMaskStartY), FPoint(GrMaskEndX, GrMaskEndY), FPoint(GrMaskFocalX, GrMaskFocalY), GrMaskScale, GrMaskSkew);
 			}
-			else if ((GrMask == 3) || (GrMask == 6))
+			else if ((GrMask == 3) || (GrMask == 6) || (GrMask == 7) || (GrMask == 8))
 			{
 				if ((patternMaskVal.isEmpty()) || (!m_Doc->docPatterns.contains(patternMaskVal)))
 					p->setMaskMode(0);
@@ -1552,8 +1552,12 @@
 					p->setPatternMask(&m_Doc->docPatterns[patternMaskVal], patternMaskScaleX, patternMaskScaleY, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
 					if (GrMask == 3)
 						p->setMaskMode(2);
+					else if (GrMask == 6)
+						p->setMaskMode(4);
+					else if (GrMask == 7)
+						p->setMaskMode(5);
 					else
-						p->setMaskMode(4);
+						p->setMaskMode(6);
 				}
 			}
 			else
@@ -2033,6 +2037,8 @@
 
 QImage PageItem::DrawObj_toImage(QList<PageItem*> &emG, double scaling)
 {
+	bool savedFlag = m_Doc->guidesPrefs().framesShown;
+	m_Doc->guidesPrefs().framesShown = false;
 	QImage retImg = QImage(qRound(gWidth * scaling), qRound(gHeight * scaling), QImage::Format_ARGB32_Premultiplied);
 	retImg.fill( qRgba(0, 0, 0, 0) );
 	ScPainter *painter = new ScPainter(&retImg, retImg.width(), retImg.height(), 1, 0);
@@ -2080,6 +2086,7 @@
 	}
 	painter->end();
 	delete painter;
+	m_Doc->guidesPrefs().framesShown = savedFlag;
 	return retImg;
 }
 

Modified: trunk/Scribus/scribus/pageitem_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/pageitem_group.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_group.cpp (original)
+++ trunk/Scribus/scribus/pageitem_group.cpp Sat Jul 30 09:09:55 2011
@@ -133,7 +133,7 @@
 				else
 					p->setGradientMask(VGradient::radial, FPoint(GrMaskStartX, GrMaskStartY), FPoint(GrMaskEndX, GrMaskEndY), FPoint(GrMaskFocalX, GrMaskFocalY), GrMaskScale, GrMaskSkew);
 			}
-			else if ((maskType() == 3) || (maskType() == 6))
+			else if ((maskType() == 3) || (maskType() == 6) || (maskType() == 7) || (maskType() == 8))
 			{
 				if ((patternMask().isEmpty()) || (!m_Doc->docPatterns.contains(patternMask())))
 					p->setMaskMode(0);
@@ -144,8 +144,12 @@
 					p->setPatternMask(&m_Doc->docPatterns[patternMask()], patternMaskScaleX * scw, patternMaskScaleY * sch, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
 					if (maskType() == 3)
 						p->setMaskMode(2);
+					else if (maskType() == 6)
+						p->setMaskMode(4);
+					else if (maskType() == 7)
+						p->setMaskMode(5);
 					else
-						p->setMaskMode(4);
+						p->setMaskMode(6);
 				}
 			}
 			else

Modified: trunk/Scribus/scribus/pageitem_imageframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/pageitem_imageframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_imageframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_imageframe.cpp Sat Jul 30 09:09:55 2011
@@ -181,7 +181,7 @@
 						else
 							p->setGradientMask(VGradient::radial, FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), FPoint(GrMaskEndX * mscalex, GrMaskEndY * mscaley), FPoint(GrMaskFocalX * mscalex, GrMaskFocalY * mscaley), GrMaskScale, GrMaskSkew);
 					}
-					else if ((GrMask == 3) || (GrMask == 6))
+					else if ((GrMask == 3) || (GrMask == 6) || (GrMask == 7) || (GrMask == 8))
 					{
 						if ((patternMaskVal.isEmpty()) || (!m_Doc->docPatterns.contains(patternMaskVal)))
 							p->setMaskMode(0);
@@ -190,8 +190,12 @@
 							p->setPatternMask(&m_Doc->docPatterns[patternMaskVal], patternMaskScaleX * mscalex, patternMaskScaleY * mscaley, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
 							if (GrMask == 3)
 								p->setMaskMode(2);
+							else if (GrMask == 6)
+								p->setMaskMode(4);
+							else if (GrMask == 7)
+								p->setMaskMode(5);
 							else
-								p->setMaskMode(4);
+								p->setMaskMode(6);
 						}
 					}
 					else

Modified: trunk/Scribus/scribus/pageitem_symbol.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/pageitem_symbol.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_symbol.cpp (original)
+++ trunk/Scribus/scribus/pageitem_symbol.cpp Sat Jul 30 09:09:55 2011
@@ -84,7 +84,7 @@
 				else
 					p->setGradientMask(VGradient::radial, FPoint(GrMaskStartX, GrMaskStartY), FPoint(GrMaskEndX, GrMaskEndY), FPoint(GrMaskFocalX, GrMaskFocalY), GrMaskScale, GrMaskSkew);
 			}
-			else if ((maskType() == 3) || (maskType() == 6))
+			else if ((maskType() == 3) || (maskType() == 6) || (maskType() == 7) || (maskType() == 8))
 			{
 				if ((patternMask().isEmpty()) || (!m_Doc->docPatterns.contains(patternMask())))
 					p->setMaskMode(0);
@@ -95,8 +95,12 @@
 					p->setPatternMask(&m_Doc->docPatterns[patternMask()], patternMaskScaleX * scw, patternMaskScaleY * sch, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
 					if (maskType() == 3)
 						p->setMaskMode(2);
+					else if (maskType() == 6)
+						p->setMaskMode(4);
+					else if (maskType() == 7)
+						p->setMaskMode(5);
 					else
-						p->setMaskMode(4);
+						p->setMaskMode(6);
 				}
 			}
 			else

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sat Jul 30 09:09:55 2011
@@ -3418,6 +3418,51 @@
 	else
 		PutDoc("/BBox [ "+FToStr(-bleedLeft)+" "+FToStr(-Options.bleeds.Bottom)+" "+FToStr(maxBoxX)+" "+FToStr(maxBoxY)+" ]\n");
 	PutDoc("/Group "+QString::number(Gobj)+" 0 R\n");
+	PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
+	if ((Seite.ImgObjects.count() != 0) || (Seite.XObjects.count() != 0))
+	{
+		PutDoc("/XObject <<\n");
+		QMap<QString,int>::Iterator it;
+		for (it = Seite.ImgObjects.begin(); it != Seite.ImgObjects.end(); ++it)
+			PutDoc("/"+it.key()+" "+QString::number(it.value())+" 0 R\n");
+		QMap<QString,int>::Iterator iti;
+		for (iti = Seite.XObjects.begin(); iti != Seite.XObjects.end(); ++iti)
+			PutDoc("/"+iti.key()+" "+QString::number(iti.value())+" 0 R\n");
+		PutDoc(">>\n");
+	}
+	if (Seite.FObjects.count() != 0)
+	{
+		PutDoc("/Font << \n");
+		QMap<QString,int>::Iterator it2;
+		for (it2 = Seite.FObjects.begin(); it2 != Seite.FObjects.end(); ++it2)
+			PutDoc("/"+it2.key()+" "+QString::number(it2.value())+" 0 R\n");
+		PutDoc(">>\n");
+	}
+	if (Shadings.count() != 0)
+	{
+		PutDoc("/Shading << \n");
+		QMap<QString,int>::Iterator it3;
+		for (it3 = Shadings.begin(); it3 != Shadings.end(); ++it3)
+			PutDoc("/"+it3.key()+" "+QString::number(it3.value())+" 0 R\n");
+		PutDoc(">>\n");
+	}
+	if (Patterns.count() != 0)
+	{
+		PutDoc("/Pattern << \n");
+		QMap<QString,int>::Iterator it3p;
+		for (it3p = Patterns.begin(); it3p != Patterns.end(); ++it3p)
+			PutDoc("/"+it3p.key()+" "+QString::number(it3p.value())+" 0 R\n");
+		PutDoc(">>\n");
+	}
+	if (Transpar.count() != 0)
+	{
+		PutDoc("/ExtGState << \n");
+		QMap<QString,int>::Iterator it3t;
+		for (it3t = Transpar.begin(); it3t != Transpar.end(); ++it3t)
+			PutDoc("/"+it3t.key()+" "+QString::number(it3t.value())+" 0 R\n");
+		PutDoc(">>\n");
+	}
+	PutDoc(">>\n");
 	if (Options.Compress)
 		data = CompressStr(&data);
 	PutDoc("/Length "+QString::number(data.length()+1));
@@ -6021,7 +6066,7 @@
 		Transpar[GXName] = writeGState("/SMask << /S /Luminosity /G "+QString::number(formObject)+" 0 R >>\n/AIS false\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
 		tmp = "/"+GXName+" gs\n";
 	}
-	else if ((currItem->GrMask == 3) || (currItem->GrMask == 6))
+	else if ((currItem->GrMask == 3) || (currItem->GrMask == 6) || (currItem->GrMask == 7) || (currItem->GrMask == 8))
 	{
 		QString tmpOut = "";
 		PDF_PatternFillStroke(tmpOut, currItem, 2);
@@ -6058,19 +6103,24 @@
 				PutDoc("/"+it3p.key()+" "+QString::number(it3p.value())+" 0 R\n");
 			PutDoc(">>\n");
 		}
+		if ((Seite.ImgObjects.count() != 0) || (Seite.XObjects.count() != 0))
+		{
+			PutDoc("/XObject <<\n");
+			QMap<QString,int>::Iterator it;
+			for (it = Seite.ImgObjects.begin(); it != Seite.ImgObjects.end(); ++it)
+				PutDoc("/"+it.key()+" "+QString::number(it.value())+" 0 R\n");
+			QMap<QString,int>::Iterator iti;
+			for (iti = Seite.XObjects.begin(); iti != Seite.XObjects.end(); ++iti)
+				PutDoc("/"+iti.key()+" "+QString::number(iti.value())+" 0 R\n");
+			PutDoc(">>\n");
+		}
 		PutDoc(">>\n");
 		QString stre = "q\n";
-		if (currItem->isGroup())
-		{
-			QTransform mpa;
-			mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
-			mpa.rotate(-currItem->rotation());
-			stre += FToStr(mpa.m11())+" "+FToStr(mpa.m12())+" "+FToStr(mpa.m21())+" "+FToStr(mpa.m22())+" "+FToStr(mpa.dx())+" "+FToStr(mpa.dy())+" cm\n";
-		}
-		else if (currItem->itemType() == PageItem::Symbol)
+		if ((currItem->isGroup()) || (currItem->itemType() == PageItem::Symbol))
 		{
 			QTransform mpa;
 			mpa.translate(0, currItem->height() * scaleY);
+			mpa.rotate(-currItem->rotation());
 			mpa.scale(scaleX, scaleY);
 			stre += FToStr(mpa.m11())+" "+FToStr(mpa.m12())+" "+FToStr(mpa.m21())+" "+FToStr(mpa.m22())+" "+FToStr(mpa.dx())+" "+FToStr(mpa.dy())+" cm\n";
 		}
@@ -6090,8 +6140,12 @@
 		ResCount++;
 		if (currItem->GrMask == 6)
 			Transpar[GXName] = writeGState("/SMask << /S /Luminosity /G "+QString::number(formObject)+" 0 R >>\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
-		else
+		else if (currItem->GrMask == 7)
+			Transpar[GXName] = writeGState("/SMask << /S /Luminosity /G "+QString::number(formObject)+" 0 R /BC [ 1 1 1 ] /TR << /FunctionType 2 /Domain [ 0 1 ] /Range [ 0 1 ] /C0 [ 1 ] /C1 [ 0 ] /N 1 >> >>\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n/AIS true\n");
+		else if (currItem->GrMask == 3)
 			Transpar[GXName] = writeGState("/SMask << /S /Alpha /G "+QString::number(formObject)+" 0 R >>\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
+		else if (currItem->GrMask == 8)
+			Transpar[GXName] = writeGState("/SMask << /S /Alpha /G "+QString::number(formObject)+" 0 R /BC [ 1 1 1 ] /TR << /FunctionType 2 /Domain [ 0 1 ] /Range [ 0 1 ] /C0 [ 1 ] /C1 [ 0 ] /N 1 >> >>\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
 		tmp = "/"+GXName+" gs\n";
 	}
 	else
@@ -6275,12 +6329,7 @@
 	}
 	else if (kind == 2)
 	{
-		if (currItem->isGroup())
-		{
-			mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
-			mpa.rotate(-currItem->rotation());
-		}
-		else if (currItem->itemType() == PageItem::Symbol)
+		if ((currItem->isGroup()) || (currItem->itemType() == PageItem::Symbol))
 		{
 			mpa.translate(0, currItem->height() * scaleY);
 			mpa.scale(scaleX, scaleY);

Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Sat Jul 30 09:09:55 2011
@@ -19,6 +19,7 @@
 #include "undomanager.h"
 #include "util_formats.h"
 
+#include <QApplication>
 #include <QMessageBox>
 
 int importai_getPluginAPIVersion()
@@ -164,6 +165,7 @@
 			fT.close();
 			if (tempBuf.startsWith("%PDF"))
 			{
+				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 				QMessageBox msgBox(ScCore->primaryMainWindow());
 				msgBox.setText( tr("This file contains 2 versions of the data."));
 				msgBox.setInformativeText( tr("Choose which one should be imported"));
@@ -181,6 +183,7 @@
 						QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The PDF Import plugin could not be found"), 1, 0, 0);
 						return false;
 					}
+					qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 					bool success = fmt->loadFile(fileName, flags);
 					if (activeTransaction)
 					{
@@ -194,6 +197,7 @@
 						QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"), 1, 0, 0);
 					return success;
 				}
+				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 			}
 		}
 	}

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp Sat Jul 30 09:09:55 2011
@@ -331,25 +331,25 @@
 							Object obj;
 							GooString *s1;
 							Dict *infoDict = info.getDict();
-							if (infoDict->lookup("Title", &obj )->isString())
+							if (infoDict->lookup((char*)"Title", &obj )->isString())
 							{
 								s1 = obj.getString();
 								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
 								obj.free();
 							}
-							if (infoDict->lookup("Author", &obj )->isString())
+							if (infoDict->lookup((char*)"Author", &obj )->isString())
 							{
 								s1 = obj.getString();
 								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
 								obj.free();
 							}
-							if (infoDict->lookup("Subject", &obj )->isString())
+							if (infoDict->lookup((char*)"Subject", &obj )->isString())
 							{
 								s1 = obj.getString();
 								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
 								obj.free();
 							}
-							if (infoDict->lookup("Keywords", &obj )->isString())
+							if (infoDict->lookup((char*)"Keywords", &obj )->isString())
 							{
 								s1 = obj.getString();
 								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp Sat Jul 30 09:09:55 2011
@@ -19,6 +19,7 @@
 #include "undomanager.h"
 #include "util_formats.h"
 #include "util.h"
+#include <QApplication>
 #include <QMessageBox>
 
 
@@ -207,7 +208,9 @@
 		}
 		else
 		{
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 			QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The Import plugin cannot handle Postscript files"), 1, 0, 0);
+			qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 			return false;
 		}
 	}

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Sat Jul 30 09:09:55 2011
@@ -13,11 +13,7 @@
 	m_doc = doc;
 	m_Elements = Elements;
 	m_groupStack.clear();
-	groupEntry gElements;
-	gElements.forSoftMask = gFalse;
-	gElements.alpha = gFalse;
-	gElements.maskName = "";
-	m_groupStack.push(gElements);
+	pushGroup();
 	m_clipStack.clear();
 	m_currentMask = "";
 	m_importedColors = importedColors;
@@ -139,11 +135,7 @@
 void SlaOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, GfxColorSpace * /*blendingColorSpace*/, GBool /*isolated*/, GBool /*knockout*/, GBool forSoftMask)
 {
 //	qDebug() << "Start Group";
-	groupEntry gElements;
-	gElements.forSoftMask = forSoftMask;
-	gElements.alpha = gFalse;
-	gElements.maskName = "";
-	m_groupStack.push(gElements);
+	pushGroup("", forSoftMask);
 }
 
 void SlaOutputDev::endTransparencyGroup(GfxState *state)
@@ -190,16 +182,7 @@
 				}
 			}
 			if (m_groupStack.count() != 0)
-			{
-				if (!m_groupStack.top().maskName.isEmpty())
-				{
-					ite->setPatternMask(m_groupStack.top().maskName);
-					if (m_groupStack.top().alpha)
-						ite->setMaskType(3);
-					else
-						ite->setMaskType(6);
-				}
-			}
+				applyMask(ite);
 		}
 		if (m_groupStack.count() != 0)
 		{
@@ -212,10 +195,21 @@
 	}
 }
 
-void SlaOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool alpha, Function * /*transferFunc*/, GfxColor * /*backdropColor*/)
+void SlaOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool alpha, Function *transferFunc, GfxColor * /*backdropColor*/)
 {
 	if (m_groupStack.count() != 0)
 	{
+		double lum = 0;
+		double lum2 = 0;
+		if (transferFunc)
+			transferFunc->transform(&lum, &lum2);
+		else
+			lum2 = lum;
+		if (lum == lum2)
+			m_groupStack.top().inverted = false;
+		else
+			m_groupStack.top().inverted = true;
+//		qDebug() << "Inverted Softmask" << m_groupStack.top().inverted;
 		m_groupStack.top().maskName = m_currentMask;
 		m_groupStack.top().alpha = alpha;
 	}
@@ -258,14 +252,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	clipEntry clp;
 	clp.ClipCoords = out.copy();
@@ -273,11 +260,7 @@
 	clp.grStackDepth = grStackDepth;
 	m_clipStack.push(clp);
 	m_doc->GroupCounter++;
-	groupEntry gElements;
-	gElements.forSoftMask = gFalse;
-	gElements.alpha = gFalse;
-	gElements.maskName = "";
-	m_groupStack.push(gElements);
+	pushGroup();
 }
 
 void SlaOutputDev::eoClip(GfxState *state)
@@ -309,14 +292,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	clipEntry clp;
 	clp.ClipCoords = out.copy();
@@ -324,11 +300,7 @@
 	clp.grStackDepth = grStackDepth;
 	m_clipStack.push(clp);
 	m_doc->GroupCounter++;
-	groupEntry gElements;
-	gElements.forSoftMask = gFalse;
-	gElements.alpha = gFalse;
-	gElements.maskName = "";
-	m_groupStack.push(gElements);
+	pushGroup();
 }
 
 void SlaOutputDev::stroke(GfxState *state)
@@ -417,9 +389,7 @@
 		ite->setLineShade(100);
 		ite->setFillEvenOdd(false);
 		ite->setFillTransparency(1.0 - state->getFillOpacity());
-		ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 		ite->setFillBlendmode(getBlendMode(state));
-		ite->setLineBlendmode(getBlendMode(state));
 		ite->setLineEnd(PLineEnd);
 		ite->setLineJoin(PLineJoin);
 		ite->setWidthHeight(wh.x(),wh.y());
@@ -429,14 +399,7 @@
 		if (m_groupStack.count() != 0)
 		{
 			m_groupStack.top().Items.append(ite);
-			if (!m_groupStack.top().maskName.isEmpty())
-			{
-				ite->setPatternMask(m_groupStack.top().maskName);
-				if (m_groupStack.top().alpha)
-					ite->setMaskType(3);
-				else
-					ite->setMaskType(6);
-			}
+			applyMask(ite);
 		}
 	}
 }
@@ -471,9 +434,7 @@
 		ite->setLineShade(100);
 		ite->setFillEvenOdd(true);
 		ite->setFillTransparency(1.0 - state->getFillOpacity());
-		ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 		ite->setFillBlendmode(getBlendMode(state));
-		ite->setLineBlendmode(getBlendMode(state));
 		ite->setLineEnd(PLineEnd);
 		ite->setLineJoin(PLineJoin);
 		ite->setWidthHeight(wh.x(),wh.y());
@@ -483,14 +444,7 @@
 		if (m_groupStack.count() != 0)
 		{
 			m_groupStack.top().Items.append(ite);
-			if (!m_groupStack.top().maskName.isEmpty())
-			{
-				ite->setPatternMask(m_groupStack.top().maskName);
-				if (m_groupStack.top().alpha)
-					ite->setMaskType(3);
-				else
-					ite->setMaskType(6);
-			}
+			applyMask(ite);
 		}
 	}
 }
@@ -576,9 +530,7 @@
 	ite->setLineShade(100);
 	ite->setFillEvenOdd(false);
 	ite->setFillTransparency(1.0 - state->getFillOpacity());
-	ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 	ite->setFillBlendmode(getBlendMode(state));
-	ite->setLineBlendmode(getBlendMode(state));
 	ite->setLineEnd(PLineEnd);
 	ite->setLineJoin(PLineJoin);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
@@ -590,14 +542,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	return gTrue;
 }
@@ -691,9 +636,7 @@
 	ite->setLineShade(100);
 	ite->setFillEvenOdd(false);
 	ite->setFillTransparency(1.0 - state->getFillOpacity());
-	ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 	ite->setFillBlendmode(getBlendMode(state));
-	ite->setLineBlendmode(getBlendMode(state));
 	ite->setLineEnd(PLineEnd);
 	ite->setLineJoin(PLineJoin);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
@@ -705,14 +648,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	return gTrue;
 }
@@ -747,9 +683,7 @@
 	ite->setLineShade(100);
 	ite->setFillEvenOdd(false);
 	ite->setFillTransparency(1.0 - state->getFillOpacity());
-	ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 	ite->setFillBlendmode(getBlendMode(state));
-	ite->setLineBlendmode(getBlendMode(state));
 	ite->setLineEnd(PLineEnd);
 	ite->setLineJoin(PLineJoin);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
@@ -758,14 +692,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 //	qDebug() << "Mesh of" << shading->getNPatches() << "Patches";
 	for (int i = 0; i < shading->getNPatches(); i++)
@@ -889,6 +816,7 @@
 	groupEntry gElements;
 	gElements.forSoftMask = gFalse;
 	gElements.alpha = gFalse;
+	gElements.inverted = false;
 	gElements.maskName = "";
 	gElements.Items.clear();
 	m_groupStack.push(gElements);
@@ -906,11 +834,6 @@
 	m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
 	QTransform mm = QTransform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
 	QTransform mmx = mm * m_ctm;
-//	qDebug() << "Pattern Fill";
-//	qDebug() << "mat" << mat[0] << mat[1] << mat[2] << mat[3] << mat[4] << mat[5];
-//	qDebug() << "pmat" << pmat[0] << pmat[1] << pmat[2] << pmat[3] << pmat[4] << pmat[5];
-//	qDebug() << "ctm" << ctm[0] << ctm[1] << ctm[2] << ctm[3] << ctm[4] << ctm[5];
-//	qDebug() << "cumulated ctm" << mmx;
 	gfx = new Gfx(xref, this, resDict, catalog, &box, NULL);
 	gfx->display(str);
 	gElements = m_groupStack.pop();
@@ -955,8 +878,6 @@
 	state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
 	QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax));
 	crect = crect.normalized();
-//	qDebug() << "Crect" << crect;
-//	qDebug() << "Xoffs" << crect.x() - (pmat[4] / fabs(pmat[0])) << "Yoffs" << crect.y() - (m_doc->currentPage()->height() - (pmat[5] / fabs(pmat[3])));
 	QString output = QString("M %1 %2").arg(0.0).arg(0.0);
 	output += QString("L %1 %2").arg(crect.width()).arg(0.0);
 	output += QString("L %1 %2").arg(crect.width()).arg(crect.height());
@@ -973,29 +894,19 @@
 	ite->setLineShade(100);
 	ite->setFillEvenOdd(false);
 	ite->setFillTransparency(1.0 - state->getFillOpacity());
-	ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 	ite->setFillBlendmode(getBlendMode(state));
-	ite->setLineBlendmode(getBlendMode(state));
 	ite->setLineEnd(PLineEnd);
 	ite->setLineJoin(PLineJoin);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
 	ite->GrType = 8;
 	ite->setPattern(id);
 	ite->setPatternTransform(fabs(pmat[0]) * 100, fabs(pmat[3]) * 100, mmx.dx() - ctm[4], mmx.dy() - ctm[5], 0, -1 * pmat[1], pmat[2]);
-//	ite->setPatternTransform(fabs(pmat[0]) * 100, fabs(pmat[3]) * 100, pmat[4], -1 * pmat[5], 0, -1 * pmat[1], pmat[2]);
 	m_doc->AdjustItemSize(ite);
 	m_Elements->append(ite);
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	delete gfx;
 	return gTrue;
@@ -1074,7 +985,7 @@
 		yCoor = yCoor + ctm[5] - (fabs(sy) * height);
 	else
 		yCoor = yCoor + ctm[5];
-	int z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, xCoor , yCoor, fabs(sx) * width, fabs(sy) * height, 0, CurrColorFill, CurrColorStroke, true);
+	int z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, xCoor , yCoor, fabs(sx) * width, fabs(sy) * height, 0, CommonStrings::None, CommonStrings::None, true);
 	PageItem* ite = m_doc->Items->at(z);
 	ite->SetRectFrame();
 	m_doc->setRedrawBounding(ite);
@@ -1084,9 +995,7 @@
 	ite->setLineShade(100);
 	ite->setFillEvenOdd(false);
 	ite->setFillTransparency(1.0 - state->getFillOpacity());
-	ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 	ite->setFillBlendmode(getBlendMode(state));
-	ite->setLineBlendmode(getBlendMode(state));
 	ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
 	ite->tempImageFile->open();
 	QString fileName = getLongPathName(ite->tempImageFile->fileName());
@@ -1104,14 +1013,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	delete imgStr;
 	delete[] buffer;
@@ -1182,7 +1084,7 @@
 		yCoor = yCoor + ctm[5] - (fabs(sy) * height);
 	else
 		yCoor = yCoor + ctm[5];
-	int z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, xCoor , yCoor, fabs(sx) * width, fabs(sy) * height, 0, CurrColorFill, CurrColorStroke, true);
+	int z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, xCoor , yCoor, fabs(sx) * width, fabs(sy) * height, 0, CommonStrings::None, CommonStrings::None, true);
 	PageItem* ite = m_doc->Items->at(z);
 	ite->SetRectFrame();
 	m_doc->setRedrawBounding(ite);
@@ -1192,9 +1094,7 @@
 	ite->setLineShade(100);
 	ite->setFillEvenOdd(false);
 	ite->setFillTransparency(1.0 - state->getFillOpacity());
-	ite->setLineTransparency(1.0 - state->getStrokeOpacity());
 	ite->setFillBlendmode(getBlendMode(state));
-	ite->setLineBlendmode(getBlendMode(state));
 	ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
 	ite->tempImageFile->open();
 	QString fileName = getLongPathName(ite->tempImageFile->fileName());
@@ -1212,14 +1112,7 @@
 	if (m_groupStack.count() != 0)
 	{
 		m_groupStack.top().Items.append(ite);
-		if (!m_groupStack.top().maskName.isEmpty())
-		{
-			ite->setPatternMask(m_groupStack.top().maskName);
-			if (m_groupStack.top().alpha)
-				ite->setMaskType(3);
-			else
-				ite->setMaskType(6);
-		}
+		applyMask(ite);
 	}
 	delete imgStr;
 	delete[] buffer;
@@ -1581,14 +1474,7 @@
 				if (m_groupStack.count() != 0)
 				{
 					m_groupStack.top().Items.append(ite);
-					if (!m_groupStack.top().maskName.isEmpty())
-					{
-						ite->setPatternMask(m_groupStack.top().maskName);
-						if (m_groupStack.top().alpha)
-							ite->setMaskType(3);
-						else
-							ite->setMaskType(6);
-					}
+					applyMask(ite);
 				}
 				delete fontPath;
 			}
@@ -1599,11 +1485,7 @@
 void SlaOutputDev::beginTextObject(GfxState *state)
 {
 //	qDebug() << "Begin Text Object";
-	groupEntry gElements;
-	gElements.forSoftMask = gFalse;
-	gElements.alpha = gFalse;
-	gElements.maskName = "";
-	m_groupStack.push(gElements);
+	pushGroup();
 }
 
 void SlaOutputDev::endTextObject(GfxState *state)
@@ -1628,16 +1510,7 @@
 				m_Elements->append(tmpSel->itemAt(as));
 			}
 			if (m_groupStack.count() != 0)
-			{
-				if (!m_groupStack.top().maskName.isEmpty())
-				{
-					ite->setPatternMask(m_groupStack.top().maskName);
-					if (m_groupStack.top().alpha)
-						ite->setMaskType(3);
-					else
-						ite->setMaskType(6);
-				}
-			}
+				applyMask(ite);
 		}
 		if (m_groupStack.count() != 0)
 		{
@@ -1851,3 +1724,37 @@
 	return mode;
 }
 
+void SlaOutputDev::applyMask(PageItem *ite)
+{
+	if (m_groupStack.count() != 0)
+	{
+		if (!m_groupStack.top().maskName.isEmpty())
+		{
+			ite->setPatternMask(m_groupStack.top().maskName);
+			if (m_groupStack.top().alpha)
+			{
+				if (m_groupStack.top().inverted)
+					ite->setMaskType(8);
+				else
+					ite->setMaskType(3);
+			}
+			else
+			{
+				if (m_groupStack.top().inverted)
+					ite->setMaskType(7);
+				else
+					ite->setMaskType(6);
+			}
+		}
+	}
+}
+
+void SlaOutputDev::pushGroup(QString maskName, GBool forSoftMask, GBool alpha, bool inverted)
+{
+	groupEntry gElements;
+	gElements.forSoftMask = forSoftMask;
+	gElements.alpha = alpha;
+	gElements.inverted = inverted;
+	gElements.maskName = maskName;
+	m_groupStack.push(gElements);
+}

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h Sat Jul 30 09:09:55 2011
@@ -162,6 +162,8 @@
 	QString getColor(GfxColorSpace *color_space, GfxColor *color);
 	QString convertPath(GfxPath *path);
 	int getBlendMode(GfxState *state);
+	void applyMask(PageItem *ite);
+	void pushGroup(QString maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
 	bool pathIsClosed;
 	bool firstLayer;
 	QString CurrColorFill;
@@ -184,6 +186,7 @@
 		GBool forSoftMask;
 		GBool alpha;
 		QString maskName;
+		bool inverted;
 	};
 	QStack<groupEntry> m_groupStack;
 	QString m_currentMask;

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sat Jul 30 09:09:55 2011
@@ -13,6 +13,7 @@
 #include <cairo.h>
 
 #include <math.h>
+#include <QDebug>
 
 ScPainter::ScPainter( QImage *target, unsigned int w, unsigned int h, double transparency, int blendmode )
 {
@@ -132,7 +133,7 @@
 			cairo_pattern_t *patM = getMaskPattern();
 			setRasterOp(m_blendMode);
 			cairo_mask(m_cr, patM);
-			if ((maskMode == 2) || (maskMode == 4))
+			if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 				cairo_surface_destroy(imageMask);
 			cairo_pattern_destroy(patM);
 		}
@@ -370,7 +371,7 @@
 			{
 				cairo_pattern_t *patM = getMaskPattern();
 				cairo_mask(m_cr, patM);
-				if ((maskMode == 2) || (maskMode == 4))
+				if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 					cairo_surface_destroy(imageMask);
 				cairo_pattern_destroy(patM);
 			}
@@ -383,7 +384,7 @@
 			{
 				cairo_pattern_t *patM = getMaskPattern();
 				cairo_mask(m_cr, patM);
-				if ((maskMode == 2) || (maskMode == 4))
+				if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 					cairo_surface_destroy(imageMask);
 				cairo_pattern_destroy(patM);
 			}
@@ -858,9 +859,11 @@
 	}
 	else
 	{
-		if (maskMode == 4)
+		if ((maskMode == 4) || (maskMode == 5))
 		{
 			imageQ = m_maskPattern->pattern.copy();
+			if (maskMode == 5)
+				imageQ.invertPixels();
 			int h = imageQ.height();
 			int w = imageQ.width();
 			int k;
@@ -883,7 +886,12 @@
 			imageMask = cairo_image_surface_create_for_data ((uchar*)imageQ.bits(), CAIRO_FORMAT_ARGB32, w, h, w*4);
 		}
 		else
-			imageMask = cairo_image_surface_create_for_data ((uchar*)m_maskPattern->getPattern()->bits(), CAIRO_FORMAT_ARGB32, m_maskPattern->getPattern()->width(), m_maskPattern->getPattern()->height(), m_maskPattern->getPattern()->width()*4);
+		{
+			imageQ = m_maskPattern->pattern.copy();
+			if (maskMode == 6)
+				imageQ.invertPixels(QImage::InvertRgba);
+			imageMask = cairo_image_surface_create_for_data ((uchar*)imageQ.bits(), CAIRO_FORMAT_ARGB32, m_maskPattern->getPattern()->width(), m_maskPattern->getPattern()->height(), m_maskPattern->getPattern()->width()*4);
+		}
 		pat = cairo_pattern_create_for_surface(imageMask);
 		cairo_pattern_set_extend(pat, CAIRO_EXTEND_REPEAT);
 		cairo_pattern_set_filter(pat, CAIRO_FILTER_GOOD);
@@ -929,7 +937,7 @@
 #endif
 				cairo_clip_preserve(m_cr);
 				cairo_mask(m_cr, pat);
-				if ((maskMode == 2) || (maskMode == 4))
+				if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 					cairo_surface_destroy(imageMask);
 				cairo_pattern_destroy(pat);
 			}
@@ -1486,7 +1494,7 @@
 				setRasterOp(m_blendModeFill);
 #endif
 				cairo_mask(m_cr, patM);
-				if ((maskMode == 2) || (maskMode == 4))
+				if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 					cairo_surface_destroy(imageMask);
 				cairo_pattern_destroy (patM);
 			}
@@ -1544,7 +1552,7 @@
 				setRasterOp(m_blendModeFill);
 #endif
 				cairo_mask(m_cr, patM);
-				if ((maskMode == 2) || (maskMode == 4))
+				if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 					cairo_surface_destroy(imageMask);
 				cairo_pattern_destroy (patM);
 			}
@@ -1734,7 +1742,7 @@
 	{
 		cairo_pattern_t *patM = getMaskPattern();
 		cairo_mask(m_cr, patM);
-		if ((maskMode == 2) || (maskMode == 4))
+		if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 			cairo_surface_destroy(imageMask);
 		cairo_pattern_destroy(patM);
 	}

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jul 30 09:09:55 2011
@@ -6559,7 +6559,7 @@
 		{
 			currItem = m_Selection->itemAt(a);
 			currItem->GrMask = typ;
-			if ((typ > 0) && (typ < 7))
+			if ((typ > 0) && (typ < 9))
 				currItem->updateGradientVectors();
 			currItem->update();
 		}

Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Sat Jul 30 09:09:55 2011
@@ -112,7 +112,7 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "07";
+	QString BUILD_DAY = "30";
 	QString BUILD_MONTH = CommonStrings::july;
 	QString BUILD_YEAR = "2011";
 	QString BUILD_TIME = "";

Modified: trunk/Scribus/scribus/ui/transparencypalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/ui/transparencypalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.cpp (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.cpp Sat Jul 30 09:09:55 2011
@@ -59,6 +59,7 @@
 	connect(editPatternProps, SIGNAL(clicked()), this, SLOT(changePatternProps()));
 	connect(transpCalcGradient, SIGNAL(clicked()), this, SLOT(switchGradientMode()));
 	connect(transpCalcPattern, SIGNAL(clicked()), this, SLOT(switchPatternMode()));
+	connect(usePatternInverted, SIGNAL(clicked()), this, SLOT(switchPatternMode()));
 }
 
 void Tpalette::setCurrentItem(PageItem* item)
@@ -139,6 +140,7 @@
 	disconnect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 	disconnect(transpCalcGradient, SIGNAL(clicked()), this, SLOT(switchGradientMode()));
 	disconnect(transpCalcPattern, SIGNAL(clicked()), this, SLOT(switchPatternMode()));
+	disconnect(usePatternInverted, SIGNAL(clicked()), this, SLOT(switchPatternMode()));
 	gradEdit->setGradient(currentItem->mask_gradient);
 	if (!currentItem->gradientMask().isEmpty())
 	{
@@ -162,10 +164,13 @@
 		tabWidget->setTabEnabled(2, true);
 	transpCalcGradient->setChecked(false);
 	transpCalcPattern->setChecked(false);
+	usePatternInverted->setChecked(false);
 	if ((currentItem->GrMask == 4) || (currentItem->GrMask == 5))
 		transpCalcGradient->setChecked(true);
-	if (currentItem->GrMask == 6)
+	if ((currentItem->GrMask == 6) || (currentItem->GrMask == 7))
 		transpCalcPattern->setChecked(true);
+	if ((currentItem->GrMask == 7) || (currentItem->GrMask == 8))
+		usePatternInverted->setChecked(true);
 	if ((currentItem->GrMask == 1) || (currentItem->GrMask == 4))
 		gradientType->setCurrentIndex(0);
 	else if ((currentItem->GrMask == 2) || (currentItem->GrMask == 5))
@@ -183,6 +188,7 @@
 	connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 	connect(transpCalcGradient, SIGNAL(clicked()), this, SLOT(switchGradientMode()));
 	connect(transpCalcPattern, SIGNAL(clicked()), this, SLOT(switchPatternMode()));
+	connect(usePatternInverted, SIGNAL(clicked()), this, SLOT(switchPatternMode()));
 }
 
 void Tpalette::updateCList()
@@ -269,9 +275,19 @@
 	else if (number == 2)
 	{
 		if (transpCalcPattern->isChecked())
-			emit NewGradient(6);
-		else
-			emit NewGradient(3);
+		{
+			if (usePatternInverted->isChecked())
+				emit NewGradient(7);
+			else
+				emit NewGradient(6);
+		}
+		else
+		{
+			if (usePatternInverted->isChecked())
+				emit NewGradient(8);
+			else
+				emit NewGradient(3);
+		}
 	}
 	else
 		emit NewGradient(0);
@@ -346,10 +362,19 @@
 void Tpalette::switchPatternMode()
 {
 	if (transpCalcPattern->isChecked())
-		emit NewGradient(6);
-	else
-		emit NewGradient(3);
-
+	{
+		if (usePatternInverted->isChecked())
+			emit NewGradient(7);
+		else
+			emit NewGradient(6);
+	}
+	else
+	{
+		if (usePatternInverted->isChecked())
+			emit NewGradient(8);
+		else
+			emit NewGradient(3);
+	}
 }
 
 void Tpalette::editGradientVector()

Modified: trunk/Scribus/scribus/ui/transparencypalette.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16732&path=/trunk/Scribus/scribus/ui/transparencypalette.ui
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.ui (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.ui Sat Jul 30 09:09:55 2011
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>236</width>
-    <height>363</height>
+    <height>373</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -362,12 +362,6 @@
            <string>Pattern</string>
           </attribute>
           <layout class="QVBoxLayout" name="verticalLayout">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>5</number>
-           </property>
            <item>
             <widget class="QListWidget" name="patternBox">
              <property name="movement">
@@ -421,6 +415,13 @@
             <widget class="QCheckBox" name="transpCalcPattern">
              <property name="text">
               <string>Use Luminosity as Alpha</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="usePatternInverted">
+             <property name="text">
+              <string>Use inverted Pattern</string>
              </property>
             </widget>
            </item>




More information about the scribus-commit mailing list