r15060 by fschmid - A litte birthday present for the Scribus folks: First version of "Symbol" items similar to Illustrator.
scribus-commit
scribus-commit at lists.scribus.net
Mon May 10 23:52:23 CEST 2010
Revision: 15060
Author: fschmid
Date: 2010-05-10T21:40:44.250449Z
Commit message: A litte birthday present for the Scribus folks:
First version of "Symbol" items similar to Illustrator.
Changeset:
M /trunk/Scribus/scribus/ui/propertiespalette.cpp
M /trunk/Scribus/scribus/scribusXml.cpp
M /trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
M /trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
M /trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
M /trunk/Scribus/scribus/scribusdoc.cpp
M /trunk/Scribus/scribus/pageitem.h
M /trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
M /trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
M /trunk/Scribus/scribus/commonstrings.cpp
M /trunk/Scribus/scribus/ui/selectobjects.cpp
M /trunk/Scribus/scribus/ui/pagepalette.cpp
M /trunk/Scribus/scribus/pdflib_core.cpp
M /trunk/Scribus/scribus/pslib.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M /trunk/Scribus/scribus/ui/patterndialog.cpp
M /trunk/Scribus/scribus/scribus.cpp
M /trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
M /trunk/Scribus/scribus/pageitem_desaxe.cpp
M /trunk/Scribus/scribus/canvasmode_normal.cpp
M /trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
M /trunk/Scribus/scribus/pageitem.cpp
M /trunk/Scribus/scribus/CMakeLists.txt
M /trunk/Scribus/scribus/ui/selectobjects.ui
M /trunk/Scribus/scribus/canvasmode_legacy.cpp
M /trunk/Scribus/scribus/scribusview.cpp
M /trunk/Scribus/scribus/commonstrings.h
M /trunk/Scribus/scribus/actionmanager.cpp
M /trunk/Scribus/scribus/ui/outlinepalette.cpp
M /trunk/Scribus/scribus/ui/scrpalettebase.cpp
M /trunk/Scribus/scribus/scribus.h
M /trunk/Scribus/scribus/ui/scrapbookpalette.cpp
M /trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
M /trunk/Scribus/scribus/ui/about.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 15059)
+++ scribus/pdflib_core.cpp (revision 15060)
@@ -2471,6 +2471,76 @@
break;
case PageItem::OSGFrame:
break;
+ case PageItem::Symbol:
+ if (doc.docPatterns.contains(ite->pattern()))
+ {
+ QString tmpD = "";
+ ScPattern pat = doc.docPatterns[ite->pattern()];
+ PutPage("q\n");
+ PutPage(SetClipPath(ite));
+ PutPage("h W* n\n");
+ QTransform trans;
+ trans.translate(0.0, -ite->height());
+ trans.scale(ite->width() / pat.width, ite->height() / pat.height);
+ trans.translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
+ PutPage(FToStr(trans.m11())+" "+FToStr(trans.m12())+" "+FToStr(trans.m21())+" "+FToStr(trans.m22())+" "+FToStr(trans.dx())+" "+FToStr(trans.dy())+" cm\n");
+ QStack<PageItem*> groupStack;
+ for (int em = 0; em < pat.items.count(); ++em)
+ {
+ PageItem* embedded = pat.items.at(em);
+ if (embedded->isGroupControl)
+ {
+ tmpD += "q\n";
+ FPointArray cl = embedded->PoLine.copy();
+ FPointArray clb = embedded->PoLine.copy();
+ QTransform mm;
+ mm.translate(embedded->gXpos, -(embedded->gHeight - embedded->gYpos));
+ mm.rotate(embedded->rotation());
+ cl.map( mm );
+ embedded->PoLine = cl;
+ tmpD += SetClipPath(embedded);
+ tmpD += "h W* n\n";
+ groupStack.push(embedded->groupsLastItem);
+ embedded->PoLine = clb.copy();
+ continue;
+ }
+ tmpD += "q\n";
+ tmpD += "1 0 0 1 "+FToStr(embedded->gXpos)+" "+FToStr(embedded->gHeight - embedded->gYpos)+" cm\n";
+ QString output;
+ if (!PDF_ProcessItem(output, embedded, pag, pag->pageNr(), true))
+ return "";
+ tmpD += output;
+ tmpD += "Q\n";
+ if (groupStack.count() != 0)
+ {
+ while (embedded == groupStack.top())
+ {
+ tmpD += "Q\n";
+ groupStack.pop();
+ if (groupStack.count() == 0)
+ break;
+ }
+ }
+ }
+ for (int em = 0; em < pat.items.count(); ++em)
+ {
+ PageItem* embedded = pat.items.at(em);
+ if (!embedded->isTableItem)
+ continue;
+ if ((embedded->lineColor() == CommonStrings::None) || (embedded->lineWidth() == 0.0))
+ continue;
+ tmpD += "q\n";
+ tmpD += "1 0 0 1 "+FToStr(embedded->gXpos)+" "+FToStr(embedded->gHeight - embedded->gYpos)+" cm\n";
+ tmpD += PDF_ProcessTableItem(embedded, pag);
+ tmpD += "Q\n";
+ }
+ if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
+ PutPage(Write_TransparencyGroup(ite->fillTransparency(), ite->fillBlendmode(), tmpD, ite));
+ else
+ PutPage(tmpD);
+ PutPage("Q\n");
+ }
+ break;
case PageItem::Multiple:
Q_ASSERT(false);
break;
@@ -4201,6 +4271,76 @@
if (ite->GrMask > 0)
tmp += "Q\n";
break;
+ case PageItem::Symbol:
+ if (doc.docPatterns.contains(ite->pattern()))
+ {
+ QString tmpD = "";
+ ScPattern pat = doc.docPatterns[ite->pattern()];
+ tmp += "q\n";
+ tmp += SetClipPath(ite);
+ tmp += "h W* n\n";
+ QTransform trans;
+ trans.translate(0.0, -ite->height());
+ trans.scale(ite->width() / pat.width, ite->height() / pat.height);
+ trans.translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
+ tmp += FToStr(trans.m11())+" "+FToStr(trans.m12())+" "+FToStr(trans.m21())+" "+FToStr(trans.m22())+" "+FToStr(trans.dx())+" "+FToStr(trans.dy())+" cm\n";
+ QStack<PageItem*> groupStack;
+ for (int em = 0; em < pat.items.count(); ++em)
+ {
+ PageItem* embedded = pat.items.at(em);
+ if (embedded->isGroupControl)
+ {
+ tmpD += "q\n";
+ FPointArray cl = embedded->PoLine.copy();
+ FPointArray clb = embedded->PoLine.copy();
+ QTransform mm;
+ mm.translate(embedded->gXpos, -(embedded->gHeight - embedded->gYpos));
+ mm.rotate(embedded->rotation());
+ cl.map( mm );
+ embedded->PoLine = cl;
+ tmpD += SetClipPath(embedded);
+ tmpD += "h W* n\n";
+ groupStack.push(embedded->groupsLastItem);
+ embedded->PoLine = clb.copy();
+ continue;
+ }
+ tmpD += "q\n";
+ tmpD += "1 0 0 1 "+FToStr(embedded->gXpos)+" "+FToStr(embedded->gHeight - embedded->gYpos)+" cm\n";
+ QString output;
+ if (!PDF_ProcessItem(output, embedded, pag, PNr, true))
+ return "";
+ tmpD += output;
+ tmpD += "Q\n";
+ if (groupStack.count() != 0)
+ {
+ while (embedded == groupStack.top())
+ {
+ tmpD += "Q\n";
+ groupStack.pop();
+ if (groupStack.count() == 0)
+ break;
+ }
+ }
+ }
+ for (int em = 0; em < pat.items.count(); ++em)
+ {
+ PageItem* embedded = pat.items.at(em);
+ if (!embedded->isTableItem)
+ continue;
+ if ((embedded->lineColor() == CommonStrings::None) || (embedded->lineWidth() == 0.0))
+ continue;
+ tmpD += "q\n";
+ tmpD += "1 0 0 1 "+FToStr(embedded->gXpos)+" "+FToStr(embedded->gHeight - embedded->gYpos)+" cm\n";
+ tmpD += PDF_ProcessTableItem(embedded, pag);
+ tmpD += "Q\n";
+ }
+ if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
+ tmp += Write_TransparencyGroup(ite->fillTransparency(), ite->fillBlendmode(), tmpD, ite);
+ else
+ tmp += tmpD;
+ tmp += "Q\n";
+ }
+ break;
case PageItem::Multiple:
Q_ASSERT(false);
break;
@@ -5773,6 +5913,14 @@
ResCount++;
QString tmp;
QString GXName;
+ double scaleX = 1.0;
+ double scaleY = 1.0;
+ if (currItem->itemType() == PageItem::Symbol)
+ {
+ ScPattern pat = doc.docPatterns[currItem->pattern()];
+ scaleX = 1.0 / (currItem->width() / pat.width);
+ scaleY = 1.0 / (currItem->height() / pat.height);
+ }
if ((currItem->GrMask == 1) || (currItem->GrMask == 2) || (currItem->GrMask == 4) || (currItem->GrMask == 5))
{
QList<double> StopVec;
@@ -5795,8 +5943,17 @@
TransVec.clear();
QTransform mpa;
if (currItem->isGroupControl)
+ {
mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
- mpa.rotate(-currItem->rotation());
+ mpa.rotate(-currItem->rotation());
+ }
+ else if (currItem->itemType() == PageItem::Symbol)
+ {
+ mpa.translate(0, currItem->height() * scaleY);
+ mpa.scale(scaleX, scaleY);
+ }
+ else
+ mpa.rotate(-currItem->rotation());
if (Gskew == 90)
Gskew = 1;
else if (Gskew == 180)
@@ -5912,7 +6069,7 @@
PutDoc("/FormType 1\n");
PutDoc("/Group << /S /Transparency /CS /DeviceGray >>\n");
double lw = currItem->lineWidth();
- if (currItem->isGroupControl)
+ if ((currItem->isGroupControl) || (currItem->itemType() == PageItem::Symbol))
PutDoc("/BBox [0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" ]\n");
else
PutDoc("/BBox ["+FToStr(-lw / 2.0)+" "+FToStr(lw / 2.0)+" "+FToStr(currItem->width()+lw)+" "+FToStr(-(currItem->height()+lw))+" ]\n");
@@ -5934,6 +6091,13 @@
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)
+ {
+ QTransform mpa;
+ mpa.translate(0, currItem->height() * scaleY);
+ 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";
+ }
stre += SetClipPath(currItem)+"h\n";
stre += FToStr(fabs(currItem->lineWidth()))+" w\n";
stre += "/Pattern cs\n";
@@ -5949,7 +6113,7 @@
ResCount++;
GXName = ResNam+QString::number(ResCount);
ResCount++;
- Transpar[GXName] = writeGState("/SMask << /S /Luminosity /G "+QString::number(formObject)+" 0 R >>\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
+ 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))
@@ -5976,7 +6140,7 @@
}
}
PutDoc(" >>\n");
- if (currItem->isGroupControl)
+ if ((currItem->isGroupControl) || (currItem->itemType() == PageItem::Symbol))
PutDoc("/BBox [0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" ]\n");
else
PutDoc("/BBox [0 0 "+FToStr(currItem->width())+" "+FToStr(-(currItem->height()))+" ]\n");
@@ -5998,6 +6162,13 @@
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)
+ {
+ QTransform mpa;
+ mpa.translate(0, currItem->height() * scaleY);
+ 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";
+ }
stre += SetClipPath(currItem)+"h\n";
stre += FToStr(fabs(currItem->lineWidth()))+" w\n";
stre += tmpOut+" f*\n";
@@ -6188,6 +6359,14 @@
PutDoc("/PaintType 1\n");
PutDoc("/TilingType 1\n");
PutDoc("/BBox [ 0 0 "+FToStr(pat->width)+" "+FToStr(pat->height)+" ]\n");
+ double scaleX = 1.0;
+ double scaleY = 1.0;
+ if (currItem->itemType() == PageItem::Symbol)
+ {
+ ScPattern pat = doc.docPatterns[currItem->pattern()];
+ scaleX = 1.0 / (currItem->width() / pat.width);
+ scaleY = 1.0 / (currItem->height() / pat.height);
+ }
QTransform mpa;
if ((inPattern == 0) && (kind != 2))
{
@@ -6213,13 +6392,21 @@
mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
mpa.rotate(-currItem->rotation());
}
+ else if (currItem->itemType() == PageItem::Symbol)
+ {
+ mpa.translate(0, currItem->height() * scaleY);
+ mpa.scale(scaleX, scaleY);
+ }
currItem->maskTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
currItem->maskFlip(mirrorX, mirrorY);
}
if (kind == 1)
mpa.translate(-currItem->lineWidth() / 2.0, currItem->lineWidth() / 2.0);
mpa.translate(patternOffsetX, -patternOffsetY);
- mpa.rotate(-patternRotation);
+ if (currItem->itemType() == PageItem::Symbol)
+ mpa.rotate(patternRotation);
+ else
+ mpa.rotate(-patternRotation);
mpa.shear(patternSkewX, -patternSkewY);
mpa.scale(pat->scaleX, pat->scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
Index: scribus/canvasmode_legacy.cpp
===================================================================
--- scribus/canvasmode_legacy.cpp (revision 15059)
+++ scribus/canvasmode_legacy.cpp (revision 15060)
@@ -565,9 +565,10 @@
QDrag* dr = new QDrag(m_view);
dr->setMimeData(md);
const QPixmap& pm = loadIcon("DragPix.xpm");
- dr->setDragCursor(pm, Qt::CopyAction);
- dr->setDragCursor(pm, Qt::MoveAction);
- dr->setDragCursor(pm, Qt::LinkAction);
+ dr->setPixmap(pm);
+ // dr->setDragCursor(pm, Qt::CopyAction);
+ // dr->setDragCursor(pm, Qt::MoveAction);
+ // dr->setDragCursor(pm, Qt::LinkAction);
dr->exec();
// QImage drImg = currItem->DrawObj_toImage();
// QPixmap pm;
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp (revision 15059)
+++ scribus/scribusdoc.cpp (revision 15060)
@@ -54,6 +54,7 @@
#ifdef HAVE_OSG
#include "pageitem_osgframe.h"
#endif
+#include "pageitem_symbol.h"
#include "ui/pagepalette.h"
#include "pagesize.h"
#include "pagestructs.h"
@@ -2804,7 +2805,7 @@
QStringList results;
for (int c = 0; c < MasterItems.count(); ++c)
{
- if ((!results.contains(MasterItems.at(c)->pattern())) && (MasterItems.at(c)->GrType == 8))
+ if ((!results.contains(MasterItems.at(c)->pattern())) && ((MasterItems.at(c)->GrType == 8) || (MasterItems.at(c)->itemType() == PageItem::Symbol)))
results.append(MasterItems.at(c)->pattern());
if (!MasterItems.at(c)->strokePattern().isEmpty())
{
@@ -2819,7 +2820,7 @@
}
for (int c = 0; c < DocItems.count(); ++c)
{
- if ((!results.contains(DocItems.at(c)->pattern())) && (DocItems.at(c)->GrType == 8))
+ if ((!results.contains(DocItems.at(c)->pattern())) && ((DocItems.at(c)->GrType == 8) || (DocItems.at(c)->itemType() == PageItem::Symbol)))
results.append(DocItems.at(c)->pattern());
if (!DocItems.at(c)->strokePattern().isEmpty())
{
@@ -2834,7 +2835,7 @@
}
for (int c = 0; c < FrameItems.count(); ++c)
{
- if ((!results.contains(FrameItems.at(c)->pattern())) && (FrameItems.at(c)->GrType == 8))
+ if ((!results.contains(FrameItems.at(c)->pattern())) && ((FrameItems.at(c)->GrType == 8) || (FrameItems.at(c)->itemType() == PageItem::Symbol)))
results.append(FrameItems.at(c)->pattern());
if (!FrameItems.at(c)->strokePattern().isEmpty())
{
@@ -2866,7 +2867,7 @@
for (uint a = 0; a < selectedItemCount; ++a)
{
PageItem *currItem = customSelection->itemAt(a);
- if (currItem->GrType == 8)
+ if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
{
const QString& pat = currItem->pattern();
if (!pat.isEmpty() && !results.contains(pat))
@@ -2899,7 +2900,7 @@
pats.clear();
for (int c = 0; c < pat->items.count(); ++c)
{
- if (pat->items.at(c)->GrType == 8)
+ if ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol))
{
const QString& patName = pat->items.at(c)->pattern();
if (!patName.isEmpty() && !results.contains(patName))
@@ -3871,6 +3872,10 @@
case PageItem::PolyLine:
z = itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2, true);
break;
+ case PageItem::Symbol:
+ z = itemAdd(PageItem::Symbol, PageItem::Unspecified, x, y, w, h, 0, CommonStrings::None, CommonStrings::None, true);
+ Items->at(z)->setPattern(Buffer->pattern);
+ break;
case PageItem::Multiple:
Q_ASSERT(false);
break;
@@ -4221,6 +4226,10 @@
Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
break;
#endif
+ case PageItem::Symbol:
+ newItem = new PageItem_Symbol(this, x, y, b, h, w, CommonStrings::None, CommonStrings::None);
+ Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
+ break;
default:
// qDebug() << "unknown item type";
assert (false);
@@ -4447,13 +4456,14 @@
newItem->ClipEdited = true;
break;
case PageItem::PathText:
+ case PageItem::Symbol:
//At this point, we cannot create a PathText item like this, only by conversion, do nothing
break;
default:
break;
}
- if (frameType==PageItem::Rectangle || itemType==PageItem::TextFrame || itemType==PageItem::ImageFrame || itemType==PageItem::LatexFrame || itemType==PageItem::OSGFrame)
+ if (frameType==PageItem::Rectangle || itemType==PageItem::TextFrame || itemType==PageItem::ImageFrame || itemType==PageItem::LatexFrame || itemType==PageItem::OSGFrame || itemType==PageItem::Symbol)
{
newItem->SetRectFrame();
//TODO one day hopefully, if(ScCore->usingGUI())
Index: scribus/scribusXml.cpp
===================================================================
--- scribus/scribusXml.cpp (revision 15059)
+++ scribus/scribusXml.cpp (revision 15060)
@@ -169,6 +169,8 @@
OB->ColGap = attrAsDbl(attrs, "COLGAP" , 0.0);
OB->GrType = attrAsInt(attrs, "GRTYP" , 0);
OB->fill_gradient.clearStops();
+ if (OB->PType == PageItem::Symbol)
+ OB->pattern = attrAsString(attrs, "pattern", "");
if (OB->GrType != 0)
{
if (OB->GrType == 8)
@@ -2756,6 +2758,8 @@
writer.writeAttribute("LatexUsePreamble", QString::number(static_cast<int>(latexitem->usePreamble())));
writer.writeTextElement("LATEX-SOURCE", item->asLatexFrame()->formula());
}
+ if (item->asSymbolFrame())
+ writer.writeAttribute("pattern", item->pattern());
#ifdef HAVE_OSG
if (item->asOSGFrame())
{
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h (revision 15059)
+++ scribus/pageitem.h (revision 15060)
@@ -69,6 +69,7 @@
class PageItem_TextFrame;
class PageItem_PathText;
class PageItem_LatexFrame;
+class PageItem_Symbol;
#ifdef HAVE_OSG
class PageItem_OSGFrame;
#endif
@@ -163,8 +164,9 @@
Polygon = 6,
PolyLine = 7,
PathText = 8,
- LatexFrame = 9,
- OSGFrame = 10,
+ LatexFrame = 9,
+ OSGFrame = 10,
+ Symbol = 11,
Multiple = 99
};
@@ -191,6 +193,7 @@
#ifdef HAVE_OSG
virtual PageItem_OSGFrame * asOSGFrame() { return NULL; }
#endif
+ virtual PageItem_Symbol * asSymbolFrame() { return NULL; }
virtual bool isImageFrame() const { return false; }
virtual bool isLine() const { return false; }
@@ -200,6 +203,7 @@
virtual bool isTextFrame() const { return false; }
virtual bool isLatexFrame() const { return false; }
virtual bool isOSGFrame() const { return false; }
+ virtual bool isSymbol() const { return false; }
/** @brief Frame Type
*
Index: scribus/commonstrings.cpp
===================================================================
--- scribus/commonstrings.cpp (revision 15059)
+++ scribus/commonstrings.cpp (revision 15060)
@@ -54,6 +54,7 @@
QString CommonStrings::itemType_PathText = "";
QString CommonStrings::itemType_LatexFrame = "";
QString CommonStrings::itemType_OSGFrame = "";
+QString CommonStrings::itemType_Symbol = "";
QString CommonStrings::itemType_Multiple = "";
QString CommonStrings::itemSubType_PDF_PushButton;
@@ -275,6 +276,7 @@
CommonStrings::itemType_PathText = tr("Text on a Path");
CommonStrings::itemType_LatexFrame = tr("Render Frame");
CommonStrings::itemType_OSGFrame = tr("PDF 3D Annotation");
+ CommonStrings::itemType_Symbol = tr("Symbol");
CommonStrings::itemType_Multiple = tr("Multiple", "Multiple frame types");
CommonStrings::itemSubType_PDF_PushButton = tr("PDF Push Button");
CommonStrings::itemSubType_PDF_TextField = tr("PDF Text Field");
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 15059)
+++ scribus/pageitem.cpp (revision 15060)
@@ -543,6 +543,10 @@
AnName = tr("PathText");
setUPixmap(Um::IPathText);
break;
+ case Symbol:
+ AnName = tr("Symbol");
+ setUPixmap(Um::IPolygon);
+ break;
default:
AnName = "Item";
break;
@@ -1545,7 +1549,7 @@
p->endLayer();
#endif
p->setMaskMode(0);
- if (itemType()==PathText || itemType()==PolyLine || itemType()==Line)
+ if (itemType()==PathText || itemType()==PolyLine || itemType()==Line || itemType()==Symbol)
doStroke=false;
if ((doStroke) && (!m_Doc->RePos))
{
@@ -1877,6 +1881,7 @@
case OSGFrame:
case Polygon:
case PathText:
+ case Symbol:
embedded->DrawObj_Item(p, cullingArea);
break;
case Line:
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp (revision 15059)
+++ scribus/scribusview.cpp (revision 15060)
@@ -113,6 +113,7 @@
#include "serializer.h"
#include "stencilreader.h"
#include "ui/storyeditor.h"
+#include "ui/symbolpalette.h"
#include "text/nlsconfig.h"
#include "undomanager.h"
#include "units.h"
@@ -784,6 +785,7 @@
// e->accept(Q3TextDrag::canDecode(e));
e->accept();
DraggedGroupFirst = false;
+ bool selectedItemByDrag=false;
FPoint dropPosDoc = m_canvas->globalToCanvas(widget()->mapToGlobal(e->pos()));
QPointF dropPosDocQ(dropPosDoc.x(), dropPosDoc.y());
// int ex = qRound(e->pos().x()/m_canvas->scale());// + Doc->minCanvasCoordinate.x());
@@ -804,6 +806,50 @@
url = e->mimeData()->urls().at(0);
text = "";
}
+ else if (e->mimeData()->hasFormat("text/symbol"))
+ {
+ e->acceptProposedAction();
+ activateWindow();
+ if (!m_ScMW->scriptIsRunning())
+ raise();
+ m_ScMW->newActWin(((ScribusWin*)(Doc->WinHan))->getSubWin());
+ updateContents();
+ QString patternVal = e->mimeData()->data("text/symbol");
+ Doc->m_Selection->delaySignalsOn();
+ for (int i = Doc->Items->count() - 1; i >= 0 ; --i)
+ {
+ if (Doc->Items->at(i)->LayerID==Doc->activeLayer())
+ {
+ if (m_canvas->frameHitTest(dropPosDocQ, Doc->Items->at(i)) >= Canvas::INSIDE)
+ {
+ Deselect(false);
+ Doc->m_Selection->addItem(Doc->Items->at(i));
+ Doc->Items->at(i)->setPattern(patternVal);
+ selectedItemByDrag=true;
+ break;
+ }
+ }
+ }
+ Doc->m_Selection->delaySignalsOff();
+ if (!selectedItemByDrag)
+ {
+ int z = Doc->itemAdd(PageItem::Symbol, PageItem::Unspecified, dropPosDoc.x(), dropPosDoc.y(), 1, 1, 0, CommonStrings::None, CommonStrings::None, true);
+ PageItem *b = Doc->Items->at(z);
+ b->LayerID = Doc->activeLayer();
+ ScPattern pat = Doc->docPatterns[patternVal];
+ b->setWidth(pat.width);
+ b->setHeight(pat.height);
+ b->OldB2 = b->width();
+ b->OldH2 = b->height();
+ b->setPattern(patternVal);
+ b->updateClip();
+ Deselect(false);
+ Doc->m_Selection->addItem(b);
+ }
+ emit DocChanged();
+ update();
+ return;
+ }
// qDebug() << "ScribusView::contentsDropEvent" << e->mimeData()->formats() << url;
if (!url.isEmpty())
{
@@ -827,7 +873,6 @@
ext = "JPEG";
//CB Need to handle this ugly file extension list elsewhere... some capabilities class perhaps
img = ((imfo.contains(ext)) || extensionIndicatesPDF(ext) || extensionIndicatesEPSorPS(ext) || extensionIndicatesTIFF(ext) || extensionIndicatesJPEG(ext) || extensionIndicatesPSD(ext));
- bool selectedItemByDrag=false;
// int pscx=qRound(e->pos().x()/m_canvas->scale()), pscy=qRound(e->pos().y()/m_canvas->scale());
//Loop through all items and see which one(s) were under the drop point on the current layer
//Should make a nice function for this.
@@ -992,6 +1037,7 @@
Doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
Doc->moveGroup(dropPosDoc.x() - x2, dropPosDoc.y() - y2);
m_ScMW->propertiesPalette->updateColorList();
+ m_ScMW->symbolPalette->updateSymbolList();
m_ScMW->propertiesPalette->paraStyleCombo->updateFormatList();
m_ScMW->propertiesPalette->charStyleCombo->updateFormatList();
m_ScMW->propertiesPalette->SetLineFormats(Doc);
Index: scribus/commonstrings.h
===================================================================
--- scribus/commonstrings.h (revision 15059)
+++ scribus/commonstrings.h (revision 15060)
@@ -115,6 +115,7 @@
static QString itemType_PathText;
static QString itemType_LatexFrame;
static QString itemType_OSGFrame;
+ static QString itemType_Symbol;
static QString itemType_Multiple;
static QString itemSubType_PDF_PushButton;
Index: scribus/actionmanager.cpp
===================================================================
--- scribus/actionmanager.cpp (revision 15059)
+++ scribus/actionmanager.cpp (revision 15060)
@@ -683,6 +683,8 @@
scrActions->insert(name, new ScrAction(loadIcon("16/preflight-verifier.png"), loadIcon("22/preflight-verifier.png"),"", defaultKey(name), mainWindow));
name="toolsAlignDistribute";
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+ name="toolsSymbols";
+ scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="toolsToolbarTools";
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="toolsToolbarPDF";
@@ -758,6 +760,7 @@
(*scrActions)["toolsActionHistory"]->setShortcutContext(Qt::ApplicationShortcut);
(*scrActions)["toolsPreflightVerifier"]->setShortcutContext(Qt::ApplicationShortcut);
(*scrActions)["toolsAlignDistribute"]->setShortcutContext(Qt::ApplicationShortcut);
+ (*scrActions)["toolsSymbols"]->setShortcutContext(Qt::ApplicationShortcut);
(*scrActions)["toolsProperties"]->setToggleAction(true);
@@ -770,6 +773,7 @@
(*scrActions)["toolsActionHistory"]->setToggleAction(true);
(*scrActions)["toolsPreflightVerifier"]->setToggleAction(true);
(*scrActions)["toolsAlignDistribute"]->setToggleAction(true);
+ (*scrActions)["toolsSymbols"]->setToggleAction(true);
(*scrActions)["toolsToolbarTools"]->setToggleAction(true);
(*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
@@ -1450,6 +1454,7 @@
(*scrActions)["toolsActionHistory"]->setTexts( tr("Action &History"));
(*scrActions)["toolsPreflightVerifier"]->setTexts( tr("Preflight &Verifier"));
(*scrActions)["toolsAlignDistribute"]->setTexts( tr("&Align and Distribute"));
+ (*scrActions)["toolsSymbols"]->setTexts( tr("Symbols"));
(*scrActions)["toolsToolbarTools"]->setTexts( tr("&Tools"));
(*scrActions)["toolsToolbarPDF"]->setTexts( tr("P&DF Tools"));
@@ -1865,7 +1870,7 @@
itmenu->second << "extrasManageImages" << "extrasHyphenateText" << "extrasDeHyphenateText" << "extrasGenerateTableOfContents";
//Windows
++itmenu;
- itmenu->second << "windowsCascade" << "windowsTile" << "toolsProperties" << "toolsOutline" << "toolsScrapbook" << "toolsLayers" << "toolsPages" << "toolsBookmarks" << "toolsMeasurements" << "toolsActionHistory" << "toolsPreflightVerifier" << "toolsAlignDistribute" << "toolsToolbarTools" << "toolsToolbarPDF";
+ itmenu->second << "windowsCascade" << "windowsTile" << "toolsProperties" << "toolsOutline" << "toolsScrapbook" << "toolsLayers" << "toolsPages" << "toolsBookmarks" << "toolsMeasurements" << "toolsActionHistory" << "toolsPreflightVerifier" << "toolsAlignDistribute" << "toolsSymbols" << "toolsToolbarTools" << "toolsToolbarPDF";
//Help
++itmenu;
itmenu->second << "helpAboutScribus" << "helpAboutPlugins" << "helpAboutQt" << "helpTooltips" << "helpManual" << "helpOnlineWWW" << "helpOnlineDocs" << "helpOnlineWiki" << "helpOnlineTutorial1" << "helpCheckUpdates";
Index: scribus/ui/patterndialog.cpp
===================================================================
--- scribus/ui/patterndialog.cpp (revision 15059)
+++ scribus/ui/patterndialog.cpp (revision 15060)
@@ -503,7 +503,7 @@
pats.clear();
for (int c = 0; c < pat->items.count(); ++c)
{
- if ((!results.contains(pat->items.at(c)->pattern())) && (pat->items.at(c)->GrType == 8))
+ if ((!results.contains(pat->items.at(c)->pattern())) && ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol)))
pats.append(pat->items.at(c)->pattern());
}
if (!pats.isEmpty())
Index: scribus/ui/pagepalette.cpp
===================================================================
--- scribus/ui/pagepalette.cpp (revision 15059)
+++ scribus/ui/pagepalette.cpp (revision 15060)
@@ -100,8 +100,9 @@
QDrag *dr = new QDrag(this);
dr->setMimeData(mimeData);
const QPixmap& pm = loadIcon("doc.png");
- dr->setDragCursor(pm, Qt::CopyAction);
- dr->setDragCursor(pm, Qt::MoveAction);
+ dr->setPixmap(pm);
+ // dr->setDragCursor(pm, Qt::CopyAction);
+ // dr->setDragCursor(pm, Qt::MoveAction);
dr->exec(Qt::CopyAction | Qt::MoveAction);
QApplication::setOverrideCursor(Qt::ArrowCursor);
}
@@ -208,8 +209,9 @@
QDrag *dr = new QDrag(this);
dr->setMimeData(mimeData);
const QPixmap& pm = loadIcon("doc.png");
- dr->setDragCursor(pm, Qt::CopyAction);
- dr->setDragCursor(pm, Qt::MoveAction);
+ dr->setPixmap(pm);
+ // dr->setDragCursor(pm, Qt::CopyAction);
+ // dr->setDragCursor(pm, Qt::MoveAction);
dr->exec(Qt::CopyAction | Qt::MoveAction);
QApplication::setOverrideCursor(Qt::ArrowCursor);
}
Index: scribus/ui/about.cpp
===================================================================
--- scribus/ui/about.cpp (revision 15059)
+++ scribus/ui/about.cpp (revision 15060)
@@ -114,7 +114,7 @@
buildID = new QLabel( tab );
buildID->setAlignment(Qt::AlignCenter);
buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
- QString BUILD_DAY = " 2";
+ QString BUILD_DAY = "10";
QString BUILD_MONTH = CommonStrings::may;
QString BUILD_YEAR = "2010";
QString BUILD_TIME = "";
Index: scribus/ui/selectobjects.cpp
===================================================================
--- scribus/ui/selectobjects.cpp (revision 15059)
+++ scribus/ui/selectobjects.cpp (revision 15060)
@@ -89,6 +89,8 @@
Type = 8;
else if (Type == 6)
Type = 9;
+ else if (Type == 7)
+ Type = 11;
}
if (useFillColor->isChecked())
{
Index: scribus/ui/scrpalettebase.cpp
===================================================================
--- scribus/ui/scrpalettebase.cpp (revision 15059)
+++ scribus/ui/scrpalettebase.cpp (revision 15060)
@@ -55,14 +55,14 @@
{
if (PrefsManager::instance()->appPrefs.uiPrefs.useSmallWidgets)
{
- setStyleSheet(" QToolButton { margin: 0px; padding: 0px; font-size: 10px; } \
+ setStyleSheet(" QToolButton { margin: 1px; padding: 0px; font-size: 10px; } \
QToolButton:pressed { padding-top: 2px; padding-left: 2px } \
- QPushButton { margin: 0px; padding: 0px; font-size: 10px; } \
+ QPushButton { margin: 1px; padding: 0px; font-size: 10px; } \
QPushButton:pressed { padding-top: 2px; padding-left: 2px } \
QRadioButton, QComboBox, QLineEdit \
- QListView, QLabel { margin:0px; padding: 0px; font-size: 10px; } \
+ QListView, QLabel { margin:1px; padding: 0px; font-size: 10px; } \
QCheckBox, QSpinBox, QDoubleSpinBox \
- { margin:0px; padding: 0px; font-size: 10px; } \
+ { margin:1px; padding: 0px; font-size: 10px; } \
QTabWidget, QTabBar, QTableView, QGroupBox, QTreeView \
{ font-size: 10px ; } \
QToolBox::tab { font-size: 10px; padding: 0px; margin: 0px; } \
Index: scribus/ui/scrapbookpalette.cpp
===================================================================
--- scribus/ui/scrapbookpalette.cpp (revision 15059)
+++ scribus/ui/scrapbookpalette.cpp (revision 15060)
@@ -116,7 +116,8 @@
}
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
- drag->setDragCursor(objectMap[currentItem()->text()].Preview, Qt::CopyAction);
+ drag->setPixmap(objectMap[currentItem()->text()].Preview);
+// drag->setDragCursor(objectMap[currentItem()->text()].Preview, Qt::CopyAction);
drag->exec(Qt::CopyAction);
clearSelection();
}
Index: scribus/ui/selectobjects.ui
===================================================================
--- scribus/ui/selectobjects.ui (revision 15059)
+++ scribus/ui/selectobjects.ui (revision 15060)
@@ -1,74 +1,75 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>selectDialog</class>
- <widget class="QDialog" name="selectDialog" >
- <property name="geometry" >
+ <widget class="QDialog" name="selectDialog">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>513</width>
- <height>402</height>
+ <width>423</width>
+ <height>321</height>
</rect>
</property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Select All Items</string>
</property>
- <property name="modal" >
+ <property name="modal">
<bool>true</bool>
</property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>5</number>
</property>
- <property name="margin" >
+ <property name="margin">
<number>10</number>
</property>
<item>
- <widget class="QGroupBox" name="rangeGroup" >
- <property name="title" >
+ <widget class="QGroupBox" name="rangeGroup">
+ <property name="title">
<string>Select All Items</string>
</property>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>5</number>
</property>
- <property name="margin" >
+ <property name="margin">
<number>10</number>
</property>
<item>
- <widget class="QRadioButton" name="buttonCurrentPage" >
- <property name="toolTip" >
+ <widget class="QRadioButton" name="buttonCurrentPage">
+ <property name="toolTip">
<string>Select all items on the current page</string>
</property>
- <property name="text" >
+ <property name="text">
<string>on Current Page</string>
</property>
- <property name="checked" >
+ <property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QRadioButton" name="buttonCurrentLayer" >
- <property name="toolTip" >
+ <widget class="QRadioButton" name="buttonCurrentLayer">
+ <property name="toolTip">
<string>Select all items on the current layer on all pages</string>
</property>
- <property name="text" >
+ <property name="text">
<string>on Current Layer</string>
</property>
</widget>
</item>
<item>
- <widget class="QRadioButton" name="buttonWorkspace" >
- <property name="toolTip" >
+ <widget class="QRadioButton" name="buttonWorkspace">
+ <property name="toolTip">
<string>Select all items not on a page</string>
</property>
- <property name="text" >
+ <property name="text">
<string>on the Scratch Space</string>
</property>
</widget>
@@ -77,203 +78,208 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="attributeGroup" >
- <property name="toolTip" >
+ <widget class="QGroupBox" name="attributeGroup">
+ <property name="toolTip">
<string>Narrow the selection of items based on various item properties</string>
</property>
- <property name="title" >
+ <property name="title">
<string>With the Following Attributes</string>
</property>
- <property name="checkable" >
+ <property name="checkable">
<bool>true</bool>
</property>
- <property name="checked" >
+ <property name="checked">
<bool>false</bool>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>10</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>5</number>
</property>
- <item row="0" column="0" >
- <widget class="QCheckBox" name="useItemType" >
- <property name="toolTip" >
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="useItemType">
+ <property name="toolTip">
<string>Select based on item type</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Item Type</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="itemTypeCombo" >
- <property name="enabled" >
+ <item row="0" column="1">
+ <widget class="QComboBox" name="itemTypeCombo">
+ <property name="enabled">
<bool>false</bool>
</property>
<item>
- <property name="text" >
+ <property name="text">
<string>Text Frame</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>Image Frame</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>Shape</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>Polyline</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>Line</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>Render Frame</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Symbol</string>
+ </property>
+ </item>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QCheckBox" name="useFillColor" >
- <property name="toolTip" >
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="useFillColor">
+ <property name="toolTip">
<string>Select based on the color that the item is filled with</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Fill Color</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="ColorCombo" name="backgroundCombo" >
- <property name="enabled" >
+ <item row="1" column="1">
+ <widget class="ColorCombo" name="backgroundCombo">
+ <property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QCheckBox" name="useLineColor" >
- <property name="toolTip" >
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="useLineColor">
+ <property name="toolTip">
<string>Select based on the color of the line or outline</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Line Color</string>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="ColorCombo" name="lineCombo" >
- <property name="enabled" >
+ <item row="2" column="1">
+ <widget class="ColorCombo" name="lineCombo">
+ <property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QCheckBox" name="useLineWidth" >
- <property name="toolTip" >
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="useLineWidth">
+ <property name="toolTip">
<string>Select based on the width of the line of the item</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Line Width</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="ScrSpinBox" name="lineWidthSpin" >
- <property name="enabled" >
+ <item row="3" column="1">
+ <widget class="ScrSpinBox" name="lineWidthSpin">
+ <property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="4" column="0" >
- <widget class="QCheckBox" name="usePrintState" >
- <property name="toolTip" >
+ <item row="4" column="0">
+ <widget class="QCheckBox" name="usePrintState">
+ <property name="toolTip">
<string>Select items based on whether they will be printed or not</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Printable</string>
</property>
</widget>
</item>
- <item row="4" column="1" >
- <widget class="QComboBox" name="printStateCombo" >
- <property name="enabled" >
+ <item row="4" column="1">
+ <widget class="QComboBox" name="printStateCombo">
+ <property name="enabled">
<bool>false</bool>
</property>
<item>
- <property name="text" >
+ <property name="text">
<string>Yes</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>No</string>
</property>
</item>
</widget>
</item>
- <item row="5" column="0" >
- <widget class="QCheckBox" name="useLockedState" >
- <property name="toolTip" >
+ <item row="5" column="0">
+ <widget class="QCheckBox" name="useLockedState">
+ <property name="toolTip">
<string>Select items based on their locked status</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Locked</string>
</property>
</widget>
</item>
- <item row="5" column="1" >
- <widget class="QComboBox" name="lockStateCombo" >
- <property name="enabled" >
+ <item row="5" column="1">
+ <widget class="QComboBox" name="lockStateCombo">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="currentIndex" >
+ <property name="currentIndex">
<number>1</number>
</property>
<item>
- <property name="text" >
+ <property name="text">
<string>Yes</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>No</string>
</property>
</item>
</widget>
</item>
- <item row="6" column="0" >
- <widget class="QCheckBox" name="useResizeState" >
- <property name="toolTip" >
+ <item row="6" column="0">
+ <widget class="QCheckBox" name="useResizeState">
+ <property name="toolTip">
<string>Select items based on whether they have their size locked or not</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Resizeable</string>
</property>
</widget>
</item>
- <item row="6" column="1" >
- <widget class="QComboBox" name="resizeStateCombo" >
- <property name="enabled" >
+ <item row="6" column="1">
+ <widget class="QComboBox" name="resizeStateCombo">
+ <property name="enabled">
<bool>false</bool>
</property>
<item>
- <property name="text" >
+ <property name="text">
<string>Yes</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>No</string>
</property>
</item>
@@ -283,11 +289,11 @@
</widget>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="standardButtons" >
+ <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
@@ -314,11 +320,11 @@
<receiver>selectDialog</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>307</x>
<y>545</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>157</x>
<y>208</y>
</hint>
@@ -330,11 +336,11 @@
<receiver>selectDialog</receiver>
<slot>reject()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>375</x>
<y>545</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>286</x>
<y>208</y>
</hint>
@@ -346,11 +352,11 @@
<receiver>itemTypeCombo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>70</x>
<y>110</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>246</x>
<y>116</y>
</hint>
@@ -362,11 +368,11 @@
<receiver>backgroundCombo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>69</x>
<y>141</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>265</x>
<y>143</y>
</hint>
@@ -378,11 +384,11 @@
<receiver>lineCombo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>52</x>
<y>175</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>243</x>
<y>179</y>
</hint>
@@ -394,11 +400,11 @@
<receiver>lineWidthSpin</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>46</x>
<y>218</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>222</x>
<y>222</y>
</hint>
@@ -410,11 +416,11 @@
<receiver>printStateCombo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>71</x>
<y>252</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>219</x>
<y>260</y>
</hint>
@@ -426,11 +432,11 @@
<receiver>lockStateCombo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>72</x>
<y>303</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>239</x>
<y>290</y>
</hint>
@@ -442,11 +448,11 @@
<receiver>resizeStateCombo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>82</x>
<y>336</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>251</x>
<y>328</y>
</hint>
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp (revision 15059)
+++ scribus/ui/propertiespalette.cpp (revision 15060)
@@ -1784,7 +1784,7 @@
TabStack->setItemEnabled(idShapeItem, false);
TabStack->setItemEnabled(idGroupItem, true);
TabStack->setItemEnabled(idLineItem, false);
- TabStack->setItemEnabled(idColorsItem, true);
+ TabStack->setItemEnabled(idColorsItem, false);
TabStack->setItemEnabled(idTextItem, false);
TabStack->setItemEnabled(idImageItem, false);
if (CurItem->FrameType == 0)
@@ -1977,6 +1977,35 @@
SCustom->setEnabled(false);
}
#endif
+ if (CurItem->asSymbolFrame())
+ {
+ TabStack->setItemEnabled(idXYZItem, true);
+ TabStack->setItemEnabled(idShapeItem, false);
+ TabStack->setItemEnabled(idGroupItem, true);
+ TabStack->setItemEnabled(idLineItem, false);
+ TabStack->setItemEnabled(idColorsItem, false);
+ TabStack->setItemEnabled(idTextItem, false);
+ TabStack->setItemEnabled(idImageItem, false);
+ TabStack->setItemEnabled(idTransparencyItem, false);
+ if (CurItem->FrameType == 0)
+ SCustom2->setIcon(SCustom2->getIconPixmap(0));
+ if (CurItem->FrameType == 1)
+ SCustom2->setIcon(SCustom2->getIconPixmap(1));
+ if (CurItem->FrameType > 3)
+ SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
+ TpalGroup->updateFromItem();
+ TpalGroup->setActPattern(i->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
+ SCustom2->setEnabled(true);
+ EditShape2->setEnabled(true);
+ SRect2->setEnabled(true);
+ textFlowDisabled2->setEnabled(true);
+ textFlowUsesFrameShape2->setEnabled(true);
+ textFlowUsesBoundingBox2->setEnabled(true);
+ textFlowUsesContourLine2->setEnabled(true);
+ textFlowUsesImageClipping2->setEnabled(false);
+ DoGroup->setEnabled(false);
+ DoUnGroup->setEnabled(false);
+ }
updateSpinBoxConstants();
connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
}
@@ -2183,6 +2212,19 @@
TabStack->setItemEnabled(idLineItem, true);
RoundRect->setEnabled(false);
break;
+ case PageItem::Symbol:
+ TabStack->setItemEnabled(idShapeItem, false);
+ TabStack->setItemEnabled(idTextItem, false);
+ TabStack->setItemEnabled(idImageItem, false);
+ TabStack->setItemEnabled(idLineItem, false);
+ TabStack->setItemEnabled(idGroupItem, true);
+ TabStack->setItemEnabled(idColorsItem, false);
+ TabStack->setItemEnabled(idTransparencyItem, false);
+ if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
+ RoundRect->setEnabled(!i->locked());
+ else
+ RoundRect->setEnabled(false);
+ break;
}
}
if (TabStack->isItemEnabled(currentTab) && (TabStack->currentIndex() != currentTab))
@@ -4013,8 +4055,8 @@
RoundRect->setEnabled(f == 0);
return;
}
- CurItem->convertTo(PageItem::Polygon);
- NewSel(6);
+// CurItem->convertTo(PageItem::Polygon);
+// NewSel(6);
RoundRect->setEnabled(f == 0);
}
}
Index: scribus/ui/outlinepalette.cpp
===================================================================
--- scribus/ui/outlinepalette.cpp (revision 15059)
+++ scribus/ui/outlinepalette.cpp (revision 15060)
@@ -136,6 +136,9 @@
case PageItem::PathText:
tipText = CommonStrings::itemType_PathText;
break;
+ case PageItem::Symbol:
+ tipText = CommonStrings::itemType_Symbol;
+ break;
default:
break;
}
@@ -482,6 +485,9 @@
case PageItem::PathText:
item->setIcon( 0, textIcon );
break;
+ case PageItem::Symbol:
+ item->setIcon( 0, polygonIcon );
+ break;
default:
break;
}
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp (revision 15059)
+++ scribus/scribus.cpp (revision 15060)
@@ -200,6 +200,7 @@
#include "stencilreader.h"
#include "ui/storyeditor.h"
#include "ui/stylemanager.h"
+#include "ui/symbolpalette.h"
#include "ui/tabcheckdoc.h"
#include "ui/tabguides.h"
#include "ui/tabmanager.h"
@@ -530,6 +531,14 @@
connect( alignDistributePalette, SIGNAL(documentChanged()), this, SLOT(slotDocCh()));
alignDistributePalette->installEventFilter(this);
+ symbolPalette = new SymbolPalette(this);
+ symbolPalette->setMainWindow(this);
+ connect( scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(setPaletteShown(bool)));
+ connect( symbolPalette, SIGNAL(paletteShown(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
+ symbolPalette->installEventFilter(this);
+ symbolPalette->hide();
+
+
undoPalette = new UndoPalette(this, "undoPalette");
undoPalette->installEventFilter(this);
undoManager->registerGui(undoPalette);
@@ -1045,6 +1054,7 @@
scrMenuMgr->addMenuItem(scrActions["toolsActionHistory"], "Windows", true);
scrMenuMgr->addMenuItem(scrActions["toolsPreflightVerifier"], "Windows", true);
scrMenuMgr->addMenuItem(scrActions["toolsAlignDistribute"], "Windows", true);
+ scrMenuMgr->addMenuItem(scrActions["toolsSymbols"], "Windows", true);
scrMenuMgr->addMenuSeparator("Windows");
scrMenuMgr->addMenuItem(scrActions["toolsToolbarTools"], "Windows", true);
scrMenuMgr->addMenuItem(scrActions["toolsToolbarPDF"], "Windows", true);
@@ -1641,6 +1651,7 @@
alignDistributePalette->hide();
guidePalette->hide();
charPalette->hide();
+ symbolPalette->hide();
// Clean up plugins, THEN save prefs to disk
ScCore->pluginManager->cleanupPlugins();
@@ -1946,6 +1957,7 @@
actionManager->connectNewViewActions(tempView);
alignDistributePalette->setDoc(tempDoc);
docCheckerPalette->clearErrorList();
+ symbolPalette->setDoc(tempDoc);
}
w->setView(tempView);
ActWin = w;
@@ -2199,6 +2211,7 @@
}
tocGenerator->setDoc(doc);
styleManager->setDoc(doc);
+ symbolPalette->setDoc(doc);
// Give plugins a chance to react on changing the current document
PluginManager& pluginManager(PluginManager::instance());
QStringList pluginNames(pluginManager.pluginNames(false));
@@ -2234,6 +2247,7 @@
guidePalette->setDoc(doc);
charPalette->setDoc(doc);
outlinePalette->setDoc(doc);
+ symbolPalette->setDoc(doc);
rebuildLayersList();
view->updateLayerMenu();
view->setLayerMenuText(doc->activeLayerName());
@@ -2419,6 +2433,7 @@
updateActiveWindowCaption(doc->DocName);
// scrActions["shade100"]->setChecked(true);
propertiesPalette->setDoc(doc);
+ symbolPalette->setDoc(doc);
propertiesPalette->Cpal->ChooseGrad(0);
// propertiesPalette->updateColorList();
pagePalette->setView(view);
@@ -2894,14 +2909,14 @@
scrActions["itemSendToPattern"]->setEnabled(true);
scrActions["itemAdjustFrameToImage"]->setEnabled(true);
scrActions["itemAdjustImageToFrame"]->setEnabled(true);
- scrActions["itemExtendedImageProperties"]->setEnabled(true);
- scrActions["itemUpdateImage"]->setEnabled(true);
- scrActions["itemPreviewLow"]->setEnabled(true);
- scrActions["itemPreviewNormal"]->setEnabled(true);
+ scrActions["itemExtendedImageProperties"]->setEnabled(false);
+ scrActions["itemUpdateImage"]->setEnabled(false);
+ scrActions["itemPreviewLow"]->setEnabled(false);
+ scrActions["itemPreviewNormal"]->setEnabled(false);
scrActions["itemPreviewFull"]->setEnabled(true);
scrActions["itemAttributes"]->setEnabled(true);
scrActions["itemPreviewLow"]->setEnabled(true);
- if (SelectedType == 6) //Polygon
+ if (SelectedType == PageItem::Polygon) //Polygon
{
scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
scrActions["itemConvertToBezierCurve"]->setEnabled(doc->appMode != modeEdit);
@@ -2910,7 +2925,7 @@
scrActions["itemConvertToPolygon"]->setEnabled(false);
scrActions["itemConvertToTextFrame"]->setEnabled(doc->appMode != modeEdit);
}
- else if (SelectedType == 7) //Polyline
+ else if (SelectedType == PageItem::PolyLine) //Polyline
{
scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
scrActions["itemConvertToBezierCurve"]->setEnabled(false);
@@ -2919,7 +2934,7 @@
scrActions["itemConvertToPolygon"]->setEnabled(doc->appMode != modeEdit);
scrActions["itemConvertToTextFrame"]->setEnabled(false);
}
- else if (SelectedType == 5) // Line
+ else if (SelectedType == PageItem::PolyLine) // Line
{
scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
scrActions["itemConvertToBezierCurve"]->setEnabled(true);
@@ -2928,6 +2943,8 @@
scrActions["itemConvertToPolygon"]->setEnabled(false);
scrActions["itemConvertToTextFrame"]->setEnabled(false);
}
+ else if (SelectedType == PageItem::Symbol)
+ scrMenuMgr->setMenuEnabled("ItemConvertTo", false);
scrActions["toolsEditContents"]->setEnabled(false);
scrActions["toolsEditWithStoryEditor"]->setEnabled(false);
scrActions["toolsUnlinkTextFrame"]->setEnabled(false);
@@ -3324,9 +3341,10 @@
QDrag* dr = new QDrag(this);
dr->setMimeData(md);
const QPixmap& dragCursor = loadIcon("DragPix.xpm");
- dr->setDragCursor(dragCursor, Qt::CopyAction);
- dr->setDragCursor(dragCursor, Qt::MoveAction);
- dr->setDragCursor(dragCursor, Qt::LinkAction);
+ dr->setPixmap(dragCursor);
+ // dr->setDragCursor(dragCursor, Qt::CopyAction);
+ // dr->setDragCursor(dragCursor, Qt::MoveAction);
+ // dr->setDragCursor(dragCursor, Qt::LinkAction);
dr->exec();
}
else
@@ -3558,6 +3576,7 @@
propertiesPalette->SetLineFormats(doc);
propertiesPalette->startArrow->rebuildList(&doc->arrowStyles());
propertiesPalette->endArrow->rebuildList(&doc->arrowStyles());
+ symbolPalette->updateSymbolList();
if (!Mpa)
{
scanDocument();
@@ -3696,6 +3715,7 @@
newActWin(ActWinOld->getSubWin());
return false;
}
+ symbolPalette->setDoc(doc);
outlinePalette->setDoc(doc);
fileLoader->informReplacementFonts();
setCurrentComboItem(view->unitSwitcher, unitGetStrFromIndex(doc->unitIndex()));
@@ -4378,6 +4398,7 @@
//<<Palettes
// propertiesPalette->NewSel(-1);
propertiesPalette->unsetDoc();
+ symbolPalette->unsetDoc();
pagePalette->setView(0);
pagePalette->Rebuild();
if (doc->appMode == modeEditClip)
@@ -4703,6 +4724,7 @@
void ScribusMainWindow::slotFileQuit()
{
propertiesPalette->unsetDoc();
+ symbolPalette->unsetDoc();
ScCore->pluginManager->savePreferences();
close();
}
@@ -4954,6 +4976,8 @@
styleManager->setDoc(doc);
propertiesPalette->unsetDoc();
propertiesPalette->setDoc(doc);
+ symbolPalette->unsetDoc();
+ symbolPalette->setDoc(doc);
doc->useRaster = savedAlignGrid;
doc->SnapGuides = savedAlignGuides;
@@ -5058,6 +5082,8 @@
styleManager->setDoc(doc);
propertiesPalette->unsetDoc();
propertiesPalette->setDoc(doc);
+ symbolPalette->unsetDoc();
+ symbolPalette->setDoc(doc);
doc->useRaster = savedAlignGrid;
doc->SnapGuides = savedAlignGuides;
@@ -6037,6 +6063,7 @@
pagePalette->setEnabled(false);
bookmarkPalette->setEnabled(false);
docCheckerPalette->setEnabled(false);
+ symbolPalette->setEnabled(false);
styleManager->setEnabled(false);
alignDistributePalette->setEnabled(false);
view->pageSelector->setEnabled(false);
@@ -6120,6 +6147,7 @@
docCheckerPalette->setEnabled(true);
styleManager->setEnabled(true);
alignDistributePalette->setEnabled(true);
+ symbolPalette->setEnabled(true);
view->pageSelector->setEnabled(true);
view->layerMenu->setEnabled(true);
// bool tmpClip = doc->EditClip; // for enabling undo if exiting shape edit mode
@@ -7749,6 +7777,7 @@
guidePalette->startup();
charPalette->startup();
styleManager->startup();
+ symbolPalette->startup();
// init the toolbars
// fileToolBar->initVisibility();
@@ -9753,6 +9782,7 @@
}
doc->addPattern(patternName, pat);
propertiesPalette->updateColorList();
+ symbolPalette->updateSymbolList();
if (outlinePalette->isVisible())
outlinePalette->BuildTree();
doc->TotalItems = oldNum;
@@ -9781,6 +9811,7 @@
doc->replaceNamedResources(colorrsc);
}
propertiesPalette->updateColorList();
+ symbolPalette->updateSymbolList();
view->DrawNew();
}
delete dia;
Index: scribus/plugins/tools/lenseffects/lenseffects.cpp
===================================================================
--- scribus/plugins/tools/lenseffects/lenseffects.cpp (revision 15059)
+++ scribus/plugins/tools/lenseffects/lenseffects.cpp (revision 15060)
@@ -75,6 +75,7 @@
m_actionInfo.notSuitableFor.append(PageItem::ImageFrame);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.needsNumObjects = 3;
}
Index: scribus/plugins/tools/pathfinder/pathfinder.cpp
===================================================================
--- scribus/plugins/tools/pathfinder/pathfinder.cpp (revision 15059)
+++ scribus/plugins/tools/pathfinder/pathfinder.cpp (revision 15060)
@@ -90,6 +90,7 @@
m_actionInfo.notSuitableFor.append(PageItem::PolyLine);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.needsNumObjects = 2;
}
Index: scribus/plugins/tools/pathconnect/pathconnect.cpp
===================================================================
--- scribus/plugins/tools/pathconnect/pathconnect.cpp (revision 15059)
+++ scribus/plugins/tools/pathconnect/pathconnect.cpp (revision 15060)
@@ -76,6 +76,7 @@
m_actionInfo.notSuitableFor.append(PageItem::Polygon);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.needsNumObjects = 2;
}
Index: scribus/plugins/tools/pathstroker/pathstroker.cpp
===================================================================
--- scribus/plugins/tools/pathstroker/pathstroker.cpp (revision 15059)
+++ scribus/plugins/tools/pathstroker/pathstroker.cpp (revision 15060)
@@ -84,6 +84,7 @@
m_actionInfo.notSuitableFor.append(PageItem::ImageFrame);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.forAppMode.append(modeNormal);
m_actionInfo.needsNumObjects = 1;
}
Index: scribus/plugins/tools/pathcut/pathcut.cpp
===================================================================
--- scribus/plugins/tools/pathcut/pathcut.cpp (revision 15059)
+++ scribus/plugins/tools/pathcut/pathcut.cpp (revision 15060)
@@ -82,6 +82,7 @@
m_actionInfo.notSuitableFor.append(PageItem::ImageFrame);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.forAppMode.append(modeNormal);
m_actionInfo.needsNumObjects = 2;
m_actionInfo.firstObjectType.append(PageItem::PolyLine);
Index: scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
===================================================================
--- scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp (revision 15059)
+++ scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp (revision 15060)
@@ -77,6 +77,7 @@
m_actionInfo.notSuitableFor.append(PageItem::ImageFrame);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.forAppMode.append(modeNormal);
m_actionInfo.needsNumObjects = 2;
m_actionInfo.firstObjectType.append(PageItem::PolyLine);
Index: scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
===================================================================
--- scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp (revision 15059)
+++ scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp (revision 15060)
@@ -78,6 +78,7 @@
m_actionInfo.notSuitableFor.append(PageItem::ImageFrame);
m_actionInfo.notSuitableFor.append(PageItem::PathText);
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.needsNumObjects = 3;
}
Index: scribus/plugins/tools/subdivide/subdivide.cpp
===================================================================
--- scribus/plugins/tools/subdivide/subdivide.cpp (revision 15059)
+++ scribus/plugins/tools/subdivide/subdivide.cpp (revision 15060)
@@ -72,6 +72,7 @@
m_actionInfo.subMenuName = tr("Path Tools");
m_actionInfo.enabledOnStartup = false;
m_actionInfo.notSuitableFor.append(PageItem::Line);
+ m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.forAppMode.append(modeEditClip);
m_actionInfo.needsNumObjects = 1;
}
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (revision 15059)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (revision 15060)
@@ -1165,6 +1165,8 @@
docu.writeAttribute("gYpos", item->gYpos);
docu.writeAttribute("gWidth", item->gWidth);
docu.writeAttribute("gHeight", item->gHeight);
+ if (item->itemType() == PageItem::Symbol)
+ docu.writeAttribute("pattern", item->pattern());
if (item->GrType != 0)
{
if (item->GrType == 8)
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp (revision 15059)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp (revision 15060)
@@ -2495,6 +2495,13 @@
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
+ case PageItem::Symbol:
+ z = doc->itemAdd(PageItem::Symbol, PageItem::Unspecified, x, y, w, h, 0, CommonStrings::None, CommonStrings::None, true);
+ currItem = doc->Items->at(z);
+ if (pagenr > -2)
+ currItem->OwnPage = pagenr;
+ currItem->setPattern( attrs.valueAsString("pattern", "") );
+ break;
case PageItem::Multiple:
Q_ASSERT(false);
break;
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h (revision 15059)
+++ scribus/scribus.h (revision 15060)
@@ -109,6 +109,7 @@
class SimpleState;
class StoryEditor;
class StyleManager;
+class SymbolPalette;
class TOCGenerator;
class UndoManager;
class UndoPalette;
@@ -221,6 +222,7 @@
LayerPalette* layerPalette;
PagePalette *pagePalette;
BookPalette *bookmarkPalette;
+ SymbolPalette *symbolPalette;
Measurements* measurementPalette;
CheckDocument * docCheckerPalette;
UndoPalette* undoPalette;
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp (revision 15059)
+++ scribus/pslib.cpp (revision 15060)
@@ -2642,6 +2642,50 @@
}
#endif
break;
+ case PageItem::Symbol:
+ if (m_Doc->docPatterns.contains(c->pattern()))
+ {
+ ScPattern pat = m_Doc->docPatterns[c->pattern()];
+ PS_save();
+ PS_translate(0, -c->height());
+ PS_scale(c->width() / pat.width, c->height() / pat.height);
+ PS_translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
+ QStack<PageItem*> groupStack;
+ for (int em = 0; em < pat.items.count(); ++em)
+ {
+ PageItem* embedded = pat.items.at(em);
+ if (embedded->isGroupControl)
+ {
+ PS_save();
+ FPointArray cl = embedded->PoLine.copy();
+ QTransform mm;
+ mm.translate(embedded->gXpos, -(embedded->gHeight - embedded->gYpos));
+ mm.rotate(embedded->rotation());
+ cl.map( mm );
+ SetClipPath(&cl);
+ PS_closepath();
+ PS_clip(true);
+ groupStack.push(embedded->groupsLastItem);
+ continue;
+ }
+ PS_save();
+ PS_translate(embedded->gXpos, embedded->gHeight - embedded->gYpos);
+ ProcessItem(m_Doc, a, embedded, PNr, sep, farb, ic, gcr, master, true);
+ PS_restore();
+ if (groupStack.count() != 0)
+ {
+ while (embedded == groupStack.top())
+ {
+ PS_restore();
+ groupStack.pop();
+ if (groupStack.count() == 0)
+ break;
+ }
+ }
+ }
+ PS_restore();
+ }
+ break;
default:
break;
}
Index: scribus/pageitem_desaxe.cpp
===================================================================
--- scribus/pageitem_desaxe.cpp (revision 15059)
+++ scribus/pageitem_desaxe.cpp (revision 15060)
@@ -184,7 +184,8 @@
const PageItem_LatexFrame *latexframe = NULL;
if (item->realItemType() == PageItem::LatexFrame)
latexframe = dynamic_cast<const PageItem_LatexFrame*>(item);
-
+ if (item->itemType() == PageItem::Symbol)
+ result.insert("pattern", item->pattern());
if ((item->itemType()==PageItem::ImageFrame || item->itemType()==PageItem::TextFrame) && (!item->externalFile().isEmpty()) && !latexframe)
{
if (item->isInlineImage)
@@ -1137,7 +1138,7 @@
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setHasRightLine, "RightLine", &parseBool ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setHasBottomLine, "BottomLine", &parseBool ));
- ruleset.addRule(Digester::concat(itemPrefix, "Pattern"), Pattern());
+ ruleset.addRule(Digester::concat(itemPrefix, "Pattern"), Pattern());
ruleset.addRule(Digester::concat(itemPrefix, "PatternStroke"), PatternStroke());
ruleset.addRule(Digester::concat(itemPrefix, "PatternMask"), PatternMask());
@@ -1168,6 +1169,7 @@
// TODO: obj attributes
+ ruleset.addRule(itemPrefix, SetAttribute<PageItem,const QString&>( & PageItem::setPattern, "pattern", dummy ));
ruleset.addRule(itemPrefix, SetAttribute<PageItem,QString>( & PageItem::setExternalFile, "image-file" ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setImageInline, "isInlineImage", &parseBool ));
ruleset.addRule(itemPrefix, SetAttribute<PageItem,QString>( & PageItem::setInlineExt, "inlineImageExt" ));
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp (revision 15059)
+++ scribus/canvasmode_normal.cpp (revision 15060)
@@ -334,9 +334,10 @@
QDrag* dr = new QDrag(m_view);
dr->setMimeData(md);
const QPixmap& pm = loadIcon("DragPix.xpm");
- dr->setDragCursor(pm, Qt::CopyAction);
- dr->setDragCursor(pm, Qt::MoveAction);
- dr->setDragCursor(pm, Qt::LinkAction);
+ dr->setPixmap(pm);
+ // dr->setDragCursor(pm, Qt::CopyAction);
+ // dr->setDragCursor(pm, Qt::MoveAction);
+ // dr->setDragCursor(pm, Qt::LinkAction);
dr->exec();
m_doc->DragP = false;
m_doc->leaveDrag = false;
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt (revision 15059)
+++ scribus/CMakeLists.txt (revision 15060)
@@ -267,6 +267,7 @@
pageitem_pathtext.h
pageitem_polygon.h
pageitem_polyline.h
+ pageitem_symbol.h
pageitem_textframe.h
ui/pageitemattributes.h
pageitempointer.h
@@ -381,6 +382,7 @@
ui/stylemanager.h
ui/styleselect.h
ui/styleview.h
+ ui/symbolpalette.h
ui/tabcheckdoc.h
ui/tabdisplay.h
ui/tabdocument.h
@@ -585,6 +587,7 @@
pageitem_pathtext.cpp
pageitem_polygon.cpp
pageitem_polyline.cpp
+ pageitem_symbol.cpp
pageitem_textframe.cpp
ui/pageitemattributes.cpp
pageitempointer.cpp
@@ -755,6 +758,7 @@
ui/stylemanager.cpp
ui/styleselect.cpp
ui/styleview.cpp
+ ui/symbolpalette.cpp
ui/tabcheckdoc.cpp
ui/tabdisplay.cpp
ui/tabdocument.cpp
More information about the scribus-commit
mailing list