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

tdecore

  • tdecore
kicontheme.cpp
1 /*
2  *
3  * $Id$
4  *
5  * This file is part of the KDE project, module tdecore.
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 <tdeglobal.h>
34 #include <tdeconfig.h>
35 #include <ksimpleconfig.h>
36 #include <kinstance.h>
37 
38 #include "kicontheme.h"
39 
40 class TDEIconThemePrivate
41 {
42 public:
43  TQString example, screenshot;
44  TQString linkOverlay, lockOverlay, zipOverlay, shareOverlay;
45  bool hidden;
46  TDESharedConfig::Ptr sharedConfig;
47 };
48 
52 class TDEIconThemeDir
53 {
54 public:
55  TDEIconThemeDir(const TQString& dir, const TDEConfigBase *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  TDEIcon::Context context() const { return mContext; }
63  TDEIcon::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  TDEIcon::Type mType;
72  TDEIcon::Context mContext;
73  int mSize, mMinSize, mMaxSize;
74  int mThreshold;
75 
76  TQString mDir;
77 };
78 
79 
80 /*** TDEIconTheme ***/
81 
82 TDEIconTheme::TDEIconTheme(const TQString& name, const TQString& appName)
83 {
84  d = new TDEIconThemePrivate;
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 = TDEGlobal::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 = TDEGlobal::dirs()->resourceDirs("icon");
109  icnlibs += TDEGlobal::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 += TDEGlobal::dirs()->resourceDirs("xdgdata-pixmap");
113  for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
114  {
115  cDir = *it + name + "/";
116  if (TDEStandardDirs::exists(cDir))
117  {
118  themeDirs += cDir;
119  if (mDir.isEmpty()
120  && (TDEStandardDirs::exists( cDir + "index.desktop") || TDEStandardDirs::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 TDESharedConfig 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 = TDESharedConfig::openConfig( fileName, true /*readonly*/, false /*useKDEGlobals*/ );
142  TDEConfig& 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", "application-vnd.tde.overlay.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 (TDEStandardDirs::exists(*itDir + *it + "/"))
170  {
171  TDEIconThemeDir *dir = new TDEIconThemeDir(*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 (TDEIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next())
187  {
188  if ((dir->type() == TDEIcon::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 TDEIconTheme::~TDEIconTheme()
223 {
224  delete d;
225 }
226 
227 bool TDEIconTheme::isValid() const
228 {
229  return !mDirs.isEmpty();
230 }
231 
232 bool TDEIconTheme::isHidden() const
233 {
234  return d->hidden;
235 }
236 
237 TQString TDEIconTheme::example() const { return d->example; }
238 TQString TDEIconTheme::screenshot() const { return d->screenshot; }
239 TQString TDEIconTheme::linkOverlay() const { return d->linkOverlay; }
240 TQString TDEIconTheme::lockOverlay() const { return d->lockOverlay; }
241 TQString TDEIconTheme::zipOverlay() const { return d->zipOverlay; }
242 TQString TDEIconTheme::shareOverlay() const { return d->shareOverlay; }
243 
244 int TDEIconTheme::defaultSize(TDEIcon::Group group) const
245 {
246  if ((group < 0) || (group >= TDEIcon::LastGroup))
247  {
248  kdDebug(264) << "Illegal icon group: " << group << "\n";
249  return -1;
250  }
251  return mDefSize[group];
252 }
253 
254 TQValueList<int> TDEIconTheme::querySizes(TDEIcon::Group group) const
255 {
256  TQValueList<int> empty;
257  if ((group < 0) || (group >= TDEIcon::LastGroup))
258  {
259  kdDebug(264) << "Illegal icon group: " << group << "\n";
260  return empty;
261  }
262  return mSizes[group];
263 }
264 
265 TQStringList TDEIconTheme::queryIcons(int size, TDEIcon::Context context) const
266 {
267  int delta = 1000, dw;
268 
269  TQPtrListIterator<TDEIconThemeDir> dirs(mDirs);
270  TDEIconThemeDir *dir;
271 
272  // Try to find exact match
273  TQStringList result;
274  for ( ; dirs.current(); ++dirs)
275  {
276  dir = dirs.current();
277  if ((context != TDEIcon::Any) && (context != dir->context()))
278  continue;
279  if ((dir->type() == TDEIcon::Fixed) && (dir->size() == size))
280  {
281  result += dir->iconList();
282  continue;
283  }
284  if ((dir->type() == TDEIcon::Scalable) &&
285  (size >= dir->minSize()) && (size <= dir->maxSize()))
286  {
287  result += dir->iconList();
288  continue;
289  }
290  if ((dir->type() == TDEIcon::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  TDEIconThemeDir *best = 0L;
301  for ( ; dirs.current(); ++dirs)
302  {
303  dir = dirs.current();
304  if ((context != TDEIcon::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 TDEIconTheme::queryIconsByContext(int size, TDEIcon::Context context) const
319 {
320  TQPtrListIterator<TDEIconThemeDir> dirs(mDirs);
321  int dw;
322  TDEIconThemeDir *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 != TDEIcon::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 TDEIconTheme::hasContext(TDEIcon::Context context) const
348 {
349  TQPtrListIterator<TDEIconThemeDir> dirs(mDirs);
350  TDEIconThemeDir *dir;
351 
352  for ( ; dirs.current(); ++dirs)
353  {
354  dir = dirs.current();
355  if ((context == TDEIcon::Any) || (context == dir->context()))
356  return true;
357  }
358  return false;
359 }
360 
361 TDEIcon TDEIconTheme::iconPath(const TQString& name, int size, TDEIcon::MatchType match) const
362 {
363  TDEIcon icon;
364  TQString path;
365  int delta = -1000, dw;
366  TDEIconThemeDir *dir;
367 
368  dw = 1000; // shut up, gcc
369  TQPtrListIterator<TDEIconThemeDir> dirs(mDirs);
370  for ( ; dirs.current(); ++dirs)
371  {
372  dir = dirs.current();
373 
374  if (match == TDEIcon::MatchExact)
375  {
376  if ((dir->type() == TDEIcon::Fixed) && (dir->size() != size))
377  continue;
378  if ((dir->type() == TDEIcon::Scalable) &&
379  ((size < dir->minSize()) || (size > dir->maxSize())))
380  continue;
381  if ((dir->type() == TDEIcon::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() == TDEIcon::Fixed)
388  {
389  dw = dir->size() - size;
390  } else if (dir->type() == TDEIcon::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() == TDEIcon::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 == TDEIcon::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 *TDEIconTheme::_theme = 0L;
439 
440 // static
441 TQStringList *TDEIconTheme::_theme_list = 0L;
442 
443 // static
444 TQString TDEIconTheme::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  TDEConfig *config = TDEGlobal::config();
452  TDEConfigGroupSaver 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 TDEIconTheme::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 = TDEGlobal::dirs()->resourceDirs("icon");
474  icnlibs += (TDEGlobal::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 += TDEGlobal::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 (!TDEStandardDirs::exists(*it + *it2 + "/index.desktop") && !TDEStandardDirs::exists(*it + *it2 + "/index.theme"))
491  continue;
492  TDEIconTheme 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 TDEIconTheme::reconfigure()
504 {
505  delete _theme;
506  _theme=0L;
507  delete _theme_list;
508  _theme_list=0L;
509 }
510 
511 // static
512 TQString TDEIconTheme::defaultThemeName()
513 {
514  return TQString::fromLatin1("crystalsvg");
515 }
516 
517 /*** TDEIconThemeDir ***/
518 
519 TDEIconThemeDir::TDEIconThemeDir(const TQString& dir, const TDEConfigBase *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 = TDEIcon::Fixed;
527 
528  if (mSize == 0)
529  return;
530 
531  TQString tmp = config->readEntry("Context");
532  if (tmp == "Devices")
533  mContext = TDEIcon::Device;
534  else if (tmp == "MimeTypes")
535  mContext = TDEIcon::MimeType;
536  else if (tmp == "FileSystems")
537  mContext = TDEIcon::FileSystem;
538  else if (tmp == "Applications")
539  mContext = TDEIcon::Application;
540  else if (tmp == "Actions")
541  mContext = TDEIcon::Action;
542  else if (tmp == "Animations")
543  mContext = TDEIcon::Animation;
544  else if (tmp == "Categories")
545  mContext = TDEIcon::Category;
546  else if (tmp == "Emblems")
547  mContext = TDEIcon::Emblem;
548  else if (tmp == "Emotes")
549  mContext = TDEIcon::Emote;
550  else if (tmp == "International")
551  mContext = TDEIcon::International;
552  else if (tmp == "Places")
553  mContext = TDEIcon::Place;
554  else if (tmp == "Status")
555  mContext = TDEIcon::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 = TDEIcon::Fixed;
563  else if (tmp == "Scalable")
564  mType = TDEIcon::Scalable;
565  else if (tmp == "Threshold")
566  mType = TDEIcon::Threshold;
567  else {
568  kdDebug(264) << "Invalid Type= line for icon theme: " << mDir << "\n";
569  return;
570  }
571  if (mType == TDEIcon::Scalable)
572  {
573  mMinSize = config->readNumEntry("MinSize", mSize);
574  mMaxSize = config->readNumEntry("MaxSize", mSize);
575  } else if (mType == TDEIcon::Threshold)
576  mThreshold = config->readNumEntry("Threshold", 2);
577  mbValid = true;
578 }
579 
580 TQString TDEIconThemeDir::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 TDEIconThemeDir::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 }
TDEConfigBase
KDE Configuration Management abstract base class.
Definition: tdeconfigbase.h:71
TDEConfigBase::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: tdeconfigbase.cpp:221
TDEConfigBase::readNumEntry
int readNumEntry(const TQString &pKey, int nDefault=0) const
Reads a numerical value.
Definition: tdeconfigbase.cpp:613
TDEConfigBase::readBoolEntry
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
Reads a boolean entry.
Definition: tdeconfigbase.cpp:748
TDEConfigBase::readIntListEntry
TQValueList< int > readIntListEntry(const TQString &pKey) const
Reads a list of Integers.
Definition: tdeconfigbase.cpp:567
TDEConfigBase::readListEntry
int readListEntry(const TQString &pKey, TQStrList &list, char sep=',') const
Reads a list of strings.
Definition: tdeconfigbase.cpp:467
TDEConfigBase::readPathListEntry
TQStringList readPathListEntry(const TQString &pKey, char sep=',') const
Reads a list of string paths.
Definition: tdeconfigbase.cpp:599
TDEConfigBase::readPathEntry
TQString readPathEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads a path.
Definition: tdeconfigbase.cpp:585
TDEConfigBase::setGroup
void setGroup(const TQString &group)
Specifies the group in which keys will be read and written.
Definition: tdeconfigbase.cpp:79
TDEConfigGroupSaver
Helper class to facilitate working with TDEConfig / KSimpleConfig groups.
Definition: tdeconfigbase.h:2083
TDEConfig
Access KDE Configuration entries.
Definition: tdeconfig.h:44
TDEGlobal::config
static TDEConfig * config()
Returns the general config object.
Definition: tdeglobal.cpp:65
TDEGlobal::dirs
static TDEStandardDirs * dirs()
Returns the application standard dirs object.
Definition: tdeglobal.cpp:58
TDEIconTheme
Class to use/access icon themes in KDE.
Definition: kicontheme.h:188
TDEIconTheme::name
TQString name() const
The stylized name of the icon theme.
Definition: kicontheme.h:203
TDEIconTheme::iconPath
TDEIcon iconPath(const TQString &name, int size, TDEIcon::MatchType match) const
Lookup an icon in the theme.
Definition: kicontheme.cpp:361
TDEIconTheme::example
TQString example() const
Return the name of the "example" icon.
Definition: kicontheme.cpp:237
TDEIconTheme::current
static TQString current()
Returns the current icon theme.
Definition: kicontheme.cpp:444
TDEIconTheme::querySizes
TQValueList< int > querySizes(TDEIcon::Group group) const
Query available sizes for a group.
Definition: kicontheme.cpp:254
TDEIconTheme::linkOverlay
TQString linkOverlay() const
Returns the name of this theme's link overlay.
Definition: kicontheme.cpp:239
TDEIconTheme::shareOverlay
TQString shareOverlay() const
Returns the name of this theme's share overlay.
Definition: kicontheme.cpp:242
TDEIconTheme::reconfigure
static void reconfigure()
Reconfigure the theme.
Definition: kicontheme.cpp:503
TDEIconTheme::isValid
bool isValid() const
The icon theme exists?
Definition: kicontheme.cpp:227
TDEIconTheme::hasContext
bool hasContext(TDEIcon::Context context) const
Returns true if the theme has any icons for the given context.
Definition: kicontheme.cpp:347
TDEIconTheme::isHidden
bool isHidden() const
The icon theme should be hidden to the user?
Definition: kicontheme.cpp:232
TDEIconTheme::queryIconsByContext
TQStringList queryIconsByContext(int size, TDEIcon::Context context=TDEIcon::Any) const
Query available icons for a context and preferred size.
Definition: kicontheme.cpp:318
TDEIconTheme::zipOverlay
TQString zipOverlay() const
Returns the name of this theme's zip overlay.
Definition: kicontheme.cpp:241
TDEIconTheme::defaultThemeName
static TQString defaultThemeName()
Returns the default icon theme.
Definition: kicontheme.cpp:512
TDEIconTheme::TDEIconTheme
TDEIconTheme(const TQString &name, const TQString &appName=TQString::null)
Load an icon theme by name.
Definition: kicontheme.cpp:82
TDEIconTheme::list
static TQStringList list()
List all icon themes installed on the system, global and local.
Definition: kicontheme.cpp:466
TDEIconTheme::lockOverlay
TQString lockOverlay() const
Returns the name of this theme's lock overlay.
Definition: kicontheme.cpp:240
TDEIconTheme::screenshot
TQString screenshot() const
Return the name of the screenshot.
Definition: kicontheme.cpp:238
TDEIconTheme::defaultSize
int defaultSize(TDEIcon::Group group) const
The default size of this theme for a certain icon group.
Definition: kicontheme.cpp:244
TDEIconTheme::dir
TQString dir() const
Returns the toplevel theme directory.
Definition: kicontheme.h:254
TDEIconTheme::queryIcons
TQStringList queryIcons(int size, TDEIcon::Context context=TDEIcon::Any) const
Query available icons for a size and context.
Definition: kicontheme.cpp:265
TDEIcon
One icon as found by TDEIconTheme.
Definition: kicontheme.h:37
TDEIcon::context
Context context
The context of the icon.
Definition: kicontheme.h:158
TDEIcon::path
TQString path
The full path of the icon.
Definition: kicontheme.h:173
TDEIcon::Context
Context
Defines the context of the icon.
Definition: kicontheme.h:49
TDEIcon::Application
@ Application
An icon that represents an application.
Definition: kicontheme.h:52
TDEIcon::Emblem
@ Emblem
An icon that adds information to an existing icon.
Definition: kicontheme.h:58
TDEIcon::Device
@ Device
An icon that represents a device.
Definition: kicontheme.h:53
TDEIcon::International
@ International
An icon that represents a country's flag.
Definition: kicontheme.h:60
TDEIcon::Any
@ Any
Some icon with unknown purpose.
Definition: kicontheme.h:50
TDEIcon::Place
@ Place
An icon that represents a location (e.g. 'home', 'trash').
Definition: kicontheme.h:61
TDEIcon::FileSystem
@ FileSystem
An icon that represents a file system.
Definition: kicontheme.h:54
TDEIcon::Action
@ Action
An action icon (e.g. 'save', 'print').
Definition: kicontheme.h:51
TDEIcon::Category
@ Category
An icon that represents a category.
Definition: kicontheme.h:57
TDEIcon::Animation
@ Animation
An icon that is animated.
Definition: kicontheme.h:56
TDEIcon::StatusIcon
@ StatusIcon
An icon that represents an event.
Definition: kicontheme.h:62
TDEIcon::MimeType
@ MimeType
An icon that represents a mime type (or file type).
Definition: kicontheme.h:55
TDEIcon::Emote
@ Emote
An icon that expresses an emotion.
Definition: kicontheme.h:59
TDEIcon::Group
Group
The group of the icon.
Definition: kicontheme.h:88
TDEIcon::LastGroup
@ LastGroup
Last group.
Definition: kicontheme.h:104
TDEIcon::type
Type type
The type of the icon: Fixed, Scalable or Threshold.
Definition: kicontheme.h:163
TDEIcon::size
int size
The size in pixels of the icon.
Definition: kicontheme.h:153
TDEIcon::threshold
int threshold
The threshold in case type == Threshold.
Definition: kicontheme.h:168
TDEIcon::Type
Type
The type of the icon.
Definition: kicontheme.h:68
TDEIcon::Fixed
@ Fixed
Fixed-size icon.
Definition: kicontheme.h:69
TDEIcon::Scalable
@ Scalable
Scalable-size icon.
Definition: kicontheme.h:70
TDEIcon::Threshold
@ Threshold
A threshold icon.
Definition: kicontheme.h:71
TDEIcon::MatchType
MatchType
The type of a match.
Definition: kicontheme.h:77
TDEIcon::MatchExact
@ MatchExact
Only try to find an exact match.
Definition: kicontheme.h:78
TDESharedConfig::openConfig
static TDESharedConfig::Ptr openConfig(const TQString &fileName, bool readOnly=false, bool bUseKDEGlobals=true)
Returns a ref-counted pointer to a shared read-write config object.
Definition: tdeconfig.cpp:334
TDESharedPtr< TDESharedConfig >
TDEStandardDirs::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
TDEStandardDirs::exists
static bool exists(const TQString &fullPath)
Checks for existence and accessability of a file or directory.
Definition: kstandarddirs.cpp:450
TDEGlobal::kdDebug
kdbgstream kdDebug(int area=0)
Returns a debug stream.
Definition: kdebug.cpp:371
KStdAction::name
const char * name(StdAction id)

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.1
This website is maintained by Timothy Pearson.