Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4688 → Rev 4689

/branches/Version13x/Scribus/scribus/fileloader.cpp
1786,7 → 1786,7
 
void FileLoader::GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, bool impo, bool VorLFound)
{
struct ScText *hg;
ScText *hg;
Foi* dummy;
bool unknown = false;
QString tmp2, tmpf;
/branches/Version13x/Scribus/scribus/mpalette.h
39,6 → 39,7
#include "linecombo.h"
#include "spalette.h"
#include "fontcombo.h"
#include "colorcombo.h"
class StyleSelect;
#include "alignselect.h"
#include "shadebutton.h"
404,10 → 405,10
QComboBox* InputP;
QComboBox* MonitorI;
QComboBox* LineMode;
QComboBox* TxStroke;
ColorCombo* TxStroke;
QComboBox* LJoinStyle;
QComboBox* LEndStyle;
QComboBox* TxFill;
ColorCombo* TxFill;
 
QListBox* StyledLine;
 
/branches/Version13x/Scribus/scribus/tabtools.h
27,6 → 27,7
class MSpinBox;
class LineCombo;
class ScribusDoc;
class ColorCombo;
 
class SCRIBUS_API TabTools : public QWidget
{
59,10 → 60,10
QLabel* previewText;
FontCombo* fontComboText;
QComboBox* sizeComboText;
QComboBox* colorComboText;
QComboBox* colorComboStrokeText;
QComboBox* colorComboTextBackground;
QComboBox* colorComboTextLine;
ColorCombo* colorComboText;
ColorCombo* colorComboStrokeText;
ColorCombo* colorComboTextBackground;
ColorCombo* colorComboTextLine;
QSpinBox* shadingText;
QSpinBox* shadingTextStroke;
QSpinBox* shadingTextBack;
83,15 → 84,15
QLabel* textLabel11b;
LineCombo* comboStyleShape;
QSpinBox* shadingFillShape;
QComboBox* comboFillShape;
ColorCombo* comboFillShape;
QSpinBox* shadingLineShape;
QLabel* textLabel7b;
QComboBox* colorComboLineShape;
ColorCombo* colorComboLineShape;
QLabel* textLabel8b;
QWidget* subTabLine;
MSpinBox* lineWidthLine;
QSpinBox* shadingLine;
QComboBox* colorComboLine;
ColorCombo* colorComboLine;
QLabel* textLabel13b;
QLabel* textLabel14b;
QLabel* textLabel15b;
98,7 → 99,7
QLabel* textLabel16b;
LineCombo* comboStyleLine;
QWidget* subTabImage;
QComboBox* comboFillImage;
ColorCombo* comboFillImage;
QLabel* textLabel19b;
QSpinBox* shadingFillImage;
QLabel* textLabel20b;
/branches/Version13x/Scribus/scribus/gtaction.cpp
168,7 → 168,7
{
if ((text.at(a) == QChar(0)) || (text.at(a) == QChar(13)))
continue;
struct ScText *hg = new ScText;
ScText *hg = new ScText;
hg->ch = text.at(a);
if ((hg->ch == QChar(10)) || (hg->ch == QChar(5)))
hg->ch = QChar(13);
/branches/Version13x/Scribus/scribus/mpalette.cpp
19,6 → 19,7
#include "arrowchooser.h"
#include "autoform.h"
#include "commonstrings.h"
#include "colorm.h"
#include "cpalette.h"
#include "sccombobox.h"
#include "scfonts.h"
510,7 → 511,7
StrokeIcon->setPixmap(loadIcon("Stiftalt.xpm"));
StrokeIcon->setScaledContents( false );
layout23->addWidget( StrokeIcon );
TxStroke = new ScComboBox( false, page_3, "TxStroke" );
TxStroke = new ColorCombo( false, page_3, "TxStroke" );
layout23->addWidget( TxStroke );
ShadeTxt1 = new QLabel( "", page_3, "ShadeTxt" );
ShadeTxt1->setPixmap(loadIcon("shade.png"));
523,7 → 524,7
FillIcon = new QLabel( "", page_3, "FillIcon" );
FillIcon->setPixmap(loadIcon("fill.png"));
layout24->addWidget( FillIcon );
TxFill = new ScComboBox( false, page_3, "TxFill" );
TxFill = new ColorCombo( false, page_3, "TxFill" );
layout24->addWidget( TxFill );
ShadeTxt2 = new QLabel("", page_3, "ShadeTxt" );
ShadeTxt2->setPixmap(loadIcon("shade.png"));
3289,9 → 3290,8
ColorList::Iterator itend=doc->PageColors.end();
for (ColorList::Iterator it = doc->PageColors.begin(); it != itend; ++it)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[it.key()].getRawRGBColor());
TxFill->insertItem(*pm, it.key());
TxStroke->insertItem(*pm, it.key());
TxFill->insertSmallItem( doc->PageColors[it.key()], it.key() );
TxStroke->insertSmallItem( doc->PageColors[it.key()], it.key() );
}
TxFill->listBox()->setMinimumWidth(TxFill->listBox()->maxItemWidth()+24);
TxStroke->listBox()->setMinimumWidth(TxStroke->listBox()->maxItemWidth()+24);
/branches/Version13x/Scribus/scribus/pslib.h
99,7 → 99,7
virtual void HandleGradient(PageItem *c, double w, double h, bool gcr);
virtual void SetFarbe(QString farb, int shade, int *h, int *s, int *v, int *k, bool gcr);
virtual void setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, Page* pg, bool sep, bool farb, bool ic, bool master);
virtual void setTextCh(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, uint d, struct ScText *hl, Page* pg, bool sep, bool farb, bool ic, bool master);
virtual void setTextCh(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, uint d, ScText *hl, Page* pg, bool sep, bool farb, bool ic, bool master);
bool Art;
private:
void PutSeite(QString c);
/branches/Version13x/Scribus/scribus/prefs.cpp
49,6 → 49,7
#include "pluginmanagerprefsgui.h"
#include "scplugin.h"
#include "sccombobox.h"
#include "colorcombo.h"
#include "commonstrings.h"
 
using namespace std;
/branches/Version13x/Scribus/scribus/cpalette.cpp
35,6 → 35,7
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qspinbox.h>
#include "colorm.h"
#include "sccombobox.h"
#include "scribusdoc.h"
#include "mspinbox.h"
134,7 → 135,7
freeGradientLayout->addMultiCellWidget(gradEditButton, 2, 2, 0, 3);
GradLayout->addWidget( freeGradientQFrame );
Form1Layout->addLayout(GradLayout);
colorListQLBox = new QListBox(this, "colorListQLBox");
colorListQLBox = new ColorListBox(this, "colorListQLBox");
colorListQLBox->setMinimumSize( QSize( 150, 30 ) );
colorListQLBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
Form1Layout->addWidget(colorListQLBox);
232,13 → 233,14
colorListQLBox->clear();
if ((!GradientMode) || (Mode == 1))
colorListQLBox->insertItem( tr("None"));
ColorList::Iterator itend=colorList.end();
colorListQLBox->updateBox(colorList, ColorListBox::fancyPixmap, false);
/*ColorList::Iterator itend=colorList.end();
for (ColorList::Iterator it = colorList.begin(); it != itend; ++it)
{
ScColor col = colorList[it.key()];
QPixmap * pm = getFancyPixmap(col);
colorListQLBox->insertItem(*pm, it.key());
}
}*/
colorListQLBox->setSelected(colorListQLBox->currentItem(), false);
connect(colorListQLBox, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selectColor(QListBoxItem*)));
connect(colorListQLBox, SIGNAL(selected(QListBoxItem*)), this, SLOT(selectColor(QListBoxItem*)));
/branches/Version13x/Scribus/scribus/Makefile.am
45,6 → 45,7
colorchart.cpp \
colorm.cpp \
colorsetmanager.cpp \
colorcombo.cpp \
commonstrings.cpp \
cpalette.cpp \
cupsoptions.cpp \
268,6 → 269,7
$(INSTALL_DATA) $(srcdir)/collect4output.h $(prefix)/include/scribus/collect4output.h
$(INSTALL_DATA) $(srcdir)/color.h $(prefix)/include/scribus/color.h
$(INSTALL_DATA) $(srcdir)/colorchart.h $(prefix)/include/scribus/colorchart.h
$(INSTALL_DATA) $(srcdir)/colorcombo.h $(prefix)/include/scribus/colorcombo.h
$(INSTALL_DATA) $(srcdir)/colorm.h $(prefix)/include/scribus/colorm.h
$(INSTALL_DATA) $(srcdir)/cpalette.h $(prefix)/include/scribus/cpalette.h
$(INSTALL_DATA) $(srcdir)/crypt.h $(prefix)/include/scribus/crypt.h
393,6 → 395,7
$(INSTALL_DATA) $(srcdir)/scribuswin.h $(prefix)/include/scribus/scribuswin.h
$(INSTALL_DATA) $(srcdir)/scribusXml.h $(prefix)/include/scribus/scribusXml.h
$(INSTALL_DATA) $(srcdir)/scrpalettebase.h $(prefix)/include/scribus/scrpalettebase.h
$(INSTALL_DATA) $(srcdir)/scpixmapcache.h $(prefix)/include/scribus/scpixmapcache.h
$(INSTALL_DATA) $(srcdir)/search.h $(prefix)/include/scribus/search.h
$(INSTALL_DATA) $(srcdir)/seiten.h $(prefix)/include/scribus/seiten.h
$(INSTALL_DATA) $(srcdir)/selection.h $(prefix)/include/scribus/selection.h
452,6 → 455,7
-rm -f $(prefix)/include/scribus/collect4output.h
-rm -f $(prefix)/include/scribus/color.h
-rm -f $(prefix)/include/scribus/colorchart.h
-rm -f $(prefix)/include/scribus/colorcombo.h
-rm -f $(prefix)/include/scribus/colorm.h
-rm -f $(prefix)/include/scribus/cpalette.h
-rm -f $(prefix)/include/scribus/crypt.h
571,6 → 575,7
-rm -f $(prefix)/include/scribus/scribuswin.h
-rm -f $(prefix)/include/scribus/scribusXml.h
-rm -f $(prefix)/include/scribus/scrpalettebase.h
-rm -f $(prefix)/include/scribus/scpixmapcache.h
-rm -f $(prefix)/include/scribus/search.h
-rm -f $(prefix)/include/scribus/seiten.h
-rm -f $(prefix)/include/scribus/selection.h
/branches/Version13x/Scribus/scribus/search.cpp
20,7 → 20,9
#include <qwhatsthis.h>
#include <qmessagebox.h>
 
