Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2024 → Rev 2025

/branches/Version13x/Scribus/scribus/fileloader.cpp
452,6 → 452,7
doc->toolSettings.scaleY = QStodouble(dc.attribute("PICTSCY","1"));
doc->toolSettings.scaleType = static_cast<bool>(QStoInt(dc.attribute("PSCALE", "1")));
doc->toolSettings.aspectRatio = static_cast<bool>(QStoInt(dc.attribute("PASPECT", "0")));
doc->toolSettings.lowResType = QStoInt(dc.attribute("HalfRes", "1"));
if (dc.hasAttribute("PEN"))
doc->toolSettings.dPen = dc.attribute("PEN");
if (dc.hasAttribute("BRUSH"))
/branches/Version13x/Scribus/scribus/scimage.h
56,7 → 56,7
QString MaskToTxt(bool PDF = true);
QString MaskToTxt14();
void swapRGBA();
void createHalfRes();
void createLowRes(double scale);
void scaleImage(int width, int height);
bool LoadPicture(QString fn, QString Prof, int rend, bool useEmbedded, bool useProf, int requestType, int gsRes, bool *realCMYK = 0);
QString getAlpha(QString fn, bool PDF, bool pdf14);
116,7 → 116,8
bool valid;
bool isRequest;
bool progressive;
bool isHalfRes;
int lowResType; /* 0 = full Resolution, 1 = 72 dpi, 2 = 36 dpi */
double lowResScale;
double pathXoffset;
double pathYoffset;
QMap<QString, FPointArray> PDSpathData;
/branches/Version13x/Scribus/scribus/tabtools.h
9,6 → 9,7
#include <qbuttongroup.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qwidgetstack.h>
#include "scfonts.h"
class LinkButton;
86,7 → 87,10
LinkButton* chainButton;
QButtonGroup* buttonGroup5;
QCheckBox* checkRatioImage;
QCheckBox* checkHalfRes;
QButtonGroup* buttonGroupRes;
QRadioButton* checkFullRes;
QRadioButton* checkNormalRes;
QRadioButton* checkHalfRes;
QWidget* subTabPolygon;
PolygonWidget* polyWidget;
QWidget* subTabZoom;
121,6 → 125,7
QGridLayout* subTabImageLayout;
QGridLayout* buttonGroup3Layout;
QHBoxLayout* buttonGroup5Layout;
QVBoxLayout* buttonGroupResLayout;
QHBoxLayout* subTabPolygonLayout;
QGridLayout* subTabZoomLayout;
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
100,7 → 100,7
toolSettings.scaleY = prefsData->toolSettings.scaleY;
toolSettings.scaleType = prefsData->toolSettings.scaleType;
toolSettings.aspectRatio = prefsData->toolSettings.aspectRatio;
toolSettings.halfRes = prefsData->toolSettings.halfRes;
toolSettings.lowResType = prefsData->toolSettings.lowResType;
toolSettings.dCols = prefsData->toolSettings.dCols;
toolSettings.dGap = prefsData->toolSettings.dGap;
toolSettings.dLineArt = PenStyle(prefsData->toolSettings.dLineArt);
/branches/Version13x/Scribus/scribus/scribusXml.cpp
2714,6 → 2714,7
dc.setAttribute("PICTSCY",doc->toolSettings.scaleY);
dc.setAttribute("PSCALE", static_cast<int>(doc->toolSettings.scaleType));
dc.setAttribute("PASPECT", static_cast<int>(doc->toolSettings.aspectRatio));
dc.setAttribute("HalfRes", doc->toolSettings.lowResType);
dc.setAttribute("MINORC",doc->guidesSettings.minorColor.name());
dc.setAttribute("MAJORC",doc->guidesSettings.majorColor.name());
dc.setAttribute("GuideC", doc->guidesSettings.guideColor.name());
3093,7 → 3094,7
dc9.setAttribute("POLYS", static_cast<int>(Vor->toolSettings.polyS));
dc9.setAttribute("PSCALE", static_cast<int>(Vor->toolSettings.scaleType));
dc9.setAttribute("PASPECT", static_cast<int>(Vor->toolSettings.aspectRatio));
dc9.setAttribute("HalfRes", static_cast<int>(Vor->toolSettings.halfRes));
dc9.setAttribute("HalfRes", Vor->toolSettings.lowResType);
dc9.setAttribute("StartArrow", Vor->toolSettings.dStartArrow);
dc9.setAttribute("EndArrow", Vor->toolSettings.dEndArrow);
elem.appendChild(dc9);
3432,7 → 3433,7
Vorein->toolSettings.scaleY = QStodouble(dc.attribute("PICTSCY","1"));
Vorein->toolSettings.scaleType = static_cast<bool>(QStoInt(dc.attribute("PSCALE", "1")));
Vorein->toolSettings.aspectRatio = static_cast<bool>(QStoInt(dc.attribute("PASPECT", "0")));
Vorein->toolSettings.halfRes = static_cast<bool>(QStoInt(dc.attribute("HalfRes", "0")));
Vorein->toolSettings.lowResType = QStoInt(dc.attribute("HalfRes", "1"));
Vorein->toolSettings.polyC = QStoInt(dc.attribute("POLYC", "4"));
Vorein->toolSettings.polyF = QStodouble(dc.attribute("POLYF", "0.5"));
Vorein->toolSettings.polyR = QStodouble(dc.attribute("POLYR", "0"));
/branches/Version13x/Scribus/scribus/tabtools.cpp
463,10 → 463,36
subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft );
textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" );
subTabImageLayout->addWidget( textLabel20b, 3, 0 );
checkHalfRes = new QCheckBox( subTabImage, "checkHalfRes" );
buttonGroupRes = new QButtonGroup( subTabImage, "buttonGroup3" );
buttonGroupRes->setColumnLayout(0, Qt::Vertical );
buttonGroupRes->layout()->setSpacing( 6 );
buttonGroupRes->layout()->setMargin( 11 );
buttonGroupRes->setExclusive( true );
buttonGroupRes->setTitle( tr( "On Screen Preview" ) );
buttonGroupResLayout = new QVBoxLayout( buttonGroupRes->layout() );
buttonGroupResLayout->setAlignment( Qt::AlignTop );
checkFullRes = new QRadioButton( buttonGroupRes, "checkFullRes" );
checkFullRes->setText( tr( "Full Resolution Preview" ) );
buttonGroupResLayout->addWidget( checkFullRes );
checkNormalRes = new QRadioButton( buttonGroupRes, "checkNormalRes" );
checkNormalRes->setText( tr( "Normal Resolution Preview" ) );
buttonGroupResLayout->addWidget( checkNormalRes );
checkHalfRes = new QRadioButton( buttonGroupRes, "checkHalfRes" );
checkHalfRes->setText( tr( "Low Resolution Preview" ) );
checkHalfRes->setChecked(prefsData->halfRes);
subTabImageLayout->addMultiCellWidget( checkHalfRes, 4, 4, 0, 1 );
buttonGroupResLayout->addWidget( checkHalfRes );
switch (prefsData->lowResType)
{
case 0:
checkFullRes->setChecked(true);
break;
case 1:
checkNormalRes->setChecked(true);
break;
case 2:
checkHalfRes->setChecked(true);
break;
}
subTabImageLayout->addMultiCellWidget( buttonGroupRes, 4, 4, 0, 1 );
subStackTools->addWidget( subTabImage, 3 );
 
subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
/branches/Version13x/Scribus/scribus/scribusstructs.h
377,7 → 377,7
double scaleY;
bool scaleType;
bool aspectRatio;
bool halfRes;
int lowResType;
/* Magnifier Tool */
int magMin;
int magMax;
/branches/Version13x/Scribus/scribus/extimageprops.cpp
291,6 → 291,7
{
currentItem->PoLine = currentItem->pixm.imgInfo.PDSpathData[c->text()].copy();
currentItem->pixm.imgInfo.usedPath = c->text();
viewWidget->MoveItem(currentItem->pixm.imgInfo.pathXoffset, currentItem->pixm.imgInfo.pathYoffset, currentItem, false);
QWMatrix cl;
cl.scale(72.0 / currentItem->pixm.imgInfo.xres, 72.0 / currentItem->pixm.imgInfo.yres);
currentItem->PoLine.map(cl);
303,12 → 304,12
currentItem->LocalX = 0;
currentItem->LocalY = 0;
viewWidget->AdjustItemSize(currentItem);
if (oldFT == 3)
/* if (oldFT == 3)
{
viewWidget->MoveItem(lx- currentItem->Xpos, ly - currentItem->Ypos, currentItem, false);
}
currentItem->pixm.imgInfo.pathXoffset = currentItem->Xpos - lx;
currentItem->pixm.imgInfo.pathYoffset = currentItem->Ypos - ly;
} */
currentItem->pixm.imgInfo.pathXoffset = lx- currentItem->Xpos;
currentItem->pixm.imgInfo.pathYoffset = ly - currentItem->Ypos;
viewWidget->setRedrawBounding(currentItem);
viewWidget->updateContents();
}
/branches/Version13x/Scribus/scribus/pageitem.cpp
534,8 → 534,8
}
p->scale(LocalScX, LocalScY);
p->translate(LocalX*LocalScX*sc, LocalY*LocalScY*sc);
if (Doc->toolSettings.halfRes)
p->scale(2, 2);
if (pixm.imgInfo.lowResType != 0)
p->scale(pixm.imgInfo.lowResScale, pixm.imgInfo.lowResScale);
if (InvPict)
{
QImage ip = pixm.copy();
/branches/Version13x/Scribus/scribus/scribusview.cpp
6405,10 → 6405,10
yP = qRound(y / Scale);
QPainter p;
QString chx;
p.begin(viewport());
p.begin(this);
// ToView(&p);
Transform(currItem, &p);
mpo = QRect(xP - Doc->guidesSettings.grabRad, yP - Doc->guidesSettings.grabRad, Doc->guidesSettings.grabRad*2, Doc->guidesSettings.grabRad*2);
mpo = QRect(x - Doc->guidesSettings.grabRad, y - Doc->guidesSettings.grabRad, Doc->guidesSettings.grabRad*2, Doc->guidesSettings.grabRad*2);
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(currItem->Width), static_cast<int>(currItem->Height))))).contains(mpo)) ||
(QRegion(p.xForm(currItem->Clip)).contains(mpo)))
{
7647,8 → 7647,8
PageItem *currItem = SelItem.at(0);
if (currItem->PicAvail)
{
double w = static_cast<double>(currItem->pixm.width());
double h = static_cast<double>(currItem->pixm.height());
double w = static_cast<double>(currItem->pixm.width())*currItem->pixm.imgInfo.lowResScale * currItem->LocalScX;
double h = static_cast<double>(currItem->pixm.height())*currItem->pixm.imgInfo.lowResScale * currItem->LocalScY;
double x = currItem->LocalX * currItem->LocalScX;
double y = currItem->LocalY * currItem->LocalScY;
if (!currItem->isTableItem)
10457,11 → 10457,23
Item->OrigW = Item->pixm.width();
Item->OrigH = Item->pixm.height();
Item->isRaster = true;
Item->IProfile = "Embedded " + Item->pixm.imgInfo.profileName;
Item->EmProfile = "Embedded " + Item->pixm.imgInfo.profileName;
if (Item->pixm.imgInfo.profileName != "")
{
Item->IProfile = "Embedded " + Item->pixm.imgInfo.profileName;
Item->EmProfile = "Embedded " + Item->pixm.imgInfo.profileName;
}
}
if (Doc->toolSettings.halfRes)
Item->pixm.createHalfRes();
if (Doc->toolSettings.lowResType != 0)
{
double scaling = 1.0;
if (Doc->toolSettings.lowResType == 1)
scaling = Item->pixm.imgInfo.xres / 72.0;
else
scaling = Item->pixm.imgInfo.xres / 36.0;
Item->pixm.createLowRes(scaling);
Item->pixm.imgInfo.lowResScale = scaling;
}
Item->pixm.imgInfo.lowResType = Doc->toolSettings.lowResType;
if (!Doc->loading)
{
emit RasterPic(Item->isRaster);
/branches/Version13x/Scribus/scribus/scimage.cpp
73,7 → 73,8
imgInfo.valid = false;
imgInfo.isRequest = false;
imgInfo.progressive = false;
imgInfo.isHalfRes = false;
imgInfo.lowResType = 1;
imgInfo.lowResScale = 1.0;
imgInfo.PDSpathData.clear();
imgInfo.RequestProps.clear();
imgInfo.clipPath = "";
101,10 → 102,10
}
}
 
