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

KStyles

helper.h

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