packages (DEVEL): kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.p...
shadzik
shadzik at pld-linux.org
Fri Jan 8 05:32:19 CET 2010
Author: shadzik Date: Fri Jan 8 04:32:19 2010 GMT
Module: packages Tag: DEVEL
---- Log message:
- updated, striped down
---- Files affected:
packages/kde4-kdebase-workspace:
kde4-kdebase-workspace-kdmconfig.patch (1.12.2.1 -> 1.12.2.2)
---- Diffs:
================================================================
Index: packages/kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.patch
diff -u packages/kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.patch:1.12.2.1 packages/kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.patch:1.12.2.2
--- packages/kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.patch:1.12.2.1 Wed Oct 28 23:57:40 2009
+++ packages/kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.patch Fri Jan 8 05:32:13 2010
@@ -22,840 +22,6 @@
" properly with real DPI value better fonts should be used or configuration"
" of font hinting should be checked.</p>" );
comboForceDpi->setWhatsThis(whatsthis);
-diff -Nru kdebase-workspace-4.3.73svn1040395/kcontrol/fonts/fonts.cpp.orig kdebase-workspace-4.3.73svn1040395-new/kcontrol/fonts/fonts.cpp.orig
---- kdebase-workspace-4.3.73svn1040395/kcontrol/fonts/fonts.cpp.orig 1970-01-01 01:00:00.000000000 +0100
-+++ kdebase-workspace-4.3.73svn1040395-new/kcontrol/fonts/fonts.cpp.orig 2009-10-02 16:53:57.000000000 +0200
-@@ -0,0 +1,830 @@
-+// KDE Display fonts setup tab
-+//
-+// Copyright (c) Mark Donohoe 1997
-+// lars Knoll 1999
-+// Rik Hemsley 2000
-+//
-+// Ported to kcontrol2 by Geert Jansen.
-+
-+#include <config-workspace.h>
-+
-+#include <QCheckBox>
-+#include <QComboBox>
-+#include <QDir>
-+#include <QLabel>
-+#include <QPushButton>
-+#include <QtCore/QSettings>
-+
-+
-+//Added by qt3to4:
-+#include <QPixmap>
-+#include <QByteArray>
-+#include <QGridLayout>
-+#include <QHBoxLayout>
-+#include <QVBoxLayout>
-+#include <QFormLayout>
-+
-+
-+#include <kacceleratormanager.h>
-+#include <kapplication.h>
-+#include <kglobalsettings.h>
-+#include <kgenericfactory.h>
-+#include <kmessagebox.h>
-+#include <knuminput.h>
-+#include <kprocess.h>
-+#include <kconfig.h>
-+#include <kstandarddirs.h>
-+#include <stdlib.h>
-+
-+#include "../krdb/krdb.h"
-+#include "fonts.h"
-+#include "fonts.moc"
-+
-+#include <kdebug.h>
-+
-+#ifdef HAVE_FREETYPE
-+#include <ft2build.h>
-+#ifdef FT_LCD_FILTER_H
-+#include FT_FREETYPE_H
-+#include FT_LCD_FILTER_H
-+#endif
-+#endif
-+
-+#include <X11/Xlib.h>
-+
-+#include <KPluginFactory>
-+
-+// X11 headers
-+#undef Bool
-+#undef Unsorted
-+#undef None
-+
-+static const char * const aa_rgb_xpm[]={
-+"12 12 3 1",
-+"a c #0000ff",
-+"# c #00ff00",
-+". c #ff0000",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa"};
-+static const char * const aa_bgr_xpm[]={
-+"12 12 3 1",
-+". c #0000ff",
-+"# c #00ff00",
-+"a c #ff0000",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa",
-+"....####aaaa"};
-+static const char * const aa_vrgb_xpm[]={
-+"12 12 3 1",
-+"a c #0000ff",
-+"# c #00ff00",
-+". c #ff0000",
-+"............",
-+"............",
-+"............",
-+"............",
-+"############",
-+"############",
-+"############",
-+"############",
-+"aaaaaaaaaaaa",
-+"aaaaaaaaaaaa",
-+"aaaaaaaaaaaa",
-+"aaaaaaaaaaaa"};
-+static const char * const aa_vbgr_xpm[]={
-+"12 12 3 1",
-+". c #0000ff",
-+"# c #00ff00",
-+"a c #ff0000",
-+"............",
-+"............",
-+"............",
-+"............",
-+"############",
-+"############",
-+"############",
-+"############",
-+"aaaaaaaaaaaa",
-+"aaaaaaaaaaaa",
-+"aaaaaaaaaaaa",
-+"aaaaaaaaaaaa"};
-+
-+static const char* const * const aaPixmaps[]={ aa_rgb_xpm, aa_bgr_xpm, aa_vrgb_xpm, aa_vbgr_xpm };
-+
-+/**** DLL Interface ****/
-+K_PLUGIN_FACTORY(FontFactory, registerPlugin<KFonts>(); )
-+K_EXPORT_PLUGIN(FontFactory("kcmfonts"))
-+
-+/**** FontUseItem ****/
-+
-+FontUseItem::FontUseItem(
-+ QWidget * parent,
-+ const QString &name,
-+ const QString &grp,
-+ const QString &key,
-+ const QString &rc,
-+ const QFont &default_fnt,
-+ bool f
-+)
-+ : KFontRequester(parent, f),
-+ _rcfile(rc),
-+ _rcgroup(grp),
-+ _rckey(key),
-+ _default(default_fnt)
-+{
-+ KAcceleratorManager::setNoAccel( this );
-+ setTitle( name );
-+ readFont();
-+}
-+
-+void FontUseItem::setDefault()
-+{
-+ setFont( _default, isFixedOnly() );
-+}
-+
-+void FontUseItem::readFont()
-+{
-+ KConfig *config;
-+
-+ bool deleteme = false;
-+ if (_rcfile.isEmpty())
-+ config = KGlobal::config().data();
-+ else
-+ {
-+ config = new KConfig(_rcfile);
-+ deleteme = true;
-+ }
-+
-+ KConfigGroup group(config, _rcgroup);
-+ QFont tmpFnt(_default);
-+ setFont( group.readEntry(_rckey, tmpFnt), isFixedOnly() );
-+ if (deleteme) delete config;
-+}
-+
-+void FontUseItem::writeFont()
-+{
-+ KConfig *config;
-+
-+ if (_rcfile.isEmpty()) {
-+ config = KGlobal::config().data();
-+ KConfigGroup(config, _rcgroup).writeEntry(_rckey, font(), KConfig::Normal|KConfig::Global);
-+ } else {
-+ config = new KConfig(KStandardDirs::locateLocal("config", _rcfile));
-+ KConfigGroup(config, _rcgroup).writeEntry(_rckey, font());
-+ config->sync();
-+ delete config;
-+ }
-+}
-+
-+void FontUseItem::applyFontDiff( const QFont &fnt, int fontDiffFlags )
-+{
-+ QFont _font( font() );
-+
-+ if (fontDiffFlags & KFontChooser::FontDiffSize) {
-+ _font.setPointSizeF( fnt.pointSizeF() );
-+ }
-+ if (fontDiffFlags & KFontChooser::FontDiffFamily) {
-+ if (!isFixedOnly() || QFontInfo(fnt).fixedPitch()) _font.setFamily( fnt.family() );
-+ }
-+ if (fontDiffFlags & KFontChooser::FontDiffStyle) {
-+ _font.setWeight( fnt.weight() );
-+ _font.setStyle( fnt.style() );
-+ _font.setUnderline( fnt.underline() );
-+ }
-+
-+ setFont( _font, isFixedOnly() );
-+}
-+
-+/**** FontAASettings ****/
-+#ifdef HAVE_FONTCONFIG
-+FontAASettings::FontAASettings(QWidget *parent)
-+ : KDialog( parent ),
-+ changesMade(false)
-+{
-+ setObjectName( "FontAASettings" );
-+ setModal( true );
-+ setCaption( i18n("Configure Anti-Alias Settings") );
-+ setButtons( Ok|Cancel );
-+ showButtonSeparator( true );
-+
-+ QWidget *mw=new QWidget(this);
-+ QFormLayout *layout=new QFormLayout(mw);
-+ layout->setMargin(0);
-+
-+ excludeRange=new QCheckBox(i18n("E&xclude range:"), mw);
-+ QHBoxLayout *rangeLayout = new QHBoxLayout();
-+ excludeFrom=new KDoubleNumInput(0, 72, 8.0, mw, 1, 1);
-+ excludeFrom->setSuffix(i18n(" pt"));
-+ rangeLayout->addWidget(excludeFrom);
-+ excludeToLabel=new QLabel(i18n(" to "), mw);
-+ rangeLayout->addWidget(excludeToLabel);
-+ excludeTo=new KDoubleNumInput(0, 72, 15.0, mw, 1, 1);
-+ excludeTo->setSuffix(i18n(" pt"));
-+ rangeLayout->addWidget(excludeTo);
-+ layout->addRow(excludeRange, rangeLayout);
-+
-+ QString subPixelWhatsThis = i18n("<p>If you have a TFT or LCD screen you"
-+ " can further improve the quality of displayed fonts by selecting"
-+ " this option.<br />Sub-pixel rendering is also known as ClearType(tm).<br />"
-+ " In order for sub-pixel rendering to"
-+ " work correctly you need to know how the sub-pixels of your display"
-+ " are aligned.</p>"
-+ " <p>On TFT or LCD displays a single pixel is actually composed of"
-+ " three sub-pixels, red, green and blue. Most displays"
-+ " have a linear ordering of RGB sub-pixel, some have BGR.<br />"
-+ " This feature does not work with CRT monitors.</p>" );
-+
-+ useSubPixel=new QCheckBox(i18n("&Use sub-pixel rendering:"), mw);
-+ useSubPixel->setWhatsThis( subPixelWhatsThis );
-+
-+ subPixelType=new QComboBox(mw);
-+ layout->addRow(useSubPixel, subPixelType);
-+
-+ subPixelType->setEditable(false);
-+ subPixelType->setWhatsThis( subPixelWhatsThis );
-+
-+ for(int t=KXftConfig::SubPixel::None+1; t<=KXftConfig::SubPixel::Vbgr; ++t)
-+ subPixelType->addItem(QPixmap(aaPixmaps[t-1]), i18n(KXftConfig::description((KXftConfig::SubPixel::Type)t).toUtf8()));
-+
-+ QLabel *hintingLabel=new QLabel(i18n("Hinting style: "), mw);
-+ hintingStyle=new QComboBox(mw);
-+ hintingStyle->setEditable(false);
-+ layout->addRow(hintingLabel, hintingStyle);
-+ for(int s=KXftConfig::Hint::NotSet+1; s<=KXftConfig::Hint::Full; ++s)
-+ hintingStyle->addItem(i18n(KXftConfig::description((KXftConfig::Hint::Style)s).toUtf8()));
-+
-+ QString hintingText(i18n("Hinting is a process used to enhance the quality of fonts at small sizes."));
-+ hintingStyle->setWhatsThis( hintingText);
-+ hintingLabel->setWhatsThis( hintingText);
-+ load();
-+ enableWidgets();
-+ setMainWidget(mw);
-+
-+ connect(excludeRange, SIGNAL(toggled(bool)), SLOT(changed()));
-+ connect(useSubPixel, SIGNAL(toggled(bool)), SLOT(changed()));
-+ connect(excludeFrom, SIGNAL(valueChanged(double)), SLOT(changed()));
-+ connect(excludeTo, SIGNAL(valueChanged(double)), SLOT(changed()));
-+ connect(subPixelType, SIGNAL(activated(const QString &)), SLOT(changed()));
-+ connect(hintingStyle, SIGNAL(activated(const QString &)), SLOT(changed()));
-+}
-+
-+bool FontAASettings::load()
-+{
-+ double from, to;
-+ KXftConfig xft;
-+
-+ if(xft.getExcludeRange(from, to))
-+ excludeRange->setChecked(true);
-+ else
-+ {
-+ excludeRange->setChecked(false);
-+ from=8.0;
-+ to=15.0;
-+ }
-+
-+ excludeFrom->setValue(from);
-+ excludeTo->setValue(to);
-+
-+ KXftConfig::SubPixel::Type spType;
-+
-+ if(!xft.getSubPixelType(spType) || KXftConfig::SubPixel::None==spType)
-+ useSubPixel->setChecked(false);
-+ else
-+ {
-+ int idx=getIndex(spType);
-+
-+ if(idx>-1)
-+ {
-+ useSubPixel->setChecked(true);
-+ subPixelType->setCurrentIndex(idx);
-+ }
-+ else
-+ useSubPixel->setChecked(false);
-+ }
-+
-+ KXftConfig::Hint::Style hStyle;
-+
-+ if(!xft.getHintStyle(hStyle) || KXftConfig::Hint::NotSet==hStyle)
-+ {
-+ KConfig kglobals("kdeglobals", KConfig::NoGlobals);
-+
-+ hStyle=KXftConfig::Hint::Medium;
-+ xft.setHintStyle(hStyle);
-+ xft.apply(); // Save this setting
-+ KConfigGroup(&kglobals, "General").writeEntry("XftHintStyle", KXftConfig::toStr(hStyle));
-+ kglobals.sync();
-+ runRdb(KRdbExportXftSettings);
-+ }
-+
-+ hintingStyle->setCurrentIndex(getIndex(hStyle));
-+
-+ enableWidgets();
-+
-+ return xft.getAntiAliasing();
-+}
-+
-+bool FontAASettings::save( bool useAA )
-+{
-+ KXftConfig xft;
-+ KConfig kglobals("kdeglobals", KConfig::NoGlobals);
-+ KConfigGroup grp(&kglobals, "General");
-+
-+ xft.setAntiAliasing( useAA );
-+
-+ if(excludeRange->isChecked())
-+ xft.setExcludeRange(excludeFrom->value(), excludeTo->value());
-+ else
-+ xft.setExcludeRange(0, 0);
-+
-+ KXftConfig::SubPixel::Type spType(useSubPixel->isChecked()
-+ ? getSubPixelType()
-+ : KXftConfig::SubPixel::None);
-+
-+ xft.setSubPixelType(spType);
-+ grp.writeEntry("XftSubPixel", KXftConfig::toStr(spType));
-+ grp.writeEntry("XftAntialias", useAA);
-+
-+ bool mod=false;
-+ KXftConfig::Hint::Style hStyle(getHintStyle());
-+
-+ xft.setHintStyle(hStyle);
-+
-+ QString hs(KXftConfig::toStr(hStyle));
-+
-+ if(!hs.isEmpty() && hs!=grp.readEntry("XftHintStyle"))
-+ {
-+ grp.writeEntry("XftHintStyle", hs);
-+ mod=true;
-+ }
-+ kglobals.sync();
-+
-+ if(!mod)
-+ mod=xft.changed();
-+
-+ xft.apply();
-+
-+ return mod;
-+}
-+
-+void FontAASettings::defaults()
-+{
-+ excludeRange->setChecked(true);
-+ excludeFrom->setValue(8.0);
-+ excludeTo->setValue(15.0);
-+ useSubPixel->setChecked(false);
-+ hintingStyle->setCurrentIndex(getIndex(KXftConfig::Hint::Medium));
-+ enableWidgets();
-+}
-+
-+int FontAASettings::getIndex(KXftConfig::SubPixel::Type spType)
-+{
-+ int pos=-1;
-+ int index;
-+
-+ for(index=0; index<subPixelType->count(); ++index)
-+ if(subPixelType->itemText(index)==i18n(KXftConfig::description(spType).toUtf8()))
-+ {
-+ pos=index;
-+ break;
-+ }
-+
-+ return pos;
-+}
-+
-+KXftConfig::SubPixel::Type FontAASettings::getSubPixelType()
-+{
-+ int t;
-+
-+ for(t=KXftConfig::SubPixel::None; t<=KXftConfig::SubPixel::Vbgr; ++t)
-+ if(subPixelType->currentText()==i18n(KXftConfig::description((KXftConfig::SubPixel::Type)t).toUtf8()))
-+ return (KXftConfig::SubPixel::Type)t;
-+
-+ return KXftConfig::SubPixel::None;
-+}
-+
-+int FontAASettings::getIndex(KXftConfig::Hint::Style hStyle)
-+{
-+ int pos=-1;
-+ int index;
-+
-+ for(index=0; index<hintingStyle->count(); ++index)
-+ if(hintingStyle->itemText(index)==i18n(KXftConfig::description(hStyle).toUtf8()))
-+ {
-+ pos=index;
-+ break;
-+ }
-+
-+ return pos;
-+}
-+
-+
-+KXftConfig::Hint::Style FontAASettings::getHintStyle()
-+{
-+ int s;
-+
-+ for(s=KXftConfig::Hint::NotSet; s<=KXftConfig::Hint::Full; ++s)
-+ if(hintingStyle->currentText()==i18n(KXftConfig::description((KXftConfig::Hint::Style)s).toUtf8()))
-+ return (KXftConfig::Hint::Style)s;
-+
-+ return KXftConfig::Hint::Medium;
-+}
-+
-+void FontAASettings::enableWidgets()
-+{
-+ excludeFrom->setEnabled(excludeRange->isChecked());
-+ excludeTo->setEnabled(excludeRange->isChecked());
-+ excludeToLabel->setEnabled(excludeRange->isChecked());
-+ subPixelType->setEnabled(useSubPixel->isChecked());
-+#ifdef FT_LCD_FILTER_H
-+ static int ft_has_subpixel = -1;
-+ if( ft_has_subpixel == -1 ) {
-+ FT_Library ftLibrary;
-+ if(FT_Init_FreeType(&ftLibrary) == 0) {
-+ ft_has_subpixel = ( FT_Library_SetLcdFilter(ftLibrary, FT_LCD_FILTER_DEFAULT )
-+ == FT_Err_Unimplemented_Feature ) ? 0 : 1;
-+ FT_Done_FreeType(ftLibrary);
-+ }
-+ }
-+ useSubPixel->setEnabled(ft_has_subpixel);
-+ subPixelType->setEnabled(ft_has_subpixel);
-+#endif
-+}
-+#endif
-+
-+void FontAASettings::changed()
-+{
-+#ifdef HAVE_FONTCONFIG
-+ changesMade=true;
-+ enableWidgets();
-+#endif
-+}
-+
-+#ifdef HAVE_FONTCONFIG
-+int FontAASettings::exec()
-+{
-+ int i=KDialog::exec();
-+
-+ if(!i)
-+ load(); // Reset settings...
-+
-+ return i && changesMade;
-+}
-+#endif
-+
-+/**** KFonts ****/
-+
-+KFonts::KFonts(QWidget *parent, const QVariantList &args)
-+ : KCModule(FontFactory::componentData(), parent, args)
-+{
-+ QStringList nameGroupKeyRc;
-+
-+ nameGroupKeyRc
-+ << i18n("General") << "General" << "font" << ""
-+ << i18n("Fixed width") << "General" << "fixed" << ""
-+ << i18n("Small") << "General" << "smallestReadableFont" << ""
-+ << i18n("Toolbar") << "General" << "toolBarFont" << ""
-+ << i18n("Menu") << "General" << "menuFont" << ""
-+ << i18n("Window title") << "WM" << "activeFont" << ""
-+ << i18n("Taskbar") << "General" << "taskbarFont" << ""
-+ << i18n("Desktop") << "General" << "desktopFont" << "";
-+
-+ QList<QFont> defaultFontList;
-+
-+ // NOTE: keep in sync with kdelibs/kdeui/kernel/kglobalsettings.cpp
-+
-+ QFont f0("Sans Serif", 10);
-+ QFont f1("Monospace", 10);
-+ QFont f2("Sans Serif", 8);
-+ QFont f3("Sans Serif", 9, QFont::Bold);
-+ QFont f4("Sans Serif", 10);
-+ QFont f5("Sans Serif", 8); // smallestReadableFont
-+
-+ defaultFontList << f0 << f1 << f5 << f2 << f0 << f3 << f4 << f0;
-+
-+ QList<bool> fixedList;
-+
-+ fixedList
-+ << false
-+ << true
-+ << false
-+ << false
-+ << false
-+ << false
-+ << false
-+ << false;
-+
-+ QStringList quickHelpList;
-+
-+ quickHelpList
-+ << i18n("Used for normal text (e.g. button labels, list items).")
-+ << i18n("A non-proportional font (i.e. typewriter font).")
-+ << i18n("Smallest font that is still readable well.")
-+ << i18n("Used to display text beside toolbar icons.")
-+ << i18n("Used by menu bars and popup menus.")
-+ << i18n("Used by the window titlebar.")
-+ << i18n("Used by the taskbar.")
-+ << i18n("Used for desktop icons.");
-+
-+ QVBoxLayout * layout = new QVBoxLayout(this );
-+ layout->setMargin(0);
-+
-+ QGridLayout * fontUseLayout = new QGridLayout( );
-+ layout->addLayout( fontUseLayout );
-+ fontUseLayout->setColumnStretch(0, 0);
-+ fontUseLayout->setColumnStretch(1, 1);
-+ fontUseLayout->setColumnStretch(2, 0);
-+
-+ QList<QFont>::ConstIterator defaultFontIt(defaultFontList.begin());
-+ QList<bool>::ConstIterator fixedListIt(fixedList.begin());
-+ QStringList::ConstIterator quickHelpIt(quickHelpList.begin());
-+ QStringList::ConstIterator it(nameGroupKeyRc.begin());
-+
-+ unsigned int count = 0;
-+
-+ while (it != nameGroupKeyRc.constEnd()) {
-+
-+ QString name = *it; it++;
-+ QString group = *it; it++;
-+ QString key = *it; it++;
-+ QString file = *it; it++;
-+
-+ FontUseItem * i =
-+ new FontUseItem(
-+ this,
-+ name,
-+ group,
-+ key,
-+ file,
-+ *defaultFontIt++,
-+ *fixedListIt++
-+ );
-+
-+ fontUseList.append(i);
-+ connect(i, SIGNAL(fontSelected(const QFont &)), SLOT(fontSelected()));
-+
-+ QLabel * fontUse = new QLabel(i18nc("Font role", "%1: ", name), this);
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kde4-kdebase-workspace/kde4-kdebase-workspace-kdmconfig.patch?r1=1.12.2.1&r2=1.12.2.2&f=u
More information about the pld-cvs-commit
mailing list