Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6450 → Rev 6451

/branches/Version13x/Scribus/scribus/mpalette.h
119,6 → 119,7
 
Cpalette *Cpal;
Autoforms* SCustom;
Autoforms* SCustom2;
Spalette *Spal;
FontComboH* Fonts;
ArrowChooser* startArrow;
227,6 → 228,7
void DoFlow(int id);
void MakeIrre(int f, int c, double *vals);
void EditSh();
void EditSh2();
void NewTDist();
void NewSpGradient(double x1, double y1, double x2, double y2);
void toggleGradientEdit();
246,6 → 248,8
void HandleTLines();
void setStartArrow(int id);
void setEndArrow(int id);
void setGroupTransparency(int trans);
void setGroupBlending(int blend);
 
protected slots:
//virtual void reject();
305,6 → 309,9
QVBoxLayout* textFlowOptionsLayout;
QHBoxLayout* layout23;
QHBoxLayout* layout24;
QVBoxLayout* page_group_layout;
QHBoxLayout* ShapeGroupLayout2;
QGridLayout* Layout1t;
NameWidget* NameEdit;
319,6 → 326,7
QWidget* page_5a;
QWidget* page_5b;
QWidget* page_6;
QWidget* page_group;
QLabel* xposLabel;
QLabel* widthLabel;
328,6 → 336,7
QLabel* basepointLabel;
QLabel* LevelTxt;
QLabel* SRect;
QLabel* SRect2;
QLabel* rndcornersLabel;
QLabel* startoffsetLabel;
QLabel* distfromcurveLabel;
361,7 → 370,9
QLabel* imgDPIXLabel;
QLabel* imgDPIYLabel;
QLabel* startArrowText;
QLabel* endArrowText;
QLabel* endArrowText;
QLabel* TransTxt;
QLabel* TransTxt2;
 
// LabelButton* colgapLabel;
386,6 → 397,7
 
 
QButtonGroup* ShapeGroup;
QButtonGroup* ShapeGroup2;
QButtonGroup* Distance3;
QButtonGroup* OverP;
 
409,6 → 421,7
QGroupBox* GroupBoxCM;
QGroupBox* TLines;
QGroupBox* GroupBox3a;
QGroupBox* TransGroup;
 
QToolButton* textFlowDisabled;
QToolButton* textFlowUsesFrameShape;
429,6 → 442,7
QComboBox* LJoinStyle;
QComboBox* LEndStyle;
ColorCombo* TxFill;
ScComboBox* blendMode;
 
QListBox* StyledLine;
 
460,6 → 474,7
MSpinBox* ChScaleV;
MSpinBox* ChBase;
QSpinBox* DCol;
QSpinBox* TransSpin;
 
QRadioButton* TopLeft;
QRadioButton* TopRight;
490,6 → 505,7
QToolButton* NoResize;
QToolButton* Revert;
QToolButton* EditShape;
QToolButton* EditShape2;
QToolButton* EditEffects;
QToolButton* EditPSDProps;
 
504,6 → 520,7
int idImageItem;
int idLineItem;
int idColorsItem;
int idGroupItem;
};
 
class SCRIBUS_API UserActionSniffer : public QObject
/branches/Version13x/Scribus/scribus/scribusXml.cpp
427,6 → 427,12
ob->setAttribute("BottomLINK", -1);
ob->setAttribute("OwnLINK", item->ItemNr);
}
ob->setAttribute("isGroupControl", static_cast<int>(item->isGroupControl));
if (item->isGroupControl)
{
if (item->groupsLastItem != 0)
ob->setAttribute("groupsLastItem", item->groupsLastItem->ItemNr - item->ItemNr);
}
ob->setAttribute("NUMDASH", static_cast<int>(item->DashValues.count()));
QString dlp = "";
QValueList<double>::Iterator dax;
641,6 → 647,7
QMap<QString,QString> DoMul;
QMap<int,int> TableID;
QMap<int,int> arrowID;
QMap<PageItem*, int> groupID;
QPtrList<PageItem> TableItems;
bool VorLFound = false;
bool newVersion = false;
901,6 → 908,9
TableItems.append(Neu);
TableID.insert(pite.attribute("OwnLINK", "0").toInt(), Neu->ItemNr);
}
Neu->isGroupControl = static_cast<bool>(pite.attribute("isGroupControl", "0").toInt());
if (Neu->isGroupControl)
groupID.insert(Neu, pite.attribute("groupsLastItem", "0").toInt()+Neu->ItemNr);
if (Neu->asPathText())
Neu->updatePolyClip();
pa = pa.nextSibling();
1032,6 → 1042,9
TableItems.append(Neu);
TableID.insert(pg.attribute("OwnLINK", "0").toInt(), Neu->ItemNr);
}
Neu->isGroupControl = static_cast<bool>(pg.attribute("isGroupControl", "0").toInt());
if (Neu->isGroupControl)
groupID.insert(Neu, pg.attribute("groupsLastItem", "0").toInt()+Neu->ItemNr);
if (Neu->asPathText())
Neu->updatePolyClip();
}
1060,6 → 1073,14
ta->BottomLink = 0;
}
}
if (groupID.count() != 0)
{
QMap<PageItem*, int>::Iterator it;
for (it = groupID.begin(); it != groupID.end(); ++it)
{
it.key()->groupsLastItem = doc->Items->at(it.data());
}
}
doc->GroupCounter = GrMax + 1;
QDir::setCurrent(CurDirP);
return true;
/branches/Version13x/Scribus/scribus/pageitem.cpp
163,6 → 163,8
BottomLine(other.BottomLine),
isTableItem(other.isTableItem),
isSingleSel(other.isSingleSel),
isGroupControl(other.isGroupControl),
groupsLastItem(other.groupsLastItem),
BoundingX(other.BoundingX),
BoundingY(other.BoundingY),
BoundingW(other.BoundingW),
430,6 → 432,8
isSingleSel = false;
Dirty = false;
invalid = true;
isGroupControl = false;
groupsLastItem = 0;
ChangedMasterItem = false;
isEmbedded = false;
OnMasterPage = m_Doc->currentPage()->pageName();
/branches/Version13x/Scribus/scribus/scribusview.cpp
37,6 → 37,7
#include <qcstring.h>
#include <qfileinfo.h>
#include <qfile.h>
#include <qptrstack.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
654,6 → 655,8
 