#include "colorm.h"
#include "commonstrings.h"
#include "colorcombo.h"
#include "fontcombo.h"
#include "mspinbox.h"
#include "page.h"
42,7 → 44,6
{
setCaption( tr( "Search/Replace" ) );
setIcon(loadIcon("AppIcon.png"));
QPixmap * pm;
ColorList::Iterator it;
Item = ite;
Doc = doc;
118,13 → 119,12
SEffVal->setStyle(0);
SEffVal->setEnabled(false);
SearchLayout->addWidget( SEffVal, 4, 1, Qt::AlignLeft );
SFillVal = new QComboBox( true, Search, "SFillVal" );
SFillVal = new ColorCombo( true, Search, "SFillVal" );
SFillVal->setEditable(false);
SFillVal->insertItem( tr("None"));
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getWidePixmap(doc->PageColors[it.key()].getRawRGBColor());
SFillVal->insertItem(*pm, it.key());
SFillVal->insertWideItem( doc->PageColors[it.key()], it.key() );
}
SFillVal->listBox()->setMinimumWidth(SFillVal->listBox()->maxItemWidth()+24);
SFillVal->setCurrentText(doc->CurrTextFill);
133,13 → 133,12
SFillSVal = new ShadeButton(Search);
SFillSVal->setEnabled(false);
SearchLayout->addWidget( SFillSVal, 6, 1, Qt::AlignLeft );
SStrokeVal = new QComboBox( true, Search, "SStrokeVal" );
SStrokeVal = new ColorCombo( true, Search, "SStrokeVal" );
SStrokeVal->setEditable(false);
SStrokeVal->insertItem( tr("None"));
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getWidePixmap(doc->PageColors[it.key()].getRawRGBColor());
SStrokeVal->insertItem(*pm, it.key());
SStrokeVal->insertWideItem( doc->PageColors[it.key()], it.key() );
}
SStrokeVal->listBox()->setMinimumWidth(SStrokeVal->listBox()->maxItemWidth()+24);
SStrokeVal->setCurrentText(doc->CurrTextStroke);
216,13 → 215,12
REffVal->setStyle(0);
REffVal->setEnabled(false);
ReplaceLayout->addWidget( REffVal, 4, 1, Qt::AlignLeft );
RFillVal = new QComboBox( true, Replace, "RFillVal" );
RFillVal = new ColorCombo( true, Replace, "RFillVal" );
RFillVal->setEditable(false);
RFillVal->insertItem( tr("None"));
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getWidePixmap(doc->PageColors[it.key()].getRawRGBColor());
RFillVal->insertItem(*pm, it.key());
RFillVal->insertWideItem( doc->PageColors[it.key()], it.key() );
}
RFillVal->listBox()->setMinimumWidth(RFillVal->listBox()->maxItemWidth()+24);
RFillVal->setCurrentText(doc->CurrTextFill);
231,13 → 229,12
RFillSVal = new ShadeButton(Replace);
RFillSVal->setEnabled(false);
ReplaceLayout->addWidget( RFillSVal, 6, 1, Qt::AlignLeft );
RStrokeVal = new QComboBox( true, Replace, "RStrokeVal" );
RStrokeVal = new ColorCombo( true, Replace, "RStrokeVal" );
RStrokeVal->setEditable(false);
RStrokeVal->insertItem( tr("None"));
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getWidePixmap(doc->PageColors[it.key()].getRawRGBColor());
RStrokeVal->insertItem(*pm, it.key());
RStrokeVal->insertWideItem( doc->PageColors[it.key()], it.key() );
}
RStrokeVal->listBox()->setMinimumWidth(RStrokeVal->listBox()->maxItemWidth()+24);
RStrokeVal->setCurrentText(doc->CurrTextStroke);
675,7 → 672,7
{
QString repl, sear;
uint cs, cx;
struct ScText *hg;
ScText *hg;
if (RText->isChecked())
{
repl = RTextVal->text();
/branches/Version13x/Scribus/scribus/multiline.cpp
10,6 → 10,7
#include <qpainter.h>
#include <qmessagebox.h>
 
#include "colorm.h"
#include "sccombobox.h"
#include "scribusdoc.h"
#include "page.h"
102,11 → 103,9
layout4 = new QHBoxLayout( 0, 0, 6, "layout4");
Color = new ScComboBox( false, Properties, "Color" );
ColorList::Iterator it;
QPixmap * pm;
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getWidePixmap(doc->PageColors[it.key()].getRawRGBColor());
Color->insertItem(*pm, it.key());
Color->listBox()->insertItem( new ColorWidePixmapItem(doc->PageColors[it.key()], it.key()) );
}
layout4->addWidget( Color );
Shade = new QSpinBox( Properties, "Shade" );
/branches/Version13x/Scribus/scribus/serializer.cpp
57,7 → 57,7
 
void Serializer::GetText(PageItem *Item, int Absatz, QString font, int size, bool Append)
{
struct ScText *hg;
ScText *hg;
PageItem *nextItem;
PageItem *it = Item;
ScribusDoc* doku = it->document();
/branches/Version13x/Scribus/scribus/annot.cpp
16,6 → 16,7
#include <qstringlist.h>
#include <qdatetime.h>
#include <qpixmap.h>
#include "colorm.h"
#include "prefsmanager.h"
#include "prefsfile.h"
#include "scimage.h"
26,8 → 27,9
#include "prefscontext.h"
#include "scribusstructs.h"
#include "commonstrings.h"
#include "sccombobox.h"
#include "colorcombo.h"
 
 
extern QPixmap loadIcon(QString nam);
 
Annot::Annot(QWidget* parent, PageItem *it, int Seite, int b, int h, ColorList Farben, ScribusView* vie)
152,16 → 154,14
TextLabel40a = new QLabel( GroupBox20, "TextLabel4a" );
TextLabel40a->setText( tr( "Color:" ) );
GroupBox20Layout->addWidget( TextLabel40a, 0, 0 );
BorderC = new QComboBox( true, GroupBox20, "BorderC" );
BorderC = new ColorCombo( true, GroupBox20, "BorderC" );
ColorList::Iterator cit;
QPixmap * pm;
BorderC->insertItem( tr("None"));
if (item->annotation().borderColor() == CommonStrings::None)
BorderC->setCurrentItem(BorderC->count()-1);
for (cit = Farben.begin(); cit != Farben.end(); ++cit)
{
pm = getSmallPixmap(Farben[cit.key()].getRawRGBColor());
BorderC->insertItem(*pm, cit.key());
BorderC->insertSmallItem(Farben[cit.key()], cit.key());
if (cit.key() == item->annotation().borderColor())
BorderC->setCurrentItem(BorderC->count()-1);
}
/branches/Version13x/Scribus/scribus/reformdoc.cpp
33,6 → 33,7
#include "page.h"
#include "prefsmanager.h"
#include "pagelayout.h"
#include "colorcombo.h"
#include "fontcombo.h"
#include "linecombo.h"
#include "arrowchooser.h"
/branches/Version13x/Scribus/scribus/pdflib.cpp
2894,7 → 2894,7
{
if ((!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
struct ScText hl2;
ScText hl2;
double wt = Cwidth(&doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), hl->csize);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
2924,7 → 2924,7
hl2.xp = sPos + wt * cx;
if ((hl2.cstyle & 256) && (hl2.cstroke != CommonStrings::None))
{
struct ScText hl3;
ScText hl3;
hl3.ch = hl2.ch;
hl3.ccolor = hl2.cstroke;
hl3.cstroke = hl2.cstroke;
2961,7 → 2961,7
continue;
if ((hl->cstyle & 256) && (hl->cstroke != CommonStrings::None))
{
struct ScText hl2;
ScText hl2;
hl2.ch = hl->ch;
hl2.ccolor = hl->cstroke;
hl2.cstroke = hl->cstroke;
/branches/Version13x/Scribus/scribus/main_win32.cpp
77,8 → 77,10
int mainApp(ScribusQApp& app)
{
int appRetVal;
#ifndef _DEBUG
__try
{
#endif
app.parseCommandLine();
if (app.usingGUI())
{
86,11 → 88,13
if (appRetVal != EXIT_FAILURE)
appRetVal = app.exec();
}
#ifndef _DEBUG
}
__except( exceptionFilter(GetExceptionCode()) )
{
defaultCrashHandler( GetExceptionCode() );
}
#endif
return appRetVal;
}
 
104,7 → 108,7
*/
LONG exceptionFilter(DWORD exceptionCode)
{
LONG result;
LONG result;
switch( exceptionCode )
{
case EXCEPTION_ACCESS_VIOLATION:
/branches/Version13x/Scribus/scribus/cpalette.h
42,6 → 42,7
class QLabel;
class QSpinBox;
class DynamicTip;
class ColorListBox;
class MSpinBox;
 
/**
108,7 → 109,7
DynamicTip* dynTip;
QListBox *colorListQLBox;
ColorListBox *colorListQLBox;
QToolButton *Inhalt;
QToolButton *Innen;
QSpinBox *PM1;
/branches/Version13x/Scribus/scribus/charselect.cpp
785,7 → 785,7
}
if (ite->HasSel)
ite->asTextFrame()->deleteSelectedTextFromFrame();
struct ScText *hg;
ScText *hg;
for (uint a=0; a<chToIns.length(); ++a)
{
hg = new ScText;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
68,7 → 68,7
tmp2.replace(QRegExp("\t"), QChar(4));
tmpf = it->attribute("CFONT", doc->toolSettings.defFont);
bool unknown = false;
struct ScText *hg;
ScText *hg;
Foi* dummy;
if ((!prefsManager->appPrefs.AvailFonts.find(tmpf)) || (!prefsManager->appPrefs.AvailFonts[tmpf]->UseFont))
{
/branches/Version13x/Scribus/scribus/pageitem_pathtext.cpp
68,7 → 68,7
int chs;
double wide;
QString chx, chx2, chx3;
struct ScText *hl;
ScText *hl;
struct ZZ *Zli;
double dx;
double sp = 0;
/branches/Version13x/Scribus/scribus/story.cpp
20,7 → 20,7
* (at your option) any later version. *
* *
***************************************************************************/
#include "sccombobox.h"
#include "colorcombo.h"
#include "scfonts.h"
#include "story.h"
#include "story.moc"
37,6 → 37,7
#include "actionmanager.h"
#include "alignselect.h"
#include "charselect.h"
#include "colorm.h"
#include "commonstrings.h"
#include "customfdialog.h"
#include "editformats.h"
723,7 → 724,7
if (p != 0)
{
c = StyledText.at(p-1)->count()-1;
struct ScText *hg;
ScText *hg;
hg = new ScText;
hg->ch = QChar(13);
chars = StyledText.at(p-1);
787,7 → 788,7
chars = StyledText.at(p);
for (uint c = 0; c < chars->count(); ++c)
{
struct ScText *hg;
ScText *hg;
hg = new ScText;
hg->ch = chars->at(c)->ch;
hg->cfont = (*doc->AllFonts)[chars->at(c)->cfont];
1613,7 → 1614,7
FillIcon = new QLabel( "", this, "FillIcon" );
FillIcon->setPixmap(loadIcon("fill.png"));
FillIcon->setScaledContents( false );
TxFill = new ScComboBox( false, this, "TxFill" );
TxFill = new ColorCombo( false, this, "TxFill" );
PM2 = new ShadeButton(this);
setCurrentDocument(doc);
//TxFill->listBox()->setMinimumWidth(TxFill->listBox()->maxItemWidth()+24);
1640,11 → 1641,9
TxFill->insertItem( tr("None"));
if (doc!=NULL)
{
QPixmap * pm;
for (ColorList::Iterator it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getSmallPixmap(doc->PageColors[it.key()].getRawRGBColor());
TxFill->insertItem(*pm, it.key());
TxFill->insertSmallItem( doc->PageColors[it.key()], it.key() );
}
}
resize(minimumSizeHint());
1675,7 → 1674,7
StrokeIcon = new QLabel( "", this, "StrokeIcon" );
StrokeIcon->setPixmap(loadIcon("Stiftalt.xpm"));
StrokeIcon->setScaledContents( false );
TxStroke = new ScComboBox( false, this, "TxStroke" );
TxStroke = new ColorCombo( false, this, "TxStroke" );
PM1 = new ShadeButton(this);
setCurrentDocument(doc);
//TxStroke->listBox()->setMinimumWidth(TxStroke->listBox()->maxItemWidth()+24);
1699,11 → 1698,9
TxStroke->insertItem( tr("None"));
if (doc!=NULL)
{
QPixmap * pm;
for (ColorList::Iterator it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
pm = getSmallPixmap(doc->PageColors[it.key()].getRawRGBColor());
TxStroke->insertItem(*pm, it.key());
TxStroke->insertSmallItem( doc->PageColors[it.key()], it.key() );
}
}
resize(minimumSizeHint());
/branches/Version13x/Scribus/scribus/sctextstruct.h
11,6 → 11,8
#include "scconfig.h"
#endif
 
#include "scribusapi.h"
 
#ifdef NLS_CONFORMANCE
#define NLS_PRIVATE private
#else
54,7 → 56,7
};
 
 
class CharStyle {
class SCRIBUS_API CharStyle {
public:
static const short NOVALUE = -16000;
static const QString NOCOLOR;
285,7 → 287,7
 
 
 
class ScText : public CharStyle
class SCRIBUS_API ScText : public CharStyle
{
public:
bool cselect;
/branches/Version13x/Scribus/scribus/tabtools.cpp
10,6 → 10,7
#include <qspinbox.h>
 
#include "sccombobox.h"
#include "colorcombo.h"
#include "units.h"
#include "mspinbox.h"
#include "linecombo.h"
25,6 → 26,7
#include "scfonts.h"
#include "sampleitem.h"
#include "commonstrings.h"
#include "colorm.h"
 
 
TabTools::TabTools( QWidget* parent, struct toolPrefs *prefsData, int unitIndex, ScribusDoc* doc) : QWidget( parent, "tabtools", 0 )
109,7 → 111,7
textLabel2b = new QLabel(sizeComboText, tr( "Size:" ), subTabText, "textLabel2b" );
subTabTextLayout->addWidget( textLabel2b, 1, 0 );
 
colorComboText = new ScComboBox( false, subTabText, "colorComboText" );
colorComboText = new ColorCombo( false, subTabText, "colorComboText" );
ColorList::Iterator itc;
colorComboText->insertItem( tr("None"));
if (prefsData->dPenText == CommonStrings::None)
118,8 → 120,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
colorComboText->insertItem( *pm, itc.key());
colorComboText->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dPenText)
colorComboText->setCurrentItem(colorComboText->count()-1);
}
130,8 → 131,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
colorComboText->insertItem( *pm, itc.key());
colorComboText->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dPenText)
colorComboText->setCurrentItem(colorComboText->count()-1);
}
148,7 → 148,7
textLabelTS = new QLabel( shadingText, tr( "Shading:" ), subTabText, "textLabelTS" );
subTabTextLayout->addWidget( textLabelTS, 2, 2 );
 
colorComboStrokeText = new ScComboBox( false, subTabText, "colorComboStrokeText" );
colorComboStrokeText = new ColorCombo( false, subTabText, "colorComboStrokeText" );
colorComboStrokeText->insertItem( tr("None"));
if (prefsData->dStrokeText == CommonStrings::None)
colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
156,8 → 156,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
colorComboStrokeText->insertItem( *pm, itc.key());
colorComboStrokeText->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dStrokeText)
colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
}
168,8 → 167,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
colorComboStrokeText->insertItem( *pm, itc.key());
colorComboStrokeText->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dStrokeText)
colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
}
186,7 → 184,7
textLabelTSS = new QLabel( shadingTextStroke, tr( "Shading:" ), subTabText, "textLabelTS" );
subTabTextLayout->addWidget( textLabelTSS, 3, 2 );
 
colorComboTextBackground = new ScComboBox( false, subTabText, "colorComboTextBackground" );
colorComboTextBackground = new ColorCombo( false, subTabText, "colorComboTextBackground" );
colorComboTextBackground->insertItem( tr("None"));
if (prefsData->dTextBackGround == CommonStrings::None)
colorComboTextBackground->setCurrentItem(colorComboTextBackground->count()-1);
194,8 → 192,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
colorComboTextBackground->insertItem( *pm, itc.key());
colorComboTextBackground->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dTextBackGround)
colorComboTextBackground->setCurrentItem(colorComboTextBackground->count()-1);
}
206,8 → 203,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
colorComboTextBackground->insertItem( *pm, itc.key());
colorComboTextBackground->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dTextBackGround)
colorComboTextBackground->setCurrentItem(colorComboTextBackground->count()-1);
}
224,7 → 220,7
textLabelTSB = new QLabel( shadingTextBack, tr( "Shading:" ), subTabText, "textLabelTSS" );
subTabTextLayout->addWidget( textLabelTSB, 4, 2 );
 
