diff options
Diffstat (limited to 'tdecore')
-rw-r--r-- | tdecore/AUTHORS | 2 | ||||
-rw-r--r-- | tdecore/kapplication.cpp | 4 | ||||
-rw-r--r-- | tdecore/kapplication.h | 2 | ||||
-rw-r--r-- | tdecore/kdebug.areas | 4 | ||||
-rw-r--r-- | tdecore/kdebugrc | 2 | ||||
-rw-r--r-- | tdecore/kglobal.cpp | 2 | ||||
-rw-r--r-- | tdecore/kglobal.h | 4 | ||||
-rw-r--r-- | tdecore/kiconeffect.cpp | 58 | ||||
-rw-r--r-- | tdecore/kiconeffect.h | 42 | ||||
-rw-r--r-- | tdecore/kiconloader.cpp | 382 | ||||
-rw-r--r-- | tdecore/kiconloader.h | 152 | ||||
-rw-r--r-- | tdecore/kiconloader_p.h | 36 | ||||
-rw-r--r-- | tdecore/kicontheme.cpp | 168 | ||||
-rw-r--r-- | tdecore/kicontheme.h | 66 | ||||
-rw-r--r-- | tdecore/kinstance.cpp | 6 | ||||
-rw-r--r-- | tdecore/kinstance.h | 6 | ||||
-rw-r--r-- | tdecore/kmimesourcefactory.cpp | 18 | ||||
-rw-r--r-- | tdecore/kmimesourcefactory.h | 4 | ||||
-rw-r--r-- | tdecore/kpixmapprovider.h | 2 | ||||
-rw-r--r-- | tdecore/kstandarddirs.h | 2 | ||||
-rw-r--r-- | tdecore/tdehardwaredevices.cpp | 8 | ||||
-rw-r--r-- | tdecore/tdehardwaredevices.h | 14 | ||||
-rw-r--r-- | tdecore/tests/kiconloadertest.cpp | 8 | ||||
-rw-r--r-- | tdecore/twin.cpp | 8 |
24 files changed, 500 insertions, 500 deletions
diff --git a/tdecore/AUTHORS b/tdecore/AUTHORS index ce19e095b..dbe44b9ca 100644 --- a/tdecore/AUTHORS +++ b/tdecore/AUTHORS @@ -40,7 +40,7 @@ Christian Czezatke <e9025461@student.tuwien.ac.at> TDEProcess class Matthias Ettrich <ettrich@kde.org> -KWM, Changes to TDEApplication and KIconLoader +KWM, Changes to TDEApplication and TDEIconLoader Stephan Kulow <coolo@kde.org> heavy modifications to KURL, autoconf and automake stuff diff --git a/tdecore/kapplication.cpp b/tdecore/kapplication.cpp index 57f3a3811..773c5550c 100644 --- a/tdecore/kapplication.cpp +++ b/tdecore/kapplication.cpp @@ -570,7 +570,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) static TQPixmap* ic = NULL; if( ic == NULL ) ic = new TQPixmap( TDEGlobal::iconLoader()->loadIcon( iconName(), - KIcon::NoGroup, 0, KIcon::DefaultState, NULL, true )); + TDEIcon::NoGroup, 0, TDEIcon::DefaultState, NULL, true )); if( !ic->isNull()) { w->setIcon( *ic ); @@ -978,7 +978,7 @@ void TDEApplication::init(bool GUIenabled) #ifdef Q_WS_MACX if (GUIenabled) { TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(), - KIcon::NoGroup, KIcon::SizeLarge, KIcon::DefaultState, 0L, false ); + TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false ); if (!pixmap.isNull()) { TQImage i = pixmap.convertToImage().convertDepth(32).smoothScale(40, 40); for(int y = 0; y < i.height(); y++) { diff --git a/tdecore/kapplication.h b/tdecore/kapplication.h index 93092e53e..5ab8d7ee7 100644 --- a/tdecore/kapplication.h +++ b/tdecore/kapplication.h @@ -1516,7 +1516,7 @@ signals: /** * @internal - * Used to notify KIconLoader objects that they need to reload. + * Used to notify TDEIconLoader objects that they need to reload. */ void updateIconLoaders(); diff --git a/tdecore/kdebug.areas b/tdecore/kdebug.areas index 831b06fdf..536bc2ce4 100644 --- a/tdecore/kdebug.areas +++ b/tdecore/kdebug.areas @@ -30,8 +30,8 @@ 230 tdeui (KCommand) 240 tdeui (tdelibs) 250 tdefile (tdelibs) -264 tdecore (KIconLoader) -265 tdecore (KIconEffect) +264 tdecore (TDEIconLoader) +265 tdecore (TDEIconEffect) 270 tdeui (KRootPixmap) 280 tdeui (TDESharedPixmap) 281 tdeui (TDECModule) diff --git a/tdecore/kdebugrc b/tdecore/kdebugrc index 0335f4e5b..e1317ddfb 100644 --- a/tdecore/kdebugrc +++ b/tdecore/kdebugrc @@ -60,7 +60,7 @@ InfoOutput=4 [250] InfoOutput=4 -# KIconloader debug info off +# TDEIconloader debug info off [264] InfoOutput=4 diff --git a/tdecore/kglobal.cpp b/tdecore/kglobal.cpp index 9d39c0d6c..107d3317e 100644 --- a/tdecore/kglobal.cpp +++ b/tdecore/kglobal.cpp @@ -74,7 +74,7 @@ TDESharedConfig *TDEGlobal::sharedConfig() return _instance->sharedConfig(); } -KIconLoader *TDEGlobal::iconLoader() +TDEIconLoader *TDEGlobal::iconLoader() { MYASSERT(_instance); diff --git a/tdecore/kglobal.h b/tdecore/kglobal.h index 90548d8b5..cf8836661 100644 --- a/tdecore/kglobal.h +++ b/tdecore/kglobal.h @@ -24,7 +24,7 @@ class KCharsets; class TDEConfig; class TDESharedConfig; -class KIconLoader; +class TDEIconLoader; class TDEHardwareDevices; class TDEGlobalNetworkManager; class TDELocale; @@ -77,7 +77,7 @@ public: * Returns an iconloader object. * @return the global iconloader object */ - static KIconLoader *iconLoader(); + static TDEIconLoader *iconLoader(); /** * Returns a TDEHardwareDevices object. diff --git a/tdecore/kiconeffect.cpp b/tdecore/kiconeffect.cpp index ae33d744d..e865a1317 100644 --- a/tdecore/kiconeffect.cpp +++ b/tdecore/kiconeffect.cpp @@ -42,26 +42,26 @@ static bool tqt_has_xft=true; extern bool tqt_use_xrender; extern bool tqt_has_xft; #endif -class KIconEffectPrivate +class TDEIconEffectPrivate { public: TQString mKey[6][3]; TQColor mColor2[6][3]; }; -KIconEffect::KIconEffect() +TDEIconEffect::TDEIconEffect() { - d = new KIconEffectPrivate; + d = new TDEIconEffectPrivate; init(); } -KIconEffect::~KIconEffect() +TDEIconEffect::~TDEIconEffect() { delete d; d = 0L; } -void KIconEffect::init() +void TDEIconEffect::init() { TDEConfig *config = TDEGlobal::config(); @@ -137,14 +137,14 @@ void KIconEffect::init() } } -bool KIconEffect::hasEffect(int group, int state) const +bool TDEIconEffect::hasEffect(int group, int state) const { return mEffect[group][state] != NoEffect; } -TQString KIconEffect::fingerprint(int group, int state) const +TQString TDEIconEffect::fingerprint(int group, int state) const { - if ( group >= KIcon::LastGroup ) return ""; + if ( group >= TDEIcon::LastGroup ) return ""; TQString cached = d->mKey[group][state]; if (cached.isEmpty()) { @@ -172,14 +172,14 @@ TQString KIconEffect::fingerprint(int group, int state) const return cached; } -TQImage KIconEffect::apply(TQImage image, int group, int state) const +TQImage TDEIconEffect::apply(TQImage image, int group, int state) const { - if (state >= KIcon::LastState) + if (state >= TDEIcon::LastState) { kdDebug(265) << "Illegal icon state: " << state << "\n"; return image; } - if (group >= KIcon::LastGroup) + if (group >= TDEIcon::LastGroup) { kdDebug(265) << "Illegal icon group: " << group << "\n"; return image; @@ -188,12 +188,12 @@ TQImage KIconEffect::apply(TQImage image, int group, int state) const mColor[group][state], d->mColor2[group][state], mTrans[group][state]); } -TQImage KIconEffect::apply(TQImage image, int effect, float value, const TQColor col, bool trans) const +TQImage TDEIconEffect::apply(TQImage image, int effect, float value, const TQColor col, bool trans) const { return apply (image, effect, value, col, TDEGlobalSettings::baseColor(), trans); } -TQImage KIconEffect::apply(TQImage image, int effect, float value, const TQColor col, const TQColor col2, bool trans) const +TQImage TDEIconEffect::apply(TQImage image, int effect, float value, const TQColor col, const TQColor col2, bool trans) const { if (effect >= LastEffect ) { @@ -229,14 +229,14 @@ TQImage KIconEffect::apply(TQImage image, int effect, float value, const TQColor return image; } -TQPixmap KIconEffect::apply(TQPixmap pixmap, int group, int state) const +TQPixmap TDEIconEffect::apply(TQPixmap pixmap, int group, int state) const { - if (state >= KIcon::LastState) + if (state >= TDEIcon::LastState) { kdDebug(265) << "Illegal icon state: " << state << "\n"; return pixmap; } - if (group >= KIcon::LastGroup) + if (group >= TDEIcon::LastGroup) { kdDebug(265) << "Illegal icon group: " << group << "\n"; return pixmap; @@ -245,13 +245,13 @@ TQPixmap KIconEffect::apply(TQPixmap pixmap, int group, int state) const mColor[group][state], d->mColor2[group][state], mTrans[group][state]); } -TQPixmap KIconEffect::apply(TQPixmap pixmap, int effect, float value, +TQPixmap TDEIconEffect::apply(TQPixmap pixmap, int effect, float value, const TQColor col, bool trans) const { return apply (pixmap, effect, value, col, TDEGlobalSettings::baseColor(), trans); } -TQPixmap KIconEffect::apply(TQPixmap pixmap, int effect, float value, +TQPixmap TDEIconEffect::apply(TQPixmap pixmap, int effect, float value, const TQColor col, const TQColor col2, bool trans) const { TQPixmap result; @@ -282,7 +282,7 @@ TQPixmap KIconEffect::apply(TQPixmap pixmap, int effect, float value, // Taken from KImageEffect. We don't want to link tdecore to tdeui! As long // as this code is not too big, it doesn't seem much of a problem to me. -void KIconEffect::toGray(TQImage &img, float value) +void TDEIconEffect::toGray(TQImage &img, float value) { int pixels = (img.depth() > 8) ? img.width()*img.height() : img.numColors(); @@ -304,7 +304,7 @@ void KIconEffect::toGray(TQImage &img, float value) } } -void KIconEffect::colorize(TQImage &img, const TQColor &col, float value) +void TDEIconEffect::colorize(TQImage &img, const TQColor &col, float value) { int pixels = (img.depth() > 8) ? img.width()*img.height() : img.numColors(); @@ -345,7 +345,7 @@ void KIconEffect::colorize(TQImage &img, const TQColor &col, float value) } } -void KIconEffect::toMonochrome(TQImage &img, const TQColor &black, const TQColor &white, float value) { +void TDEIconEffect::toMonochrome(TQImage &img, const TQColor &black, const TQColor &white, float value) { int pixels = (img.depth() > 8) ? img.width()*img.height() : img.numColors(); unsigned int *data = img.depth() > 8 ? (unsigned int *) img.bits() : (unsigned int *) img.tqcolorTable(); @@ -395,7 +395,7 @@ void KIconEffect::toMonochrome(TQImage &img, const TQColor &black, const TQColor } } -void KIconEffect::deSaturate(TQImage &img, float value) +void TDEIconEffect::deSaturate(TQImage &img, float value) { int pixels = (img.depth() > 8) ? img.width()*img.height() : img.numColors(); @@ -413,7 +413,7 @@ void KIconEffect::deSaturate(TQImage &img, float value) } } -void KIconEffect::toGamma(TQImage &img, float value) +void TDEIconEffect::toGamma(TQImage &img, float value) { int pixels = (img.depth() > 8) ? img.width()*img.height() : img.numColors(); @@ -435,7 +435,7 @@ void KIconEffect::toGamma(TQImage &img, float value) } } -void KIconEffect::semiTransparent(TQImage &img) +void TDEIconEffect::semiTransparent(TQImage &img) { img.setAlphaBuffer(true); @@ -509,7 +509,7 @@ void KIconEffect::semiTransparent(TQImage &img) } } -void KIconEffect::semiTransparent(TQPixmap &pix) +void TDEIconEffect::semiTransparent(TQPixmap &pix) { if ( tqt_use_xrender && tqt_has_xft ) { @@ -540,7 +540,7 @@ void KIconEffect::semiTransparent(TQPixmap &pix) pix.setMask(mask); } -TQImage KIconEffect::doublePixels(TQImage src) const +TQImage TDEIconEffect::doublePixels(TQImage src) const { TQImage dst; if (src.depth() == 1) @@ -589,7 +589,7 @@ TQImage KIconEffect::doublePixels(TQImage src) const return dst; } -void KIconEffect::overlay(TQImage &src, TQImage &overlay) +void TDEIconEffect::overlay(TQImage &src, TQImage &overlay) { if (src.depth() != overlay.depth()) { @@ -704,7 +704,7 @@ void KIconEffect::overlay(TQImage &src, TQImage &overlay) } void -KIconEffect::visualActivate(TQWidget * widget, TQRect rect) +TDEIconEffect::visualActivate(TQWidget * widget, TQRect rect) { if (!TDEGlobalSettings::visualActivate()) return; @@ -772,7 +772,7 @@ KIconEffect::visualActivate(TQWidget * widget, TQRect rect) } void -KIconEffect::visualActivate(TQWidget * widget, TQRect rect, TQPixmap *pixmap) +TDEIconEffect::visualActivate(TQWidget * widget, TQRect rect, TQPixmap *pixmap) { if (!TDEGlobalSettings::visualActivate()) return; diff --git a/tdecore/kiconeffect.h b/tdecore/kiconeffect.h index 299be3d2e..06deb0d4c 100644 --- a/tdecore/kiconeffect.h +++ b/tdecore/kiconeffect.h @@ -10,8 +10,8 @@ * exact licensing terms. */ -#ifndef __KIconEffect_h_Included__ -#define __KIconEffect_h_Included__ +#ifndef __TDEIconEffect_h_Included__ +#define __TDEIconEffect_h_Included__ #include <tqimage.h> #include <tqpixmap.h> @@ -21,7 +21,7 @@ class TQWidget; -class KIconEffectPrivate; +class TDEIconEffectPrivate; /** * Applies effects to icons. @@ -29,16 +29,16 @@ class KIconEffectPrivate; * This class applies effects to icons depending on their state and * group. For example, it can be used to make all disabled icons * in a toolbar gray. - * @see KIcon + * @see TDEIcon */ -class TDECORE_EXPORT KIconEffect +class TDECORE_EXPORT TDEIconEffect { public: /** - * Create a new KIconEffect. + * Create a new TDEIconEffect. */ - KIconEffect(); - ~KIconEffect(); + TDEIconEffect(); + ~TDEIconEffect(); /** * This is the enumeration of all possible icon effects. @@ -63,12 +63,12 @@ public: /** * Tests whether an effect has been configured for the given icon group. - * @param group the group to check, see KIcon::Group - * @param state the state to check, see KIcon::States + * @param group the group to check, see TDEIcon::Group + * @param state the state to check, see TDEIcon::States * @returns true if an effect is configured for the given @p group * in @p state, otherwise false. - * @see KIcon::Group - * KIcon::States + * @see TDEIcon::Group + * TDEIcon::States */ bool hasEffect(int group, int state) const; @@ -76,8 +76,8 @@ public: * Returns a fingerprint for the effect by encoding * the given @p group and @p state into a TQString. This * is useful for caching. - * @param group the group, see KIcon::Group - * @param state the state, see KIcon::States + * @param group the group, see TDEIcon::Group + * @param state the state, see TDEIcon::States * @return the fingerprint of the given @p group+@p state */ TQString fingerprint(int group, int state) const; @@ -86,8 +86,8 @@ public: * Applies an effect to an image. The effect to apply depends on the * @p group and @p state parameters, and is configured by the user. * @param src The image. - * @param group The group for the icon, see KIcon::Group - * @param state The icon's state, see KIcon::States + * @param group The group for the icon, see TDEIcon::Group + * @param state The icon's state, see TDEIcon::States * @return An image with the effect applied. */ TQImage apply(TQImage src, int group, int state) const; @@ -95,7 +95,7 @@ public: /** * Applies an effect to an image. * @param src The image. - * @param effect The effect to apply, one of KIconEffect::Effects. + * @param effect The effect to apply, one of TDEIconEffect::Effects. * @param value Strength of the effect. 0 <= @p value <= 1. * @param rgb Color parameter for effects that need one. * @param trans Add Transparency if trans = true. @@ -111,8 +111,8 @@ public: /** * Applies an effect to a pixmap. * @param src The pixmap. - * @param group The group for the icon, see KIcon::Group - * @param state The icon's state, see KIcon::States + * @param group The group for the icon, see TDEIcon::Group + * @param state The icon's state, see TDEIcon::States * @return A pixmap with the effect applied. */ TQPixmap apply(TQPixmap src, int group, int state) const; @@ -120,7 +120,7 @@ public: /** * Applies an effect to a pixmap. * @param src The pixmap. - * @param effect The effect to apply, one of KIconEffect::Effects. + * @param effect The effect to apply, one of TDEIconEffect::Effects. * @param value Strength of the effect. 0 <= @p value <= 1. * @param rgb Color parameter for effects that need one. * @param trans Add Transparency if trans = true. @@ -225,7 +225,7 @@ private: float mValue[6][3]; TQColor mColor[6][3]; bool mTrans[6][3]; - KIconEffectPrivate *d; + TDEIconEffectPrivate *d; }; #endif diff --git a/tdecore/kiconloader.cpp b/tdecore/kiconloader.cpp index ba0dffb3f..5938331cd 100644 --- a/tdecore/kiconloader.cpp +++ b/tdecore/kiconloader.cpp @@ -55,19 +55,19 @@ #include "kiconloader_p.h" -/*** KIconThemeNode: A node in the icon theme dependancy tree. ***/ +/*** TDEIconThemeNode: A node in the icon theme dependancy tree. ***/ -KIconThemeNode::KIconThemeNode(KIconTheme *_theme) +TDEIconThemeNode::TDEIconThemeNode(TDEIconTheme *_theme) { theme = _theme; } -KIconThemeNode::~KIconThemeNode() +TDEIconThemeNode::~TDEIconThemeNode() { delete theme; } -void KIconThemeNode::printTree(TQString& dbgString) const +void TDEIconThemeNode::printTree(TQString& dbgString) const { /* This method doesn't have much sense anymore, so maybe it should be removed in the (near?) future */ @@ -76,30 +76,30 @@ void KIconThemeNode::printTree(TQString& dbgString) const dbgString += ")"; } -void KIconThemeNode::queryIcons(TQStringList *result, - int size, KIcon::Context context) const +void TDEIconThemeNode::queryIcons(TQStringList *result, + int size, TDEIcon::Context context) const { // add the icons of this theme to it *result += theme->queryIcons(size, context); } -void KIconThemeNode::queryIconsByContext(TQStringList *result, - int size, KIcon::Context context) const +void TDEIconThemeNode::queryIconsByContext(TQStringList *result, + int size, TDEIcon::Context context) const { // add the icons of this theme to it *result += theme->queryIconsByContext(size, context); } -KIcon KIconThemeNode::findIcon(const TQString& name, int size, - KIcon::MatchType match) const +TDEIcon TDEIconThemeNode::findIcon(const TQString& name, int size, + TDEIcon::MatchType match) const { return theme->iconPath(name, size, match); } -/*** KIconGroup: Icon type description. ***/ +/*** TDEIconGroup: Icon type description. ***/ -struct KIconGroup +struct TDEIconGroup { int size; bool dblPixels; @@ -108,33 +108,33 @@ struct KIconGroup #define KICONLOADER_CHECKS #ifdef KICONLOADER_CHECKS -// Keep a list of recently created and destroyed KIconLoader instances in order +// Keep a list of recently created and destroyed TDEIconLoader instances in order // to detect bugs like #68528. -struct KIconLoaderDebug +struct TDEIconLoaderDebug { - KIconLoaderDebug( KIconLoader* l, const TQString& a ) + TDEIconLoaderDebug( TDEIconLoader* l, const TQString& a ) : loader( l ), appname( a ), valid( true ) {} - KIconLoaderDebug() {}; // this TQValueList feature annoys me - KIconLoader* loader; + TDEIconLoaderDebug() {}; // this TQValueList feature annoys me + TDEIconLoader* loader; TQString appname; bool valid; TQString delete_bt; }; -static TQValueList< KIconLoaderDebug > *kiconloaders; +static TQValueList< TDEIconLoaderDebug > *kiconloaders; #endif -/*** KIconLoader: the icon loader ***/ +/*** TDEIconLoader: the icon loader ***/ -KIconLoader::KIconLoader(const TQString& _appname, TDEStandardDirs *_dirs) +TDEIconLoader::TDEIconLoader(const TQString& _appname, TDEStandardDirs *_dirs) { #ifdef KICONLOADER_CHECKS if( kiconloaders == NULL ) - kiconloaders = new TQValueList< KIconLoaderDebug>(); - // check for the (very unlikely case) that new KIconLoader gets allocated + kiconloaders = new TQValueList< TDEIconLoaderDebug>(); + // check for the (very unlikely case) that new TDEIconLoader gets allocated // at exactly same address like some previous one - for( TQValueList< KIconLoaderDebug >::Iterator it = kiconloaders->begin(); + for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); it != kiconloaders->end(); ) { @@ -143,9 +143,9 @@ KIconLoader::KIconLoader(const TQString& _appname, TDEStandardDirs *_dirs) else ++it; } - kiconloaders->append( KIconLoaderDebug( this, _appname )); + kiconloaders->append( TDEIconLoaderDebug( this, _appname )); #endif - d = new KIconLoaderPrivate; + d = new TDEIconLoaderPrivate; d->q = this; d->mpGroups = 0L; d->imgDict.setAutoDelete(true); @@ -159,7 +159,7 @@ KIconLoader::KIconLoader(const TQString& _appname, TDEStandardDirs *_dirs) init( _appname, _dirs ); } -void KIconLoader::reconfigure( const TQString& _appname, TDEStandardDirs *_dirs ) +void TDEIconLoader::reconfigure( const TQString& _appname, TDEStandardDirs *_dirs ) { d->links.clear(); d->imgDict.clear(); @@ -171,7 +171,7 @@ void KIconLoader::reconfigure( const TQString& _appname, TDEStandardDirs *_dirs init( _appname, _dirs ); } -void KIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs ) +void TDEIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs ) { // If this is unequal to 0, the iconloader is initialized // successfully. @@ -191,25 +191,25 @@ void KIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs ) appname = TDEGlobal::instance()->instanceName(); // Add the default theme and its base themes to the theme tree - KIconTheme *def = new KIconTheme(KIconTheme::current(), appname); + TDEIconTheme *def = new TDEIconTheme(TDEIconTheme::current(), appname); if (!def->isValid()) { delete def; // warn, as this is actually a small penalty hit kdDebug(264) << "Couldn't find current icon theme, falling back to default." << endl; - def = new KIconTheme(KIconTheme::defaultThemeName(), appname); + def = new TDEIconTheme(TDEIconTheme::defaultThemeName(), appname); if (!def->isValid()) { kdError(264) << "Error: standard icon theme" - << " \"" << KIconTheme::defaultThemeName() << "\" " + << " \"" << TDEIconTheme::defaultThemeName() << "\" " << " not found!" << endl; d->mpGroups=0L; return; } } - d->mpThemeRoot = new KIconThemeNode(def); + d->mpThemeRoot = new TDEIconThemeNode(def); d->links.append(d->mpThemeRoot); - d->mThemesInTree += KIconTheme::current(); + d->mThemesInTree += TDEIconTheme::current(); addBaseThemes(d->mpThemeRoot, appname); // These have to match the order in kicontheme.h @@ -218,8 +218,8 @@ void KIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs ) TDEConfigGroupSaver cs(config, "dummy"); // loading config and default sizes - d->mpGroups = new KIconGroup[(int) KIcon::LastGroup]; - for (KIcon::Group i=KIcon::FirstGroup; i<KIcon::LastGroup; i++) + d->mpGroups = new TDEIconGroup[(int) TDEIcon::LastGroup]; + for (TDEIcon::Group i=TDEIcon::FirstGroup; i<TDEIcon::LastGroup; i++) { if (groups[i] == 0L) break; @@ -260,10 +260,10 @@ void KIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs ) #endif } -KIconLoader::~KIconLoader() +TDEIconLoader::~TDEIconLoader() { #ifdef KICONLOADER_CHECKS - for( TQValueList< KIconLoaderDebug >::Iterator it = kiconloaders->begin(); + for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); it != kiconloaders->end(); ++it ) { @@ -282,17 +282,17 @@ KIconLoader::~KIconLoader() delete d; } -void KIconLoader::enableDelayedIconSetLoading( bool enable ) +void TDEIconLoader::enableDelayedIconSetLoading( bool enable ) { d->delayedLoading = enable; } -bool KIconLoader::isDelayedIconSetLoadingEnabled() const +bool TDEIconLoader::isDelayedIconSetLoadingEnabled() const { return d->delayedLoading; } -void KIconLoader::addAppDir(const TQString& appname) +void TDEIconLoader::addAppDir(const TQString& appname) { d->mpDirs->addResourceType("appicon", TDEStandardDirs::kde_default("data") + appname + "/pics/"); @@ -302,14 +302,14 @@ void KIconLoader::addAppDir(const TQString& appname) addAppThemes(appname); } -void KIconLoader::addAppThemes(const TQString& appname) +void TDEIconLoader::addAppThemes(const TQString& appname) { - if ( KIconTheme::current() != KIconTheme::defaultThemeName() ) + if ( TDEIconTheme::current() != TDEIconTheme::defaultThemeName() ) { - KIconTheme *def = new KIconTheme(KIconTheme::current(), appname); + TDEIconTheme *def = new TDEIconTheme(TDEIconTheme::current(), appname); if (def->isValid()) { - KIconThemeNode* node = new KIconThemeNode(def); + TDEIconThemeNode* node = new TDEIconThemeNode(def); d->links.append(node); addBaseThemes(node, appname); } @@ -317,13 +317,13 @@ void KIconLoader::addAppThemes(const TQString& appname) delete def; } - KIconTheme *def = new KIconTheme(KIconTheme::defaultThemeName(), appname); - KIconThemeNode* node = new KIconThemeNode(def); + TDEIconTheme *def = new TDEIconTheme(TDEIconTheme::defaultThemeName(), appname); + TDEIconThemeNode* node = new TDEIconThemeNode(def); d->links.append(node); addBaseThemes(node, appname); } -void KIconLoader::addBaseThemes(KIconThemeNode *node, const TQString &appname) +void TDEIconLoader::addBaseThemes(TDEIconThemeNode *node, const TQString &appname) { TQStringList lst = node->theme->inherits(); TQStringList::ConstIterator it; @@ -332,19 +332,19 @@ void KIconLoader::addBaseThemes(KIconThemeNode *node, const TQString &appname) { if( d->mThemesInTree.contains(*it) && (*it) != "hicolor") continue; - KIconTheme *theme = new KIconTheme(*it,appname); + TDEIconTheme *theme = new TDEIconTheme(*it,appname); if (!theme->isValid()) { delete theme; continue; } - KIconThemeNode *n = new KIconThemeNode(theme); + TDEIconThemeNode *n = new TDEIconThemeNode(theme); d->mThemesInTree.append(*it); d->links.append(n); addBaseThemes(n, appname); } } -void KIconLoader::addExtraDesktopThemes() +void TDEIconLoader::addExtraDesktopThemes() { if ( d->extraDesktopIconsLoaded ) return; @@ -384,8 +384,8 @@ void KIconLoader::addExtraDesktopThemes() continue; if ( *it == TQString("default.tde") ) continue; - KIconTheme *def = new KIconTheme( *it, "" ); - KIconThemeNode* node = new KIconThemeNode(def); + TDEIconTheme *def = new TDEIconTheme( *it, "" ); + TDEIconThemeNode* node = new TDEIconThemeNode(def); d->mThemesInTree.append(*it); d->links.append(node); addBaseThemes(node, "" ); @@ -395,12 +395,12 @@ void KIconLoader::addExtraDesktopThemes() } -bool KIconLoader::extraDesktopThemesAdded() const +bool TDEIconLoader::extraDesktopThemesAdded() const { return d->extraDesktopIconsLoaded; } -TQString KIconLoader::removeIconExtension(const TQString &name) const +TQString TDEIconLoader::removeIconExtension(const TQString &name) const { int extensionLength=0; @@ -430,7 +430,7 @@ TQString KIconLoader::removeIconExtension(const TQString &name) const return name; } -TQString KIconLoader::removeIconExtensionInternal(const TQString &name) const +TQString TDEIconLoader::removeIconExtensionInternal(const TQString &name) const { TQString name_noext = removeIconExtension(name); @@ -445,9 +445,9 @@ TQString KIconLoader::removeIconExtensionInternal(const TQString &name) const return name_noext; } -KIcon KIconLoader::findMatchingIcon(const TQString& name, int size) const +TDEIcon TDEIconLoader::findMatchingIcon(const TQString& name, int size) const { - KIcon icon; + TDEIcon icon; const TQString *ext[4]; int count=0; @@ -474,18 +474,18 @@ KIcon KIconLoader::findMatchingIcon(const TQString& name, int size) const and so on */ - for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ; + for ( TDEIconThemeNode *themeNode = d->links.first() ; themeNode ; themeNode = d->links.next() ) { for (int i = 0 ; i < count ; i++) { - icon = themeNode->theme->iconPath(name + *ext[i], size, KIcon::MatchExact); + icon = themeNode->theme->iconPath(name + *ext[i], size, TDEIcon::MatchExact); if (icon.isValid()) goto icon_found ; } for (int i = 0 ; i < count ; i++) { - icon = themeNode->theme->iconPath(name + *ext[i], size, KIcon::MatchBest); + icon = themeNode->theme->iconPath(name + *ext[i], size, TDEIcon::MatchBest); if (icon.isValid()) goto icon_found; } } @@ -493,11 +493,11 @@ KIcon KIconLoader::findMatchingIcon(const TQString& name, int size) const return icon; } -inline TQString KIconLoader::unknownIconPath( int size ) const +inline TQString TDEIconLoader::unknownIconPath( int size ) const { static const TQString &str_unknown = TDEGlobal::staticQString("unknown"); - KIcon icon = findMatchingIcon(str_unknown, size); + TDEIcon icon = findMatchingIcon(str_unknown, size); if (!icon.isValid()) { kdDebug(264) << "Warning: could not find \"Unknown\" icon for size = " @@ -509,7 +509,7 @@ inline TQString KIconLoader::unknownIconPath( int size ) const // Finds the absolute path to an icon. -TQString KIconLoader::iconPath(const TQString& _name, int group_or_size, +TQString TDEIconLoader::iconPath(const TQString& _name, int group_or_size, bool canReturnNull) const { if (d->mpThemeRoot == 0L) @@ -521,7 +521,7 @@ TQString KIconLoader::iconPath(const TQString& _name, int group_or_size, TQString name = removeIconExtensionInternal( _name ); TQString path; - if (group_or_size == KIcon::User) + if (group_or_size == TDEIcon::User) { static const TQString &png_ext = TDEGlobal::staticQString(".png"); static const TQString &xpm_ext = TDEGlobal::staticQString(".xpm"); @@ -540,7 +540,7 @@ TQString KIconLoader::iconPath(const TQString& _name, int group_or_size, return path; } - if (group_or_size >= KIcon::LastGroup) + if (group_or_size >= TDEIcon::LastGroup) { kdDebug(264) << "Illegal icon group: " << group_or_size << endl; return path; @@ -559,12 +559,12 @@ TQString KIconLoader::iconPath(const TQString& _name, int group_or_size, return unknownIconPath(size); } - KIcon icon = findMatchingIcon(name, size); + TDEIcon icon = findMatchingIcon(name, size); if (!icon.isValid()) { // Try "User" group too. - path = iconPath(name, KIcon::User, true); + path = iconPath(name, TDEIcon::User, true); if (!path.isEmpty() || canReturnNull) return path; @@ -576,7 +576,7 @@ TQString KIconLoader::iconPath(const TQString& _name, int group_or_size, return icon.path; } -TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int size, +TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, int size, int state, TQString *path_store, bool canReturnNull) const { TQString name = _name; @@ -598,7 +598,7 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si static const TQString &str_unknown = TDEGlobal::staticQString("unknown"); // Special case for "User" icons. - if (group == KIcon::User) + if (group == TDEIcon::User) { key = "$kicou_"; key += TQString::number(size); key += '_'; @@ -608,13 +608,13 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si return pix; TQString path = (absolutePath) ? name : - iconPath(name, KIcon::User, canReturnNull); + iconPath(name, TDEIcon::User, canReturnNull); if (path.isEmpty()) { if (canReturnNull) return pix; // We don't know the desired size: use small - path = iconPath(str_unknown, KIcon::Small, true); + path = iconPath(str_unknown, TDEIcon::Small, true); if (path.isEmpty()) { kdDebug(264) << "Warning: Cannot find \"unknown\" icon." << endl; @@ -637,24 +637,24 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si // Regular case: Check parameters - if ((group < -1) || (group >= KIcon::LastGroup)) + if ((group < -1) || (group >= TDEIcon::LastGroup)) { kdDebug(264) << "Illegal icon group: " << group << endl; - group = KIcon::Desktop; + group = TDEIcon::Desktop; } - int overlay = (state & KIcon::OverlayMask); - state &= ~KIcon::OverlayMask; - if ((state < 0) || (state >= KIcon::LastState)) + int overlay = (state & TDEIcon::OverlayMask); + state &= ~TDEIcon::OverlayMask; + if ((state < 0) || (state >= TDEIcon::LastState)) { kdDebug(264) << "Illegal icon state: " << state << endl; - state = KIcon::DefaultState; + state = TDEIcon::DefaultState; } if (size == 0 && group < 0) { kdDebug(264) << "Neither size nor group specified!" << endl; - group = KIcon::Desktop; + group = TDEIcon::Desktop; } if (!absolutePath) @@ -705,11 +705,11 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si noEffectKey != d->lastImageKey ) { // No? load it. - KIcon icon; + TDEIcon icon; if (absolutePath && !favIconOverlay) { - icon.context=KIcon::Any; - icon.type=KIcon::Scalable; + icon.context=TDEIcon::Any; + icon.type=TDEIcon::Scalable; icon.path=name; } else @@ -721,7 +721,7 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si { // Try "User" icon too. Some apps expect this. if (!name.isEmpty()) - pix = loadIcon(name, KIcon::User, size, state, path_store, true); + pix = loadIcon(name, TDEIcon::User, size, state, path_store, true); if (!pix.isNull() || canReturnNull) { TQPixmapCache::insert(key, pix); return pix; @@ -789,20 +789,20 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si if (overlay) { TQImage *ovl; - KIconTheme *theme = d->mpThemeRoot->theme; - if ((overlay & KIcon::LockOverlay) && + TDEIconTheme *theme = d->mpThemeRoot->theme; + if ((overlay & TDEIcon::LockOverlay) && ((ovl = loadOverlay(theme->lockOverlay(), size)) != 0L)) - KIconEffect::overlay(*img, *ovl); - if ((overlay & KIcon::LinkOverlay) && + TDEIconEffect::overlay(*img, *ovl); + if ((overlay & TDEIcon::LinkOverlay) && ((ovl = loadOverlay(theme->linkOverlay(), size)) != 0L)) - KIconEffect::overlay(*img, *ovl); - if ((overlay & KIcon::ZipOverlay) && + TDEIconEffect::overlay(*img, *ovl); + if ((overlay & TDEIcon::ZipOverlay) && ((ovl = loadOverlay(theme->zipOverlay(), size)) != 0L)) - KIconEffect::overlay(*img, *ovl); - if ((overlay & KIcon::ShareOverlay) && + TDEIconEffect::overlay(*img, *ovl); + if ((overlay & TDEIcon::ShareOverlay) && ((ovl = loadOverlay(theme->shareOverlay(), size)) != 0L)) - KIconEffect::overlay(*img, *ovl); - if (overlay & KIcon::HiddenOverlay) + TDEIconEffect::overlay(*img, *ovl); + if (overlay & TDEIcon::HiddenOverlay) { if (img->depth() != 32) *img = img->convertDepth(32); @@ -816,11 +816,11 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si } // Scale the icon and apply effects if necessary - if (iconType == KIcon::Scalable && size != img->width()) + if (iconType == TDEIcon::Scalable && size != img->width()) { *img = img->smoothScale(size, size); } - if (iconType == KIcon::Threshold && size != img->width()) + if (iconType == TDEIcon::Threshold && size != img->width()) { if ( abs(size-img->width())>iconThreshold ) *img = img->smoothScale(size, size); @@ -868,14 +868,14 @@ TQPixmap KIconLoader::loadIcon(const TQString& _name, KIcon::Group group, int si return pix; } -TQImage *KIconLoader::loadOverlay(const TQString &name, int size) const +TQImage *TDEIconLoader::loadOverlay(const TQString &name, int size) const { TQString key = name + '_' + TQString::number(size); TQImage *image = d->imgDict.find(key); if (image != 0L) return image; - KIcon icon = findMatchingIcon(name, size); + TDEIcon icon = findMatchingIcon(name, size); if (!icon.isValid()) { kdDebug(264) << "Overlay " << name << "not found." << endl; @@ -892,7 +892,7 @@ TQImage *KIconLoader::loadOverlay(const TQString &name, int size) const -TQMovie KIconLoader::loadMovie(const TQString& name, KIcon::Group group, int size) const +TQMovie TDEIconLoader::loadMovie(const TQString& name, TDEIcon::Group group, int size) const { TQString file = moviePath( name, group, size ); if (file.isEmpty()) @@ -904,23 +904,23 @@ TQMovie KIconLoader::loadMovie(const TQString& name, KIcon::Group group, int siz return TQMovie(file); } -TQString KIconLoader::moviePath(const TQString& name, KIcon::Group group, int size) const +TQString TDEIconLoader::moviePath(const TQString& name, TDEIcon::Group group, int size) const { if (!d->mpGroups) return TQString::null; - if ( (group < -1 || group >= KIcon::LastGroup) && group != KIcon::User ) + if ( (group < -1 || group >= TDEIcon::LastGroup) && group != TDEIcon::User ) { kdDebug(264) << "Illegal icon group: " << group << endl; - group = KIcon::Desktop; + group = TDEIcon::Desktop; } if (size == 0 && group < 0) { kdDebug(264) << "Neither size nor group specified!" << endl; - group = KIcon::Desktop; + group = TDEIcon::Desktop; } TQString file = name + ".mng"; - if (group == KIcon::User) + if (group == TDEIcon::User) { file = d->mpDirs->findResource("appicon", file); } @@ -929,15 +929,15 @@ TQString KIconLoader::moviePath(const TQString& name, KIcon::Group group, int si if (size == 0) size = d->mpGroups[group].size; - KIcon icon; + TDEIcon icon; - for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ; + for ( TDEIconThemeNode *themeNode = d->links.first() ; themeNode ; themeNode = d->links.next() ) { - icon = themeNode->theme->iconPath(file, size, KIcon::MatchExact); + icon = themeNode->theme->iconPath(file, size, TDEIcon::MatchExact); if (icon.isValid()) goto icon_found ; - icon = themeNode->theme->iconPath(file, size, KIcon::MatchBest); + icon = themeNode->theme->iconPath(file, size, TDEIcon::MatchBest); if (icon.isValid()) goto icon_found ; } @@ -948,32 +948,32 @@ TQString KIconLoader::moviePath(const TQString& name, KIcon::Group group, int si } -TQStringList KIconLoader::loadAnimated(const TQString& name, KIcon::Group group, int size) const +TQStringList TDEIconLoader::loadAnimated(const TQString& name, TDEIcon::Group group, int size) const { TQStringList lst; if (!d->mpGroups) return lst; - if ((group < -1) || (group >= KIcon::LastGroup)) + if ((group < -1) || (group >= TDEIcon::LastGroup)) { kdDebug(264) << "Illegal icon group: " << group << endl; - group = KIcon::Desktop; + group = TDEIcon::Desktop; } if ((size == 0) && (group < 0)) { kdDebug(264) << "Neither size nor group specified!" << endl; - group = KIcon::Desktop; + group = TDEIcon::Desktop; } TQString file = name + "/0001"; - if (group == KIcon::User) + if (group == TDEIcon::User) { file = d->mpDirs->findResource("appicon", file + ".png"); } else { if (size == 0) size = d->mpGroups[group].size; - KIcon icon = findMatchingIcon(file, size); + TDEIcon icon = findMatchingIcon(file, size); file = icon.isValid() ? icon.path : TQString::null; } @@ -999,17 +999,17 @@ TQStringList KIconLoader::loadAnimated(const TQString& name, KIcon::Group group, return lst; } -KIconTheme *KIconLoader::theme() const +TDEIconTheme *TDEIconLoader::theme() const { if (d->mpThemeRoot) return d->mpThemeRoot->theme; return 0L; } -int KIconLoader::currentSize(KIcon::Group group) const +int TDEIconLoader::currentSize(TDEIcon::Group group) const { if (!d->mpGroups) return -1; - if (group < 0 || group >= KIcon::LastGroup) + if (group < 0 || group >= TDEIcon::LastGroup) { kdDebug(264) << "Illegal icon group: " << group << endl; return -1; @@ -1017,7 +1017,7 @@ int KIconLoader::currentSize(KIcon::Group group) const return d->mpGroups[group].size; } -TQStringList KIconLoader::queryIconsByDir( const TQString& iconsDir ) const +TQStringList TDEIconLoader::queryIconsByDir( const TQString& iconsDir ) const { TQDir dir(iconsDir); TQStringList lst = dir.entryList("*.png;*.xpm", TQDir::Files); @@ -1028,11 +1028,11 @@ TQStringList KIconLoader::queryIconsByDir( const TQString& iconsDir ) const return result; } -TQStringList KIconLoader::queryIconsByContext(int group_or_size, - KIcon::Context context) const +TQStringList TDEIconLoader::queryIconsByContext(int group_or_size, + TDEIcon::Context context) const { TQStringList result; - if (group_or_size >= KIcon::LastGroup) + if (group_or_size >= TDEIcon::LastGroup) { kdDebug(264) << "Illegal icon group: " << group_or_size << endl; return result; @@ -1043,7 +1043,7 @@ TQStringList KIconLoader::queryIconsByContext(int group_or_size, else size = -group_or_size; - for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ; + for ( TDEIconThemeNode *themeNode = d->links.first() ; themeNode ; themeNode = d->links.next() ) themeNode->queryIconsByContext(&result, size, context); @@ -1069,10 +1069,10 @@ TQStringList KIconLoader::queryIconsByContext(int group_or_size, } -TQStringList KIconLoader::queryIcons(int group_or_size, KIcon::Context context) const +TQStringList TDEIconLoader::queryIcons(int group_or_size, TDEIcon::Context context) const { TQStringList result; - if (group_or_size >= KIcon::LastGroup) + if (group_or_size >= TDEIcon::LastGroup) { kdDebug(264) << "Illegal icon group: " << group_or_size << endl; return result; @@ -1083,7 +1083,7 @@ TQStringList KIconLoader::queryIcons(int group_or_size, KIcon::Context context) else size = -group_or_size; - for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ; + for ( TDEIconThemeNode *themeNode = d->links.first() ; themeNode ; themeNode = d->links.next() ) themeNode->queryIcons(&result, size, context); @@ -1108,26 +1108,26 @@ TQStringList KIconLoader::queryIcons(int group_or_size, KIcon::Context context) return res2; } -// used by KIconDialog to find out which contexts to offer in a combobox -bool KIconLoader::hasContext(KIcon::Context context) const +// used by TDEIconDialog to find out which contexts to offer in a combobox +bool TDEIconLoader::hasContext(TDEIcon::Context context) const { - for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ; + for ( TDEIconThemeNode *themeNode = d->links.first() ; themeNode ; themeNode = d->links.next() ) if( themeNode->theme->hasContext( context )) return true; return false; } -KIconEffect * KIconLoader::iconEffect() const +TDEIconEffect * TDEIconLoader::iconEffect() const { return &d->mpEffect; } -bool KIconLoader::alphaBlending(KIcon::Group group) const +bool TDEIconLoader::alphaBlending(TDEIcon::Group group) const { if (!d->mpGroups) return false; - if (group < 0 || group >= KIcon::LastGroup) + if (group < 0 || group >= TDEIcon::LastGroup) { kdDebug(264) << "Illegal icon group: " << group << endl; return false; @@ -1135,103 +1135,103 @@ bool KIconLoader::alphaBlending(KIcon::Group group) const return d->mpGroups[group].alphaBlending; } -TQIconSet KIconLoader::loadIconSet(const TQString& name, KIcon::Group group, int size, bool canReturnNull) +TQIconSet TDEIconLoader::loadIconSet(const TQString& name, TDEIcon::Group group, int size, bool canReturnNull) { return loadIconSet( name, group, size, canReturnNull, true ); } -TQIconSet KIconLoader::loadIconSet(const TQString& name, KIcon::Group group, int size) +TQIconSet TDEIconLoader::loadIconSet(const TQString& name, TDEIcon::Group group, int size) { return loadIconSet( name, group, size, false ); } /*** class for delayed icon loading for TQIconSet ***/ -class KIconFactory +class TDEIconFactory : public TQIconFactory { public: - KIconFactory( const TQString& iconName_P, KIcon::Group group_P, - int size_P, KIconLoader* loader_P ); - KIconFactory( const TQString& iconName_P, KIcon::Group group_P, - int size_P, KIconLoader* loader_P, bool canReturnNull ); + TDEIconFactory( const TQString& iconName_P, TDEIcon::Group group_P, + int size_P, TDEIconLoader* loader_P ); + TDEIconFactory( const TQString& iconName_P, TDEIcon::Group group_P, + int size_P, TDEIconLoader* loader_P, bool canReturnNull ); virtual TQPixmap* createPixmap( const TQIconSet&, TQIconSet::Size, TQIconSet::Mode, TQIconSet::State ); private: TQString iconName; - KIcon::Group group; + TDEIcon::Group group; int size; - KIconLoader* loader; + TDEIconLoader* loader; bool canReturnNull; }; -TQIconSet KIconLoader::loadIconSet( const TQString& name, KIcon::Group g, int s, +TQIconSet TDEIconLoader::loadIconSet( const TQString& name, TDEIcon::Group g, int s, bool canReturnNull, bool immediateExistenceCheck) { if ( !d->delayedLoading ) return loadIconSetNonDelayed( name, g, s, canReturnNull ); if (g < -1 || g > 6) { - kdDebug() << "KIconLoader::loadIconSet " << name << " " << (int)g << " " << s << endl; + kdDebug() << "TDEIconLoader::loadIconSet " << name << " " << (int)g << " " << s << endl; tqDebug("%s", kdBacktrace().latin1()); abort(); } if(canReturnNull && immediateExistenceCheck) { // we need to find out if the icon actually exists - TQPixmap pm = loadIcon( name, g, s, KIcon::DefaultState, NULL, true ); + TQPixmap pm = loadIcon( name, g, s, TDEIcon::DefaultState, NULL, true ); if( pm.isNull()) return TQIconSet(); TQIconSet ret( pm ); - ret.installIconFactory( new KIconFactory( name, g, s, this )); + ret.installIconFactory( new TDEIconFactory( name, g, s, this )); return ret; } TQIconSet ret; - ret.installIconFactory( new KIconFactory( name, g, s, this, canReturnNull )); + ret.installIconFactory( new TDEIconFactory( name, g, s, this, canReturnNull )); return ret; } -TQIconSet KIconLoader::loadIconSetNonDelayed( const TQString& name, - KIcon::Group g, +TQIconSet TDEIconLoader::loadIconSetNonDelayed( const TQString& name, + TDEIcon::Group g, int s, bool canReturnNull ) { TQIconSet iconset; - TQPixmap tmp = loadIcon(name, g, s, KIcon::ActiveState, NULL, canReturnNull); + TQPixmap tmp = loadIcon(name, g, s, TDEIcon::ActiveState, NULL, canReturnNull); iconset.setPixmap( tmp, TQIconSet::Small, TQIconSet::Active ); // we don't use QIconSet's resizing anyway iconset.setPixmap( tmp, TQIconSet::Large, TQIconSet::Active ); - tmp = loadIcon(name, g, s, KIcon::DisabledState, NULL, canReturnNull); + tmp = loadIcon(name, g, s, TDEIcon::DisabledState, NULL, canReturnNull); iconset.setPixmap( tmp, TQIconSet::Small, TQIconSet::Disabled ); iconset.setPixmap( tmp, TQIconSet::Large, TQIconSet::Disabled ); - tmp = loadIcon(name, g, s, KIcon::DefaultState, NULL, canReturnNull); + tmp = loadIcon(name, g, s, TDEIcon::DefaultState, NULL, canReturnNull); iconset.setPixmap( tmp, TQIconSet::Small, TQIconSet::Normal ); iconset.setPixmap( tmp, TQIconSet::Large, TQIconSet::Normal ); return iconset; } -KIconFactory::KIconFactory( const TQString& iconName_P, KIcon::Group group_P, - int size_P, KIconLoader* loader_P ) +TDEIconFactory::TDEIconFactory( const TQString& iconName_P, TDEIcon::Group group_P, + int size_P, TDEIconLoader* loader_P ) : iconName( iconName_P ), group( group_P ), size( size_P ), loader( loader_P ) { canReturnNull = false; setAutoDelete( true ); } -KIconFactory::KIconFactory( const TQString& iconName_P, KIcon::Group group_P, - int size_P, KIconLoader* loader_P, bool canReturnNull_P ) +TDEIconFactory::TDEIconFactory( const TQString& iconName_P, TDEIcon::Group group_P, + int size_P, TDEIconLoader* loader_P, bool canReturnNull_P ) : iconName( iconName_P ), group( group_P ), size( size_P ), loader( loader_P ), canReturnNull( canReturnNull_P) { setAutoDelete( true ); } -TQPixmap* KIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconSet::Mode mode_P, TQIconSet::State ) +TQPixmap* TDEIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconSet::Mode mode_P, TQIconSet::State ) { #ifdef KICONLOADER_CHECKS bool found = false; - for( TQValueList< KIconLoaderDebug >::Iterator it = kiconloaders->begin(); + for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); it != kiconloaders->end(); ++it ) { @@ -1244,7 +1244,7 @@ TQPixmap* KIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconS loader = TDEGlobal::iconLoader(); iconName = "no_way_man_you_will_get_broken_icon"; #else - kdWarning() << "Using already destroyed KIconLoader for loading an icon!" << endl; + kdWarning() << "Using already destroyed TDEIconLoader for loading an icon!" << endl; kdWarning() << "Appname:" << (*it).appname << ", icon:" << iconName << endl; kdWarning() << "Deleted at:" << endl; kdWarning() << (*it).delete_bt << endl; @@ -1263,7 +1263,7 @@ TQPixmap* KIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconS loader = TDEGlobal::iconLoader(); iconName = "no_way_man_you_will_get_broken_icon"; #else - kdWarning() << "Using unknown KIconLoader for loading an icon!" << endl; + kdWarning() << "Using unknown TDEIconLoader for loading an icon!" << endl; kdWarning() << "Icon:" << iconName << endl; kdWarning() << kdBacktrace() << endl; abort(); @@ -1271,15 +1271,15 @@ TQPixmap* KIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconS #endif } #endif - // TQIconSet::Mode to KIcon::State conversion - static const KIcon::States tbl[] = { KIcon::DefaultState, KIcon::DisabledState, KIcon::ActiveState }; - int state = KIcon::DefaultState; + // TQIconSet::Mode to TDEIcon::State conversion + static const TDEIcon::States tbl[] = { TDEIcon::DefaultState, TDEIcon::DisabledState, TDEIcon::ActiveState }; + int state = TDEIcon::DefaultState; if( mode_P <= TQIconSet::Active ) state = tbl[ mode_P ]; - if( group >= 0 && state == KIcon::ActiveState ) + if( group >= 0 && state == TDEIcon::ActiveState ) { // active and normal icon are usually the same - if( loader->iconEffect()->fingerprint(group, KIcon::ActiveState ) - == loader->iconEffect()->fingerprint(group, KIcon::DefaultState )) + if( loader->iconEffect()->fingerprint(group, TDEIcon::ActiveState ) + == loader->iconEffect()->fingerprint(group, TDEIcon::DefaultState )) return 0; // so let TQIconSet simply duplicate it } // ignore passed size @@ -1293,105 +1293,105 @@ TQPixmap* KIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconS TQPixmap DesktopIcon(const TQString& name, int force_size, int state, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIcon(name, KIcon::Desktop, force_size, state); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIcon(name, TDEIcon::Desktop, force_size, state); } TQPixmap DesktopIcon(const TQString& name, TDEInstance *instance) { - return DesktopIcon(name, 0, KIcon::DefaultState, instance); + return DesktopIcon(name, 0, TDEIcon::DefaultState, instance); } TQIconSet DesktopIconSet(const TQString& name, int force_size, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIconSet( name, KIcon::Desktop, force_size ); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIconSet( name, TDEIcon::Desktop, force_size ); } TQPixmap BarIcon(const TQString& name, int force_size, int state, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIcon(name, KIcon::Toolbar, force_size, state); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIcon(name, TDEIcon::Toolbar, force_size, state); } TQPixmap BarIcon(const TQString& name, TDEInstance *instance) { - return BarIcon(name, 0, KIcon::DefaultState, instance); + return BarIcon(name, 0, TDEIcon::DefaultState, instance); } TQIconSet BarIconSet(const TQString& name, int force_size, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIconSet( name, KIcon::Toolbar, force_size ); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIconSet( name, TDEIcon::Toolbar, force_size ); } TQPixmap SmallIcon(const TQString& name, int force_size, int state, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIcon(name, KIcon::Small, force_size, state); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIcon(name, TDEIcon::Small, force_size, state); } TQPixmap SmallIcon(const TQString& name, TDEInstance *instance) { - return SmallIcon(name, 0, KIcon::DefaultState, instance); + return SmallIcon(name, 0, TDEIcon::DefaultState, instance); } TQIconSet SmallIconSet(const TQString& name, int force_size, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIconSet( name, KIcon::Small, force_size ); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIconSet( name, TDEIcon::Small, force_size ); } TQPixmap MainBarIcon(const TQString& name, int force_size, int state, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIcon(name, KIcon::MainToolbar, force_size, state); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIcon(name, TDEIcon::MainToolbar, force_size, state); } TQPixmap MainBarIcon(const TQString& name, TDEInstance *instance) { - return MainBarIcon(name, 0, KIcon::DefaultState, instance); + return MainBarIcon(name, 0, TDEIcon::DefaultState, instance); } TQIconSet MainBarIconSet(const TQString& name, int force_size, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIconSet( name, KIcon::MainToolbar, force_size ); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIconSet( name, TDEIcon::MainToolbar, force_size ); } TQPixmap UserIcon(const TQString& name, int state, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIcon(name, KIcon::User, 0, state); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIcon(name, TDEIcon::User, 0, state); } TQPixmap UserIcon(const TQString& name, TDEInstance *instance) { - return UserIcon(name, KIcon::DefaultState, instance); + return UserIcon(name, TDEIcon::DefaultState, instance); } TQIconSet UserIconSet(const TQString& name, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); - return loader->loadIconSet( name, KIcon::User ); + TDEIconLoader *loader = instance->iconLoader(); + return loader->loadIconSet( name, TDEIcon::User ); } -int IconSize(KIcon::Group group, TDEInstance *instance) +int IconSize(TDEIcon::Group group, TDEInstance *instance) { - KIconLoader *loader = instance->iconLoader(); + TDEIconLoader *loader = instance->iconLoader(); return loader->currentSize(group); } -TQPixmap KIconLoader::unknown() +TQPixmap TDEIconLoader::unknown() { TQPixmap pix; if ( TQPixmapCache::find("unknown", pix) ) return pix; - TQString path = TDEGlobal::iconLoader()->iconPath("unknown", KIcon::Small, true); + TQString path = TDEGlobal::iconLoader()->iconPath("unknown", TDEIcon::Small, true); if (path.isEmpty()) { kdDebug(264) << "Warning: Cannot find \"unknown\" icon." << endl; @@ -1405,7 +1405,7 @@ TQPixmap KIconLoader::unknown() return pix; } -void KIconLoaderPrivate::reconfigure() +void TDEIconLoaderPrivate::reconfigure() { q->reconfigure(appname, mpDirs); } diff --git a/tdecore/kiconloader.h b/tdecore/kiconloader.h index 86fa77679..0c7e67a26 100644 --- a/tdecore/kiconloader.h +++ b/tdecore/kiconloader.h @@ -9,8 +9,8 @@ * exact licensing terms. */ -#ifndef __KIconLoader_h_Included__ -#define __KIconLoader_h_Included__ +#ifndef __TDEIconLoader_h_Included__ +#define __TDEIconLoader_h_Included__ #include <tqstring.h> #include <tqpixmap.h> @@ -18,31 +18,31 @@ // Grmbl, X headers..... #ifdef Status -#define KIconLoaderXStatus Status +#define TDEIconLoaderXStatus Status #undef Status #endif #include <tqmovie.h> -#ifdef KIconLoaderXStatus +#ifdef TDEIconLoaderXStatus #define Status int -#undef KIconLoaderXStatus +#undef TDEIconLoaderXStatus #endif #include <kglobal.h> #include <kinstance.h> #include <kicontheme.h> -struct KIconGroup; -class KIconThemeNode; +struct TDEIconGroup; +class TDEIconThemeNode; class TDEConfig; -struct KIconLoaderPrivate; +struct TDEIconLoaderPrivate; class TDEStandardDirs; -class KIconEffect; +class TDEIconEffect; /** * Iconloader for KDE. * - * KIconLoader will load the current icon theme and all its base themes. + * TDEIconLoader will load the current icon theme and all its base themes. * Icons will be searched in any of these themes. Additionally, it caches * icons and applies effects according the the user's preferences. * @@ -55,12 +55,12 @@ class KIconEffect; * * The standard groups are defined below. * - * @li KIcon::Desktop: Icons in the iconview of konqueror, kdesktop and similar apps. - * @li KIcon::Toolbar: Icons in toolbars. - * @li KIcon::MainToolbar: Icons in the main toolbars. - * @li KIcon::Small: Various small (typical 16x16) places: titlebars, listviews + * @li TDEIcon::Desktop: Icons in the iconview of konqueror, kdesktop and similar apps. + * @li TDEIcon::Toolbar: Icons in toolbars. + * @li TDEIcon::MainToolbar: Icons in the main toolbars. + * @li TDEIcon::Small: Various small (typical 16x16) places: titlebars, listviews * and menu entries. - * @li KIcon::Panel: Icons in kicker's panel + * @li TDEIcon::Panel: Icons in kicker's panel * * The icons are stored on disk in an icon theme or in a standalone * directory. The icon theme directories contain multiple sizes and/or @@ -74,7 +74,7 @@ class KIconEffect; * "User". * */ -class TDECORE_EXPORT KIconLoader +class TDECORE_EXPORT TDEIconLoader { public: @@ -92,12 +92,12 @@ public: * @see TDEGlobal::iconLoader() * @see TDEInstance::iconLoader() */ - KIconLoader(const TQString& appname=TQString::null, TDEStandardDirs *dirs = 0); + TDEIconLoader(const TQString& appname=TQString::null, TDEStandardDirs *dirs = 0); /** * Cleanup */ - ~KIconLoader(); + ~TDEIconLoader(); /** * Adds @p appname to the list of application specific directories. @@ -116,7 +116,7 @@ public: * @param group The icon group. This will specify the size of and effects to * be applied to the icon. * @param size If nonzero, this overrides the size specified by @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @param state The icon state: @p DefaultState, @p ActiveState or * @p DisabledState. Depending on the user's preferences, the iconloader * may apply a visual effect to hint about its state. @@ -126,8 +126,8 @@ public: * @return the TQPixmap. Can be null when not found, depending on * @p canReturnNull. */ - TQPixmap loadIcon(const TQString& name, KIcon::Group group, int size=0, - int state=KIcon::DefaultState, TQString *path_store=0L, + TQPixmap loadIcon(const TQString& name, TDEIcon::Group group, int size=0, + int state=TDEIcon::DefaultState, TQString *path_store=0L, bool canReturnNull=false) const; /** @@ -138,7 +138,7 @@ public: * @param group The icon group. This will specify the size of and effects to * be applied to the icon. * @param size If nonzero, this overrides the size specified by @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @param canReturnNull Can return a null iconset? If false, iconset * containing the "unknown" pixmap is returned when no appropriate icon has * been found. @@ -148,10 +148,10 @@ public: * @p canReturnNull. * @since 3.5 */ - TQIconSet loadIconSet(const TQString& name, KIcon::Group group, int size, + TQIconSet loadIconSet(const TQString& name, TDEIcon::Group group, int size, bool canReturnNull, bool immediateExistenceCheck); - // KDE4 merge as (const TQString&,KIcon::Group,int=0,bool=false,bool=true); + // KDE4 merge as (const TQString&,TDEIcon::Group,int=0,bool=false,bool=true); /** * Creates an icon set, that will do on-demand loading of the icon. * Loading itself is done by calling loadIcon . @@ -160,7 +160,7 @@ public: * @param group The icon group. This will specify the size of and effects to * be applied to the icon. * @param size If nonzero, this overrides the size specified by @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @param canReturnNull Can return a null iconset? If false, iconset * containing the "unknown" pixmap is returned when no appropriate icon has * been found. @@ -168,10 +168,10 @@ public: * @p canReturnNull. * @since 3.1 */ - TQIconSet loadIconSet(const TQString& name, KIcon::Group group, int size, + TQIconSet loadIconSet(const TQString& name, TDEIcon::Group group, int size, bool canReturnNull); - // KDE4 merge as (const TQString&,KIcon::Group,int=0,bool=false,bool=true); + // KDE4 merge as (const TQString&,TDEIcon::Group,int=0,bool=false,bool=true); /** * Creates an icon set, that will do on-demand loading of the icon. * Loading itself is done by calling loadIcon . @@ -180,10 +180,10 @@ public: * @param group The icon group. This will specify the size of and effects to * be applied to the icon. * @param size If nonzero, this overrides the size specified by @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @return the icon set. Can be null when not found */ - TQIconSet loadIconSet(const TQString& name, KIcon::Group group, int size=0); + TQIconSet loadIconSet(const TQString& name, TDEIcon::Group group, int size=0); /** * Returns the path of an icon. @@ -193,7 +193,7 @@ public: * @param group_or_size If positive, search icons whose size is * specified by the icon group @p group_or_size. If negative, search * icons whose size is - @p group_or_size. - * See KIcon::Group and KIcon::StdSizes + * See TDEIcon::Group and TDEIcon::StdSizes * @param canReturnNull Can return a null string? If not, a path to the * "unknown" icon will be returned. * @return the path of an icon, can be null or the "unknown" icon when @@ -207,21 +207,21 @@ public: * @param name The name of the icon. * @param group The icon group. See loadIcon(). * @param size Override the default size for @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @return A TQMovie object. Can be null if not found. */ - TQMovie loadMovie(const TQString& name, KIcon::Group group, int size=0) const; + TQMovie loadMovie(const TQString& name, TDEIcon::Group group, int size=0) const; /** * Returns the path to an animated icon. * @param name The name of the icon. * @param group The icon group. See loadIcon(). * @param size Override the default size for @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @return the full path to the movie, ready to be passed to QMovie's constructor. * Empty string if not found. */ - TQString moviePath(const TQString& name, KIcon::Group group, int size=0) const; + TQString moviePath(const TQString& name, TDEIcon::Group group, int size=0) const; /** * Loads an animated icon as a series of still frames. If you want to load @@ -229,11 +229,11 @@ public: * @param name The name of the icon. * @param group The icon group. See loadIcon(). * @param size Override the default size for @p group. - * See KIcon::StdSizes. + * See TDEIcon::StdSizes. * @return A TQStringList containing the absolute path of all the frames * making up the animation. */ - TQStringList loadAnimated(const TQString& name, KIcon::Group group, int size=0) const; + TQStringList loadAnimated(const TQString& name, TDEIcon::Group group, int size=0) const; /** * Queries all available icons for a specific group, having a specific @@ -241,30 +241,30 @@ public: * @param group_or_size If positive, search icons whose size is * specified by the icon group @p group_or_size. If negative, search * icons whose size is - @p group_or_size. - * See KIcon::Group and KIcon::StdSizes + * See TDEIcon::Group and TDEIcon::StdSizes * @param context The icon context. * @return a list of all icons */ - TQStringList queryIcons(int group_or_size, KIcon::Context context=KIcon::Any) const; + TQStringList queryIcons(int group_or_size, TDEIcon::Context context=TDEIcon::Any) const; /** * Queries all available icons for a specific context. * @param group_or_size The icon preferred group or size. If available * at this group or size, those icons will be returned, in other case, * icons of undefined size will be returned. Positive numbers are groups, - * negative numbers are negated sizes. See KIcon::Group and - * KIcon::StdSizes + * negative numbers are negated sizes. See TDEIcon::Group and + * TDEIcon::StdSizes * @param context The icon context. * @return A TQStringList containing the icon names * available for that context */ TQStringList queryIconsByContext(int group_or_size, - KIcon::Context context=KIcon::Any) const; + TDEIcon::Context context=TDEIcon::Any) const; /** * @internal */ - bool hasContext( KIcon::Context context ) const; + bool hasContext( TDEIcon::Context context ) const; /** * Returns a list of all icons (*.png or *.xpm extension) in the @@ -280,20 +280,20 @@ public: * @param group the group to check. * @return the current size for an icon group. */ - int currentSize(KIcon::Group group) const; + int currentSize(TDEIcon::Group group) const; /** * Returns a pointer to the current theme. Can be used to query * available and default sizes for groups. * @return a pointer to the current theme. 0 if no theme set. */ - KIconTheme *theme() const; + TDEIconTheme *theme() const; /** - * Returns a pointer to the KIconEffect object used by the icon loader. - * @return the KIconEffect. + * Returns a pointer to the TDEIconEffect object used by the icon loader. + * @return the TDEIconEffect. */ - KIconEffect *iconEffect() const; + TDEIconEffect *iconEffect() const; /** * Called by TDEInstance::newIconLoader to reconfigure the icon loader. @@ -317,7 +317,7 @@ public: * @return true if alpha blending is desired * @obsolete */ - bool alphaBlending( KIcon::Group group ) const; + bool alphaBlending( TDEIcon::Group group ) const; /** * Adds all the default themes from other desktops at the end of @@ -344,7 +344,7 @@ public: * The default is disabled, as the iconloader object must not be * destroyed before all those iconsets are destroyed. * - * (Some broken applications use temporary KIconLoader objects). + * (Some broken applications use temporary TDEIconLoader objects). * Every TDEInstance 's iconloader has this feature enabled. * * @param enable true to enable delayed icon loading, false to disable @@ -375,7 +375,7 @@ public: * tries to find an icon with the name. It tries some extension and * match strategies */ - KIcon findMatchingIcon(const TQString& name, int size) const; + TDEIcon findMatchingIcon(const TQString& name, int size) const; /** * @internal @@ -394,7 +394,7 @@ public: * below (the fallbacks of the theme) in the tree. * @internal */ - void addBaseThemes(KIconThemeNode *node, const TQString &appname); + void addBaseThemes(TDEIconThemeNode *node, const TQString &appname); /** * @internal @@ -434,120 +434,120 @@ public: /** * Loads all the different sizes for an iconset. */ - TQIconSet loadIconSetNonDelayed( const TQString& name, KIcon::Group group, + TQIconSet loadIconSetNonDelayed( const TQString& name, TDEIcon::Group group, int size, bool canReturnNull ); // @internal the data object - KIconLoaderPrivate *d; + TDEIconLoaderPrivate *d; }; /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a desktop icon. */ TDECORE_EXPORT TQPixmap DesktopIcon(const TQString& name, int size=0, - int state=KIcon::DefaultState, + int state=TDEIcon::DefaultState, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a desktop icon. */ TDECORE_EXPORT TQPixmap DesktopIcon(const TQString& name, TDEInstance *instance); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a desktop icon, and apply the necessary effects to get an IconSet. */ TDECORE_EXPORT TQIconSet DesktopIconSet(const TQString& name, int size=0, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a toolbar icon. */ -TDECORE_EXPORT TQPixmap BarIcon(const TQString& name, int size=0, int state=KIcon::DefaultState, +TDECORE_EXPORT TQPixmap BarIcon(const TQString& name, int size=0, int state=TDEIcon::DefaultState, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a toolbar icon. */ TDECORE_EXPORT TQPixmap BarIcon(const TQString& name, TDEInstance *instance); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a toolbar icon, and apply the necessary effects to get an IconSet. */ TDECORE_EXPORT TQIconSet BarIconSet(const TQString& name, int size=0, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a small icon. */ TDECORE_EXPORT TQPixmap SmallIcon(const TQString& name, int size=0, - int state=KIcon::DefaultState, + int state=TDEIcon::DefaultState, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a small icon. */ TDECORE_EXPORT TQPixmap SmallIcon(const TQString& name, TDEInstance *instance); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a small icon, and apply the necessary effects to get an IconSet. */ TDECORE_EXPORT TQIconSet SmallIconSet(const TQString& name, int size=0, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a main toolbar icon. */ TDECORE_EXPORT TQPixmap MainBarIcon(const TQString& name, int size=0, - int state=KIcon::DefaultState, + int state=TDEIcon::DefaultState, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a main toolbar icon. */ TDECORE_EXPORT TQPixmap MainBarIcon(const TQString& name, TDEInstance *instance); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a main toolbar icon, and apply the effects to get an IconSet. */ TDECORE_EXPORT TQIconSet MainBarIconSet(const TQString& name, int size=0, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a user icon. User icons are searched in $appdir/pics. */ -TDECORE_EXPORT TQPixmap UserIcon(const TQString& name, int state=KIcon::DefaultState, +TDECORE_EXPORT TQPixmap UserIcon(const TQString& name, int state=TDEIcon::DefaultState, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a user icon. User icons are searched in $appdir/pics. */ TDECORE_EXPORT TQPixmap UserIcon(const TQString& name, TDEInstance *instance); /** - * \relates KIconLoader + * \relates TDEIconLoader * Load a user icon, and apply the effects to get an IconSet. */ TDECORE_EXPORT TQIconSet UserIconSet(const TQString& name, TDEInstance *instance=TDEGlobal::instance()); /** - * \relates KIconLoader + * \relates TDEIconLoader * Returns the current icon size for a specific group. */ -TDECORE_EXPORT int IconSize(KIcon::Group group, TDEInstance *instance=TDEGlobal::instance()); +TDECORE_EXPORT int IconSize(TDEIcon::Group group, TDEInstance *instance=TDEGlobal::instance()); -#endif // __KIconLoader_h_Included__ +#endif // __TDEIconLoader_h_Included__ diff --git a/tdecore/kiconloader_p.h b/tdecore/kiconloader_p.h index 4c3c87339..82ff9dbe8 100644 --- a/tdecore/kiconloader_p.h +++ b/tdecore/kiconloader_p.h @@ -9,8 +9,8 @@ * exact licensing terms. */ -#ifndef __KIconLoader_p_h_Included__ -#define __KIconLoader_p_h_Included__ +#ifndef __TDEIconLoader_p_h_Included__ +#define __TDEIconLoader_p_h_Included__ #include <tqobject.h> #include <tqstringlist.h> @@ -19,37 +19,37 @@ #include <kiconeffect.h> #include <tqdict.h> -class KIconThemeNode +class TDEIconThemeNode { public: - KIconThemeNode(KIconTheme *_theme); - ~KIconThemeNode(); + TDEIconThemeNode(TDEIconTheme *_theme); + ~TDEIconThemeNode(); - void queryIcons(TQStringList *lst, int size, KIcon::Context context) const; - void queryIconsByContext(TQStringList *lst, int size, KIcon::Context context) const; - KIcon findIcon(const TQString& name, int size, KIcon::MatchType match) const; + void queryIcons(TQStringList *lst, int size, TDEIcon::Context context) const; + void queryIconsByContext(TQStringList *lst, int size, TDEIcon::Context context) const; + TDEIcon findIcon(const TQString& name, int size, TDEIcon::MatchType match) const; void printTree(TQString& dbgString) const; - KIconTheme *theme; + TDEIconTheme *theme; }; -class KIconLoaderPrivate : public TQObject +class TDEIconLoaderPrivate : public TQObject { Q_OBJECT public: TQStringList mThemesInTree; - KIconGroup *mpGroups; - KIconThemeNode *mpThemeRoot; + TDEIconGroup *mpGroups; + TDEIconThemeNode *mpThemeRoot; TDEStandardDirs *mpDirs; - KIconLoader *q; - KIconEffect mpEffect; + TDEIconLoader *q; + TDEIconEffect mpEffect; TQDict<TQImage> imgDict; TQImage lastImage; // last loaded image without effect applied TQString lastImageKey; // key for icon without effect TQString appname; - int lastIconType; // see KIcon::type - int lastIconThreshold; // see KIcon::threshold - TQPtrList<KIconThemeNode> links; + int lastIconType; // see TDEIcon::type + int lastIconThreshold; // see TDEIcon::threshold + TQPtrList<TDEIconThemeNode> links; bool extraDesktopIconsLoaded; bool delayedLoading; @@ -57,4 +57,4 @@ public slots: void reconfigure(); }; -#endif // __KIconLoader_p_h_Included__ +#endif // __TDEIconLoader_p_h_Included__ diff --git a/tdecore/kicontheme.cpp b/tdecore/kicontheme.cpp index f967dc36c..9d5d2b7d0 100644 --- a/tdecore/kicontheme.cpp +++ b/tdecore/kicontheme.cpp @@ -37,7 +37,7 @@ #include "kicontheme.h" -class KIconThemePrivate +class TDEIconThemePrivate { public: TQString example, screenshot; @@ -49,18 +49,18 @@ public: /** * A subdirectory in an icon theme. */ -class KIconThemeDir +class TDEIconThemeDir { public: - KIconThemeDir(const TQString& dir, const TDEConfigBase *config); + TDEIconThemeDir(const TQString& dir, const TDEConfigBase *config); bool isValid() const { return mbValid; } TQString iconPath(const TQString& name) const; TQStringList iconList() const; TQString dir() const { return mDir; } - KIcon::Context context() const { return mContext; } - KIcon::Type type() const { return mType; } + TDEIcon::Context context() const { return mContext; } + TDEIcon::Type type() const { return mType; } int size() const { return mSize; } int minSize() const { return mMinSize; } int maxSize() const { return mMaxSize; } @@ -68,8 +68,8 @@ public: private: bool mbValid; - KIcon::Type mType; - KIcon::Context mContext; + TDEIcon::Type mType; + TDEIcon::Context mContext; int mSize, mMinSize, mMaxSize; int mThreshold; @@ -77,11 +77,11 @@ private: }; -/*** KIconTheme ***/ +/*** TDEIconTheme ***/ -KIconTheme::KIconTheme(const TQString& name, const TQString& appName) +TDEIconTheme::TDEIconTheme(const TQString& name, const TQString& appName) { - d = new KIconThemePrivate; + d = new TDEIconThemePrivate; TQStringList icnlibs; TQStringList::ConstIterator it, itDir; @@ -168,7 +168,7 @@ KIconTheme::KIconTheme(const TQString& name, const TQString& appName) { if (TDEStandardDirs::exists(*itDir + *it + "/")) { - KIconThemeDir *dir = new KIconThemeDir(*itDir + *it, &cfg); + TDEIconThemeDir *dir = new TDEIconThemeDir(*itDir + *it, &cfg); if (!dir->isValid()) { kdDebug(264) << "Icon directory " << *itDir << " group " << *it << " not valid.\n"; @@ -183,9 +183,9 @@ KIconTheme::KIconTheme(const TQString& name, const TQString& appName) // Expand available sizes for scalable icons to their full range int i; TQMap<int,TQValueList<int> > scIcons; - for (KIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next()) + for (TDEIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next()) { - if ((dir->type() == KIcon::Scalable) && !scIcons.contains(dir->size())) + if ((dir->type() == TDEIcon::Scalable) && !scIcons.contains(dir->size())) { TQValueList<int> lst; for (i=dir->minSize(); i<=dir->maxSize(); i++) @@ -219,31 +219,31 @@ KIconTheme::KIconTheme(const TQString& name, const TQString& appName) } -KIconTheme::~KIconTheme() +TDEIconTheme::~TDEIconTheme() { delete d; } -bool KIconTheme::isValid() const +bool TDEIconTheme::isValid() const { return !mDirs.isEmpty(); } -bool KIconTheme::isHidden() const +bool TDEIconTheme::isHidden() const { return d->hidden; } -TQString KIconTheme::example() const { return d->example; } -TQString KIconTheme::screenshot() const { return d->screenshot; } -TQString KIconTheme::linkOverlay() const { return d->linkOverlay; } -TQString KIconTheme::lockOverlay() const { return d->lockOverlay; } -TQString KIconTheme::zipOverlay() const { return d->zipOverlay; } -TQString KIconTheme::shareOverlay() const { return d->shareOverlay; } +TQString TDEIconTheme::example() const { return d->example; } +TQString TDEIconTheme::screenshot() const { return d->screenshot; } +TQString TDEIconTheme::linkOverlay() const { return d->linkOverlay; } +TQString TDEIconTheme::lockOverlay() const { return d->lockOverlay; } +TQString TDEIconTheme::zipOverlay() const { return d->zipOverlay; } +TQString TDEIconTheme::shareOverlay() const { return d->shareOverlay; } -int KIconTheme::defaultSize(KIcon::Group group) const +int TDEIconTheme::defaultSize(TDEIcon::Group group) const { - if ((group < 0) || (group >= KIcon::LastGroup)) + if ((group < 0) || (group >= TDEIcon::LastGroup)) { kdDebug(264) << "Illegal icon group: " << group << "\n"; return -1; @@ -251,10 +251,10 @@ int KIconTheme::defaultSize(KIcon::Group group) const return mDefSize[group]; } -TQValueList<int> KIconTheme::querySizes(KIcon::Group group) const +TQValueList<int> TDEIconTheme::querySizes(TDEIcon::Group group) const { TQValueList<int> empty; - if ((group < 0) || (group >= KIcon::LastGroup)) + if ((group < 0) || (group >= TDEIcon::LastGroup)) { kdDebug(264) << "Illegal icon group: " << group << "\n"; return empty; @@ -262,32 +262,32 @@ TQValueList<int> KIconTheme::querySizes(KIcon::Group group) const return mSizes[group]; } -TQStringList KIconTheme::queryIcons(int size, KIcon::Context context) const +TQStringList TDEIconTheme::queryIcons(int size, TDEIcon::Context context) const { int delta = 1000, dw; - TQPtrListIterator<KIconThemeDir> dirs(mDirs); - KIconThemeDir *dir; + TQPtrListIterator<TDEIconThemeDir> dirs(mDirs); + TDEIconThemeDir *dir; // Try to find exact match TQStringList result; for ( ; dirs.current(); ++dirs) { dir = dirs.current(); - if ((context != KIcon::Any) && (context != dir->context())) + if ((context != TDEIcon::Any) && (context != dir->context())) continue; - if ((dir->type() == KIcon::Fixed) && (dir->size() == size)) + if ((dir->type() == TDEIcon::Fixed) && (dir->size() == size)) { result += dir->iconList(); continue; } - if ((dir->type() == KIcon::Scalable) && + if ((dir->type() == TDEIcon::Scalable) && (size >= dir->minSize()) && (size <= dir->maxSize())) { result += dir->iconList(); continue; } - if ((dir->type() == KIcon::Threshold) && + if ((dir->type() == TDEIcon::Threshold) && (abs(size-dir->size())<dir->threshold())) result+=dir->iconList(); } @@ -297,11 +297,11 @@ TQStringList KIconTheme::queryIcons(int size, KIcon::Context context) const dirs.toFirst(); // Find close match - KIconThemeDir *best = 0L; + TDEIconThemeDir *best = 0L; for ( ; dirs.current(); ++dirs) { dir = dirs.current(); - if ((context != KIcon::Any) && (context != dir->context())) + if ((context != TDEIcon::Any) && (context != dir->context())) continue; dw = dir->size() - size; if ((dw > 6) || (abs(dw) >= abs(delta))) @@ -315,11 +315,11 @@ TQStringList KIconTheme::queryIcons(int size, KIcon::Context context) const return best->iconList(); } -TQStringList KIconTheme::queryIconsByContext(int size, KIcon::Context context) const +TQStringList TDEIconTheme::queryIconsByContext(int size, TDEIcon::Context context) const { - TQPtrListIterator<KIconThemeDir> dirs(mDirs); + TQPtrListIterator<TDEIconThemeDir> dirs(mDirs); int dw; - KIconThemeDir *dir; + TDEIconThemeDir *dir; // We want all the icons for a given context, but we prefer icons // of size size . Note that this may (will) include duplicate icons @@ -332,7 +332,7 @@ TQStringList KIconTheme::queryIconsByContext(int size, KIcon::Context context) c for ( ; dirs.current(); ++dirs) { dir = dirs.current(); - if ((context != KIcon::Any) && (context != dir->context())) + if ((context != TDEIcon::Any) && (context != dir->context())) continue; dw = abs(dir->size() - size); iconlist[(dw<127)?dw:127]+=dir->iconList(); @@ -344,50 +344,50 @@ TQStringList KIconTheme::queryIconsByContext(int size, KIcon::Context context) c return iconlistResult; } -bool KIconTheme::hasContext(KIcon::Context context) const +bool TDEIconTheme::hasContext(TDEIcon::Context context) const { - TQPtrListIterator<KIconThemeDir> dirs(mDirs); - KIconThemeDir *dir; + TQPtrListIterator<TDEIconThemeDir> dirs(mDirs); + TDEIconThemeDir *dir; for ( ; dirs.current(); ++dirs) { dir = dirs.current(); - if ((context == KIcon::Any) || (context == dir->context())) + if ((context == TDEIcon::Any) || (context == dir->context())) return true; } return false; } -KIcon KIconTheme::iconPath(const TQString& name, int size, KIcon::MatchType match) const +TDEIcon TDEIconTheme::iconPath(const TQString& name, int size, TDEIcon::MatchType match) const { - KIcon icon; + TDEIcon icon; TQString path; int delta = -1000, dw; - KIconThemeDir *dir; + TDEIconThemeDir *dir; dw = 1000; // shut up, gcc - TQPtrListIterator<KIconThemeDir> dirs(mDirs); + TQPtrListIterator<TDEIconThemeDir> dirs(mDirs); for ( ; dirs.current(); ++dirs) { dir = dirs.current(); - if (match == KIcon::MatchExact) + if (match == TDEIcon::MatchExact) { - if ((dir->type() == KIcon::Fixed) && (dir->size() != size)) + if ((dir->type() == TDEIcon::Fixed) && (dir->size() != size)) continue; - if ((dir->type() == KIcon::Scalable) && + if ((dir->type() == TDEIcon::Scalable) && ((size < dir->minSize()) || (size > dir->maxSize()))) continue; - if ((dir->type() == KIcon::Threshold) && + if ((dir->type() == TDEIcon::Threshold) && (abs(dir->size()-size) > dir->threshold())) continue; } else { // dw < 0 means need to scale up to get an icon of the requested size - if (dir->type() == KIcon::Fixed) + if (dir->type() == TDEIcon::Fixed) { dw = dir->size() - size; - } else if (dir->type() == KIcon::Scalable) + } else if (dir->type() == TDEIcon::Scalable) { if (size < dir->minSize()) dw = dir->minSize() - size; @@ -395,7 +395,7 @@ KIcon KIconTheme::iconPath(const TQString& name, int size, KIcon::MatchType matc dw = dir->maxSize() - size; else dw = 0; - } else if (dir->type() == KIcon::Threshold) + } else if (dir->type() == TDEIcon::Threshold) { if (size < dir->size() - dir->threshold()) dw = dir->size() - dir->threshold() - size; @@ -423,7 +423,7 @@ KIcon KIconTheme::iconPath(const TQString& name, int size, KIcon::MatchType matc icon.context = dir->context(); // if we got in MatchExact that far, we find no better - if (match == KIcon::MatchExact) + if (match == TDEIcon::MatchExact) return icon; else { @@ -435,13 +435,13 @@ KIcon KIconTheme::iconPath(const TQString& name, int size, KIcon::MatchType matc } // static -TQString *KIconTheme::_theme = 0L; +TQString *TDEIconTheme::_theme = 0L; // static -TQStringList *KIconTheme::_theme_list = 0L; +TQStringList *TDEIconTheme::_theme_list = 0L; // static -TQString KIconTheme::current() +TQString TDEIconTheme::current() { // Static pointer because of unloading problems wrt DSO's. if (_theme != 0L) @@ -463,7 +463,7 @@ TQString KIconTheme::current() } // static -TQStringList KIconTheme::list() +TQStringList TDEIconTheme::list() { // Static pointer because of unloading problems wrt DSO's. if (_theme_list != 0L) @@ -489,7 +489,7 @@ TQStringList KIconTheme::list() continue; if (!TDEStandardDirs::exists(*it + *it2 + "/index.desktop") && !TDEStandardDirs::exists(*it + *it2 + "/index.theme")) continue; - KIconTheme oink(*it2); + TDEIconTheme oink(*it2); if (!oink.isValid()) continue; if (!_theme_list->contains(*it2)) @@ -500,7 +500,7 @@ TQStringList KIconTheme::list() } // static -void KIconTheme::reconfigure() +void TDEIconTheme::reconfigure() { delete _theme; _theme=0L; @@ -509,75 +509,75 @@ void KIconTheme::reconfigure() } // static -TQString KIconTheme::defaultThemeName() +TQString TDEIconTheme::defaultThemeName() { return TQString::fromLatin1("crystalsvg"); } -/*** KIconThemeDir ***/ +/*** TDEIconThemeDir ***/ -KIconThemeDir::KIconThemeDir(const TQString& dir, const TDEConfigBase *config) +TDEIconThemeDir::TDEIconThemeDir(const TQString& dir, const TDEConfigBase *config) { mbValid = false; mDir = dir; mSize = config->readNumEntry("Size"); mMinSize = 1; // just set the variables to something mMaxSize = 50; // meaningful in case someone calls minSize or maxSize - mType = KIcon::Fixed; + mType = TDEIcon::Fixed; if (mSize == 0) return; TQString tmp = config->readEntry("Context"); if (tmp == "Devices") - mContext = KIcon::Device; + mContext = TDEIcon::Device; else if (tmp == "MimeTypes") - mContext = KIcon::MimeType; + mContext = TDEIcon::MimeType; else if (tmp == "FileSystems") - mContext = KIcon::FileSystem; + mContext = TDEIcon::FileSystem; else if (tmp == "Applications") - mContext = KIcon::Application; + mContext = TDEIcon::Application; else if (tmp == "Actions") - mContext = KIcon::Action; + mContext = TDEIcon::Action; else if (tmp == "Animations") - mContext = KIcon::Animation; + mContext = TDEIcon::Animation; else if (tmp == "Categories") - mContext = KIcon::Category; + mContext = TDEIcon::Category; else if (tmp == "Emblems") - mContext = KIcon::Emblem; + mContext = TDEIcon::Emblem; else if (tmp == "Emotes") - mContext = KIcon::Emote; + mContext = TDEIcon::Emote; else if (tmp == "International") - mContext = KIcon::International; + mContext = TDEIcon::International; else if (tmp == "Places") - mContext = KIcon::Place; + mContext = TDEIcon::Place; else if (tmp == "Status") - mContext = KIcon::StatusIcon; + mContext = TDEIcon::StatusIcon; else { kdDebug(264) << "Invalid Context= line for icon theme: " << mDir << "\n"; return; } tmp = config->readEntry("Type"); if (tmp == "Fixed") - mType = KIcon::Fixed; + mType = TDEIcon::Fixed; else if (tmp == "Scalable") - mType = KIcon::Scalable; + mType = TDEIcon::Scalable; else if (tmp == "Threshold") - mType = KIcon::Threshold; + mType = TDEIcon::Threshold; else { kdDebug(264) << "Invalid Type= line for icon theme: " << mDir << "\n"; return; } - if (mType == KIcon::Scalable) + if (mType == TDEIcon::Scalable) { mMinSize = config->readNumEntry("MinSize", mSize); mMaxSize = config->readNumEntry("MaxSize", mSize); - } else if (mType == KIcon::Threshold) + } else if (mType == TDEIcon::Threshold) mThreshold = config->readNumEntry("Threshold", 2); mbValid = true; } -TQString KIconThemeDir::iconPath(const TQString& name) const +TQString TDEIconThemeDir::iconPath(const TQString& name) const { if (!mbValid) return TQString::null; @@ -589,7 +589,7 @@ TQString KIconThemeDir::iconPath(const TQString& name) const return TQString::null; } -TQStringList KIconThemeDir::iconList() const +TQStringList TDEIconThemeDir::iconList() const { TQDir dir(mDir); #ifdef HAVE_LIBART diff --git a/tdecore/kicontheme.h b/tdecore/kicontheme.h index b20dd6340..9079eff0c 100644 --- a/tdecore/kicontheme.h +++ b/tdecore/kicontheme.h @@ -10,8 +10,8 @@ * */ -#ifndef __KIconTheme_h_Included__ -#define __KIconTheme_h_Included__ +#ifndef __TDEIconTheme_h_Included__ +#define __TDEIconTheme_h_Included__ #include <tqstring.h> #include <tqstringlist.h> @@ -20,23 +20,23 @@ #include "tdelibs_export.h" class TDEConfig; -class KIconThemeDir; +class TDEIconThemeDir; -class KIconThemePrivate; +class TDEIconThemePrivate; -class KIconPrivate; +class TDEIconPrivate; /** - * One icon as found by KIconTheme. Also serves as a namespace containing + * One icon as found by TDEIconTheme. Also serves as a namespace containing * icon related constants. - * @see KIconEffect - * @see KIconTheme - * @see KIconLoader + * @see TDEIconEffect + * @see TDEIconTheme + * @see TDEIconLoader */ -class TDECORE_EXPORT KIcon +class TDECORE_EXPORT TDEIcon { public: - KIcon() { size = 0; } + TDEIcon() { size = 0; } /** * Return true if this icon is valid, false otherwise. @@ -81,7 +81,7 @@ public: }; // if you add a group here, make sure to change the config reading in - // KIconLoader too + // TDEIconLoader too /** * The group of the icon. */ @@ -173,18 +173,18 @@ public: TQString path; private: - KIconPrivate *d; + TDEIconPrivate *d; }; -inline KIcon::Group& operator++(KIcon::Group& group) { group = static_cast<KIcon::Group>(group+1); return group; } -inline KIcon::Group operator++(KIcon::Group& group,int) { KIcon::Group ret = group; ++group; return ret; } +inline TDEIcon::Group& operator++(TDEIcon::Group& group) { group = static_cast<TDEIcon::Group>(group+1); return group; } +inline TDEIcon::Group operator++(TDEIcon::Group& group,int) { TDEIcon::Group ret = group; ++group; return ret; } /** * Class to use/access icon themes in KDE. This class is used by the * iconloader but can be used by others too. - * @see KIconLoader + * @see TDEIconLoader */ -class TDECORE_EXPORT KIconTheme +class TDECORE_EXPORT TDEIconTheme { public: /** @@ -193,8 +193,8 @@ public: * @param appName the name of the application. Can be null. This argument * allows applications to have themed application icons. */ - KIconTheme(const TQString& name, const TQString& appName=TQString::null); - ~KIconTheme(); + TDEIconTheme(const TQString& name, const TQString& appName=TQString::null); + ~TDEIconTheme(); /** * The stylized name of the icon theme. @@ -281,17 +281,17 @@ public: /** * The default size of this theme for a certain icon group. - * @param group The icon group. See KIcon::Group. + * @param group The icon group. See TDEIcon::Group. * @return The default size in pixels for the given icon group. */ - int defaultSize(KIcon::Group group) const; + int defaultSize(TDEIcon::Group group) const; /** * Query available sizes for a group. - * @param group The icon group. See KIcon::Group. + * @param group The icon group. See TDEIcon::Group. * @return a list of available sized for the given group */ - TQValueList<int> querySizes(KIcon::Group group) const; + TQValueList<int> querySizes(TDEIcon::Group group) const; /** * Query available icons for a size and context. @@ -299,7 +299,7 @@ public: * @param context the context of the icons * @return the list of icon names */ - TQStringList queryIcons(int size, KIcon::Context context = KIcon::Any) const; + TQStringList queryIcons(int size, TDEIcon::Context context = TDEIcon::Any) const; /** * Query available icons for a context and preferred size. @@ -307,26 +307,26 @@ public: * @param context the context of the icons * @return the list of icon names */ - TQStringList queryIconsByContext(int size, KIcon::Context context = KIcon::Any) const; + TQStringList queryIconsByContext(int size, TDEIcon::Context context = TDEIcon::Any) const; /** * Lookup an icon in the theme. * @param name The name of the icon, without extension. * @param size The desired size of the icon. - * @param match The matching mode. KIcon::MatchExact returns an icon - * only if matches exactly. KIcon::MatchBest returns the best matching + * @param match The matching mode. TDEIcon::MatchExact returns an icon + * only if matches exactly. TDEIcon::MatchBest returns the best matching * icon. - * @return A KIcon class that describes the icon. If an icon is found, - * @see KIcon::isValid will return true, and false otherwise. + * @return A TDEIcon class that describes the icon. If an icon is found, + * @see TDEIcon::isValid will return true, and false otherwise. */ - KIcon iconPath(const TQString& name, int size, KIcon::MatchType match) const; + TDEIcon iconPath(const TQString& name, int size, TDEIcon::MatchType match) const; /** * Returns true if the theme has any icons for the given context. * @since 3.5.5 */ - bool hasContext( KIcon::Context context ) const; + bool hasContext( TDEIcon::Context context ) const; /** * List all icon themes installed on the system, global and local. @@ -359,8 +359,8 @@ private: int mDepth; TQString mDir, mName, mDesc; TQStringList mInherits; - TQPtrList<KIconThemeDir> mDirs; - KIconThemePrivate *d; + TQPtrList<TDEIconThemeDir> mDirs; + TDEIconThemePrivate *d; static TQString *_theme; static TQStringList *_theme_list; diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index 308ea7782..749979750 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -259,11 +259,11 @@ void TDEInstance::setConfigName(const TQString &configName) d->configName = configName; } -KIconLoader *TDEInstance::iconLoader() const +TDEIconLoader *TDEInstance::iconLoader() const { DEBUG_CHECK_ALIVE if( _iconLoader == 0 ) { - _iconLoader = new KIconLoader( _name, dirs() ); + _iconLoader = new TDEIconLoader( _name, dirs() ); _iconLoader->enableDelayedIconSetLoading( true ); } @@ -293,7 +293,7 @@ TDEGlobalNetworkManager *TDEInstance::networkManager() const void TDEInstance::newIconLoader() const { DEBUG_CHECK_ALIVE - KIconTheme::reconfigure(); + TDEIconTheme::reconfigure(); _iconLoader->reconfigure( _name, dirs() ); } diff --git a/tdecore/kinstance.h b/tdecore/kinstance.h index 759581080..be60c943c 100644 --- a/tdecore/kinstance.h +++ b/tdecore/kinstance.h @@ -21,7 +21,7 @@ class TDEStandardDirs; class TDEAboutData; class TDEConfig; -class KIconLoader; +class TDEIconLoader; class KCharsets; class TQFont; class TDEInstancePrivate; @@ -108,7 +108,7 @@ class TDECORE_EXPORT TDEInstance * Returns an iconloader object. * @return the iconloader object. */ - KIconLoader *iconLoader() const; + TDEIconLoader *iconLoader() const; /** * Returns a TDEHardwareDevices object. @@ -166,7 +166,7 @@ private: mutable TDEStandardDirs *_dirs; mutable TDEConfig *_config; - mutable KIconLoader *_iconLoader; + mutable TDEIconLoader *_iconLoader; mutable TDEHardwareDevices *_hardwaredevices; mutable TDEGlobalNetworkManager *_networkmanager; diff --git a/tdecore/kmimesourcefactory.cpp b/tdecore/kmimesourcefactory.cpp index ed4265835..f08cb249a 100644 --- a/tdecore/kmimesourcefactory.cpp +++ b/tdecore/kmimesourcefactory.cpp @@ -28,8 +28,8 @@ class KMimeSourceFactoryPrivate { public: - inline KMimeSourceFactoryPrivate (KIconLoader* loader) : m_iconLoader(loader), m_instance(0L) {} - inline KIconLoader *iconLoader() + inline KMimeSourceFactoryPrivate (TDEIconLoader* loader) : m_iconLoader(loader), m_instance(0L) {} + inline TDEIconLoader *iconLoader() { // If we don't have either of these, things are looking grim. Q_ASSERT(m_instance || m_iconLoader); @@ -40,11 +40,11 @@ public: return m_instance->iconLoader(); } - KIconLoader *m_iconLoader; + TDEIconLoader *m_iconLoader; TDEInstance *m_instance; }; -KMimeSourceFactory::KMimeSourceFactory (KIconLoader* loader) +KMimeSourceFactory::KMimeSourceFactory (TDEIconLoader* loader) : TQMimeSourceFactory (), d (new KMimeSourceFactoryPrivate (loader)) { @@ -71,23 +71,23 @@ TQString KMimeSourceFactory::makeAbsolute (const TQString& absOrRelName, const T if (myContext == "desktop") { - result = d->iconLoader()->iconPath (myName, KIcon::Desktop); + result = d->iconLoader()->iconPath (myName, TDEIcon::Desktop); } else if (myContext == "toolbar") { - result = d->iconLoader()->iconPath (myName, KIcon::Toolbar); + result = d->iconLoader()->iconPath (myName, TDEIcon::Toolbar); } else if (myContext == "maintoolbar") { - result = d->iconLoader()->iconPath (myName, KIcon::MainToolbar); + result = d->iconLoader()->iconPath (myName, TDEIcon::MainToolbar); } else if (myContext == "small") { - result = d->iconLoader()->iconPath (myName, KIcon::Small); + result = d->iconLoader()->iconPath (myName, TDEIcon::Small); } else if (myContext == "user") { - result = d->iconLoader()->iconPath (myName, KIcon::User); + result = d->iconLoader()->iconPath (myName, TDEIcon::User); } if (result.isEmpty()) diff --git a/tdecore/kmimesourcefactory.h b/tdecore/kmimesourcefactory.h index e18c7d888..16302dfe4 100644 --- a/tdecore/kmimesourcefactory.h +++ b/tdecore/kmimesourcefactory.h @@ -29,7 +29,7 @@ class KMimeSourceFactoryPrivate; class TDEInstance; /** - * An extension to TQMimeSourceFactory that uses KIconLoader to + * An extension to TQMimeSourceFactory that uses TDEIconLoader to * find images. * * Normally you don't have to instantiate this class at all, TDEApplication does that for @@ -46,7 +46,7 @@ public: * * @param loader is the iconloader used to find images. */ - KMimeSourceFactory (KIconLoader* loader = TDEGlobal::iconLoader()); + KMimeSourceFactory (TDEIconLoader* loader = TDEGlobal::iconLoader()); /** * Destructor. diff --git a/tdecore/kpixmapprovider.h b/tdecore/kpixmapprovider.h index 009f1ed75..f01466315 100644 --- a/tdecore/kpixmapprovider.h +++ b/tdecore/kpixmapprovider.h @@ -43,7 +43,7 @@ public: * You may subclass this and return a pixmap of size @p size for @p text. * @param text the text that is associated with the pixmap * @param size the size of the icon in pixels, 0 for defaylt size. - * See KIcon::StdSize. + * See TDEIcon::StdSize. * @return the pixmap for the arguments, or null if there is none */ virtual TQPixmap pixmapFor( const TQString& text, int size = 0 ) = 0; diff --git a/tdecore/kstandarddirs.h b/tdecore/kstandarddirs.h index 29a5a9627..7eb654f42 100644 --- a/tdecore/kstandarddirs.h +++ b/tdecore/kstandarddirs.h @@ -75,7 +75,7 @@ class TDEStandardDirsPrivate; * @li data - Where applications store data. * @li exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account. * @li html - HTML documentation. - * @li icon - Icons, see KIconLoader. + * @li icon - Icons, see TDEIconLoader. * @li lib - Libraries. * @li locale - Translation files for TDELocale. * @li mime - Mime types. diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index d0164a3b2..559650e20 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -286,7 +286,7 @@ TDEGenericDevice* TDEGenericDevice::parentDevice() { return m_parentDevice; } -TQPixmap TDEGenericDevice::icon(KIcon::StdSizes size) { +TQPixmap TDEGenericDevice::icon(TDEIcon::StdSizes size) { return TDEGlobal::hardwareDevices()->getDeviceTypeIconFromType(type(), size); } @@ -541,7 +541,7 @@ TQString TDEStorageDevice::friendlyName() { TQString TDEStorageDevice::friendlyDeviceType() { TQString ret = i18n("Hard Disk Drive"); - // Keep this in sync with TDEStorageDevice::icon(KIcon::StdSizes size) below + // Keep this in sync with TDEStorageDevice::icon(TDEIcon::StdSizes size) below if (isDiskOfType(TDEDiskDeviceType::Floppy)) { ret = i18n("Floppy Drive"); } @@ -602,7 +602,7 @@ TQString TDEStorageDevice::friendlyDeviceType() { return ret; } -TQPixmap TDEStorageDevice::icon(KIcon::StdSizes size) { +TQPixmap TDEStorageDevice::icon(TDEIcon::StdSizes size) { TQPixmap ret = DesktopIcon("hdd_unmount", size); if (isDiskOfType(TDEDiskDeviceType::Floppy)) { @@ -5495,7 +5495,7 @@ TQString TDEHardwareDevices::getFriendlyDeviceTypeStringFromType(TDEGenericDevic return ret; } -TQPixmap TDEHardwareDevices::getDeviceTypeIconFromType(TDEGenericDeviceType::TDEGenericDeviceType query, KIcon::StdSizes size) { +TQPixmap TDEHardwareDevices::getDeviceTypeIconFromType(TDEGenericDeviceType::TDEGenericDeviceType query, TDEIcon::StdSizes size) { TQPixmap ret = DesktopIcon("misc", size); // // Keep this in sync with the TDEGenericDeviceType definition in the header diff --git a/tdecore/tdehardwaredevices.h b/tdecore/tdehardwaredevices.h index b6d0dd5ef..0363596e4 100644 --- a/tdecore/tdehardwaredevices.h +++ b/tdecore/tdehardwaredevices.h @@ -353,10 +353,10 @@ class TDECORE_EXPORT TDEGenericDevice : public TQObject /** * Get an icon for this device - * @param size a KIcon::StdSizes structure specifying the desired icon size + * @param size a TDEIcon::StdSizes structure specifying the desired icon size * @return a TQPixmap containing the icon for the specified type */ - virtual TQPixmap icon(KIcon::StdSizes size); + virtual TQPixmap icon(TDEIcon::StdSizes size); protected: /** @@ -622,12 +622,12 @@ class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice /** * Get an icon for this device - * @param size a KIcon::StdSizes structure specifying the desired icon size + * @param size a TDEIcon::StdSizes structure specifying the desired icon size * @return a TQPixmap containing the icon for the specified type * - * This method overrides TDEGenericDevice::icon(KIcon::StdSizes size) + * This method overrides TDEGenericDevice::icon(TDEIcon::StdSizes size) */ - TQPixmap icon(KIcon::StdSizes size); + TQPixmap icon(TDEIcon::StdSizes size); /** * @return a TQString with a friendly name @@ -1977,10 +1977,10 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject /** * Get an icon for a device type * @param query a TDEGenericDeviceType::TDEGenericDeviceType specifying a device type - * @param size a KIcon::StdSizes structure specifying the desired icon size + * @param size a TDEIcon::StdSizes structure specifying the desired icon size * @return a TQPixmap containing the icon for the specified type */ - TQPixmap getDeviceTypeIconFromType(TDEGenericDeviceType::TDEGenericDeviceType query, KIcon::StdSizes size); + TQPixmap getDeviceTypeIconFromType(TDEGenericDeviceType::TDEGenericDeviceType query, TDEIcon::StdSizes size); /** * Convenience function to obtain the root system device diff --git a/tdecore/tests/kiconloadertest.cpp b/tdecore/tests/kiconloadertest.cpp index 27dcdf845..29f810488 100644 --- a/tdecore/tests/kiconloadertest.cpp +++ b/tdecore/tests/kiconloadertest.cpp @@ -9,12 +9,12 @@ int main(int argc, char *argv[]) { TDEApplication app(argc,argv,"kiconloadertest"/*,false,false*/); - KIconLoader * mpLoader = TDEGlobal::iconLoader(); - KIcon::Context mContext = KIcon::Application; + TDEIconLoader * mpLoader = TDEGlobal::iconLoader(); + TDEIcon::Context mContext = TDEIcon::Application; TQTime dt; dt.start(); int count = 0; - for ( int mGroup = 0; mGroup < KIcon::LastGroup ; ++mGroup ) + for ( int mGroup = 0; mGroup < TDEIcon::LastGroup ; ++mGroup ) { kdDebug() << "queryIcons " << mGroup << "," << mContext << endl; TQStringList filelist=mpLoader->queryIcons(mGroup, mContext); @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) ++it, ++i ) { //kdDebug() << ( i==9 ? "..." : (*it) ) << endl; - mpLoader->loadIcon( (*it), (KIcon::Group)mGroup ); + mpLoader->loadIcon( (*it), (TDEIcon::Group)mGroup ); ++count; } } diff --git a/tdecore/twin.cpp b/tdecore/twin.cpp index a0cc69dc1..841463e52 100644 --- a/tdecore/twin.cpp +++ b/tdecore/twin.cpp @@ -483,8 +483,8 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags ) if( XGetClassHint( tqt_xdisplay(), win, &hint ) ) { TQString className = hint.res_class; - TQPixmap pm = TDEGlobal::instance()->iconLoader()->loadIcon( className.lower(), KIcon::Small, iconWidth, - KIcon::DefaultState, 0, true ); + TQPixmap pm = TDEGlobal::instance()->iconLoader()->loadIcon( className.lower(), TDEIcon::Small, iconWidth, + TDEIcon::DefaultState, 0, true ); if( scale && !pm.isNull() ) result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) ); else @@ -500,8 +500,8 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags ) // If the icon is still a null pixmap, load the 'xapp' icon // as a last resort: if ( result.isNull() ) { - TQPixmap pm = TDEGlobal::instance()->iconLoader()->loadIcon( "xapp", KIcon::Small, iconWidth, - KIcon::DefaultState, 0, true ); + TQPixmap pm = TDEGlobal::instance()->iconLoader()->loadIcon( "xapp", TDEIcon::Small, iconWidth, + TDEIcon::DefaultState, 0, true ); if( scale && !pm.isNull() ) result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) ); else |