Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 166 → Rev 167

/trunk/Scribus/ChangeLogCVS
1,4 → 1,8
Changes since Version 1.1.4
21.01.2004 Added the possiblity to search and replace Font Effects.
Updated the Danish Translation.
Updated the British Translation.
 
20.01.2004 First Version of the "Search/Replace" Dialog working.
 
19.01.2004 Started a "Search/Replace Dialog".
/trunk/Scribus/scribus/pdfopts.cpp
25,7 → 25,7
FontsToEmbed.clear();
view = vie;
EffVal = Eff;
Einheit = view->Doc->Einheit;
Einheit = view->Doc->Einheit;
PDFOptsLayout = new QVBoxLayout( this );
PDFOptsLayout->setSpacing( 6 );
PDFOptsLayout->setMargin( 11 );
38,13 → 38,13
Layout5->setMargin( 0 );
Datei = new QLineEdit( this, "Datei" );
Datei->setMinimumSize( QSize( 268, 22 ) );
if (Optionen->Datei != "")
Datei->setText(Optionen->Datei);
else
{
if (Optionen->Datei != "")
Datei->setText(Optionen->Datei);
else
{
QFileInfo fi = QFileInfo(Fname);
Datei->setText(fi.dirPath()+"/"+fi.baseName()+".pdf");
}
}
Layout5->addWidget( Datei );
FileC = new QToolButton( this, "FileC" );
FileC->setMinimumSize( QSize( 88, 24 ) );
84,13 → 84,13
FirstPage = new QSpinBox( RangeGroup, "FirstPage" );
FirstPage->setMaxValue(view->Pages.count());
FirstPage->setMinValue( 1 );
FirstPage->setValue(1);
LastPage->setValue(view->Pages.count());
FirstPage->setValue(1);
LastPage->setValue(view->Pages.count());
Layout11->addWidget( FirstPage, 0, 1 );
RangeGroupLayout->addLayout( Layout11 );
FirstPage->setEnabled(false);
LastPage->setEnabled(false);
RText->setEnabled(false);
FirstPage->setEnabled(false);
LastPage->setEnabled(false);
RText->setEnabled(false);
Layout13->addWidget( RangeGroup );
 
GroupBox1 = new QGroupBox( tab, "GroupBox1" );
110,23 → 110,23
ComboBox1->insertItem("Acrobat 4.0");
ComboBox1->insertItem("Acrobat 5.0");
#ifdef HAVE_CMS
if ((CMSuse) && (CMSavail) && (!PDFXProfiles->isEmpty()))
if ((CMSuse) && (CMSavail) && (!PDFXProfiles->isEmpty()))
ComboBox1->insertItem("PDF/X-3");
#endif
ComboBox1->setEditable(false);
#ifdef HAVE_CMS
if ((CMSuse) && (CMSavail))
{
if (Optionen->Version == 12)
ComboBox1->setCurrentItem(2);
}
else
ComboBox1->setCurrentItem(0);
if ((CMSuse) && (CMSavail))
{
if (Optionen->Version == 12)
ComboBox1->setCurrentItem(2);
}
else
ComboBox1->setCurrentItem(0);
#endif
if (Optionen->Version == 13)
ComboBox1->setCurrentItem(0);
if (Optionen->Version == 14)
ComboBox1->setCurrentItem(1);
if (Optionen->Version == 13)
ComboBox1->setCurrentItem(0);
if (Optionen->Version == 14)
ComboBox1->setCurrentItem(1);
GroupBox1Layout->addMultiCellWidget( ComboBox1, 0, 0, 1, 2, AlignLeft );
TextLabel1x = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1x->setText( tr( "Binding:" ) );
136,19 → 136,19
ComboBind->insertItem( tr("Left Margin"));
ComboBind->insertItem( tr("Right Margin"));
ComboBind->setEditable(false);
ComboBind->setCurrentItem(Optionen->Binding);
ComboBind->setCurrentItem(Optionen->Binding);
GroupBox1Layout->addMultiCellWidget( ComboBind, 1, 1, 1, 2, AlignLeft );
CheckBox1 = new QCheckBox( GroupBox1, "CheckBox1" );
CheckBox1->setText( tr( "Generate Thumbnails" ) );
CheckBox1->setChecked(Optionen->Thumbnails);
CheckBox1->setChecked(Optionen->Thumbnails);
GroupBox1Layout->addMultiCellWidget( CheckBox1, 2, 2, 0, 2 );
Article = new QCheckBox( GroupBox1, "CheckBox1" );
Article->setText( tr( "Save linked Text Frames as PDF-Articles" ) );
Article->setChecked(Optionen->Articles);
Article->setChecked(Optionen->Articles);
GroupBox1Layout->addMultiCellWidget( Article, 3, 3, 0, 2 );
CheckBM = new QCheckBox( GroupBox1, "E" );
CheckBM->setText( tr( "Include Bookmarks" ) );
CheckBM->setChecked(Optionen->Bookmarks);
CheckBM->setChecked(Optionen->Bookmarks);
GroupBox1Layout->addMultiCellWidget( CheckBM, 4, 4, 0, 2 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setText( tr( "Resolution:" ) );
173,7 → 173,7
GroupBox2Layout->setMargin( 11 );
DSColor = new QCheckBox( GroupBox2, "DSColor" );
DSColor->setText( tr( "Downsample Images to:" ) );
DSColor->setChecked(Optionen->RecalcPic);
DSColor->setChecked(Optionen->RecalcPic);
GroupBox2Layout->addWidget( DSColor, 1, 0 );
ValC = new QSpinBox( GroupBox2, "ValC" );
ValC->setSuffix( tr( " dpi" ) );
180,10 → 180,7
ValC->setMaxValue( 4000 );
ValC->setMinValue( 35 );
ValC->setValue(Optionen->PicRes);
if (DSColor->isChecked())
ValC->setEnabled(true);
else
ValC->setEnabled(false);
ValC->setEnabled(DSColor->isChecked() ? true : false);
GroupBox2Layout->addWidget( ValC, 1, 1, AlignLeft );
Compression = new QCheckBox( GroupBox2, "Compression" );
Compression->setText( tr( "Compress Text and Vector Graphics" ) );
214,21 → 211,21
TextFont1->setText( tr( "Available Fonts:" ) );
Layout4_2->addWidget( TextFont1 );
AvailFlist = new QListBox( GroupFont, "AvailFlist" );
QMap<QString,QFont>::Iterator it;
for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
{
if (AllFonts[it.key()]->HasMetrics)
QMap<QString,QFont>::Iterator it;
for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
{
if (AllFonts[it.key()]->HasMetrics)
AvailFlist->insertItem(loadIcon("ok.png"), it.key());
else
{
else
{
AvailFlist->insertItem(it.key());
AvailFlist->item(AvailFlist->count()-1)->setSelectable(false);
}
}
AvailFlist->item(AvailFlist->count()-1)->setSelectable(false);
}
}
AvailFlist->setMinimumSize(QSize(150, 140));
AvailFlist->setMaximumSize(QSize(150, 140));
Layout4_2->addWidget( AvailFlist );
GroupFontLayout->addLayout( Layout4_2 );
GroupFontLayout->addLayout( Layout4_2 );
Layout5_2 = new QVBoxLayout;
Layout5_2->setSpacing( 6 );
Layout5_2->setMargin( 0 );
250,20 → 247,19
EmbedList = new QListBox( GroupFont, "EmbedList" );
EmbedList->setMinimumSize(QSize(150, 140));
EmbedList->setMaximumSize(QSize(150, 140));
if (Optionen->EmbedList.count() != 0)
{
for (uint efo = 0; efo < Optionen->EmbedList.count(); efo++)
{
EmbedList->insertItem(Optionen->EmbedList[efo]);
FontsToEmbed.append(Optionen->EmbedList[efo]);
}
}
if (Optionen->EmbedList.count() != 0)
{
for (uint efo = 0; efo < Optionen->EmbedList.count(); ++efo)
{
EmbedList->insertItem(Optionen->EmbedList[efo]);
FontsToEmbed.append(Optionen->EmbedList[efo]);
}
}
Layout6->addWidget( EmbedList );
GroupFontLayout->addLayout( Layout6 );
tabLayout_3->addWidget( GroupFont );
Options->insertTab( tab_3, tr( "Fonts" ) );
 
tab_5 = new QWidget( Options, "tab_5" );
tab_5 = new QWidget( Options, "tab_5" );
tabLayout_5 = new QGridLayout( tab_5 );
tabLayout_5->setSpacing( 6 );
tabLayout_5->setMargin( 11 );
270,19 → 266,19
CheckBox10 = new QCheckBox( tab_5, "CheckBox10" );
CheckBox10->setText( tr( "Enable Presentation Effects" ) );
CheckBox10->setChecked(Optionen->PresentMode);
tabLayout_5->addMultiCellWidget( CheckBox10, 0, 0, 0, 1 );
 
Pages = new QListBox( tab_5, "Pages" );
Pages->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, Pages->sizePolicy().hasHeightForWidth() ) );
tabLayout_5->addMultiCellWidget( CheckBox10, 0, 0, 0, 1 );
Pages = new QListBox( tab_5, "Pages" );
Pages->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1,
Pages->sizePolicy().hasHeightForWidth() ) );
QString tmp;
struct PreSet ef;
if (EffVal.count() != 0)
{
if (EffVal.count() != 0)
{
for (uint pg2 = 0; pg2 < vie->Pages.count(); ++pg2)
{
{
Pages->insertItem( tr("Page")+" "+tmp.setNum(pg2+1));
if (EffVal.count()-1 < pg2)
{
if (EffVal.count()-1 < pg2)
{
ef.EffektLen = 1;
ef.AnzeigeLen = 1;
ef.Effekt = 0;
290,13 → 286,13
ef.M = 0;
ef.Di = 0;
EffVal.append(ef);
}
}
}
else
{
}
}
else
{
for (uint pg = 0; pg < vie->Pages.count(); ++pg)
{
{
Pages->insertItem( tr("Page")+" "+tmp.setNum(pg+1));
ef.EffektLen = 1;
ef.AnzeigeLen = 1;
305,14 → 301,13
ef.M = 0;
ef.Di = 0;
EffVal.append(ef);
}
}
}
}
tabLayout_5->addWidget( Pages, 1, 0 );
PagePrev = new QCheckBox( tab_5, "CheckBox10" );
PagePrev->setText( tr( "Show Page Previews" ) );
PagePrev->setChecked(false);
tabLayout_5->addWidget( PagePrev, 2, 0 );
 
tabLayout_5->addWidget( PagePrev, 2, 0 );
Effects = new QGroupBox( tab_5, "Effects" );
Effects->setTitle( tr( "Effects" ) );
Effects->setColumnLayout(0, Qt::Vertical );
327,19 → 322,19
EffectsLayout->addWidget( TextLabel1e, 0, 0 );
TextLabel2e = new QLabel( Effects, "TextLabel2_2" );
TextLabel2e->setText( tr( "Effect Duration:" ) );
EffectsLayout->addWidget( TextLabel2e, 1, 0 );
EffectsLayout->addWidget( TextLabel2e, 1, 0 );
TextLabel3e = new QLabel( Effects, "TextLabel3_2" );
TextLabel3e->setText( tr( "Effect Type:" ) );
EffectsLayout->addWidget( TextLabel3e, 2, 0 );
EffectsLayout->addWidget( TextLabel3e, 2, 0 );
TextLabel4e = new QLabel( Effects, "TextLabel4_2" );
TextLabel4e->setText( tr( "Moving Lines:" ) );
EffectsLayout->addWidget( TextLabel4e, 3, 0 );
EffectsLayout->addWidget( TextLabel4e, 3, 0 );
TextLabel5e = new QLabel( Effects, "TextLabel6" );
TextLabel5e->setText( tr( "from the:" ) );
EffectsLayout->addWidget( TextLabel5e, 4, 0 );
TextLabel6e = new QLabel( Effects, "TextLabel5" );
TextLabel6e = new QLabel( Effects, "TextLabel5" );
TextLabel6e->setText( tr( "Direction:" ) );
EffectsLayout->addWidget( TextLabel6e, 5, 0 );
EffectsLayout->addWidget( TextLabel6e, 5, 0 );
PageTime = new QSpinBox( Effects, "PageTime" );
PageTime->setSuffix( tr( " sec" ) );
PageTime->setMaxValue( 3600 );
353,13 → 348,10
EffectTime->setValue(EffVal[0].EffektLen);
EffectsLayout->addWidget( EffectTime, 1, 1 );
EffectType = new QComboBox( true, Effects, "EffectType" );
EffectType->insertItem( tr( "No Effect" ) );
EffectType->insertItem( tr( "Blinds" ) );
EffectType->insertItem( tr( "Box" ) );
EffectType->insertItem( tr( "Dissolve" ) );
EffectType->insertItem( tr( "Glitter" ) );
EffectType->insertItem( tr( "Split" ) );
EffectType->insertItem( tr( "Wipe" ) );
char *tmpc[] = {"No Effect", "Blinds", "Box", "Dissolve", "Glitter", "Split", "Wipe"};
size_t ar = sizeof(tmpc) / sizeof(*tmpc);
for (uint a = 0; a < ar; ++a)
EffectType->insertItem(tr(tmpc[a]));
EffectType->setEditable(false);
EffectsLayout->addWidget( EffectType, 2, 1 );
EDirection = new QComboBox( true, Effects, "EDirection" );
373,16 → 365,16
EDirection_2->setEditable(false);
EffectsLayout->addWidget( EDirection_2, 4, 1 );
EDirection_2_2 = new QComboBox( true, Effects, "EDirection_2_2" );
EDirection_2_2->insertItem( tr( "Left to Right" ) );
EDirection_2_2->insertItem( tr( "Top to Bottom" ) );
EDirection_2_2->insertItem( tr( "Bottom to Top" ) );
EDirection_2_2->insertItem( tr( "Right to Left" ) );
EDirection_2_2->insertItem( tr( "Top-Left to Bottom-Right" ) );
char *tmp_ed[] = {"Left to Right", "Top to Bottom", "Bottom to Top", "Right to Left",
"Top-left to Bottom-Right"};
size_t ar_ed = sizeof(tmp_ed) / sizeof(*tmp_ed);
for (uint a = 0; a < ar_ed; ++a)
EDirection_2_2->insertItem(tr(tmp_ed[a]));
EDirection_2_2->setEditable(false);
EffectsLayout->addWidget( EDirection_2_2, 5, 1 );
EonAllPg = new QPushButton( Effects, "Eon" );
EffectsLayout->addWidget( EDirection_2_2, 5, 1 );
EonAllPg = new QPushButton( Effects, "Eon" );
EonAllPg->setText( tr( "Apply Effect on all Pages" ) );
EffectsLayout->addMultiCellWidget( EonAllPg, 6, 6, 0, 1 );
EffectsLayout->addMultiCellWidget( EonAllPg, 6, 6, 0, 1 );
tabLayout_5->addMultiCellWidget( Effects, 1, 2, 1, 1 );
Options->insertTab( tab_5, tr( "Extras" ) );
 
393,7 → 385,8
Encry->setChecked( Optionen->Encrypt );
tabsecLayout->addWidget( Encry );
GroupPass = new QGroupBox( tabsec, "GroupPass" );
GroupPass->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, GroupPass->sizePolicy().hasHeightForWidth() ) );
GroupPass->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0,
GroupPass->sizePolicy().hasHeightForWidth() ) );
GroupPass->setTitle( tr( "Passwords" ) );
GroupPass->setColumnLayout(0, Qt::Vertical );
GroupPass->layout()->setSpacing( 6 );
408,16 → 401,17
GroupPassLayout->addWidget( TextSec1, 0, 0 );
PassOwner = new QLineEdit( GroupPass, "PassOwner" );
PassOwner->setEchoMode( QLineEdit::Password );
PassOwner->setText(Optionen->PassOwner);
PassOwner->setText(Optionen->PassOwner);
GroupPassLayout->addWidget( PassOwner, 0, 1 );
PassUser = new QLineEdit( GroupPass, "PassUser" );
PassUser->setEchoMode( QLineEdit::Password );
PassUser->setText(Optionen->PassUser);
PassUser->setText(Optionen->PassUser);
GroupPassLayout->addWidget( PassUser, 1, 1 );
tabsecLayout->addWidget( GroupPass );
 
GroupSecSet = new QGroupBox( tabsec, "GroupSecSet" );
GroupSecSet->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, GroupSecSet->sizePolicy().hasHeightForWidth() ) );
GroupSecSet->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0,
GroupSecSet->sizePolicy().hasHeightForWidth() ) );
GroupSecSet->setTitle( tr( "Settings" ) );
GroupSecSet->setColumnLayout(0, Qt::Vertical );
GroupSecSet->layout()->setSpacing( 6 );
441,11 → 435,11
AddSec->setChecked( Optionen->Permissions & 32 );
GroupSecSetLayout->addWidget( AddSec );
tabsecLayout->addWidget( GroupSecSet );
if (!Encry->isChecked())
{
GroupSecSet->setEnabled(false);
GroupPass->setEnabled(false);
}
if (!Encry->isChecked())
{
GroupSecSet->setEnabled(false);
GroupPass->setEnabled(false);
}
Options->insertTab( tabsec, tr( "Security" ) );
 
tabcolor = new QWidget( Options, "tabcolor" );
463,11 → 457,8
OutCombo = new QComboBox( true, ColorGroup, "OutCombo" );
OutCombo->insertItem( tr( "Screen / Web" ) );
OutCombo->insertItem( tr( "Printer" ) );
OutCombo->setEditable(false);
if (Optionen->UseRGB)
OutCombo->setCurrentItem(0);
else
OutCombo->setCurrentItem(1);
OutCombo->setEditable(false);
OutCombo->setCurrentItem(Optionen->UseRGB ? 0 : 1);
ColorGroupLayout->addWidget( OutCombo );
tabcolorLayout->addWidget( ColorGroup );
 
480,7 → 471,7
GroupBox9Layout->setAlignment( Qt::AlignTop );
EmbedProfs = new QCheckBox( GroupBox9, "EmbedProfs" );
EmbedProfs->setText( tr( "Use ICC-Profile" ) );
EmbedProfs->setChecked(Optionen->UseProfiles);
EmbedProfs->setChecked(Optionen->UseProfiles);
GroupBox9Layout->addMultiCellWidget( EmbedProfs, 0, 0, 0, 1 );
ProfsTxt1 = new QLabel(GroupBox9, "ProfsTxt1");
ProfsTxt1->setText( tr( "Profile:" ) );
489,14 → 480,14
ProfsTxt2->setText( tr( "Rendering-Intent:" ) );
GroupBox9Layout->addWidget( ProfsTxt2, 1, 1 );
SolidPr = new QComboBox(true, GroupBox9, "SolidPr" );
SolidPr->setEditable(false);
SolidPr->setEditable(false);
GroupBox9Layout->addWidget( SolidPr, 2, 0 );
IntendS = new QComboBox( true, GroupBox9, "IntendS" );
IntendS->insertItem( tr( "Perceptual" ) );
IntendS->insertItem( tr( "Relative Colorimetric" ) );
IntendS->insertItem( tr( "Saturation" ) );
IntendS->insertItem( tr( "Absolute Colorimetric" ) );
IntendS->setEditable(false);
char *tmp_ip[] = {"Perceptual", "Relative Colorimetric", "Saturation", "Absolute Colorimetric"};
size_t ar_ip = sizeof(tmp_ip) / sizeof(*tmp_ip);
for (uint a = 0; a < ar_ip; ++a)
IntendS->insertItem(tr(tmp_ip[a]));
IntendS->setEditable(false);
GroupBox9Layout->addWidget( IntendS, 2, 1 );
tabcolorLayout->addWidget( GroupBox9 );
ProfsGroup = new QGroupBox( tabcolor, "ProfsGroup" );
508,11 → 499,11
ProfsGroupLayout->setAlignment( Qt::AlignTop );
EmbedProfs2 = new QCheckBox( ProfsGroup, "EmbedProfs" );
EmbedProfs2->setText( tr( "Use ICC-Profile" ) );
EmbedProfs2->setChecked(Optionen->UseProfiles2);
EmbedProfs2->setChecked(Optionen->UseProfiles2);
ProfsGroupLayout->addMultiCellWidget( EmbedProfs2, 0, 0, 0, 1 );
NoEmbedded = new QCheckBox( ProfsGroup, "NoEmbedded" );
NoEmbedded->setText( tr( "Don't use embedded ICC profiles" ) );
NoEmbedded->setChecked(Optionen->EmbeddedI);
NoEmbedded->setChecked(Optionen->EmbeddedI);
ProfsGroupLayout->addMultiCellWidget( NoEmbedded, 1, 1, 0, 1 );
ProfsTxt3 = new QLabel( ProfsGroup, "ProfsTxt3" );
ProfsTxt3->setText( tr( "Profile:" ) );
521,62 → 512,60
ProfsTxt4->setText( tr( "Rendering-Intent:" ) );
ProfsGroupLayout->addWidget( ProfsTxt4, 2, 1 );
ImageP = new QComboBox( true, ProfsGroup, "ImageP" );
ImageP->setEditable(false);
ImageP->setEditable(false);
ProfsGroupLayout->addWidget( ImageP, 3, 0 );
IntendI = new QComboBox( true, ProfsGroup, "IntendS" );
IntendI->insertItem( tr( "Perceptual" ) );
IntendI->insertItem( tr( "Relative Colorimetric" ) );
IntendI->insertItem( tr( "Saturation" ) );
IntendI->insertItem( tr( "Absolute Colorimetric" ) );
IntendI->setEditable(false);
for (uint a = 0; a < ar_ip; ++a)
IntendI->insertItem(tr(tmp_ip[a]));
IntendI->setEditable(false);
ProfsGroupLayout->addWidget( IntendI, 3, 1 );
tabcolorLayout->addWidget( ProfsGroup );
if (Optionen->UseRGB)
{
ProfsGroup->setEnabled(false);
GroupBox9->setEnabled(false);
}
EnablePG();
EnablePGI();
if (Optionen->UseRGB)
{
ProfsGroup->setEnabled(false);
GroupBox9->setEnabled(false);
}
EnablePG();
EnablePGI();
#ifdef HAVE_CMS
QString tp = Optionen->SolidProf;
if (!InputProfiles.contains(tp))
tp = vie->Doc->CMSSettings.DefaultInputProfile2;
ProfilesL::Iterator itp;
for (itp = InputProfiles.begin(); itp != InputProfiles.end(); ++itp)
{
SolidPr->insertItem(itp.key());
QString tp = Optionen->SolidProf;
if (!InputProfiles.contains(tp))
tp = vie->Doc->CMSSettings.DefaultInputProfile2;
ProfilesL::Iterator itp;
for (itp = InputProfiles.begin(); itp != InputProfiles.end(); ++itp)
{
SolidPr->insertItem(itp.key());
if (itp.key() == tp)
{
if ((CMSuse) && (CMSavail))
{
if ((CMSuse) && (CMSavail))
SolidPr->setCurrentItem(SolidPr->count()-1);
}
}
if ((CMSuse) && (CMSavail))
}
}
if ((CMSuse) && (CMSavail))
IntendS->setCurrentItem(Optionen->Intent);
ProfilesL::Iterator itp2;
QString tp1 = Optionen->ImageProf;
if (!InputProfiles.contains(tp1))
tp1 = vie->Doc->CMSSettings.DefaultInputProfile2;
for (itp2 = InputProfiles.begin(); itp2 != InputProfiles.end(); ++itp2)
{
ImageP->insertItem(itp2.key());
ProfilesL::Iterator itp2;
QString tp1 = Optionen->ImageProf;
if (!InputProfiles.contains(tp1))
tp1 = vie->Doc->CMSSettings.DefaultInputProfile2;
for (itp2 = InputProfiles.begin(); itp2 != InputProfiles.end(); ++itp2)
{
ImageP->insertItem(itp2.key());
if (itp2.key() == tp1)
{
if ((CMSuse) && (CMSavail))
{
if ((CMSuse) && (CMSavail))
ImageP->setCurrentItem(ImageP->count()-1);
}
}
if ((CMSuse) && (CMSavail))
IntendI->setCurrentItem(Optionen->Intent2);
if ((!CMSuse) || (!CMSavail))
{
GroupBox9->hide();
ProfsGroup->hide();
}
#else
}
}
if ((CMSuse) && (CMSavail))
IntendI->setCurrentItem(Optionen->Intent2);
if ((!CMSuse) || (!CMSavail))
{
GroupBox9->hide();
ProfsGroup->hide();
}
#else
GroupBox9->hide();
ProfsGroup->hide();
#endif
QSpacerItem* spacerCG = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
tabcolorLayout->addItem( spacerCG );
592,24 → 581,22
X3GroupLayout = new QGridLayout( X3Group->layout() );
X3GroupLayout->setAlignment( Qt::AlignTop );
PrintProfC = new QComboBox( true, X3Group, "PrintProfC" );
PrintProfC->setEditable(false);
PrintProfC->setEditable(false);
#ifdef HAVE_CMS
ProfilesL::Iterator itp3;
QString tp3 = Optionen->PrintProf;
if (!PDFXProfiles->contains(tp3))
tp3 = vie->Doc->CMSSettings.DefaultPrinterProfile;
for (itp3 = PDFXProfiles->begin(); itp3 != PDFXProfiles->end(); ++itp3)
{
PrintProfC->insertItem(itp3.key());
ProfilesL::Iterator itp3;
QString tp3 = Optionen->PrintProf;
if (!PDFXProfiles->contains(tp3))
tp3 = vie->Doc->CMSSettings.DefaultPrinterProfile;
for (itp3 = PDFXProfiles->begin(); itp3 != PDFXProfiles->end(); ++itp3)
{
PrintProfC->insertItem(itp3.key());
if (itp3.key() == tp3)
{
PrintProfC->setCurrentItem(PrintProfC->count()-1);
}
}
}
#endif
X3GroupLayout->addWidget( PrintProfC, 0, 1 );
InfoString = new QLineEdit( X3Group, "InfoString" );
InfoString->setText(Optionen->Info);
InfoString->setText(Optionen->Info);
X3GroupLayout->addWidget( InfoString, 1, 1 );
PDFX2 = new QLabel( X3Group, "PDFX2" );
PDFX2->setText( tr( "Info String:" ) );
647,67 → 634,54
BleedGroupLayout->addItem( spacerPX2, 1, 4 );
tabpdfxLayout->addWidget( BleedGroup );
Options->insertTab( tabpdfx, tr( "PDF/X-3" ) );
QString EinTxt = "";
switch (Einheit)
{
case 0:
EinTxt = tr( " pt" );
break;
case 1:
EinTxt = tr( " mm" );
break;
case 2:
EinTxt = tr( " in" );
break;
case 3:
EinTxt = tr( " p" );
break;
}
char *size[] = {" pt", " mm", " in", " p"};
QString EinTxt = tr(size[Einheit]);
 
BleedTop->setSuffix( EinTxt );
BleedTop->setMinValue(0);
BleedTop->setMaxValue(view->Doc->PageH*UmReFaktor);
BleedTop->setMinValue(0);
BleedTop->setMaxValue(view->Doc->PageH*UmReFaktor);
BleedTop->setValue(Optionen->BleedTop*UmReFaktor);
BleedBottom->setSuffix( EinTxt );
BleedBottom->setMinValue(0);
BleedBottom->setMaxValue(view->Doc->PageH*UmReFaktor);
BleedBottom->setMinValue(0);
BleedBottom->setMaxValue(view->Doc->PageH*UmReFaktor);
BleedBottom->setValue(Optionen->BleedBottom*UmReFaktor);
BleedRight->setSuffix( EinTxt );
BleedRight->setMinValue(0);
BleedRight->setMaxValue(view->Doc->PageB*UmReFaktor);
BleedRight->setMinValue(0);
BleedRight->setMaxValue(view->Doc->PageB*UmReFaktor);
BleedRight->setValue(Optionen->BleedRight*UmReFaktor);
BleedLeft->setSuffix( EinTxt );
BleedLeft->setMinValue(0);
BleedLeft->setMaxValue(view->Doc->PageB*UmReFaktor);
BleedLeft->setMinValue(0);
BleedLeft->setMaxValue(view->Doc->PageB*UmReFaktor);
BleedLeft->setValue(Optionen->BleedLeft*UmReFaktor);
#ifdef HAVE_CMS
if ((!CMSuse) || (!CMSavail))
Options->setTabEnabled(tabpdfx, false);
if ((CMSuse) && (CMSavail) && (Optionen->Version == 12) && (!PDFXProfiles->isEmpty()))
EnablePDFX(2);
else
Options->setTabEnabled(tabpdfx, false);
if ((!CMSuse) || (!CMSavail))
Options->setTabEnabled(tabpdfx, false);
if ((CMSuse) && (CMSavail) && (Optionen->Version == 12) && (!PDFXProfiles->isEmpty()))
EnablePDFX(2);
else
Options->setTabEnabled(tabpdfx, false);
#else
Options->setTabEnabled(tabpdfx, false);
Options->setTabEnabled(tabpdfx, false);
#endif
BleedChanged();
BleedChanged();
PgSel = 0;
Pages->setCurrentItem(0);
SetEffOpts(0);
Pages->setEnabled(false);
Effects->setEnabled(false);
PagePrev->setEnabled(false);
Pages->setEnabled(false);
Effects->setEnabled(false);
PagePrev->setEnabled(false);
PDFOptsLayout->addWidget( Options );
DoEffects();
if (CheckBox10->isChecked())
{
PageTime->setValue(EffVal[0].AnzeigeLen);
EffectTime->setValue(EffVal[0].EffektLen);
EffectType->setCurrentItem(EffVal[0].Effekt);
EDirection->setCurrentItem(EffVal[0].Dm);
EDirection_2->setCurrentItem(EffVal[0].M);
EDirection_2_2->setCurrentItem(EffVal[0].Di);
SetEffOpts(EffectType->currentItem());
}
DoEffects();
if (CheckBox10->isChecked())
{
PageTime->setValue(EffVal[0].AnzeigeLen);
EffectTime->setValue(EffVal[0].EffektLen);
EffectType->setCurrentItem(EffVal[0].Effekt);
EDirection->setCurrentItem(EffVal[0].Dm);
EDirection_2->setCurrentItem(EffVal[0].M);
EDirection_2_2->setCurrentItem(EffVal[0].Di);
SetEffOpts(EffectType->currentItem());
}
Layout7 = new QHBoxLayout;
Layout7->setSpacing( 6 );
Layout7->setMargin( 0 );
747,15 → 721,15
connect(AllPages, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
connect(FirstPage, SIGNAL(valueChanged(int)), this, SLOT(ChFrom()));
connect(LastPage, SIGNAL(valueChanged(int)), this, SLOT(ChTo()));
connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
connect(EmbedProfs, SIGNAL(clicked()), this, SLOT(EnablePG()));
connect(EmbedProfs2, SIGNAL(clicked()), this, SLOT(EnablePGI()));
connect(NoEmbedded, SIGNAL(clicked()), this, SLOT(EnablePGI2()));
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
connect(BleedTop, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(BleedBottom, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(BleedLeft, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(BleedRight, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
connect(BleedTop, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(BleedBottom, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(BleedLeft, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(BleedRight, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
connect(Encry, SIGNAL(clicked()), this, SLOT(ToggleEncr()));
}
 
769,9 → 743,7
 
void PDF_Opts::ToggleEncr()
{
bool setter = false;
if (Encry->isChecked())
setter = true;
bool setter = Encry->isChecked() ? true : false;
GroupSecSet->setEnabled(setter);
GroupPass->setEnabled(setter);
}
792,8 → 764,10
p.setPen(QPen(black, 1, DotLine, FlatCap, MiterJoin));
int x = qRound((BleedLeft->value() / UmReFaktor) * (70.0 / view->Doc->PageB));
int y = qRound((BleedTop->value() / UmReFaktor) * (80.0 / view->Doc->PageH));
int w = qRound((view->Doc->PageB-((BleedLeft->value()+BleedRight->value())/UmReFaktor))*(70.0/view->Doc->PageB));
int h = qRound((view->Doc->PageH-((BleedTop->value()+BleedBottom->value())/UmReFaktor))*(80.0/view->Doc->PageH));
int w =qRound((view->Doc->PageB-((BleedLeft->value()+BleedRight->value())/UmReFaktor))*
(70.0/view->Doc->PageB));
int h = qRound((view->Doc->PageH-((BleedTop->value()+BleedBottom->value())/UmReFaktor))*
(80.0/view->Doc->PageH));
p.drawRect(x, y, w, h);
BleedIcon->setPixmap(pm);
p.end();
802,7 → 776,7
void PDF_Opts::EnablePDFX(int a)
{
if (a != 2)
{
{
Options->setTabEnabled(tabpdfx, false);
Options->setTabEnabled(tabsec, true);
EmbedProfs2->setEnabled(true);
810,7 → 784,7
EmbedFonts->setEnabled(true);
OutCombo->setEnabled(true);
return;
}
}
EmbedFonts->setChecked(true);
EmbedAll();
CheckBox10->setChecked(false);
829,31 → 803,27
void PDF_Opts::EnablePGI()
{
if (EmbedProfs2->isChecked())
{
{
NoEmbedded->setEnabled(true);
bool setter = false;
if (NoEmbedded->isChecked())
setter = true;
bool setter = NoEmbedded->isChecked() ? true : false;
ProfsTxt3->setEnabled(setter);
ProfsTxt4->setEnabled(setter);
ImageP->setEnabled(setter);
IntendI->setEnabled(setter);
}
}
else
{
{
ProfsTxt3->setEnabled(false);
ProfsTxt4->setEnabled(false);
ImageP->setEnabled(false);
IntendI->setEnabled(false);
NoEmbedded->setEnabled(false);
}
}
}
 
void PDF_Opts::EnablePGI2()
{
bool setter = false;
if (NoEmbedded->isChecked())
setter = true;
bool setter = NoEmbedded->isChecked() ? true : false;
ProfsTxt3->setEnabled(setter);
ProfsTxt4->setEnabled(setter);
ImageP->setEnabled(setter);
862,9 → 832,7
 
void PDF_Opts::EnablePG()
{
bool setter = false;
if (EmbedProfs->isChecked())
setter = true;
bool setter = EmbedProfs->isChecked() ? true : false;
ProfsTxt1->setEnabled(setter);
ProfsTxt2->setEnabled(setter);
SolidPr->setEnabled(setter);
880,7 → 848,7
 
void PDF_Opts::ChFrom()
{
disconnect(LastPage, SIGNAL(valueChanged(int)), this, SLOT(ChTo()));
disconnect(LastPage, SIGNAL(valueChanged(int)), this, SLOT(ChTo()));
if (FirstPage->value() > LastPage->value())
LastPage->setValue(FirstPage->value());
connect(LastPage, SIGNAL(valueChanged(int)), this, SLOT(ChTo()));
888,20 → 856,19
 
void PDF_Opts::ChTo()
{
disconnect(FirstPage, SIGNAL(valueChanged(int)), this, SLOT(ChFrom()));
disconnect(FirstPage, SIGNAL(valueChanged(int)), this, SLOT(ChFrom()));
if (LastPage->value() < FirstPage->value())
FirstPage->setValue(LastPage->value());
connect(FirstPage, SIGNAL(valueChanged(int)), this, SLOT(ChFrom()));
connect(FirstPage, SIGNAL(valueChanged(int)), this, SLOT(ChFrom()));
}
 
void PDF_Opts::SelRange(bool e)
{
bool setter = true;
if (e)
setter = false;
RText->setEnabled( setter );
FirstPage->setEnabled( setter );
LastPage->setEnabled( setter );
bool setter = e ? false : true;
 
RText->setEnabled( setter );
FirstPage->setEnabled( setter );
LastPage->setEnabled( setter );
if (setter == false)
CheckBM->setChecked(false);
}
908,8 → 875,8
 
void PDF_Opts::EffectOnAll()
{
for (uint pg = 0; pg < view->Pages.count(); pg++)
{
for (uint pg = 0; pg < view->Pages.count(); ++pg)
{
EffVal[pg].AnzeigeLen = PageTime->value();
EffVal[pg].EffektLen = EffectTime->value();
EffVal[pg].Effekt = EffectType->currentItem();
916,14 → 883,12
EffVal[pg].Dm = EDirection->currentItem();
EffVal[pg].M = EDirection_2->currentItem();
EffVal[pg].Di = EDirection_2_2->currentItem();
}
}
}
 
void PDF_Opts::DoEffects()
{
bool setter = false;
if (CheckBox10->isChecked())
setter = true;
bool setter = CheckBox10->isChecked() ? true : false;
Pages->setEnabled(setter);
Effects->setEnabled(setter);
PagePrev->setEnabled(setter);
961,7 → 926,7
EDirection_2_2->listBox()->item(3)->setSelectable(false);
EDirection_2_2->listBox()->item(4)->setSelectable(false);
switch (nr)
{
{
case 0:
case 3:
EDirection->setEnabled(false);
984,10 → 949,10
EDirection_2->setEnabled(false);
EDirection_2_2->setEnabled(true);
if (nr == 6)
{
{
EDirection_2_2->listBox()->item(2)->setSelectable(true);
EDirection_2_2->listBox()->item(3)->setSelectable(true);
}
}
else
EDirection_2_2->listBox()->item(4)->setSelectable(true);
break;
1001,32 → 966,28
 
void PDF_Opts::PagePr()
{
disconnect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
disconnect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
QString tmp;
int ci = Pages->currentItem();
if (PagePrev->isChecked())
{
for (uint pg = 0; pg < view->Pages.count(); pg++)
{
Pages->changeItem(view->PageToPixmap(pg, 70), tr("Page")+" "+tmp.setNum(pg+1), pg);
}
{
for (uint pg = 0; pg < view->Pages.count(); ++pg)
Pages->changeItem(view->PageToPixmap(pg, 70), tr("Page")+" "+tmp.setNum(pg+1), pg);
}
else
else
{
for (uint pg = 0; pg < view->Pages.count(); pg++)
{
Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
}
for (uint pg = 0; pg < view->Pages.count(); ++pg)
Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
}
if (ci != -1)
if (ci != -1)
{
PgSel = ci;
Pages->setCurrentItem(ci);
PgSel = ci;
Pages->setCurrentItem(ci);
}
else
else
{
PgSel = 0;
Pages->clearSelection();
PgSel = 0;
Pages->clearSelection();
}
connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
}
1034,17 → 995,15
void PDF_Opts::DoDownsample()
{
if (DSColor->isChecked())
{
{
ValC->setEnabled(true);
if (ValC->value() > Resolution->value())
ValC->setValue(Resolution->value());
ValC->setMaxValue(Resolution->value());
ValC->setMinValue(35);
}
ValC->setMaxValue(Resolution->value());
ValC->setMinValue(35);
}
else
{
ValC->setEnabled(false);
}
}
 
void PDF_Opts::RemoveEmbed()
1051,8 → 1010,8
{
FontsToEmbed.remove(EmbedList->currentText());
EmbedList->removeItem(EmbedList->currentItem());
EmbedList->clearSelection();
if (EmbedList->count() == 0)
EmbedList->clearSelection();
if (EmbedList->count() == 0)
FromEmbed->setEnabled(false);
}
 
1059,28 → 1018,28
void PDF_Opts::PutToEmbed()
{
if (EmbedList->count() != 0)
{
if (EmbedList->findItem(AvailFlist->currentText()) == NULL)
{
if (EmbedList->findItem(AvailFlist->currentText()) == NULL)
{
FontsToEmbed.append(AvailFlist->currentText());
EmbedList->insertItem(AvailFlist->currentText());
}
}
}
else
{
{
FontsToEmbed.append(AvailFlist->currentText());
EmbedList->insertItem(AvailFlist->currentText());
}
}
}
 
void PDF_Opts::SelAFont(QListBoxItem *c)
{
if ((c != NULL) && (!EmbedFonts->isChecked()))
{
{
FromEmbed->setEnabled(false);
if (c->isSelectable())
ToEmbed->setEnabled(true);
EmbedList->clearSelection();
ToEmbed->setEnabled(true);
EmbedList->clearSelection();
}
}
 
1087,10 → 1046,10
void PDF_Opts::SelEFont(QListBoxItem *c)
{
if ((c != NULL) && (!EmbedFonts->isChecked()))
{
{
FromEmbed->setEnabled(true);
ToEmbed->setEnabled(false);
AvailFlist->clearSelection();
ToEmbed->setEnabled(false);
AvailFlist->clearSelection();
}
}
 
1097,20 → 1056,20
void PDF_Opts::EmbedAll()
{
if (EmbedFonts->isChecked())
{
{
EmbedList->clear();
FontsToEmbed.clear();
FromEmbed->setEnabled(false);
ToEmbed->setEnabled(false);
for (uint a=0; a < AvailFlist->count(); a++)
ToEmbed->setEnabled(false);
for (uint a=0; a < AvailFlist->count(); ++a)
{
if (AvailFlist->item(a)->isSelectable())
{
if (AvailFlist->item(a)->isSelectable())
{
FontsToEmbed.append(AvailFlist->item(a)->text());
EmbedList->insertItem(AvailFlist->item(a)->text());
}
}
}
}
}
 
void PDF_Opts::ChangeFile()
1123,9 → 1082,9
fn = dia.selectedFile();
else
return;
if (!fn.isEmpty())
{
if (!fn.isEmpty())
{
if (overwrite(this, fn))
Datei->setText(fn);
}
Datei->setText(fn);
}
}
/trunk/Scribus/scribus/lineformats.cpp
131,7 → 131,7
tr("Do you really want do delete this Style?"),
tr("No"),
tr("Yes"),
0, 0, 1);
0, QMessageBox::No, QMessageBox::Yes);
if (exit == 1)
{
TempStyles.remove(sFnumber);
/trunk/Scribus/scribus/align.cpp
7,7 → 7,7
: QDialog( parent, "al", true, 0 )
{
Anzahl = anz;
Anzahl > 2 ? setCaption( tr("Distribute/Align")) : setCaption( tr("Align"));
Anzahl > 2 ? setCaption( tr("Distribute/Align")) : setCaption( tr("Align"));
setIcon(loadIcon("AppIcon.png"));
AlignLayout = new QVBoxLayout( this );
AlignLayout->setSpacing( 0 );
35,7 → 35,7
VartH->insertItem( tr("Middles"));
VartH->insertItem( tr("Right Sides"));
VartH->setEditable(false);
ButtonGroup1Layout->addMultiCellWidget( VartH, 0, 0, 1, 2 );
ButtonGroup1Layout->addMultiCellWidget( VartH, 0, 0, 1, 2 );
NichtsH = new QRadioButton( ButtonGroup1, "NichtsH" );
NichtsH->setText( tr( "Don't change" ) );
NichtsH->setChecked(true);
98,25 → 98,11
AVert = new MSpinBox( ButtonGroup1_2, 2 );
AVert->setEnabled( true );
AVert->setMinimumSize( QSize( 80, 20 ) );
switch (ein)
{
case 0:
AHor->setSuffix( tr( " pts" ) );
AVert->setSuffix( tr( " pts" ) );
break;
case 1:
AHor->setSuffix( tr( " mm" ) );
AVert->setSuffix( tr( " mm" ) );
break;
case 2:
AHor->setSuffix( tr( " in" ) );
AVert->setSuffix( tr( " in" ) );
break;
case 3:
AHor->setSuffix( tr( " p" ) );
AVert->setSuffix( tr( " p" ) );
break;
}
QString tmp = (ein == 0) ? tr(" pts") :
(ein == 1) ? tr(" mm") :
(ein == 2) ? tr(" in") : tr(" p");
AHor->setSuffix(tmp);
AVert->setSuffix(tmp);
AVert->setMaxValue( 1000 );
AVert->setMinValue( -1000 );
AVert->setValue( 0 );
157,7 → 143,7
// signals and slots connections
connect( OKbutton, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( CancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect(ButtonApply, SIGNAL(clicked()), this, SLOT( slotApplyDiag()));
connect(ButtonApply, SIGNAL(clicked()), this, SLOT( slotApplyDiag()));
connect( ButtonGroup1, SIGNAL( clicked(int) ), this, SLOT( DistHoriz() ) );
connect( ButtonGroup1_2, SIGNAL( clicked(int) ), this, SLOT( DistVert() ) );
}
175,7 → 161,6
bool setter = CheckH->isChecked() ? true : false;
AHor->setEnabled( setter );
TextLabelD->setEnabled( setter );
 
}
 
void Align::DistVert()
/trunk/Scribus/scribus/customfdialog.cpp
32,18 → 32,10
ImIconProvider::ImIconProvider(QWidget *pa) : QFileIconProvider(pa)
{
fmts.clear();
fmts += "eps";
fmts += "gif";
fmts += "png";
fmts += "jpg";
fmts += "xpm";
fmts += "tif";
fmts += "bmp";
fmts += "pbm";
fmts += "pgm";
fmts += "ppm";
fmts += "xbm";
fmts += "xpm";
char *tmp[] = {"eps", "gif", "png", "jpg", "xpm", "tif", "bmp", "pbm", "pgm", "ppm", "xbm", "xpm"};
size_t array = sizeof(tmp) / sizeof(*tmp);
for (uint a = 0; a < array; ++a)
fmts += tmp[a];
imagepm = loadIcon("image.png");
pspm = loadIcon("postscript.png");
txtpm = loadIcon("txt.png");
202,30 → 194,13
TxCodeT->setText( tr("Encoding:"));
TxCodeM = new QComboBox(true, LayoutC, "Cod");
TxCodeM->setEditable(false);
TxCodeM->insertItem("ISO 8859-1");
TxCodeM->insertItem("ISO 8859-2");
TxCodeM->insertItem("ISO 8859-3");
TxCodeM->insertItem("ISO 8859-4");
TxCodeM->insertItem("ISO 8859-5");
TxCodeM->insertItem("ISO 8859-6");
TxCodeM->insertItem("ISO 8859-7");
TxCodeM->insertItem("ISO 8859-8");
TxCodeM->insertItem("ISO 8859-9");
TxCodeM->insertItem("ISO 8859-10");
TxCodeM->insertItem("ISO 8859-13");
TxCodeM->insertItem("ISO 8859-14");
TxCodeM->insertItem("ISO 8859-15");
TxCodeM->insertItem("utf8");
TxCodeM->insertItem("KOI8-R");
TxCodeM->insertItem("KOI8-U");
TxCodeM->insertItem("CP1250");
TxCodeM->insertItem("CP1251");
TxCodeM->insertItem("CP1252");
TxCodeM->insertItem("CP1253");
TxCodeM->insertItem("CP1254");
TxCodeM->insertItem("CP1255");
TxCodeM->insertItem("CP1256");
TxCodeM->insertItem("CP1257");
char *tmp_txc[] = {"ISO 8859-1", "ISO 8859-2", "ISO 8859-3", "ISO 8859-4", "ISO 8859-5", "ISO 8859-6",
"ISO 8859-7", "ISO 8859-8", "ISO 8859-9", "ISO 8859-10", "ISO 8859-13", "ISO 8859-14",
"ISO 8859-15", "utf8", "KOI8-R", "KOI8-U", "CP1250", "CP1251", "CP1252", "CP1253",
"CP1254", "CP1255", "CP1256", "CP1257"};
size_t array = sizeof(tmp_txc) / sizeof(*tmp_txc);
for (uint a = 0; a < array; ++a)
TxCodeM->insertItem(tmp_txc[a]);
QString localEn = QTextCodec::codecForLocale()->name();
bool hasIt = false;
for (int cc = 0; cc < TxCodeM->count(); ++cc)
/trunk/Scribus/scribus/mpalette.cpp
530,61 → 530,8
layout46->addLayout( layout24 );
 
Layout1 = new QHBoxLayout( 0, 0, 0, "Layout1");
 
Underline = new QToolButton( page_3, "Underline" );
Underline->setMaximumSize( QSize( 22, 22 ) );
Underline->setText("");
Underline->setPixmap(loadIcon("Unter.xpm"));
Underline->setToggleButton( true );
Layout1->addWidget( Underline );
 
ButtonGroup1 = new QButtonGroup( page_3, "ButtonGroup1" );
ButtonGroup1->setFrameShape( QButtonGroup::NoFrame );
ButtonGroup1->setTitle("");
ButtonGroup1->setExclusive( true );
ButtonGroup1->setRadioButtonExclusive( false );
ButtonGroup1->setColumnLayout(0, Qt::Vertical );
ButtonGroup1->layout()->setSpacing( 0 );
ButtonGroup1->layout()->setMargin( 0 );
ButtonGroup1Layout = new QHBoxLayout( ButtonGroup1->layout() );
ButtonGroup1Layout->setAlignment( Qt::AlignTop );
 
Subs = new QToolButton( ButtonGroup1, "Subs" );
Subs->setMaximumSize( QSize( 22, 22 ) );
Subs->setText("");
Subs->setPixmap(loadIcon("Tief.xpm"));
Subs->setToggleButton( true );
ButtonGroup1Layout->addWidget( Subs );
 
Supers = new QToolButton( ButtonGroup1, "Supers" );
Supers->setMaximumSize( QSize( 22, 22 ) );
Supers->setText("");
Supers->setPixmap(loadIcon("Hoch.xpm"));
Supers->setToggleButton( true );
ButtonGroup1Layout->addWidget( Supers );
Layout1->addWidget( ButtonGroup1 );
 
Kapital = new QToolButton( page_3, "Kapital" );
Kapital->setMaximumSize( QSize( 22, 22 ) );
Kapital->setText("");
Kapital->setPixmap(loadIcon("Kapital.xpm"));
Kapital->setToggleButton( true );
Layout1->addWidget( Kapital );
 
Strike = new QToolButton( page_3, "Strike" );
Strike->setMaximumSize( QSize( 22, 22 ) );
Strike->setText("");
Strike->setPixmap(loadIcon("Strike.xpm"));
Strike->setToggleButton( true );
Layout1->addWidget( Strike );
 
Outlined = new QToolButton( page_3, "Outlined" );
Outlined->setMaximumSize( QSize( 22, 22 ) );
Outlined->setText("");
Outlined->setPixmap(loadIcon("outlined.png"));
Outlined->setToggleButton( true );
Layout1->addWidget( Outlined );
 
SeStyle = new StyleSelect(page_3);
Layout1->addWidget(SeStyle);
Revert = new QToolButton( page_3, "Bold" );
Revert->setMaximumSize( QSize( 22, 22 ) );
Revert->setText("");
850,12 → 797,6
QToolTip::add( LineSp, tr( "Line Spacing" ) );
QToolTip::add( Extra, tr( "Manual Kerning" ) );
QToolTip::add( Revert, tr( "Reverse Writing" ) );
QToolTip::add( Underline, tr( "Underline" ) );
QToolTip::add( Kapital, tr( "Small Caps" ) );
QToolTip::add( Subs, tr( "Subscript" ) );
QToolTip::add( Supers, tr( "Superscript" ) );
QToolTip::add( Strike, tr( "Strikeout" ) );
QToolTip::add( Outlined, tr( "Outline Text" ) );
QToolTip::add( TextL, tr( "Align Text Left" ) );
QToolTip::add( TextR, tr( "Align Text Right" ) );
QToolTip::add( TextB, tr( "Align Text Block" ) );
890,13 → 831,8
connect(FlipH, SIGNAL(clicked()), this, SLOT(DoFlipH()));
connect(FlipV, SIGNAL(clicked()), this, SLOT(DoFlipV()));
connect(GroupAlign, SIGNAL(clicked(int)), this, SLOT(NewAli()));
connect(Kapital, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert()));
connect(Underline, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Subs, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Strike, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Supers, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Outlined, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(SeStyle, SIGNAL(State(int)), this, SLOT(setTypeStyle(int)));
connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
1759,32 → 1695,16
 
void Mpalette::setStil(int s)
{
Supers->setOn(false);
Subs->setOn(false);
Strike->setOn(false);
Underline->setOn(false);
Kapital->setOn(false);
Outlined->setOn(false);
StrokeIcon->setEnabled(false);
TxStroke->setEnabled(false);
PM1->setEnabled(false);
if (s & 1)
Supers->setOn(true);
if (s & 2)
Subs->setOn(true);
SeStyle->setStyle(s);
if (s & 4)
{
Outlined->setOn(true);
StrokeIcon->setEnabled(true);
TxStroke->setEnabled(true);
PM1->setEnabled(true);
}
if (s & 8)
Underline->setOn(true);
if (s & 16)
Strike->setOn(true);
if (s & 64)
Kapital->setOn(true);
}
 
void Mpalette::setAli(int e)
2292,47 → 2212,10
}
}
 
void Mpalette::setTypeStyle()
void Mpalette::setTypeStyle(int s)
{
if (Supers == sender())
{
emit Stellung(1);
Subs->setOn(false);
emit BackHome();
return;
}
if (Subs == sender())
{
emit Stellung(2);
Supers->setOn(false);
emit BackHome();
return;
}
if (Outlined == sender())
{
emit Stellung(4);
emit BackHome();
return;
}
if (Underline == sender())
{
emit Stellung(8);
emit BackHome();
return;
}
if (Strike == sender())
{
emit Stellung(16);
emit BackHome();
return;
}
if (Kapital == sender())
{
emit Stellung(64);
emit BackHome();
return;
}
emit Stellung(0);
emit Stellung(s);
emit BackHome();
}
 
void Mpalette::DoLower()
/trunk/Scribus/scribus/util.cpp
118,62 → 118,59
#ifdef HAVE_CMS
QImage out = Im->copy();
if ((CMSuse) && (SoftProofing))
{
{
cmsHTRANSFORM xform;
cmsHPROFILE inputProf;
if (emPr != 0)
inputProf = emPr;
else
{
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
if (emPr != 0)
inputProf = emPr;
else
{
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
emp = true;
}
}
int dcmsFlags = 0;
if (Gamut)
dcmsFlags |= cmsFLAGS_GAMUTCHECK;
else
dcmsFlags |= cmsFLAGS_SOFTPROOFING;
dcmsFlags |= Gamut ? cmsFLAGS_GAMUTCHECK : cmsFLAGS_SOFTPROOFING;
xform = cmsCreateProofingTransform(inputProf, TYPE_RGBA_8,
CMSoutputProf, TYPE_RGBA_8,
CMSprinterProf,
IntentPrinter,
Rend, dcmsFlags);
CMSoutputProf, TYPE_RGBA_8,
CMSprinterProf,
IntentPrinter,
Rend, dcmsFlags);
for (int i=0; i < out.height(); ++i)
{
{
LPBYTE ptr = out.scanLine(i);
cmsDoTransform(xform, ptr, ptr, out.width());
}
}
cmsDeleteTransform(xform);
if (emp)
cmsCloseProfile(inputProf);
}
}
else
{
if (CMSuse)
{
if (CMSuse)
{
cmsHTRANSFORM xform;
cmsHPROFILE inputProf;
if (emPr != 0)
inputProf = emPr;
else
{
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
if (emPr != 0)
inputProf = emPr;
else
{
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
emp = true;
}
}
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8,
CMSoutputProf, TYPE_RGBA_8,
Rend,
0);
CMSoutputProf, TYPE_RGBA_8,
Rend,
0);
for (int i=0; i < out.height(); ++i)
{
{
LPBYTE ptr = out.scanLine(i);
cmsDoTransform(xform, ptr, ptr, out.width());
}
}
cmsDeleteTransform(xform);
if (emp)
cmsCloseProfile(inputProf);
}
}
}
return out;
#else
return Im->copy();
185,24 → 182,24
#ifdef HAVE_CMS
QImage out = Im->copy();
if ((CMSuse) && (SoftProofing))
{
for (int i=0; i < out.height(); ++i)
{
for (int i=0; i < out.height(); ++i)
{
LPBYTE ptr = out.scanLine(i);
cmsDoTransform(stdProofImg, ptr, ptr, out.width());
}
}
}
else
{
if (CMSuse)
{
if (CMSuse)
for (int i=0; i < out.height(); ++i)
{
for (int i=0; i < out.height(); ++i)
{
LPBYTE ptr = out.scanLine(i);
cmsDoTransform(stdTransImg, ptr, ptr, out.width());
}
}
}
}
return out;
#else
return Im->copy();
212,7 → 209,7
QPixmap LoadPDF(QString fn, int Seite, int Size, int *w, int *h)
{
QString tmp, cmd1, cmd2;
QString tmpFile = QString(getenv("HOME"))+"/.scribus/sc.png";
QString tmpFile = QString(getenv("HOME"))+"/.scribus/sc.png";
QPixmap pm;
int ret = -1;
tmp.setNum(Seite);
220,19 → 217,17
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
if (ret == 0)
{
{
QImage image;
image.load(tmpFile);
system("rm -f "+tmpFile);
QImage im2;
QImage im2;
*h = image.height();
*w = image.width();
double sx = image.width() / static_cast<double>(Size);
double sy = image.height() / static_cast<double>(Size);
if (sy < sx)
im2 = image.smoothScale(static_cast<int>(image.width() / sx), static_cast<int>(image.height() / sx));
else
im2 = image.smoothScale(static_cast<int>(image.width() / sy), static_cast<int>(image.height() / sy));
double t = (sy < sx ? sx : sy);
im2 = image.smoothScale(static_cast<int>(image.width() / t), static_cast<int>(image.height() / t));
pm.convertFromImage(im2);
QPainter p;
p.begin(&pm);
241,7 → 236,7
p.drawRect(0, 0, pm.width(), pm.height());
p.end();
im2.detach();
}
}
return pm;
}
 
253,93 → 248,94
double x, y, b, h;
bool found = false;
int ret = -1;
QString tmpFile = QString(getenv("HOME"))+"/.scribus/sc.png";
QString tmpFile = QString(getenv("HOME"))+"/.scribus/sc.png";
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
if (ret == 0)
{
{
QImage image;
image.load(tmpFile);
Bild = image.convertDepth(32);
Bild = image.convertDepth(32);
system("rm -f "+tmpFile);
}
}
}
if ((ext == "eps") || (ext == "ps"))
{
{
QFile f(fn);
if (f.open(IO_ReadOnly))
{
{
QTextStream ts(&f);
while (!ts.atEnd())
{
{
tc = ' ';
tmp = "";
while ((tc != '\n') && (tc != '\r'))
{
{
ts >> tc;
if ((tc != '\n') && (tc != '\r'))
tmp += tc;
}
}
if (tmp.startsWith("%%BoundingBox"))
{
{
found = true;
BBox = tmp;
}
}
if (tmp.startsWith("%%EndComments"))
break;
}
}
f.close();
if (found)
{
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x >> y >> b >> h;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" + fn + "\"" + cmd2);
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" +
fn + "\"" + cmd2);
if (ret == 0)
{
{
QImage im4;
QImage image;
image.load(tmpFile);
image = image.convertDepth(32);
image = image.convertDepth(32);
int wi = image.width();
int hi = image.height();
QBitmap bm(tmpFile);
bm.fill(Qt::color1);
QPainter pp;
pp.begin(&bm);
pp.setPen(Qt::color0);
QString tmp2;
if ( image.depth() == 8 )
QPainter pp;
pp.begin(&bm);
pp.setPen(Qt::color0);
QString tmp2;
if ( image.depth() == 8 )
{
for( int yi=0; yi < hi; ++yi )
{
for( int yi=0; yi < hi; ++yi )
uchar * s = image.scanLine( yi );
for( int xi=0; xi < wi; ++xi )
{
uchar * s = image.scanLine( yi );
for( int xi=0; xi < wi; ++xi )
{
if(image.color(s[xi]) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
if(image.color(s[xi]) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
}
else
{
for( int yi=0; yi < hi; ++yi )
{
for( int yi=0; yi < hi; ++yi )
QRgb * s = (QRgb*)(image.scanLine( yi ));
for(int xi=0; xi < wi; ++xi )
{
QRgb * s = (QRgb*)(image.scanLine( yi ));
for(int xi=0; xi < wi; ++xi )
{
if((*s++) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
if((*s++) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
}
pp.end();
pp.end();
QPixmap pm;
pm.convertFromImage(image);
pm.setMask(bm);
347,18 → 343,18
im4 = pm.convertToImage();
Bild = im4.copy(static_cast<int>(x), 0, static_cast<int>(b-x), static_cast<int>(h-y));
system("rm -f "+tmpFile);
}
}
}
}
}
#ifdef HAVE_TIFF
if (ext == "tif")
{
{
QImage img;
QImage inI2;
TIFF* tif = TIFFOpen(fn, "r");
if(tif)
{
{
unsigned width, height,size;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);
365,43 → 361,43
size=width*height;
uint32 *bits=(uint32*) _TIFFmalloc(size * sizeof (uint32));
if(bits)
{
if (TIFFReadRGBAImage(tif, width, height, bits, 0))
{
if (TIFFReadRGBAImage(tif, width, height, bits, 0))
{
img.create(width,height,32);
img.create(width,height,32);
if(TIFFGetR(0x1234567)==qRed (0x1234567) &&
TIFFGetG(0x1234567)==qGreen(0x1234567) &&
TIFFGetB(0x1234567)==qBlue (0x1234567))
{
{
for(unsigned y=0; y<height; ++y)
memcpy(img.scanLine(height-1-y),bits+y*width,width*4);
}
}
else
{
{
uint32 *inp=bits;
for(unsigned y=0; y<height; ++y)
{
{
QRgb *row=(QRgb*) (img.scanLine(height-1-y));
for(unsigned x=0; x<width; ++x)
{
{
const uint32 col=*(inp++);
row[x]=qRgb(TIFFGetR(col), TIFFGetG(col), TIFFGetB(col) ) | (TIFFGetA(col)<<24);
}
}
}
}
Bild = img.copy();
}
}
_TIFFfree(bits);
}
}
TIFFClose(tif);
}
}
}
#endif
else
{
{
Bild.load(fn);
Bild = Bild.convertDepth(32);
}
Bild = Bild.convertDepth(32);
}
return Bild;
}
 
414,210 → 410,216
double x, y, b, h;
bool found = false;
int ret = -1;
QString tmpFile = QString(getenv("HOME"))+"/.scribus/sc.png";
QString tmpFile = QString(getenv("HOME"))+"/.scribus/sc.png";
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
if (ret == 0)
{
{
QImage image;
image.load(tmpFile);
Bild = image.convertDepth(32);
Bild = image.convertDepth(32);
system("rm -f "+tmpFile);
*realCMYK = false;
}
}
if ((ext == "eps") || (ext == "ps"))
}
if ((ext == "eps") || (ext == "ps"))
{
QFile f(fn);
if (f.open(IO_ReadOnly))
QFile f(fn);
if (f.open(IO_ReadOnly))
{
QTextStream ts(&f);
while (!ts.atEnd())
QTextStream ts(&f);
while (!ts.atEnd())
{
tc = ' ';
tmp = "";
while ((tc != '\n') && (tc != '\r'))
tc = ' ';
tmp = "";
while ((tc != '\n') && (tc != '\r'))
{
ts >> tc;
if ((tc != '\n') && (tc != '\r'))
tmp += tc;
ts >> tc;
if ((tc != '\n') && (tc != '\r'))
tmp += tc;
}
if (tmp.startsWith("%%BoundingBox"))
if (tmp.startsWith("%%BoundingBox"))
{
found = true;
BBox = tmp;
found = true;
BBox = tmp;
}
if (tmp.startsWith("%%EndComments"))
break;
if (tmp.startsWith("%%EndComments"))
break;
}
f.close();
if (found)
f.close();
if (found)
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x >> y >> b >> h;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" + fn + "\"" + cmd2);
if (ret == 0)
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x >> y >> b >> h;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" +
fn + "\"" + cmd2);
if (ret == 0)
{
QImage im4;
QImage image;
image.load(tmpFile);
image = image.convertDepth(32);
int wi = image.width();
int hi = image.height();
QBitmap bm(tmpFile);
bm.fill(Qt::color1);
QPainter pp;
pp.begin(&bm);
pp.setPen(Qt::color0);
QString tmp2;
if ( image.depth() == 8 )
QImage im4;
QImage image;
image.load(tmpFile);
image = image.convertDepth(32);
int wi = image.width();
int hi = image.height();
QBitmap bm(tmpFile);
bm.fill(Qt::color1);
QPainter pp;
pp.begin(&bm);
pp.setPen(Qt::color0);
QString tmp2;
if ( image.depth() == 8 )
{
for( int yi=0; yi < hi; ++yi )
for( int yi=0; yi < hi; ++yi )
{
uchar * s = image.scanLine( yi );
for( int xi=0; xi < wi; ++xi )
uchar * s = image.scanLine( yi );
for( int xi=0; xi < wi; ++xi )
{
if(image.color(s[xi]) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
}
else
if(image.color(s[xi]) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
}
else
{
for( int yi=0; yi < hi; ++yi )
for( int yi=0; yi < hi; ++yi )
{
QRgb * s = (QRgb*)(image.scanLine( yi ));
for(int xi=0; xi < wi; ++xi )
QRgb * s = (QRgb*)(image.scanLine( yi ));
for(int xi=0; xi < wi; ++xi )
{
if((*s++) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
}
pp.end();
QPixmap pm;
pm.convertFromImage(image);
pm.setMask(bm);
im4.setAlphaBuffer(true);
im4 = pm.convertToImage();
Bild = im4.copy(static_cast<int>(x), 0, static_cast<int>(b-x), static_cast<int>(h-y));
system("rm -f "+tmpFile);
*realCMYK = false;
if((*s++) == 0xffffffff)
pp.drawPoint(xi, yi);
}
}
}
pp.end();
QPixmap pm;
pm.convertFromImage(image);
pm.setMask(bm);
im4.setAlphaBuffer(true);
im4 = pm.convertToImage();
Bild = im4.copy(static_cast<int>(x), 0, static_cast<int>(b-x), static_cast<int>(h-y));
system("rm -f "+tmpFile);
*realCMYK = false;
}
}
}
}
#ifdef HAVE_TIFF
if (ext == "tif")
if (ext == "tif")
{
QImage img;
QImage inI2;
TIFF* tif = TIFFOpen(fn, "r");
if(tif)
QImage img;
QImage inI2;
TIFF* tif = TIFFOpen(fn, "r");
if(tif)
{
DWORD EmbedLen = 0;
LPBYTE EmbedBuffer;
unsigned width, height,size;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);
size=width*height;
uint32 *bits=(uint32*) _TIFFmalloc(size * sizeof (uint32));
if(bits)
DWORD EmbedLen = 0;
LPBYTE EmbedBuffer;
unsigned width, height,size;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);
size=width*height;
uint32 *bits=(uint32*) _TIFFmalloc(size * sizeof (uint32));
if(bits)
{
if (TIFFReadRGBAImage(tif, width, height, bits, 0))
if (TIFFReadRGBAImage(tif, width, height, bits, 0))
{
img.create(width,height,32);
if(TIFFGetR(0x1234567)==qRed (0x1234567) &&
TIFFGetG(0x1234567)==qGreen(0x1234567) &&
TIFFGetB(0x1234567)==qBlue (0x1234567))
img.create(width,height,32);
if(TIFFGetR(0x1234567)==qRed (0x1234567) &&
TIFFGetG(0x1234567)==qGreen(0x1234567) &&
TIFFGetB(0x1234567)==qBlue (0x1234567))
{
for(unsigned y=0; y<height; ++y)
memcpy(img.scanLine(height-1-y),bits+y*width,width*4);
for(unsigned y=0; y<height; ++y)
memcpy(img.scanLine(height-1-y),bits+y*width,width*4);
}
else
else
{
uint32 *inp=bits;
for(unsigned y=0; y<height; ++y)
uint32 *inp=bits;
for(unsigned y=0; y<height; ++y)
{
QRgb *row=(QRgb*) (img.scanLine(height-1-y));
for(unsigned x=0; x<width; ++x)
QRgb *row=(QRgb*) (img.scanLine(height-1-y));
for(unsigned x=0; x<width; ++x)
{
const uint32 col=*(inp++);
row[x]=qRgb(TIFFGetR(col), TIFFGetG(col), TIFFGetB(col) ) | (TIFFGetA(col)<<24);
const uint32 col=*(inp++);
row[x]=qRgb(TIFFGetR(col), TIFFGetG(col), TIFFGetB(col) ) |
(TIFFGetA(col)<<24);
}
}
}
Bild = img.copy();
Bild = img.copy();
}
_TIFFfree(bits);
cmsHTRANSFORM xform;
cmsHPROFILE inputProf;
if((TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer)) && (UseEmbedded))
_TIFFfree(bits);
cmsHTRANSFORM xform;
cmsHPROFILE inputProf;
if((TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer)) && (UseEmbedded))
{
inputProf = cmsOpenProfileFromMem(EmbedBuffer, EmbedLen);
if ((int) cmsGetColorSpace(inputProf) == icSigRgbData)
inputProf = cmsOpenProfileFromMem(EmbedBuffer, EmbedLen);
if (static_cast<int>(cmsGetColorSpace(inputProf)) == icSigRgbData)
{
switch ((int) cmsGetColorSpace(CMSprinterProf))
switch (static_cast<int>(cmsGetColorSpace(CMSprinterProf)))
{
case icSigRgbData:
*realCMYK = false;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf, TYPE_RGBA_8, IntentPrinter, 0);
break;
case icSigCmykData:
*realCMYK = true;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf, TYPE_CMYK_8, IntentPrinter, 0);
break;
case icSigRgbData:
*realCMYK = false;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf,
TYPE_RGBA_8, IntentPrinter, 0);
break;
case icSigCmykData:
*realCMYK = true;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf,
TYPE_CMYK_8, IntentPrinter, 0);
break;
}
for (int i=0; i < Bild.height(); ++i)
for (int i=0; i < Bild.height(); ++i)
{
LPBYTE ptr = Bild.scanLine(i);
cmsDoTransform(xform, ptr, ptr, Bild.width());
LPBYTE ptr = Bild.scanLine(i);
cmsDoTransform(xform, ptr, ptr, Bild.width());
}
}
}
else
else
{
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
switch ((int) cmsGetColorSpace(CMSprinterProf))
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
switch (static_cast<int>(cmsGetColorSpace(CMSprinterProf)))
{
case icSigRgbData:
*realCMYK = false;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf, TYPE_RGBA_8, IntentPrinter, 0);
break;
case icSigCmykData:
*realCMYK = true;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf, TYPE_CMYK_8, IntentPrinter, 0);
break;
case icSigRgbData:
*realCMYK = false;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf,
TYPE_RGBA_8, IntentPrinter, 0);
break;
case icSigCmykData:
*realCMYK = true;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf,
TYPE_CMYK_8, IntentPrinter, 0);
break;
}
for (int i=0; i < Bild.height(); ++i)
for (int i=0; i < Bild.height(); ++i)
{
LPBYTE ptr = Bild.scanLine(i);
cmsDoTransform(xform, ptr, ptr, Bild.width());
LPBYTE ptr = Bild.scanLine(i);
cmsDoTransform(xform, ptr, ptr, Bild.width());
}
}
cmsDeleteTransform(xform);
cmsCloseProfile(inputProf);
cmsDeleteTransform(xform);
cmsCloseProfile(inputProf);
}
TIFFClose(tif);
TIFFClose(tif);
}
}
#endif
else
{
{
cmsHTRANSFORM xform;
cmsHPROFILE inputProf;
Bild.load(fn);
Bild = Bild.convertDepth(32);
Bild = Bild.convertDepth(32);
inputProf = cmsOpenProfileFromFile(InputProfiles[Prof], "r");
switch (static_cast<int>(cmsGetColorSpace(CMSprinterProf)))
{
{
case icSigRgbData:
*realCMYK = false;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf, TYPE_RGBA_8, IntentPrinter, 0);
626,15 → 628,15
*realCMYK = true;
xform = cmsCreateTransform(inputProf, TYPE_RGBA_8, CMSprinterProf, TYPE_CMYK_8, IntentPrinter, 0);
break;
}
}
for (int i=0; i < Bild.height(); ++i)
{
{
LPBYTE ptr = Bild.scanLine(i);
cmsDoTransform(xform, ptr, ptr, Bild.width());
}
}
cmsDeleteTransform(xform);
cmsCloseProfile(inputProf);
}
}
return Bild;
}
#endif
648,10 → 650,7
{
bool ok = false;
int c = in.toInt(&ok);
if (ok)
return c;
else
return 0;
return ok ? c : 0;
}
 
double QStodouble(QString in)
658,16 → 657,13
{
bool ok = false;
double c = in.toDouble(&ok);
if (ok)
return c;
else
return 0.0;
return ok ? c : 0.0;
}
 
QPixmap loadIcon(QString nam)
{
QString pfad = PREL;
pfad += "/lib/scribus/icons/"+nam;
QString pfad = PREL;
pfad += "/lib/scribus/icons/"+nam;
QPixmap pm;
pm.load(pfad);
return pm;
680,22 → 676,18
if (!fi.exists())
return false;
uint posi;
bool ret = false;
bool ret;
QByteArray bb(f.size());
if (f.open(IO_ReadOnly))
{
{
f.readBlock(bb.data(), f.size());
f.close();
for (posi = 0; posi < bb.size(); ++posi)
{
*Buffer += bb[posi];
}
ret = true;
}
}
else
{
ret = false;
}
return ret;
}
 
707,17 → 699,17
uint c2 = ch2.at(0).unicode();
Foi* fo = (*doc->AllFonts)[name];
if (fo->CharWidth.contains(c1))
{
{
w = fo->CharWidth[c1]*(Siz / 10.0);
if (fo->HasKern)
{
{
uint cl = FT_Get_Char_Index(doc->FFonts[name], c1);
uint cr = FT_Get_Char_Index(doc->FFonts[name], c2);
FT_Get_Kerning(doc->FFonts[name], cl, cr, ft_kerning_unscaled, &delta);
w += delta.x / fo->uniEM * (Siz / 10.0);
}
}
return w;
}
}
else
return static_cast<double>(Siz / 10.0);
}
724,11 → 716,7
 
QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota)
{
uint cx;
if (star)
cx = c * 2;
else
cx = c;
uint cx = star ? c * 2 : c;
double seg = 360.0 / cx;
double sc = rota + 180.0;
double di = factor;
736,39 → 724,29
int my = 0;
QPointArray pts = QPointArray();
for (uint x = 0; x < cx; ++x)
{
{
sc = seg * x + 180.0 + rota;
if (star)
{
if (x % 2 == 0)
{
mx = qRound(sin(sc / 180 * M_PI) * (w/2) + (w/2));
my = qRound(cos(sc / 180 * M_PI) * (h/2) + (h/2));
}
else
{
mx = qRound(sin(sc / 180 * M_PI) * (w/2*di) + (w/2));
my = qRound(cos(sc / 180 * M_PI) * (h/2*di) + (h/2));
}
}
{
double wf = x % 2 == 0 ? w / 2 : w / 2 * di;
double hf = x % 2 == 0 ? h / 2 : h / 2 * di;
mx = qRound(sin(sc / 180 * M_PI) * (wf) + (w/2));
my = qRound(cos(sc / 180 * M_PI) * (hf) + (h/2));
}
else
{
{
mx = qRound(sin(sc / 180 * M_PI) * (w/2) + (w/2));
my = qRound(cos(sc / 180 * M_PI) * (h/2) + (h/2));
}
}
pts.resize(x+1);
pts.setPoint(x, mx, my);
}
}
return pts;
}
 
FPointArray RegularPolygonF(double w, double h, uint c, bool star, double factor, double rota)
{
uint cx;
if (star)
cx = c * 2;
else
cx = c;
uint cx = star ? c * 2 : c;
double seg = 360.0 / cx;
double sc = rota + 180.0;
double di = factor;
776,29 → 754,23
double my = 0;
FPointArray pts = FPointArray();
for (uint x = 0; x < cx; ++x)
{
{
sc = seg * x + 180.0 + rota;
if (star)
{
if (x % 2 == 0)
{
mx = sin(sc / 180 * M_PI) * (w/2) + (w/2);
my = cos(sc / 180 * M_PI) * (h/2) + (h/2);
}
else
{
mx = sin(sc / 180 * M_PI) * (w/2*di) + (w/2);
my = cos(sc / 180 * M_PI) * (h/2*di) + (h/2);
}
}
{
double wf = x % 2 == 0 ? w / 2 : w / 2 * di;
double hf = x % 2 == 0 ? h / 2 : h / 2 * di;
mx = qRound(sin(sc / 180 * M_PI) * (wf) + (w/2));
my = qRound(cos(sc / 180 * M_PI) * (hf) + (h/2));
}
else
{
{
mx = sin(sc / 180 * M_PI) * (w/2) + (w/2);
my = cos(sc / 180 * M_PI) * (h/2) + (h/2);
}
}
pts.resize(x+1);
pts.setPoint(x, mx, my);
}
}
return pts;
}
 
808,23 → 780,23
QPointArray outa, cli;
Segs.clear();
if (ina.size() > 3)
{
for (uint poi=0; poi<ina.size()-3; poi += 4)
{
for (uint poi=0; poi<ina.size()-3; poi += 4)
if (ina.point(poi).x() > 900000)
{
if (ina.point(poi).x() > 900000)
{
outa.resize(outa.size()+1);
outa.setPoint(outa.size()-1, cli.point(cli.size()-1));
Segs.append(outa.size());
continue;
}
}
BezierPoints(&Bez, ina.pointQ(poi), ina.pointQ(poi+1), ina.pointQ(poi+3), ina.pointQ(poi+2));
cli = Bez.cubicBezier();
outa.putPoints(outa.size(), cli.size()-1, cli);
}
}
outa.resize(outa.size()+1);
outa.setPoint(outa.size()-1, cli.point(cli.size()-1));
}
}
return outa;
}
 
845,15 → 817,15
void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level)
{
for (uint la2 = 0; la2 < doc->Layers.count(); ++la2)
{
if (doc->Layers[la2].Level == Level)
{
if (doc->Layers[la2].Level == Level)
{
ll->Sichtbar = doc->Layers[la2].Sichtbar;
ll->Drucken = doc->Layers[la2].Drucken;
ll->LNr = doc->Layers[la2].LNr;
break;
}
}
}
}
 
QString ImageToTxt(QImage *im)
862,10 → 834,10
int w = im->width();
QString ImgStr = "";
for( int yi=0; yi < h; ++yi )
{
{
QRgb * s = (QRgb*)(im->scanLine( yi ));
for( int xi=0; xi < w; ++xi )
{
{
QRgb r=*s++;
unsigned char u=qRed(r);
ImgStr += u;
873,8 → 845,8
ImgStr += u;
u=qBlue(r);
ImgStr += u;
}
}
}
return ImgStr;
}
 
884,10 → 856,10
int w = im->width();
QString ImgStr = "";
for( int yi=0; yi < h; ++yi )
{
{
QRgb * s = (QRgb*)(im->scanLine( yi ));
for( int xi=0; xi < w; ++xi )
{
{
QRgb r=*s++;
int c = 255 - qRed(r);
int m = 255 - qGreen(r);
897,8 → 869,8
ImgStr += m - k;
ImgStr += y - k;
ImgStr += k;
}
}
}
return ImgStr;
}
 
908,12 → 880,12
int w = im->width();
QString ImgStr = "";
if (pre)
{
for( int yi=0; yi < h; ++yi )
{
for( int yi=0; yi < h; ++yi )
{
QRgb * s = (QRgb*)(im->scanLine( yi ));
for( int xi=0; xi < w; ++xi )
{
{
QRgb r=*s++;
int c = qRed(r);
int m = qGreen(r);
920,14 → 892,14
int y = qBlue(r);
int k = qAlpha(r);
if (pl == -1)
{
{
ImgStr += c;
ImgStr += m;
ImgStr += y;
ImgStr += k;
}
}
else
{
{
if (pl == -2)
ImgStr += QMIN(255, qRound(0.3 * c + 0.59 * m + 0.11 * y + k));
if (pl == 1)
938,17 → 910,17
ImgStr += y;
if (pl == 0)
ImgStr += k;
}
}
}
}
}
else
{
for( int yi=0; yi < h; ++yi )
{
for( int yi=0; yi < h; ++yi )
{
QRgb * s = (QRgb*)(im->scanLine( yi ));
for( int xi=0; xi < w; ++xi )
{
{
QRgb r=*s++;
int c = 255 - qRed(r);
int m = 255 - qGreen(r);
955,14 → 927,14
int y = 255 - qBlue(r);
int k = QMIN(QMIN(c, m), y);
if (pl == -1)
{
{
ImgStr += c - k;
ImgStr += m - k;
ImgStr += y - k;
ImgStr += k;
}
}
else
{
{
if (pl == -2)
ImgStr += QMIN(255, qRound(0.3 * c + 0.59 * m + 0.11 * y + k));
if (pl == 1)
973,10 → 945,10
ImgStr += y - k;
if (pl == 0)
ImgStr += k;
}
}
}
}
}
return ImgStr;
}
 
984,23 → 956,20
{
int h = im->height();
int w = im->width();
int w2;
w2 = w / 8;
if ((w % 8) != 0)
w2++;
int w2;
w2 = w / 8;
if ((w % 8) != 0)
w2++;
QString ImgStr = "";
for( int yi=0; yi < h; ++yi )
{
{
uchar * s = im->scanLine( yi );
for( int xi=0; xi < w2; ++xi )
{
{
unsigned char u = *(s+xi);
if (PDF)
ImgStr += ~u;
else
ImgStr += u;
}
ImgStr += PDF ? ~u : u;
}
}
return ImgStr;
}
 
1010,16 → 979,12
#ifdef HAVE_LIBZ
QByteArray bb(in->length());
for (uint ax = 0; ax < in->length(); ++ax)
{
bb[ax] = uchar(QChar(in->at(ax)));
}
uLong exlen = uint(bb.size() * 0.001 + 16) + bb.size();
QByteArray bc(exlen);
compress2((Byte *)bc.data(), &exlen, (Byte *)bb.data(), uLong(bb.size()), 9);
for (uint cl = 0; cl < exlen; ++cl)
{
out += bc[cl];
}
#else
out = *in;
#endif
1031,15 → 996,15
static char hexVal[3];
int i = 1;
while ( i >= 0 )
{
ushort hex = (u & 0x000f);
if ( hex < 0x0a )
{
ushort hex = (u & 0x000f);
if ( hex < 0x0a )
hexVal[i] = '0'+hex;
else
else
hexVal[i] = 'A'+(hex-0x0a);
u = u >> 4;
u = u >> 4;
i--;
}
}
hexVal[2] = '\0';
return hexVal;
}
1049,15 → 1014,15
int i = 0;
QString out = "";
for( uint xi = 0; xi < in->length(); ++xi )
{
{
out += toHex(uchar(QChar(in->at(xi))));
++i;
if ((i>40) && (lang))
{
{
out += '\n';
i=0;
}
}
}
return out;
}
 
1078,7 → 1043,7
uint dcoun = 0;
uint dcoun2 = 0;
while (ende)
{
{
if (Pdir[dcoun] == Bdir[dcoun])
dcoun++;
else
1085,16 → 1050,12
break;
if (dcoun > Pdir.count())
break;
}
}
dcoun2 = dcoun;
for (uint ddx2 = dcoun; ddx2 < Pdir.count(); ddx2++)
{
Ndir += "../";
}
for (uint ddx = dcoun2; ddx < Bdir.count(); ddx++)
{
Ndir += Bdir[ddx]+"/";
}
Ndir += Bfi.fileName();
return Ndir;
}
1106,17 → 1067,17
FT_Library library;
FT_Face face;
FT_ULong charcode;
FT_UInt gindex;
FT_UInt gindex;
error = FT_Init_FreeType(&library);
error = FT_New_Face(library, Dat, 0, &face);
gindex = 0;
charcode = FT_Get_First_Char(face, &gindex );
while (gindex != 0)
{
charcode = FT_Get_First_Char(face, &gindex );
while (gindex != 0)
{
FT_Get_Glyph_Name(face, gindex, buf, 50);
GList->insert(charcode, QString(reinterpret_cast<char*>(buf)));
charcode = FT_Get_Next_Char(face, charcode, &gindex );
}
charcode = FT_Get_Next_Char(face, charcode, &gindex );
}
FT_Done_FreeType( library );
return true;
}
1129,27 → 1090,27
FT_Library library;
FT_Face face;
FT_ULong charcode;
FT_UInt gindex;
uint counter1 = 32;
uint counter2 = 0;
FT_UInt gindex;
uint counter1 = 32;
uint counter2 = 0;
error = FT_Init_FreeType(&library);
error = FT_New_Face(library, Dat, 0, &face);
gindex = 0;
charcode = FT_Get_First_Char(face, &gindex );
while (gindex != 0)
{
charcode = FT_Get_First_Char(face, &gindex );
while (gindex != 0)
{
FT_Get_Glyph_Name(face, gindex, buf, 50);
gln.Code = counter1 + counter2;
gln.Name = "/"+QString(reinterpret_cast<char*>(buf));
GListInd->insert(charcode, gln);
charcode = FT_Get_Next_Char(face, charcode, &gindex );
counter1++;
if (counter1 > 255)
{
charcode = FT_Get_Next_Char(face, charcode, &gindex );
counter1++;
if (counter1 > 255)
{
counter1 = 32;
counter2 += 0x100;
}
}
}
FT_Done_FreeType( library );
return true;
}
1162,11 → 1123,11
double tox = ( to->x / 64.0 );
double toy = ( to->y / 64.0 );
if (!FirstM)
{
{
composite->addPoint(firstP);
composite->addPoint(firstP);
composite->setMarker();
}
}
else
FirstM = false;
composite->addPoint(FPoint(tox, toy));
1180,7 → 1141,7
double tox = ( to->x / 64.0 );
double toy = ( to->y / 64.0 );
if (composite->size() > 4)
{
{
FPoint b1 = composite->point(composite->size()-4);
FPoint b2 = composite->point(composite->size()-3);
FPoint b3 = composite->point(composite->size()-2);
1191,7 → 1152,7
FPoint n4 = FPoint(tox, toy);
if ((b1 == n1) && (b2 == n2) && (b3 == n3) && (b4 == n4))
return 0;
}
}
composite->addPoint(FPoint(tox, toy));
composite->addPoint(FPoint(tox, toy));
composite->addPoint(FPoint(tox, toy));
1206,7 → 1167,7
double x2 = ( to->x / 64.0 );
double y2 = ( to->y / 64.0 );
if (composite->size() > 4)
{
{
FPoint b1 = composite->point(composite->size()-4);
FPoint b2 = composite->point(composite->size()-3);
FPoint b3 = composite->point(composite->size()-2);
1217,13 → 1178,13
FPoint n4 = FPoint(x2, y2);
if ((b1 == n1) && (b2 == n2) && (b3 == n3) && (b4 == n4))
return 0;
}
}
composite->addPoint(FPoint(x2, y2));
composite->addPoint(FPoint(x1, y1));
composite->addPoint(FPoint(x2, y2));
composite->addPoint(FPoint(x2, y2));
return 0;
};
}
 
int traceCubicBezier( FT_Vector *p, FT_Vector *q, FT_Vector *to, FPointArray *composite )
{
1234,7 → 1195,7
double x3 = ( to->x / 64.0 );
double y3 = ( to->y / 64.0 );
if (composite->size() > 4)
{
{
FPoint b1 = composite->point(composite->size()-4);
FPoint b2 = composite->point(composite->size()-3);
FPoint b3 = composite->point(composite->size()-2);
1245,7 → 1206,7
FPoint n4 = FPoint(x3, y3);
if ((b1 == n1) && (b2 == n2) && (b3 == n3) && (b4 == n4))
return 0;
}
}
composite->setPoint(composite->size()-1, FPoint(x1, y1));
composite->addPoint(FPoint(x3, y3));
composite->addPoint(FPoint(x2, y2));
1292,7 → 1253,7
double mx = 0;
double my = 0;
for (uint c = 0; c < Clip.size(); ++c)
{
{
np = Clip.point(c);
if (np.x() > 900000)
continue;
1300,7 → 1261,7
mx = np.x();
if (np.y() > my)
my = np.y();
}
}
rp = FPoint(mx, my);
return rp;
}
1329,20 → 1290,20
p->setBrush(back);
p->drawRect(0.0, 0.0, static_cast<double>(w), static_cast<double>(h));
p->setBrush(Qt::black);
for (uint n = 0; n < ts.length(); n++)
{
for (uint n = 0; n < ts.length(); ++n)
{
uint dv = ts[n].unicode();
FPointArray gly = traceChar(face, dv, s, &x, &y);
if (gly.size() > 3)
{
{
gly.translate(static_cast<double>(pen_x) / 64.0, a);
gp = GetMaxClipF(gly);
ymax = QMAX(ymax, gp.y());
p->setupPolygon(&gly);
p->fillPath();
}
}
pen_x += face->glyph->advance.x;
}
}
p->end();
pm.resize(QMIN(qRound(gp.x()), w), QMIN(qRound(ymax), h));
delete p;
1360,14 → 1321,14
 
bool overwrite(QWidget *parent, QString filename)
{
bool retval = true;
QFileInfo fi(filename);
if (fi.exists())
bool retval = true;
QFileInfo fi(filename);
if (fi.exists())
{
int t = QMessageBox::warning(parent, QObject::tr("Warning"),
QObject::tr("Do you really want to overwrite the File:\n%1 ?").arg(filename),
QMessageBox::No, QMessageBox::Yes, QMessageBox::NoButton);
if (t == QMessageBox::No)
int t = QMessageBox::warning(parent, QObject::tr("Warning"),
QObject::tr("Do you really want to overwrite the File:\n%1 ?").arg(filename),
QMessageBox::No, QMessageBox::Yes, QMessageBox::NoButton);
if (t == QMessageBox::No)
retval = false;
}
return retval;
1461,9 → 1422,9
Buffer->Pfile3 = b->Pfile3;
QString Text = "";
if (b->Ptext.count() != 0)
{
for (a=0; a<b->Ptext.count(); ++a)
{
for (a=0; a<b->Ptext.count(); ++a)
{
if( (b->Ptext.at(a)->ch == "\n") || (b->Ptext.at(a)->ch == "\r"))
Text += QString(QChar(5))+"\t";
else if(b->Ptext.at(a)->ch == "\t")
1480,8 → 1441,8
Text += b->Ptext.at(a)->cstroke+"\t";
Text += QString::number(b->Ptext.at(a)->cshade2)+'\t';
Text += QString::number(b->Ptext.at(a)->cscale)+'\n';
}
}
}
Buffer->Ptext = Text;
Buffer->Clip = b->Clip.copy();
Buffer->PoLine = b->PoLine.copy();
1528,52 → 1489,52
PageItem *nb = b;
PageItem *nbl = b;
while (nb != 0)
{
{
if (nb->BackBox != 0)
nb = nb->BackBox;
else
break;
}
}
while (nb != 0)
{
for (uint a = 0; a < nb->Ptext.count(); ++a)
{
for (uint a = 0; a < nb->Ptext.count(); ++a)
{
QChar b = nb->Ptext.at(a)->ch[0];
if (b == QChar(13))
{
{
if (a >= nb->MaxChars)
paraN++;
else
para++;
}
}
if ((!b.isLetterOrNumber()) && (Dat.isLetterOrNumber()) && (!first))
{
{
if (a >= nb->MaxChars)
wwN++;
else
ww++;
}
}
if (a >= nb->MaxChars)
ccN++;
else
cc++;
Dat = b;
Dat = b;
first = false;
}
nbl = nb;
nb = nb->NextBox;
}
}
if (nbl->MaxChars < nbl->Ptext.count())
paraN++;
else
para++;
if (Dat.isLetterOrNumber())
{
{
if (nbl->MaxChars < nbl->Ptext.count())
wwN++;
else
ww++;
}
}
*w = ww;
*p = para;
*c = cc;
/trunk/Scribus/scribus/edit1format.cpp
184,7 → 184,7
BelowV->setMinimumSize( QSize( 70, 22 ) );
BelowV->setMaxValue( 300 );
BelowV->setMinValue( 0 );
AbstandVLayout->addWidget( BelowV, 1, 1 );
AbstandVLayout->addWidget( BelowV, 1, 1 );
 
LineSpVal = new MSpinBox( AbstandV, 1 );
LineSpVal->setMinimumSize( QSize( 70, 22 ) );
/trunk/Scribus/scribus/story.cpp
49,15 → 49,15
int p, i;
getCursorPosition(&p, &i);
if ((k->key() == Key_Backspace) && (i == 0))
{
{
emit bsPressed();
return;
}
}
if ((k->key() == Key_Delete) && (i == static_cast<int>(text().length())))
{
{
emit delPressed();
return;
}
}
QTextEdit::keyPressEvent(k);
if (clines != lines())
emit wrapped();
85,14 → 85,14
r = currentRow();
c = currentColumn();
if (c == 1)
{
{
tt = static_cast<SEditor*>(cellWidget(r, 1));
if ((k->key() == Key_Prior) || (k->key() == Key_Next))
{
{
HomeK = 0;
EndK = 0;
return;
}
}
if ((k->key() == Key_Left)
|| (k->key() == Key_Right)
|| (k->key() == Key_Down)
99,16 → 99,16
|| (k->key() == Key_Up)
|| (k->key() == Key_Home)
|| (k->key() == Key_End))
{
{
QTextEdit::CursorAction move;
tt->getCursorPosition(&p, &i);
switch (k->key())
{
{
case Key_Home:
EndK = 0;
HomeK++;
switch (HomeK)
{
{
case 1:
move = QTextEdit::MoveLineStart;
break;
121,13 → 121,13
move = QTextEdit::MoveHome;
HomeK = 0;
break;
}
}
break;
case Key_End:
HomeK = 0;
EndK++;
switch (EndK)
{
{
case 1:
move = QTextEdit::MoveLineEnd;
break;
140,25 → 140,25
move = QTextEdit::MoveEnd;
EndK = 0;
break;
}
}
break;
case Key_Left:
if ((i == 0) && (r > 0))
{
{
tt = dynamic_cast<SEditor*>(cellWidget(r-1, 1));
setCurrentCell(r-1, 1);
move = QTextEdit::MoveEnd;
}
}
else
move = QTextEdit::MoveBackward;
break;
case Key_Right:
if ((i == static_cast<int>(tt->text().length())) && (r < n-1))
{
{
tt = dynamic_cast<SEditor*>(cellWidget(r+1, 1));
setCurrentCell(r+1, 1);
move = QTextEdit::MoveLineStart;
}
}
else
move = QTextEdit::MoveForward;
break;
165,11 → 165,11
case Key_Up:
l = tt->lineOfChar(0, i);
if ((l == 0) && (r > 0))
{
{
tt = dynamic_cast<SEditor*>(cellWidget(r-1, 1));
setCurrentCell(r-1, 1);
move = QTextEdit::MoveEnd;
}
}
else
move = QTextEdit::MoveUp;
break;
176,15 → 176,15
case Key_Down:
l = tt->lineOfChar(0, i);
if ((l == tt->lines()-1) && (r < n-1))
{
{
tt = dynamic_cast<SEditor*>(cellWidget(r+1, 1));
setCurrentCell(r+1, 1);
move = QTextEdit::MoveLineStart;
}
}
else
move = QTextEdit::MoveDown;
break;
}
}
if (k->key() != Key_Home)
HomeK = 0;
if (k->key() != Key_End)
196,8 → 196,8
#endif
emit StatBarUpdt();
return;
}
}
}
HomeK = 0;
EndK = 0;
QTable::keyPressEvent(k);
220,17 → 220,16
int para = 0;
int pstyle;
doc = docc;
QString Dat = "";
QString Dat = "";
setCaption( tr( "Story Editor" ) );
setIcon(loadIcon("AppIcon.png"));
Form1Layout = new QVBoxLayout( this, 5, 5, "Form1Layout");
edList.clear();
stList.clear();
style.append( tr("Left"));
style.append( tr("Center"));
style.append( tr("Right"));
style.append( tr("Block"));
style.append( tr("Forced"));
char *tmp[] = {"Left", "Center", "Right", "Block", "Forced"};
size_t ar = sizeof(tmp) / sizeof(*tmp);
for (uint a = 0; a < ar; ++a)
style.append(tr(tmp[a]));
if (doc->Vorlagen.count() > 5)
{
for (uint a = 5; a < doc->Vorlagen.count(); ++a)
340,30 → 339,30
QPtrList<Pti> y;
PageItem *nb = ite;
while (nb != 0)
{
{
if (nb->BackBox != 0)
nb = nb->BackBox;
else
break;
}
}
while (nb != 0)
{
{
y = nb->Ptext;
for (a = 0; a < y.count(); ++a)
for (a = 0; a < y.count(); ++a)
{
QString b = y.at(a)->ch;
pstyle = y.at(a)->cab;
if (b == QChar(13))
{
{
addPar(para, Dat, pstyle);
Dat = "";
para++;
}
}
else
Dat += b;
Dat += b;
}
nb = nb->NextBox;
}
}
if (Dat != "")
addPar(para, Dat, pstyle);
if (table1->numRows() == 0)
375,11 → 374,11
cp->setFocus();
cp->setCursorPosition(0, 0);
for (uint a = 0; a < edList.count(); ++a)
{
{
SEditor *tt = edList.at(a);
tt->setUndoRedoEnabled(false);
tt->setUndoRedoEnabled(true);
}
}
emenu->setItemEnabled(Mundo, 0);
emenu->setItemEnabled(Mredo, 0);
emenu->setItemEnabled(Mcopy, 0);
400,32 → 399,32
int counter = 0;
int counter1 = 0;
int counter2 = 0;
while ( pos >= 0 )
while ( pos >= 0 )
{
pos = rx.search( cp->text(), pos );
if ( pos > -1 )
{
pos = rx.search( cp->text(), pos );
if ( pos > -1 )
{
counter++;
pos += rx.matchedLength();
}
}
}
WordC->setText(tmp.setNum(counter));
CharC->setText(tmp.setNum(cp->length()));
for (uint a = 0; a < edList.count(); ++a)
{
{
SEditor *tt = edList.at(a);
int pos = 0;
while ( pos >= 0 )
while ( pos >= 0 )
{
pos = rx.search( tt->text(), pos );
if ( pos > -1 )
{
pos = rx.search( tt->text(), pos );
if ( pos > -1 )
{
counter2++;
pos += rx.matchedLength();
}
}
}
counter1 += tt->length()+1;
}
}
WordC2->setText(tmp.setNum(counter2));
CharC2->setText(tmp.setNum(counter1-1));
}
438,13 → 437,13
void StoryEditor::Do_leave()
{
if (TextChanged)
{
{
int t = QMessageBox::warning(this, tr("Warning"),
tr("Do you really want to lose all your Changes?"),
tr("Do you really want to lose all your Changes?"),
QMessageBox::No, QMessageBox::Yes, QMessageBox::NoButton);
if (t == QMessageBox::No)
if (t == QMessageBox::No)
return;
}
}
reject();
}
 
451,9 → 450,9
void StoryEditor::Do_new()
{
int t = QMessageBox::warning(this, tr("Warning"),
tr("Do you really want to clear all your Text?"),
tr("Do you really want to clear all your Text?"),
QMessageBox::No, QMessageBox::Yes, QMessageBox::NoButton);
if (t == QMessageBox::No)
if (t == QMessageBox::No)
return;
table1->setNumCols( 2 );
table1->setNumRows( 0 );
533,14 → 532,14
bool first = false;
PageItem *nb = CurrItem;
while (nb != 0)
{
{
if (nb->BackBox != 0)
nb = nb->BackBox;
else
break;
}
}
for (uint a = 0; a < edList.count(); ++a)
{
{
Serializer *ss = new Serializer("");
SEditor *tt = edList.at(a);
QComboBox *cp = stList.at(a);
551,19 → 550,19
ss->GetText(nb, st, doc->Vorlagen[st].Font, doc->Vorlagen[st].FontSize, first);
delete ss;
first = true;
}
}
while (nb != 0)
{
if (doc->Trenner->AutoCheck)
{
if (doc->Trenner->AutoCheck)
{
if (doc->Trenner->Language != nb->Language)
doc->Trenner->slotNewDict(nb->Language);
doc->Trenner->slotHyphenate(nb);
}
}
else
nb->OwnPage->RefreshItem(nb);
nb = nb->NextBox;
}
}
TextChanged = false;
emenu->setItemEnabled(Mupdt, 0);
emit DocChanged();
575,18 → 574,17
QComboBox *ct;
emit EditSt();
style.clear();
style.append( tr("Left"));
style.append( tr("Center"));
style.append( tr("Right"));
style.append( tr("Block"));
style.append( tr("Forced"));
char *tmp[] = {"Left", "Center", "Right", "Block", "Forced"};
size_t ar = sizeof(tmp) / sizeof(*tmp);
for (uint a = 0; a < ar; ++a)
style.append(tr(tmp[a]));
if (doc->Vorlagen.count() > 5)
{
{
for (uint a = 5; a < doc->Vorlagen.count(); ++a)
style.append(doc->Vorlagen[a].Vname);
}
}
for (uint b = 0; b < stList.count(); ++b)
{
{
ct = stList.at(b);
sty = ct->currentItem();
if (sty > static_cast<int>(doc->Vorlagen.count()-1))
598,7 → 596,7
ct->setCurrentItem(sty);
disconnect(ct, SIGNAL(highlighted(int)), this, SLOT(styleChange(int)));
connect(ct, SIGNAL(activated(int)), this, SLOT(styleChange(int)));
}
}
}
 
void StoryEditor::styleChange(int st)
606,10 → 604,10
int r = stList.findRef((QComboBox*)sender());
int align = st > 4 ? doc->Vorlagen[st].Ausri : st;
if (r != -1)
{
{
SEditor *tt = dynamic_cast<SEditor*>(table1->cellWidget(r, 1));
switch (align)
{
{
case 0:
tt->setAlignment(Qt::AlignLeft);
break;
625,9 → 623,9
break;
default:
break;
}
}
modifiedText();
}
}
}
 
int StoryEditor::getStyle(int where)
643,13 → 641,13
ct->insertStringList(style);
ct->setMaximumSize(200, 24);
ct->setEditable(false);
table1->setCellWidget(where, 0, ct);
table1->setCellWidget(where, 0, ct);
SEditor *cp = new SEditor(this);
stList.insert(where, ct);
edList.insert(where, cp);
table1->setCellWidget(where, 1, cp);
table1->setCurrentCell(where, 1);
cp->setText(text);
cp->setText(text);
table1->adjHeight(where);
connect(ct, SIGNAL(highlighted(int)), this, SLOT(styleChange(int)));
ct->setCurrentItem(sty);
687,7 → 685,7
{
int r = edList.findRef((SEditor*)sender());
if (r != -1)
{
{
table1->setCurrentCell(r, 1);
table1->cellWidget(r, 1)->setFocus();
#if QT_VERSION >= 0x030100
694,7 → 692,7
table1->updateHeaderStates();
#endif
updateStatus();
}
}
}
 
void StoryEditor::KeyDel()
704,7 → 702,7
SEditor *tt = (SEditor*)sender();
tmp = tt->text();
if (r < table1->numRows()-1)
{
{
int al = tt->alignment();
SEditor *bt = edList.at(r+1);
tmp2 = bt->text();
718,7 → 716,7
tt->setFocus();
tt->setCursorPosition(0, tmp.length());
updateStatus();
}
}
}
 
void StoryEditor::KeyBS()
728,7 → 726,7
SEditor *tt = (SEditor*)sender();
tmp = tt->text();
if (r > 0)
{
{
SEditor *bt = edList.at(r-1);
int al = bt->alignment();
tmp2 = bt->text();
742,7 → 740,7
bt->setFocus();
bt->setCursorPosition(0, tmp2.length());
updateStatus();
}
}
}
 
void StoryEditor::KeyRet()
755,23 → 753,23
int st = getStyle(table1->currentRow());
int rPos = tmp.find("\n");
if (CurrItem->PType == 8)
{
{
tmp.remove("\n");
tt->setText(tmp);
tt->setAlignment(al);
return;
}
}
if (rPos < static_cast<int>(tmp.length()))
{
{
tmp2 = tmp.left(rPos);
tmp3 = tmp.mid(rPos+1);
tt->setText(tmp2);
}
}
else
{
{
tmp.remove("\n");
tt->setText(tmp);
}
}
tt->setAlignment(al);
table1->adjHeight(table1->currentRow());
addPar(table1->currentRow()+1, tmp3, st);
863,4 → 861,3
delete ss;
}
}
 
/trunk/Scribus/scribus/styleselect.h
0,0 → 1,41
#ifndef STYLESELECT_H
#define STYLESELECT_H
 
#include <qbuttongroup.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
 
class StyleSelect : public QWidget
{
 
Q_OBJECT
 
public:
StyleSelect(QWidget* parent);
~StyleSelect() {};
void setStyle(int s);
int getStyle();
 
QButtonGroup* ButtonGroup1;
QToolButton* Underline;
QToolButton* Subs;
QToolButton* Supers;
QToolButton* Kapital;
QToolButton* Strike;
QToolButton* Outlined;
private slots:
void setTypeStyle();
 
signals:
void State(int);
 
protected:
QHBoxLayout* Layout1;
QHBoxLayout* ButtonGroup1Layout;
 
};
 
#endif
 
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Scribus/scribus/picstatus.cpp
===================================================================
--- Scribus/scribus/picstatus.cpp (revision 166)
+++ Scribus/scribus/picstatus.cpp (revision 167)
@@ -59,13 +59,10 @@
PicTable->verticalHeader()->hide();
PicTable->setNumCols( 7 );
Header = PicTable->horizontalHeader();
- Header->setLabel(0, tr("Name"));
- Header->setLabel(1, tr("Path"));
- Header->setLabel(2, tr("Page"));
- Header->setLabel(3, " ");
- Header->setLabel(4, tr("Print"));
- Header->setLabel(5, tr("Status"));
- Header->setLabel(6, " ");
+ char *tmpc[] = {"Name", "Path", "Page", " ", "Print", "Status", " "};
+ size_t ar = sizeof(tmpc) / sizeof(*tmpc);
+ for (uint a = 0; a < ar; ++a)
+ Header->setLabel(a, tr(tmpc[a]));
Zeilen = 0;
for (p=0; p<view->MasterPages.count(); ++p)
{
@@ -250,19 +247,15 @@
{
view->Pages.at(PgNr)->LoadPict(fileName, ItNr);
PicTable->setText(zz, 1, view->Pages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
+ PicTable->setText(zz, 5, view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail ?
+ tr("OK") : tr("Missing"));
}
else
{
view->MasterPages.at(PgNr)->LoadPict(fileName, ItNr);
PicTable->setText(zz, 1, view->MasterPages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->MasterPages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
+ PicTable->setText(zz, 5, view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail ?
+ tr("OK") : tr("Missing"));
}
}
}
@@ -285,19 +278,15 @@
{
view->Pages.at(PgNr)->LoadPict(Pfade[0], ItNr);
PicTable->setText(zz, 1, view->Pages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
+ PicTable->setText(zz, 5, view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail ?
+ tr("OK") : tr("Missing"));
}
else
{
view->MasterPages.at(PgNr)->LoadPict(Pfade[0], ItNr);
PicTable->setText(zz, 1, view->MasterPages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->MasterPages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
+ PicTable->setText(zz, 5, view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail ?
+ tr("OK") : tr("Missing"));
}
}
}
Index: Scribus/scribus/cmsprefs.cpp
===================================================================
--- Scribus/scribus/cmsprefs.cpp (revision 166)
+++ Scribus/scribus/cmsprefs.cpp (revision 167)
@@ -125,10 +125,10 @@
RenderLayout->addWidget( Text22, 1, 0 );
MonitorI = new QComboBox( true, Render, "MonitorI" );
- MonitorI->insertItem( tr( "Perceptual" ) );
- MonitorI->insertItem( tr( "Relative Colorimetric" ) );
- MonitorI->insertItem( tr( "Saturation" ) );
- MonitorI->insertItem( tr( "Absolute Colorimetric" ) );
+ char *tmp_mp[] = {"Perceptual", "Relative Colorimetric", "Saturation", "Absolute Colorimetric"};
+ size_t array = sizeof(tmp_mp) / sizeof(*tmp_mp);
+ for (uint a = 0; a < array; ++a)
+ MonitorI->insertItem(tr(tmp_mp[a]));
MonitorI->setMinimumSize( QSize( 190, 22 ) );
MonitorI->setEditable(false);
MonitorI->setCurrentItem(Vor->DefaultIntentMonitor);
@@ -136,10 +136,8 @@
RenderLayout->addWidget( MonitorI, 0, 1 );
PrinterI = new QComboBox( true, Render, "PrinterI" );
- PrinterI->insertItem( tr( "Perceptual" ) );
- PrinterI->insertItem( tr( "Relative Colorimetric" ) );
- PrinterI->insertItem( tr( "Saturation" ) );
- PrinterI->insertItem( tr( "Absolute Colorimetric" ) );
+ for (uint a = 0; a < array; ++a)
+ PrinterI->insertItem(tr(tmp_mp[a]));
PrinterI->setMinimumSize( QSize( 190, 22 ) );
PrinterI->setEditable(false);
PrinterI->setCurrentItem(Vor->DefaultIntentPrinter);
/trunk/Scribus/scribus/buttonicon.cpp
14,13 → 14,11
TextLabel1_2->setText( tr( "Layout:" ) );
Layout1->addWidget( TextLabel1_2, 0, 0 );
Place = new QComboBox( true, this, "Place" );
Place->insertItem( tr( "Caption only" ) );
Place->insertItem( tr( "Icon only" ) );
Place->insertItem( tr( "Caption below Icon" ) );
Place->insertItem( tr( "Caption above Icon" ) );
Place->insertItem( tr( "Caption right to Icon" ) );
Place->insertItem( tr( "Caption left to Icon" ) );
Place->insertItem( tr( "Caption overlays Icon" ) );
char *tmp_pla[] = {"Caption only", "Icon only", "Caption below Icon", "Caption above Icon",
"Caption right to Icon", "Caption left to Icon", "Caption overlays Icon"};
size_t array_pla = sizeof(tmp_pla) / sizeof(*tmp_pla);
for (uint a = 0; a < array_pla; ++a)
Place->insertItem(tr(tmp_pla[a]));
Place->setEditable(false);
Layout1->addWidget( Place, 0, 1 );
TextLabel1 = new QLabel( this, "TextLabel1" );
/trunk/Scribus/scribus/seiten.cpp
8,9 → 8,7
{
QByteArray data(secret.length());
for (uint a = 0; a < secret.length(); ++a)
{
data[a]= QChar(secret[a]);
}
setEncodedData( data );
}
 
23,15 → 21,13
{
QByteArray payload = e->data("page/magic");
if (payload.size())
{
{
e->accept();
str = "";
for (uint a = 0; a < payload.size(); ++a)
{
str += payload[a];
}
return true;
}
}
return false;
}
 
51,17 → 47,19
QTable *tt = table();
sv = (SeView*)tt;
if (Side)
{
{
p->drawPixmap(0, (cr.height()-py)/2, pixmap());
if (sv->Namen)
p->drawText(px, 0, cr.width()-px, cr.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak, text());
}
p->drawText(px, 0, cr.width()-px, cr.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak,
text());
}
else
{
{
p->drawPixmap(cr.width()-px-2, (cr.height()-py)/2, pixmap());
if (sv->Namen)
p->drawText(0, 0, cr.width()-px-2, cr.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak, text());
}
p->drawText(0, 0, cr.width()-px-2, cr.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak,
text());
}
}
 
/* ListBox Subclass */
75,7 → 73,7
{
Mpressed = false;
if (m->button() == RightButton)
{
{
QPopupMenu *pmen = new QPopupMenu();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
int px = pmen->insertItem( tr("Show Page Previews"), this, SLOT(ToggleTh()));
83,7 → 81,7
pmen->setItemChecked(px, true);
pmen->exec(QCursor::pos());
delete pmen;
}
}
}
 
void SeList::ToggleTh()
98,27 → 96,26
CurItem = 0;
QListBoxItem *i = itemAt(e->pos());
if (i)
{
{
CurItem = i;
Mpos = e->pos();
Mpressed = true;
}
Mpressed = true;
}
}
 
void SeList::mouseMoveEvent(QMouseEvent* e)
{
if ((Mpressed) && ((Mpos - e->pos()).manhattanLength() > 4))
{
{
Mpressed = false;
QListBoxItem *i = itemAt(Mpos);
if (i)
{
{
QDragObject *dr = new SeDrag("1"+i->text(), this, "te");
dr->setPixmap(loadIcon("doc.png"));
dr->drag();
}
}
}
}
 
/* QTable Subclass */
131,7 → 128,7
Mpressed = false;
Doppel = false;
Namen = true;
pix = QPixmap(2, 34);
pix = QPixmap(2, 34);
pix.fill(black);
setFocusPolicy(NoFocus);
}
148,7 → 145,7
e->accept();
Mpressed = false;
if (e->button() == RightButton)
{
{
QPopupMenu *pmen = new QPopupMenu();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
int px = pmen->insertItem( tr("Show Template Names"), this, SLOT(ToggleNam()));
156,7 → 153,7
pmen->setItemChecked(px, true);
pmen->exec(QCursor::pos());
delete pmen;
}
}
emit Click(rowAt(e->pos().y()), columnAt(e->pos().x()), e->button());
}
 
179,17 → 176,17
int a = rowAt(e->pos().y());
int b = columnAt(e->pos().x());
if ((Mpressed) && ((Mpos - e->pos()).manhattanLength() > 4))
{
{
Mpressed = false;
if ((a != -1) && (b != -1))
{
{
str = text(a, b);
p = GetPage(a, b);
QDragObject *dr = new SeDrag("2 "+tmp.setNum(p)+" "+str, this, "te");
dr->setPixmap(loadIcon("doc.png"));
dr->drag();
}
}
}
}
 
void SeView::contentsDropEvent(QDropEvent * e)
196,9 → 193,9
{
QString str, tmp;
if (SeDrag::decode(e, str))
{
if (str.startsWith("1"))
{
if (str.startsWith("1"))
{
int a = rowAt(e->pos().y());
int b = columnAt(e->pos().x());
int p;
206,65 → 203,60
if ((a == -1) || (b == -1))
return;
if (Doppel)
{
if (((a % 2) == 1) && ((b == 0) || (b == 2)))
{
if (((a % 2) == 1) && ((b == 0) || (b == 2)))
if (Links)
{
if (Links)
{
if (b == 0)
emit NewPage(a-1, tmp);
if (b == 2)
emit NewPage(a, tmp);
}
}
else
{
{
if (b == 0)
{
if (a == 1)
emit NewPage(a-1, tmp);
else
emit NewPage(a-2, tmp);
}
emit NewPage((a == 1 ? a - 1 : a - 2), tmp);
if (b == 2)
emit NewPage(a-1, tmp);
}
}
ClearPix();
}
}
if (a == numRows()-1)
emit NewPage(MaxC+1, tmp);
if (((a % 2) == 1) && ((b == 1) || (b == 3)))
{
if (item(a,b) != 0)
{
if (item(a,b) != 0)
{
p = GetPage(a, b);
emit UseTemp(tmp, p);
setText(a, b, tmp);
}
}
}
}
else
{
if ((a == -1) || ((a % 2) == 0))
{
if ((a == -1) || ((a % 2) == 0))
{
setNumRows(numRows()+2);
if (a == -1)
emit NewPage(numRows()/2-1, tmp);
else
{
{
emit NewPage(a/2, tmp);
clearCell(a, 0);
}
}
}
else
{
{
emit UseTemp(tmp, a/2);
setText(a, 0, tmp);
}
}
}
return;
}
}
if (str.startsWith("2"))
{
{
int st = str.find(" ");
int en = str.find(" ", st+1);
tmp = str.mid(en+1);
275,76 → 267,69
if ((a == -1) || (b == -1))
return;
if (Doppel)
{
if (((a % 2) == 1) && ((b == 0) || (b == 2)))
{
if (((a % 2) == 1) && ((b == 0) || (b == 2)))
if (Links)
{
if (Links)
{
if (b == 0)
z = a-1;
if (b == 2)
z = a;
}
}
else
{
{
if (b == 0)
{
if (a == 1)
z = a-1;
else
z = a-2;
}
z = a == 1 ? a - 1 : a - 2;
if (b == 2)
z = a-1;
}
}
if (dr != z)
emit MovePage(dr, z);
ClearPix();
}
}
if (a == numRows()-1)
{
{
z = MaxC;
emit MovePage(dr, z);
}
}
if (((a % 2) == 1) && ((b == 1) || (b == 3)))
{
if (item(a,b) != 0)
{
if (item(a,b) != 0)
{
p = GetPage(a, b);
emit UseTemp(tmp, p);
setText(a, b, tmp);
}
}
}
}
else
{
if ((a == -1) || ((a % 2) == 0))
{
if ((a == -1) || ((a % 2) == 0))
if (a != -1)
{
if (a != -1)
{
if (dr != a/2)
emit MovePage(dr, a/2);
clearCell(a, 0);
}
}
}
else
{
{
emit UseTemp(tmp, a/2);
setText(a, 0, tmp);
}
}
}
ClearPix();
return;
}
}
}
}
 
void SeView::contentsDragEnterEvent(QDragEnterEvent *e)
{
if (SeDrag::canDecode(e))
{
e->accept();
}
}
 
void SeView::contentsDragLeaveEvent(QDragLeaveEvent *e)
356,66 → 341,61
{
QString str, tmp;
if (SeDrag::decode(e, str))
{
{
int a = rowAt(e->pos().y());
int b = columnAt(e->pos().x());
if ((a == -1) || (b == -1))
{
{
ClearPix();
return;
}
}
if (Doppel)
{
if ((((a % 2) == 1) && ((b == 0) || (b == 2))) || (a == numRows()-1))
{
if ((((a % 2) == 1) && ((b == 0) || (b == 2))) || (a == numRows()-1))
{
QPixmap pm;
pm = QPixmap(columnWidth(b), rowHeight(a));
pm = QPixmap(columnWidth(b), rowHeight(a));
pm.fill(darkBlue);
setPixmap(a, b, pm);
}
}
else
ClearPix();
}
}
else
{
if ((a % 2) == 0)
{
if ((a % 2) == 0)
{
QPixmap pm;
pm = QPixmap(columnWidth(0), 9);
pm = QPixmap(columnWidth(0), 9);
pm.fill(darkBlue);
setPixmap(a, 0, pm);
}
}
else
ClearPix();
}
}
}
}
 
void SeView::ClearPix()
{
for (int a = 0; a < numRows(); ++a)
{
if (Doppel)
{
if (Doppel)
clearCell(a, 0);
setPixmap(a, 2, pix);
if ((a % 2) != 1)
{
if ((a % 2) == 1)
{
clearCell(a,0);
setPixmap(a,2, pix);
}
else
{
clearCell(a,0);
clearCell(a,1);
setPixmap(a,2, pix);
clearCell(a,3);
}
}
}
else
{
{
if ((a % 2) == 0)
clearCell(a, 0);
}
}
}
}
 
int SeView::GetPage(int r, int c)
422,33 → 402,30
{
int p;
if (Doppel)
{
if (Links)
{
if (Links)
{
if (c == 1)
p = r;
if (c == 3)
p = r+1;
}
}
else
{
{
if ((c == 1) && ( r == 1))
return 0;
if (c == 1)
p = r - 1;
else
p = r;
}
p = c == 1 ? r - 1 : r;
}
p--;
if (p > MaxC)
p = MaxC;
}
}
else
{
{
p = r / 2;
if (p > MaxC)
p = MaxC;
}
}
return p;
}
 
465,10 → 442,10
void TrashBin::dragEnterEvent(QDragEnterEvent *e)
{
if (SeDrag::canDecode(e))
{
{
e->accept();
setPixmap(Offen);
}
}
}
 
void TrashBin::dragLeaveEvent(QDragLeaveEvent *)
481,19 → 458,19
setPixmap(Normal);
QString str, tmp;
if (SeDrag::decode(e, str))
{
if (str.startsWith("2"))
{
if (str.startsWith("2"))
{
int st = str.find(" ");
int en = str.find(" ", st+1);
emit DelPage(str.mid(st, en-st).toInt());
}
}
if (str.startsWith("1"))
{
{
tmp = str.remove(0,1);
emit DelMaster(tmp);
}
}
}
}
 
 
514,8 → 491,8
TextLabel1->setText( tr( "Available Templates:" ) );
Layout2->addWidget( TextLabel1 );
TemplList = new SeList(privateLayoutWidget);
TemplList->setMinimumSize(QSize(130,70));
TemplList->Thumb = false;
TemplList->setMinimumSize(QSize(130,70));
TemplList->Thumb = false;
Layout2->addWidget( TemplList );
QWidget* privateLayoutWidget_2 = new QWidget( Splitter1, "Layout3" );
Layout3 = new QVBoxLayout( privateLayoutWidget_2, 0, 5, "Layout3");
531,9 → 508,9
PageView->setSelectionMode(QTable::NoSelection);
PageView->setColumnMovingEnabled(false);
PageView->setRowMovingEnabled(false);
PageView->setNumRows(1);
PageView->setNumCols(1);
PageView->setMinimumSize(QSize(130,120));
PageView->setNumRows(1);
PageView->setNumCols(1);
PageView->setMinimumSize(QSize(130,120));
Layout3->addWidget( PageView );
SeitenPalLayout->addWidget( Splitter1 );
 
544,10 → 521,10
Layout4 = new QVBoxLayout;
Layout4->setSpacing( 6 );
Layout4->setMargin( 0 );
DS = new QCheckBox(this, "DS");
DS = new QCheckBox(this, "DS");
DS->setText( tr( "Facing Pages" ) );
Layout4->addWidget( DS );
LP = new QCheckBox(this, "LP");
LP = new QCheckBox(this, "LP");
LP->setText( tr( "Left Page first" ) );
Layout4->addWidget( LP );
Layout1->addLayout( Layout4 );
556,22 → 533,23
Layout1->addItem( spacer );
 
Trash = new TrashBin( this );
Trash->setMinimumSize(QSize(22,22));
Trash->setMinimumSize(QSize(22,22));
Layout1->addWidget( Trash );
SeitenPalLayout->addLayout( Layout1 );
pix = loadIcon("document2.png");
Vie = 0;
Rebuild();
connect(TemplList, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(selTemplate()));
connect(TemplList, SIGNAL(ThumbChanged()), this, SLOT(RebuildTemp()));
connect(PageView, SIGNAL(Click(int, int, int)), this, SLOT(GotoPage(int, int, int)));
connect(PageView, SIGNAL(MovePage(int, int)), this, SLOT(MPage(int, int)));
connect(DS, SIGNAL(clicked()), this, SLOT(HandleDS()));
connect(LP, SIGNAL(clicked()), this, SLOT(HandleLP()));
connect(Trash, SIGNAL(DelMaster(QString)), this, SLOT(DelMPage(QString)));
QToolTip::add( Trash, tr( "Drag Pages or Template Pages onto the Trashbin to delete them." ) );
QToolTip::add( PageView, tr( "This previews all the pages of your Document." )
); QToolTip::add( TemplList, tr( "Here are all your Templates, to create a new Page\ndrag a Template to the Pageview below." ) );
pix = loadIcon("document2.png");
Vie = 0;
Rebuild();
connect(TemplList, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(selTemplate()));
connect(TemplList, SIGNAL(ThumbChanged()), this, SLOT(RebuildTemp()));
connect(PageView, SIGNAL(Click(int, int, int)), this, SLOT(GotoPage(int, int, int)));
connect(PageView, SIGNAL(MovePage(int, int)), this, SLOT(MPage(int, int)));
connect(DS, SIGNAL(clicked()), this, SLOT(HandleDS()));
connect(LP, SIGNAL(clicked()), this, SLOT(HandleLP()));
connect(Trash, SIGNAL(DelMaster(QString)), this, SLOT(DelMPage(QString)));
QToolTip::add( Trash, tr( "Drag Pages or Template Pages onto the Trashbin to delete them." ) );
QToolTip::add( PageView, tr( "This previews all the pages of your Document." ));
QToolTip::add( TemplList,
tr( "Here are all your Templates, to create a new Page\ndrag a Template to the Pageview below." ) );
}
 
 
583,8 → 561,8
 
void SeitenPal::DelMPage(QString tmp)
{
if (tmp == tr("Normal"))
return;
if (tmp == tr("Normal"))
return;
int Nr = Vie->MasterNames[tmp];
Page* Seite = Vie->MasterPages.at(Nr);
Vie->MasterPages.remove(Nr);
591,36 → 569,28
delete Seite->parentWidget();
Vie->MasterNames.clear();
for (uint aa=0; aa < Vie->MasterPages.count(); ++aa)
{
{
Seite = Vie->MasterPages.at(aa);
Seite->PageNr = aa;
if (Vie->Doc->PageFP)
{
if (Seite->LeftPg)
{
Seite->Margins.Left = Vie->Doc->PageM.Right;
Seite->Margins.Right = Vie->Doc->PageM.Left;
}
else
{
Seite->Margins.Right = Vie->Doc->PageM.Right;
Seite->Margins.Left = Vie->Doc->PageM.Left;
}
}
{
Seite->Margins.Left = Seite->LeftPg ? Vie->Doc->PageM.Right : Vie->Doc->PageM.Left;
Seite->Margins.Right= Seite->LeftPg? Vie->Doc->PageM.Left : Vie->Doc->PageM.Right;
}
else
{
{
Seite->Margins.Right = Vie->Doc->PageM.Right;
Seite->Margins.Left = Vie->Doc->PageM.Left;
}
}
Seite->Margins.Top = Vie->Doc->PageM.Top;
Seite->Margins.Bottom = Vie->Doc->PageM.Bottom;
Vie->MasterNames[Seite->PageNam] = aa;
}
}
for (uint b=0; b<Vie->DocPages.count(); ++b)
{
{
if (Vie->DocPages.at(b)->MPageNam == tmp)
Vie->DocPages.at(b)->MPageNam = "Normal";
}
}
Vie->DrawNew();
RebuildTemp();
RebuildPage();
629,15 → 599,7
 
void SeitenPal::MPage(int r, int c)
{
if (r > c)
Vie->movePage(r, r+1, c, 0);
else
{
if (c > PageView->MaxC)
Vie->movePage(r, r+1, c, 2);
else
Vie->movePage(r, r+1, c, 1);
}
Vie->movePage(r, r + 1, c, r > c ? 0 : (c > PageView->MaxC ? 2 : 1));
RebuildPage();
Vie->Doc->setModified();
}
646,10 → 608,10
{
int p;
if ((b == LeftButton) && (r != -1) && (c != -1))
{
{
p = PageView->GetPage(r, c);
emit GotoSeite(p);
}
}
}
 
void SeitenPal::DisablePal()
665,10 → 627,7
PageView->setEnabled(true);
TemplList->setEnabled(true);
DS->setEnabled(true);
if (PageView->Doppel)
LP->setEnabled(true);
else
LP->setEnabled(false);
LP->setEnabled(PageView->Doppel ? true : false);
}
 
void SeitenPal::HandleDS()
684,10 → 643,7
Vie->GotoPage(Vie->Doc->ActPage->PageNr);
RebuildPage();
Vie->Doc->setModified();
if (fp)
LP->setEnabled(true);
else
LP->setEnabled(false);
LP->setEnabled(fp ? true : false);
}
 
void SeitenPal::HandleLP()
714,22 → 670,12
return;
QMap<QString,int>::Iterator it;
for (it = Vie->MasterNames.begin(); it != Vie->MasterNames.end(); ++it)
{
{
if (TemplList->Thumb)
{
if (it.key() == "Normal")
TemplList->insertItem(Vie->MPageToPixmap(it.key(),60), tr("Normal"));
else
TemplList->insertItem(Vie->MPageToPixmap(it.key(),60), it.key());
}
TemplList->insertItem(Vie->MPageToPixmap(it.key(),60), it.key() == "Normal" ? tr("Normal") : it.key());
else
{
if (it.key() == "Normal")
TemplList->insertItem( tr("Normal"));
else
TemplList->insertItem(it.key());
}
}
TemplList->insertItem(it.key() == "Normal" ? tr("Normal") : it.key());
}
}
 
void SeitenPal::RebuildPage()
740,11 → 686,11
PageView->setNumRows(1);
PageView->setNumCols(1);
if (Vie == 0)
{
{
connect(DS, SIGNAL(clicked()), this, SLOT(HandleDS()));
connect(LP, SIGNAL(clicked()), this, SLOT(HandleLP()));
return;
}
}
PageView->Doppel = Vie->Doc->PageFP;
PageView->Links = Vie->Doc->FirstPageLeft;
DS->setChecked(PageView->Doppel);
753,13 → 699,10
LP->setEnabled(true);
PageView->MaxC = Vie->Pages.count()-1;
if (Vie->Doc->PageFP)
{
{
int cc, cb;
bool Side;
if (PageView->Namen)
resize(240, height());
else
resize(180, height());
resize(PageView->Namen ? 240 : 180, height());
PageView->setNumCols(4);
PageView->setColumnWidth(0, 5);
PageView->setColumnWidth(2, 5);
770,20 → 713,20
PageView->setColumnWidth(3, val);
cc = 1;
if (Vie->Doc->FirstPageLeft)
{
{
PageView->setNumRows(((Vie->Doc->PageC-1)/2 + 1) * 2 + 1);
cb = 1;
}
}
else
{
{
PageView->setNumRows((Vie->Doc->PageC/2 + 1) * 2 +1);
cb = 3;
}
}
for (uint a = 0; a < Vie->Pages.count(); ++a)
{
{
str = Vie->Pages.at(a)->MPageNam;
Side = cb == 1 ? false : true;
QTableItem *it = new SeItem( PageView, str, CreateIcon(a, pix), Side);
QTableItem *it = new SeItem( PageView, str, CreateIcon(a, pix), Side);
PageView->setItem(cc, cb, it);
PageView->setRowHeight(cc, pix.height());
PageView->setPixmap(cc, 2, PageView->pix);
793,22 → 736,22
PageView->adjustRow(cc);
cb += 2;
if (cb > 3)
{
{
cb = 1;
cc += 2;
}
}
}
}
}
else
{
{
PageView->setNumRows(Vie->Pages.count()*2+1);
PageView->setNumCols(1);
resize(180, height());
int cc = 1;
for (uint a = 0; a < Vie->Pages.count(); ++a)
{
{
str = Vie->Pages.at(a)->MPageNam;
QTableItem *it = new SeItem( PageView, str, CreateIcon(a, pix), true);
QTableItem *it = new SeItem( PageView, str, CreateIcon(a, pix), true);
PageView->setItem(cc, 0, it);
PageView->setRowHeight(cc, pix.height());
PageView->adjustRow(cc);
815,9 → 758,9
PageView->setRowHeight(cc-1, 10);
PageView->setRowReadOnly(cc-1, true);
cc += 2;
}
}
PageView->adjustColumn(0);
}
}
PageView->setRowHeight(PageView->numRows()-1, 10);
if (Vie->Doc->PageFP)
PageView->setPixmap(PageView->numRows()-1, 2, PageView->pix);
/trunk/Scribus/scribus/guidemanager.cpp
142,22 → 142,9
 
QString GuideManager::GetUnit()
{
QString tmp = "";
switch (Einheit)
{
case 0:
tmp = tr(" pt");
break;
case 1:
tmp = tr(" mm");
break;
case 2:
tmp = tr(" in");
break;
case 3:
tmp = tr(" p");
break;
}
QString tmp = (Einheit == 0) ? tr(" pt") :
(Einheit == 1) ? tr(" mm") :
(Einheit == 2) ? tr(" in") : tr(" p");
return tmp;
}
 
/trunk/Scribus/scribus/pageitem.cpp
59,10 → 59,7
Parent = pa;
Doc = doc;
Pcolor = fill;
if (PType == 4)
Pcolor2 = fill;
else
Pcolor2 = outline;
Pcolor2 = PType == 4 ? fill : outline;
TxtFill = Doc->DpenText;
TxtStroke = TxtFill;
ShTxtStroke = 100;
122,14 → 119,18
else
Frame = false;
switch (art)
{
{
case 6:
Clip.setPoints(4, static_cast<int>(w/2),0, static_cast<int>(w),static_cast<int>(h/2), static_cast<int>(w/2),static_cast<int>(h), 0,static_cast<int>(h/2));
Clip.setPoints(4, static_cast<int>(w/2), 0,
static_cast<int>(w), static_cast<int>(h/2),
static_cast<int>(w/2), static_cast<int>(h),
0,static_cast<int>(h/2));
break;
default:
Clip.setPoints(4, 0,0, static_cast<int>(w),0, static_cast<int>(w),static_cast<int>(h), 0,static_cast<int>(h));
Clip.setPoints(4, 0,0, static_cast<int>(w),0, static_cast<int>(w),
static_cast<int>(h), 0,static_cast<int>(h));
break;
}
}
PoLine.resize(0);
Segments.clear();
PoShow = false;
139,7 → 140,7
PicAvail = false;
isPrintable = true;
isBookmark = false;
BMnr = 0;
BMnr = 0;
isAnnotation = false;
AnType = 0;
AnActType = 0;
240,22 → 241,22
int DropLines;
tTabValues.clear();
if (!Doc->DoDrawing)
{
{
Redrawn = true;
Tinput = false;
FrameOnly = false;
Dirty = false;
return;
}
}
LiList.setAutoDelete(true);
for (int xxx=0; xxx<5; ++xxx)
{
{
Doc->Vorlagen[xxx].LineSpa = LineSp;
Doc->Vorlagen[xxx].Indent = 0;
Doc->Vorlagen[xxx].First = 0;
Doc->Vorlagen[xxx].Avor = 0;
Doc->Vorlagen[xxx].Anach = 0;
}
}
Doc->Vorlagen[0].Ausri = Ausrich;
pf.begin(Parent);
pf.translate(static_cast<int>(Xpos*sc), static_cast<int>(Ypos*sc));
262,12 → 263,7
pf.scale(static_cast<double>(sc), static_cast<double>(sc));
pf.rotate(static_cast<double>(Rot));
if (!Doc->RePos)
{
if (!e.isEmpty())
pf.setClipRect(e);
else
pf.setClipRect(OwnPage->ViewReg().boundingRect());
}
pf.setClipRect(!e.isEmpty() ? e : OwnPage->ViewReg().boundingRect());
bool doStroke = true;
p->setZoomFactor(sc);
p->save();
276,15 → 272,15
p->rotate(static_cast<double>(Rot));
p->setLineWidth(Pwidth);
if (Pcolor != "None")
{
{
SetFarbe(&tmp, Pcolor, Shade);
p->setBrush(tmp);
p->setFillMode(1);
}
}
else
p->setFillMode(0);
if (GrType != 0)
{
{
p->setFillMode(2);
p->fill_gradient = fill_gradient;
QWMatrix grm;
291,7 → 287,7
grm.rotate(Rot);
FPointArray gra;
switch (GrType)
{
{
case 1:
gra.setPoints(2, 0, 0, Width, 0);
gra.map(grm);
318,44 → 314,45
gv = FPoint(Width, Height / 2.0);
else
gv = FPoint(Width / 2.0, Height);
p->setGradient(VGradient::radial, FPoint(Width / 2.0,Height / 2.0), gv, FPoint(Width / 2.0,Height / 2.0));
p->setGradient(VGradient::radial, FPoint(Width / 2.0,Height / 2.0), gv,
FPoint(Width / 2.0,Height / 2.0));
break;
}
}
}
if (Pcolor2 != "None")
{
{
SetFarbe(&tmp, Pcolor2, Shade2);
if ((Pwidth == 0) && (PType != 5))
p->setLineWidth(0);
else
{
{
p->setPen(tmp, Pwidth, PLineArt, PLineEnd, PLineJoin);
if (DashValues.count() != 0)
p->setDash(DashValues, DashOffset);
}
}
}
else
p->setLineWidth(0);
p->setBrushOpacity(1.0 - Transparency);
p->setPenOpacity(1.0 - TranspStroke);
switch (PType)
{
{
case 2:
if (Doc->RePos)
break;
if ((Pcolor != "None") || (GrType != 0))
{
{
p->setupPolygon(&PoLine);
p->drawPolygon();
}
}
if (Pfile == "")
{
{
p->setPen(black, 1, SolidLine, FlatCap, MiterJoin);
p->drawLine(FPoint(0, 0), FPoint(Width, Height));
p->drawLine(FPoint(0, Height), FPoint(Width, 0));
}
}
else
{
{
QBitmap bmd = QBitmap(static_cast<int>(Width), static_cast<int>(Height));
bmd.fill(Qt::color0);
QPainter pb;
369,14 → 366,11
QPainter pd;
pd.begin(&pmd);
if ((!PicArt) || (!PicAvail))
{
{
pd.setPen(QPen(black, 1, SolidLine, FlatCap, MiterJoin));
pd.drawLine(0, 0, static_cast<int>(Width), static_cast<int>(Height));
pd.drawLine(0, static_cast<int>(Height), static_cast<int>(Width), 0);
if (PicAvail)
pd.setPen(blue);
else
pd.setPen(red);
pd.setPen(PicAvail ? blue : red);
pd.setBackgroundMode(OpaqueMode);
pd.setFont(QFont("Helvetica", 18));
QFileInfo fi = QFileInfo(Pfile);
384,46 → 378,46
int xp = static_cast<int>(Width / 2 - leng / 2);
int yp = static_cast<int>(Height / 2 + pd.fontMetrics().height() / 2);
pd.drawText(xp, yp, fi.fileName());
}
}
else
{
if ((Pcolor != "None") || (GrType != 0))
{
if ((Pcolor != "None") || (GrType != 0))
{
pd.setPen(NoPen);
SetFarbe(&tmp, Pcolor, Shade);
pd.setBrush(tmp);
if (!Doc->RePos)
{
{
if (GrType == 0)
DrawPoly(&pd, Clip, pd.brush().color());
}
}
}
if (flippedH % 2 != 0)
{
{
pd.translate(Width, 0);
pd.scale(-1, 1);
}
}
if (flippedV % 2 != 0)
{
{
pd.translate(0, static_cast<int>(Height));
pd.scale(1, -1);
}
}
if ((LocalViewX != 1) || (LocalViewY != 1))
pd.scale(LocalViewX, LocalViewY);
if (InvPict)
{
{
QImage ip = pixm.copy();
ip.invertPixels();
pd.drawImage(static_cast<int>(LocalX*LocalScX), static_cast<int>(LocalY*LocalScY), ip);
}
}
else
pd.drawImage(static_cast<int>(LocalX*LocalScX), static_cast<int>(LocalY*LocalScY), pixm);
}
}
pmd.setMask(bmd);
QImage ip2 = pmd.convertToImage();
p->drawImage(ip2);
pd.end();
}
}
break;
case 5:
if (Doc->RePos)
431,10 → 425,10
if (NamedLStyle == "")
p->drawLine(FPoint(0, 0), FPoint(Width, 0));
else
{
{
multiLine ml = Doc->MLineStyles[NamedLStyle];
for (int it = ml.size()-1; it > -1; it--)
{
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(tmp, ml[it].Width,
static_cast<PenStyle>(ml[it].Dash),
441,9 → 435,9
static_cast<PenCapStyle>(ml[it].LineEnd),
static_cast<PenJoinStyle>(ml[it].LineJoin));
p->drawLine(FPoint(0, 0), FPoint(Width, 0));
}
}
doStroke = false;
}
}
break;
case 1:
case 3:
1329,7 → 1323,7
zae = 0;
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2)+pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
while (wid < 1)
{
{
zae++;
if (zae > cl.size()-2)
{
1336,11 → 1330,12
MaxChars = Ptext.count();
break;
}
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2)+pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
}
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2) +
pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
}
rota = xy2Deg(cl.point(zae+1).x()-cl.point(zae).x(),cl.point(zae+1).y()-cl.point(zae).y());
for (a = 0; a < Ptext.count(); ++a)
{
{
CurY = 0;
hl = Ptext.at(a);
chx = hl->ch;
1353,53 → 1348,55
else
chx2 = chx;
if (a < Ptext.count()-1)
{
{
if (Ptext.at(a+1)->ch == QChar(29))
chx3 = " ";
else
chx3 = Ptext.at(a+1)->ch;
wide = Cwidth(Doc, hl->cfont, chx2, chs, chx3);
}
}
else
wide = Cwidth(Doc, hl->cfont, chx2, chs);
wide = wide * (hl->cscale / 100.0);
if ((CurX+(wide+hl->cextra)/2) >= wid)
{
if (zae < cl.size()-1)
{
if (zae < cl.size()-1)
{
CurX = CurX - wid;
wid = 0;
EndX = CurX;
do
{
do
{
do
{
zae++;
if (zae > cl.size()-2)
{
{
MaxChars = a+1;
break;
}
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2)+pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
rota = xy2Deg(cl.point(zae+1).x()-cl.point(zae).x(),cl.point(zae+1).y()-cl.point(zae).y());
}
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2)+
pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
rota = xy2Deg(cl.point(zae+1).x()-cl.point(zae).x(),
cl.point(zae+1).y()-cl.point(zae).y());
}
while (wid == 0);
EndX -= wid;
if (zae > cl.size()-2)
{
{
MaxChars = a+1;
break;
}
}
}
while (wid < EndX);
CurX = EndX + wid;
}
}
else
{
{
MaxChars = a+1;
break;
}
}
}
if (zae > cl.size()-2)
break;
p->save();
1413,15 → 1410,15
Zli = new ZZ;
Zli->Zeich = chx;
if (hl->ccolor != "None")
{
{
SetFarbe(&tmp, hl->ccolor, hl->cshade);
p->setBrush(tmp);
}
}
if (hl->cstroke != "None")
{
{
SetFarbe(&tmp, hl->cstroke, hl->cshade2);
p->setPen(tmp, 1, SolidLine, FlatCap, MiterJoin);
}
}
Zli->Farb = hl->ccolor;
Zli->Farb2 = hl->cstroke;
Zli->shade = hl->cshade;
1442,19 → 1439,19
p->setZoomFactor(sc);
MaxChars = a+1;
CurX += wide+hl->cextra;
}
}
default:
break;
}
}
if ((doStroke) && (!Doc->RePos))
{
if (Pcolor2 != "None")
{
if (Pcolor2 != "None")
{
SetFarbe(&tmp, Pcolor2, Shade2);
p->setPen(tmp, Pwidth, PLineArt, PLineEnd, PLineJoin);
if (DashValues.count() != 0)
p->setDash(DashValues, DashOffset);
}
}
else
p->setLineWidth(0);
p->setupPolygon(&PoLine);
1461,10 → 1458,10
if (NamedLStyle == "")
p->drawPolyLine();
else
{
{
multiLine ml = Doc->MLineStyles[NamedLStyle];
for (int it = ml.size()-1; it > -1; it--)
{
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(tmp, ml[it].Width,
static_cast<PenStyle>(ml[it].Dash),
1471,13 → 1468,13
static_cast<PenCapStyle>(ml[it].LineEnd),
static_cast<PenJoinStyle>(ml[it].LineJoin));
p->drawPolyLine();
}
}
}
}
if ((!Tinput) && (!Doc->RePos))
{
if ((Frame) && (Doc->ShFrames) && ((PType == 2) || (PType == 4)))
{
if ((Frame) && (Doc->ShFrames) && ((PType == 2) || (PType == 4)))
{
p->setPen(black, 1, DotLine, FlatCap, MiterJoin);
if ((isBookmark) || (isAnnotation))
p->setPen(blue, 1, DotLine, FlatCap, MiterJoin);
1488,8 → 1485,8
p->setFillMode(0);
p->setupPolygon(&PoLine);
p->drawPolyLine();
}
}
}
Tinput = false;
FrameOnly = false;
Dirty = false;
1501,29 → 1498,29
{
QPainter p;
if (!Doc->DoDrawing)
{
{
Redrawn = true;
Tinput = false;
FrameOnly = false;
Dirty = false;
return;
}
}
if (toPixmap)
p.begin(ppX);
else
p.begin(Parent);
if ((!toPixmap) && (!Doc->RePos))
{
{
if (!e.isEmpty())
p.setClipRect(e);
else
p.setClipRect(OwnPage->ViewReg().boundingRect());
}
}
p.translate(static_cast<int>(Xpos*Doc->Scale), static_cast<int>(Ypos*Doc->Scale));
p.scale(static_cast<double>(Doc->Scale), static_cast<double>(Doc->Scale));
p.rotate(static_cast<double>(Rot));
if (Sizing)
{
{
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
1531,11 → 1528,11
p.drawRect(0, 0, static_cast<int>(Width), static_cast<int>(Height));
OldB = Width;
OldH = Height;
}
}
if ((!Tinput) && (!Doc->RePos))
{
if ((Frame) && (Doc->ShFrames))
{
if ((Frame) && (Doc->ShFrames))
{
p.setPen(QPen(black, 1, DotLine, FlatCap, MiterJoin));
if ((isBookmark) || (isAnnotation))
p.setPen(QPen(blue, 1, DotLine, FlatCap, MiterJoin));
1545,13 → 1542,13
p.setPen(QPen(darkRed, 1, SolidLine, FlatCap, MiterJoin));
p.setBrush(NoBrush);
DrawPolyL(&p, Clip);
}
}
if (Select) // && (!Doc->EditClip))
{
if (!OwnPage->SelItem.isEmpty())
{
if (!OwnPage->SelItem.isEmpty())
if (Groups.count() == 0)
{
if (Groups.count() == 0)
{
QPainter pr;
pr.begin(Parent);
pr.translate(static_cast<int>(Xpos*Doc->Scale), static_cast<int>(Ypos*Doc->Scale));
1561,50 → 1558,54
else
pr.setPen(QPen(red, 1, DotLine, FlatCap, MiterJoin));
pr.setBrush(NoBrush);
pr.drawRect(-1, -1, static_cast<int>(Width*Doc->Scale)+2, static_cast<int>(Height*Doc->Scale)+2);
pr.drawRect(-1, -1, static_cast<int>(Width*Doc->Scale)+2,
static_cast<int>(Height*Doc->Scale)+2);
if (Locked)
{
{
pr.setPen(QPen(darkRed, 1, SolidLine, FlatCap, MiterJoin));
pr.setBrush(darkRed);
}
}
else
{
{
pr.setPen(QPen(red, 1, SolidLine, FlatCap, MiterJoin));
pr.setBrush(red);
}
}
if (PType != 5)
{
{
pr.drawRect(-1, -1, 6, 6);
pr.drawRect(static_cast<int>(Width*Doc->Scale), static_cast<int>(Height*Doc->Scale), -6, -6);
pr.drawRect(static_cast<int>(Width*Doc->Scale), static_cast<int>(Height*Doc->Scale),
-6, -6);
pr.drawRect(static_cast<int>(Width*Doc->Scale), -1, -6, 6);
pr.drawRect(-1, static_cast<int>(Height*Doc->Scale), 6, -6);
if (Width > 6)
{
pr.drawRect(static_cast<int>(Width/2*Doc->Scale - 3), static_cast<int>(Height*Doc->Scale), 6, -6);
{
pr.drawRect(static_cast<int>(Width/2*Doc->Scale - 3),
static_cast<int>(Height*Doc->Scale), 6, -6);
pr.drawRect(static_cast<int>(Width/2*Doc->Scale - 3), -1, 6, 6);
}
}
if (Height > 6)
{
pr.drawRect(static_cast<int>(Width*Doc->Scale), static_cast<int>(Height/2*Doc->Scale - 3), -6, 6);
{
pr.drawRect(static_cast<int>(Width*Doc->Scale),
static_cast<int>(Height/2*Doc->Scale - 3), -6, 6);
pr.drawRect(-1, static_cast<int>(Height/2*Doc->Scale - 3), 6, 6);
}
}
}
else
{
{
pr.drawRect(-3, -3, 6, 6);
pr.drawRect(static_cast<int>(Width*Doc->Scale)+3, -3, -6, 6);
}
}
pr.end();
}
}
else
{
{
p.setPen(QPen(darkCyan, 1, DotLine, FlatCap, MiterJoin));
p.setBrush(NoBrush);
p.drawRect(-1, -1, static_cast<int>(Width+2), static_cast<int>(Height+2));
}
}
}
}
}
Tinput = false;
FrameOnly = false;
Dirty = false;
1616,16 → 1617,16
uint zae = 0;
QString chx = "#";
if (!Doc->MasterP)
{
while (Ptext.at(base+zae)->ch == QChar(30))
{
while (Ptext.at(base+zae)->ch == QChar(30))
{
zae++;
if (base+zae == Ptext.count())
break;
}
}
QString out="%1";
chx = out.arg(OwnPage->PageNr+Doc->FirstPnum, zae).right(zae).left(1);
}
}
return chx;
}
 
1634,17 → 1635,17
int h, s, v, sneu;
Doc->PageColors[farbe].getRGBColor().rgb(&h, &s, &v);
if ((h == s) && (s == v))
{
{
Doc->PageColors[farbe].getRGBColor().hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * shad / 100);
tmp->setHsv(h, s, sneu);
}
}
else
{
{
Doc->PageColors[farbe].getRGBColor().hsv(&h, &s, &v);
sneu = s * shad / 100;
tmp->setHsv(h, sneu, v);
}
}
}
 
double PageItem::SetZeichAttr(struct Pti *hl, int *chs, QString *chx)
1653,26 → 1654,26
int asce = static_cast<int>((*Doc->AllFonts)[hl->cfont]->numAscent * (hl->csize / 10.0));
int chst = hl->cstyle & 127;
if (chst != 0)
{
if (chst & 1)
{
if (chst & 1)
{
retval -= asce * Doc->VHoch / 100;
*chs = QMAX(static_cast<int>(hl->csize * Doc->VHochSc / 100), 1);
}
}
if (chst & 2)
{
{
retval += asce * Doc->VTief / 100;
*chs = QMAX(static_cast<int>(hl->csize * Doc->VTiefSc / 100), 1);
}
}
if (chst & 64)
{
if (chx->upper() != *chx)
{
if (chx->upper() != *chx)
{
*chs = QMAX(static_cast<int>(hl->csize * Doc->VKapit / 100), 1);
*chx = chx->upper();
}
}
}
}
return retval;
}
 
1679,21 → 1680,19
void PageItem::DrawZeichenS(ScPainter *p, struct ZZ *hl)
{
QString ccx = hl->Zeich;
if ((ccx == QChar(13)) || (ccx == QChar(9)))
return;
if (ccx == QChar(29))
ccx = " ";
if (ccx == QChar(13))
return;
if (ccx == QChar(9))
return;
double csi = static_cast<double>(hl->Siz) / 100.0;
uint chr = ccx[0].unicode();
if ((*Doc->AllFonts)[hl->ZFo]->CharWidth.contains(chr))
{
{
QWMatrix chma;
chma.scale(csi, csi);
FPointArray gly = (*Doc->AllFonts)[hl->ZFo]->GlyphArray[chr].Outlines.copy();
if (gly.size() > 3)
{
{
gly.map(chma);
chma = QWMatrix();
chma.scale(hl->scale / 100.0, 1);
1700,13 → 1699,13
gly.map(chma);
chma = QWMatrix();
if (Reverse)
{
{
chma.scale(-1, 1);
chma.translate(-hl->wide, 0);
gly.map(chma);
chma = QWMatrix();
chma.translate(hl->xco, hl->yco-(hl->Siz / 10.0));
}
}
else
chma.translate(hl->xco, hl->yco-(hl->Siz / 10.0));
gly.map(chma);
1715,43 → 1714,44
if (hl->Farb != "None")
p->fillPath();
if ((hl->Style & 4) && (hl->Farb2 != "None"))
{
{
p->setLineWidth((*Doc->AllFonts)[hl->ZFo]->strokeWidth * (hl->Siz / 10.0) / 2);
p->strokePath();
}
}
}
if (hl->Style & 16)
{
{
p->setPen(p->brush());
double st = (*Doc->AllFonts)[hl->ZFo]->strikeout_pos * (hl->Siz / 10.0);
p->setLineWidth(QMAX((*Doc->AllFonts)[hl->ZFo]->strokeWidth * (hl->Siz / 10.0), 1));
p->drawLine(FPoint(hl->xco-hl->kern, hl->yco-st), FPoint(hl->xco+hl->wide, hl->yco-st));
}
}
if (hl->Style & 8)
{
{
double st = (*Doc->AllFonts)[hl->ZFo]->underline_pos * (hl->Siz / 10.0);
QString dummy;
p->setPen(p->brush());
p->setLineWidth(QMAX((*Doc->AllFonts)[hl->ZFo]->strokeWidth * (hl->Siz / 10.0), 1));
if ((gly.size() > 4) && (ccx != QChar(32)))
p->drawUnderline(FPoint(hl->xco-hl->kern, hl->yco-st), FPoint(hl->xco+hl->wide, hl->yco-st), false, &dummy);
p->drawUnderline(FPoint(hl->xco-hl->kern, hl->yco-st),
FPoint(hl->xco+hl->wide, hl->yco-st), false, &dummy);
else
p->drawLine(FPoint(hl->xco-hl->kern, hl->yco-st), FPoint(hl->xco+hl->wide, hl->yco-st));
}
}
}
else
{
{
p->setLineWidth(1);
p->setPen(black);
p->setFillMode(0);
p->drawRect(hl->xco, hl->yco-(hl->Siz / 10.0), (hl->Siz / 10.0)*(hl->scale / 100.0), (hl->Siz / 10.0));
}
}
}
 
void PageItem::DrawPoly(QPainter *p, QPointArray pts, QColor BackF, bool bitm)
{
if ((Pcolor != "None") || (GrType != 0) || (PType == 2))
{
{
QBitmap bm(static_cast<int>(Width), static_cast<int>(Height));
bm.fill(Qt::color0);
QPainter pbm;
1763,12 → 1763,12
QValueList<uint>::Iterator it3;
uint FirstVal = 0;
for (it3 = Segments.begin(); it3 != Segments.end(); ++it3)
{
{
dr.resize(0);
dr.putPoints(0, (*it3)-FirstVal-1, pts, FirstVal);
pbm.drawPolygon(dr);
FirstVal = (*it3);
}
}
dr.resize(0);
dr.putPoints(0, pts.size()-FirstVal-1, pts, FirstVal);
pbm.drawPolygon(dr);
1776,13 → 1776,13
if (bitm)
p->drawPixmap(0, 0, bm);
else
{
{
QPixmap ppm(static_cast<int>(Width), static_cast<int>(Height));
ppm.fill(BackF);
ppm.setMask(bm);
p->drawPixmap(0, 0, ppm);
}
}
}
}
 
void PageItem::DrawPolyL(QPainter *p, QPointArray pts)
1789,18 → 1789,18
{
QColor tmp;
if (Segments.count() != 0)
{
{
QValueList<uint>::Iterator it2;
uint FirstVal = 0;
for (it2 = Segments.begin(); it2 != Segments.end(); ++it2)
{
{
if (NamedLStyle == "")
p->drawPolyline(pts, FirstVal, (*it2)-FirstVal);
else
{
{
multiLine ml = Doc->MLineStyles[NamedLStyle];
for (int it = ml.size()-1; it > -1; it--)
{
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(QPen(tmp,
QMAX(static_cast<int>(ml[it].Width*Doc->Scale), 1),
1808,17 → 1808,17
static_cast<PenCapStyle>(ml[it].LineEnd),
static_cast<PenJoinStyle>(ml[it].LineJoin)));
p->drawPolyline(pts, FirstVal, (*it2)-FirstVal);
}
}
}
FirstVal = (*it2);
}
}
if (NamedLStyle == "")
p->drawPolyline(pts, FirstVal);
else
{
{
multiLine ml = Doc->MLineStyles[NamedLStyle];
for (int it = ml.size()-1; it > -1; it--)
{
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(QPen(tmp,
QMAX(static_cast<int>(ml[it].Width*Doc->Scale), 1),
1826,18 → 1826,18
static_cast<PenCapStyle>(ml[it].LineEnd),
static_cast<PenJoinStyle>(ml[it].LineJoin)));
p->drawPolyline(pts, FirstVal);
}
}
}
}
else
{
{
if (NamedLStyle == "")
p->drawPolyline(pts);
else
{
{
multiLine ml = Doc->MLineStyles[NamedLStyle];
for (int it = ml.size()-1; it > -1; it--)
{
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(QPen(tmp,
QMAX(static_cast<int>(ml[it].Width*Doc->Scale), 1),
1845,7 → 1845,7
static_cast<PenCapStyle>(ml[it].LineEnd),
static_cast<PenJoinStyle>(ml[it].LineJoin)));
p->drawPolyline(pts);
}
}
}
}
}
/trunk/Scribus/scribus/werktoolb.cpp
32,22 → 32,26
SubMode = 0;
ValCount = 32;
static double AutoShapes0[] = {0.0, 0.0, 0.0, 0.0, 100.0, 0.0, 100.0, 0.0, 100.0, 0.0, 100.0, 0.0,
100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 0.0, 100.0,
0.0, 100.0, 0.0, 100.0, 0.0, 0.0, 0.0, 0.0};
100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 0.0, 100.0,
0.0, 100.0, 0.0, 100.0, 0.0, 0.0, 0.0, 0.0};
ShapeVals = AutoShapes0;
Select = new QToolButton(loadIcon("Kreuz.xpm"), tr("Select Items"), QString::null, this, SLOT(ModeFromTB()), this);
Select = new QToolButton(loadIcon("Kreuz.xpm"), tr("Select Items"), QString::null, this,
SLOT(ModeFromTB()), this);
Select->setToggleButton(true);
Select->setOn(true);
Texte = new QToolButton(loadIcon("Text.xpm"), tr("Insert Text Frame"), QString::null, this, SLOT(ModeFromTB()), this);
Texte = new QToolButton(loadIcon("Text.xpm"), tr("Insert Text Frame"), QString::null, this,
SLOT(ModeFromTB()), this);
Texte->setToggleButton( true );
BildB = new QToolButton(loadIcon("Bild.xpm"), tr("Insert Picture"), QString::null, this, SLOT(ModeFromTB()), this);
BildB = new QToolButton(loadIcon("Bild.xpm"), tr("Insert Picture"), QString::null, this, SLOT(ModeFromTB()),
this);
BildB->setToggleButton( true );
Rechteck = new Autoforms( this );
Rechteck = new Autoforms( this );
Rechteck->setPopupDelay(0);
Rechteck->setToggleButton( true );
PolyM = new QPopupMenu();
PolyM->insertItem( tr("Properties..."), this, SLOT(GetPolyProps()));
Polygon = new QToolButton(loadIcon("spline.png"), tr("Insert Polygons"), QString::null, this, SLOT(ModeFromTB()), this);
Polygon = new QToolButton(loadIcon("spline.png"), tr("Insert Polygons"), QString::null, this,
SLOT(ModeFromTB()), this);
Polygon->setToggleButton( true );
Polygon->setPopup(PolyM);
Polygon->setPopupDelay(0);
59,32 → 63,39
LinM->setWhatsThis(id, tr("Insert Bezier Curves"));
id = LinM->insertItem(loadIcon("Stiftalt.xpm"));
LinM->setWhatsThis(id, tr("Insert Freehand Line"));
Linien = new QToolButton(loadIcon("Stift.xpm"), tr("Insert Lines"), QString::null, this, SLOT(ModeFromTB()), this);
Linien = new QToolButton(loadIcon("Stift.xpm"), tr("Insert Lines"), QString::null, this, SLOT(ModeFromTB()),
this);
Linien->setToggleButton( true );
Linien->setPopup(LinM);
Linien->setPopupDelay(0);
LMode = 8;
Rotiere = new QToolButton(loadIcon("Rotieren.xpm"), tr("Rotate Item"), QString::null, this, SLOT(ModeFromTB()), this);
Rotiere = new QToolButton(loadIcon("Rotieren.xpm"), tr("Rotate Item"), QString::null, this,
SLOT(ModeFromTB()), this);
Rotiere->setToggleButton( true );
Rotiere->setEnabled(false);
Zoom = new QToolButton(loadIcon("Lupe.xpm"), tr("Zooms in or out"), QString::null, this, SLOT(ModeFromTB()), this);
Zoom = new QToolButton(loadIcon("Lupe.xpm"), tr("Zooms in or out"), QString::null, this, SLOT(ModeFromTB()),
this);
Zoom->setToggleButton( true );
Textedit = new QToolButton(loadIcon("Editm.xpm"), tr("Edit Contents of Frame"), QString::null, this, SLOT(ModeFromTB()), this);
Textedit = new QToolButton(loadIcon("Editm.xpm"), tr("Edit Contents of Frame"), QString::null, this,
SLOT(ModeFromTB()), this);
Textedit->setToggleButton( true );
Textedit->setEnabled( FALSE );
Textedit2 = new QToolButton(loadIcon("signature.png"), tr("Edit the Text with the Story Editor"), QString::null, this, SLOT(ModeFromTB()), this);
Textedit->setEnabled( false );
Textedit2 = new QToolButton(loadIcon("signature.png"), tr("Edit the Text with the Story Editor"),
QString::null, this, SLOT(ModeFromTB()), this);
Textedit2->setToggleButton( true );
Textedit2->setEnabled( FALSE );
KetteEin = new QToolButton(loadIcon("Lock.xpm"), tr("Link Text Frames"), QString::null, this, SLOT(ModeFromTB()), this);
Textedit2->setEnabled( false );
KetteEin = new QToolButton(loadIcon("Lock.xpm"), tr("Link Text Frames"), QString::null, this,
SLOT(ModeFromTB()), this);
KetteEin->setToggleButton( true );
KetteEin->setEnabled(false);
KetteAus = new QToolButton(loadIcon("Unlock.xpm"), tr("Unlink Text Frames"), QString::null, this, SLOT(ModeFromTB()), this);
KetteAus = new QToolButton(loadIcon("Unlock.xpm"), tr("Unlink Text Frames"), QString::null, this,
SLOT(ModeFromTB()), this);
KetteAus->setToggleButton( true );
KetteAus->setEnabled(false);
setCloseMode(QDockWindow::Undocked);
connect(this, SIGNAL(placeChanged(QDockWindow::Place)), this, SLOT(Docken(QDockWindow::Place)));
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(Verbergen(bool)));
connect(Rechteck, SIGNAL(FormSel(int, int, double *)), this, SLOT(SelShape(int, int, double *)));
connect(this, SIGNAL(placeChanged(QDockWindow::Place)), this, SLOT(Docken(QDockWindow::Place)));
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(Verbergen(bool)));
connect(Rechteck, SIGNAL(FormSel(int, int, double *)), this, SLOT(SelShape(int, int, double *)));
connect(Rechteck, SIGNAL(clicked()), this, SLOT(SelShape2()));
connect(LinM, SIGNAL(activated(int)), this, SLOT(setLinMode(int)));
QToolTip::add( Rechteck, tr( "Draws various Shapes" ) );
92,10 → 103,7
 
void WerkToolB::Docken(QDockWindow::Place p)
{
if (p == InDock)
setOrientation(Horizontal);
else
setOrientation(Vertical);
setOrientation(p == InDock ? Horizontal : Vertical);
}
 
void WerkToolB::Verbergen(bool vis)
107,7 → 115,7
void WerkToolB::GetPolyProps()
{
PolygonProps* dia = new PolygonProps(this);
if (dia->exec())
if (dia->exec())
{
PolyC = dia->Ecken->value();
PolyF = dia->PFactor;
114,7 → 122,7
PolyS = dia->Konvex->isChecked();
PolyFd = dia->Slider1->value();
PolyR = dia->Faktor2->value();
}
}
delete dia;
}
 
170,60 → 178,60
KetteAus->setOn(false);
Polygon->setOn(false);
if (Select == sender())
{
{
Select->setOn(true);
emit NewMode(1);
}
}
if (Rotiere == sender())
{
{
Rotiere->setOn(true);
emit NewMode(9);
}
}
if (Textedit == sender())
{
{
Textedit->setOn(true);
emit NewMode(7);
}
}
if (Textedit2 == sender())
{
{
Textedit2->setOn(true);
emit NewMode(3);
}
}
if (Zoom == sender())
{
{
Zoom->setOn(true);
emit NewMode(6);
}
}
if (Texte == sender())
{
{
Texte->setOn(true);
emit NewMode(5);
}
}
if (BildB == sender())
{
{
BildB->setOn(true);
emit NewMode(4);
}
}
if (Linien == sender())
{
{
Linien->setOn(true);
emit NewMode(LMode);
}
}
if (KetteEin == sender())
{
{
KetteEin->setOn(true);
emit NewMode(10);
}
}
if (KetteAus == sender())
{
{
KetteAus->setOn(true);
emit NewMode(11);
}
}
if (Polygon == sender())
{
{
Polygon->setOn(true);
emit NewMode(12);
}
}
}
 
void WerkToolB::setLinMode(int id)
241,24 → 249,11
KetteAus->setOn(false);
Polygon->setOn(false);
int c = LinM->indexOf(id);
switch (c)
{
case 0:
Linien->setPixmap(loadIcon("Stift.xpm"));
LMode = 8;
emit NewMode(8);
break;
case 1:
Linien->setPixmap(loadIcon("beziertool.png"));
LMode = 13;
emit NewMode(13);
break;
case 2:
Linien->setPixmap(loadIcon("Stiftalt.xpm"));
LMode = 21;
emit NewMode(21);
break;
}
char *icn[] = {"Stift.xpm", "beziertool.png", "Stiftalt.xpm"};
int lm[] = {8, 13, 21};
Linien->setPixmap(loadIcon(icn[c]));
LMode = lm[c];
emit NewMode(LMode);
Linien->setOn(true);
}
 
265,12 → 260,13
WerkToolBP::WerkToolBP(QMainWindow* parent) : QToolBar( tr("PDF-Tools"), parent)
{
PDFM = new QPopupMenu();
PDFM->insertItem(loadIcon("pushbutton.png"), tr("Button"));
PDFM->insertItem(loadIcon("textview.png"), tr("Text Field"));
PDFM->insertItem(loadIcon("checkbox.png"), tr("Check Box"));
PDFM->insertItem(loadIcon("combobox.png"), tr("Combo Box"));
PDFM->insertItem(loadIcon("listbox.png"), tr("List Box"));
PDFTool = new QToolButton(loadIcon("pushbutton.png"), tr("Insert PDF-Fields"), QString::null, this, SLOT(ModeFromTB()), this);
char *tmp_icn[] = {"pushbutton.png", "textview.png", "checkbox.png", "combobox.png", "listbox.png"};
char *tmp_txt[] = {"Button", "Text Field", "Check Box", "Combo Box", "List Box"};
size_t ar_tmp = sizeof(tmp_icn) / sizeof(*tmp_icn);
for (uint a = 0; a < ar_tmp; ++a)
PDFM->insertItem(loadIcon(tmp_icn[a]), tr(tmp_txt[a]));
PDFTool = new QToolButton(loadIcon("pushbutton.png"), tr("Insert PDF-Fields"), QString::null, this,
SLOT(ModeFromTB()), this);
PDFTool->setToggleButton(true);
PDFTool->setPopup(PDFM);
PDFTool->setPopupDelay(0);
278,14 → 274,15
PDFA = new QPopupMenu();
PDFA->insertItem(loadIcon("charset.png"), tr("Text"));
PDFA->insertItem(loadIcon("goto.png"), tr("Link"));
PDFaTool = new QToolButton(loadIcon("charset.png"), tr("Insert PDF-Annotations"), QString::null, this, SLOT(ModeFromTB()), this);
PDFaTool = new QToolButton(loadIcon("charset.png"), tr("Insert PDF-Annotations"), QString::null, this,
SLOT(ModeFromTB()), this);
PDFaTool->setToggleButton(true);
PDFaTool->setPopup(PDFA);
PDFaTool->setPopupDelay(0);
PDFnotiz = 0;
setCloseMode(QDockWindow::Undocked);
connect(this, SIGNAL(placeChanged(QDockWindow::Place)), this, SLOT(Docken(QDockWindow::Place)));
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(Verbergen(bool)));
connect(this, SIGNAL(placeChanged(QDockWindow::Place)), this, SLOT(Docken(QDockWindow::Place)));
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(Verbergen(bool)));
connect(PDFM, SIGNAL(activated(int)), this, SLOT(setPDFtool(int)));
connect(PDFA, SIGNAL(activated(int)), this, SLOT(setPDFnotiz(int)));
}
295,7 → 292,7
int c = PDFA->indexOf(id);
PDFnotiz = c;
switch (c)
{
{
case 0:
PDFaTool->setPixmap(loadIcon("charset.png"));
break;
302,7 → 299,7
case 1:
PDFaTool->setPixmap(loadIcon("goto.png"));
break;
}
}
PDFTool->setOn(false);
PDFaTool->setOn(true);
emit NewMode(19+PDFnotiz);
312,24 → 309,8
{
int c = PDFM->indexOf(id);
PDFwerkz = c;
switch (c)
{
case 0:
PDFTool->setPixmap(loadIcon("pushbutton.png"));
break;
case 1:
PDFTool->setPixmap(loadIcon("textview.png"));
break;
case 2:
PDFTool->setPixmap(loadIcon("checkbox.png"));
break;
case 3:
PDFTool->setPixmap(loadIcon("combobox.png"));
break;
case 4:
PDFTool->setPixmap(loadIcon("listbox.png"));
break;
}
char *tmp[] = {"pushbutton.png", "textview.png", "checkbox.png", "combobox.png", "listbox.png"};
PDFTool->setPixmap(loadIcon(tmp[c]));
PDFTool->setOn(true);
PDFaTool->setOn(false);
emit NewMode(14+PDFwerkz);
351,15 → 332,13
PDFTool->setOn(false);
PDFaTool->setOn(false);
if (PDFTool == sender())
{
{
PDFTool->setOn(true);
emit NewMode(14+PDFwerkz);
}
}
if (PDFaTool == sender())
{
{
PDFaTool->setOn(true);
emit NewMode(19+PDFnotiz);
}
}
}
 
 
/trunk/Scribus/scribus/libabout/about.cpp
54,7 → 54,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1. %2 %3 ").arg(20).arg("January").arg(2004);
QString bu = tr("%1. %2 %3 ").arg(21).arg("January").arg(2004);
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus/spalette.cpp
20,12 → 20,13
 
Spalette::Spalette(QWidget* parent) : QListBox(parent, "Sfloat")
{
setMinimumSize(QSize(10,static_cast<int>(font().pointSize()*2.5)));
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );
setMinimumSize(QSize(10,static_cast<int>(font().pointSize()*2.5)));
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, 0, 0,
sizePolicy().hasHeightForWidth() ) );
insertItem( tr("No Style"));
doc = 0;
connect(this, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
connect(this, SIGNAL(selected(int)), this, SIGNAL(EditSt()));
doc = 0;
connect(this, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
connect(this, SIGNAL(selected(int)), this, SIGNAL(EditSt()));
}
 
void Spalette::SetFormats(ScribusDoc *dd)
36,17 → 37,15
 
void Spalette::updateFList()
{
disconnect(this, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
disconnect(this, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
clear();
if (doc != 0)
{
{
insertItem( tr("No Style"));
for (uint x = 5; x < doc->Vorlagen.count(); ++x)
{
insertItem(doc->Vorlagen[x].Vname);
}
setSelected(currentItem(), false);
}
}
connect(this, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
}
 
53,9 → 52,9
void Spalette::selFormat(QListBoxItem *c)
{
if (c == NULL)
return;
if (c->listBox()->currentItem() > 0)
emit NewStyle(c->listBox()->currentItem()+4);
else
emit NewStyle(c->listBox()->currentItem());
return;
if (c->listBox()->currentItem() > 0)
emit NewStyle(c->listBox()->currentItem()+4);
else
emit NewStyle(c->listBox()->currentItem());
}
/trunk/Scribus/scribus/Makefile.am
1,13 → 1,13
bin_PROGRAMS = scribus
 
scribus_SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp libpdf/pdflib.cpp libpostscript/pslib.cpp plugins/libchar/charselect.cpp libprefs/prefs.cpp libabout/about.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
scribus_SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp libpdf/pdflib.cpp libpostscript/pslib.cpp plugins/libchar/charselect.cpp libprefs/prefs.cpp libabout/about.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
INTERFACES =
TRANSLATIONS =
 
SUBDIRS = icons libabout libprefs plugins libpostscript libpdf profiles dicts po qm
 
EXTRA_DIST = main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h pageback.cpp pageback.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h scfonts_ttf.cpp scfonts_ttf.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h splash.h fontcombo.h scpainter.cpp scpainter.h vgradient.cpp vgradient.h story.cpp story.h autoform.cpp autoform.h fparser.cpp fparser.h tabmanager.cpp tabmanager.h search.cpp search.h art_kmisc.c art_kmisc.h art_render_misc.c art_render_misc.h art_render_pattern.c art_render_pattern.h art_rgb.c art_rgb.h art_rgb_affine_private.c art_rgb_affine_private.h art_rgb_svp.c art_rgb_svp.h art_rgba_affine.c art_rgba_affine.h gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-private.h gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlib.h gdk-pixbuf-xlibrgb.c gdk-pixbuf-xlibrgb.h rgbscribus.txt
EXTRA_DIST = main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h pageback.cpp pageback.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h scfonts_ttf.cpp scfonts_ttf.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h splash.h fontcombo.h scpainter.cpp scpainter.h vgradient.cpp vgradient.h story.cpp story.h autoform.cpp autoform.h fparser.cpp fparser.h tabmanager.cpp tabmanager.h search.cpp search.h styleselect.cpp styleselect.h art_kmisc.c art_kmisc.h art_render_misc.c art_render_misc.h art_render_pattern.c art_render_pattern.h art_rgb.c art_rgb.h art_rgb_affine_private.c art_rgb_affine_private.h art_rgb_svp.c art_rgb_svp.h art_rgba_affine.c art_rgba_affine.h gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-private.h gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlib.h gdk-pixbuf-xlibrgb.c gdk-pixbuf-xlibrgb.h rgbscribus.txt
 
install-data-local:
$(mkinstalldirs) $(prefix)/lib/scribus/
/trunk/Scribus/scribus/newfile.cpp
5,27 → 5,25
NewDoc::NewDoc( QWidget* parent, preV *Vor )
: QDialog( parent, "newDoc", true, 0 )
{
switch (Vor->Einheit)
{
case 0:
char *units[] = {" pt", " mm", " in", " p"};
ein = units[Vor->Einheit];
switch (Vor->Einheit)
{
case 0:
Umrech = 1.0;
ein = " pt";
break;
case 1:
Umrech = 0.3527777;
ein = " mm";
break;
case 2:
Umrech = 1.0 / 72.0;
ein = " in";
break;
case 3:
Umrech = 1.0 / 12.0;
ein = " p";
break;
}
einheit = Vor->Einheit;
Orient = 0;
break;
case 1:
Umrech = 0.3527777;
break;
case 2:
Umrech = 1.0 / 72.0;
break;
case 3:
Umrech = 1.0 / 12.0;
break;
}
einheit = Vor->Einheit;
Orient = 0;
setCaption( tr( "New Document" ) );
setIcon(loadIcon("AppIcon.png"));
NewDocLayout = new QHBoxLayout( this, 10, 5, "NewDocLayout");
43,55 → 41,30
TextLabel1->setText( tr( "Size:" ));
Layout6->addWidget( TextLabel1, 0, 0 );
ComboBox1 = new QComboBox( true, ButtonGroup1_2, "ComboBox1" );
ComboBox1->insertItem("A0");
ComboBox1->insertItem("A1");
ComboBox1->insertItem("A2");
ComboBox1->insertItem("A3");
ComboBox1->insertItem("A4");
ComboBox1->insertItem("A5");
ComboBox1->insertItem("A6");
ComboBox1->insertItem("A7");
ComboBox1->insertItem("A8");
ComboBox1->insertItem("A9");
ComboBox1->insertItem("B0");
ComboBox1->insertItem("B1");
ComboBox1->insertItem("B2");
ComboBox1->insertItem("B3");
ComboBox1->insertItem("B4");
ComboBox1->insertItem("B5");
ComboBox1->insertItem("B6");
ComboBox1->insertItem("B7");
ComboBox1->insertItem("B8");
ComboBox1->insertItem("B9");
ComboBox1->insertItem("B10");
ComboBox1->insertItem("C5E");
ComboBox1->insertItem("Comm10E");
ComboBox1->insertItem("DLE");
ComboBox1->insertItem("Executive");
ComboBox1->insertItem("Folio");
ComboBox1->insertItem("Ledger");
ComboBox1->insertItem("Legal");
ComboBox1->insertItem("Letter");
ComboBox1->insertItem("Tabloid");
ComboBox1->insertItem( tr( "Custom" ) );
ComboBox1->setEditable(false);
QString sizelist[] = {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4",
"B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive", "Folio",
"Ledger", "Letter", "Tabloid", tr("Custom")};
size_t const num_mappings = (sizeof sizelist)/(sizeof *sizelist);
for (uint m = 0; m < num_mappings; ++m)
ComboBox1->insertItem(sizelist[m]);
ComboBox1->setEditable(false);
Layout6->addWidget(ComboBox1, 0, 1 );
TextLabel2 = new QLabel( ButtonGroup1_2, "TextLabel2" );
TextLabel2->setText( tr( "Orientation:" ));
Layout6->addWidget( TextLabel2, 1, 0 );
ComboBox2 = new QComboBox( true, ButtonGroup1_2, "ComboBox2" );
ComboBox2 = new QComboBox( true, ButtonGroup1_2, "ComboBox2" );
ComboBox2->insertItem( tr( "Portrait" ) );
ComboBox2->insertItem( tr( "Landscape" ) );
ComboBox2->setEditable(false);
ComboBox2->setCurrentItem(Vor->Ausrichtung);
ComboBox2->setEditable(false);
ComboBox2->setCurrentItem(Vor->Ausrichtung);
Layout6->addWidget( ComboBox2, 1, 1 );
ButtonGroup1_2Layout->addLayout( Layout6 );
 
Layout5 = new QHBoxLayout( 0, 0, 6, "Layout5");
TextLabel1_2 = new QLabel( ButtonGroup1_2, "TextLabel1_2" );
TextLabel1_2 = new QLabel( ButtonGroup1_2, "TextLabel1_2" );
TextLabel1_2->setText( tr( "Width:" ) );
Layout5->addWidget( TextLabel1_2 );
Breite = new MSpinBox( ButtonGroup1_2, 2 );
Breite = new MSpinBox( ButtonGroup1_2, 2 );
Breite->setEnabled( false );
Breite->setMinimumSize( QSize( 70, 20 ) );
Breite->setSuffix(ein);
101,7 → 74,7
TextLabel2_2 = new QLabel( ButtonGroup1_2, "TextLabel2_2" );
TextLabel2_2->setText( tr( "Height:" ) );
Layout5->addWidget( TextLabel2_2 );
Hoehe = new MSpinBox( ButtonGroup1_2, 2 );
Hoehe = new MSpinBox( ButtonGroup1_2, 2 );
Hoehe->setEnabled( false );
Hoehe->setMinimumSize( QSize( 70, 20 ) );
Hoehe->setSuffix(ein);
112,15 → 85,15
Layout8 = new QHBoxLayout( 0, 0, 6, "Layout8");
Doppelseiten = new QCheckBox( ButtonGroup1_2, "Doppelseiten" );
Doppelseiten->setText( tr( "Facing Pages" ) );
Doppelseiten->setChecked(Vor->DoppelSeiten);
Doppelseiten->setChecked(Vor->DoppelSeiten);
Layout8->addWidget( Doppelseiten );
ErsteSeite = new QCheckBox( ButtonGroup1_2, "CheckBox3" );
ErsteSeite->setText( tr( "Left Page first" ) );
ErsteSeite->setChecked(Vor->ErsteLinks);
ErsteSeite->setChecked(Vor->ErsteLinks);
Layout8->addWidget( ErsteSeite );
ButtonGroup1_2Layout->addLayout( Layout8 );
Layout9->addWidget( ButtonGroup1_2 );
ComboBox1->setCurrentItem(Vor->PageFormat);
ComboBox1->setCurrentItem(Vor->PageFormat);
Breite->setValue(Vor->PageBreite * Umrech);
Hoehe->setValue(Vor->PageHoehe * Umrech);
 
148,44 → 121,44
TextLabel7 = new QLabel( GroupBox7, "TextLabel7" );
TextLabel7->setText( tr( "Bottom:" ) );
Layout3->addWidget( TextLabel7, 1, 0 );
TopR = new MSpinBox( GroupBox7, 2 );
TopR = new MSpinBox( GroupBox7, 2 );
TopR->setMinimumSize( QSize( 70, 20 ) );
TopR->setMaxValue( 1000 );
TopR->setMinValue( 0 );
TopR->setSuffix( ein );
TopR->setValue(Vor->RandOben * Umrech);
Top = Vor->RandOben;
Top = Vor->RandOben;
Layout3->addWidget( TopR, 0, 1 );
BottomR = new MSpinBox( GroupBox7, 2 );
BottomR = new MSpinBox( GroupBox7, 2 );
BottomR->setMinimumSize( QSize( 70, 20 ) );
BottomR->setSuffix( ein );
BottomR->setMaxValue( 1000 );
BottomR->setMinValue( 0 );
BottomR->setValue(Vor->RandUnten * Umrech);
Bottom = Vor->RandUnten;
Bottom = Vor->RandUnten;
Layout3->addWidget( BottomR, 1, 1 );
LeftR = new MSpinBox( GroupBox7, 2 );
LeftR = new MSpinBox( GroupBox7, 2 );
LeftR->setMinimumSize( QSize( 70, 20 ) );
LeftR->setSuffix( ein );
LeftR->setMaxValue( 1000 );
LeftR->setMinValue( 0 );
LeftR->setValue(Vor->RandLinks * Umrech);
Left = Vor->RandLinks;
Left = Vor->RandLinks;
Layout3->addWidget( LeftR, 0, 3 );
RightR = new MSpinBox( GroupBox7, 2 );
RightR = new MSpinBox( GroupBox7, 2 );
RightR->setMinimumSize( QSize( 70, 20 ) );
RightR->setSuffix( ein );
RightR->setMaxValue( 1000 );
RightR->setMinValue( 0 );
RightR->setValue(Vor->RandRechts * Umrech);
Right = Vor->RandRechts;
Right = Vor->RandRechts;
Layout3->addWidget( RightR, 1, 3 );
GroupBox7Layout->addLayout( Layout3 );
Layout9->addWidget( GroupBox7 );
NewDocLayout->addLayout( Layout9 );
setDS();
setSize(Vor->PageFormat);
setOrien(Vor->Ausrichtung);
setDS();
setSize(Vor->PageFormat);
setOrien(Vor->Ausrichtung);
 
Layout10 = new QVBoxLayout( 0, 0, 6, "Layout10");
 
211,8 → 184,8
ComboBox3->insertItem( tr( "Millimeters (mm)" ) );
ComboBox3->insertItem( tr( "Inches (in)" ) );
ComboBox3->insertItem( tr( "Picas (p)" ) );
ComboBox3->setCurrentItem(einheit);
ComboBox3->setEditable(false);
ComboBox3->setCurrentItem(einheit);
ComboBox3->setEditable(false);
GroupBox3Layout->addMultiCellWidget( ComboBox3, 1, 1, 1, 2 );
Layout10->addWidget( GroupBox3 );
 
238,11 → 211,11
TextLabel3 = new QLabel( GroupBox4, "TextLabel3" );
TextLabel3->setText( tr( "Columns:" ) );
Layout2->addWidget( TextLabel3, 0, 0 );
Distance = new MSpinBox( GroupBox4, 2 );
Distance = new MSpinBox( GroupBox4, 2 );
Distance->setSuffix( ein );
Distance->setMaxValue( 1000 );
Distance->setValue(11 * Umrech);
Dist = 11;
Dist = 11;
Layout2->addWidget( Distance, 1, 1, Qt::AlignLeft );
SpinBox10 = new QSpinBox( GroupBox4, "SpinBox10" );
SpinBox10->setButtonSymbols( QSpinBox::UpDownArrows );
251,7 → 224,7
Layout2->addWidget( SpinBox10, 0, 1, Qt::AlignLeft );
GroupBox4Layout->addLayout( Layout2 );
Layout10->addWidget( GroupBox4 );
GroupBox4->setEnabled(false);
GroupBox4->setEnabled(false);
 
Layout1 = new QHBoxLayout;
Layout1->setSpacing( 6 );
276,14 → 249,14
connect( CancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( Doppelseiten, SIGNAL( clicked() ), this, SLOT( setDS() ) );
connect( AutoFrame, SIGNAL( clicked() ), this, SLOT( setAT() ) );
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(setPGsize()));
connect(ComboBox2, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
connect(ComboBox3, SIGNAL(activated(int)), this, SLOT(setUnit(int)));
connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
connect(Distance, SIGNAL(valueChanged(int)), this, SLOT(setDist(int)));
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(setPGsize()));
connect(ComboBox2, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
connect(ComboBox3, SIGNAL(activated(int)), this, SLOT(setUnit(int)));
connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
connect(Distance, SIGNAL(valueChanged(int)), this, SLOT(setDist(int)));
}
 
void NewDoc::code_repeat(int m)
352,25 → 325,22
 
void NewDoc::setUnit(int u)
{
ein = units[u];
switch (u)
{
{
case 0:
Umrech = 1.0;
ein = " pt";
Umrech = 1.0;
break;
case 1:
Umrech = 0.3527777;
ein = " mm";
break;
break;
case 2:
Umrech = 1.0 / 72.0;
ein = " in";
break;
break;
case 3:
Umrech = 1.0 / 12.0;
ein = " p";
break;
}
break;
}
einheit = u;
disconnect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int)));
disconnect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int)));
395,28 → 365,28
connect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int)));
connect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int)));
Distance->setValue(Dist * Umrech);
TopR->setSuffix(ein);
BottomR->setSuffix(ein);
LeftR->setSuffix(ein);
RightR->setSuffix(ein);
Breite->setSuffix(ein);
Hoehe->setSuffix(ein);
Distance->setSuffix( ein );
TopR->setSuffix(ein);
BottomR->setSuffix(ein);
LeftR->setSuffix(ein);
RightR->setSuffix(ein);
Breite->setSuffix(ein);
Hoehe->setSuffix(ein);
Distance->setSuffix( ein );
}
 
void NewDoc::ExitOK()
{
if (ComboBox1->currentItem() == 30)
{
{
Pagebr = Breite->value() / Umrech;
Pageho = Hoehe->value() / Umrech;
}
}
if (Orient == 1)
{
{
double br = Pagebr;
Pagebr = Pageho;
Pageho = br;
}
}
accept();
}
 
427,22 → 397,22
disconnect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int)));
disconnect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int)));
if (ori == 0)
{
if (ComboBox1->currentItem() == 30)
{
if (ComboBox1->currentItem() == 30)
{
br = Breite->value();
Breite->setValue(Hoehe->value());
Hoehe->setValue(br);
}
}
Orient = 0;
}
}
else
{
{
Orient = 1;
br = Breite->value();
Breite->setValue(Hoehe->value());
Hoehe->setValue(br);
}
}
RightR->setMaxValue(Breite->value() - LeftR->value());
LeftR->setMaxValue(Breite->value() - RightR->value());
TopR->setMaxValue(Hoehe->value() - BottomR->value());
467,133 → 437,17
disconnect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int)));
Breite->setEnabled(false);
Hoehe->setEnabled(false);
switch (gr)
{
case 0: // A0
Pagebr = 2380;
Pageho = 3368;
break;
case 1: // A1
Pagebr = 1684;
Pageho = 2380;
break;
case 2: // A2
Pagebr = 1190;
Pageho = 1684;
break;
case 3: // A3
Pagebr = 842;
Pageho = 1190;
break;
case 4: // A4
Pagebr = 595;
Pageho = 842;
break;
case 5: // A5
Pagebr = 421;
Pageho = 595;
break;
case 6: // A6
Pagebr = 297;
Pageho = 421;
break;
case 7: // A7
Pagebr = 210;
Pageho = 297;
break;
case 8: // A8
Pagebr = 148;
Pageho = 210;
break;
case 9: // A9
Pagebr = 105;
Pageho = 148;
break;
case 10: // B0
Pagebr = 2836;
Pageho = 4008;
break;
case 11: // B1
Pagebr = 2004;
Pageho = 2836;
break;
case 12: // B2
Pagebr = 1418;
Pageho = 2004;
break;
case 13: // B3
Pagebr = 1002;
Pageho = 1418;
break;
case 14: // B4
Pagebr = 709;
Pageho = 1002;
break;
case 15: // B5
Pagebr = 501;
Pageho = 709;
break;
case 16: // B6
Pagebr = 355;
Pageho = 501;
break;
case 17: // B7
Pagebr = 250;
Pageho = 355;
break;
case 18: // B8
Pagebr = 178;
Pageho = 250;
break;
case 19: // B9
Pagebr = 125;
Pageho = 178;
break;
case 20: // B10
Pagebr = 89;
Pageho = 125;
break;
case 21: // C5E
Pagebr = 462;
Pageho = 649;
break;
case 22: // Comm10E
Pagebr = 298;
Pageho = 683;
break;
case 23: // DLE
Pagebr = 312;
Pageho = 624;
break;
case 24: // Executive
Pagebr = 542;
Pageho = 720;
break;
case 25: // Folio
Pagebr = 595;
Pageho = 935;
break;
case 26: // Ledger
Pagebr = 1224;
Pageho = 792;
break;
case 27: // Legal
Pagebr = 612;
Pageho = 1008;
break;
case 28: // Letter
Pagebr = 612;
Pageho = 792;
break;
case 29: // Tabloid
Pagebr = 792;
Pageho = 1224;
break;
case 30: // Custom
Breite->setEnabled(true);
Hoehe->setEnabled(true);
break;
}
int page_x[] = {2380, 1684, 1190, 842, 595, 421, 297, 210, 148, 105, 2836, 2004, 1418, 1002, 709, 501,
355, 250, 178, 125, 89, 462, 298, 312, 542, 595, 1224, 612, 612, 792};
int page_y[] = {3368, 2380, 1684, 1190, 842, 595, 421, 297, 210, 148, 4008, 2836, 2004, 1418, 1002, 709,
501, 355, 250, 178, 125, 649, 683, 624, 720, 935, 792, 1008, 792, 1225};
if (gr == 30)
{
Breite->setEnabled(true);
Hoehe->setEnabled(true);
}
Pagebr = page_x[gr];
Pageho = page_y[gr];
Breite->setValue(Pagebr * Umrech);
Hoehe->setValue(Pageho * Umrech);
RightR->setMaxValue(Breite->value() - LeftR->value());
606,26 → 460,13
 
void NewDoc::setAT()
{
if (AutoFrame->isChecked())
GroupBox4->setEnabled(true);
else
GroupBox4->setEnabled(false);
GroupBox4->setEnabled(AutoFrame->isChecked() ? true : false);
}
 
void NewDoc::setDS()
{
if (Doppelseiten->isChecked())
{
TextLabel6->setText( tr( "Inside:" ) );
TextLabel8->setText( tr( "Outside:" ) );
ErsteSeite->setEnabled(true);
}
else
{
TextLabel6->setText( tr( "Left:" ) );
TextLabel8->setText( tr( "Right:" ) );
ErsteSeite->setEnabled(false);
}
bool test = Doppelseiten->isChecked() ? false : true;
TextLabel6->setText(test == false ? tr("Inside:") : tr("Left:"));
TextLabel8->setText(test == false ? tr("Outside:") : tr("Right:"));
ErsteSeite->setEnabled(test == false ? true : false);
}
 
 
/trunk/Scribus/scribus/query.cpp
22,7 → 22,7
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "Query" );
setName( "Query" );
setCaption( tr( titel ) );
setIcon(loadIcon("AppIcon.png"));
QueryLayout = new QVBoxLayout( this );
/trunk/Scribus/scribus/search.cpp
15,6 → 15,7
#include "scribusdoc.h"
#include "fontcombo.h"
#include "page.h"
#include "styleselect.h"
extern QPixmap loadIcon(QString nam);
 
 
58,13 → 59,17
SSize->setText( tr( "Font Size" ) );
SearchLayout->addWidget( SSize, 3, 0 );
 
SEffect = new QCheckBox( Search, "SEffect" );
SEffect->setText( tr( "Font Effects" ) );
SearchLayout->addWidget( SEffect, 4, 0 );
 
SFill = new QCheckBox( Search, "SFill" );
SFill->setText( tr( "Fill Color" ) );
SearchLayout->addWidget( SFill, 4, 0 );
SearchLayout->addWidget( SFill, 5, 0 );
 
SStroke = new QCheckBox( Search, "SStroke" );
SStroke->setText( tr( "Stroke Color" ) );
SearchLayout->addWidget( SStroke, 5, 0 );
SearchLayout->addWidget( SStroke, 6, 0 );
 
STextVal = new QLineEdit( Search, "STextVal" );
STextVal->setEnabled(false);
102,6 → 107,11
SSizeVal->setEnabled(false);
SearchLayout->addWidget( SSizeVal, 3, 1 );
 
SEffVal = new StyleSelect( Search );
SEffVal->setStyle(0);
SEffVal->setEnabled(false);
SearchLayout->addWidget( SEffVal, 4, 1, Qt::AlignLeft );
 
SFillVal = new QComboBox( true, Search, "SFillVal" );
SFillVal->setEditable(false);
SFillVal->insertItem( tr("None"));
112,7 → 122,7
}
SFillVal->setCurrentText(doc->CurrTextFill);
SFillVal->setEnabled(false);
SearchLayout->addWidget( SFillVal, 4, 1 );
SearchLayout->addWidget( SFillVal, 5, 1 );
 
SStrokeVal = new QComboBox( true, Search, "SStrokeVal" );
SStrokeVal->setEditable(false);
124,7 → 134,7
}
SStrokeVal->setCurrentText(doc->CurrTextStroke);
SStrokeVal->setEnabled(false);
SearchLayout->addWidget( SStrokeVal, 5, 1 );
SearchLayout->addWidget( SStrokeVal, 6, 1 );
 
SelLayout->addWidget( Search );
 
152,13 → 162,17
RSize->setText( tr( "Font Size" ) );
ReplaceLayout->addWidget( RSize, 3, 0 );
 
REffect = new QCheckBox( Replace, "REffect" );
REffect->setText( tr( "Font Effects" ) );
ReplaceLayout->addWidget( REffect, 4, 0 );
 
RFill = new QCheckBox( Replace, "RFill" );
RFill->setText( tr( "Fill Color" ) );
ReplaceLayout->addWidget( RFill, 4, 0 );
ReplaceLayout->addWidget( RFill, 5, 0 );
 
RStroke = new QCheckBox( Replace, "RStroke" );
RStroke->setText( tr( "Stroke Color" ) );
ReplaceLayout->addWidget( RStroke, 5, 0 );
ReplaceLayout->addWidget( RStroke, 6, 0 );
 
RTextVal = new QLineEdit( Replace, "RTextVal" );
RTextVal->setEnabled(false);
196,6 → 210,11
RSizeVal->setEnabled(false);
ReplaceLayout->addWidget( RSizeVal, 3, 1 );
 
REffVal = new StyleSelect( Replace );
REffVal->setStyle(0);
REffVal->setEnabled(false);
ReplaceLayout->addWidget( REffVal, 4, 1, Qt::AlignLeft );
 
RFillVal = new QComboBox( true, Replace, "RFillVal" );
RFillVal->setEditable(false);
RFillVal->insertItem( tr("None"));
206,7 → 225,7
}
RFillVal->setCurrentText(doc->CurrTextFill);
RFillVal->setEnabled(false);
ReplaceLayout->addWidget( RFillVal, 4, 1 );
ReplaceLayout->addWidget( RFillVal, 5, 1 );
 
RStrokeVal = new QComboBox( true, Replace, "RStrokeVal" );
RStrokeVal->setEditable(false);
218,7 → 237,7
}
RStrokeVal->setCurrentText(doc->CurrTextStroke);
RStrokeVal->setEnabled(false);
ReplaceLayout->addWidget( RStrokeVal, 5, 1 );
ReplaceLayout->addWidget( RStrokeVal, 6, 1 );
 
SelLayout->addWidget( Replace );
SearchReplaceLayout->addLayout( SelLayout );
258,7 → 277,6
Leave->setText( tr( "Leave" ) );
ButtonsLayout->addWidget( Leave );
SearchReplaceLayout->addLayout( ButtonsLayout );
// resize( QSize(570, 311).expandedTo(minimumSizeHint()) );
resize(minimumSizeHint());
 
// signals and slots connections
270,6 → 288,7
connect( SStyle, SIGNAL( clicked() ), this, SLOT( enableStyleSearch() ) );
connect( SFont, SIGNAL( clicked() ), this, SLOT( enableFontSearch() ) );
connect( SSize, SIGNAL( clicked() ), this, SLOT( enableSizeSearch() ) );
connect( SEffect, SIGNAL( clicked() ), this, SLOT( enableEffSearch() ) );
connect( SFill, SIGNAL( clicked() ), this, SLOT( enableFillSearch() ) );
connect( SStroke, SIGNAL( clicked() ), this, SLOT( enableStrokeSearch() ) );
connect( RText, SIGNAL( clicked() ), this, SLOT( enableTxReplace() ) );
276,6 → 295,7
connect( RStyle, SIGNAL( clicked() ), this, SLOT( enableStyleReplace() ) );
connect( RFont, SIGNAL( clicked() ), this, SLOT( enableFontReplace() ) );
connect( RSize, SIGNAL( clicked() ), this, SLOT( enableSizeReplace() ) );
connect( REffect, SIGNAL( clicked() ), this, SLOT( enableEffReplace() ) );
connect( RFill, SIGNAL( clicked() ), this, SLOT( enableFillReplace() ) );
connect( RStroke, SIGNAL( clicked() ), this, SLOT( enableStrokeReplace() ) );
 
283,25 → 303,29
setTabOrder( SText, SStyle );
setTabOrder( SStyle, SFont );
setTabOrder( SFont, SSize );
setTabOrder( SSize, SFill );
setTabOrder( SSize, SEffect );
setTabOrder( SEffect, SFill );
setTabOrder( SFill, SStroke );
setTabOrder( SStroke, STextVal );
setTabOrder( STextVal, SStyleVal );
setTabOrder( SStyleVal, SFontVal );
setTabOrder( SFontVal, SSizeVal );
setTabOrder( SSizeVal, SFillVal );
setTabOrder( SSizeVal, SEffVal );
setTabOrder( SEffVal, SFillVal );
setTabOrder( SFillVal, SStrokeVal );
setTabOrder( SStrokeVal, RText );
setTabOrder( RText, RStyle );
setTabOrder( RStyle, RFont );
setTabOrder( RFont, RSize );
setTabOrder( RSize, RFill );
setTabOrder( RSize, REffect );
setTabOrder( REffect, RFill );
setTabOrder( RFill, RStroke );
setTabOrder( RStroke, RTextVal );
setTabOrder( RTextVal, RStyleVal );
setTabOrder( RStyleVal, RFontVal );
setTabOrder( RFontVal, RSizeVal );
setTabOrder( RSizeVal, RFillVal );
setTabOrder( RSizeVal, REffVal );
setTabOrder( REffVal, RFillVal );
setTabOrder( RFillVal, RStrokeVal );
setTabOrder( RStrokeVal, Word );
setTabOrder( Word, CaseIgnore );
328,15 → 352,18
NotFound = true;
int sStyle = 0;
int sSize = 0;
int sEff = 0;
bool rep = false;
bool found = true;
if ((RFill->isChecked()) || (RStroke->isChecked()) || (RStyle->isChecked()) || (RFont->isChecked())
|| (RSize->isChecked()) || (RText->isChecked()))
if ((RFill->isChecked()) || (RStroke->isChecked()) || (RStyle->isChecked()) || (RFont->isChecked())
|| (RSize->isChecked()) || (RText->isChecked()) || (REffect->isChecked()))
rep = true;
if (SText->isChecked())
sText = STextVal->text();
if (CaseIgnore->isChecked())
sText = sText.lower();
if (SEffect->isChecked())
sEff = SEffVal->getStyle();
if (SFill->isChecked())
fCol = SFillVal->currentText();
if (SStroke->isChecked())
388,6 → 415,11
if (Item->Ptext.at(a)->cstroke != sCol)
found = false;
}
if (SEffect->isChecked())
{
if ((Item->Ptext.at(a)->cstyle & 127) != sEff)
found = false;
}
if (SFill->isChecked())
{
if (Item->Ptext.at(a)->ccolor != fCol)
551,6 → 583,22
emit NewFont(RFontVal->currentText());
if (RSize->isChecked())
Doc->ActPage->chFSize(qRound(RSizeVal->value() * 10.0));
if (REffect->isChecked())
{
int s = REffVal->getStyle();
Doc->CurrentStyle = s;
if (Item->Ptext.count() != 0)
{
for (uint a = 0; a < Item->Ptext.count(); ++a)
{
if (Item->Ptext.at(a)->cselect)
{
Item->Ptext.at(a)->cstyle &= ~127;
Item->Ptext.at(a)->cstyle |= s;
}
}
}
}
DoReplace->setEnabled(false);
AllReplace->setEnabled(false);
for (uint a = 0; a < Item->Ptext.count(); ++a)
596,6 → 644,11
SSizeVal->setEnabled(SSize->isChecked());
}
 
void SearchReplace::enableEffSearch()
{
SEffVal->setEnabled(SEffect->isChecked());
}
 
void SearchReplace::enableFillSearch()
{
SFillVal->setEnabled(SFill->isChecked());
626,6 → 679,11
RSizeVal->setEnabled(RSize->isChecked());
}
 
void SearchReplace::enableEffReplace()
{
REffVal->setEnabled(REffect->isChecked());
}
 
void SearchReplace::enableFillReplace()
{
RFillVal->setEnabled(RFill->isChecked());
/trunk/Scribus/scribus/annota.cpp
24,18 → 24,18
OriBreite = b;
OriHoehe = h;
view = vie;
MaxSeite = Seite;
MaxSeite = Seite;
QStringList tl;
if ((item->AnActType == 2) || (item->AnActType == 7))
{
if ((item->AnActType == 2) || (item->AnActType == 7))
{
QString tm = item->AnAction;
tl = tl.split(" ", tm);
}
else
{
tl.append("0");
tl.append("0");
}
}
else
{
tl.append("0");
tl.append("0");
}
AnnotLayout = new QVBoxLayout( this );
AnnotLayout->setSpacing( 6 );
76,17 → 76,17
GroupBox1Layout->setMargin( 11 );
 
Destfile = new QLineEdit(GroupBox1, "File");
Destfile->setText(item->An_Extern);
Destfile->setReadOnly(true);
Destfile->setText(item->An_Extern);
Destfile->setReadOnly(true);
GroupBox1Layout->addMultiCellWidget( Destfile, 0, 0, 0, 1 );
ChFile = new QPushButton(GroupBox1, "Change");
ChFile->setText( tr("Change..."));
ChFile = new QPushButton(GroupBox1, "Change");
ChFile->setText( tr("Change..."));
GroupBox1Layout->addWidget( ChFile, 0, 2 );
if ((item->AnActType != 7) && (item->AnActType != 8))
{
Destfile->hide();
ChFile->hide();
}
if ((item->AnActType != 7) && (item->AnActType != 8))
{
Destfile->hide();
ChFile->hide();
}
 
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setText( tr( "Page:" ) );
149,7 → 149,7
connect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
connect(SpinBox2, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
connect(SpinBox3, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
connect(ChFile, SIGNAL(clicked()), this, SLOT(GetFile()));
connect(ChFile, SIGNAL(clicked()), this, SLOT(GetFile()));
SetZiel(item->AnType);
SetCross();
}
164,22 → 164,22
{
disconnect(SpinBox1, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
if (ComboBox1->currentItem() == 2)
{
if (!Pg->SetSeite(v, 100, Destfile->text()))
{
if (!Pg->SetSeite(v, 100, Destfile->text()))
{
SpinBox1->setValue(1);
Pg->SetSeite(1, 100, Destfile->text());
}
}
Breite = Pg->Breite;
Hoehe = Pg->Hoehe;
}
}
else
{
{
Pg->SetSeite(v-1, 100);
SpinBox1->setValue(v);
Breite = OriBreite;
Hoehe = OriHoehe;
}
}
SpinBox2->setMaxValue(Breite);
SpinBox3->setMaxValue(Hoehe);
connect(SpinBox1, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
188,11 → 188,11
void Annota::SetCross()
{
int x,y;
disconnect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
disconnect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
x = static_cast<int>(static_cast<double>(SpinBox2->value())/static_cast<double>(Breite)*Pg->pmx.width());
y = static_cast<int>(static_cast<double>(SpinBox3->value())/static_cast<double>(Hoehe)*Pg->pmx.height());
Pg->drawMark(x, y);
connect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
connect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
}
 
void Annota::SetVals()
203,31 → 203,31
if (item->AnType == 10)
item->AnActType = 0;
if (item->AnType == 11)
{
{
item->AnAction = tmp.setNum(SpinBox2->value())+" "+tmp2.setNum(Hoehe-SpinBox3->value())+" 0";
item->An_Extern = "";
item->AnActType = 2;
}
}
if (item->AnType == 12)
{
{
item->AnAction = tmp.setNum(SpinBox2->value())+" "+tmp2.setNum(Hoehe-SpinBox3->value())+" 0";
if (Destfile->text() != "")
{
{
item->An_Extern = Destfile->text();
item->AnActType = 7;
}
}
item->AnType = 11;
}
}
if (item->AnType == 13)
{
{
item->AnAction = "";
if (Destfile->text() != "")
{
{
item->An_Extern = Destfile->text();
item->AnActType = 8;
}
}
item->AnType = 11;
}
}
accept();
}
 
242,7 → 242,7
SpinBox2->show();
SpinBox3->show();
switch (it)
{
{
case 1:
Fram->raiseWidget(1);
Destfile->setText("");
252,7 → 252,7
SetPg(QMIN(SpinBox1->value(), MaxSeite));
break;
case 2:
Fram->raiseWidget(1);
Fram->raiseWidget(1);
Destfile->show();
ChFile->show();
Destfile->setReadOnly(true);
288,7 → 288,7
item->AnActType = 8;
break;
case 11:
Fram->raiseWidget(1);
Fram->raiseWidget(1);
if (item->AnActType == 7)
{
Destfile->show();
314,7 → 314,7
default:
Fram->raiseWidget(2);
break;
}
}
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(SetZiel(int)));
}
 
325,14 → 325,14
if (Destfile->text() != "")
dia.setSelection(Destfile->text());
if (dia.exec() == QDialog::Accepted)
{
fn = dia.selectedFile();
if (!fn.isEmpty())
{
fn = dia.selectedFile();
if (!fn.isEmpty())
{
Destfile->setText(fn);
SpinBox1->setValue(1);
SpinBox1->setMaxValue(1000);
SetPg(1);
}
Destfile->setText(fn);
SpinBox1->setValue(1);
SpinBox1->setMaxValue(1000);
SetPg(1);
}
}
}
/trunk/Scribus/scribus/applytemplate.cpp
14,25 → 14,18
layout3->addWidget( TextLabel1 );
Templ = new QComboBox( true, this, "Templ" );
Templ->setMinimumSize( QSize( 120, 22 ) );
Templ->setEditable(false);
QString na, in;
if (Nam == "Normal")
na = tr("Normal");
else
na = Nam;
int cc = 0;
QMap<QString,int>::Iterator it;
for (it = view->MasterNames.begin(); it != view->MasterNames.end(); ++it)
{
if (it.key() == "Normal")
in = tr("Normal");
else
in = it.key();
Templ->insertItem(in);
if (in == na)
Templ->setCurrentItem(cc);
cc++;
}
Templ->setEditable(false);
QString na = Nam == "Normal" ? tr("Normal") : Nam, in;
int cc = 0;
QMap<QString,int>::Iterator it;
for (it = view->MasterNames.begin(); it != view->MasterNames.end(); ++it)
{
in = it.key() == "Normal" ? tr("Normal") : it.key();
Templ->insertItem(in);
if (in == na)
Templ->setCurrentItem(cc);
cc++;
}
layout3->addWidget( Templ );
ApplyTLayout->addLayout( layout3 );
 
50,12 → 43,12
 
layout2 = new QHBoxLayout( 0, 0, 6, "layout2");
PageRange = new QRadioButton( buttonGroup1, "radioButton2" );
PageRange->setText( tr( "Apply from Page:" ) );
PageRange->setText( tr( "Apply from Page:" ) );
layout2->addWidget( PageRange );
FromPage = new QSpinBox( buttonGroup1, "FromPage" );
FromPage->setMinValue( 1 );
FromPage->setMaxValue(view->Pages.count());
FromPage->setValue(view->Doc->ActPage->PageNr+1);
FromPage->setMaxValue(view->Pages.count());
FromPage->setValue(view->Doc->ActPage->PageNr+1);
layout2->addWidget( FromPage );
TextLabel2 = new QLabel( buttonGroup1, "textLabel1" );
TextLabel2->setText( tr( "to:" ) );
62,13 → 55,13
layout2->addWidget( TextLabel2 );
ToPage = new QSpinBox( buttonGroup1, "toPage" );
ToPage->setMinValue( 1 );
ToPage->setMaxValue(view->Pages.count());
ToPage->setValue(view->Pages.count());
ToPage->setMaxValue(view->Pages.count());
ToPage->setValue(view->Pages.count());
layout2->addWidget( ToPage );
buttonGroup1Layout->addLayout( layout2 );
ApplyTLayout->addWidget( buttonGroup1 );
FromPage->setEnabled(false);
ToPage->setEnabled(false);
FromPage->setEnabled(false);
ToPage->setEnabled(false);
 
Layout4 = new QHBoxLayout;
Layout4->setSpacing( 6 );
77,7 → 70,7
Layout4->addItem( spacer );
OKButton = new QPushButton( this, "OKButton" );
OKButton->setText( tr( "OK" ) );
OKButton->setDefault( TRUE );
OKButton->setDefault( true );
Layout4->addWidget( OKButton );
QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout4->addItem( spacer_2 );
89,10 → 82,10
ApplyTLayout->addLayout( Layout4 );
connect( CancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( OKButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect(SinglePage, SIGNAL(clicked()), this, SLOT(SingleSel()));
connect(PageRange, SIGNAL(clicked()), this, SLOT(RangeSel()));
connect(FromPage, SIGNAL(valueChanged(int)), this, SLOT(CheckRangeF()));
connect(ToPage, SIGNAL(valueChanged(int)), this, SLOT(CheckRangeT()));
connect(SinglePage, SIGNAL(clicked()), this, SLOT(SingleSel()));
connect(PageRange, SIGNAL(clicked()), this, SLOT(RangeSel()));
connect(FromPage, SIGNAL(valueChanged(int)), this, SLOT(CheckRangeF()));
connect(ToPage, SIGNAL(valueChanged(int)), this, SLOT(CheckRangeT()));
}
 
void ApplyT::RangeSel()
/trunk/Scribus/scribus/styleselect.cpp
0,0 → 1,154
#include "styleselect.h"
#include "styleselect.moc"
 
extern QPixmap loadIcon(QString nam);
 
StyleSelect::StyleSelect(QWidget* parent) : QWidget(parent, "StyleSelect")
{
Layout1 = new QHBoxLayout( this, 0, 0, "Layout1");
 
Underline = new QToolButton( this, "Underline" );
Underline->setMaximumSize( QSize( 22, 22 ) );
Underline->setText("");
Underline->setPixmap(loadIcon("Unter.xpm"));
Underline->setToggleButton( true );
Layout1->addWidget( Underline );
 
ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" );
ButtonGroup1->setFrameShape( QButtonGroup::NoFrame );
ButtonGroup1->setTitle("");
ButtonGroup1->setExclusive( true );
ButtonGroup1->setRadioButtonExclusive( false );
ButtonGroup1->setColumnLayout(0, Qt::Vertical );
ButtonGroup1->layout()->setSpacing( 0 );
ButtonGroup1->layout()->setMargin( 0 );
ButtonGroup1Layout = new QHBoxLayout( ButtonGroup1->layout() );
ButtonGroup1Layout->setAlignment( Qt::AlignTop );
 
Subs = new QToolButton( ButtonGroup1, "Subs" );
Subs->setMaximumSize( QSize( 22, 22 ) );
Subs->setText("");
Subs->setPixmap(loadIcon("Tief.xpm"));
Subs->setToggleButton( true );
ButtonGroup1Layout->addWidget( Subs );
 
Supers = new QToolButton( ButtonGroup1, "Supers" );
Supers->setMaximumSize( QSize( 22, 22 ) );
Supers->setText("");
Supers->setPixmap(loadIcon("Hoch.xpm"));
Supers->setToggleButton( true );
ButtonGroup1Layout->addWidget( Supers );
Layout1->addWidget( ButtonGroup1 );
 
Kapital = new QToolButton( this, "Kapital" );
Kapital->setMaximumSize( QSize( 22, 22 ) );
Kapital->setText("");
Kapital->setPixmap(loadIcon("Kapital.xpm"));
Kapital->setToggleButton( true );
Layout1->addWidget( Kapital );
 
Strike = new QToolButton( this, "Strike" );
Strike->setMaximumSize( QSize( 22, 22 ) );
Strike->setText("");
Strike->setPixmap(loadIcon("Strike.xpm"));
Strike->setToggleButton( true );
Layout1->addWidget( Strike );
 
Outlined = new QToolButton( this, "Outlined" );
Outlined->setMaximumSize( QSize( 22, 22 ) );
Outlined->setText("");
Outlined->setPixmap(loadIcon("outlined.png"));
Outlined->setToggleButton( true );
Layout1->addWidget( Outlined );
QToolTip::add( Underline, tr( "Underline" ) );
QToolTip::add( Kapital, tr( "Small Caps" ) );
QToolTip::add( Subs, tr( "Subscript" ) );
QToolTip::add( Supers, tr( "Superscript" ) );
QToolTip::add( Strike, tr( "Strikeout" ) );
QToolTip::add( Outlined, tr( "Outline Text" ) );
connect(Kapital, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Underline, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Subs, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Strike, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Supers, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
connect(Outlined, SIGNAL(clicked()), this, SLOT(setTypeStyle()));
resize(minimumSizeHint());
}
 
void StyleSelect::setStyle(int s)
{
Supers->setOn(false);
Subs->setOn(false);
Strike->setOn(false);
Underline->setOn(false);
Kapital->setOn(false);
Outlined->setOn(false);
if (s & 1)
Supers->setOn(true);
if (s & 2)
Subs->setOn(true);
if (s & 4)
Outlined->setOn(true);
if (s & 8)
Underline->setOn(true);
if (s & 16)
Strike->setOn(true);
if (s & 64)
Kapital->setOn(true);
}
 
int StyleSelect::getStyle()
{
int ret = 0;
if (Supers->isOn())
ret |= 1;
if (Subs->isOn())
ret |= 2;
if (Outlined->isOn())
ret |= 4;
if (Underline->isOn())
ret |= 8;
if (Strike->isOn())
ret |= 16;
if (Kapital->isOn())
ret |= 64;
return ret;
}
 
void StyleSelect::setTypeStyle()
{
if (Supers == sender())
{
emit State(1);
Subs->setOn(false);
return;
}
if (Subs == sender())
{
emit State(2);
Supers->setOn(false);
return;
}
if (Outlined == sender())
{
emit State(4);
return;
}
if (Underline == sender())
{
emit State(8);
return;
}
if (Strike == sender())
{
emit State(16);
return;
}
if (Kapital == sender())
{
emit State(64);
return;
}
emit State(0);
}
 
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Scribus/scribus/mdup.cpp
===================================================================
--- Scribus/scribus/mdup.cpp (revision 166)
+++ Scribus/scribus/mdup.cpp (revision 167)
@@ -36,25 +36,9 @@
ShiftH->setMinValue( -1000 );
ShiftH->setValue(Dx);
Layout4->addWidget( ShiftH, 1, 1 );
- switch (Ein)
- {
- case 0:
- ShiftH->setSuffix( tr( " pt" ) );
- ShiftV->setSuffix( tr( " pt" ) );
- break;
- case 1:
- ShiftH->setSuffix( tr( " mm" ) );
- ShiftV->setSuffix( tr( " mm" ) );
- break;
- case 2:
- ShiftH->setSuffix( tr( " in" ) );
- ShiftV->setSuffix( tr( " in" ) );
- break;
- case 3:
- ShiftH->setSuffix( tr( " p" ) );
- ShiftV->setSuffix( tr( " p" ) );
- break;
- }
+ char *Suffix[] = {" pt", " mm", " in", " p"};
+ ShiftH->setSuffix(tr(Suffix[Ein]));
+ ShiftV->setSuffix(tr(Suffix[Ein]));
TextLabel1 = new QLabel( this, "TextLabel1" );
TextLabel1->setText( tr( "Number of Copies:" ) );
Layout4->addWidget( TextLabel1, 0, 0 );
Index: Scribus/scribus/fontprefs.cpp
===================================================================
--- Scribus/scribus/fontprefs.cpp (revision 166)
+++ Scribus/scribus/fontprefs.cpp (revision 167)
@@ -91,12 +91,10 @@
Table1->setLeftMargin(0);
Table1->verticalHeader()->hide();
Header = Table1->horizontalHeader();
- Header->setLabel(0, tr("Font Name"));
- Header->setLabel(1, tr("Use Font"));
- Header->setLabel(2, tr("Embed in:"));
- Header->setLabel(3, tr("Subset"));
- Header->setLabel(4, tr("Type"));
- Header->setLabel(5, tr("Path to Font File"));
+ char *tmp_head[] = {"Font Name", "Use Font", "Embed in:", "Subset", "Type", "Path to Font File"};
+ size_t array_head = sizeof(tmp_head) / sizeof(*tmp_head);
+ for (uint a = 0; a < array_head; ++a)
+ Header->setLabel(a, tr(tmp_head[a]));
Table1->adjustColumn(0);
Table1->adjustColumn(1);
Table1->setColumnWidth(2, 110);
@@ -222,7 +220,7 @@
{
QString tmp;
UsedFonts.clear();
- uint a = 0;
+ uint a = 0;
SCFontsIterator it(Prefs->AvailFonts);
for ( ; it.current() ; ++it)
{
Index: Scribus/scribus/serializer.cpp
===================================================================
--- Scribus/scribus/serializer.cpp (revision 166)
+++ Scribus/scribus/serializer.cpp (revision 167)
@@ -33,15 +33,15 @@
void Serializer::PutText(PageItem *Item)
{
- uint a;
- QString Dat = "";
+ uint a;
+ QString Dat = "";
QPtrList<Pti> y = Item->Ptext;
- for (a=0; a<y.count(); ++a)
+ for (a=0; a<y.count(); ++a)
{
QString b = y.at(a)->ch;
if (b == QChar(13))
b = "\n";
- Dat += b;
+ Dat += b;
}
Objekt = Dat;
}
@@ -53,26 +53,26 @@
PageItem *it = Item;
uint a;
if (!Append)
- {
+ {
nb = Item;
while (nb != 0)
- {
+ {
if (nb->BackBox != 0)
nb = nb->BackBox;
else
break;
- }
+ }
it = nb;
while (nb != 0)
- {
+ {
nb->Ptext.clear();
nb->CPos = 0;
nb->Dirty = true;
nb = nb->NextBox;
- }
}
+ }
for (a=0; a<Objekt.length(); ++a)
- {
+ {
if ((Objekt.at(a) == QChar(0)) || (Objekt.at(a) == QChar(13)))
continue;
hg = new Pti;
@@ -79,16 +79,8 @@
hg->ch = Objekt.at(a);
if ((hg->ch == QChar(10)) || (hg->ch == QChar(5)))
hg->ch = QChar(13);
- if (font != "")
- {
- hg->cfont = font;
- hg->csize = size;
- }
- else
- {
- hg->cfont = it->IFont;
- hg->csize = it->ISize;
- }
+ hg->cfont = font != "" ? font : it->IFont;
+ hg->csize = font != "" ? size : it->ISize;
hg->ccolor = it->TxtFill;
hg->cshade = it->ShTxtFill;
hg->cstroke = it->TxtStroke;
@@ -118,19 +110,15 @@
codec = QTextCodec::codecForLocale();
else
codec = QTextCodec::codecForName(Cod);
- QCString dec = codec->fromUnicode( Objekt );
+ QCString dec = codec->fromUnicode( Objekt );
QFile f(Filename);
bool ret = false;
if (f.open(IO_WriteOnly))
- {
+ {
f.writeBlock(dec, dec.length());
f.close();
ret = true;
- }
- else
- {
- ret = false;
- }
+ }
return ret;
}
@@ -142,7 +130,7 @@
codec = QTextCodec::codecForLocale();
else
codec = QTextCodec::codecForName(Cod);
- QString dec = codec->toUnicode( Objekt );
+ QString dec = codec->toUnicode( Objekt );
Objekt = dec;
return tmp;
}
/trunk/Scribus/scribus/page.cpp
127,12 → 127,12
void Page::dragLeaveEvent(QDragLeaveEvent *e)
{
if (DraggedGroup)
{
{
double gx, gy, gw, gh;
getGroupRectScreen(&gx, &gy, &gw, &gh);
repaint(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh));
DraggedGroup = false;
}
}
}
 
void Page::dragEnterEvent(QDragEnterEvent *e)
140,15 → 140,15
QString text;
e->accept(QTextDrag::canDecode(e));
if (QTextDrag::decode(e, text))
{
{
double gx, gy, gw, gh;
QUrl ur(text);
QFileInfo fi = QFileInfo(ur.path());
ScriXmlDoc *ss = new ScriXmlDoc();
ScriXmlDoc *ss = new ScriXmlDoc();
if (fi.exists())
text = ur.path();
if(ss->ReadElemHeader(text,fi.exists(), &gx, &gy, &gw, &gh))
{
if(ss->ReadElemHeader(text,fi.exists(), &gx, &gy, &gw, &gh))
{
GroupX = e->pos().x() / doku->Scale;
GroupY = e->pos().y() / doku->Scale;
GroupW = gw;
155,12 → 155,12
GroupH = gh;
DraggedGroup = true;
GroupSel = false;
}
}
delete ss;
setActiveWindow();
raise();
SeleItemPos(e->pos());
}
}
}
 
void Page::dragMoveEvent(QDragMoveEvent *e)
170,9 → 170,9
bool img;
e->accept(QTextDrag::canDecode(e));
if (QTextDrag::decode(e, text))
{
if (DraggedGroup)
{
if (DraggedGroup)
{
double gx, gy, gw, gh;
getGroupRectScreen(&gx, &gy, &gw, &gh);
repaint(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh));
183,7 → 183,7
emit Hrule(e->pos().x()+Anz->childX(parentWidget()));
emit Vrule(e->pos().y()+Anz->childY(parentWidget()));
return;
}
}
QUrl ur(text);
QFileInfo fi = QFileInfo(ur.path());
QString ext = fi.extension(false).upper();
192,25 → 192,25
ext = "JPEG";
img = ((imfo.contains(ext))||(ext=="PS")||(ext=="EPS")||(ext=="TIF"));
if (!SeleItemPos(e->pos()))
{
{
if (SelItem.count() != 0)
Deselect(true);
}
}
else
{
{
b = SelItem.at(0);
if (img)
{
{
if (b->PType != 2)
Deselect(true);
}
}
else
{
{
if (b->PType != 4)
Deselect(true);
}
}
}
}
}
 
void Page::dropEvent(QDropEvent *e)
222,7 → 222,7
uint a;
int re;
if (QTextDrag::decode(e, text))
{
{
QUrl ur(text);
QFileInfo fi = QFileInfo(ur.path());
QString ext = fi.extension(false).upper();
231,10 → 231,10
ext = "JPEG";
img = ((imfo.contains(ext))||(ext=="PS")||(ext=="EPS")||(ext=="PDF")||(ext=="TIF"));
if ((fi.exists()) && (img) && (!SeleItemPos(e->pos())))
{
{
int z = PaintPict(qRound(e->pos().x()/doku->Scale), qRound(e->pos().y()/doku->Scale), 1, 1);
b = Items.at(z);
LoadPict(ur.path(), b->ItemNr);
LoadPict(ur.path(), b->ItemNr);
b->Width = static_cast<double>(b->pixm.width());
b->Height = static_cast<double>(b->pixm.height());
b->OldB2 = b->Width;
243,42 → 243,42
emit DocChanged();
update();
return;
}
}
if ((SeleItemPos(e->pos())) && (!text.startsWith("<SCRIBUSELEM")))
{
{
b = SelItem.at(0);
if (b->PType == 2)
{
if ((fi.exists()) && (img))
{
if ((fi.exists()) && (img))
{
LoadPict(ur.path(), b->ItemNr);
update();
}
LoadPict(ur.path(), b->ItemNr);
update();
}
}
if (b->PType == 4)
{
{
if ((b->BackBox != 0) && (b->Ptext.count() == 0))
return;
if ((fi.exists()) && (!img) && (fi.size() < 500000))
{
Serializer *ss = new Serializer(ur.path());
if (ss->Read())
{
Serializer *ss = new Serializer(ur.path());
if (ss->Read())
{
int st = doku->CurrentABStil;
ss->GetText(b, st, doku->Vorlagen[st].Font, doku->Vorlagen[st].FontSize);
ss->GetText(b, st, doku->Vorlagen[st].Font, doku->Vorlagen[st].FontSize);
emit DocChanged();
}
delete ss;
update();
delete ss;
update();
}
else
{
{
slotDoCurs(false);
slotSetCurs(e->pos().x(), e->pos().y());
if (text.startsWith("<SCRIBUSELEM"))
return;
for (a=0; a<text.length(); ++a)
{
{
hg = new Pti;
hg->ch = text.at(a);
if (hg->ch == QChar(10))
305,23 → 305,22
hg->PtransY = 0;
b->Ptext.insert(b->CPos, hg);
b->CPos += 1;
}
}
b->Dirty = true;
emit DocChanged();
update();
}
}
}
}
else
{
{
if ((fi.exists()) && (!img))
{
emit LoadElem(QString(ur.path()), qRound(e->pos().x()/doku->Scale), qRound(e->pos().y()/doku->Scale), true, false, doku);
}
emit LoadElem(QString(ur.path()), qRound(e->pos().x()/doku->Scale),
qRound(e->pos().y()/doku->Scale), true, false, doku);
else
{
if (doku->DraggedElem != 0)
{
if (doku->DraggedElem != 0)
{
QPopupMenu *pmen = new QPopupMenu();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
pmen->insertItem( tr("Copy Here"));
330,26 → 329,28
re = pmen->indexOf(pmen->exec(QCursor::pos()));
delete pmen;
if (re == 1)
{
{
doku->DraggedElem->OwnPage->SelItem.clear();
for (uint dre=0; dre<doku->DragElements.count(); ++dre)
{
doku->DraggedElem->OwnPage->SelItem.append(doku->DraggedElem->OwnPage->Items.at(doku->DragElements[dre]));
}
{
doku->DraggedElem->OwnPage->SelItem.append(doku->DraggedElem->OwnPage->Items.at
(doku->DragElements[dre]));
}
doku->DraggedElem->OwnPage->DeleteItem();
}
}
}
else
re = 1;
if ((!img) && ((re == 0) || (re == 1)))
emit LoadElem(QString(text), qRound(e->pos().x()/doku->Scale), qRound(e->pos().y()/doku->Scale), false, false, doku);
emit LoadElem(QString(text), qRound(e->pos().x()/doku->Scale),
qRound(e->pos().y()/doku->Scale), false, false, doku);
// Deselect(true);
doku->DraggedElem = 0;
doku->DragElements.clear();
update();
}
}
}
}
}
 
/** No descriptions */
377,7 → 378,7
p.setBrush(NoBrush);
p.drawRect(0, 0, width(), height());
p.end();
if (SelItem.count() != 0)
if (SelItem.count() != 0)
{
PageItem *b = SelItem.at(0);
b->paintObj(e->rect());
384,11 → 385,11
if ((doku->EditClip) && (b->Select))
MarkClip(b);
if (GroupSel)
{
{
setGroupRect();
paintGroupRect();
}
}
}
delete painter;
}
 
405,30 → 406,33
p->setWorldMatrix(ma);
p->setLineWidth(lw);
if (doku->Marks)
{
{
p->setPen(doku->margColor);
if (doku->RandFarbig)
{
{
p->setBrush(doku->margColor);
p->drawRect(0, 0, width()/doku->Scale, Margins.Top);
p->drawRect(0, Margins.Top, Margins.Left, height()/doku->Scale-Margins.Top);
p->drawRect(Margins.Left, height()/doku->Scale-Margins.Bottom, width()/doku->Scale-Margins.Right-Margins.Left, Margins.Bottom);
p->drawRect(Margins.Left, height()/doku->Scale-Margins.Bottom,
width()/doku->Scale-Margins.Right-Margins.Left, Margins.Bottom);
p->drawRect(width()/doku->Scale-Margins.Right, Margins.Top, Margins.Right, height()/doku->Scale);
}
}
p->setPen(doku->margColor);
p->drawLine(FPoint(0, Margins.Top), FPoint(width()/doku->Scale, Margins.Top));
p->drawLine(FPoint(0, height()/doku->Scale-Margins.Bottom), FPoint(width()/doku->Scale, height()/doku->Scale-Margins.Bottom));
p->drawLine(FPoint(0, height()/doku->Scale-Margins.Bottom), FPoint(width()/doku->Scale,
height()/doku->Scale-Margins.Bottom));
p->drawLine(FPoint(Margins.Left, 0), FPoint(Margins.Left, height()/doku->Scale));
p->drawLine(FPoint(width()/doku->Scale-Margins.Right, 0), FPoint(width()/doku->Scale-Margins.Right, height()/doku->Scale));
}
p->drawLine(FPoint(width()/doku->Scale-Margins.Right, 0), FPoint(width()/doku->Scale-Margins.Right,
height()/doku->Scale));
}
if (doku->Raster)
{
{
double stx = rd.x()/doku->Scale;
double endx = rd.x()/doku->Scale+rd.width()/doku->Scale;
double sty = rd.y()/doku->Scale;
double endy = rd.y()/doku->Scale+rd.height()/doku->Scale;
if (doku->Scale > 0.49)
{
{
double i,start;
i=doku->majorGrid;
p->setPen(doku->majorColor, lw, SolidLine, FlatCap, MiterJoin);
435,42 → 439,38
start=floor(sty/i);
start*=i;
for (b = start; b < endy; b+=i)
p->drawLine(FPoint(0, b), FPoint(width()/doku->Scale, b));
p->drawLine(FPoint(0, b), FPoint(width()/doku->Scale, b));
start=floor(stx/i);
start*=i;
for (b = start; b <= endx; b+=i)
p->drawLine(FPoint(b, 0), FPoint(b, height()/doku->Scale));
p->drawLine(FPoint(b, 0), FPoint(b, height()/doku->Scale));
i=doku->minorGrid;
p->setPen(doku->minorColor, lw, DotLine, FlatCap, MiterJoin);
start=floor(sty/i);
start*=i;
for (b = start; b < endy; b+=i)
p->drawLine(FPoint(0, b), FPoint(width()/doku->Scale, b));
p->drawLine(FPoint(0, b), FPoint(width()/doku->Scale, b));
start=floor(stx/i);
start*=i;
for (b = start; b <= endx; b+=i)
p->drawLine(FPoint(b, 0), FPoint(b, height()/doku->Scale));
}
p->drawLine(FPoint(b, 0), FPoint(b, height()/doku->Scale));
}
}
if (doku->Guides)
{
if (XGuides.count() != 0)
{
if (XGuides.count() != 0)
{
p->setPen(doku->guideColor, lw, SolidLine, FlatCap, MiterJoin);
for (uint xg = 0; xg < XGuides.count(); ++xg)
{
p->drawLine(FPoint(XGuides[xg], 0), FPoint(XGuides[xg], doku->PageH));
}
}
}
if (YGuides.count() != 0)
{
{
p->setPen(doku->guideColor, lw, SolidLine, FlatCap, MiterJoin);
for (uint yg = 0; yg < YGuides.count(); ++yg)
{
p->drawLine(FPoint(0, YGuides[yg]), FPoint(doku->PageB, YGuides[yg]));
}
}
}
}
p->setWorldMatrix(ma2);
}
 
487,20 → 487,20
if ((rd.width() == 0) || (rd.height() == 0))
return;
if (MPageNam != "")
{
{
Page* Mp = vi->MasterPages.at(vi->MasterNames[MPageNam]);
QWidget* Opa;
Page* Opa2;
if (Mp->Items.count() != 0)
{
{
Lnr = 0;
for (uint la = 0; la < doku->Layers.count(); ++la)
{
{
Level2Layer(doku, &ll, Lnr);
if (ll.Sichtbar)
{
for (a = 0; a < Mp->Items.count(); ++a)
{
for (a = 0; a < Mp->Items.count(); ++a)
{
b = Mp->Items.at(a);
if (b->LayerNr != ll.LNr)
continue;
511,22 → 511,22
b->DrawObj(painter, rd);
b->Parent = Opa;
b->OwnPage = Opa2;
}
}
}
Lnr++;
}
}
}
}
if (Items.count() != 0)
{
{
Lnr = 0;
for (uint la2 = 0; la2 < doku->Layers.count(); ++la2)
{
{
Level2Layer(doku, &ll, Lnr);
if (ll.Sichtbar)
{
for (a = 0; a < Items.count(); ++a)
{
for (a = 0; a < Items.count(); ++a)
{
b = Items.at(a);
if (b->LayerNr != ll.LNr)
continue;
534,20 → 534,21
p.begin(this);
Transform(b, &p);
QRegion apr = QRegion(p.xForm(b->Clip));
QRegion apr2 = QRegion(p.xForm(QRect(-1, -1, static_cast<int>(b->Width), static_cast<int>(b->Height))));
QRegion apr2 = QRegion(p.xForm(QRect(-1, -1, static_cast<int>(b->Width),
static_cast<int>(b->Height))));
p.end();
if ((rd.intersects(apr.boundingRect())) || (rd.intersects(apr2.boundingRect())))
{
{
b->DrawObj(painter, rd);
b->Redrawn = true;
if ((doku->AppMode == 7) && (b->Select))
slotDoCurs(true);
}
}
}
}
Lnr++;
}
}
}
}
 
void Page::setGroupRect()
558,11 → 559,11
double maxx = -99999.9;
double maxy = -99999.9;
for (uint gc = 0; gc < SelItem.count(); ++gc)
{
{
b = SelItem.at(gc);
if (b->Rot != 0)
{
FPointArray pb;
{
FPointArray pb;
FPoint p1;
pb.resize(0);
pb.addPoint(FPoint(b->Xpos, b->Ypos));
573,21 → 574,21
p1 = transformPoint(FPoint(0.0, b->Height), b->Xpos, b->Ypos, b->Rot, 1.0, 1.0);
pb.addPoint(p1);
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, b->Xpos);
miny = QMIN(miny, b->Ypos);
maxx = QMAX(maxx, b->Xpos + b->Width);
maxy = QMAX(maxy, b->Ypos + b->Height);
}
}
}
GroupX = minx;
GroupY = miny;
GroupW = maxx - minx;
602,12 → 603,13
if (GroupSel)
getGroupRectScreen(&gx, &gy, &gw, &gh);
for (uint a = 0; a < SelItem.count(); ++a)
{
{
b = SelItem.at(a);
MoveItem(x, y, b, fromMP);
}
}
if (GroupSel)
repaint(QRect(static_cast<int>(gx-5), static_cast<int>(gy-5), static_cast<int>(gw+10), static_cast<int>(gh+10)));
repaint(QRect(static_cast<int>(gx-5), static_cast<int>(gy-5), static_cast<int>(gw+10),
static_cast<int>(gh+10)));
}
 
void Page::getGroupRect(double *x, double *y, double *w, double *h)
633,18 → 635,15
getGroupRectScreen(&x, &y, &w, &h);
QPainter pgc;
pgc.begin(this);
if (norm)
pgc.setPen(QPen(red, 1, DotLine, FlatCap, MiterJoin));
else
pgc.setPen(QPen(black, 1, DotLine, FlatCap, MiterJoin));
pgc.setPen(QPen((norm ? red : black), 1, DotLine, FlatCap, MiterJoin));
pgc.setBrush(NoBrush);
pgc.drawRect(static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h));
pgc.setBrush(red);
if (norm)
{
{
pgc.setPen(QPen(red, 1, SolidLine, FlatCap, MiterJoin));
pgc.drawRect(static_cast<int>(x+w-6), static_cast<int>(y+h-6), 6, 6);
}
}
// pgc.drawRect(int(x), int(y), 6, 6);
/* pgc.drawRect(int(x+w-6), int(y), 6, 6);
pgc.drawRect(int(x), int(y+h-6), 6, 6);
713,15 → 712,15
void Page::TransformM(PageItem *b, QPainter *p)
{
if (b->flippedH % 2 != 0)
{
{
p->translate(b->Width, 0);
p->scale(-1, 1);
}
}
if (b->flippedV % 2 != 0)
{
{
p->translate(0, b->Height);
p->scale(1, -1);
}
}
}
 
void Page::PaintSizeRect(QPainter *p, QRect alt, QRect neu)
737,10 → 736,10
{
QPoint np;
if (doku->useRaster)
{
{
np.setX(static_cast<int>(qRound(in.x() / doku->minorGrid) * doku->minorGrid));
np.setY(static_cast<int>(qRound(in.y() / doku->minorGrid) * doku->minorGrid));
}
}
else
np = in;
return np;
749,30 → 748,30
void Page::ApplyGuides(double *x, double *y)
{
if (doku->SnapGuides)
{
if (YGuides.count() != 0)
{
if (YGuides.count() != 0)
for (uint yg = 0; yg < YGuides.count(); ++yg)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
if ((YGuides[yg] < (*y+doku->GuideRad)) && (YGuides[yg] > (*y-doku->GuideRad)))
{
if ((YGuides[yg] < (*y+doku->GuideRad)) && (YGuides[yg] > (*y-doku->GuideRad)))
{
*y= YGuides[yg];
break;
}
}
}
}
if (XGuides.count() != 0)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
if ((XGuides[xg] < (*x+doku->GuideRad)) && (XGuides[xg] > (*x-doku->GuideRad)))
{
if ((XGuides[xg] < (*x+doku->GuideRad)) && (XGuides[xg] > (*x-doku->GuideRad)))
{
*x = XGuides[xg];
break;
}
}
}
}
}
}
 
FPoint Page::ApplyGridF(FPoint in)
779,10 → 778,10
{
FPoint np;
if (doku->useRaster)
{
{
np.setX(qRound(in.x() / doku->minorGrid) * doku->minorGrid);
np.setY(qRound(in.y() / doku->minorGrid) * doku->minorGrid);
}
}
else
np = in;
return np;
803,10 → 802,10
 
void Page::RepaintTextRegion(PageItem *b, QRegion alt, bool single)
{
if (!isUpdatesEnabled())
return;
QPainter p;
QRegion neu;
if (!isUpdatesEnabled())
return;
p.begin(this);
Transform(b, &p);
neu = QRegion(p.xForm(QRect(0, 0, static_cast<int>(b->Width+1), static_cast<int>(b->Height+1)))).unite(alt);
818,7 → 817,7
g.setWidth(g.width()+static_cast<int>(QMAX(10.0, b->Pwidth / 2.0)));
g.setHeight(g.height()+static_cast<int>(QMAX(10.0, b->Pwidth / 2.0)));
if (single)
{
{
QRect rd = ViewReg().boundingRect().intersect(g);
if ((rd.width() < 1) || (rd.height() < 1))
return;
842,17 → 841,17
if ((doku->EditClip) && (b->Select))
MarkClip(b);
if (GroupSel)
{
{
setGroupRect();
paintGroupRect();
}
}
delete painter;
}
}
else
{
{
neu = QRegion(g);
update(neu.intersect(ViewReg()).boundingRect());
}
}
}
 
void Page::AdjustPreview(PageItem *b)
860,11 → 859,11
int neww, newh, fho, fvo;
bool savF;
if ((b->LocalViewX < 1.0) || (b->LocalViewY < 1.0))
{
if ((b->Pfile != "") && (b->PicAvail))
{
if ((b->Pfile != "") && (b->PicAvail))
if (!b->Sizing)
{
if (!b->Sizing)
{
fho = b->flippedH;
fvo = b->flippedV;
savF = b->PicArt;
872,22 → 871,20
b->flippedH = fho;
b->flippedV = fvo;
b->PicArt = savF;
}
}
neww = qRound(b->pixm.width() * b->LocalViewX);
newh = qRound(b->pixm.height() * b->LocalViewY);
b->pixm = b->pixm.smoothScale(neww, newh);
b->LocalViewX = 1;
b->LocalViewY = 1;
}
}
}
}
 
void Page::AdjustPictScale(PageItem *b)
{
int fho, fvo;
bool savF;
if (b->ScaleType)
return;
bool savF;
b->LocalX = 0;
b->LocalY = 0;
if ((b->OrigW == 0) || (b->OrigH == 0))
895,29 → 892,28
double xs = b->Width / static_cast<double>(b->OrigW);
double ys = b->Height / static_cast<double>(b->OrigH);
if (!b->Sizing)
{
fho = b->flippedH;
fvo = b->flippedV;
{
int fho = b->flippedH, fvo = b->flippedV;
savF = b->PicArt;
LoadPict(b->Pfile, b->ItemNr);
b->flippedH = fho;
b->flippedV = fvo;
b->PicArt = savF;
}
}
if (b->AspectRatio)
{
{
b->LocalScX = QMIN(xs, ys);
b->LocalScY = QMIN(xs, ys);
b->LocalViewX = QMIN(xs, ys);
b->LocalViewY = QMIN(xs, ys);
}
}
else
{
{
b->LocalScX = xs;
b->LocalScY = ys;
b->LocalViewX = xs;
b->LocalViewY = ys;
}
}
emit SetLocalValues(b->LocalScX, b->LocalScY, b->LocalX, b->LocalY );
}
 
931,7 → 927,7
alt = QRegion(p.xForm(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))));
p.end();
if (b->PType == 5)
{
{
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
946,11 → 942,11
emit ItemPos(b->Xpos, b->Ypos);
emit ItemGeom(b->Width, b->Height);
emit SetAngle(b->Rot);
}
}
else
{
if (b->Rot != 0)
{
if (b->Rot != 0)
{
FPoint npv = FPoint(newX.x(), newX.y());
QWMatrix ma3;
ma3.translate(b->Xpos, b->Ypos);
959,13 → 955,13
double myc3 = b->Ypos - (ma3.m22() * npv.y() + ma3.m12() * npv.x() + ma3.dy());
SizeItem(b->Width - newY.x(), b->Height - newY.y(), ite);
MoveItem(-mxc3, -myc3, b);
}
}
else
{
{
SizeItem(b->Width - newY.x(), b->Height - newY.y(), ite);
MoveItem(newX.x(), newX.y(), b);
}
}
}
return true;
}
 
973,15 → 969,17
{
int ph = static_cast<int>(QMAX(1.0, b->Pwidth / 2.0));
switch (b->PType)
{
{
case 5:
b->Clip.setPoints(4, -ph,-ph, static_cast<int>(b->Width+ph),-ph, static_cast<int>(b->Width+ph),static_cast<int>(b->Height+ph), -ph,static_cast<int>(b->Height+ph));
b->Clip.setPoints(4, -ph,-ph, static_cast<int>(b->Width+ph),-ph,
static_cast<int>(b->Width+ph),static_cast<int>(b->Height+ph),
-ph,static_cast<int>(b->Height+ph));
break;
default:
if (!b->ClipEdited)
{
switch (b->FrameType)
{
switch (b->FrameType)
{
case 0:
SetRectFrame(b);
break;
991,16 → 989,16
case 2:
SetFrameRound(b);
break;
}
}
b->OldB2 = b->Width;
b->OldH2 = b->Height;
}
}
else
{
if (doku->SubMode != -1)
{
if (doku->SubMode != -1)
switch (doku->SubMode)
{
switch (doku->SubMode)
{
case 0:
SetRectFrame(b);
break;
1010,10 → 1008,10
default:
SetFrameShape(b, doku->ValCount, doku->ShapeValues);
break;
}
}
b->OldB2 = b->Width;
b->OldH2 = b->Height;
}
}
if ((b->OldB2 == 0) || (b->OldH2 == 0))
return;
double scx = b->Width / b->OldB2;
1027,23 → 1025,23
b->Clip = FlattenPath(b->PoLine, b->Segments);
b->OldB2 = b->Width;
b->OldH2 = b->Height;
}
}
break;
}
}
}
 
bool Page::SizeItem(double newX, double newY, int ite, bool fromMP, bool DoUpdateClip)
{
QRegion alt, neu;
QPainter p;
PageItem *b = Items.at(ite);
if (b->Locked)
return false;
QRegion alt, neu;
QPainter p;
if (b->PType != 5)
{
{
newX = QMAX(newX, 1);
newY = QMAX(newY, 1);
}
}
int ph = static_cast<int>(QMAX(1.0, b->Pwidth / 2.0));
p.begin(this);
Transform(b, &p);
1056,9 → 1054,9
b->Width = newX;
b->Height = newY;
if ((doku->RotMode != 0) && (fromMP))
{
switch (doku->RotMode)
{
switch (doku->RotMode)
{
case 2:
MoveItem(dX / 2.0, dY / 2.0, b);
break;
1071,27 → 1069,29
case 1:
MoveItem(dX, 0.0, b);
break;
}
}
b->RadRect = QMIN(b->RadRect, QMIN(b->Width,b->Height)/2);
}
b->RadRect = QMIN(b->RadRect, QMIN(b->Width,b->Height)/2);
if ((b->PType == 2) && (!b->Sizing) && (!doku->EditClip))
{
{
AdjustPictScale(b);
AdjustPreview(b);
}
}
if (b->PType == 5)
{
if (!fromMP)
{
if (!fromMP)
{
b->Rot = atan2(b->Height,b->Width)*(180.0/3.1415927);
b->Width = sqrt(pow(b->Width,2)+pow(b->Height,2));
b->Height = 0;
emit SetAngle(b->Rot);
}
b->Clip.setPoints(4, -ph,-ph, static_cast<int>(b->Width+ph),-ph, static_cast<int>(b->Width+ph),static_cast<int>(b->Height+ph), -ph,static_cast<int>(b->Height+ph));
}
b->Clip.setPoints(4, -ph,-ph, static_cast<int>(b->Width+ph),-ph,
static_cast<int>(b->Width+ph),static_cast<int>(b->Height+ph),
-ph,static_cast<int>(b->Height+ph));
}
if (b->Sizing)
{
{
b->FrameOnly = true;
b->Tinput = true;
if ((HowTo == 1) && (b->PType != 5))
1099,38 → 1099,38
emit ItemGeom(b->Width, b->Height);
emit ItemRadius(b->RadRect);
return true;
}
}
if (DoUpdateClip)
{
if (fromMP)
{
if (fromMP)
{
if (b->flippedH % 2 != 0)
MoveItemI(-(b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
if (b->flippedV % 2 != 0)
MoveItemI(0, -(b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
}
}
else
{
{
if (b->flippedH % 2 == 0)
MoveItemI((b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
if (b->flippedV % 2 == 0)
MoveItemI(0, (b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
}
}
UpdateClip(b);
}
}
RepaintTextRegion(b, alt);
if (!fromMP)
{
if (GroupSel)
{
if (GroupSel)
{
double gx, gy, gh, gw;
setGroupRect();
getGroupRect(&gx, &gy, &gw, &gh);
emit ItemGeom(gw, gh);
}
}
else
emit ItemGeom(b->Width, b->Height);
}
}
emit ItemRadius(b->RadRect);
return true;
}
1137,12 → 1137,10
 
void Page::MoveItemI(double newX, double newY, int ite)
{
QPainter p;
PageItem *b = Items.at(ite);
if (b->Locked)
if ((b->Locked) || (!b->ScaleType))
return;
if (!b->ScaleType)
return;
QPainter p;
p.begin(this);
Transform(b, &p);
TransformM(b, &p);
1162,27 → 1160,27
 
bool Page::MoveItem(double newX, double newY, PageItem* b, bool fromMP)
{
if (b->Locked)
return false;
QRegion alt;
bool retw = false;
if (b->Locked)
return false;
double oldx = b->Xpos;
double oldy = b->Ypos;
if (!Imoved)
{
{
QPainter p;
p.begin(this);
Transform(b, &p);
alt = QRegion(p.xForm(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))));
p.end();
}
}
b->Xpos += newX;
b->Ypos += newY;
if ((doku->useRaster) && (!Imoved))
{
{
b->Xpos = qRound(b->Xpos / doku->minorGrid) * doku->minorGrid;
b->Ypos = qRound(b->Ypos / doku->minorGrid) * doku->minorGrid;
}
}
if ((doku->SnapGuides) && (!Imoved) && (doku->AppMode == 1) && (!doku->EditClip))
SnapToGuides(b);
if ((b->Xpos != oldx) || (b->Ypos != oldy))
1190,17 → 1188,17
if ((!Imoved) && (!b->Sizing))
RepaintTextRegion(b, alt);
if (!fromMP)
{
if (GroupSel)
{
if (GroupSel)
{
double gx, gy, gh, gw;
setGroupRect();
getGroupRect(&gx, &gy, &gw, &gh);
emit ItemPos(gx, gy);
}
}
else
emit ItemPos(b->Xpos, b->Ypos);
}
}
if (!doku->loading)
emit UpdtObj(PageNr, b->ItemNr);
return retw;
1216,35 → 1214,37
ma.translate(RCenter.x(), RCenter.y());
ma.scale(1, 1);
ma.rotate(win);
QRect alt = QRect(static_cast<int>(gxS-5), static_cast<int>(gyS-5), static_cast<int>(gwS+10), static_cast<int>(ghS+10));
QRect alt = QRect(static_cast<int>(gxS-5), static_cast<int>(gyS-5), static_cast<int>(gwS+10),
static_cast<int>(ghS+10));
for (uint a = 0; a < SelItem.count(); ++a)
{
{
b = SelItem.at(a);
n = FPoint(b->Xpos - RCenter.x(), b->Ypos - RCenter.y());
b->Xpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
b->Ypos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
b->Rot += win;
}
}
setGroupRect();
getGroupRectScreen(&gxS, &gyS, &gwS, &ghS);
repaint(QRect(static_cast<int>(gxS-5), static_cast<int>(gyS-5), static_cast<int>(gwS+10), static_cast<int>(ghS+10)).unite(alt));
repaint(QRect(static_cast<int>(gxS-5), static_cast<int>(gyS-5), static_cast<int>(gwS+10),
static_cast<int>(ghS+10)).unite(alt));
}
 
void Page::RotateItem(double win, int ite)
{
QRegion alt, neu;
QPainter p;
PageItem *b;
FPoint n;
b = Items.at(ite);
if (b->Locked)
return;
QRegion alt, neu;
QPainter p;
FPoint n;
p.begin(this);
Transform(b, &p);
alt = QRegion(p.xForm(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))));
p.end();
if ((doku->RotMode != 0) && (b->PType != 5))
{
{
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.scale(1, 1);
1252,7 → 1252,7
double ro = win-b->Rot;
b->Rot = win;
switch (doku->RotMode)
{
{
case 2:
ma.translate(b->Width/2, b->Height/2);
n = FPoint(-b->Width/2, -b->Height/2);
1269,12 → 1269,12
ma.translate(b->Width, 0);
n = FPoint(-b->Width, 0);
break;
}
}
ma.rotate(ro);
double x = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
double y = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
MoveItem(x-b->Xpos, y-b->Ypos, b);
}
}
else
b->Rot = win;
RepaintTextRegion(b, alt);
1284,67 → 1284,69
void Page::SnapToGuides(PageItem* b)
{
if (YGuides.count() != 0)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
if ((YGuides[yg] < (b->Ypos+doku->GuideRad)) && (YGuides[yg] > (b->Ypos-doku->GuideRad)))
{
if ((YGuides[yg] < (b->Ypos+doku->GuideRad)) && (YGuides[yg] > (b->Ypos-doku->GuideRad)))
{
b->Ypos = YGuides[yg];
break;
}
}
if (b->PType == 5)
{
{
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
double my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
if ((YGuides[yg] < (my+doku->GuideRad)) && (YGuides[yg] > (my-doku->GuideRad)))
{
{
b->Ypos = b->Ypos + YGuides[yg] - my;
break;
}
}
}
else
{
if ((YGuides[yg] < (b->Ypos+b->Height+doku->GuideRad)) &&
(YGuides[yg] > ((b->Ypos+b->Height)-doku->GuideRad)))
{
if ((YGuides[yg] < (b->Ypos+b->Height+doku->GuideRad)) && (YGuides[yg] > ((b->Ypos+b->Height)-doku->GuideRad)))
{
b->Ypos = YGuides[yg]-b->Height;
break;
}
}
}
}
}
if (XGuides.count() != 0)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
if ((XGuides[xg] < (b->Xpos+doku->GuideRad)) && (XGuides[xg] > (b->Xpos-doku->GuideRad)))
{
if ((XGuides[xg] < (b->Xpos+doku->GuideRad)) && (XGuides[xg] > (b->Xpos-doku->GuideRad)))
{
b->Xpos = XGuides[xg];
break;
}
}
if (b->PType == 5)
{
{
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
double mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
if ((XGuides[xg] < (mx+doku->GuideRad)) && (XGuides[xg] > (mx-doku->GuideRad)))
{
{
b->Xpos = b->Xpos + XGuides[xg] - mx;
break;
}
}
}
else
{
if ((XGuides[xg] < (b->Xpos+b->Width+doku->GuideRad)) &&
(XGuides[xg] > ((b->Xpos+b->Width)-doku->GuideRad)))
{
if ((XGuides[xg] < (b->Xpos+b->Width+doku->GuideRad)) && (XGuides[xg] > ((b->Xpos+b->Width)-doku->GuideRad)))
{
b->Xpos = XGuides[xg]-b->Width;
break;
}
}
}
}
}
}
 
void Page::sentToScrap()
1358,16 → 1360,16
{
int d = pmen3->indexOf(id);
int dd = doku->Layers[d].LNr;
if (SelItem.count() != 0)
if (SelItem.count() != 0)
{
for (uint a = 0; a < SelItem.count(); ++a)
for (uint a = 0; a < SelItem.count(); ++a)
{
PageItem *b = SelItem.at(a);
b->LayerNr = dd;
}
}
}
Deselect(true);
update();
update();
}
 
bool Page::PointOnLine(QPoint Start, QPoint Ende, QRect MArea)
1374,57 → 1376,33
{
QPoint an, en;
if (Start.x() == Ende.x())
{
an = Start.y() > Ende.y() ? Ende : Start;
en = an == Ende ? Start : Ende;
for (int a=an.y(); a<en.y(); ++a)
{
if (Start.y() > Ende.y())
{
an = Ende;
en = Start;
}
else
{
en = Ende;
an = Start;
}
for (int a=an.y(); a<en.y(); ++a)
{
if (MArea.contains(QPoint(an.x(), a)))
return true;
}
}
}
if (Start.y() == Ende.y())
{
an = Start.x() > Ende.x() ? Ende : Start;
en = an == Ende ? Start : Ende;
for (int a=an.x(); a<en.x(); ++a)
{
if (Start.x() > Ende.x())
{
an = Ende;
en = Start;
}
else
{
en = Ende;
an = Start;
}
for (int a=an.x(); a<en.x(); ++a)
{
if (MArea.contains(QPoint(a, an.y())))
return true;
}
}
if (Start.x() > Ende.x())
{
an = Ende;
en = Start;
}
else
{
en = Ende;
an = Start;
}
}
an = Start.x() > Ende.x() ? Ende : Start;
en = an == Ende ? Start : Ende;
double stg = (en.y() - an.y()) / static_cast<double>((en.x() - an.x()));
for (int a = an.x(); a < en.x(); ++a)
{
{
if (MArea.contains(QPoint(a, an.y()+qRound((a-an.x())*stg))))
return true;
}
}
return false;
}
 
1446,10 → 1424,10
SizeItem(b->Width - tp2.x(), b->Height - tp2.y(), b->ItemNr, false, false);
Clip.translate(-tp2.x(), -tp2.y());
if (b->Rot != 0)
{
{
FPoint npv = FPoint(tp2.x(), tp2.y());
MoveRotated(b, npv);
}
}
else
MoveItem(tp2.x(), tp2.y(), b);
if (b->flippedH % 2 == 0)
1509,7 → 1487,7
double offsY = b->Height / 2.0;
ma.translate(-offsX, -offsY);
switch (mode)
{
{
case 0:
ma.rotate(-1.0);
break;
1534,7 → 1512,7
case 7:
ma.shear(0, 0.017455);
break;
}
}
b->PoLine.map(ma);
b->PoLine.translate(offsX, offsY);
AdjustItemSize(b);
1544,7 → 1522,7
ma2.translate(offsX, offsY);
FPoint n = FPoint(-offsX, -offsY);
switch (mode)
{
{
case 0:
ma2.rotate(-1.0);
break;
1569,7 → 1547,7
case 7:
ma2.shear(0, 0.017455);
break;
}
}
double x = ma2.m11() * n.x() + ma2.m21() * n.y() + ma2.dx();
double y = ma2.m22() * n.y() + ma2.m12() * n.x() + ma2.dy();
MoveItem(x-oldPos.x(), y-oldPos.y(), b);
1600,13 → 1578,10
if ((ClRe == 0) || (ClRe == static_cast<int>(b->PoLine.size()-2)))
b->PoLine.setPoint(ClRe+1, np);
else
{
{
b->PoLine.setPoint(ClRe+1, np);
if (ClRe % 4 != 0)
b->PoLine.setPoint(ClRe+3, np);
else
b->PoLine.setPoint(ClRe-1, np);
}
b->PoLine.setPoint((ClRe % 4 != 0 ? ClRe + 3 : ClRe - 1), np);
}
AdjustItemSize(b);
MarkClip(b);
}
1613,48 → 1588,46
 
void Page::MoveClipPoint(PageItem *b, FPoint ip)
{
if (((EdPoints) && (ClRe % 2 != 0)) || ((!EdPoints) && (ClRe % 2 == 0)))
return;
FPointArray Clip;
Clip = b->PoLine;
b->FrameType = 3;
if ((EdPoints) && (ClRe % 2 != 0))
return;
if ((!EdPoints) && (ClRe % 2 == 0))
return;
uint EndInd = Clip.size();
uint StartInd = 0;
for (uint n = ClRe; n < Clip.size(); n++)
for (uint n = ClRe; n < Clip.size(); ++n)
{
if (Clip.point(n).x() > 900000)
{
if (Clip.point(n).x() > 900000)
{
EndInd = n;
break;
}
}
}
if (ClRe > 0)
{
for (uint n2 = ClRe; n2 > 0; n2--)
{
for (uint n2 = ClRe; n2 > 0; n2--)
{
if (n2 == 0)
break;
if (Clip.point(n2).x() > 900000)
{
{
StartInd = n2 + 1;
break;
}
}
}
}
// FPoint np = ApplyGridF(ip);
FPoint np = ip;
if (ClRe != -1)
{
if (np.x() < 0)
{
if (np.x() < 0)
{
SizeItem(b->Width - np.x(), b->Height, b->ItemNr, false, false);
if (b->Rot != 0)
{
{
FPoint npv = FPoint(np.x(), 0);
MoveRotated(b, npv);
}
}
else
MoveItem(np.x(), 0, b);
Clip.translate(-np.x(), 0);
1661,15 → 1634,15
if (b->flippedH % 2 == 0)
MoveItemI(-np.x()/b->LocalScX, 0, b->ItemNr);
np.setX(0);
}
}
if (np.y() < 0)
{
{
SizeItem(b->Width, b->Height - np.y(), b->ItemNr, false, false);
if (b->Rot != 0)
{
{
FPoint npv = FPoint(0, np.y());
MoveRotated(b, npv);
}
}
else
MoveItem(0, np.y(), b);
Clip.translate(0, -np.y());
1676,19 → 1649,20
if (b->flippedV % 2 == 0)
MoveItemI(0, -np.y()/b->LocalScY, b->ItemNr);
np.setY(0);
}
}
emit ClipPo(np.x(), np.y());
if ((ClRe+1 < static_cast<int>(EndInd)) && (ClRe % 2 == 0))
{
{
FPoint ap = Clip.point(ClRe);
FPoint ap2 = Clip.point(ClRe+1);
ap2.setX(ap2.x() - (ap.x() - np.x()));
ap2.setY(ap2.y() - (ap.y() - np.y()));
Clip.setPoint(ClRe+1, ap2);
}
}
Clip.setPoint(ClRe, np);
if (((ClRe % 4 != 0) && (ClRe % 2 == 0)) && (ClRe+3 < static_cast<int>(EndInd)) && (ClRe != static_cast<int>(StartInd)))
{
if (((ClRe % 4 != 0) && (ClRe % 2 == 0)) && (ClRe+3 < static_cast<int>(EndInd)) &&
(ClRe != static_cast<int>(StartInd)))
{
FPoint ap = Clip.point(ClRe+2);
FPoint ap2 = Clip.point(ClRe+3);
ap2.setX(ap2.x() - (ap.x() - np.x()));
1695,9 → 1669,9
ap2.setY(ap2.y() - (ap.y() - np.y()));
Clip.setPoint(ClRe+3, ap2);
Clip.setPoint(ClRe+2, np);
}
}
if ((ClRe % 4 == 0) && (ClRe+3 < static_cast<int>(EndInd)) && (ClRe != static_cast<int>(StartInd)))
{
{
FPoint ap = Clip.point(ClRe-2);
FPoint ap2 = Clip.point(ClRe-1);
ap2.setX(ap2.x() - (ap.x() - np.x()));
1704,11 → 1678,12
ap2.setY(ap2.y() - (ap.y() - np.y()));
Clip.setPoint(ClRe-1, ap2);
Clip.setPoint(ClRe-2, np);
}
if (((ClRe == static_cast<int>(StartInd)) || (ClRe == static_cast<int>(EndInd-2))) && ((b->PType == 6) || (b->PType == 4) || (b->PType == 2)))
}
if (((ClRe == static_cast<int>(StartInd)) || (ClRe == static_cast<int>(EndInd-2))) &&
((b->PType == 6) || (b->PType == 4) || (b->PType == 2)))
{
if (ClRe == static_cast<int>(StartInd))
{
if (ClRe == static_cast<int>(StartInd))
{
FPoint ap = Clip.point(EndInd-2);
FPoint ap2 = Clip.point(EndInd-1);
ap2.setX(ap2.x() - (ap.x() - np.x()));
1715,9 → 1690,9
ap2.setY(ap2.y() - (ap.y() - np.y()));
Clip.setPoint(EndInd-2, Clip.point(StartInd));
Clip.setPoint(EndInd-1, ap2);
}
}
else
{
{
FPoint ap = Clip.point(StartInd);
FPoint ap2 = Clip.point(StartInd + 1);
ap2.setX(ap2.x() - (ap.x() - np.x()));
1724,10 → 1699,11
ap2.setY(ap2.y() - (ap.y() - np.y()));
Clip.setPoint(StartInd, Clip.point(EndInd-2));
Clip.setPoint(StartInd + 1, ap2);
}
}
if (((ClRe == static_cast<int>(StartInd+1)) || (ClRe == static_cast<int>(EndInd-1))) && ((b->PType == 6) || (b->PType == 4) || (b->PType == 2)) && (MoveSym))
{
}
if (((ClRe == static_cast<int>(StartInd+1)) || (ClRe == static_cast<int>(EndInd-1))) &&
((b->PType == 6) || (b->PType == 4) || (b->PType == 2)) && (MoveSym))
{
uint kon = 0;
if (ClRe == static_cast<int>(StartInd+1))
kon = EndInd-1;
1740,9 → 1716,10
lk.setX(lk.x() + dx*2);
lk.setY(lk.y() + dy*2);
Clip.setPoint(kon, lk);
}
if ((ClRe % 2 != 0) && (MoveSym) && (ClRe != static_cast<int>(StartInd + 1)) && (ClRe != static_cast<int>(EndInd-1)))
{
}
if ((ClRe % 2 != 0) && (MoveSym) && (ClRe != static_cast<int>(StartInd + 1)) &&
(ClRe != static_cast<int>(EndInd-1)))
{
uint kon = 0;
if ((ClRe+1) % 4 == 0)
kon = ClRe + 2;
1755,30 → 1732,31
lk.setX(lk.x() + dx*2);
lk.setY(lk.y() + dy*2);
Clip.setPoint(kon, lk);
}
}
b->PoLine = Clip.copy();
b->Clip = FlattenPath(b->PoLine, b->Segments);
AdjustItemSize(b);
// emit DocChanged();
}
}
}
void Page::ConvertClip(PageItem *b)
{
if (b->Clip.count() != 0)
{
{
FPoint np = FPoint(b->Clip.point(0));
b->PoLine.resize(2);
b->PoLine.setPoint(0, np);
b->PoLine.setPoint(1, np);
for (uint a = 1; a < b->Clip.size(); ++a)
{
{
np = FPoint(b->Clip.point(a));
b->PoLine.putPoints(b->PoLine.size(), 4, np.x(), np.y(), np.x(), np.y(), np.x(), np.y(), np.x(), np.y());
}
b->PoLine.putPoints(b->PoLine.size(), 4, np.x(), np.y(), np.x(), np.y(), np.x(), np.y(),
np.x(), np.y());
}
np = FPoint(b->Clip.point(0));
b->PoLine.putPoints(b->PoLine.size(), 2, np.x(), np.y(), np.x(), np.y());
b->Clip = FlattenPath(b->PoLine, b->Segments);
}
}
else
SetRectFrame(b);
}
1788,32 → 1766,25
m->accept();
Mpressed = false;
if ((GroupSel) || (doku->AppMode != 1) || (doku->EditClip))
{
{
mousePressEvent(m);
return;
}
}
PageItem *b = 0;
if (GetItem(&b))
{
if ((b->PType == 6) || (b->PType == 7) || (b->PType == 2) || (b->PType == 8))
{
if ((b->PType == 6) || (b->PType == 7) || (b->PType == 2) || (b->PType == 8))
if ((b->Locked) || (!b->ScaleType))
{
if ((b->Locked) || (!b->ScaleType))
{
mousePressEvent(m);
return;
}
}
emit Amode(7);
}
}
else
{
if (b->PType == 4)
{
if (b->isAnnotation)
emit AnnotProps();
else
emit Amode(7);
}
}
emit b->isAnnotation ? AnnotProps() : Amode(7);
}
}
 
1847,7 → 1818,7
uint aa;
getGroupRect(&gx, &gy, &gw, &gh);
for (uint a = 0; a < SelItem.count(); ++a)
{
{
bb = SelItem.at(a);
bb->OldB = bb->Width;
bb->OldH = bb->Height;
1857,7 → 1828,7
FPoint b, b1, t, t1, h, h1, g, tes, tes2;
double oldRot;
switch (HowTo)
{
{
case 1:
oldRot = bb->Rot;
g = FPoint(gx, gy);
1872,25 → 1843,23
h1 = transformPoint(h, 0, 0, 0, scx, scy);
bb->Pwidth = QMAX(bb->Pwidth*((scx+scy)/2), 0.01);
MoveItem(b1.x()-b.x(), b1.y()-b.y(), bb);
SizeItem(sqrt(pow(t1.x()-b1.x(),2)+pow(t1.y()-b1.y(),2)), sqrt(pow(h1.x()-b1.x(),2)+pow(h1.y()-b1.y(),2)), bb->ItemNr, true);
SizeItem(sqrt(pow(t1.x()-b1.x(),2)+pow(t1.y()-b1.y(),2)),
sqrt(pow(h1.x()-b1.x(),2)+pow(h1.y()-b1.y(),2)), bb->ItemNr, true);
if (bb->Rot != 0)
bb->Rot = atan2(t1.y()-b1.y(),t1.x()-b1.x())*(180.0/M_PI);
bb->ISize = QMAX(qRound(bb->ISize*((scx+scy)/2)), 1);
if (bb->Ptext.count() != 0)
{
bb->LineSp = ((bb->ISize / 10.0) * static_cast<double>(doku->AutoLine) / 100) + (bb->ISize / 10.0);
{
bb->LineSp = ((bb->ISize / 10.0) * static_cast<double>(doku->AutoLine) / 100) +
(bb->ISize / 10.0);
for (aa = 0; aa < bb->Ptext.count(); ++aa)
{
bb->Ptext.at(aa)->csize = QMAX(qRound(bb->Ptext.at(aa)->csize*((scx+scy)/2)), 1);
}
if (bb->PType == 8)
{
UpdatePolyClip(bb);
}
}
}
break;
}
}
}
setGroupRect();
update();
emit DocChanged();
1909,42 → 1878,42
PageItem *b;
Mpressed = false;
if (doku->Guides)
{
{
bool fg = false;
double nx = m->x()/doku->Scale;
double ny = m->y()/doku->Scale;
if (YGuides.count() != 0)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
if ((YGuides[yg] < (ny+doku->GrabRad)) && (YGuides[yg] > (ny-doku->GrabRad)))
{
if ((YGuides[yg] < (ny+doku->GrabRad)) && (YGuides[yg] > (ny-doku->GrabRad)))
{
fg = true;
break;
}
}
}
}
if (XGuides.count() != 0)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
if ((XGuides[xg] < (nx+doku->GrabRad)) && (XGuides[xg] > (nx-doku->GrabRad)))
{
if ((XGuides[xg] < (nx+doku->GrabRad)) && (XGuides[xg] > (nx-doku->GrabRad)))
{
fg = true;
break;
}
}
}
}
if ((fg) && (m->button() == RightButton))
{
{
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
MoveGY = false;
MoveGX = false;
emit EditGuides();
return;
}
}
if (MoveGY)
{
{
YGuides.remove(YGuides[GyM]);
SetYGuide(m);
MoveGY = false;
1951,9 → 1920,9
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
update();
return;
}
}
if (MoveGX)
{
{
XGuides.remove(XGuides[GxM]);
SetXGuide(m);
MoveGX = false;
1960,25 → 1929,25
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
update();
return;
}
}
}
if (doku->AppMode == 21)
{
{
doku->AppMode = 1;
if (RecordP.size() > 1)
{
{
uint z = PaintPolyLine(0, 0, 1, 1, doku->Dwidth, "None", doku->Dpen);
b = Items.at(z);
b->PoLine.resize(0);
b->PoLine.addPoint(RecordP.point(0));
b->PoLine.addPoint(RecordP.point(0));
for (uint px = 1; px < RecordP.size()-1; px++)
{
for (uint px = 1; px < RecordP.size()-1; ++px)
{
b->PoLine.addPoint(RecordP.point(px));
b->PoLine.addPoint(RecordP.point(px));
b->PoLine.addPoint(RecordP.point(px));
b->PoLine.addPoint(RecordP.point(px));
}
}
b->PoLine.addPoint(RecordP.point(RecordP.size()-1));
b->PoLine.addPoint(RecordP.point(RecordP.size()-1));
AdjustItemSize(b);
1992,38 → 1961,40
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
emit HaveSel(7);
}
}
update();
emit PaintingDone();
emit DocChanged();
return;
}
}
if ((doku->EditClip) && (ClRe == -1) && (HaveSelRect))
{
{
double sc = doku->Scale;
QPainter p;
p.begin(this);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)),
static_cast<int>(SeRy-(Myp*sc)));
p.end();
if((Mxp*sc) > SeRx)
if((Mxp*sc) > SeRx)
{
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
}
if((Myp*sc) > SeRy)
if((Myp*sc) > SeRy)
{
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
}
b = SelItem.at(0);
SelNode.clear();
QRect Sele = QRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
QRect Sele = QRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc),
static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
for (uint a = 0; a < b->PoLine.count(); ++a)
{
{
if (b->PoLine.point(a).x() > 900000)
continue;
p.begin(this);
2031,20 → 2002,20
QPoint npf = p.xForm(b->PoLine.pointQ(a));
p.end();
if ((Sele.contains(npf)) && ((a == 0) || (((a-2) % 4) == 0)))
{
{
ClRe = a;
SelNode.append(a);
emit ClipPo(b->PoLine.point(a).x(), b->PoLine.point(a).y());
}
}
}
HaveSelRect = false;
MarkClip(b);
return;
}
}
if ((doku->EditClip) && (SegP1 == -1) && (SegP2 == -1))
{
if (Imoved)
{
if (Imoved)
{
b = SelItem.at(0);
b->OldB2 = b->Width;
b->OldH2 = b->Height;
2056,12 → 2027,12
ApplyGuides(&nx, &ny);
FPoint np = transformPointI(FPoint(nx, ny), b->Xpos, b->Ypos, b->Rot, 1, 1);
MoveClipPoint(b, np);
}
}
Imoved = false;
return;
}
}
if ((doku->EditClip) && (SegP1 != -1) && (SegP2 != -1))
{
{
SegP1 = -1;
SegP2 = -1;
b = SelItem.at(0);
2069,37 → 2040,22
b->paintObj();
MarkClip(b);
return;
}
}
if ((!GetItem(&b)) && (m->button() == RightButton) && (!doku->DragP) && (doku->AppMode == 1))
{
{
QPopupMenu *pmen = new QPopupMenu();
if (ScApp->Buffer2.startsWith("<SCRIBUSELEM"))
{
{
Mxp = m->x();
Myp = m->y();
pmen->insertItem( tr("Paste") , this, SLOT(PasteToPage()));
pmen->insertSeparator();
}
if (doku->Marks)
pmen->insertItem( tr("Hide Margins"), ScApp, SLOT(ToggleMarks()));
else
pmen->insertItem( tr("Show Margins"), ScApp, SLOT(ToggleMarks()));
if (doku->ShFrames)
pmen->insertItem( tr("Hide Frames"), ScApp, SLOT(ToggleFrames()));
else
pmen->insertItem( tr("Show Frames"), ScApp, SLOT(ToggleFrames()));
if (doku->ShowPic)
pmen->insertItem( tr("Hide Images"), ScApp, SLOT(TogglePics()));
else
pmen->insertItem( tr("Show Images"), ScApp, SLOT(TogglePics()));
if (doku->Raster)
pmen->insertItem( tr("Hide Grid"), ScApp, SLOT(ToggleRaster()));
else
pmen->insertItem( tr("Show Grid"), ScApp, SLOT(ToggleRaster()));
if (doku->Guides)
pmen->insertItem( tr("Hide Guides"), ScApp, SLOT(ToggleGuides()));
else
pmen->insertItem( tr("Show Guides"), ScApp, SLOT(ToggleGuides()));
}
pmen->insertItem((doku->Marks ? tr("Hide Margins") : tr("Show Margins")), ScApp, SLOT(ToggleMarks()));
pmen->insertItem((doku->ShFrames ? tr("Hide Frames") : tr("Show Frames")), ScApp, SLOT(ToggleFrames()));
pmen->insertItem((doku->ShowPic ? tr("Hide Images") : tr("Show Images")), ScApp, SLOT(TogglePics()));
pmen->insertItem((doku->Raster ? tr("Hide Grid") : tr("Show Grid")), ScApp, SLOT(ToggleRaster()));
pmen->insertItem((doku->Guides ? tr("Hide Guides") : tr("Show Guides")), ScApp, SLOT(ToggleGuides()));
int uRas = pmen->insertItem( tr("Snap to Grid"), ScApp, SLOT(ToggleURaster()));
pmen->setItemChecked(uRas, doku->useRaster);
int uGuide = pmen->insertItem( tr("Snap to Guides"), ScApp, SLOT(ToggleUGuides()));
2107,11 → 2063,11
pmen->exec(QCursor::pos());
delete pmen;
return;
}
}
if ((doku->AppMode != 6) /* && (doku->AppMode != 7) */ && (!doku->EditClip) && (doku->AppMode != 13))
{
if ((GetItem(&b)) && (m->button() == RightButton) && (!doku->DragP))
{
if ((GetItem(&b)) && (m->button() == RightButton) && (!doku->DragP))
{
QPopupMenu *pmen = new QPopupMenu();
QPopupMenu *pmen2 = new QPopupMenu();
pmen3 = new QPopupMenu();
2119,7 → 2075,7
QPopupMenu *pmen4 = new QPopupMenu();
 
if ((b->PType == 4) || (b->PType == 2) || (b->PType == 8))
{
{
QButtonGroup *InfoGroup = new QButtonGroup( this, "InfoGroup" );
InfoGroup->setFrameShape( QButtonGroup::NoFrame );
InfoGroup->setFrameShadow( QButtonGroup::Plain );
2141,7 → 2097,7
QLabel *CharCT = new QLabel(InfoGroup, "ct");
QLabel *CharC = new QLabel(InfoGroup, "cc");
if (b->PType == 2)
{
{
QFileInfo fi = QFileInfo(b->Pfile);
InfoT->setText( tr("Picture"));
InfoGroupLayout->addMultiCellWidget( InfoT, 0, 0, 0, 1, Qt::AlignCenter );
2155,11 → 2111,12
InfoGroupLayout->addWidget( WordC, 2, 1 );
CharCT->setText( tr("Actual ppi: "));
InfoGroupLayout->addWidget( CharCT, 3, 0, Qt::AlignRight );
CharC->setText(txtC.setNum(qRound(72.0 / b->LocalScX))+" x "+txtC2.setNum(qRound(72.0 / b->LocalScY)));
CharC->setText(txtC.setNum(qRound(72.0 / b->LocalScX))+" x "+
txtC2.setNum(qRound(72.0 / b->LocalScY)));
InfoGroupLayout->addWidget( CharC, 3, 1 );
}
}
if ((b->PType == 4) || (b->PType == 8))
{
{
int Parag = 0;
int Words = 0;
int Chara = 0;
2167,12 → 2124,12
int WordsN = 0;
int CharaN = 0;
if (b->PType == 4)
{
{
if ((b->NextBox != 0) || (b->BackBox != 0))
InfoT->setText( tr("Linked Text"));
else
InfoT->setText( tr("Text Frame"));
}
}
else
InfoT->setText( tr("Text on a Path"));
InfoGroupLayout->addMultiCellWidget( InfoT, 0, 0, 0, 1, Qt::AlignCenter );
2198,41 → 2155,41
else
CharC->setText(txtC.setNum(Chara));
InfoGroupLayout->addWidget( CharC, 3, 1 );
}
}
 
pmen4->insertItem(InfoGroup);
 
pmen->insertItem( tr("Info"), pmen4);
}
}
if (b->PType == 2)
{
{
pmen->insertItem( tr("Get Picture..."), this, SIGNAL(LoadPic()));
int px = pmen->insertItem( tr("Image Visible"), this, SLOT(TogglePic()));
pmen->setItemChecked(px, b->PicArt);
}
}
if (b->PType == 4)
{
{
pmen->insertItem( tr("Get Text..."), this, SIGNAL(LoadPic()));
pmen->insertItem( tr("Edit Text..."), this, SIGNAL(EditText()));
if (PageNam == "")
{
{
int pxb = pmen->insertItem( tr("Is PDF-Bookmark"), this, SLOT(ToggleBookmark()));
pmen->setItemChecked(pxb, b->isBookmark);
pxb = pmen->insertItem( tr("Is PDF-Annotation"), this, SLOT(ToggleAnnotation()));
pmen->setItemChecked(pxb, b->isAnnotation);
if (b->isAnnotation)
{
{
if ((b->AnType == 0) || (b->AnType == 1) || (b->AnType > 9))
pmen->insertItem( tr("Annotation Properties"), this, SIGNAL(AnnotProps()));
else
pmen->insertItem( tr("Field Properties"), this, SIGNAL(AnnotProps()));
}
}
}
}
if (b->PType == 8)
pmen->insertItem( tr("Edit Text..."), this, SIGNAL(EditText()));
if (!b->Locked)
{
{
if (SelItem.count() > 1)
pmen->insertItem( tr("Group"), this, SIGNAL(DoGroup()));
if (b->Groups.count() != 0)
2242,42 → 2199,42
pmen->insertItem( tr("Bring to Front"), this, SLOT(ToFront()));
pmen->insertItem( tr("Lower"), this, SLOT(LowerItem()));
pmen->insertItem( tr("Raise"), this, SLOT(RaiseItem()));
}
}
else
pmen->insertItem( tr("Unlock"), this, SLOT(ToggleLock()));
pmen->insertItem( tr("Send to Scrapbook"), this, SLOT(sentToScrap()));
if (doku->Layers.count() > 1)
{
for (uint lam=0; lam < doku->Layers.count(); ++lam)
{
for (uint lam=0; lam < doku->Layers.count(); ++lam)
{
int lai = pmen3->insertItem(doku->Layers[lam].Name);
if (static_cast<int>(lam) == doku->ActiveLayer)
pmen3->setItemEnabled(lai, 0);
}
}
pmen->insertItem( tr("Send to Layer"), pmen3);
}
}
connect(pmen3, SIGNAL(activated(int)), this, SLOT(sentToLayer(int)));
if ((b->PType == 4) || (b->PType == 2) || (b->PType == 6))
{
if (b->PType == 4)
{
if (b->PType == 4)
{
pmen2->insertItem( tr("Picture Frame"), this, SLOT(ToPicFrame()));
pmen2->insertItem( tr("Polygon"), this, SLOT(ToPolyFrame()));
pmen2->insertItem( tr("Outlines"), this, SLOT(TextToPath()));
}
}
if (b->PType == 2)
{
{
pmen2->insertItem( tr("Text Frame"), this, SLOT(ToTextFrame()));
pmen2->insertItem( tr("Polygon"), this, SLOT(ToPolyFrame()));
}
}
if (b->PType == 6)
{
{
pmen2->insertItem( tr("Text Frame"), this, SLOT(ToTextFrame()));
pmen2->insertItem( tr("Picture Frame"), this, SLOT(ToPicFrame()));
pmen2->insertItem( tr("Bezier Curve"), this, SLOT(ToBezierFrame()));
}
}
pmen->insertItem( tr("Convert to"), pmen2);
}
}
if (!ScApp->Mpal->isVisible())
pmen->insertItem( tr("Show Properties..."), ScApp, SLOT(ToggleMpal()));
else
2296,11 → 2253,11
disconnect(pmen3, SIGNAL(activated(int)), this, SLOT(sentToLayer(int)));
delete pmen3;
delete pmen4;
}
}
if (doku->AppMode == 10)
update();
if (doku->AppMode == 12)
{
{
b = SelItem.at(0);
QPainter p;
FPointArray cli;
2349,13 → 2306,13
b->Sizing = false;
UpdateClip(b);
update();
}
}
if (GetItem(&b))
{
if (GroupSel)
{
if (GroupSel)
if (mCG)
{
if (mCG)
{
double gx, gy, gh, gw, mx, my, scx, scy;
mx = Mxp;
my = Myp;
2366,52 → 2323,48
doku->RotMode = 0;
scaleGroup(scx, scy);
doku->RotMode = RotMode;
}
}
}
else
{
if (b->Sizing)
{
if (b->Sizing)
{
FPoint npx;
double nx = m->pos().x()/doku->Scale;
double ny = m->pos().y()/doku->Scale;
if (doku->SnapGuides)
{
{
ApplyGuides(&nx, &ny);
npx = transformPointI(FPoint(nx, ny), b->Xpos, b->Ypos, b->Rot, 1, 1);
}
}
else
{
npx = ApplyGridF(transformPointI(FPoint(nx, ny), b->Xpos, b->Ypos, b->Rot, 1, 1));
}
if ((HowTo == 1) && (b->PType != 5) && (doku->SnapGuides))
{
SizeItem(npx.x(), npx.y(), b->ItemNr);
}
bool sav = doku->SnapGuides;
doku->SnapGuides = false;
switch (HowTo)
{
{
case 1:
if (b->PType != 5)
{
{
if (b->flippedH % 2 != 0)
MoveItemI(-(b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
if (b->flippedV % 2 != 0)
MoveItemI(0, -(b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
}
}
else
{
if (sav)
{
if (sav)
{
double nx = m->pos().x()/doku->Scale;
double ny = m->pos().y()/doku->Scale;
if (doku->useRaster)
{
{
FPoint ra = ApplyGridF(FPoint(nx, ny));
nx = ra.x();
ny = ra.y();
}
}
doku->SnapGuides = sav;
ApplyGuides(&nx, &ny);
doku->SnapGuides = false;
2419,13 → 2372,13
RotateItem(r, b->ItemNr);
double w = sqrt(pow(nx - b->Xpos, 2) + pow(ny - b->Ypos,2));
SizeItem(w, b->Height, b->ItemNr, true);
}
}
}
b->Sizing = false;
break;
case 2:
if (b->PType != 5)
{
{
MoveSizeItem(npx, npx, b->ItemNr);
b->Sizing = false;
if (b->flippedH % 2 == 0)
2432,19 → 2385,19
MoveItemI((b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
if (b->flippedV % 2 == 0)
MoveItemI(0, (b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
}
}
else
{
if (sav)
{
if (sav)
{
double nx = m->pos().x()/doku->Scale;
double ny = m->pos().y()/doku->Scale;
if (doku->useRaster)
{
{
FPoint ra = ApplyGridF(FPoint(nx, ny));
nx = ra.x();
ny = ra.y();
}
}
doku->SnapGuides = sav;
ApplyGuides(&nx, &ny);
doku->SnapGuides = false;
2459,8 → 2412,8
SizeItem(w, b->Height, b->ItemNr, true);
RotateItem(r, b->ItemNr);
b->Sizing = false;
}
}
}
break;
case 3:
MoveSizeItem(FPoint(0, npx.y()), FPoint(b->Width - npx.x(), npx.y()), b->ItemNr);
2506,19 → 2459,17
if (b->flippedV % 2 == 0)
MoveItemI(0, (b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
break;
}
}
if ((b->PType == 4) && (m->state() & ShiftButton) && (m->state() & ControlButton))
{
{
double scx = b->Width / b->OldB2;
double scy = b->Height / b->OldH2;
if (scx != scy)
scx = scx / scy;
else
scx = 1.0;
scx = scx != scy ? scx / scy : 1.0;
if (b->Ptext.count() != 0)
{
{
b->ISize = QMAX(qRound(b->ISize * scy), 1);
b->LineSp = ((b->ISize / 10.0)* static_cast<double>(doku->AutoLine) / 100) + (b->ISize / 10.0);
b->LineSp = ((b->ISize / 10.0)* static_cast<double>(doku->AutoLine) / 100) +
(b->ISize / 10.0);
b->TxtScale = QMIN(QMAX(qRound(b->TxtScale * scx), 25), 400);
doku->CurrTextScale = b->TxtScale;
doku->CurrFontSize = b->ISize;
2527,66 → 2478,68
emit ItemTextSize(b->ISize);
emit ItemTextSca(b->TxtScale);
for (uint aa = 0; aa < b->Ptext.count(); ++aa)
{
{
b->Ptext.at(aa)->csize = QMAX(qRound(b->Ptext.at(aa)->csize*scy), 1);
b->Ptext.at(aa)->cscale = QMAX(QMIN(qRound(b->Ptext.at(aa)->cscale*scx), 400), 25);
}
}
}
}
if (b->PType == 2)
{
{
AdjustPictScale(b);
AdjustPreview(b);
}
}
UpdateClip(b);
emit ItemTextCols(b->Cols, b->ColGap);
doku->SnapGuides = sav;
update();
emit DocChanged();
}
}
}
if (Imoved)
{
{
b = SelItem.at(0);
if (b->PType != 5)
{
{
if (fabs(b->Width) < 5)
b->Width = 5;
if (fabs(b->Height) < 5)
b->Height = 5;
}
}
Imoved = false;
MoveItem(0, 0, b, false);
update();
emit DocChanged();
}
}
}
if ((SelItem.count() == 0) && (HaveSelRect) && (!MidButt))
{
{
double sc = doku->Scale;
QPainter p;
p.begin(this);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)),
static_cast<int>(SeRy-(Myp*sc)));
p.end();
if((Mxp*sc) > SeRx)
if((Mxp*sc) > SeRx)
{
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
}
if((Myp*sc) > SeRy)
if((Myp*sc) > SeRy)
{
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
}
QRect Sele = QRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
QRect Sele = QRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc),
static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
if (Items.count() != 0)
{
for (uint a = 0; a < Items.count(); ++a)
{
for (uint a = 0; a < Items.count(); ++a)
{
p.begin(this);
Transform(Items.at(a), &p);
QRegion apr = QRegion(p.xForm(Items.at(a)->Clip));
2593,22 → 2546,22
p.end();
if ((Sele.contains(apr.boundingRect())) && (Items.at(a)->LayerNr == doku->ActiveLayer))
SelectItemNr(a);
}
}
}
HaveSelRect = false;
}
}
if (doku->AppMode != 7)
{
{
if (doku->AppMode == 9)
doku->RotMode = RotMode;
doku->AppMode = 1;
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
emit PaintingDone();
}
}
if (GetItem(&b))
{
if (doku->ActPage->SelItem.count() > 1)
{
if (doku->ActPage->SelItem.count() > 1)
{
setGroupRect();
paintGroupRect();
double x, y, w, h;
2615,27 → 2568,27
getGroupRect(&x, &y, &w, &h);
emit ItemPos(x, y);
emit ItemGeom(w, h);
}
}
else
EmitValues(b);
}
}
}
if (doku->AppMode == 6)
{
if (HaveSelRect)
{
if (HaveSelRect)
{
double sc = doku->Scale;
if((Mxp*sc) > SeRx)
if((Mxp*sc) > SeRx)
{
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
}
if((Myp*sc) > SeRy)
if((Myp*sc) > SeRy)
{
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
}
double yf = height() / (SeRy/sc-Myp);
double xf = width() / (SeRx/sc-Mxp);
2646,39 → 2599,34
doku->AppMode = 1;
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
emit PaintingDone();
}
}
else
{
if (Magnify)
emit ZoomIn();
else
emit ZoomOut();
{
emit Magnify ? ZoomIn() : ZoomOut();
if (SelItem.count() == 0)
emit AbsPosi2(Mxp, Myp);
HaveSelRect = false;
}
}
}
if ((doku->AppMode == 7) && !HanMove)
{
{
b = SelItem.at(0);
uint a;
if (b->PType == 4)
{
if (oldCp == b->CPos)
{
if (oldCp == b->CPos)
{
for (a = 0; a < b->Ptext.count(); ++a)
{
b->Ptext.at(a)->cselect = false;
}
b->HasSel = false;
emit HasNoTextSel();
b->Dirty = true;
RefreshItem(b);
}
}
}
}
if ((doku->AppMode == 13) && (m->button() == LeftButton))
{
{
b = SelItem.at(0);
QPainter p;
QPointArray Bez(4);
2688,7 → 2636,7
npf = ApplyGridF(npf);
b->PoLine.addPoint(npf);
if ((b->PoLine.size() % 4 == 0) && (b->PoLine.size() > 3))
{
{
FPoint lxy = b->PoLine.point(b->PoLine.size()-2);
FPoint lk = b->PoLine.point(b->PoLine.size()-1);
double dx = lxy.x() - lk.x();
2697,26 → 2645,26
lk.setY(lk.y() + dy*2);
b->PoLine.addPoint(lxy);
b->PoLine.addPoint(lk);
}
}
FPoint np2 = GetMinClipF(b->PoLine);
if (np2.x() < 0)
{
{
b->PoLine.translate(-np2.x(), 0);
MoveItem(np2.x(), 0, b);
}
}
if (np2.y() < 0)
{
{
b->PoLine.translate(0, -np2.y());
MoveItem(0, np2.y(), b);
}
}
SizeItem(b->PoLine.WidthHeight().x(), b->PoLine.WidthHeight().y(), b->ItemNr, false, false);
SetPolyClip(b, qRound(QMAX(b->Pwidth / 2, 1)), qRound(QMAX(b->Pwidth / 2, 1)));
AdjustItemSize(b);
RefreshItem(b);
p.end();
}
}
if ((doku->AppMode == 13) && (m->button() == RightButton))
{
{
b = SelItem.at(0);
b->PoLine.resize(b->PoLine.size()-2);
SizeItem(b->PoLine.WidthHeight().x(), b->PoLine.WidthHeight().y(), b->ItemNr, false, false);
2728,7 → 2676,7
emit DocChanged();
FirstPoly = true;
update();
}
}
doku->DragP = false;
Imoved = false;
mCG = false;
2741,12 → 2689,12
QPoint py = mapFromGlobal(m->globalPos());
double newY = py.y() / doku->Scale;
if ((newY > 0) && (newY < doku->PageH) && (doku->Guides))
{
{
YGuides.append(newY);
qHeapSort(YGuides);
update();
emit DocChanged();
}
}
}
 
void Page::SetXGuide(QMouseEvent *m)
2754,12 → 2702,12
QPoint py = mapFromGlobal(m->globalPos());
double newY = py.x() / doku->Scale;
if ((newY > 0) && (newY < doku->PageB) && (doku->Guides))
{
{
XGuides.append(newY);
qHeapSort(XGuides);
update();
emit DocChanged();
}
}
}
 
void Page::FromHRuler(QMouseEvent *m)
2767,7 → 2715,7
double sc = doku->Scale;
int newY;
if (doku->Guides)
{
{
QPoint py = mapFromGlobal(m->globalPos());
newY = py.y();
emit MousePos(py.x()/sc, py.y()/sc);
2781,7 → 2729,7
p.drawLine(0, newY, static_cast<int>(doku->PageB * sc), newY);
p.end();
DrHY = newY;
}
}
}
 
void Page::FromVRuler(QMouseEvent *m)
2789,7 → 2737,7
double sc = doku->Scale;
int newY;
if (doku->Guides)
{
{
QPoint py = mapFromGlobal(m->globalPos());
newY = py.x();
emit MousePos(py.x()/sc, py.y()/sc);
2823,9 → 2771,9
emit Hrule(m->x()+Anz->childX(parentWidget()));
emit Vrule(m->y()+Anz->childY(parentWidget()));
if (doku->Guides)
{
if (MoveGY)
{
if (MoveGY)
{
FromHRuler(m);
if (((m->y()/sc) < 0) || ((m->y()/sc) > doku->PageH))
qApp->setOverrideCursor(QCursor(loadIcon("DelPoint.png")), true);
2832,9 → 2780,9
else
qApp->setOverrideCursor(QCursor(SplitHCursor), true);
return;
}
}
if (MoveGX)
{
{
FromVRuler(m);
if (((m->x()/sc) < 0) || ((m->x()/sc) > doku->PageB))
qApp->setOverrideCursor(QCursor(loadIcon("DelPoint.png")), true);
2841,10 → 2789,10
else
qApp->setOverrideCursor(QCursor(SplitVCursor), true);
return;
}
}
}
if ((!doku->DragP) && (Mpressed) && (SelItem.count() != 0))
{
{
int cx = Anz->contentsX() - Anz->childX(doku->ActPage->parentWidget());
int cy = Anz->contentsY() - Anz->childY(doku->ActPage->parentWidget());
int cw = Anz->visibleWidth();
2857,47 → 2805,45
Anz->scrollBy(m->x() - cx, 0);
if ((cw - (m->x() - cx)) < 0)
Anz->scrollBy(m->x() - cx - cw, 0);
}
}
if (Mpressed && (doku->AppMode == 21))
{
{
newX = m->x();
newY = m->y();
double newXF = m->x()/sc;
double newYF = m->y()/sc;
if (RecordP.size() > 0)
{
{
if (FPoint(newXF, newYF) != RecordP.point(RecordP.size()-1))
RecordP.addPoint(FPoint(newXF, newYF));
}
}
else
RecordP.addPoint(FPoint(newXF, newYF));
p.begin(this);
if (RecordP.size() > 1)
{
{
FPoint xp = RecordP.point(RecordP.size()-2);
p.drawLine(qRound(xp.x()*sc), qRound(xp.y()*sc), newX, newY);
}
}
else
p.drawPoint(m->x(), m->y());
p.end();
return;
}
}
if (GetItem(&b))
{
{
newX = static_cast<int>(m->x()/sc);
newY = static_cast<int>(m->y()/sc);
if ((Mpressed) && (m->state() == RightButton) && (!doku->DragP) && (doku->AppMode == 1) && (!b->Locked))
{
if ((abs(Dxp - newX) > 3) || (abs(Dyp - newY) > 3))
{
if ((abs(Dxp - newX) > 3) || (abs(Dyp - newY) > 3))
{
doku->DragP = true;
doku->DraggedElem = b;
doku->DragElements.clear();
for (uint dre=0; dre<SelItem.count(); ++dre)
{
doku->DragElements.append(SelItem.at(dre)->ItemNr);
}
ScriXmlDoc *ss = new ScriXmlDoc();
ScriXmlDoc *ss = new ScriXmlDoc();
QDragObject *dr = new QTextDrag(ss->WriteElem(&SelItem, doku), this);
dr->setPixmap(loadIcon("DragPix.xpm"));
dr->drag();
2906,13 → 2852,13
Mpressed = false;
doku->DraggedElem = 0;
doku->DragElements.clear();
}
}
return;
}
}
if (doku->DragP)
return;
if (Mpressed && (doku->AppMode == 9))
{
{
double newW = xy2Deg(m->x()/sc - RCenter.x(), m->y()/sc - RCenter.y());
if (GroupSel)
RotateGroup(newW - oldW);
2920,144 → 2866,152
RotateItem(b->Rot - (oldW - newW), b->ItemNr);
oldW = newW;
emit DocChanged();
}
}
if (doku->AppMode == 13)
{
{
p.begin(this);
Transform(b, &p);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if (doku->useRaster)
{
{
newX = static_cast<int>(qRound(newX / doku->minorGrid) * doku->minorGrid);
newY = static_cast<int>(qRound(newY / doku->minorGrid) * doku->minorGrid);
}
}
if (!Mpressed)
{
{
BezierPoints(&Bez, b->PoLine.pointQ(b->PoLine.size()-2), b->PoLine.pointQ(b->PoLine.size()-1),
p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc))), p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc))));
p.xFormDev(QPoint(static_cast<int>(Mxp*sc),
static_cast<int>(Myp*sc))),
p.xFormDev(QPoint(static_cast<int>(Mxp*sc),
static_cast<int>(Myp*sc))));
p.drawCubicBezier(Bez);
Bez.setPoint(2, p.xFormDev(QPoint(static_cast<int>(newX*sc), static_cast<int>(newY*sc))));
Bez.setPoint(3, p.xFormDev(QPoint(static_cast<int>(newX*sc), static_cast<int>(newY*sc))));
p.drawCubicBezier(Bez);
}
}
else
{
if (b->PoLine.size() > 2)
{
if (b->PoLine.size() > 2)
{
BezierPoints(&Bez, b->PoLine.pointQ(b->PoLine.size()-3), b->PoLine.pointQ(b->PoLine.size()-2),
p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc))), b->PoLine.pointQ(b->PoLine.size()-1));
p.xFormDev(QPoint(static_cast<int>(Mxp*sc),
static_cast<int>(Myp*sc))),
b->PoLine.pointQ(b->PoLine.size()-1));
p.drawCubicBezier(Bez);
Bez.setPoint(2, p.xFormDev(QPoint(static_cast<int>(newX*sc), static_cast<int>(newY*sc))));
Bez.setPoint(3, b->PoLine.pointQ(b->PoLine.size()-1));
p.drawCubicBezier(Bez);
}
p.drawLine(b->PoLine.pointQ(b->PoLine.size()-1), p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc))));
p.drawLine(b->PoLine.pointQ(b->PoLine.size()-1), p.xFormDev(QPoint(static_cast<int>(newX*sc), static_cast<int>(newY*sc))));
}
p.drawLine(b->PoLine.pointQ(b->PoLine.size()-1), p.xFormDev(QPoint(static_cast<int>(Mxp*sc),
static_cast<int>(Myp*sc))));
p.drawLine(b->PoLine.pointQ(b->PoLine.size()-1), p.xFormDev(QPoint(static_cast<int>(newX*sc),
static_cast<int>(newY*sc))));
}
p.end();
Mxp = newX;
Myp = newY;
}
}
if (Mpressed && (doku->AppMode == 12))
{
{
p.begin(this);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if (m->state() & ShiftButton)
{
{
mop = QPoint(m->x(), static_cast<int>((b->Ypos + (newX - b->Xpos)) * sc));
QCursor::setPos(mapToGlobal(mop));
newY = static_cast<int>(mop.y()/sc);
}
}
if (doku->useRaster)
{
{
newX = static_cast<int>(qRound(newX / doku->minorGrid) * doku->minorGrid);
newY = static_cast<int>(qRound(newY / doku->minorGrid) * doku->minorGrid);
}
p.drawRect(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(Mxp*sc-b->Xpos*sc), static_cast<int>(Myp*sc-b->Ypos*sc));
p.drawRect(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(newX*sc-b->Xpos*sc), static_cast<int>(newY*sc-b->Ypos*sc));
}
p.drawRect(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc),
static_cast<int>(Mxp*sc-b->Xpos*sc), static_cast<int>(Myp*sc-b->Ypos*sc));
p.drawRect(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc),
static_cast<int>(newX*sc-b->Xpos*sc), static_cast<int>(newY*sc-b->Ypos*sc));
p.end();
emit ItemGeom(newX - b->Xpos, newY - b->Ypos);
Mxp = newX;
Myp = newY;
}
}
if (Mpressed && (doku->AppMode == 8))
{
{
p.begin(this);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if (doku->useRaster)
{
{
newX = static_cast<int>(qRound(newX / doku->minorGrid) * doku->minorGrid);
newY = static_cast<int>(qRound(newY / doku->minorGrid) * doku->minorGrid);
}
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(newX*sc), static_cast<int>(newY*sc));
}
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(Mxp*sc),
static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(newX*sc),
static_cast<int>(newY*sc));
p.end();
emit SetAngle(xy2Deg(newX - b->Xpos, newY - b->Ypos));
emit ItemGeom(sqrt(pow(newX - b->Xpos,2)+pow(newY - b->Ypos,2)), 0);
Mxp = newX;
Myp = newY;
}
}
if (Mpressed && (doku->AppMode == 7) && (!HanMove))
{
if (b->PType == 2)
{
if (b->PType == 2)
{
MoveItemI((newX-Mxp)/b->LocalScX, (newY-Myp)/b->LocalScY, b->ItemNr);
Mxp = newX;
Myp = newY;
}
}
if (b->PType == 4)
{
{
for (a = 0; a < b->Ptext.count(); ++a)
{
b->Ptext.at(a)->cselect = false;
}
b->HasSel = false;
slotSetCurs(m->x(), m->y());
if (b->CPos < oldCp)
{
for (c = b->CPos; c < oldCp; ++c)
{
for (c = b->CPos; c < oldCp; ++c)
{
b->Ptext.at(c)->cselect = true;
b->HasSel = true;
}
}
}
if (b->CPos > oldCp)
{
for (c = oldCp; c < b->CPos; ++c)
{
for (c = oldCp; c < b->CPos; ++c)
{
b->Ptext.at(c)->cselect = true;
b->HasSel = true;
}
}
}
RefreshItem(b);
if (b->HasSel)
emit HasTextSel();
else
emit HasNoTextSel();
}
emit b->HasSel ? HasTextSel() : HasNoTextSel();
}
}
if (Mpressed && ((doku->AppMode == 1) || ((doku->AppMode == 7) && HanMove)))
{
if (doku->EditClip)
{
if (doku->EditClip)
if ((Mpressed) && (ClRe == -1) && (SegP1 == -1) && (SegP2 == -1))
{
if ((Mpressed) && (ClRe == -1) && (SegP1 == -1) && (SegP2 == -1))
{
newX = m->x();
newY = m->y();
p.begin(this);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(newX-(Mxp*sc)), static_cast<int>(newY-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc),
static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc),
static_cast<int>(newX-(Mxp*sc)), static_cast<int>(newY-(Myp*sc)));
p.end();
SeRx = newX;
SeRy = newY;
HaveSelRect = true;
return;
}
}
Imoved = true;
b = SelItem.at(0);
b->OldB2 = b->Width;
3067,7 → 3021,7
npf = FPoint(p.xFormDev(m->pos()));
p.end();
if ((SegP1 != -1) && (SegP2 != -1))
{
{
FPointArray Clip;
Clip = b->PoLine;
p.begin(this);
3089,16 → 3043,17
p.end();
Mxp = newX;
Myp = newY;
}
}
else
{
if ((SelNode.count() != 0) && (EdPoints))
{
if ((SelNode.count() != 0) && (EdPoints))
{
int storedClRe = ClRe;
for (uint itm = 0; itm < SelNode.count(); ++itm)
{
{
p.begin(this);
p.translate(static_cast<int>(b->Xpos*doku->Scale), static_cast<int>(b->Ypos*doku->Scale));
p.translate(static_cast<int>(b->Xpos*doku->Scale),
static_cast<int>(b->Ypos*doku->Scale));
p.rotate(b->Rot);
FPoint npfN = FPoint(p.xFormDev(QPoint(newX, newY)));
FPoint npfM = FPoint(p.xFormDev(QPoint(Mxp, Myp)));
3109,28 → 3064,28
b->OldB2 = b->Width;
b->OldH2 = b->Height;
MoveClipPoint(b, npf);
}
}
b->OldB2 = b->Width;
b->OldH2 = b->Height;
ClRe = storedClRe;
}
}
else
MoveClipPoint(b, npf);
Mxp = newX;
Myp = newY;
}
}
return;
}
}
if (mCG)
{
{
Imoved = false;
if (GroupSel)
{
{
double gx, gy, gh, gw;
getGroupRect(&gx, &gy, &gw, &gh);
p.begin(this);
switch (HowTo)
{
{
case 1:
np = QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
np2 = QPoint(m->x(), static_cast<int>((gy+(gh * ((newX-gx) / gw)))*sc));
3144,18 → 3099,19
np2 = QPoint(m->x(), m->y()); */
Mxp = static_cast<int>(np2.x()/sc);
Myp = static_cast<int>(np2.y()/sc);
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(gx*sc), static_cast<int>(gy*sc)), np), QRect(QPoint(static_cast<int>(gx*sc), static_cast<int>(gy*sc)), np2));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(gx*sc), static_cast<int>(gy*sc)), np),
QRect(QPoint(static_cast<int>(gx*sc), static_cast<int>(gy*sc)), np2));
break;
}
}
p.end();
}
}
else
{
for (a = 0; a < SelItem.count(); ++a)
{
for (a = 0; a < SelItem.count(); ++a)
{
b = SelItem.at(0);
switch (HowTo)
{
{
case 0:
break;
case 1:
3162,37 → 3118,38
p.begin(this);
Transform(b, &p);
if ((m->state() & ShiftButton) && (!(m->state() & ControlButton)))
{
{
mop = QPoint(m->x(), static_cast<int>((b->Ypos + (newX - b->Xpos)) * sc));
QCursor::setPos(mapToGlobal(mop));
}
}
else
{
if ((m->state() & ControlButton) && (!(m->state() & ShiftButton)))
{
if ((m->state() & ControlButton) && (!(m->state() & ShiftButton)))
{
mop = QPoint(m->x(), static_cast<int>((b->Ypos + ((newX - b->Xpos) / b->OldB2 * b->OldH2)) * sc));
mop = QPoint(m->x(), static_cast<int>((b->Ypos + ((newX - b->Xpos) /
b->OldB2 * b->OldH2)) * sc));
QCursor::setPos(mapToGlobal(mop));
}
}
else
mop = QPoint(m->x(), m->y());
}
}
np = p.xFormDev(mop);
nx = np.x();
ny = np.y();
p.end();
if (b->PType != 5)
{
if (doku->useRaster)
{
if (doku->useRaster)
{
dx = b->Xpos - int (b->Xpos / doku->minorGrid) * doku->minorGrid;
dy = b->Ypos - int (b->Ypos / doku->minorGrid) * doku->minorGrid;
nx = (qRound(np.x() / doku->minorGrid) * doku->minorGrid - dx);
ny = (qRound(np.y() / doku->minorGrid) * doku->minorGrid - dy);
}
}
erf = SizeItem(nx, ny, b->ItemNr);
}
}
else
{
{
p.begin(this);
double rba = b->Rot;
b->Rot = 0;
3203,20 → 3160,22
np = ApplyGrid(np);
erf = SizeItem(np.x(), np.y(), b->ItemNr);
if (doku->SnapGuides)
{
{
p.begin(this);
b->Sizing = true;
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc), static_cast<int>(newX*sc), static_cast<int>(newY*sc));
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc),
static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(b->Xpos*sc), static_cast<int>(b->Ypos*sc),
static_cast<int>(newX*sc), static_cast<int>(newY*sc));
p.end();
}
}
}
break;
case 2:
if (b->PType == 5)
{
{
p.begin(this);
Transform(b, &p);
mop = QPoint(m->x(), m->y());
3230,16 → 3189,19
doku->SnapGuides = sav;
if (sav)
b->Sizing = true;
}
}
else
{
{
p.begin(this);
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(np, QPoint(static_cast<int>(b->Width), static_cast<int>(b->Height))), QRect(np2, QPoint(static_cast<int>(b->Width), static_cast<int>(b->Height))));
PaintSizeRect(&p, QRect(np, QPoint(static_cast<int>(b->Width),
static_cast<int>(b->Height))),
QRect(np2, QPoint(static_cast<int>(b->Width),
static_cast<int>(b->Height))));
p.end();
}
}
break;
case 3:
p.begin(this);
3246,7 → 3208,8
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(np, QPoint(0, static_cast<int>(b->Height))), QRect(np2, QPoint(0, static_cast<int>(b->Height))));
PaintSizeRect(&p, QRect(np, QPoint(0, static_cast<int>(b->Height))),
QRect(np2, QPoint(0, static_cast<int>(b->Height))));
p.end();
break;
case 4:
3254,7 → 3217,8
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(np, QPoint(static_cast<int>(b->Width), 0)), QRect(np2, QPoint(static_cast<int>(b->Width), 0)));
PaintSizeRect(&p, QRect(np, QPoint(static_cast<int>(b->Width), 0)),
QRect(np2, QPoint(static_cast<int>(b->Width), 0)));
p.end();
break;
case 5:
3262,7 → 3226,9
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(b->Width), np.y()), QPoint(0, 0)), QRect(QPoint(static_cast<int>(b->Width), np2.y()), QPoint(0, 0)));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(b->Width), np.y()), QPoint(0, 0)),
QRect(QPoint(static_cast<int>(b->Width), np2.y()),
QPoint(0, 0)));
p.end();
break;
case 6:
3270,7 → 3236,9
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(np.x(), static_cast<int>(b->Height)), QPoint(0, 0)), QRect(QPoint(np2.x(), static_cast<int>(b->Height)), QPoint(0, 0)));
PaintSizeRect(&p, QRect(QPoint(np.x(), static_cast<int>(b->Height)),
QPoint(0, 0)), QRect(QPoint(np2.x(), static_cast<int>(b->Height)),
QPoint(0, 0)));
p.end();
break;
case 7:
3278,7 → 3246,10
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(np.x(), static_cast<int>(b->Height)), QPoint(static_cast<int>(b->Width), 0)), QRect(QPoint(np2.x(), static_cast<int>(b->Height)), QPoint(static_cast<int>(b->Width), 0)));
PaintSizeRect(&p, QRect(QPoint(np.x(), static_cast<int>(b->Height)),
QPoint(static_cast<int>(b->Width), 0)), QRect(QPoint(np2.x(),
static_cast<int>(b->Height)), QPoint(static_cast<int>(b->Width),
0)));
p.end();
break;
case 8:
3286,34 → 3257,37
Transform(b, &p);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(b->Width),np.y()), QPoint(0, static_cast<int>(b->Height))), QRect(QPoint(static_cast<int>(b->Width),np2.y()), QPoint(0, static_cast<int>(b->Height))));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(b->Width),np.y()),
QPoint(0, static_cast<int>(b->Height))),
QRect(QPoint(static_cast<int>(b->Width),np2.y()),
QPoint(0, static_cast<int>(b->Height))));
p.end();
break;
}
}
}
}
if ((erf) || (HowTo > 1))
{
{
Mxp = newX;
Myp = newY;
}
}
}
else
{
if (!GroupSel)
{
if (!GroupSel)
{
doku->UnData.UnCode = 1;
doku->UnDoValid = true;
emit UndoAvail();
}
}
else
{
{
doku->UnDoValid = false;
emit UndoAvail();
}
}
Imoved = true;
for (a = 0; a < SelItem.count(); ++a)
{
{
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
3330,53 → 3304,56
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
p.end();
}
}
if (erf)
{
{
Mxp = newX;
Myp = newY;
}
}
}
}
if ((!Mpressed) && (doku->AppMode != 13))
{
if (GroupSel)
{
if (GroupSel)
{
QRect mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
double gx, gy, gh, gw;
getGroupRectScreen(&gx, &gy, &gw, &gh);
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
{
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw),
static_cast<int>(gh)).intersects(mpo))
{
if (doku->AppMode == 9)
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
else
else
qApp->setOverrideCursor(QCursor(SizeAllCursor), true);
if (QRect(static_cast<int>(gx+gw)-6, static_cast<int>(gy+gh)-6, 6, 6).intersects(mpo))
{
if (QRect(static_cast<int>(gx+gw)-6, static_cast<int>(gy+gh)-6, 6, 6).intersects(mpo))
{
if (doku->AppMode == 9)
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
else
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
}
}
else
else
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
}
}
else
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
return;
}
return;
}
for (a = 0; a < doku->ActPage->SelItem.count(); ++a)
{
b = doku->ActPage->SelItem.at(a);
{
b = doku->ActPage->SelItem.at(a);
if (b->Locked)
break;
p.begin(this);
p.begin(this);
Transform(b, &p);
QRegion ganz = ViewReg();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
if (ganz.intersect(QRegion(p.xForm(QPointArray(QRect(-3, -3, static_cast<int>(b->Width+6), static_cast<int>(b->Height+6)))))).contains(m->pos()))
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
if (ganz.intersect(QRegion(p.xForm(QPointArray(QRect(-3, -3, static_cast<int>(b->Width+6),
static_cast<int>(b->Height+6)))))).contains(m->pos()))
{
if (doku->EditClip)
{
QRect mpo = p.xFormDev(QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2));
{
QRect mpo = p.xFormDev(QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad,
doku->GrabRad*2, doku->GrabRad*2));
FPointArray Clip;
QPointArray cli;
ClRe2 = -1;
3384,127 → 3361,131
SegP2 = -1;
Clip = b->PoLine;
if ((doku->EditClipMode == 2) || (doku->EditClipMode == 0) || (doku->EditClipMode == 3))
{
{
np2 = p.xFormDev(m->pos());
for (a=0; a<Clip.size(); ++a)
{
if ((EdPoints) && (a % 2 != 0))
{
if (((EdPoints) && (a % 2 != 0)) || ((!EdPoints) && (a % 2 == 0)))
continue;
if ((!EdPoints) && (a % 2 == 0))
continue;
np = p.xForm(Clip.pointQ(a));
tx = QRect(np.x()-3, np.y()-3, 6, 6);
tx = QRect(np.x()-3, np.y()-3, 6, 6);
if (tx.contains(m->pos()))
{
{
if (doku->EditClipMode == 0)
qApp->setOverrideCursor(QCursor(SizeAllCursor), true);
qApp->setOverrideCursor(QCursor(SizeAllCursor), true);
if (doku->EditClipMode == 2)
qApp->setOverrideCursor(QCursor(loadIcon("DelPoint.png"), 4, 3), true);
qApp->setOverrideCursor(QCursor(loadIcon("DelPoint.png"), 4, 3), true);
if (doku->EditClipMode == 3)
qApp->setOverrideCursor(QCursor(loadIcon("Split.png"), 4, 3), true);
qApp->setOverrideCursor(QCursor(loadIcon("Split.png"), 4, 3), true);
p.end();
return;
}
}
}
}
if ((doku->EditClipMode == 1) || (doku->EditClipMode == 0) && (EdPoints))
{
for (uint poi=0; poi<Clip.size()-3; poi += 4)
{
for (uint poi=0; poi<Clip.size()-3; poi += 4)
{
BezierPoints(&Bez, Clip.pointQ(poi), Clip.pointQ(poi+1), Clip.pointQ(poi+3), Clip.pointQ(poi+2));
BezierPoints(&Bez, Clip.pointQ(poi), Clip.pointQ(poi+1), Clip.pointQ(poi+3),
Clip.pointQ(poi+2));
cli = Bez.cubicBezier();
for (uint clp = 0; clp < cli.size()-1; ++clp)
{
if (PointOnLine(cli.point(clp), cli.point(clp+1), mpo))
{
if (PointOnLine(cli.point(clp), cli.point(clp+1), mpo))
{
if (doku->EditClipMode == 0)
qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
if (doku->EditClipMode == 1)
qApp->setOverrideCursor(QCursor(loadIcon("AddPoint.png"), 4, 3), true);
qApp->setOverrideCursor(QCursor(loadIcon("AddPoint.png"), 4, 3), true);
ClRe2 = poi;
p.end();
return;
}
}
}
}
}
tx = p.xForm(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height)));
if (tx.contains(m->pos()))
}
tx = p.xForm(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height)));
if (tx.contains(m->pos()))
{
qApp->setOverrideCursor(QCursor(SizeAllCursor), true);
if (doku->AppMode == 9)
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
if (doku->AppMode == 7)
qApp->setOverrideCursor(QCursor(SizeAllCursor), true);
if (doku->AppMode == 9)
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
if (doku->AppMode == 7)
{
if (b->PType == 4)
qApp->setOverrideCursor(QCursor(ibeamCursor), true);
if (b->PType == 2)
qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
if (b->PType == 4)
qApp->setOverrideCursor(QCursor(ibeamCursor), true);
if (b->PType == 2)
qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
}
QRect mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
QRect mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2,
doku->GrabRad*2);
HandleCurs(&p, b, mpo);
}
}
else
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
p.end();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
p.end();
}
}
}
else
{
if (Mpressed)
{
if (Mpressed)
{
newX = m->x();
newY = m->y();
p.begin(this);
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)), static_cast<int>(SeRy-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(newX-(Mxp*sc)), static_cast<int>(newY-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(SeRx-(Mxp*sc)),
static_cast<int>(SeRy-(Myp*sc)));
p.drawRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>(newX-(Mxp*sc)),
static_cast<int>(newY-(Myp*sc)));
p.end();
SeRx = newX;
SeRy = newY;
HaveSelRect = true;
}
}
else
{
{
if ((doku->Guides) && (doku->AppMode == 1))
{
if (YGuides.count() != 0)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
if ((YGuides[yg] < (static_cast<int>(m->y()/sc)+doku->GuideRad)) &&
(YGuides[yg] > (static_cast<int>(m->y()/sc)-doku->GuideRad)))
{
if ((YGuides[yg] < (static_cast<int>(m->y()/sc)+doku->GuideRad)) && (YGuides[yg] > (static_cast<int>(m->y()/sc)-doku->GuideRad)))
{
if (((m->x()/sc) < 0) || ((m->x()/sc) >= doku->PageB-1))
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
else
qApp->setOverrideCursor(QCursor(SplitHCursor), true);
return;
}
}
}
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
}
if (XGuides.count() != 0)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
{
for (uint xg = 0; xg < XGuides.count(); ++xg)
if ((XGuides[xg] < (static_cast<int>(m->x()/sc)+doku->GuideRad)) &&
(XGuides[xg] > (static_cast<int>(m->x()/sc)-doku->GuideRad)))
{
if ((XGuides[xg] < (static_cast<int>(m->x()/sc)+doku->GuideRad)) && (XGuides[xg] > (static_cast<int>(m->x()/sc)-doku->GuideRad)))
{
if (((m->y()/sc) < 0) || ((m->y()/sc) >= doku->PageH-1))
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
else
qApp->setOverrideCursor(QCursor(SplitVCursor), true);
qApp->setOverrideCursor(QCursor(SplitVCursor), true);
return;
}
}
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
}
}
}
}
}
 
void Page::mousePressEvent(QMouseEvent *m)
3534,7 → 3515,7
Myp = qRound(m->y()/sc);
mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
if (doku->AppMode != 7)
{
{
Rxp = ApplyGrid(QPoint(Mxp, Myp)).x();
Rxpd = Mxp - Rxp;
Mxp = qRound(Rxp);
3541,17 → 3522,17
Ryp = ApplyGrid(QPoint(Mxp, Myp)).y();
Rypd = Myp - Ryp;
Myp = qRound(Ryp);
}
}
else
{
{
Ryp = Myp;
Rxp = Mxp;
}
}
switch (doku->AppMode)
{
{
case 1:
if ((doku->EditClip) && (SelItem.count() != 0))
{
{
b = SelItem.at(0);
FPointArray Clip;
bool edited = false;
3562,89 → 3543,88
npf2 = FPoint(p.xFormDev(m->pos()));
ClRe = -1;
for (a=0; a<Clip.size(); ++a)
{
if ((EdPoints) && (a % 2 != 0))
{
if (((EdPoints) && (a % 2 != 0)) || ((!EdPoints) && (a % 2 == 0)))
continue;
if ((!EdPoints) && (a % 2 == 0))
continue;
npf = FPoint(p.xForm(Clip.pointQ(a)));
tx = QRect(static_cast<int>(npf.x()-3), static_cast<int>(npf.y()-3), 6, 6);
tx = QRect(static_cast<int>(npf.x()-3), static_cast<int>(npf.y()-3), 6, 6);
if (tx.contains(m->pos()))
{
{
ClRe = a;
if ((EdPoints) && (SelNode.contains(a) == 0))
{
{
if (m->state() == ShiftButton)
SelNode.append(a);
else
{
{
SelNode.clear();
SelNode.append(a);
}
}
}
emit ClipPo(Clip.point(a).x(), Clip.point(a).y());
pfound = true;
break;
}
}
}
if ((!pfound) || (!EdPoints))
SelNode.clear();
p.end();
if ((doku->EditClipMode == 0) && (ClRe2 != -1) && (ClRe == -1))
{
{
SegP1 = ClRe2;
SegP2 = ClRe2+2;
}
}
FPointArray cli;
uint EndInd = Clip.size();
uint StartInd = 0;
for (uint n = ClRe; n < Clip.size(); n++)
for (uint n = ClRe; n < Clip.size(); ++n)
{
if (Clip.point(n).x() > 900000)
{
if (Clip.point(n).x() > 900000)
{
EndInd = n;
break;
}
}
}
if (ClRe > 0)
{
for (uint n2 = ClRe; n2 > 0; n2--)
{
for (uint n2 = ClRe; n2 > 0; n2--)
{
if (n2 == 0)
break;
if (Clip.point(n2).x() > 900000)
{
{
StartInd = n2 + 1;
break;
}
}
}
}
if (doku->EditClipMode == 3)
{
{
if (!EdPoints)
return;
if (ClRe != -1)
{
if (b->PType == 6)
{
if (b->PType == 6)
if ((ClRe != 0) && (ClRe != static_cast<int>(EndInd-2)))
{
if ((ClRe != 0) && (ClRe != static_cast<int>(EndInd-2)))
if (b->Segments.count() == 0)
{
if (b->Segments.count() == 0)
{
cli.putPoints(0, EndInd-(ClRe+2), Clip, ClRe+2);
cli.putPoints(cli.size(), ClRe+2, Clip);
}
}
else
{
{
cli.putPoints(0, EndInd-StartInd, Clip, StartInd);
z = PaintPoly(b->Xpos, b->Ypos, b->Width, b->Height, b->Pwidth, b->Pcolor, b->Pcolor2);
z = PaintPoly(b->Xpos, b->Ypos, b->Width, b->Height, b->Pwidth,
b->Pcolor, b->Pcolor2);
bb = Items.at(z);
bb->PoLine.resize(0);
if (StartInd != 0)
{
{
bb->PoLine.putPoints(0, StartInd - 4, Clip);
bb->PoLine.putPoints(bb->PoLine.size(), Clip.size()-EndInd, Clip, EndInd);
}
}
else
bb->PoLine.putPoints(0, Clip.size()-EndInd-4, Clip, EndInd+4);
bb->Rot = b->Rot;
3654,14 → 3634,14
PageItem *bx = Items.take(bb->ItemNr);
Items.insert(bb->ItemNr-1, bx);
for (uint al = 0; al < Items.count(); ++al)
{
{
Items.at(al)->ItemNr = al;
if (Items.at(al)->isBookmark)
emit NewBMNr(Items.at(al)->BMnr, al);
}
}
}
b->PoLine = cli.copy();
}
}
ClRe = -1;
b->ClipEdited = true;
edited = true;
3669,14 → 3649,15
b->PType = 7;
SetPolyClip(b, qRound(QMAX(b->Pwidth / 2, 1)), qRound(QMAX(b->Pwidth / 2, 1)));
emit PolyOpen();
}
}
else
{
if ((b->PType == 7) || (b->PType == 8))
{
if ((b->PType == 7) || (b->PType == 8))
if ((ClRe > 1) && (ClRe < static_cast<int>(Clip.size()-2)))
{
if ((ClRe > 1) && (ClRe < static_cast<int>(Clip.size()-2)))
{
z = PaintPolyLine(b->Xpos, b->Ypos, b->Width, b->Height, b->Pwidth, b->Pcolor, b->Pcolor2);
z = PaintPolyLine(b->Xpos, b->Ypos, b->Width, b->Height, b->Pwidth,
b->Pcolor, b->Pcolor2);
bb = Items.at(z);
bb->PoLine.putPoints(0, Clip.size()-(ClRe+2), Clip, ClRe+2);
bb->Rot = b->Rot;
3685,7 → 3666,7
cli.resize(0);
cli.putPoints(0, ClRe+2, Clip);
b->PoLine = cli.copy();
}
}
ClRe = -1;
b->ClipEdited = true;
edited = true;
3692,36 → 3673,36
doku->EditClipMode = 0;
SetPolyClip(b, qRound(QMAX(b->Pwidth / 2, 1)), qRound(QMAX(b->Pwidth / 2, 1)));
emit PolyOpen();
}
}
}
}
}
if ((doku->EditClipMode == 2) && (ClRe != -1))
{
{
if (!EdPoints)
return;
if ((b->PType == 6) || (b->PType == 4) || (b->PType == 2))
{
{
if ((b->Segments.count() == 0) && (Clip.size() < 13))
return;
}
}
else
{
{
if (Clip.size() < 9)
return;
}
}
if ((b->Segments.count() != 0) && ((EndInd - StartInd) < 13))
{
{
if (StartInd != 0)
cli.putPoints(0, StartInd-4, Clip);
cli.putPoints(cli.size(), Clip.size() - EndInd, Clip, EndInd);
}
}
else
{
if (ClRe == static_cast<int>(StartInd))
{
if (ClRe == static_cast<int>(StartInd))
if ((b->PType == 6) || (b->PType == 4) || (b->PType == 2))
{
if ((b->PType == 6) || (b->PType == 4) || (b->PType == 2))
{
FPoint kp = Clip.point(EndInd-3);
cli.putPoints(0, StartInd, Clip);
cli.putPoints(cli.size(), EndInd - StartInd - 4, Clip, StartInd);
3728,39 → 3709,40
cli.setPoint(StartInd, cli.point(cli.size()-2));
cli.setPoint(StartInd + 1, kp);
cli.putPoints(cli.size(), Clip.size() - EndInd, Clip, EndInd);
}
}
else
{
{
cli.putPoints(0, StartInd, Clip);
cli.putPoints(cli.size(), EndInd - StartInd - 4, Clip, StartInd+4);
cli.putPoints(cli.size(), Clip.size() - EndInd, Clip, EndInd);
}
}
}
else
{
{
if (ClRe != 0)
cli.putPoints(0, ClRe, Clip);
cli.putPoints(cli.size(), Clip.size()-(ClRe + 4), Clip, ClRe+4);
}
}
}
b->PoLine = cli.copy();
ClRe = -1;
b->ClipEdited = true;
edited = true;
}
}
if ((doku->EditClipMode == 1) && (ClRe2 != -1))
{
{
cli.putPoints(0, ClRe2+2, Clip);
cli.resize(cli.size()+4);
cli.putPoints(cli.size()-4, 4, npf2.x(), npf2.y(), npf2.x(), npf2.y(), npf2.x(), npf2.y(), npf2.x(), npf2.y());
cli.putPoints(cli.size()-4, 4, npf2.x(), npf2.y(), npf2.x(), npf2.y(), npf2.x(),
npf2.y(), npf2.x(), npf2.y());
cli.putPoints(cli.size(), Clip.size()-(ClRe2 + 2), Clip, ClRe2+2);
b->PoLine = cli.copy();
ClRe2 = -1;
b->ClipEdited = true;
edited = true;
}
}
if (edited)
{
{
if (b->PType != 7)
b->Clip = FlattenPath(b->PoLine, b->Segments);
AdjustItemSize(b);
3768,88 → 3750,90
update();
emit PStatus(b->PType, b->PoLine.size());
emit DocChanged();
qApp->setOverrideCursor(QCursor(pointingHandCursor), true);
}
qApp->setOverrideCursor(QCursor(pointingHandCursor), true);
}
MarkClip(b);
return;
}
}
if (GetItem(&b))
{
if (GroupSel)
{
if (GroupSel)
{
double gx, gy, gh, gw;
getGroupRectScreen(&gx, &gy, &gw, &gh);
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
{
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw),
static_cast<int>(gh)).intersects(mpo))
{
HowTo = 0;
if (QRect(static_cast<int>(gx+gw)-6, static_cast<int>(gy+gh)-6, 6, 6).intersects(mpo))
{
{
HowTo = 1;
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
}
}
if (HowTo != 0)
mCG = true;
}
}
else
SeleItem(m);
}
}
else
{
{
p.begin(this);
Transform(b, &p);
if (!QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(mpo))
{
if (!QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(mpo))
{
SeleItem(m);
if (SelItem.count() != 0)
storeUndoInf(SelItem.at(0));
}
}
else
{
{
SeleItem(m);
if (!b->Locked)
{
{
HandleSizer(&p, b, mpo);
if (HowTo != 0)
{
{
doku->UnData.UnCode = 2;
if (b->PType != 5)
b->Sizing = true;
mCG = true;
}
}
else
doku->UnData.UnCode = 1;
doku->UnDoValid = true;
emit UndoAvail();
}
}
}
p.end();
}
}
}
else
{
{
SeleItem(m);
if (SelItem.count() != 0)
storeUndoInf(SelItem.at(0));
}
}
if (m->button() == MidButton)
{
{
MidButt = true;
if (SelItem.count() != 0)
Deselect(true);
repaint();
}
}
if ((SelItem.count() != 0) && (m->button() == RightButton))
{
{
Mpressed = true;
Dxp = Mxp;
Dyp = Mxp;
}
}
break;
case 2:
SeleItem(m);
Deselect(false);
switch (doku->SubMode)
{
{
case 0:
z = PaintRect(Rxp, Ryp, 1+Rxpd, 1+Rypd, doku->Dwidth, doku->Dbrush, doku->Dpen);
SetupDraw(z);
3866,7 → 3850,7
SetupDraw(z);
emit HaveSel(6);
break;
}
}
break;
case 4:
SeleItem(m);
3894,54 → 3878,54
HanMove = false;
slotDoCurs(false);
if (GetItem(&b))
{
if (!b->Locked)
{
if (!b->Locked)
{
p.begin(this);
Transform(b, &p);
HandleSizer(&p, b, mpo);
p.end();
if (HowTo != 0)
{
{
HanMove = true;
return;
}
}
}
}
inText = slotSetCurs(m->x(), m->y());
if (!inText)
{
{
Deselect(true);
if (!SeleItem(m))
{
{
slotDoCurs(true);
emit Amode(1);
return;
}
}
}
b = doku->ActPage->SelItem.at(0);
oldCp = b->CPos;
slotDoCurs(true);
if ((!inText) && ((b->PType == 4) || (b->PType == 2)))
{
{
Deselect(true);
if (SeleItem(m))
{
{
b = doku->ActPage->SelItem.at(0);
if ((b->PType == 4) || (b->PType == 2))
emit Amode(7);
else
{
{
emit PaintingDone();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
}
}
else
{
{
emit PaintingDone();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
}
}
break;
case 8:
SeleItem(m);
3964,56 → 3948,60
break;
case 9:
if (GetItem(&b))
{
{
RotMode = doku->RotMode;
if (GroupSel)
{
{
double gx, gy, gh, gw;
double gxR, gyR, ghR, gwR;
getGroupRectScreen(&gx, &gy, &gw, &gh);
getGroupRect(&gxR, &gyR, &gwR, &ghR);
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
{
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw),
static_cast<int>(gh)).intersects(mpo))
{
doku->RotMode = 2;
RCenter = FPoint(gxR+gwR/2.0, gyR+ghR/2.0);
if (QRect(static_cast<int>(gx+gw)-6, static_cast<int>(gy+gh)-6, 6, 6).intersects(mpo))
{
{
RCenter = FPoint(gxR, gyR);
doku->RotMode = 0;
}
}
}
oldW = xy2Deg(m->x()/sc - RCenter.x(), m->y()/sc - RCenter.y());
doku->UnDoValid = false;
emit UndoAvail();
}
}
else
{
{
p.begin(this);
Transform(b, &p);
doku->RotMode = 2;
RCenter = transformPointI(FPoint(b->Xpos+b->Width/2, b->Ypos+b->Height/2), 0, 0, b->Rot, 1, 1);
if (QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(mpo))
if (QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(mpo))
{
if (p.xForm(QRect(static_cast<int>(b->Width)-6, static_cast<int>(b->Height)-6,
6, 6)).intersects(mpo))
{
if (p.xForm(QRect(static_cast<int>(b->Width)-6, static_cast<int>(b->Height)-6, 6, 6)).intersects(mpo))
{
RCenter = FPoint(b->Xpos, b->Ypos);
doku->RotMode = 0;
}
}
if (p.xForm(QRect(0, 0, 6, 6)).intersects(mpo))
{
RCenter = transformPointI(FPoint(b->Xpos+b->Width, b->Ypos+b->Height), 0, 0, b->Rot, 1, 1);
{
RCenter = transformPointI(FPoint(b->Xpos+b->Width, b->Ypos+b->Height), 0, 0,
b->Rot, 1, 1);
doku->RotMode = 4;
}
}
if (p.xForm(QRect(0, static_cast<int>(b->Height)-6, 6, 6)).intersects(mpo))
{
{
RCenter = transformPointI(FPoint(b->Xpos+b->Width, b->Ypos), 0, 0, b->Rot, 1, 1);
doku->RotMode = 1;
}
}
if (p.xForm(QRect(static_cast<int>(b->Width)-6, 0, 6, 6)).intersects(mpo))
{
{
RCenter = transformPointI(FPoint(b->Xpos, b->Ypos+b->Height), 0, 0, b->Rot, 1, 1);
doku->RotMode = 3;
}
}
oldW = xy2Deg(m->x()/sc - RCenter.x(), m->y()/sc - RCenter.y());
doku->UnData.UnCode = 3;
storeUndoInf(b);
4020,66 → 4008,62
doku->UnDoValid = true;
emit UndoAvail();
p.end();
}
}
}
}
break;
case 10:
b = doku->ElemToLink;
SeleItem(m);
if (GetItem(&bb))
{
if ((bb->Ptext.count() == 0) && (bb->BackBox == 0) && (b != bb))
{
if ((bb->Ptext.count() == 0) && (bb->BackBox == 0) && (b != bb))
{
b->NextBox = bb;
bb->BackBox = b;
if ((bb->ItemNr < b->ItemNr) && (bb->OwnPage == b->OwnPage))
{
{
Items.insert(b->ItemNr+1, bb);
bb = Items.take(bb->ItemNr);
for (uint a = 0; a < Items.count(); ++a)
{
{
Items.at(a)->ItemNr = a;
if (Items.at(a)->isBookmark)
emit NewBMNr(Items.at(a)->BMnr, a);
}
}
}
b->OwnPage->repaint();
}
}
emit DocChanged();
}
}
doku->ElemToLink = 0;
break;
case 11:
SeleItem(m);
if (GetItem(&b))
{
if (b->BackBox != 0)
{
if (b->BackBox != 0)
if (b->NextBox != 0)
{
if (b->NextBox != 0)
{
PageItem* nb = b->NextBox;
while (nb != 0)
{
{
uint a = nb->Ptext.count();
for (uint s=0; s<a; ++s)
{
b->Ptext.append(nb->Ptext.take(0));
}
nb = nb->NextBox;
}
}
}
uint a2 = b->Ptext.count();
for (uint s = 0; s < a2; ++s)
{
b->BackBox->Ptext.append(b->Ptext.take(0));
}
b->BackBox->NextBox = 0;
b->BackBox = 0;
}
}
emit DocChanged();
b->OwnPage->repaint();
}
}
break;
case 12:
{
4093,10 → 4077,11
b->PoLine.setPoint(0, np);
b->PoLine.setPoint(1, np);
for (uint ax = 1; ax < cli.size(); ++ax)
{
{
np = FPoint(cli.point(ax));
b->PoLine.putPoints(b->PoLine.size(), 4, np.x(), np.y(), np.x(), np.y(), np.x(), np.y(), np.x(), np.y());
}
b->PoLine.putPoints(b->PoLine.size(), 4, np.x(), np.y(), np.x(), np.y(), np.x(), np.y(),
np.x(), np.y());
}
np = FPoint(cli.point(0));
b->PoLine.putPoints(b->PoLine.size(), 2, np.x(), np.y(), np.x(), np.y());
b->Clip = FlattenPath(b->PoLine, b->Segments);
4119,7 → 4104,7
if (m->button() == RightButton)
break;
if (FirstPoly)
{
{
SeleItem(m);
Deselect(false);
z = PaintPolyLine(Rxp, Ryp, 1+Rxpd, 1+Rypd, doku->Dwidth, "None", doku->Dpen);
4129,7 → 4114,7
b->Select = true;
qApp->setOverrideCursor(QCursor(crossCursor), true);
FirstPoly = false;
}
}
b = SelItem.at(0);
p.begin(this);
Transform(b, &p);
4139,20 → 4124,20
b->PoLine.addPoint(npf);
npf2 = GetMinClipF(b->PoLine);
if (npf2.x() < 0)
{
{
b->PoLine.translate(-npf2.x(), 0);
MoveItem(npf2.x(), 0, b);
}
}
if (npf2.y() < 0)
{
{
b->PoLine.translate(0, -npf2.y());
MoveItem(0, npf2.y(), b);
}
}
SizeItem(b->PoLine.WidthHeight().x(), b->PoLine.WidthHeight().y(), b->ItemNr, false, false);
SetPolyClip(b, qRound(QMAX(b->Pwidth / 2, 1)), qRound(QMAX(b->Pwidth / 2, 1)));
b->paintObj();
if (b->PoLine.size() > 2)
{
{
p.begin(this);
Transform(b, &p);
p.setPen(QPen(black, 1, DotLine, FlatCap, MiterJoin));
4160,7 → 4145,7
p.xFormDev(m->pos()), b->PoLine.pointQ(b->PoLine.size()-1));
p.drawCubicBezier(Bez);
p.end();
}
}
emit ItemPos(b->Xpos, b->Ypos);
emit SetSizeValue(b->Pwidth);
emit SetLineArt(b->PLineArt, b->PLineEnd, b->PLineJoin);
4182,7 → 4167,7
b = Items.at(z);
b->isAnnotation = true;
switch (doku->AppMode)
{
{
case 14:
b->AnType = 2;
b->AnFlag = 65536;
4217,7 → 4202,7
RecordP.resize(0);
Deselect(false);
break;
}
}
}
 
void Page::HandleCurs(QPainter *p, PageItem *b, QRect mpo)
4226,77 → 4211,54
tx = p->xForm(QRect(static_cast<int>(b->Width)-6, 0, 6, 6));
tx2 = p->xForm(QRect(0, static_cast<int>(b->Height)-6, 6, 6));
if (tx.intersects(mpo) || tx2.intersects(mpo))
{
{
if (doku->AppMode == 9)
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
else
{
{
double rr = fabs(b->Rot);
if ((rr >= 0.0) && (rr < 45.0))
if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) || ((rr >=315.0) && (rr <= 360.0)))
qApp->setOverrideCursor(QCursor(SizeBDiagCursor), true);
if ((rr >= 45.0) && (rr < 135.0))
if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
if ((rr >= 135.0) && (rr < 225.0))
qApp->setOverrideCursor(QCursor(SizeBDiagCursor), true);
if ((rr >= 225.0) && (rr < 315.0))
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
if ((rr >= 315.0) && (rr <= 360.0))
qApp->setOverrideCursor(QCursor(SizeBDiagCursor), true);
}
}
}
tx = p->xForm(QRect(static_cast<int>(b->Width)-6, static_cast<int>(b->Height)/2 - 3, 6, 6));
tx2 = p->xForm(QRect(0, static_cast<int>(b->Height)/2 - 3, 6, 6));
if (tx.intersects(mpo) || tx2.intersects(mpo))
{
{
double rr = fabs(b->Rot);
if ((rr >= 0.0) && (rr < 45.0))
if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) || ((rr >= 315.0) && (rr <= 360.0)))
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
if ((rr >= 45.0) && (rr < 135.0))
if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
qApp->setOverrideCursor(QCursor(SizeVerCursor), true);
if ((rr >= 135.0) && (rr < 225.0))
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
if ((rr >= 225.0) && (rr < 315.0))
qApp->setOverrideCursor(QCursor(SizeVerCursor), true);
if ((rr >= 315.0) && (rr <= 360.0))
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
}
}
tx = p->xForm(QRect(static_cast<int>(b->Width)/2 - 3, 0, 6, 6));
tx2 = p->xForm(QRect(static_cast<int>(b->Width)/2 - 3, static_cast<int>(b->Height)-6, 6, 6));
if (tx.intersects(mpo) || tx2.intersects(mpo))
{
{
double rr = fabs(b->Rot);
if ((rr >= 0.0) && (rr < 45.0))
if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) || ((rr >= 315.0) && (rr <= 360.0)))
qApp->setOverrideCursor(QCursor(SizeVerCursor), true);
if ((rr >= 45.0) && (rr < 135.0))
if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
if ((rr >= 135.0) && (rr < 225.0))
qApp->setOverrideCursor(QCursor(SizeVerCursor), true);
if ((rr >= 225.0) && (rr < 315.0))
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
if ((rr >= 315.0) && (rr <= 360.0))
qApp->setOverrideCursor(QCursor(SizeVerCursor), true);
}
}
tx = p->xForm(QRect(static_cast<int>(b->Width)-6, static_cast<int>(b->Height)-6, 6, 6));
tx2 = p->xForm(QRect(0, 0, 6, 6));
if (tx.intersects(mpo) || tx2.intersects(mpo))
{
{
if (doku->AppMode == 9)
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
else
{
{
double rr = fabs(b->Rot);
if ((rr >= 0.0) && (rr < 45.0))
if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) ||
((rr >= 315.0) && (rr <= 360.0)))
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
if ((rr >= 45.0) && (rr < 135.0))
if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
qApp->setOverrideCursor(QCursor(SizeBDiagCursor), true);
if ((rr >= 135.0) && (rr < 225.0))
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
if ((rr >= 225.0) && (rr < 315.0))
qApp->setOverrideCursor(QCursor(SizeBDiagCursor), true);
if ((rr >= 315.0) && (rr <= 360.0))
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
}
}
}
if (doku->EditClip)
qApp->setOverrideCursor(QCursor(crossCursor), true);
}
4309,7 → 4271,7
b->OldH2 = b->Height;
HowTo = 0;
if (b->PType != 5)
{
{
if (p->xForm(QRect(0, 0, 6, 6)).intersects(mpo))
HowTo = 2;
if (p->xForm(QRect(static_cast<int>(b->Width/2) - 3, 0, 6, 6)).intersects(mpo))
4316,7 → 4278,8
HowTo = 8;
if (p->xForm(QRect(0, static_cast<int>(b->Height)/2 - 3, 6, 6)).intersects(mpo))
HowTo = 7;
if (p->xForm(QRect(static_cast<int>(b->Width) - 6, static_cast<int>(b->Height)/2 - 3, 6, 6)).intersects(mpo))
if (p->xForm(QRect(static_cast<int>(b->Width) - 6, static_cast<int>(b->Height)/2 - 3,
6, 6)).intersects(mpo))
HowTo = 6;
if (p->xForm(QRect(static_cast<int>(b->Width)/2 - 3, static_cast<int>(b->Height)-6, 6, 6)).intersects(mpo))
HowTo = 5;
4324,13 → 4287,13
HowTo = 4;
if (p->xForm(QRect(static_cast<int>(b->Width)-6, 0, 6, 6)).intersects(mpo))
HowTo = 3;
}
}
if (p->xForm(QRect(static_cast<int>(b->Width)-6, static_cast<int>(b->Height)-6, 6, 6)).intersects(mpo))
HowTo = 1;
HandleCurs(p, b, mpo);
storeUndoInf(b);
if (HowTo != 0)
{
{
doku->UnData.UnCode = 2;
if (b->PType != 5)
b->Sizing = true;
4337,7 → 4300,7
mCG = true;
doku->UnDoValid = true;
emit UndoAvail();
}
}
}
 
FPoint Page::GetMinClipF(FPointArray Clip)
4346,7 → 4309,7
double mx = 99999;
double my = 99999;
for (uint c = 0; c < Clip.size(); ++c)
{
{
np = Clip.point(c);
if (np.x() > 900000)
continue;
4354,7 → 4317,7
mx = np.x();
if (np.y() < my)
my = np.y();
}
}
rp = FPoint(mx, my);
return rp;
}
4365,13 → 4328,13
int mx = 99999;
int my = 99999;
for (uint c = 0; c < Clip.size(); ++c)
{
{
np = Clip.point(c);
if (np.x() < mx)
mx = np.x();
if (np.y() < my)
my = np.y();
}
}
rp = QPoint(mx, my);
return rp;
}
4382,13 → 4345,13
int mx = 0;
int my = 0;
for (uint c = 0; c < Clip.size(); ++c)
{
{
np = Clip.point(c);
if (np.x() > mx)
mx = np.x();
if (np.y() > my)
my = np.y();
}
}
rp = QPoint(mx, my);
return rp;
}
4403,25 → 4366,26
Myp = static_cast<int>(m.y()/sc);
ClRe = -1;
if (doku->ActPage != this)
{
{
Deselect(true);
doku->ActPage = this;
emit PgCh(PageNr);
}
}
if (doku->DragP)
return false;
for (a = 0; a < Items.count(); ++a)
{
if (b->LayerNr == doku->ActiveLayer)
{
if (b->LayerNr == doku->ActiveLayer)
{
p.begin(this);
Transform(b, &p);
if (QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(m))
if (QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(m))
{
if ((b->PType == 4) || (b->PType == 2))
{
if ((b->PType == 4) || (b->PType == 2))
if (!b->Select)
{
if (!b->Select)
{
b->Select = true;
b->FrameOnly = true;
b->paintObj();
4428,20 → 4392,20
SelItem.append(b);
emit HaveSel(b->PType);
EmitValues(b);
}
}
p.end();
if (SelItem.count() > 1)
{
if (SelItem.count() > 1)
{
setGroupRect();
paintGroupRect();
}
}
return true;
}
}
}
p.end();
}
}
b = Items.prev();
}
}
return false;
}
 
4458,93 → 4422,94
mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
ClRe = -1;
if (doku->ActPage != this)
{
{
Deselect(false);
doku->ActPage = this;
emit PgCh(PageNr);
}
}
if ((m->state() == ControlButton) && (SelItem.count() != 0))
{
for (a = 0; a < Items.count(); ++a)
{
for (a = 0; a < Items.count(); ++a)
if (b->Select)
{
if (b->Select)
if (b->ItemNr == 0)
{
if (b->ItemNr == 0)
{
b = Items.last();
break;
}
}
b = Items.prev();
break;
}
}
b = Items.prev();
}
}
}
for (a = 0; a < Items.count(); ++a)
{
{
if (b == NULL)
return false;
if (b->LayerNr == doku->ActiveLayer)
{
{
p.begin(this);
Transform(b, &p);
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(mpo)) ||
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(mpo)) ||
(QRegion(p.xForm(b->Clip)).contains(mpo)))
{
if (!b->Select)
{
if (!b->Select)
{
if ((m->state() != ShiftButton) || (doku->AppMode == 10) || (doku->AppMode == 11))
Deselect(false);
if (b->Groups.count() != 0)
{
if (SelItem.count() != 0)
{
if (SelItem.count() != 0)
{
if (SelItem.find(b) == -1)
SelItem.append(b);
}
}
else
SelItem.append(b);
for (uint ga=0; ga<Items.count(); ++ga)
{
if (Items.at(ga)->Groups.count() != 0)
{
if (Items.at(ga)->Groups.count() != 0)
if (Items.at(ga)->Groups.top() == b->Groups.top())
{
if (Items.at(ga)->Groups.top() == b->Groups.top())
if (Items.at(ga)->ItemNr != b->ItemNr)
{
if (Items.at(ga)->ItemNr != b->ItemNr)
{
if (SelItem.find(Items.at(ga)) == -1)
SelItem.append(Items.at(ga));
}
}
Items.at(ga)->Select = true;
Items.at(ga)->FrameOnly = true;
Items.at(ga)->paintObj();
}
}
}
}
}
else
{
{
SelItem.append(b);
b->Select = true;
b->FrameOnly = true;
b->paintObj();
}
}
}
else
{
if (SelItem.count() > 1)
{
if (SelItem.count() > 1)
{
PageItem *bb = SelItem.at(0);
SelItem.remove(b);
SelItem.prepend(b);
PageItem *bb = SelItem.at(0);
SelItem.remove(b);
SelItem.prepend(b);
b->FrameOnly = true;
b->paintObj();
bb->FrameOnly = true;
bb->paintObj();
}
}
if (SelItem.count() > 1)
{
}
if (SelItem.count() > 1)
{
setGroupRect();
paintGroupRect();
double x, y, w, h;
4552,72 → 4517,72
emit ItemPos(x, y);
emit ItemGeom(w, h);
emit HaveSel(b->PType);
}
}
else
{
{
EmitValues(b);
emit HaveSel(b->PType);
if (b->PType == 5)
emit ItemGeom(b->Width, b->Height);
}
tx = p.xForm(QRect(static_cast<int>(b->Width-6), static_cast<int>(b->Height-6), 6, 6));
}
tx = p.xForm(QRect(static_cast<int>(b->Width-6), static_cast<int>(b->Height-6), 6, 6));
if (tx.contains(mpo))
{
{
mCG = true;
HowTo = 1;
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
}
}
else
{
{
tx = p.xForm(QRect(0, 0, 6, 6));
if (tx.contains(mpo))
{
{
mCG = true;
HowTo = 2;
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
}
}
else
{
{
mCG = false;
qApp->setOverrideCursor(QCursor(SizeAllCursor), true);
}
}
}
p.end();
return true;
}
}
p.end();
}
}
b = Items.prev();
}
}
if ((doku->Guides) && (doku->AppMode == 1) && (!doku->GuideLock))
{
if (YGuides.count() != 0)
{
if (YGuides.count() != 0)
for (uint yg = 0; yg < YGuides.count(); ++yg)