void ScImage::createHalfRes()
void ScImage::createLowRes(double scale)
{
int w = width() / 2;
int h = height() / 2;
int w = qRound(width() / scale);
int h = qRound(height() / scale);
QImage tmp = smoothScale(w, h);
create(w, h, 32);
for( int yi=0; yi < tmp.height(); ++yi )
118,7 → 119,6
d++;
}
}
imgInfo.isHalfRes = true;
}
 
void ScImage::Convert2JPG(QString fn, int Quality, bool isCMYK, bool isGray)
2562,7 → 2562,7
{
xres = dotsPerMeterX() * 0.0254;
yres = dotsPerMeterY() * 0.0254;
convertDepth(32);
*this = convertDepth(32);
setAlphaBuffer(true);
imgInfo.colorspace = 0;
imgInfo.xres = qRound(xres);
/branches/Version13x/Scribus/scribus/scribus.cpp
492,7 → 492,7
Prefs.LeftPageFirst = false;
Prefs.toolSettings.scaleType = true;
Prefs.toolSettings.aspectRatio = true;
Prefs.toolSettings.halfRes = false;
Prefs.toolSettings.lowResType = 1;
Prefs.MinWordLen = 3;
Prefs.HyCount = 2;
Prefs.Language = "";
3008,9 → 3008,16
doc->toolSettings.scaleY = static_cast<double>(dia->tabTools->scalingVertical->value()) / 100.0;
doc->toolSettings.scaleType = dia->tabTools->buttonGroup3->isChecked();
doc->toolSettings.aspectRatio = dia->tabTools->checkRatioImage->isChecked();
if (doc->toolSettings.halfRes != dia->tabTools->checkHalfRes->isChecked())
int haRes = 0;
if (dia->tabTools->checkFullRes->isChecked())
haRes = 0;
if (dia->tabTools->checkNormalRes->isChecked())
haRes = 1;
if (dia->tabTools->checkHalfRes->isChecked())
haRes = 2;
if (doc->toolSettings.lowResType != haRes)
{
doc->toolSettings.halfRes = dia->tabTools->checkHalfRes->isChecked();
doc->toolSettings.lowResType = haRes;
view->RecalcPicturesRes();
}
dia->tabTools->polyWidget->getValues(&doc->toolSettings.polyC, &doc->toolSettings.polyFd, &doc->toolSettings.polyF, &doc->toolSettings.polyS, &doc->toolSettings.polyR);
6428,6 → 6435,7
ite->isSingleSel = false;
if (ite->isBookmark)
DelBookMark(ite);
ite->isBookmark = false;
view->SelItem.append(ite);
}
}
6491,6 → 6499,7
ite->isSingleSel = false;
if (ite->isBookmark)
DelBookMark(ite);
ite->isBookmark = false;
view->SelItem.append(ite);
}
}
7804,7 → 7813,14
Prefs.toolSettings.scaleY = static_cast<double>(dia->tabTools->scalingVertical->value()) / 100.0;
Prefs.toolSettings.scaleType = dia->tabTools->buttonGroup3->isChecked();
Prefs.toolSettings.aspectRatio = dia->tabTools->checkRatioImage->isChecked();
Prefs.toolSettings.halfRes = dia->tabTools->checkHalfRes->isChecked();
int haRes = 0;
if (dia->tabTools->checkFullRes->isChecked())
haRes = 0;
if (dia->tabTools->checkNormalRes->isChecked())
haRes = 1;
if (dia->tabTools->checkHalfRes->isChecked())
haRes = 2;
Prefs.toolSettings.lowResType = haRes;
Prefs.AutoSave = dia->ASon->isChecked();
Prefs.AutoSaveTime = dia->ASTime->value() * 60 * 1000;
Prefs.MinWordLen = dia->tabHyphenator->wordLen->value();