void ScribusView::DrawMasterItems(ScPainter *painter, Page *page, QRect clip)
{
QPtrStack<PageItem> groupStack;
QPtrStack<PageItem> groupClips;
double z = painter->zoomFactor();
if (!page->MPageNam.isEmpty())
{
690,6 → 693,16
continue;
if ((previewMode) && (!currItem->printEnabled()))
continue;
if (currItem->isGroupControl)
{
painter->save();
#ifdef HAVE_CAIRO
painter->beginLayer(1.0 - currItem->fillTransparency(), currItem->fillBlendmode());
#endif
groupClips.push(currItem);
groupStack.push(currItem->groupsLastItem);
continue;
}
currItem->savedOwnPage = currItem->OwnPage;
// int savedOwnPage = currItem->OwnPage;
double OldX = currItem->xPos();
718,6 → 731,23
currItem->BoundingX = OldBX;
currItem->BoundingY = OldBY;
}
if (groupStack.count() != 0)
{
while (currItem == groupStack.top())
{
PageItem *tmpItem = groupClips.pop();
FPointArray cl = tmpItem->PoLine.copy();
QWMatrix mm;
mm.translate(tmpItem->xPos(), tmpItem->yPos());
mm.rotate(tmpItem->rotation());
cl.map( mm );
#ifdef HAVE_CAIRO
painter->endLayer(&cl);
#endif
painter->restore();
groupStack.pop();
}
}
}
for (uint a = 0; a < pageFromMasterCount; ++a)
{
789,6 → 819,8
{
linkedFramesToShow.clear();
double z = painter->zoomFactor();
QPtrStack<PageItem> groupStack;
QPtrStack<PageItem> groupClips;
if (Doc->Items->count() != 0)
{
int Lnr=0;
825,6 → 857,16
if (currItem->OnMasterPage != Doc->currentPage()->pageName())
continue;
}
if (currItem->isGroupControl)
{
painter->save();
#ifdef HAVE_CAIRO
painter->beginLayer(1.0 - currItem->fillTransparency(), currItem->fillBlendmode());
#endif
groupClips.push(currItem);
groupStack.push(currItem->groupsLastItem);
continue;
}
QRect oldR(currItem->getRedrawBounding(Scale));
if (clip.intersects(oldR))
{
876,6 → 918,23
}
}
}
if (groupStack.count() != 0)
{
while (currItem == groupStack.top())
{
PageItem *tmpItem = groupClips.pop();
FPointArray cl = tmpItem->PoLine.copy();
QWMatrix mm;
mm.translate(tmpItem->xPos(), tmpItem->yPos());
mm.rotate(tmpItem->rotation());
cl.map( mm );
#ifdef HAVE_CAIRO
painter->endLayer(&cl);
#endif
painter->restore();
groupStack.pop();
}
}
}
QPtrListIterator<PageItem> docItem2(*Doc->Items);
while ( (currItem = docItem2.current()) != 0 )
2358,13 → 2417,13
pmen->insertItem( tr("Conve&rt to"), pmen2);
}
pmen->insertSeparator();
if (!currItem->locked() && !(currItem->isTableItem && currItem->isSingleSel))
if (!currItem->locked() && !(currItem->isSingleSel))
m_ScMW->scrActions["editCut"]->addTo(pmen);
if (!(currItem->isTableItem && currItem->isSingleSel))
if (!(currItem->isSingleSel))
m_ScMW->scrActions["editCopy"]->addTo(pmen);
if ((Doc->appMode == modeEdit) && (m_ScMW->Buffer2.startsWith("<SCRIBUSTEXT")) && (currItem->itemType() == PageItem::TextFrame))
m_ScMW->scrActions["editPaste"]->addTo(pmen);
if (!currItem->locked() && (Doc->appMode != modeEdit) && (!(currItem->isTableItem && currItem->isSingleSel)))
if (!currItem->locked() && (Doc->appMode != modeEdit) && (!(currItem->isSingleSel)))
pmen->insertItem( tr("&Delete"), Doc, SLOT(itemSelection_DeleteItem()));
if ((currItem->itemType() == PageItem::ImageFrame) || (currItem->itemType() == PageItem::TextFrame))
{
3750,7 → 3809,7
{
newX = qRound(m->x()/sc + Doc->minCanvasCoordinate.x());
newY = qRound(m->y()/sc + Doc->minCanvasCoordinate.y());
if (moveTimerElapsed() && (m_MouseButtonPressed) && (m->state() == RightButton) && (!Doc->DragP) && (Doc->appMode == modeNormal) /* && (!currItem->locked()) */ && (!(currItem->isTableItem && currItem->isSingleSel)))
if (moveTimerElapsed() && (m_MouseButtonPressed) && (m->state() == RightButton) && (!Doc->DragP) && (Doc->appMode == modeNormal) /* && (!currItem->locked()) */ && (!(currItem->isSingleSel)))
{
if ((abs(Dxp - newX) > 10) || (abs(Dyp - newY) > 10))
{
10055,6 → 10114,7
currItem->setPrintEnabled(Buffer->isPrintable);
currItem->isBookmark = Buffer->isBookmark;
// currItem->BMnr = Buffer->BMnr;
currItem->Groups = Buffer->Groups;
currItem->setIsAnnotation(Buffer->m_isAnnotation);
currItem->setAnnotation(Buffer->m_annotation);
if (!Buffer->AnName.isEmpty())
10075,6 → 10135,11
currItem->AutoName = false;
}
}
else
{
if (currItem->isGroupControl)
currItem->setItemName( tr("Group%1").arg(currItem->Groups.top()));
}
 
currItem->TopLine = Buffer->TopLine;
currItem->RightLine = Buffer->RightLine;
10095,7 → 10160,6
// currItem->setFont(Buffer->IFont);
// currItem->setFontSize(Buffer->ISize);
// currItem->ExtraV = Buffer->ExtraV;
currItem->Groups = Buffer->Groups;
currItem->TabValues = Buffer->TabValues;
currItem->DashValues = Buffer->DashValues;
currItem->DashOffset = Buffer->DashOffset;
/branches/Version13x/Scribus/scribus/scribus.cpp
292,6 → 292,8
scrActions["helpTooltips"]->setOn(prefsManager->appPrefs.showToolTips);
ToggleTips();
propertiesPalette->setFontSize();
if (scrActions["SaveAsDocumentTemplate"])
scrActions["SaveAsDocumentTemplate"]->setEnabled(false);
connect(ScCore->fileWatcher, SIGNAL(fileDeleted(QString )), this, SLOT(removeRecent(QString)));
connect(this, SIGNAL(TextIFont(QString)), this, SLOT(AdjustFontMenu(QString)));
554,6 → 556,7
scrActions["fileExportText"]->setEnabled(false);
scrActions["fileExportAsEPS"]->setEnabled(false);
scrActions["fileExportAsPDF"]->setEnabled(false);
scrMenuMgr->setMenuEnabled("FileImport", false);
scrMenuMgr->setMenuEnabled("FileExport", false);
scrActions["fileDocSetup"]->setEnabled(false);
scrActions["filePrint"]->setEnabled(false);
2392,6 → 2395,7
scrActions["fileRevert"]->setEnabled(false);
scrActions["fileCollect"]->setEnabled(true);
scrActions["fileSaveAs"]->setEnabled(true);
scrMenuMgr->setMenuEnabled("FileImport", true);
scrMenuMgr->setMenuEnabled("FileExport", true);
scrActions["fileExportAsEPS"]->setEnabled(true);
scrActions["fileExportAsPDF"]->setEnabled(true);
2558,7 → 2562,16
{
if (doc->m_Selection->count() != 0)
{
currItem = doc->m_Selection->itemAt(0);
uint lowestItem = 999999;
for (uint a=0; a<doc->m_Selection->count(); ++a)
{
currItem = doc->m_Selection->itemAt(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
}
currItem = doc->Items->at(lowestItem);
// doc->m_Selection->removeItem(currItem);
// doc->m_Selection->prependItem(currItem);
// currItem = doc->m_Selection->itemAt(0);
if (!currItem)
Nr=-1;
}
2935,10 → 2948,10
}
else
{
bool setter=!(currItem->isTableItem && currItem->isSingleSel);
bool setter=!(currItem->isTableItem && currItem->isSingleSel && currItem->isGroupControl);
scrActions["itemDuplicate"]->setEnabled(setter);
scrActions["itemMulDuplicate"]->setEnabled(setter);
scrActions["itemDelete"]->setEnabled(setter);
scrActions["itemDelete"]->setEnabled(!currItem->isSingleSel);
scrActions["itemLowerToBottom"]->setEnabled(setter);
scrActions["itemRaiseToTop"]->setEnabled(setter);
scrActions["itemRaise"]->setEnabled(setter);
4155,6 → 4168,7
scrActions["PrintPreview"]->setEnabled(false);
if (scrActions["SaveAsDocumentTemplate"])
scrActions["SaveAsDocumentTemplate"]->setEnabled(false);
scrMenuMgr->setMenuEnabled("FileImport", false);
scrMenuMgr->setMenuEnabled("FileExport", false);
scrActions["fileExportAsPDF"]->setEnabled(false);
scrActions["fileExportText"]->setEnabled(false);
4589,7 → 4603,7
}
else
{
if (currItem->isTableItem && currItem->isSingleSel)
if (((currItem->isSingleSel) && (currItem->isGroupControl)) || ((currItem->isSingleSel) && (currItem->isTableItem)))
return;
ScriXmlDoc *ss = new ScriXmlDoc();
BufferI = ss->WriteElem(doc, view, doc->m_Selection);
4680,7 → 4694,7
}
else
{
if (currItem->isTableItem && currItem->isSingleSel)
if (((currItem->isSingleSel) && (currItem->isGroupControl)) || ((currItem->isSingleSel) && (currItem->isTableItem)))
return;
ScriXmlDoc *ss = new ScriXmlDoc();
BufferI = ss->WriteElem(doc, view, doc->m_Selection);
8094,6 → 8108,8
}
doc->GroupCounter++;
view->getGroupRect(&x, &y, &w, &h);
uint lowestItem = 999999;
uint highestItem = 0;
for (uint a=0; a<selectedItemCount; ++a)
{
currItem = doc->m_Selection->itemAt(a);
8101,7 → 8117,58
currItem->gYpos = currItem->yPos() - y;
currItem->gWidth = w;
currItem->gHeight = h;
lowestItem = QMIN(lowestItem, currItem->ItemNr);
highestItem = QMAX(highestItem, currItem->ItemNr);
}
double minx = 99999.9;
double miny = 99999.9;
double maxx = -99999.9;
double maxy = -99999.9;
for (uint ep = 0; ep < selectedItemCount; ++ep)
{
PageItem* currItem = doc->m_Selection->itemAt(ep);
double lw = currItem->lineWidth() / 2.0;
if (currItem->rotation() != 0)
{
FPointArray pb;
pb.resize(0);
pb.addPoint(FPoint(currItem->xPos()-lw, currItem->yPos()-lw));
pb.addPoint(FPoint(currItem->width()+lw*2.0, -lw, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
pb.addPoint(FPoint(currItem->width()+lw*2.0, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
double gy = miny;
double gw = maxx - minx;
double gh = maxy - miny;
PageItem *high = doc->Items->at(highestItem);
int z = doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, gx, gy, gw, gh, doc->toolSettings.dWidth, doc->toolSettings.dBrush, doc->toolSettings.dPen, true);
PageItem *neu = doc->Items->take(z);
doc->Items->insert(lowestItem, neu);
neu->Groups.push(doc->GroupCounter-1);
neu->setItemName( tr("Group%1").arg(neu->Groups.top()));
neu->isGroupControl = true;
neu->groupsLastItem = high;
for (uint a = 0; a < doc->Items->count(); ++a)
{
doc->Items->at(a)->ItemNr = a;
}
doc->m_Selection->prependItem(neu);
view->updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
outlinePalette->BuildTree();
slotDocCh();
8123,6 → 8190,7
ss->set("itemcount", docSelectionCount);
QString tooltip = Um::ItemsInvolved + "\n";
PageItem *currItem;
uint lowestItem = 999999;
for (uint a=0; a<docSelectionCount; ++a)
{
currItem = doc->m_Selection->itemAt(a);
8132,12 → 8200,21
currItem->RightLink = 0;
currItem->TopLink = 0;
currItem->BottomLink = 0;
lowestItem = QMIN(lowestItem, currItem->ItemNr);
ss->set(QString("item%1").arg(a), currItem->ItemNr);
tooltip += "\t" + currItem->getUName() + "\n";
}
view->Deselect(true);
if (doc->Items->at(lowestItem)->isGroupControl)
{
doc->Items->remove(lowestItem);
for (uint a = 0; a < doc->Items->count(); ++a)
{
doc->Items->at(a)->ItemNr = a;
}
}
outlinePalette->BuildTree();
slotDocCh();
view->Deselect(true);
 
undoManager->action(this, ss, Um::SelectionGroup, Um::IGroup);
}
/branches/Version13x/Scribus/scribus/scpainter.h
83,7 → 83,7
enum FillMode { None, Solid, Gradient, Pattern };
#ifdef HAVE_CAIRO
virtual void beginLayer(double transparency, int blendmode);
virtual void endLayer();
virtual void endLayer(FPointArray *clipArray = 0);
#endif
virtual void begin();
virtual void end();
/branches/Version13x/Scribus/scribus/mpalette.cpp
37,6 → 37,9
#include "undomanager.h"
#include "util.h"
#include "text/nlsconfig.h"
#ifdef HAVE_CAIRO
#include <cairo.h>
#endif
 
using namespace std;
 
477,6 → 480,59
pageLayout_2->addItem( spacer6 );
idShapeItem=TabStack->addItem( page_2, "&Shape" );
 
page_group = new QWidget(TabStack, "page_group");
page_group_layout = new QVBoxLayout( page_group, 0, 5, "pageLayout_2");
 
ShapeGroup2 = new QButtonGroup( "", page_group, "ShapeGroup2" );
ShapeGroup2->setFrameShape( QButtonGroup::NoFrame );
ShapeGroup2->setExclusive( true );
ShapeGroup2->setColumnLayout(0, Qt::Vertical );
ShapeGroup2->layout()->setSpacing( 2 );
ShapeGroup2->layout()->setMargin( 0 );
ShapeGroupLayout2 = new QHBoxLayout( ShapeGroup2->layout() );
ShapeGroupLayout2->setAlignment( Qt::AlignTop );
SRect2 = new QLabel( "Shape:", ShapeGroup2, "SRect" );
ShapeGroupLayout2->addWidget( SRect2 );
SCustom2 = new Autoforms( ShapeGroup2 );
ShapeGroupLayout2->addWidget( SCustom2 );
page_group_layout->addWidget( ShapeGroup2 );
EditShape2 = new QToolButton( page_group, "EditShape" );
page_group_layout->addWidget( EditShape2 );
TransGroup = new QGroupBox( tr( "Transparency Settings" ), page_group, "TransGroup" );
TransGroup->setColumnLayout(0, Qt::Vertical );
TransGroup->layout()->setSpacing( 0 );
TransGroup->layout()->setMargin( 0 );
Layout1t = new QGridLayout( TransGroup->layout() );
Layout1t->setAlignment( Qt::AlignTop );
Layout1t->setSpacing( 5 );
Layout1t->setMargin( 5 );
TransTxt = new QLabel( TransGroup, "Transtxt" );
Layout1t->addWidget( TransTxt, 0, 0 );
TransSpin = new QSpinBox( TransGroup, "traspin" );
TransSpin->setMinValue(0);
TransSpin->setMaxValue(100);
TransSpin->setLineStep(10);
TransSpin->setValue(100);
Layout1t->addWidget(TransSpin, 0, 1);
TransTxt2 = new QLabel( TransGroup, "textLabel1" );
Layout1t->addWidget( TransTxt2, 1, 0 );
blendMode = new ScComboBox( false, TransGroup, "blendMode" );
Layout1t->addWidget( blendMode, 1, 1 );
page_group_layout->addWidget(TransGroup);
// TransGroup->setEnabled(false);
#ifndef HAVE_CAIRO
blendMode->hide();
TransTxt2->hide();
#else
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 1, 8)
blendMode->hide();
TransTxt2->hide();
#endif
#endif
QSpacerItem* spacerTr2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
page_group_layout->addItem( spacerTr2 );
idGroupItem = TabStack->addItem(page_group, "Groups");
 
page_3 = new QWidget( TabStack, "page_3" );
pageLayout_3 = new QVBoxLayout( page_3, 0, 5, "pageLayout_3");
pageLayout_3->setAlignment( Qt::AlignLeft );
850,6 → 906,8
 
connect(SCustom, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeIrre(int, int, double *)));
connect(EditShape, SIGNAL(clicked()), this, SLOT(EditSh()));
connect(SCustom2, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeIrre(int, int, double *)));
connect(EditShape2, SIGNAL(clicked()), this, SLOT(EditSh2()));
connect(dGap, SIGNAL(valueChanged(int)), this, SLOT(NewGap()));
connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
connect(DTop, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
892,6 → 950,8
connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
connect( KnockOut, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
connect( Overprint, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
 
HaveItem = false;
Xpos->setValue(0);
902,7 → 962,7
RoundRect->setValue(0);
TabStack3->raiseWidget(0);
TabStack2->raiseWidget(0);
for (int ws = 1; ws < 6; ++ws)
for (int ws = 1; ws < 7; ++ws)
TabStack->setItemEnabled(ws, false);
TabStack->setCurrentIndex(0);
TabStack->item(0)->setEnabled(false);
936,7 → 996,7
{
if (!m_ScMW || m_ScMW->ScriptRunning)
return;
if ((HaveDoc) && (HaveItem) && (t == 5))
if ((HaveDoc) && (HaveItem) && (t == idColorsItem))
{
Cpal->setActGradient(CurItem->GrType);
updateColorSpecialGradient();
1065,7 → 1125,7
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
*/
// langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
if (TabStack->currentIndex() == 5)
if (TabStack->currentIndex() == idColorsItem)
Cpal->setActGradient(CurItem->GrType);
updateColorSpecialGradient();
Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1142,6 → 1202,24
else
TabStack3->raiseWidget(0);
LayerGroup->setEnabled(!setter);
disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
if (i->isGroupControl)
{
TabStack->setItemEnabled(idGroupItem, true);
if (i->FrameType == 0)
SCustom2->setPixmap(SCustom2->getIconPixmap(0));
if (i->FrameType == 1)
SCustom2->setPixmap(SCustom2->getIconPixmap(1));
if (i->FrameType > 3)
SCustom2->setPixmap(SCustom2->getIconPixmap(i->FrameType-2));
TransSpin->setValue(qRound(100 - (i->fillTransparency() * 100)));
blendMode->setCurrentItem(i->fillBlendmode());
}
else
TabStack->setItemEnabled(idGroupItem, false);
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
/*
Xpos->setReadOnly(setter);
Ypos->setReadOnly(setter);
1176,13 → 1254,16
KnockOut->setChecked(!i->doOverprint);
Overprint->setChecked(i->doOverprint);
 
if ((i->itemType() == PageItem::Line) && LMode) {
if ((i->itemType() == PageItem::Line) && LMode)
{
xposLabel->setText( tr( "&X1:" ) );
widthLabel->setText( tr( "X&2:" ) );
yposLabel->setText( tr( "Y&1:" ) );
heightLabel->setText( tr( "&Y2:" ) );
Rot->setEnabled(false);
} else {
}
else
{
xposLabel->setText( tr( "&X-Pos:" ) );
widthLabel->setText( tr( "&Width:" ) );
yposLabel->setText( tr( "&Y-Pos:" ) );
1264,23 → 1345,24
 
HaveItem = false;
CurItem = i;
if (TabStack->currentIndex() == 5)
 
if (TabStack->currentIndex() == idColorsItem)
Cpal->setActGradient(CurItem->GrType);
updateColorSpecialGradient();
Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
Cpal->gradEdit->Preview->updateDisplay();
if (i->FrameType == 0)
if (CurItem->FrameType == 0)
SCustom->setPixmap(SCustom->getIconPixmap(0));
if (i->FrameType == 1)
if (CurItem->FrameType == 1)
SCustom->setPixmap(SCustom->getIconPixmap(1));
if (i->FrameType > 3)
SCustom->setPixmap(SCustom->getIconPixmap(i->FrameType-2));
if ((i->asLine()) || (i->asPolyLine()))
if (CurItem->FrameType > 3)
SCustom->setPixmap(SCustom->getIconPixmap(CurItem->FrameType-2));
if ((CurItem->asLine()) || (CurItem->asPolyLine()))
{
startArrow->setEnabled(true);
endArrow->setEnabled(true);
startArrow->setCurrentItem(i->startArrowIndex());
endArrow->setCurrentItem(i->endArrowIndex());
startArrow->setCurrentItem(CurItem->startArrowIndex());
endArrow->setCurrentItem(CurItem->endArrowIndex());
}
else
{
1287,11 → 1369,11
startArrow->setEnabled(false);
endArrow->setEnabled(false);
}
NameEdit->setText(i->itemName());
RoundRect->setValue(i->cornerRadius()*Umrech);
NameEdit->setText(CurItem->itemName());
RoundRect->setValue(CurItem->cornerRadius()*Umrech);
QString tm;
LevelTxt->setText(tm.setNum(i->ItemNr));
PageItem_TextFrame *i2=i->asTextFrame();
LevelTxt->setText(tm.setNum(CurItem->ItemNr));
PageItem_TextFrame *i2=CurItem->asTextFrame();
if (i2!=0)
{
DCol->setMaxValue(QMAX(qRound(i2->width() / QMAX(i2->ColGap, 10.0)), 1));
1314,8 → 1396,8
DBottom->setValue(i2->textToFrameDistBottom()*Umrech);
DRight->setValue(i2->textToFrameDistRight()*Umrech);
}
Revert->setOn(i->reversed());
setTextFlowMode(i->textFlowMode());
Revert->setOn(CurItem->reversed());
setTextFlowMode(CurItem->textFlowMode());
/*
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1326,7 → 1408,7
*/
// langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
bool setter;
if (i->NamedLStyle.isEmpty())
if (CurItem->NamedLStyle.isEmpty())
{
StyledLine->setCurrentItem(0);
setter = true;
1333,7 → 1415,7
}
else
{
StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
StyledLine->setSelected(StyledLine->findItem(CurItem->NamedLStyle), true);
setter = false;
}
LStyle->setEnabled(setter);
1348,58 → 1430,79
//NoPrint->setOn(!i->printEnabled());
//setLocked(i->locked());
//setSizeLocked(i->sizeLocked());
if ((i->isTableItem) && (i->isSingleSel))
if ((CurItem->isTableItem) && (CurItem->isSingleSel))
{
setter = true;
TabStack3->raiseWidget(1);
TopLine->setChecked(i->TopLine);
LeftLine->setChecked(i->LeftLine);
RightLine->setChecked(i->RightLine);
BottomLine->setChecked(i->BottomLine);
TopLine->setChecked(CurItem->TopLine);
LeftLine->setChecked(CurItem->LeftLine);
RightLine->setChecked(CurItem->RightLine);
BottomLine->setChecked(CurItem->BottomLine);
}
else
TabStack3->raiseWidget(0);
LayerGroup->setEnabled(!setter);
disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
if (CurItem->isGroupControl)
{
TabStack->setItemEnabled(idGroupItem, true);
if (CurItem->FrameType == 0)
SCustom2->setPixmap(SCustom2->getIconPixmap(0));
if (CurItem->FrameType == 1)
SCustom2->setPixmap(SCustom2->getIconPixmap(1));
if (CurItem->FrameType > 3)
SCustom2->setPixmap(SCustom2->getIconPixmap(CurItem->FrameType-2));
TransSpin->setValue(qRound(100 - (CurItem->fillTransparency() * 100)));
blendMode->setCurrentItem(CurItem->fillBlendmode());
}
else
TabStack->setItemEnabled(idGroupItem, false);
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
/*
Xpos->setReadOnly(setter);
Ypos->setReadOnly(setter);
Rot->setReadOnly(setter);
*/
if (i->asPathText())
if (CurItem->asPathText())
{
TabStack2->raiseWidget(1);
showcurveCheckBox->setChecked(i->PoShow);
LineW->setValue(i->BaseOffs * -1);
Dist->setValue(i->textToFrameDistLeft());
showcurveCheckBox->setChecked(CurItem->PoShow);
LineW->setValue(CurItem->BaseOffs * -1);
Dist->setValue(CurItem->textToFrameDistLeft());
}
else if (i->asPolygon())
else if (CurItem->asPolygon())
{
TabStack2->raiseWidget(2);
NonZero->setChecked(!i->fillRule);
EvenOdd->setChecked(i->fillRule);
NonZero->setChecked(!CurItem->fillRule);
EvenOdd->setChecked(CurItem->fillRule);
}
else
TabStack2->raiseWidget(0);
// Frame type 3 is obsolete: CR 2005-02-06
//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) && (!i->ClipEdited))
if (((i->asTextFrame()) || (i->asImageFrame())) && (!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
RoundRect->setEnabled(true);
else
{
if ((i->asPolygon()) && (!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
if ((CurItem->asPolygon()) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
RoundRect->setEnabled(true);
else
RoundRect->setEnabled(false);
}
KnockOut->setChecked(!i->doOverprint);
Overprint->setChecked(i->doOverprint);
if ((i->itemType() == PageItem::Line) && LMode) {
KnockOut->setChecked(!CurItem->doOverprint);
Overprint->setChecked(CurItem->doOverprint);
if ((CurItem->itemType() == PageItem::Line) && LMode)
{
xposLabel->setText( tr( "&X1:" ) );
widthLabel->setText( tr( "X&2:" ) );
yposLabel->setText( tr( "Y&1:" ) );
heightLabel->setText( tr( "&Y2:" ) );
Rot->setEnabled(false);
} else {
}
else
{
xposLabel->setText( tr( "&X-Pos:" ) );
widthLabel->setText( tr( "&Width:" ) );
yposLabel->setText( tr( "&Y-Pos:" ) );
1407,10 → 1510,10
Rot->setEnabled(true);
}
HaveItem = true;
if (i->asLine())
if (CurItem->asLine())
{
keepFrameWHRatioButton->setEnabled(false);
if (LMode && !i->locked())
if (LMode && !CurItem->locked())
Height->setEnabled(true);
else
Height->setEnabled(false);
1419,12 → 1522,12
{
Height->setEnabled(true);
keepFrameWHRatioButton->setEnabled(true);
if (i->asImageFrame())
if (CurItem->asImageFrame())
{
updateCmsList();
EditEffects->setShown(i->PicAvail && i->isRaster);
EditPSDProps->setShown(i->PicAvail && i->pixm.imgInfo.valid);
setter = i->ScaleType;
EditEffects->setShown(CurItem->PicAvail && CurItem->isRaster);
EditPSDProps->setShown(CurItem->PicAvail && CurItem->pixm.imgInfo.valid);
setter = CurItem->ScaleType;
FreeScale->setChecked(setter);
FrameScale->setChecked(!setter);
//CB Why do we need this? Setting it too much here
1434,7 → 1537,7
// keepImageDPIRatioButton->setOn(setter);
// }
Aspect->setEnabled(!setter);
Aspect->setChecked(i->AspectRatio);
Aspect->setChecked(CurItem->AspectRatio);
imageXOffsetSpinBox->setEnabled(setter);
imageYOffsetSpinBox->setEnabled(setter);
imageXScaleSpinBox->setEnabled(setter);
1443,7 → 1546,7
imgDpiY->setEnabled(setter);
}
}
setXY(i->xPos(), i->yPos());
setXY(CurItem->xPos(), CurItem->yPos());
 
updateSpinBoxConstants();
}
1489,9 → 1592,9
Rot->setEnabled(true);
// TabStack->setCurrentIndex(0);
TabStack->item(0)->setEnabled(true);
TabStack->setItemEnabled(0, true);
TabStack->setItemEnabled(idXYZItem, true);
NameEdit->setEnabled(false);
TabStack->setItemEnabled(5, true);
TabStack->setItemEnabled(idColorsItem, true);
FlipH->setToggleButton( true );
FlipV->setToggleButton( true );
FlipH->setOn(false);
1523,8 → 1626,8
Center->setEnabled(true);
visID = TabStack->currentIndex ();
TabStack->item(0)->setEnabled(true);
TabStack->setItemEnabled(0, true);
TabStack->setItemEnabled(5, true);
TabStack->setItemEnabled(idXYZItem, true);
TabStack->setItemEnabled(idColorsItem, true);
/*
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1567,18 → 1670,18
Height->setValue(0);
Rot->setValue(0);
RoundRect->setValue(0);
for (int ws = 1; ws < 6; ++ws)
for (int ws = 1; ws < 7; ++ws)
TabStack->setItemEnabled(ws, false);
// TabStack->setCurrentIndex(0);
TabStack->item(0)->setEnabled(false);
TabStack->setItemEnabled(0, false);
TabStack->setItemEnabled(idXYZItem, false);
Cpal->ChooseGrad(0);
break;
case 2:
TabStack->setItemEnabled(1, true);
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, true);
TabStack->setItemEnabled(4, true);
TabStack->setItemEnabled(idShapeItem, true);
TabStack->setItemEnabled(idTextItem, false);
TabStack->setItemEnabled(idImageItem, true);
TabStack->setItemEnabled(idLineItem, true);
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(!i->locked());
else
1589,10 → 1692,10
// TabStack->setCurrentIndex(0);
break;
case 4:
TabStack->setItemEnabled(1, true);
TabStack->setItemEnabled(2, true);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
TabStack->setItemEnabled(idShapeItem, true);
TabStack->setItemEnabled(idTextItem, true);
TabStack->setItemEnabled(idImageItem, false);
TabStack->setItemEnabled(idLineItem, true);
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(!i->locked());
else
1602,10 → 1705,10
// TabStack->setCurrentIndex(0);
break;
case 5:
TabStack->setItemEnabled(1, false);
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
TabStack->setItemEnabled(idShapeItem, false);
TabStack->setItemEnabled(idTextItem, false);
TabStack->setItemEnabled(idImageItem, false);
TabStack->setItemEnabled(idLineItem, true);
RoundRect->setEnabled(false);
LineMode->setEnabled(true);
TopLeft->setEnabled(false);
1619,10 → 1722,10
case 1:
case 3:
case 6:
TabStack->setItemEnabled(1, true);
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
TabStack->setItemEnabled(idShapeItem, true);
TabStack->setItemEnabled(idTextItem, false);
TabStack->setItemEnabled(idImageItem, false);
TabStack->setItemEnabled(idLineItem, true);
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(!i->locked());
else
1631,19 → 1734,19
// TabStack->setCurrentIndex(0);
break;
case 7:
TabStack->setItemEnabled(1, true);
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
TabStack->setItemEnabled(idShapeItem, true);
TabStack->setItemEnabled(idTextItem, false);
TabStack->setItemEnabled(idImageItem, false);
TabStack->setItemEnabled(idLineItem, true);
RoundRect->setEnabled(false);
// if ((visID == 2) || (visID == 3))
// TabStack->setCurrentIndex(0);
break;
case 8:
TabStack->setItemEnabled(1, true);
TabStack->setItemEnabled(2, true);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
TabStack->setItemEnabled(idShapeItem, true);
TabStack->setItemEnabled(idTextItem, true);
TabStack->setItemEnabled(idImageItem, false);
TabStack->setItemEnabled(idLineItem, true);
RoundRect->setEnabled(false);
// if (visID == 3)
// TabStack->setCurrentIndex(0);
1663,6 → 1766,18
//FlipH->setEnabled(!isMultiple);
//FlipV->setEnabled(!isMultiple);
NameEdit->setEnabled(!isMultiple);
if (doc->m_Selection->count() > 1)
{
PageItem *i;
uint lowestItem = 999999;
for (uint a=0; a<doc->m_Selection->count(); ++a)
{
i = doc->m_Selection->itemAt(a);
lowestItem = QMIN(lowestItem, i->ItemNr);
}
i = doc->Items->at(lowestItem);
SetCurItem(i);
}
}
 
void Mpalette::unitChange()
3863,6 → 3978,7
TabStack->setItemLabel(idShapeItem, tr("&Shape"));
TabStack->setItemLabel(idLineItem, tr("&Line"));
TabStack->setItemLabel(idColorsItem, tr("&Colors"));
TabStack->setItemLabel(idGroupItem, tr("&Group"));
 
NameGroup->setTitle( tr("Name"));
GeoGroup->setTitle( tr("Geometry"));
3875,6 → 3991,27
LayerGroup->setTitle( tr("Level"));
SRect->setText( tr("Shape:"));
EditShape->setText( tr("&Edit Shape..."));
SRect2->setText( tr("Shape:"));
EditShape2->setText( tr("&Edit Shape..."));
TransGroup->setTitle( tr( "Transparency Settings" ));
TransTxt->setText( tr( "Opacity:" ) );
TransTxt2->setText( tr( "Blend Mode:" ) );
blendMode->clear();
blendMode->insertItem( tr("Normal"));
blendMode->insertItem( tr("Darken"));
blendMode->insertItem( tr("Lighten"));
blendMode->insertItem( tr("Multiply"));
blendMode->insertItem( tr("Screen"));
blendMode->insertItem( tr("Overlay"));
blendMode->insertItem( tr("Hard Light"));
blendMode->insertItem( tr("Soft Light"));
blendMode->insertItem( tr("Difference"));
blendMode->insertItem( tr("Exclusion"));
blendMode->insertItem( tr("Color Dodge"));
blendMode->insertItem( tr("Color Burn"));
blendMode->insertItem( tr("Hue"));
blendMode->insertItem( tr("Saturation"));
blendMode->insertItem( tr("Color"));
rndcornersLabel->setText( tr("R&ound\nCorners:"));
Distance->setTitle( tr("Distance of Text"));
columnsLabel->setText( tr("Colu&mns:"));
4266,3 → 4403,33
FlipV->setOn(isFlippedV);
}
 
void Mpalette::setGroupTransparency(int trans)
{
if ((HaveDoc) && (HaveItem))
{
CurItem->setFillTransparency(static_cast<double>(100 - trans) / 100.0);
m_ScMW->view->RefreshItem(CurItem);
emit DocChanged();
}
}
 
void Mpalette::setGroupBlending(int blend)
{
CurItem->setFillBlendmode(blend);
m_ScMW->view->RefreshItem(CurItem);
emit DocChanged();
}
 
void Mpalette::EditSh2()
{
if (!m_ScMW || m_ScMW->ScriptRunning)
return;
if ((HaveDoc) && (HaveItem))
{
doc->m_Selection->clear();
doc->m_Selection->addItem(CurItem);
CurItem->isSingleSel = true;
m_ScMW->view->RefreshItem(CurItem);
emit ShapeEdit();
}
}
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
4331,7 → 4331,7
for (uint c = 0; c < docSelectionCount; ++c)
{
currItem = m_Selection->itemAt(c);
if (currItem->isTableItem && currItem->isSingleSel)
if (((currItem->isSingleSel) && (currItem->isGroupControl)) || ((currItem->isSingleSel) && (currItem->isTableItem)))
return false;
ObjOrder.insert(currItem->ItemNr, c);
int d = Items->findRef(currItem);
4361,7 → 4361,7
for (uint c = 0; c < docSelectionCount; ++c)
{
currItem = m_Selection->itemAt(c);
if (currItem->isTableItem && currItem->isSingleSel)
if (((currItem->isSingleSel) && (currItem->isGroupControl)) || ((currItem->isSingleSel) && (currItem->isTableItem)))
return false;
ObjOrder.insert(currItem->ItemNr, c);
int d = Items->findRef(currItem);
6393,7 → 6393,7
for (uint de = 0; de < selectedItemCount; ++de)
{
currItem = itemSelection->itemAt(offs);
if ((currItem->isTableItem && currItem->isSingleSel) || (currItem->locked()))
if ((((currItem->isSingleSel) && (currItem->isGroupControl)) || ((currItem->isSingleSel) && (currItem->isTableItem))) || (currItem->locked()))
{
offs++;
continue;
6505,6 → 6505,8
for (uint i = 0; i < selectedItemCount; ++i)
{
PageItem *currItem = m_Selection->itemAt(i);
if (currItem->isGroupControl)
continue;
currItem->setFillTransparency(t);
}
emit updateContents();
6534,6 → 6536,8
for (uint i = 0; i < selectedItemCount; ++i)
{
PageItem *currItem = m_Selection->itemAt(i);
if (currItem->isGroupControl)
continue;
currItem->setFillBlendmode(t);
}
emit updateContents();
/branches/Version13x/Scribus/scribus/pdflib.cpp
37,6 → 37,7
#include <qdir.h>
#include <cstdlib>
#include <cmath>
#include <qptrstack.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
1845,6 → 1846,7
 
void PDFlib::PDF_ProcessPage(const Page* pag, uint PNr, bool clip)
{
QPtrStack<PageItem> groupStack;
QString tmp;
ActPageP = pag;
PageItem* ite;
1892,6 → 1894,22
if ((!pag->pageName().isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
continue;
QString name = "/"+pag->MPageNam.simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ) + QString::number(ite->ItemNr);
if (ite->isGroupControl)
{
PutPage("q\n");
FPointArray cl = ite->PoLine.copy();
FPointArray clb = ite->PoLine.copy();
QWMatrix mm;
mm.translate(ite->xPos() - mPage->xOffset(), (ite->yPos() - mPage->yOffset()) - mPage->height());
mm.rotate(-ite->rotation());
cl.map( mm );
ite->PoLine = cl;
PutPage(SetClipPath(ite));
PutPage("h W* n\n");
groupStack.push(ite->groupsLastItem);
ite->PoLine = clb.copy();
continue;
}
if (! ite->asTextFrame())
PutPage(name+" Do\n");
else
1907,6 → 1925,14
ite->BoundingX = OldBX;
ite->BoundingY = OldBY;
}
if (groupStack.count() != 0)
{
while (ite == groupStack.top())
{
PutPage("Q\n");
groupStack.pop();
}
}
}
for (uint am = 0; am < pag->FromMaster.count(); ++am)
{
1965,10 → 1991,42
ite = PItems.at(a);
if (ite->LayerNr != ll.LNr)
continue;
QString grcon = "";
if (ite->isGroupControl)
{
grcon += "q\n";
FPointArray cl = ite->PoLine.copy();
FPointArray clb = ite->PoLine.copy();
QWMatrix mm;
mm.translate(ite->xPos() - pag->xOffset(), (ite->yPos() - pag->yOffset()) - pag->height());
mm.rotate(-ite->rotation());
cl.map( mm );
ite->PoLine = cl;
grcon += SetClipPath(ite);
grcon += "h W* n\n";
groupStack.push(ite->groupsLastItem);
if (((ll.transparency != 1) || (ll.blendMode != 0)) && (Options.Version >= 14))
inh += grcon;
else
PutPage(grcon);
ite->PoLine = clb.copy();
continue;
}
if (((ll.transparency != 1) || (ll.blendMode != 0)) && (Options.Version >= 14))
inh += PDF_ProcessItem(ite, pag, PNr);
else
PutPage(PDF_ProcessItem(ite, pag, PNr));
if (groupStack.count() != 0)
{
while (ite == groupStack.top())
{
if (((ll.transparency != 1) || (ll.blendMode != 0)) && (Options.Version >= 14))
inh += "Q\n";
else
PutPage("Q\n");
groupStack.pop();
}
}
}
for (uint a = 0; a < PItems.count() && !abortExport; ++a)
{
/branches/Version13x/Scribus/scribus/pageitem.h
407,6 → 407,8
bool BottomLine;
bool isTableItem;
bool isSingleSel;
bool isGroupControl;
PageItem *groupsLastItem;
double BoundingX;
double BoundingY;
double BoundingW;
/branches/Version13x/Scribus/scribus/scpainter.cpp
381,7 → 381,7
#endif
}
 
void ScPainter::endLayer()
void ScPainter::endLayer(FPointArray *clipArray)
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 1, 6)
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 1, 8)
397,8 → 397,6
int stride = cairo_image_surface_get_stride(tmp);
unsigned char *s = cairo_image_surface_get_data(tmp);
unsigned char *d = cairo_image_surface_get_data(tmpB);
// int h = m_image->height();
// int w = m_image->width();
int h = cairo_image_surface_get_height(tmp);
int w = cairo_image_surface_get_width(tmp);
for( int yi=0; yi < h; ++yi )
582,6 → 580,11
layerProp la;
la = Layers.pop();
cairo_pop_group_to_source (m_cr);
if (clipArray != NULL)
{
setupPolygon(clipArray);
setClipPath();
}
if (m_blendMode == 0)
{
cairo_set_operator(m_cr, CAIRO_OPERATOR_OVER);
/branches/Version13x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
242,6 → 242,7
QFont fo;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
QMap<PageItem*, int> groupID;
int a;
PageItem *Neu;
Page* Apage;
1047,6 → 1048,9
TableItems.append(Neu);
TableID.insert(pg.attribute("OwnLINK", "0").toInt(), Neu->ItemNr);
}
Neu->isGroupControl = static_cast<bool>(pg.attribute("isGroupControl", "0").toInt());
if (Neu->isGroupControl)
groupID.insert(Neu, pg.attribute("groupsLastItem", "0").toInt()+Neu->ItemNr);
if (pg.tagName()=="FRAMEOBJECT")
{
m_Doc->FrameItems.append(m_Doc->Items->take(Neu->ItemNr));
1190,6 → 1194,9
TableItems.append(Neu);
TableID.insert(pite.attribute("OwnLINK", "0").toInt(), Neu->ItemNr);
}
Neu->isGroupControl = static_cast<bool>(pite.attribute("isGroupControl", "0").toInt());
if (Neu->isGroupControl)
groupID.insert(Neu, pite.attribute("groupsLastItem", "0").toInt()+Neu->ItemNr);
pa = pa.nextSibling();
}
m_Doc->useRaster = savedAlignGrid;
1237,6 → 1244,14
ta->BottomLink = 0;
}
}
if (groupID.count() != 0)
{
QMap<PageItem*, int>::Iterator it;
for (it = groupID.begin(); it != groupID.end(); ++it)
{
it.key()->groupsLastItem = m_Doc->Items->at(it.data());
}
}
m_Doc->setActiveLayer(layerToSetActive);
m_Doc->setMasterPageMode(false);
m_Doc->reformPages();
2619,6 → 2634,7
QFont fo;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
QMap<PageItem*, int> groupID;
int a, counter, baseobj;
double pageX = 0, pageY = 0;
bool newVersion = false;
2962,6 → 2978,9
TableItems.append(Neu);
TableID.insert(pg.attribute("OwnLINK", "0").toInt(), Neu->ItemNr);
}
Neu->isGroupControl = static_cast<bool>(pg.attribute("isGroupControl", "0").toInt());
if (Neu->isGroupControl)
groupID.insert(Neu, pg.attribute("groupsLastItem", "0").toInt()+Neu->ItemNr);
if (pg.tagName()=="FRAMEOBJECT")
{
m_Doc->FrameItems.append(m_Doc->Items->take(Neu->ItemNr));
3092,6 → 3111,9
TableItems.append(Neu);
TableID.insert(pite.attribute("OwnLINK", "0").toInt(), Neu->ItemNr);
}
Neu->isGroupControl = static_cast<bool>(pite.attribute("isGroupControl", "0").toInt());
if (Neu->isGroupControl)
groupID.insert(Neu, pite.attribute("groupsLastItem", "0").toInt()+Neu->ItemNr);
pa = pa.nextSibling();
}
m_Doc->useRaster = savedAlignGrid;
3139,6 → 3161,14
ta->BottomLink = 0;
}
}
if (groupID.count() != 0)
{
QMap<PageItem*, int>::Iterator it;
for (it = groupID.begin(); it != groupID.end(); ++it)
{
it.key()->groupsLastItem = m_Doc->Items->at(it.data());
}
}
if (LFrames.count() != 0)
{
PageItem *Its;
3540,7 → 3570,7
if (item->GrType == 8)
{
ob.setAttribute("pattern", item->pattern());
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternXStep, patternYStep;
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
ob.setAttribute("pScaleX", patternScaleX);
ob.setAttribute("pScaleY", patternScaleY);
3987,6 → 4017,12
ob->setAttribute("BottomLINK", -1);
ob->setAttribute("OwnLINK", item->ItemNr);
}
ob->setAttribute("isGroupControl", static_cast<int>(item->isGroupControl));
if (item->isGroupControl)
{
if (item->groupsLastItem != 0)
ob->setAttribute("groupsLastItem", item->groupsLastItem->ItemNr - item->ItemNr);
}
ob->setAttribute("NUMDASH", static_cast<int>(item->DashValues.count()));
QString dlp = "";
QValueList<double>::Iterator dax;
/branches/Version13x/Scribus/scribus/plugins/psimport/import.prolog
529,8 → 529,8
% modified: 18.10.96
/i_close
{
beginX beginY i_line
(cp\n) print
beginX beginY i_line
} bind def
 
/storeMatrix
788,8 → 788,8
writecurrentlinecap
writecurrentlinejoin
writecurrentdash
clipCnt 1 eq
{ pathClipForStroke } if
% clipCnt 1 eq
% { pathClipForStroke } if
storeMatrix
 
{i_move} {i_line} {i_curve} {i_close} pathforall
805,8 → 805,8
writecurrentlinecap
writecurrentlinejoin
writecurrentdash
clipCnt 1 eq
{ pathClipAndClose } if
% clipCnt 1 eq
% { pathClipAndClose } if
storeMatrix % take transformation, scaling, rotation from PostScript
{i_move} {i_line} {i_curve} {i_close} pathforall
(f\n)print % close polygon
833,12 → 833,30
 
(ci\n)print % close clip polygon begin path
% we have to close the path!!
clip
/clipCnt 1 def
% clip
% /clipCnt 1 def
newpath % clear stack
end
} i_shortcutOverload
 
/eoclip
{
userdict begin
(n\n)print % start clip polygon
 
% FIXME: pathClipAndClose first?
 
storeMatrix % take transformation, scaling, rotation from PostScript
{i_move} {i_line} {i_curve} {i_close} pathforall
 
(ci\n)print % close clip polygon begin path
% we have to close the path!!
% clip
% /clipCnt 1 def
newpath % clear stack
end
} i_shortcutOverload
 
% we don't clip
% because this doesn't work for flattening text (show, charpath) with NeXT PostScript Code
/rectclip
879,8 → 897,8
(ci\n)print % close clip polygon begin path
% we have to close the path!!
rectclip
/clipCnt 1 def
% rectclip
% /clipCnt 1 def
newpath % clear stack
end
} i_shortcutOverload
1106,6 → 1124,7
/stateTop 0 def
/gsave
{
(gs\n) print
userdict begin
% (gs\n) print
stateArray stateTop gstate currentgstate put
1115,6 → 1134,7
 
/grestore
{
(gr\n) print
userdict begin
stateTop 1 lt
{
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.cpp
23,6 → 23,8
#include <qcursor.h>
#include <qdragobject.h>
#include <qregexp.h>
#include <qptrstack.h>
#include <qvaluestack.h>
#include <cmath>
#include <cstdlib>
 
196,10 → 198,60
QDir::setCurrent(CurDirP);
if ((Elements.count() > 1) && (interactive))
{
double minx = 99999.9;
double miny = 99999.9;
double maxx = -99999.9;
double maxy = -99999.9;
uint lowestItem = 999999;
uint highestItem = 0;
for (uint a = 0; a < Elements.count(); ++a)
{
Elements.at(a)->Groups.push(m_Doc->GroupCounter);
PageItem* currItem = Elements.at(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
highestItem = QMAX(highestItem, currItem->ItemNr);
double lw = currItem->lineWidth() / 2.0;
if (currItem->rotation() != 0)
{
FPointArray pb;
pb.resize(0);
pb.addPoint(FPoint(currItem->xPos()-lw, currItem->yPos()-lw));
pb.addPoint(FPoint(currItem->width()+lw*2.0, -lw, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
pb.addPoint(FPoint(currItem->width()+lw*2.0, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
double gy = miny;
double gw = maxx - minx;
double gh = maxy - miny;
PageItem *high = m_Doc->Items->at(highestItem);
int z = m_Doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, gx, gy, gw, gh, m_Doc->toolSettings.dWidth, m_Doc->toolSettings.dBrush, m_Doc->toolSettings.dPen, true);
PageItem *neu = m_Doc->Items->take(z);
m_Doc->Items->insert(lowestItem, neu);
neu->Groups.push(m_Doc->GroupCounter);
neu->setItemName( tr("Group%1").arg(neu->Groups.top()));
neu->isGroupControl = true;
neu->groupsLastItem = high;
for (uint a = 0; a < doc->Items->count(); ++a)
{
m_Doc->Items->at(a)->ItemNr = a;
}
Elements.prepend(neu);
m_Doc->GroupCounter++;
}
m_Doc->DoDrawing = true;
304,8 → 356,8
if( !cmd.isEmpty() )
args.append( cmd );
// then finish building the command and call gs
args.append( QString("-g%1x%2").arg(tmp2.setNum(qRound((b-x)*4))).arg(tmp3.setNum(qRound((h-y)*4))) );
args.append( "-r288");
args.append( QString("-g%1x%2").arg(tmp2.setNum(qRound((b-x)))).arg(tmp3.setNum(qRound((h-y)))) );
args.append( "-r72");
args.append( "-dTextAlphaBits=4" );
args.append( "-dGraphicsAlphaBits=4" );
args.append( "-c" );
377,6 → 429,9
double dcp;
bool fillRuleEvenOdd = true;
PageItem* ite;
QPtrStack<PageItem> groupStack;
QValueStack<int> gsStack;
QValueStack<int> gsStackMarks;
QFile f(fn);
lasttoken = "";
pagecount = 1;
467,6 → 522,14
ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
ite->setFillTransparency(1.0 - Opacity);
m_Doc->view()->AdjustItemSize(ite);
if (groupStack.count() != 0)
{
QValueStack<int> groupOld = groupStack.top()->Groups;
for (uint gg = 0; gg < groupOld.count(); gg++)
{
ite->Groups.push(groupOld[gg]);
}
}
Elements.append(ite);
}
lastPath = currPath;
509,6 → 572,14
ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
ite->setLineTransparency(1.0 - Opacity);
m_Doc->view()->AdjustItemSize(ite);
if (groupStack.count() != 0)
{
QValueStack<int> groupOld = groupStack.top()->Groups;
for (uint gg = 0; gg < groupOld.count(); gg++)
{
ite->Groups.push(groupOld[gg]);
}
}
Elements.append(ite);
}
lastPath = currPath;
522,10 → 593,57
else if (token == "ci")
{
clipCoords = Coords;
if (Coords.size() != 0)
{
z = m_Doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, 0, 0, 10, 10, 0, CommonStrings::None, CommonStrings::None, true);
ite = m_Doc->Items->at(z);
ite->PoLine = Coords.copy(); //FIXME: try to avoid copy if FPointArray when properly shared
ite->PoLine.translate(m_Doc->currentPage()->xOffset(), m_Doc->currentPage()->yOffset());
ite->ClipEdited = true;
ite->FrameType = 3;
// ite->fillRule = (fillRuleEvenOdd);
FPoint wh = getMaxClipF(&ite->PoLine);
ite->setWidthHeight(wh.x(),wh.y());
ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
// ite->setFillTransparency(1.0 - Opacity);
m_Doc->view()->AdjustItemSize(ite);
ite->Groups.push(m_Doc->GroupCounter);
if (groupStack.count() != 0)
{
QValueStack<int> groupOld = groupStack.top()->Groups;
for (uint gg = 0; gg < groupOld.count(); gg++)
{
ite->Groups.push(groupOld[gg]);
}
}
ite->isGroupControl = true;
ite->setItemName( tr("Group%1").arg(ite->Groups.top()));
Elements.append(ite);
groupStack.push(ite);
gsStackMarks.push(gsStack.count());
m_Doc->GroupCounter++;
}
Coords = FPointArray(0);
lastPath = "";
currPath = "";
}
else if (token == "gs")
{
gsStack.push(1);
}
else if (token == "gr")
{
gsStack.pop();
if (groupStack.count() != 0)
{
if (gsStack.count() < gsStackMarks.top())
{
PageItem *ite = groupStack.pop();
ite->groupsLastItem = Elements.at(Elements.count()-1);
gsStackMarks.pop();
}
}
}
else if (token == "w")
{
QTextStream Lw(&params, IO_ReadOnly);
600,6 → 718,14
lasttoken = token;
}
f.close();
if (groupStack.count() != 0)
{
while (!groupStack.isEmpty())
{
PageItem *ite = groupStack.pop();
ite->groupsLastItem = Elements.at(Elements.count()-1);
}
}
}
if (failedImages > 0)
{
/branches/Version13x/Scribus/scribus/pslib.cpp
32,6 → 32,7
#include <cstdlib>
#include <qregexp.h>
#include <qbuffer.h>
#include <qptrstack.h>
 
#include "commonstrings.h"
#include "scconfig.h"
1106,6 → 1107,7
 
int PSLib::CreatePS(ScribusDoc* Doc, std::vector<int> &pageNs, bool sep, QString SepNam, QStringList spots, bool farb, bool Hm, bool Vm, bool Ic, bool gcr, bool doDev, bool doClip, bool over)
{
QPtrStack<PageItem> groupStack;
int sepac;
int pagemult;
doOverprint = over;
1314,6 → 1316,20
PageItem *ite = Doc->Pages->at(a)->FromMaster.at(am);
if ((ite->LayerNr != ll.LNr) || (!ite->printEnabled()))
continue;
if (ite->isGroupControl)
{
PS_save();
FPointArray cl = ite->PoLine.copy();
QWMatrix mm;
mm.translate(ite->xPos() - Doc->Pages->at(a)->xOffset(), (ite->yPos() - Doc->Pages->at(a)->yOffset()) - Doc->Pages->at(a)->height());
mm.rotate(-ite->rotation());
cl.map( mm );
SetClipPath(&cl);
PS_closepath();
PS_clip(true);
groupStack.push(ite->groupsLastItem);
continue;
}
if (!(ite->asTextFrame()) && !(ite->asImageFrame()))
PS_UseTemplate(Doc->Pages->at(a)->MPageNam + tmps.setNum(ite->ItemNr));
else if (ite->asImageFrame())
1469,6 → 1485,14
}
PS_restore();
}
if (groupStack.count() != 0)
{
while (ite == groupStack.top())
{
PS_restore();
groupStack.pop();
}
}
}
}
for (uint am = 0; am < Doc->Pages->at(a)->FromMaster.count(); ++am)
2082,6 → 2106,7
QString chstr, chglyph, tmp;
PageItem *c;
QPtrList<PageItem> PItems;
QPtrStack<PageItem> groupStack;
int Lnr = 0;
struct Layer ll;
ll.isPrintable = false;
2122,7 → 2147,29
continue;
if ((!a->pageName().isEmpty()) && (c->OwnPage != static_cast<int>(a->pageNr())) && (c->OwnPage != -1))
continue;
if (c->isGroupControl)
{
PS_save();
FPointArray cl = c->PoLine.copy();
QWMatrix mm;
mm.translate(c->xPos() - a->xOffset(), (c->yPos() - a->yOffset()) - a->height());
mm.rotate(-c->rotation());
cl.map( mm );
SetClipPath(&cl);
PS_closepath();
PS_clip(true);
groupStack.push(c->groupsLastItem);
continue;
}
ProcessItem(Doc, a, c, PNr, sep, farb, ic, gcr, false);
if (groupStack.count() != 0)
{
while (c == groupStack.top())
{
PS_restore();
groupStack.pop();
}
}
}
}
for (b = 0; b < PItems.count(); ++b)