colorComboTextLine = new ScComboBox( false, subTabText, "colorComboTextLine" );
colorComboTextLine = new ColorCombo( false, subTabText, "colorComboTextLine" );
colorComboTextLine->insertItem( tr("None"));
if (prefsData->dTextLineColor == CommonStrings::None)
colorComboTextLine->setCurrentItem(colorComboTextLine->count()-1);
232,8 → 228,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
colorComboTextLine->insertItem( *pm, itc.key());
colorComboTextLine->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dTextLineColor)
colorComboTextLine->setCurrentItem(colorComboTextLine->count()-1);
}
244,8 → 239,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
colorComboTextLine->insertItem( *pm, itc.key());
colorComboTextLine->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dTextLineColor)
colorComboTextLine->setCurrentItem(colorComboTextLine->count()-1);
}
323,7 → 317,7
subTabShape = new QWidget( subStackTools, "subTabShape" );
subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
subTabShapeLayout->setAlignment( Qt::AlignTop );
colorComboLineShape = new ScComboBox( false, subTabShape, "colorComboLineShape" );
colorComboLineShape = new ColorCombo( false, subTabShape, "colorComboLineShape" );
colorComboLineShape->insertItem( tr("None"));
if (prefsData->dPen == CommonStrings::None)
colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
331,8 → 325,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
colorComboLineShape->insertItem(*pm, itc.key());
colorComboLineShape->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dPen)
colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
}
343,8 → 336,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
colorComboLineShape->insertItem( *pm, itc.key());
colorComboLineShape->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dPen)
colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
}
360,7 → 352,7
subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
comboFillShape = new ScComboBox( false, subTabShape, "comboFillShape" );
comboFillShape = new ColorCombo( false, subTabShape, "comboFillShape" );
comboFillShape->insertItem( tr("None"));
if (prefsData->dBrush == CommonStrings::None)
comboFillShape->setCurrentItem(comboFillShape->count()-1);
368,8 → 360,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
comboFillShape->insertItem( *pm, itc.key());
comboFillShape->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dBrush)
comboFillShape->setCurrentItem(comboFillShape->count()-1);
}
380,8 → 371,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
comboFillShape->insertItem( *pm, itc.key());
comboFillShape->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dBrush)
comboFillShape->setCurrentItem(comboFillShape->count()-1);
}
434,7 → 424,7
subTabLine = new QWidget( subStackTools, "subTabLine" );
subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
subTabLineLayout->setAlignment( Qt::AlignTop );
colorComboLine = new ScComboBox( false, subTabLine, "colorComboLine" );
colorComboLine = new ColorCombo( false, subTabLine, "colorComboLine" );
colorComboLine->insertItem( tr("None"));
if (prefsData->dPenLine == CommonStrings::None)
colorComboLine->setCurrentItem(colorComboLine->count()-1);
442,8 → 432,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
colorComboLine->insertItem( *pm, itc.key());
colorComboLine->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dPenLine)
colorComboLine->setCurrentItem(colorComboLine->count()-1);
}
454,8 → 443,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
colorComboLine->insertItem( *pm, itc.key());
colorComboLine->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dPenLine)
colorComboLine->setCurrentItem(colorComboLine->count()-1);
}
573,7 → 561,7
checkRatioImage->setChecked(prefsData->aspectRatio);
buttonGroup5Layout->addWidget( checkRatioImage );
subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
comboFillImage = new ScComboBox( false, subTabImage, "comboFillImage" );
comboFillImage = new ColorCombo( false, subTabImage, "comboFillImage" );
comboFillImage->insertItem( tr("None"));
if (prefsData->dBrushPict == CommonStrings::None)
comboFillImage->setCurrentItem(comboFillImage->count()-1);
581,8 → 569,7
{
for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
{
QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
comboFillImage->insertItem( *pm, itc.key());
comboFillImage->insertSmallItem( doc->PageColors[itc.key()], itc.key() );
if (itc.key() == prefsData->dBrushPict)
comboFillImage->setCurrentItem(comboFillImage->count()-1);
}
593,8 → 580,7
ColorList::Iterator endOfColorList=colorList->end();
for (itc = colorList->begin(); itc != endOfColorList; ++itc)
{
QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
comboFillImage->insertItem( *pm, itc.key());
comboFillImage->insertSmallItem( (*colorList)[itc.key()], itc.key() );
if (itc.key() == prefsData->dBrushPict)
comboFillImage->setCurrentItem(comboFillImage->count()-1);
}
/branches/Version13x/Scribus/scribus/pageitem.h
296,7 → 296,7
virtual void handleModeEditKey(QKeyEvent *k, bool &keyRepeat);
double SetZeichAttr(struct ScText *hl, int *chs, QString *chx);
double SetZeichAttr(ScText *hl, int *chs, QString *chx);
void SetFarbe(QColor *tmp, QString farbe, int shad);
void DrawZeichenS(ScPainter *p, struct ZZ *hl);
void DrawPolyL(QPainter *p, QPointArray pts);
/branches/Version13x/Scribus/scribus/scpageoutput.cpp
780,7 → 780,7
int chs;
double wide;
QString chx, chx2, chx3;
struct ScText *hl;
ScText *hl;
struct PageItem::ZZ *Zli;
double dx;
double sp = 0;
1091,7 → 1091,7
uint BuPos, LastSP, MaxText;
double oldCurY, LastXp, EndX, OFs, OFs2, wide, lineCorr, ColWidth, kernVal, RTabX;
QString chx, chx2, chx3;
struct ScText *hl;
ScText *hl;
struct PageItem::ZZ *Zli;
struct PageItem::ZZ *Zli2;
 
/branches/Version13x/Scribus/scribus/pageitem.cpp
1169,7 → 1169,7
*tmp = m_Doc->PageColors[farbe].getShadeColorProof(shad);
}
 
double PageItem::SetZeichAttr(struct ScText *hl, int *chs, QString *chx)
double PageItem::SetZeichAttr(ScText *hl, int *chs, QString *chx)
{
double retval = 0.0;
double asce = hl->cfont->numAscent * (hl->csize / 10.0);
3543,7 → 3543,7
 
void PageItem::updatePolyClip()
{
struct ScText *hl;
ScText *hl;
int asce = 1;
int desc = 1;
uint itemTextCount=itemText.count();
/branches/Version13x/Scribus/scribus/scribusview.cpp
511,7 → 511,7
Page* Mp = Doc->MasterPages.at(Doc->MasterNames[page->MPageNam]);
if (page->FromMaster.count() != 0)
{
QPainter p;
//QPainter p;
int Lnr;
struct Layer ll;
PageItem *currItem;
634,7 → 634,7
double z = painter->zoomFactor();
if (Doc->Items->count() != 0)
{
QPainter p;
//QPainter p;
int Lnr=0;
struct Layer ll;
PageItem *currItem;
4691,8 → 4691,8
Doc->RotMode = 3;
}
oldW = xy2Deg(m->x()/Scale - RCenter.x(), m->y()/Scale - RCenter.y());
p.end();
}
p.end();
}
}
break;
9067,7 → 9067,7
double h = Buffer->Height;
double pw = Buffer->Pwidth;
int z = 0;
struct ScText *hg;
ScText *hg;
switch (Buffer->PType)
{
// OBSOLETE CR 2005-02-06
9532,7 → 9532,7
double x, y, wide;
QString chx, ccounter;
PageItem* bb;
struct ScText *hl;
ScText *hl;
for (uint a = 0; a < currItem->MaxChars; ++a)
{
pts.resize(0);
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
85,7 → 85,7
uint BuPos, LastSP, MaxText;
double oldCurY, LastXp, EndX, OFs, OFs2, wide, lineCorr, ColWidth, kernVal, RTabX;
QString chx, chx2, chx3;
struct ScText *hl;
ScText *hl;
struct ZZ *Zli;
struct ZZ *Zli2;
 
2109,7 → 2109,7
void PageItem_TextFrame::handleModeEditKey(QKeyEvent *k, bool& keyRepeat)
{
int oldPos = CPos; // 15-mar-2004 jjsa for cursor movement with Shift + Arrow key
struct ScText *hg;
ScText *hg;
int kk = k->key();
int as = k->ascii();
double altx, alty;
/branches/Version13x/Scribus/scribus/scribus.cpp
132,6 → 132,7
#include "tabmanager.h"
#include "search.h"
#include "fontcombo.h"
#include "colorcombo.h"
#include "prefsfile.h"
#include "undomanager.h"
#include "polygonwidget.h"
692,7 → 693,7
//Color menu
// CB TODO
scrMenuMgr->createMenu("Color", tr("&Color"));
ColorMenC = new ScComboBox(false);
ColorMenC = new ColorCombo(false);
ColorMenC->setEditable(false);
scrMenuMgr->addMenuItem(ColorMenC, "Color");
 
1114,7 → 1115,7
{
if (doc->selection->count() == 1)
{
struct ScText *hg = new ScText;
ScText *hg = new ScText;
PageItem *currItem = doc->selection->itemAt(0);
if (currItem!=NULL)
{
3501,6 → 3502,7
ite->DrawObj(painter, rd);
}
}
painter->end();
delete painter;
// if (doc->OldBM)
// StoreBookmarks();
4389,7 → 4391,7
 
void ScribusMainWindow::slotEditPaste()
{
struct ScText *hg;
ScText *hg;
NoFrameEdit();
if (HaveDoc)
{
7843,7 → 7845,13
GetCMSProfilesDir(fi.filePath()+"/");
continue;
}
#ifdef QT_MAC
 
#ifndef QT_MAC
QString ext = fi.extension(false).lower();
if ((ext != "icm") && (ext != "icc"))
continue;
#endif
 
QFile f(fi.filePath());
QByteArray bb(40);
if (!f.open(IO_ReadOnly)) {
7853,10 → 7861,6
int len = f.readBlock(bb.data(), 40);
f.close();
if (len == 40 && bb[36] == 'a' && bb[37] == 'c' && bb[38] == 's' && bb[39] == 'p')
#else
QString ext = fi.extension(false).lower();
if ((ext == "icm") || (ext == "icc"))
#endif
{
const QCString profilePath( QString(pfad + d[dc]).local8Bit() );
hIn = cmsOpenProfileFromFile(profilePath.data(), "r");
8747,8 → 8751,7
ColorList::Iterator itend=doc->PageColors.end();
for (ColorList::Iterator it = doc->PageColors.begin(); it != itend; ++it)
{
QPixmap *pm = getSmallPixmap(doc->PageColors[it.key()].getRawRGBColor());
ColorMenC->insertItem(*pm, it.key());
ColorMenC->insertSmallItem( doc->PageColors[it.key()], it.key() );
if (it.key() == doc->toolSettings.dBrush)
ColorMenC->setCurrentItem(a);
++a;
/branches/Version13x/Scribus/scribus/annot.h
31,6 → 31,7
 
class PageItem;
class Navigator;
class ColorCombo;
class ScribusView;
class PrefsContext;
 
97,7 → 98,7
QLabel* TextLabel90;
QComboBox* Visib;
QGroupBox* GroupBox20;
QComboBox* BorderC;
ColorCombo* BorderC;
QLabel* TextLabel40a;
QComboBox* BorderW;
QLabel* TextLabel40;
/branches/Version13x/Scribus/scribus/sccombobox.h
12,9 → 12,12
* Copyright 2005 under GPL2. All rights reserved.
*
*/
 
#ifndef SCCOMBOBOX_H
#define SCCOMBOBOX_H
 
#include <qcombobox.h>
 
 
/*!
\class ScComboBox sccombobox.h
\brief The ScComboBox widget always uses a listbox instead of a popup,
27,3 → 30,4
ScComboBox( bool rw, QWidget* parent=0, const char* name=0 );
};
 
#endif
/branches/Version13x/Scribus/scribus/scribus.h
70,6 → 70,7
class CheckDocument;
class FileWatcher;
class FontCombo;
class ColorCombo;
class LayerPalette;
class LineFormate;
class Mpalette;
560,7 → 561,7
QString layerMenuName;
QPixmap noIcon;
bool scribusInitialized;
QComboBox *ColorMenC;
ColorCombo *ColorMenC;
/** ShapeMenu enthaelt die Rahmenformen */
QPopupMenu *ShapeMenu;
/** FontMenu enthaelt die Fonts */
/branches/Version13x/Scribus/scribus/colorm.h
25,7 → 25,56
 
class DynamicTip;
 
class SCRIBUS_API ColorListBoxItem : public QListBoxItem
{
protected:
 
ScColor color;
 
public:
ColorListBoxItem( const ScColor& col, const QString colName );
~ColorListBoxItem() {};
 
virtual int height( const QListBox * ) const;
};
 
class SCRIBUS_API ColorSmallPixmapItem : public ColorListBoxItem
{
public:
ColorSmallPixmapItem( const ScColor& col, const QString colName );
~ColorSmallPixmapItem() {};
 
virtual int width( const QListBox * ) const;
 
virtual void paint( QPainter * );
virtual int rtti() const { return 654873547; };
};
 
class SCRIBUS_API ColorWidePixmapItem : public ColorListBoxItem
{
public:
ColorWidePixmapItem( const ScColor& col, const QString colName );
~ColorWidePixmapItem() {};
 
virtual int width( const QListBox * ) const;
 
virtual void paint( QPainter * );
virtual int rtti() const { return 654873548; };
};
 
class SCRIBUS_API ColorFancyPixmapItem : public ColorListBoxItem
{
public:
ColorFancyPixmapItem( const ScColor& col, const QString colName );
~ColorFancyPixmapItem() {};
 
virtual int width( const QListBox * ) const;
 
virtual void paint( QPainter * );
virtual int rtti() const { return 654873549; };
};
 
 
/*! \brief Very nice list box with color names and samples.
It's inherited from QListBox with all its methods and properties.
I create it as separate class because it's used now in ColorManager
38,6 → 87,14
Q_OBJECT
 
public:
 
enum PixmapType
{
smallPixmap,
widePixmap,
fancyPixmap
};
 
/*! \brief Standard QListBox like constructor.
Just there are initialized pixmaps for icon drawing. */
ColorListBox(QWidget * parent = 0, const char * name = 0, WFlags f = 0);
45,16 → 102,10
/*! \brief Fill the list box with values taken from list.
The list is cleared itself. Then is rendered an icon with
color attributes (RGB/CMYK/Spot etc.).
\param list a ColorList to present. */
void updateBox(ColorList list);
private:
//! \brief Icons for color characteristics to render.
QPixmap alertIcon;
QPixmap cmykIcon;
QPixmap rgbIcon;
QPixmap spotIcon;
QPixmap regIcon;
\param list a ColorList to present.
\param the pixmap type to use
\param if the list should be cleared first */
void updateBox(ColorList list, ColorListBox::PixmapType type, bool clearFirst = true);
};
 
 
/branches/Version13x/Scribus/scribus/scpreview.cpp
43,8 → 43,8
QPixmap ScPreview::createPreview(QString data)
{
struct CopyPasteBuffer OB;
struct ScText *hg;
struct ScText *hl;
ScText *hg;
ScText *hl;
QPtrList<ScText> Ptexti;
bool error;
ScColor lf = ScColor();
/branches/Version13x/Scribus/scribus/pslib.cpp
1410,7 → 1410,7
{
int h, s, v, k, tsz;
uint d;
struct ScText *hl;
ScText *hl;
QValueList<double> dum;
dum.clear();
QString tmps, chx;
2140,7 → 2140,7
 
void PSLib::setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, Page* pg, bool sep, bool farb, bool ic, bool master)
{
struct ScText *hl;
ScText *hl;
uint tabCc = 0;
QValueList<PageItem::TabRecord> tTabValues;
double tabDist = ite->textToFrameDistLeft();
2166,7 → 2166,7
{
if ((!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
struct ScText hl2;
ScText hl2;
double wt = Cwidth(Doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), hl->csize);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
2195,7 → 2195,7
hl2.xp = sPos + wt * cx;
if ((hl2.cstyle & 256) && (hl2.cstroke != CommonStrings::None))
{
struct ScText hl3;
ScText hl3;
hl3.ch = hl2.ch;
hl3.ccolor = hl2.cstroke;
hl3.cstroke = hl2.cstroke;
2232,7 → 2232,7
continue;
if ((hl->cstyle & 256) && (hl->cstroke != CommonStrings::None))
{
struct ScText hl2;
ScText hl2;
hl2.ch = hl->ch;
hl2.ccolor = hl->cstroke;
hl2.cstroke = hl->cstroke;
2261,7 → 2261,7
}
}
 
void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, uint d, struct ScText *hl, Page* pg, bool sep, bool farb, bool ic, bool master)
void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, uint d, ScText *hl, Page* pg, bool sep, bool farb, bool ic, bool master)
{
QString chx;
int h, s, v, k, tsz;
/branches/Version13x/Scribus/scribus/story.h
58,8 → 58,8
class PrefsManager;
class PrefsContext;
class StoryEditor;
class ColorCombo;
 
 
struct PtiSmall {
int csize;
short cshade;
206,7 → 206,7
~SToolBColorF() {};
void setCurrentDocument(ScribusDoc *doc);
QLabel* FillIcon;
QComboBox* TxFill;
ColorCombo* TxFill;
ShadeButton *PM2;
 
public slots:
228,7 → 228,7
~SToolBColorS() {};
void setCurrentDocument(ScribusDoc *doc);
QLabel* StrokeIcon;
QComboBox* TxStroke;
ColorCombo* TxStroke;
ShadeButton *PM1;
 
public slots:
/branches/Version13x/Scribus/scribus/colorm.cpp
7,6 → 7,7
#include "colorm.h"
#include "colorm.moc"
#include <qvariant.h>
#include <qfontmetrics.h>
#include <qpixmap.h>
#include <cstdlib>
 
25,24 → 26,186
#include "util.h"
#include "dynamictip.h"
 
ColorListBoxItem::ColorListBoxItem( const ScColor& col, const QString colName ) : QListBoxItem()
{
color = col;
setText(colName);
}
 
int ColorListBoxItem::height( const QListBox *lb ) const
{
int h;
QString colorName = text();
if ( colorName.isEmpty() )
h = 15;
else
h = QMAX( 15, lb->fontMetrics().lineSpacing() + 2 );
return QMAX( h, QApplication::globalStrut().height() );
}
 
ColorSmallPixmapItem::ColorSmallPixmapItem( const ScColor& col, const QString colName ) : ColorListBoxItem(col, colName)
{
}
 
void ColorSmallPixmapItem::paint( QPainter *p )
{
static QPixmap smallPix(15, 15);
 
int itemHeight = height( listBox() );
int yPos;
QColor rgb = color.getRawRGBColor();
smallPix.fill(rgb);
QPainter painter(&smallPix);
painter.setBrush(Qt::NoBrush);
QPen b(Qt::black, 1);
painter.setPen(b);
painter.drawRect(0, 0, 15, 15);
painter.end();
 
QRect rect;
rect.setCoords(3, 0, 15, 15);
 
yPos = ( itemHeight - 15 ) / 2;
p->drawPixmap( 3, yPos, smallPix );
 
if( !text().isEmpty() )
{
QFontMetrics fm = p->fontMetrics();
yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
p->drawText( smallPix.width() + 5, yPos, text() );
}
}
 
int ColorSmallPixmapItem::width( const QListBox *lb ) const
{
QString colorName = text();
if ( text().isEmpty() )
return QMAX( 21, QApplication::globalStrut().width() );
return QMAX( 21 + lb->fontMetrics().width( colorName ), QApplication::globalStrut().width() );
}
 
ColorWidePixmapItem::ColorWidePixmapItem( const ScColor& col, const QString colName ) : ColorListBoxItem(col, colName)
{
}
 
void ColorWidePixmapItem::paint( QPainter *p )
{
static QPixmap widePix(30, 15);
 
int itemHeight = height( listBox() );
int yPos;
QColor rgb = color.getRawRGBColor();
widePix.fill(rgb);
 
QRect rect;
rect.setCoords(3, 0, 30, 15);
 
yPos = ( itemHeight - 15 ) / 2;
p->drawPixmap( 3, yPos, widePix );
 
if( !text().isEmpty() )
{
QFontMetrics fm = p->fontMetrics();
yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
p->drawText( widePix.width() + 5, yPos, text() );
}
}
 
int ColorWidePixmapItem::width( const QListBox *lb ) const
{
QString colorName = text();
if ( text().isEmpty() )
return QMAX( 36, QApplication::globalStrut().width() );
return QMAX( 36 + lb->fontMetrics().width( colorName ), QApplication::globalStrut().width() );
}
 
ColorFancyPixmapItem::ColorFancyPixmapItem( const ScColor& col, const QString colName ) : ColorListBoxItem(col, colName)
{
}
 
void ColorFancyPixmapItem::paint( QPainter *p )
{
static QPixmap cellPix(60, 15);
static QPixmap smallPix(15, 15);
 
static QPixmap alertIcon;
static QPixmap cmykIcon;
static QPixmap rgbIcon;
static QPixmap spotIcon;
static QPixmap regIcon;
static bool iconsInitialized = false;
 
if ( !iconsInitialized ) {
alertIcon = loadIcon("alert.png");
cmykIcon = loadIcon("cmyk.png");
rgbIcon = loadIcon("rgb.png");
spotIcon = loadIcon("spot.png");
regIcon = loadIcon("register.png");
iconsInitialized = true;
}
 
int itemHeight = height( listBox() );
int yPos;
QColor rgb = color.getRawRGBColor();
smallPix.fill(rgb);
QPainter painter(&smallPix);
painter.setBrush(Qt::NoBrush);
QPen b(Qt::black, 1);
painter.setPen(b);
painter.drawRect(0, 0, 15, 15);
painter.end();
 
cellPix.fill(Qt::white);
paintAlert(smallPix, cellPix, 0, 0);
color.checkGamut();
if (color.isOutOfGamut())
paintAlert(alertIcon, cellPix, 15, 0);
if ((color.getColorModel() == colorModelCMYK) || (color.isSpotColor()))
paintAlert(cmykIcon, cellPix, 30, 0);
else
paintAlert(rgbIcon, cellPix, 30, 0);
if (color.isSpotColor())
paintAlert(spotIcon, cellPix, 46, 2);
if (color.isRegistrationColor())
paintAlert(regIcon, cellPix, 45, 0);
 
QRect rect;
rect.setCoords(3, 0, 60, 15);
 
yPos = ( itemHeight - 15 ) / 2;
p->drawPixmap( 3, yPos, cellPix );
 
if( !text().isEmpty() )
{
QFontMetrics fm = p->fontMetrics();
yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
p->drawText( cellPix.width() + 5, yPos, text() );
}
}
 
int ColorFancyPixmapItem::width( const QListBox *lb ) const
{
QString colorName = text();
if ( text().isEmpty() )
return QMAX( 66, QApplication::globalStrut().width() );
return QMAX( 66 + lb->fontMetrics().width( colorName ), QApplication::globalStrut().width() );
}
 
ColorListBox::ColorListBox(QWidget * parent, const char * name, WFlags f)
: QListBox(parent, name, f)
{
if (name == "")
setName("ColorListBox");
alertIcon = loadIcon("alert.png");
cmykIcon = loadIcon("cmyk.png");
rgbIcon = loadIcon("rgb.png");
spotIcon = loadIcon("spot.png");
regIcon = loadIcon("register.png");
}
 
#include <qbitmap.h>
void ColorListBox::updateBox(ColorList list)
void ColorListBox::updateBox(ColorList list, ColorListBox::PixmapType type, bool clearFirst)
{
ColorList::Iterator it;
clear();
if (clearFirst)
clear();
for (it = list.begin(); it != list.end(); ++it)
{
// if condition 10/21/2004 pv #1191
50,12 → 213,15
continue;
 
ScColor col = list[it.key()];
QPixmap * pm = getFancyPixmap(col);
insertItem(*pm, it.key());
if (type == ColorListBox::fancyPixmap)
insertItem( new ColorFancyPixmapItem(col, it.key()) );
else if (type == ColorListBox::widePixmap)
insertItem( new ColorWidePixmapItem(col, it.key()) );
else if (type == ColorListBox::smallPixmap)
insertItem( new ColorSmallPixmapItem(col, it.key()) );
}
}
 
 
ColorManager::ColorManager(QWidget* parent, ColorList doco, bool haveDoc, QString docColSet, QStringList custColSet)
: QDialog( parent, "ColorManager", true, 0 )
{
639,7 → 805,7
 
void ColorManager::updateCList()
{
colorListBox->updateBox(EditColors);
colorListBox->updateBox(EditColors, ColorListBox::fancyPixmap);
DelF->setEnabled(EditColors.count() == 1 ? false : true);
if (colorListBox->currentItem() == -1)
{
/branches/Version13x/Scribus/scribus/scpaths.cpp
234,6 → 234,16
createDirs.append("/usr/share/create/swatches/");
createDirs.append("/usr/local/share/create/swatches/");
#elif defined(_WIN32)
QString localAppData = getSpecialDir(CSIDL_LOCAL_APPDATA);
QString commonAppData = getSpecialDir(CSIDL_COMMON_APPDATA);
QString programFilesCommon = getSpecialDir(CSIDL_PROGRAM_FILES_COMMON);
createDirs.append(getSpecialDir(CSIDL_APPDATA) + "create/swatches/");
if ( !localAppData.isEmpty() )
createDirs.append(localAppData + "create/swatches/");
if ( !commonAppData.isEmpty() )
createDirs.append(commonAppData + "create/swatches/");
if ( !programFilesCommon.isEmpty() )
createDirs.append(programFilesCommon + "create/swatches/");
#endif
return createDirs;
}
243,11 → 253,13
QString qstr;
#if defined(_WIN32)
char dir[256];
SHGetSpecialFolderPath(NULL, dir, folder , false);
qstr = dir;
if( !qstr.endsWith("\\") )
qstr += "\\";
qstr.replace( '\\', '/' );
if ( SHGetSpecialFolderPath(NULL, dir, folder , false) )
{
qstr = dir;
if( !qstr.endsWith("\\") )
qstr += "\\";
qstr.replace( '\\', '/' );
}
#else
Q_ASSERT(false);
#endif
/branches/Version13x/Scribus/scribus/search.h
27,6 → 27,7
class PrefsContext;
class QLabel;
 
class ColorCombo;
class ScribusDoc;
class PageItem;
 
57,9 → 58,9
QComboBox* SStyleVal;
FontCombo* SFontVal;
MSpinBox* SSizeVal;
QComboBox* SFillVal;
ColorCombo* SFillVal;
ShadeButton *SFillSVal;
QComboBox* SStrokeVal;
ColorCombo* SStrokeVal;
ShadeButton *SStrokeSVal;
QGroupBox* Replace;
QCheckBox* RStroke;
74,9 → 75,9
QComboBox* RStyleVal;
FontCombo* RFontVal;
MSpinBox* RSizeVal;
QComboBox* RFillVal;
ColorCombo* RFillVal;
ShadeButton *RFillSVal;
QComboBox* RStrokeVal;
ColorCombo* RStrokeVal;
ShadeButton *RStrokeSVal;
StyleSelect* SEffVal;
StyleSelect* REffVal;