/branches/Version13x/Scribus/scribus/util.cpp |
---|
1529,12 → 1529,6 |
return (unsigned char)(( ( c >> 8 ) + c ) >> 8); |
} |
/*! |
* Convert a color in RGB space to HSV space (Hue, Saturation, Value). |
* \param red the red component (modified in place). |
* \param green the green component (modified in place). |
* \param blue the blue component (modified in place). |
*/ |
void RGBTOHSV ( uchar& red, uchar& green, uchar& blue ) |
{ |
int r, g, b; |
1581,12 → 1575,6 |
blue = (uchar)v; |
} |
/*! |
* Convert a color in HSV space to RGB space. |
* \param hue the hue component (modified in place). |
* \param saturation the saturation component (modified in place). |
* \param value the value component (modified in place). |
*/ |
void HSVTORGB ( uchar& hue, uchar& saturation, uchar& value ) |
{ |
if ( saturation == 0 ) |
1642,12 → 1630,6 |
} |
} |
/*! |
* Convert a color in RGB space to HLS space (Hue, Lightness, Saturation). |
* \param red the red component (modified in place). |
* \param green the green component (modified in place). |
* \param blue the blue component (modified in place). |
*/ |
void RGBTOHLS ( uchar& red, uchar& green, uchar& blue ) |
{ |
int r = red; |
1696,13 → 1678,6 |
blue = (uchar)s; |
} |
/*! |
* Implement the HLS "double hex-cone". |
* \param n1 lightness fraction (?) |
* \param n2 saturation fraction (?) |
* \param hue hue "angle". |
* \return HLS value. |
*/ |
int HLSVALUE ( double n1, double n2, double hue ) |
{ |
double value; |
1721,12 → 1696,6 |
return (int)( value * 255 ); |
} |
/*! |
* Convert a color in HLS space to RGB space. |
* \param hue the hue component (modified in place). |
* \param lightness the lightness component (modified in place). |
* \param saturation the saturation component (modified in place). |
*/ |
void HLSTORGB ( uchar& hue, uchar& lightness, uchar& saturation ) |
{ |
double h = hue; |
1751,3 → 1720,9 |
saturation = HLSVALUE( m1, m2, h - 85 ); |
} |
} |
void tDebug(QString message) |
{ |
QDateTime debugTime; |
qDebug(QString("%1\t%2").arg(debugTime.currentDateTime().toString("hh:mm:ss:zzz")).arg(message)); |
} |
/branches/Version13x/Scribus/scribus/prefs.cpp |
---|
54,13 → 54,6 |
extern ScribusQApp* ScQApp; |
// performance measurements - PV |
// void tdebug(QString i) |
// { |
// QDateTime debugTime; |
// qDebug(QString("%1 %2").arg(i).arg(debugTime.currentDateTime().toString("hh:mm:ss:zzz"))); |
// } |
Preferences::Preferences( QWidget* parent) : PrefsDialogBase( parent ) |
{ |
prefsManager=PrefsManager::instance(); |
83,7 → 76,7 |
tabTypo = new TabTypograpy( prefsWidgets, &prefsData->typographicSettings); |
addItem( tr("Typography"), loadIcon("typography.png"), tabTypo); |
tabTools = new TabTools( prefsWidgets, &prefsData->toolSettings, docUnitIndex, 0); |
tabTools = new TabTools( prefsWidgets, &prefsData->toolSettings, docUnitIndex, ap->doc); |
addItem( tr("Tools"), loadIcon("tools.png"), tabTools); |
tabHyphenator = new HySettings(prefsWidgets, &ap->LangTransl); |
91,7 → 84,7 |
// ap->PrefsPfad is propably obsolete |
//tabFonts = new FontPrefs(prefsWidgets, false, ap->PrefsPfad, 0); |
tabFonts = new FontPrefs(prefsWidgets, false, prefsManager->preferencesLocation(), 0); |
tabFonts = new FontPrefs(prefsWidgets, false, prefsManager->preferencesLocation(), ap->doc); |
addItem( tr("Fonts"), loadIcon("font.png"), tabFonts); |
tabDocChecker = new TabCheckDoc( prefsWidgets, prefsData->checkerProfiles, prefsData->curCheckProfile); |
/branches/Version13x/Scribus/scribus/tabtools.cpp |
---|
383,7 → 383,7 |
toolText->setOn(true); |
// Neccessary for document prefs |
restoreDefaults(prefsData, unitIndex); |
//restoreDefaults(prefsData, unitIndex); |
QToolTip::add( toolText, tr( "Text Frame Properties" ) ); |
QToolTip::add( toolImage, tr( "Picture Frame Properties" ) ); |
912,7 → 912,8 |
{ |
if (!fontPreview) |
return; |
SampleItem *si = new SampleItem(docu); |
SampleItem *si = new SampleItem(0); |
si->setText(tr("Woven silk pyjamas exchanged for blue quartz")); |
if (colorComboTextBackground->currentText() != CommonStrings::NoneColor) |
{ |
931,6 → 932,7 |
} |
else |
si->setBgColor(paletteBackgroundColor()); |
if (colorComboText->currentText() != CommonStrings::NoneColor) |
{ |
if (docu != 0) |
950,8 → 952,6 |
si->setTxColor(paletteBackgroundColor()); |
si->setFont(fontComboText->currentText()); |
si->setFontSize(sizeComboText->currentText().left(2).toInt() * 10, true); |
/*QPixmap pm = si->getSample(previewText->width(), previewText->height()); |
previewText->setPixmap(pm);*/ |
previewText->setPixmap(si->getSample(previewText->width(), previewText->height())); |
delete si; |
} |
/branches/Version13x/Scribus/scribus/scribus.cpp |
---|
7157,6 → 7157,8 |
} |
FontSub->RebuildList(0); |
propertiesPalette->Fonts->RebuildList(0); |
layerPalette->setDoc(doc); |
layerPalette->rebuildList(); |
ScCore->getCMSProfiles(); |
SetShortCut(); |
} |
/branches/Version13x/Scribus/scribus/util.h |
---|
161,11 → 161,44 |
and using a setPixmap method for their changing. |
\author Petr Vanek */ |
QPixmap SCRIBUS_API getQCheckBoxPixmap(const bool checked, const QColor background); |
/*! \brief Convert a color in RGB space to HSV space (Hue, Saturation, Value). |
* \param red the red component (modified in place). |
* \param green the green component (modified in place). |
* \param blue the blue component (modified in place). |
*/ |
unsigned char SCRIBUS_API INT_MULT ( unsigned char a, unsigned char b ); |
/*! \brief Convert a color in HSV space to RGB space. |
* \param hue the hue component (modified in place). |
* \param saturation the saturation component (modified in place). |
* \param value the value component (modified in place). |
*/ |
void SCRIBUS_API RGBTOHSV ( uchar& red, uchar& green, uchar& blue ); |
/*! \brief Convert a color in RGB space to HLS space (Hue, Lightness, Saturation). |
* \param red the red component (modified in place). |
* \param green the green component (modified in place). |
* \param blue the blue component (modified in place). |
*/ |
void SCRIBUS_API HSVTORGB ( uchar& hue, uchar& saturation, uchar& value ); |
void SCRIBUS_API RGBTOHLS ( uchar& red, uchar& green, uchar& blue ); |
/*! \brief Implement the HLS "double hex-cone". |
* \param n1 lightness fraction (?) |
* \param n2 saturation fraction (?) |
* \param hue hue "angle". |
* \return HLS value. |
*/ |
int SCRIBUS_API HLSVALUE ( double n1, double n2, double hue ); |
/*! \brief Convert a color in HLS space to RGB space. |
* \param hue the hue component (modified in place). |
* \param lightness the lightness component (modified in place). |
* \param saturation the saturation component (modified in place). |
*/ |
void SCRIBUS_API HLSTORGB ( uchar& hue, uchar& lightness, uchar& saturation ); |
/*! \brief performance measurements. |
It prints given message with it current timestamp. |
Useful for duration holes finding. |
\author Petr Vanek */ |
void tDebug(QString message); |
#endif |
/branches/Version13x/Scribus/scribus/reformdoc.cpp |
---|
47,6 → 47,7 |
extern QPixmap loadIcon(QString nam); |
ReformDoc::ReformDoc( QWidget* parent, ScribusDoc* doc ) : PrefsDialogBase( parent ) |
{ |
docUnitIndex = doc->unitIndex(); |
55,8 → 56,6 |
unitRatio = doc->unitRatio(); |
QString ein = unitGetSuffixFromIndex(docUnitIndex); |
decimals = unitGetDecimalsFromIndex(docUnitIndex); |
customText="Custom"; |
customTextTR=tr( "Custom" ); |
setCaption( tr( "Document Setup" ) ); |
tabPage = new TabDocument( prefsWidgets, "tab", true ); |
80,14 → 79,9 |
addItem( tr("Tools"), loadIcon("tools.png"), tabTools); |
tabHyphenator = new HySettings(prefsWidgets, &ScMW->LangTransl); |
// tabHyphenator->verbose->setChecked(!doc->docHyphenator->Automatic); |
// tabHyphenator->input->setChecked(doc->docHyphenator->AutoCheck); |
// tabHyphenator->language->setCurrentText(ScMW->LangTransl[doc->docHyphenator->Language]); |
// tabHyphenator->wordLen->setValue(doc->docHyphenator->MinWordLen); |
// tabHyphenator->maxCount->setValue(doc->docHyphenator->HyCount); |
addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator); |
tabFonts = new FontPrefs(prefsWidgets, true, ScMW->PrefsPfad, doc); |
tabFonts = new FontPrefs(prefsWidgets, true, PrefsManager::instance()->preferencesLocation(), doc); |
addItem( tr("Fonts"), loadIcon("font.png"), tabFonts); |
tabDocChecker = new TabCheckDoc( prefsWidgets, doc->checkerProfiles, doc->curCheckProfile); |
202,10 → 196,10 |
void ReformDoc::setDS(int layout) |
{ |
tabPage->marginGroup->setFacingPages(!(layout == singlePage)); |
choosenLayout = layout; |
tabPage->docLayout->firstPage->setCurrentItem(currDoc->pageSets[choosenLayout].FirstPage); |
tabView->gapHorizontal->setValue(currDoc->pageSets[choosenLayout].GapHorizontal * unitRatio); |
tabView->gapVertical->setValue(currDoc->pageSets[choosenLayout].GapBelow * unitRatio); |
tabPage->choosenLayout = layout; |
tabPage->docLayout->firstPage->setCurrentItem(currDoc->pageSets[tabPage->choosenLayout].FirstPage); |
tabView->gapHorizontal->setValue(currDoc->pageSets[tabPage->choosenLayout].GapHorizontal * unitRatio); |
tabView->gapVertical->setValue(currDoc->pageSets[tabPage->choosenLayout].GapBelow * unitRatio); |
} |
void ReformDoc::switchCMS(bool enable) |
244,7 → 238,7 |
br2 = tabPage->marginGroup->bottom(); |
lr2 = tabPage->marginGroup->left(); |
rr2 = tabPage->marginGroup->right(); |
int fp = choosenLayout; |
int fp = tabPage->choosenLayout; |
currDoc->pageSets[fp].FirstPage = tabPage->docLayout->firstPage->currentItem(); |
currDoc->pageSets[fp].GapHorizontal = tabView->gapHorizontal->value() / currDoc->unitRatio(); |
currDoc->pageSets[fp].GapBelow = tabView->gapVertical->value() / currDoc->unitRatio(); |
251,7 → 245,7 |
//currDoc->FirstPnum = pageNumber->value(); |
currDoc->resetPage(tpr2, lr2, rr2, br2, fp); |
currDoc->PageOri = tabPage->pageOrientationComboBox->currentItem(); |
currDoc->m_pageSize = prefsPageSizeName; |
currDoc->m_pageSize = tabPage->prefsPageSizeName; |
currDoc->pageWidth = tabPage->pageW; |
currDoc->pageHeight = tabPage->pageH; |
double TopD = tabView->topScratch->value() / currDoc->unitRatio() - currDoc->ScratchTop; |
303,7 → 297,7 |
} |
currDoc->guidesSettings.before = tabGuides->inBackground->isChecked(); |
currDoc->marginColored = tabView->checkUnprintable->isChecked(); |
currDoc->papColor = colorPaper; |
currDoc->papColor = tabView->colorPaper; |
currDoc->guidesSettings.marginsShown = tabGuides->marginBox->isChecked(); |
currDoc->guidesSettings.framesShown = tabView->checkFrame->isChecked(); |
currDoc->guidesSettings.layerMarkersShown = tabView->checkLayerM->isChecked(); |
/branches/Version13x/Scribus/scribus/sampleitem.cpp |
---|
14,15 → 14,19 |
#include "prefsmanager.h" |
#include <qcolor.h> |
#include <qstring.h> |
#include <qcursor.h> |
#include "text/nlsconfig.h" |
SampleItem::SampleItem(ScribusDoc* doc) : |
QObject() |
{ |
used = true; |
m_Doc=doc; |
if (!m_Doc) |
if (doc==0) |
{ |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
// FIXME: main preformance issue here! PV |
m_Doc=ScCore->primaryMainWindow()->doFileNew(//pageWidth, pageHeight, |
0,0, |
//topMargin, leftMargin, rightMargin, bottomMargin, |
34,11 → 38,13 |
1, 1, 1, |
//orientation, firstPageNr, "Custom", requires gui, page count, showview); |
1, 1, "custom", false, 1, false); |
//m_Doc = new ScribusDoc(); |
Q_ASSERT(m_Doc!=0); |
if (!m_Doc) |
return; |
m_Doc->pageSets[1/*pagesType*/].FirstPage = 1;//firstPageOrder; |
used = false; |
qApp->restoreOverrideCursor(); |
} |
// tmp colors. to be removed in descrictor |
m_Doc->PageColors.insert("__blackforpreview__", ScColor(0, 0, 0, 255)); |
/branches/Version13x/Scribus/scribus/reformdoc.h |
---|
63,46 → 63,11 |
int docUnitIndex; |
int decimals; |
double unitRatio; |
/* double pageWidth; |
double pageHeight;*/ |
int choosenLayout; |
QColor colorPaper; |
QString prefsPageSizeName; |
protected: |
/* QVBoxLayout* reformDocLayout; |
QHBoxLayout* dsGroupBox7Layout; |
QHBoxLayout* groupBox7aLayout; |
QHBoxLayout* groupScratchLayout; |
QHBoxLayout* groupGapLayout; |
QGridLayout* layout4sg; |
QGridLayout* dsLayout4; |
QHBoxLayout* dsLayout4p; |
QVBoxLayout* dsLayout4pv; |
QGridLayout* layout4; |
QGridLayout* layout4a; |
QGridLayout* layout4s; |
QHBoxLayout* Layout3; |
// QVBoxLayout* tabViewLayout; |
QVBoxLayout* buttonGroup1Layout; |
QHBoxLayout* layout7; |
QVBoxLayout* pageBackgroundLayout; |
QHBoxLayout* layout10; |
QHBoxLayout* groupAutoSaveLayout;*/ |
QStringList docAttributesList; |
TabDocument* tabPage; |
// PageLayouts* docLayout; |
// MarginWidget* GroupRand; |
// QGroupBox* groupBox7a; |
// QGroupBox* dsGroupBox7; |
// QGroupBox* groupScratch; |
// QLabel* TextLabel5s; |
// QLabel* TextLabel7s; |
// QLabel* TextLabel1_3; |
// QSpinBox* pageNumber; |
DocInfos* docInfos; |
DocSections* tabDocSections; |
TabGuides* tabGuides; |
114,15 → 79,10 |
TabCheckDoc* tabDocChecker; |
CMSPrefs* tabColorManagement; |
TabPDFOptions* tabPDF; |
QLabel* textLabel9; |
QLabel* textLabel1m; |
DocumentItemAttributes* tabDocItemAttributes; |
TOCIndexPrefs* tabTOCIndexPrefs; |
bool viewToRecalcPictureRes; |
//Replace with commonstrings when translators have that one done. |
QString customText, customTextTR; |
protected slots: |
virtual void restoreDefaults(); |
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/objprinter.cpp |
---|
458,7 → 458,7 |
if (dd != NULL) |
{ |
if (!fil) |
fna = ScCore->primaryMainWindow()->PrefsPfad+"/tmp.ps"; |
fna = QDir::convertSeparators(prefsManager->preferencesLocation()+"/tmp.ps"); |
PSfile = dd->PS_set_file(fna); |
fna = QDir::convertSeparators(fna); |
if (PSfile) |
/branches/Version13x/Scribus/scribus/scribus.h |
---|
218,7 → 218,7 |
QMap<QString,QString> Sprachen; |
QWorkspace *wsp; |
ScribusWin* ActWin; |
QString PrefsPfad; |
//QString PrefsPfad; |
QClipboard *ClipB; |
QString LoadEnc; |
bool ScriptRunning; |