• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kicontheme.cpp
1 /* vi: ts=8 sts=4 sw=4
2  *
3  * $Id$
4  *
5  * This file is part of the KDE project, module kdecore.
6  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
7  * Antonio Larrosa <larrosa@kde.org>
8  *
9  * This is free software; it comes under the GNU Library General
10  * Public License, version 2. See the file "COPYING.LIB" for the
11  * exact licensing terms.
12  *
13  * kicontheme.cpp: Lowlevel icon theme handling.
14  */
15 
16 #include <sys/stat.h>
17 #include <unistd.h>
18 #include <stdlib.h>
19 #include <config.h>
20 
21 #include <tqstring.h>
22 #include <tqstringlist.h>
23 #include <tqvaluelist.h>
24 #include <tqmap.h>
25 #include <tqpixmap.h>
26 #include <tqpixmapcache.h>
27 #include <tqimage.h>
28 #include <tqfileinfo.h>
29 #include <tqdir.h>
30 
31 #include <kdebug.h>
32 #include <kstandarddirs.h>
33 #include <kglobal.h>
34 #include <kconfig.h>
35 #include <ksimpleconfig.h>
36 #include <kinstance.h>
37 
38 #include "kicontheme.h"
39 
40 class KIconThemePrivate
41 {
42 public:
43  TQString example, screenshot;
44  TQString linkOverlay, lockOverlay, zipOverlay, shareOverlay;
45  bool hidden;
46  KSharedConfig::Ptr sharedConfig;
47 };
48 
52 class KIconThemeDir
53 {
54 public:
55  KIconThemeDir(const TQString& dir, const KConfigBase *config);
56 
57  bool isValid() const { return mbValid; }
58  TQString iconPath(const TQString& name) const;
59  TQStringList iconList() const;
60  TQString dir() const { return mDir; }
61 
62  KIcon::Context context() const { return mContext; }
63  KIcon::Type type() const { return mType; }
64  int size() const { return mSize; }
65  int minSize() const { return mMinSize; }
66  int maxSize() const { return mMaxSize; }
67  int threshold() const { return mThreshold; }
68 
69 private:
70  bool mbValid;
71  KIcon::Type mType;
72  KIcon::Context mContext;
73  int mSize, mMinSize, mMaxSize;
74  int mThreshold;
75 
76  TQString mDir;
77 };
78 
79 
80 /*** KIconTheme ***/
81 
82 KIconTheme::KIconTheme(const TQString& name, const TQString& appName)
83 {
84  d = new KIconThemePrivate;
85 
86  TQStringList icnlibs;
87  TQStringList::ConstIterator it, itDir;
88  TQStringList themeDirs;
89  TQString cDir;
90 
91  // Applications can have local additions to the global "locolor" and
92  // "hicolor" icon themes. For these, the _global_ theme description
93  // files are used..
94 
95  if (!appName.isEmpty() &&
96  ( name == "crystalsvg" || name== "hicolor" || name == "locolor" ) )
97  {
98  icnlibs = KGlobal::dirs()->resourceDirs("data");
99  for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
100  {
101  cDir = *it + appName + "/icons/" + name;
102  if (TQFile::exists( cDir ))
103  themeDirs += cDir + "/";
104  }
105  }
106  // Find the theme description file. These are always global.
107 
108  icnlibs = KGlobal::dirs()->resourceDirs("icon");
109  icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-icon");
110  icnlibs += "/usr/share/pixmaps";
111  // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
112  icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-pixmap");
113  for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
114  {
115  cDir = *it + name + "/";
116  if (KStandardDirs::exists(cDir))
117  {
118  themeDirs += cDir;
119  if (mDir.isEmpty()
120  && (KStandardDirs::exists( cDir + "index.desktop") || KStandardDirs::exists( cDir + "index.theme")))
121  mDir = cDir;
122  }
123  }
124 
125  if (mDir.isEmpty())
126  {
127  kdDebug(264) << "Icon theme " << name << " not found.\n";
128  return;
129  }
130 
131  TQString fileName, mainSection;
132  if(TQFile::exists(mDir + "index.desktop")) {
133  fileName = mDir + "index.desktop";
134  mainSection="KDE Icon Theme";
135  } else {
136  fileName = mDir + "index.theme";
137  mainSection="Icon Theme";
138  }
139  // Use KSharedConfig to avoid parsing the file many times, from each kinstance.
140  // Need to keep a ref to it to make this useful
141  d->sharedConfig = KSharedConfig::openConfig( fileName, true /*readonly*/, false /*useKDEGlobals*/ );
142  KConfig& cfg = *d->sharedConfig;
143  //was: KSimpleConfig cfg(fileName);
144 
145  cfg.setGroup(mainSection);
146  mName = cfg.readEntry("Name");
147  mDesc = cfg.readEntry("Comment");
148  mDepth = cfg.readNumEntry("DisplayDepth", 32);
149  mInherits = cfg.readListEntry("Inherits");
150  if ( name != "crystalsvg" )
151  for ( TQStringList::Iterator it = mInherits.begin(); it != mInherits.end(); ++it )
152  if ( *it == "default" || *it == "hicolor" ) *it="crystalsvg";
153 
154  d->hidden = cfg.readBoolEntry("Hidden", false);
155  d->example = cfg.readPathEntry("Example");
156  d->screenshot = cfg.readPathEntry("ScreenShot");
157  d->linkOverlay = cfg.readEntry("LinkOverlay", "link");
158  d->lockOverlay = cfg.readEntry("LockOverlay", "lock");
159  d->zipOverlay = cfg.readEntry("ZipOverlay", "zip");
160  d->shareOverlay = cfg.readEntry("ShareOverlay","share");
161 
162  TQStringList dirs = cfg.readPathListEntry("Directories");
163  mDirs.setAutoDelete(true);
164  for (it=dirs.begin(); it!=dirs.end(); ++it)
165  {
166  cfg.setGroup(*it);
167  for (itDir=themeDirs.begin(); itDir!=themeDirs.end(); ++itDir)
168  {
169  if (KStandardDirs::exists(*itDir + *it + "/"))
170  {
171  KIconThemeDir *dir = new KIconThemeDir(*itDir + *it, &cfg);
172  if (!dir->isValid())
173  {
174  kdDebug(264) << "Icon directory " << *itDir << " group " << *it << " not valid.\n";
175  delete dir;
176  }
177  else
178  mDirs.append(dir);
179  }
180  }
181  }
182 
183  // Expand available sizes for scalable icons to their full range
184  int i;
185  TQMap<int,TQValueList<int> > scIcons;
186  for (KIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next())
187  {
188  if ((dir->type() == KIcon::Scalable) && !scIcons.contains(dir->size()))
189  {
190  TQValueList<int> lst;
191  for (i=dir->minSize(); i<=dir->maxSize(); i++)
192  lst += i;
193  scIcons[dir->size()] = lst;
194  }
195  }
196 
197  TQStringList groups;
198  groups += "Desktop";
199  groups += "Toolbar";
200  groups += "MainToolbar";
201  groups += "Small";
202  groups += "Panel";
203  const int defDefSizes[] = { 32, 22, 22, 16, 32 };
204  cfg.setGroup(mainSection);
205  for (it=groups.begin(), i=0; it!=groups.end(); ++it, i++)
206  {
207  mDefSize[i] = cfg.readNumEntry(*it + "Default", defDefSizes[i]);
208  TQValueList<int> exp, lst = cfg.readIntListEntry(*it + "Sizes");
209  TQValueList<int>::ConstIterator it2;
210  for (it2=lst.begin(); it2!=lst.end(); ++it2)
211  {
212  if (scIcons.contains(*it2))
213  exp += scIcons[*it2];
214  else
215  exp += *it2;
216  }
217  mSizes[i] = exp;
218  }
219 
220 }
221 
222 KIconTheme::~KIconTheme()
223 {
224  delete d;
225 }
226 
227 bool KIconTheme::isValid() const
228 {
229  return !mDirs.isEmpty();
230 }
231 
232 bool KIconTheme::isHidden() const
233 {
234  return d->hidden;
235 }
236 
237 TQString KIconTheme::example() const { return d->example; }
238 TQString KIconTheme::screenshot() const { return d->screenshot; }
239 TQString KIconTheme::linkOverlay() const { return d->linkOverlay; }
240 TQString KIconTheme::lockOverlay() const { return d->lockOverlay; }
241 TQString KIconTheme::zipOverlay() const { return d->zipOverlay; }
242 TQString KIconTheme::shareOverlay() const { return d->shareOverlay; }
243 
244 int KIconTheme::defaultSize(KIcon::Group group) const
245 {
246  if ((group < 0) || (group >= KIcon::LastGroup))
247  {
248  kdDebug(264) << "Illegal icon group: " << group << "\n";
249  return -1;
250  }
251  return mDefSize[group];
252 }
253 
254 TQValueList<int> KIconTheme::querySizes(KIcon::Group group) const
255 {
256  TQValueList<int> empty;
257  if ((group < 0) || (group >= KIcon::LastGroup))
258  {
259  kdDebug(264) << "Illegal icon group: " << group << "\n";
260  return empty;
261  }
262  return mSizes[group];
263 }
264 
265 TQStringList KIconTheme::queryIcons(int size, KIcon::Context context) const
266 {
267  int delta = 1000, dw;
268 
269  TQPtrListIterator<KIconThemeDir> dirs(mDirs);
270  KIconThemeDir *dir;
271 
272  // Try to find exact match
273  TQStringList result;
274  for ( ; dirs.current(); ++dirs)
275  {
276  dir = dirs.current();
277  if ((context != KIcon::Any) && (context != dir->context()))
278  continue;
279  if ((dir->type() == KIcon::Fixed) && (dir->size() == size))
280  {
281  result += dir->iconList();
282  continue;
283  }
284  if ((dir->type() == KIcon::Scalable) &&
285  (size >= dir->minSize()) && (size <= dir->maxSize()))
286  {
287  result += dir->iconList();
288  continue;
289  }
290  if ((dir->type() == KIcon::Threshold) &&
291  (abs(size-dir->size())<dir->threshold()))
292  result+=dir->iconList();
293  }
294 
295  return result;
296 
297  dirs.toFirst();
298 
299  // Find close match
300  KIconThemeDir *best = 0L;
301  for ( ; dirs.current(); ++dirs)
302  {
303  dir = dirs.current();
304  if ((context != KIcon::Any) && (context != dir->context()))
305  continue;
306  dw = dir->size() - size;
307  if ((dw > 6) || (abs(dw) >= abs(delta)))
308  continue;
309  delta = dw;
310  best = dir;
311  }
312  if (best == 0L)
313  return TQStringList();
314 
315  return best->iconList();
316 }
317 
318 TQStringList KIconTheme::queryIconsByContext(int size, KIcon::Context context) const
319 {
320  TQPtrListIterator<KIconThemeDir> dirs(mDirs);
321  int dw;
322  KIconThemeDir *dir;
323 
324  // We want all the icons for a given context, but we prefer icons
325  // of size size . Note that this may (will) include duplicate icons
326  //TQStringList iconlist[34]; // 33 == 48-16+1
327  TQStringList iconlist[128]; // 33 == 48-16+1
328  // Usually, only the 0, 6 (22-16), 10 (32-22), 16 (48-32 or 32-16),
329  // 26 (48-22) and 32 (48-16) will be used, but who knows if someone
330  // will make icon themes with different icon sizes.
331 
332  for ( ; dirs.current(); ++dirs)
333  {
334  dir = dirs.current();
335  if ((context != KIcon::Any) && (context != dir->context()))
336  continue;
337  dw = abs(dir->size() - size);
338  iconlist[(dw<127)?dw:127]+=dir->iconList();
339  }
340 
341  TQStringList iconlistResult;
342  for (int i=0; i<128; i++) iconlistResult+=iconlist[i];
343 
344  return iconlistResult;
345 }
346 
347 bool KIconTheme::hasContext(KIcon::Context context) const
348 {
349  TQPtrListIterator<KIconThemeDir> dirs(mDirs);
350  KIconThemeDir *dir;
351 
352  for ( ; dirs.current(); ++dirs)
353  {
354  dir = dirs.current();
355  if ((context == KIcon::Any) || (context == dir->context()))
356  return true;
357  }
358  return false;
359 }
360 
361 KIcon KIconTheme::iconPath(const TQString& name, int size, KIcon::MatchType match) const
362 {
363  KIcon icon;
364  TQString path;
365  int delta = -1000, dw;
366  KIconThemeDir *dir;
367 
368  dw = 1000; // shut up, gcc
369  TQPtrListIterator<KIconThemeDir> dirs(mDirs);
370  for ( ; dirs.current(); ++dirs)
371  {
372  dir = dirs.current();
373 
374  if (match == KIcon::MatchExact)
375  {
376  if ((dir->type() == KIcon::Fixed) && (dir->size() != size))
377  continue;
378  if ((dir->type() == KIcon::Scalable) &&
379  ((size < dir->minSize()) || (size > dir->maxSize())))
380  continue;
381  if ((dir->type() == KIcon::Threshold) &&
382  (abs(dir->size()-size) > dir->threshold()))
383  continue;
384  } else
385  {
386  // dw < 0 means need to scale up to get an icon of the requested size
387  if (dir->type() == KIcon::Fixed)
388  {
389  dw = dir->size() - size;
390  } else if (dir->type() == KIcon::Scalable)
391  {
392  if (size < dir->minSize())
393  dw = dir->minSize() - size;
394  else if (size > dir->maxSize())
395  dw = dir->maxSize() - size;
396  else
397  dw = 0;
398  } else if (dir->type() == KIcon::Threshold)
399  {
400  if (size < dir->size() - dir->threshold())
401  dw = dir->size() - dir->threshold() - size;
402  else if (size > dir->size() + dir->threshold())
403  dw = dir->size() + dir->threshold() - size;
404  else
405  dw = 0;
406  }
407  /* Skip this if we've found a closer one, unless
408  it's a downscale, and we only had upscales befores.
409  This is to avoid scaling up unless we have to,
410  since that looks very ugly */
411  if (/*(abs(dw) >= abs(delta)) ||*/
412  (delta > 0 && dw < 0))
413  continue;
414  }
415 
416  path = dir->iconPath(name);
417  if (path.isEmpty())
418  continue;
419  icon.path = path;
420  icon.size = dir->size();
421  icon.type = dir->type();
422  icon.threshold = dir->threshold();
423  icon.context = dir->context();
424 
425  // if we got in MatchExact that far, we find no better
426  if (match == KIcon::MatchExact)
427  return icon;
428  else
429  {
430  delta = dw;
431  if (delta==0) return icon; // We won't find a better match anyway
432  }
433  }
434  return icon;
435 }
436 
437 // static
438 TQString *KIconTheme::_theme = 0L;
439 
440 // static
441 TQStringList *KIconTheme::_theme_list = 0L;
442 
443 // static
444 TQString KIconTheme::current()
445 {
446  // Static pointer because of unloading problems wrt DSO's.
447  if (_theme != 0L)
448  return *_theme;
449 
450  _theme = new TQString();
451  KConfig *config = KGlobal::config();
452  KConfigGroupSaver saver(config, "Icons");
453  *_theme = config->readEntry("Theme",defaultThemeName());
454  if ( *_theme == TQString::fromLatin1("hicolor") ) *_theme = defaultThemeName();
455 /* if (_theme->isEmpty())
456  {
457  if (TQPixmap::defaultDepth() > 8)
458  *_theme = defaultThemeName();
459  else
460  *_theme = TQString::fromLatin1("locolor");
461  }*/
462  return *_theme;
463 }
464 
465 // static
466 TQStringList KIconTheme::list()
467 {
468  // Static pointer because of unloading problems wrt DSO's.
469  if (_theme_list != 0L)
470  return *_theme_list;
471 
472  _theme_list = new TQStringList();
473  TQStringList icnlibs = KGlobal::dirs()->resourceDirs("icon");
474  icnlibs += (KGlobal::dirs()->resourceDirs("xdgdata-icon"));
475  icnlibs += "/usr/share/pixmaps";
476  // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
477  icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-pixmap");
478  TQStringList::ConstIterator it;
479  for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
480  {
481  TQDir dir(*it);
482  if (!dir.exists())
483  continue;
484  TQStringList lst = dir.entryList(TQDir::Dirs);
485  TQStringList::ConstIterator it2;
486  for (it2=lst.begin(); it2!=lst.end(); ++it2)
487  {
488  if ((*it2 == ".") || (*it2 == "..") || (*it2).startsWith("default.") )
489  continue;
490  if (!KStandardDirs::exists(*it + *it2 + "/index.desktop") && !KStandardDirs::exists(*it + *it2 + "/index.theme"))
491  continue;
492  KIconTheme oink(*it2);
493  if (!oink.isValid()) continue;
494 
495  if (!_theme_list->contains(*it2))
496  _theme_list->append(*it2);
497  }
498  }
499  return *_theme_list;
500 }
501 
502 // static
503 void KIconTheme::reconfigure()
504 {
505  delete _theme;
506  _theme=0L;
507  delete _theme_list;
508  _theme_list=0L;
509 }
510 
511 // static
512 TQString KIconTheme::defaultThemeName()
513 {
514  return TQString::fromLatin1("crystalsvg");
515 }
516 
517 /*** KIconThemeDir ***/
518 
519 KIconThemeDir::KIconThemeDir(const TQString& dir, const KConfigBase *config)
520 {
521  mbValid = false;
522  mDir = dir;
523  mSize = config->readNumEntry("Size");
524  mMinSize = 1; // just set the variables to something
525  mMaxSize = 50; // meaningful in case someone calls minSize or maxSize
526  mType = KIcon::Fixed;
527 
528  if (mSize == 0)
529  return;
530 
531  TQString tmp = config->readEntry("Context");
532  if (tmp == "Devices")
533  mContext = KIcon::Device;
534  else if (tmp == "MimeTypes")
535  mContext = KIcon::MimeType;
536  else if (tmp == "FileSystems")
537  mContext = KIcon::FileSystem;
538  else if (tmp == "Applications")
539  mContext = KIcon::Application;
540  else if (tmp == "Actions")
541  mContext = KIcon::Action;
542  else if (tmp == "Animations")
543  mContext = KIcon::Animation;
544  else if (tmp == "Categories")
545  mContext = KIcon::Category;
546  else if (tmp == "Emblems")
547  mContext = KIcon::Emblem;
548  else if (tmp == "Emotes")
549  mContext = KIcon::Emote;
550  else if (tmp == "International")
551  mContext = KIcon::International;
552  else if (tmp == "Places")
553  mContext = KIcon::Place;
554  else if (tmp == "Status")
555  mContext = KIcon::StatusIcon;
556  else {
557  kdDebug(264) << "Invalid Context= line for icon theme: " << mDir << "\n";
558  return;
559  }
560  tmp = config->readEntry("Type");
561  if (tmp == "Fixed")
562  mType = KIcon::Fixed;
563  else if (tmp == "Scalable")
564  mType = KIcon::Scalable;
565  else if (tmp == "Threshold")
566  mType = KIcon::Threshold;
567  else {
568  kdDebug(264) << "Invalid Type= line for icon theme: " << mDir << "\n";
569  return;
570  }
571  if (mType == KIcon::Scalable)
572  {
573  mMinSize = config->readNumEntry("MinSize", mSize);
574  mMaxSize = config->readNumEntry("MaxSize", mSize);
575  } else if (mType == KIcon::Threshold)
576  mThreshold = config->readNumEntry("Threshold", 2);
577  mbValid = true;
578 }
579 
580 TQString KIconThemeDir::iconPath(const TQString& name) const
581 {
582  if (!mbValid)
583  return TQString::null;
584  TQString file = mDir + "/" + name;
585 
586  if (access(TQFile::encodeName(file), R_OK) == 0)
587  return file;
588 
589  return TQString::null;
590 }
591 
592 TQStringList KIconThemeDir::iconList() const
593 {
594  TQDir dir(mDir);
595 #ifdef HAVE_LIBART
596  TQStringList lst = dir.entryList("*.png;*.svg;*.svgz;*.xpm", TQDir::Files);
597 #else
598  TQStringList lst = dir.entryList("*.png;*.xpm", TQDir::Files);
599 #endif
600  TQStringList result;
601  TQStringList::ConstIterator it;
602  for (it=lst.begin(); it!=lst.end(); ++it)
603  result += mDir + "/" + *it;
604  return result;
605 }
KIconTheme::KIconTheme
KIconTheme(const TQString &name, const TQString &appName=TQString::null)
Load an icon theme by name.
Definition: kicontheme.cpp:82
KIconTheme::reconfigure
static void reconfigure()
Reconfigure the theme.
Definition: kicontheme.cpp:503
KSharedPtr
Can be used to control the lifetime of an object that has derived KShared.
Definition: ksharedptr.h:100
KIconTheme::defaultSize
int defaultSize(KIcon::Group group) const
The default size of this theme for a certain icon group.
Definition: kicontheme.cpp:244
KConfigBase::readPathListEntry
TQStringList readPathListEntry(const TQString &pKey, char sep= ',') const
Reads a list of string paths.
Definition: kconfigbase.cpp:622
KIconTheme::isHidden
bool isHidden() const
The icon theme should be hidden to the user?
Definition: kicontheme.cpp:232
KIcon::Any
Some icon with unknown purpose.
Definition: kicontheme.h:50
KIcon::StatusIcon
An icon that represents an event.
Definition: kicontheme.h:62
KIconTheme::isValid
bool isValid() const
The icon theme exists?
Definition: kicontheme.cpp:227
KIcon::Group
Group
The group of the icon.
Definition: kicontheme.h:88
KIconTheme::example
TQString example() const
Return the name of the "example" icon.
Definition: kicontheme.cpp:237
KIcon::Emblem
An icon that adds information to an existing icon.
Definition: kicontheme.h:58
KIcon::size
int size
The size in pixels of the icon.
Definition: kicontheme.h:153
KIcon::Application
An icon that represents an application.
Definition: kicontheme.h:52
KIcon::Scalable
Scalable-size icon.
Definition: kicontheme.h:70
KConfigBase::readIntListEntry
TQValueList< int > readIntListEntry(const TQString &pKey) const
Reads a list of Integers.
Definition: kconfigbase.cpp:590
KIconTheme::iconPath
KIcon iconPath(const TQString &name, int size, KIcon::MatchType match) const
Lookup an icon in the theme.
Definition: kicontheme.cpp:361
KIcon::Animation
An icon that is animated.
Definition: kicontheme.h:56
KConfigBase::setGroup
void setGroup(const TQString &group)
Specifies the group in which keys will be read and written.
Definition: kconfigbase.cpp:80
KConfigBase::readPathEntry
TQString readPathEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads a path.
Definition: kconfigbase.cpp:608
KConfigBase::readEntry
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:222
KIconTheme::screenshot
TQString screenshot() const
Return the name of the screenshot.
Definition: kicontheme.cpp:238
KIcon::MatchExact
Only try to find an exact match.
Definition: kicontheme.h:78
KConfigBase::readBoolEntry
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
Reads a boolean entry.
Definition: kconfigbase.cpp:771
KIcon::LastGroup
Last group.
Definition: kicontheme.h:104
KGlobal::dirs
static KStandardDirs * dirs()
Returns the application standard dirs object.
Definition: kglobal.cpp:54
KIcon::MimeType
An icon that represents a mime type (or file type).
Definition: kicontheme.h:55
KIcon::International
An icon that represents a country&#39;s flag.
Definition: kicontheme.h:60
KIcon::context
Context context
The context of the icon.
Definition: kicontheme.h:158
KIcon
One icon as found by KIconTheme.
Definition: kicontheme.h:36
KIcon::type
Type type
The type of the icon: Fixed, Scalable or Threshold.
Definition: kicontheme.h:163
KIconTheme::hasContext
bool hasContext(KIcon::Context context) const
Returns true if the theme has any icons for the given context.
Definition: kicontheme.cpp:347
KConfigGroupSaver
Helper class to facilitate working with KConfig / KSimpleConfig groups.
Definition: kconfigbase.h:2059
KConfigBase
KDE Configuration Management abstract base class.
Definition: kconfigbase.h:70
KIcon::Place
An icon that represents a location (e.g. &#39;home&#39;, &#39;trash&#39;).
Definition: kicontheme.h:61
KIcon::FileSystem
An icon that represents a file system.
Definition: kicontheme.h:54
KIconTheme::linkOverlay
TQString linkOverlay() const
Returns the name of this theme&#39;s link overlay.
Definition: kicontheme.cpp:239
KIconTheme::defaultThemeName
static TQString defaultThemeName()
Returns the default icon theme.
Definition: kicontheme.cpp:512
KIcon::Context
Context
Defines the context of the icon.
Definition: kicontheme.h:49
KIcon::Threshold
A threshold icon.
Definition: kicontheme.h:71
KIcon::threshold
int threshold
The threshold in case type == Threshold.
Definition: kicontheme.h:168
KIcon::Type
Type
The type of the icon.
Definition: kicontheme.h:68
KIconTheme::queryIconsByContext
TQStringList queryIconsByContext(int size, KIcon::Context context=KIcon::Any) const
Query available icons for a context and preferred size.
Definition: kicontheme.cpp:318
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KIcon::Device
An icon that represents a device.
Definition: kicontheme.h:53
KConfigBase::readNumEntry
int readNumEntry(const TQString &pKey, int nDefault=0) const
Reads a numerical value.
Definition: kconfigbase.cpp:636
KIcon::path
TQString path
The full path of the icon.
Definition: kicontheme.h:173
KIcon::MatchType
MatchType
The type of a match.
Definition: kicontheme.h:77
KIconTheme::current
static TQString current()
Returns the current icon theme.
Definition: kicontheme.cpp:444
KStandardDirs::exists
static bool exists(const TQString &fullPath)
Checks for existence and accessability of a file or directory.
Definition: kstandarddirs.cpp:450
KIcon::Fixed
Fixed-size icon.
Definition: kicontheme.h:69
KIconTheme::zipOverlay
TQString zipOverlay() const
Returns the name of this theme&#39;s zip overlay.
Definition: kicontheme.cpp:241
KIconTheme::lockOverlay
TQString lockOverlay() const
Returns the name of this theme&#39;s lock overlay.
Definition: kicontheme.cpp:240
KIcon::Emote
An icon that expresses an emotion.
Definition: kicontheme.h:59
KIcon::Category
An icon that represents a category.
Definition: kicontheme.h:57
KIconTheme::queryIcons
TQStringList queryIcons(int size, KIcon::Context context=KIcon::Any) const
Query available icons for a size and context.
Definition: kicontheme.cpp:265
KSharedConfig::openConfig
static KSharedConfig::Ptr openConfig(const TQString &fileName, bool readOnly=false, bool bUseKDEGlobals=true)
Returns a ref-counted pointer to a shared read-write config object.
Definition: kconfig.cpp:334
KStandardDirs::resourceDirs
TQStringList resourceDirs(const char *type) const
This function is used internally by almost all other function as it serves and fills the directories ...
Definition: kstandarddirs.cpp:795
KIconTheme
Class to use/access icon themes in KDE.
Definition: kicontheme.h:187
KGlobal::config
static KConfig * config()
Returns the general config object.
Definition: kglobal.cpp:61
KIcon::Action
An action icon (e.g. &#39;save&#39;, &#39;print&#39;).
Definition: kicontheme.h:51
KIconTheme::list
static TQStringList list()
List all icon themes installed on the system, global and local.
Definition: kicontheme.cpp:466
KConfigBase::readListEntry
int readListEntry(const TQString &pKey, TQStrList &list, char sep= ',') const
Reads a list of strings.
Definition: kconfigbase.cpp:490
KIconTheme::querySizes
TQValueList< int > querySizes(KIcon::Group group) const
Query available sizes for a group.
Definition: kicontheme.cpp:254
KIconTheme::shareOverlay
TQString shareOverlay() const
Returns the name of this theme&#39;s share overlay.
Definition: kicontheme.cpp:242

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |