• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KStyles

helper.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2007 Matthew Woehlke <mw_triad@users.sourceforge.net>
00003  * Copyright 2007 Casper Boemann <cbr@boemann.dk>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License version 2 as published by the Free Software Foundation.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef __OXYGEN_STYLE_HELPER_H
00021 #define __OXYGEN_STYLE_HELPER_H
00022 
00023 #include "lib/helper.h"
00024 #include "tileset.h"
00025 
00026 class SlabCache {
00027 public:
00028     SlabCache() {}
00029     ~SlabCache() {}
00030 
00031     QCache<quint64, QPixmap> m_roundSlabCache;
00032     QCache<quint64, TileSet> m_slabCache;
00033 };
00034 
00035 class OxygenStyleHelper : public OxygenHelper
00036 {
00037 public:
00038     explicit OxygenStyleHelper(const QByteArray &componentName);
00039     virtual ~OxygenStyleHelper() {}
00040 
00041     virtual void invalidateCaches();
00042 
00043     QColor calcMidColor(const QColor &color) const;
00044 
00045     static void fillSlab(QPainter&, const QRect&, int size = 7);
00046     static void fillHole(QPainter&, const QRect&, int size = 7);
00047 
00048     QPixmap  roundSlab(const QColor&, double shade, int size = 7);
00049     QPixmap  roundSlabFocused(const QColor&, const QColor &glowColor, double shade, int size = 7);
00050 
00051     // TODO - need to rebase scrollbars to size=7
00052     TileSet *slab(const QColor&, double shade, int size = 7);
00053     TileSet *slabFocused(const QColor&, const QColor &glowColor, double shade, int size = 7);
00054     TileSet *slabSunken(const QColor&, double shade, int size = 7);
00055     TileSet *slabInverted(const QColor&, double shade, int size = 7);
00056 
00057     TileSet *slope(const QColor&, double shade, int size = 7);
00058 
00059     TileSet *hole(const QColor&, double shade, int size = 7);
00060     TileSet *holeFlat(const QColor&, double shade, int size = 7);
00061     TileSet *holeFocused(const QColor&, const QColor &glowColor, double shade, int size = 7);
00062 
00063     TileSet *groove(const QColor&, double shade, int size = 7);
00064 
00065     TileSet *slitFocused(const QColor&);
00066 
00067     TileSet *verticalScrollBar(const QColor&, int width, int offset, int size = 6);
00068     TileSet *horizontalScrollBar(const QColor&, int width, int offset, int size = 6);
00069 
00070     TileSet *progressBar(const QColor&, QRect rect, Qt::Orientation orient = Qt::Horizontal, int size = 6);
00071 
00072 protected:
00073     SlabCache* slabCache(const QColor&);
00074 
00075     void drawInverseShadow(QPainter&, const QColor&, int pad, int size, double fuzz) const;
00076     void drawInverseGlow(QPainter&, const QColor&, int pad, int size, int rsize) const;
00077     void drawHole(QPainter&, const QColor&, double shade, int r = 7) const;
00078     void drawSlab(QPainter&, const QColor&, double shade) const;
00079 
00080     static const double _slabThickness;
00081 
00082     QCache<quint64, SlabCache> m_slabCache;
00083     QCache<quint64, TileSet> m_slabSunkenCache;
00084     QCache<quint64, TileSet> m_slabInvertedCache;
00085     QCache<quint64, TileSet> m_holeCache;
00086     QCache<quint64, TileSet> m_holeFlatCache;
00087     QCache<quint64, TileSet> m_slopeCache;
00088     QCache<quint64, TileSet> m_grooveCache;
00089     QCache<quint64, TileSet> m_slitCache;
00090     QCache<quint64, TileSet> m_verticalScrollBarCache;
00091     QCache<quint64, TileSet> m_horizontalScrollBarCache;
00092     QCache<quint64, TileSet> m_progressBarCache;
00093 };
00094 
00095 #endif // __OXYGEN_STYLE_HELPER_H

KStyles

Skip menu "KStyles"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal