Back to index

kdeartwork  4.3.2
Static.h
Go to the documentation of this file.
00001 /*
00002   RISC OS KWin client
00003   
00004   Copyright 2000
00005     Rik Hemsley <rik@kde.org>
00006 
00007   This program is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018   along with this program; see the file COPYING.  If not, write to
00019   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020   Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef RISC_OS_STATIC_H
00024 #define RISC_OS_STATIC_H
00025 
00026 #include <qimage.h>
00027 #include <qpixmap.h>
00028 #include <qpainter.h>
00029 #include <qstringlist.h>
00030 
00031 #include "Palette.h"
00032 
00033 namespace RiscOS
00034 {
00035 
00036 enum SymbolType { Lower, Close, Iconify, Max, Unmax };
00037 
00038 class Static
00039 {
00040    public:
00041 
00042       Static();
00043 
00044       ~Static();
00045 
00046       static Static* instance()
00047       {
00048          if (instance_ == 0)
00049          new Static;
00050 
00051          return instance_;
00052       }
00053 
00054       void reset();
00055       void updatePixmaps();
00056 
00057       const QPixmap& titleTextLeft(bool active) const;
00058       const QPixmap& titleTextRight(bool active) const;
00059       const QPixmap& resizeMidLeft(bool active) const;
00060       const QPixmap& resizeMidRight(bool active) const;
00061       const QPixmap& titleTextMid(bool active) const;
00062       const QPixmap& resizeMidMid(bool active) const;
00063       const QPixmap& buttonBase(bool active, bool down) const;
00064       const QPixmap& resize(bool active) const;
00065 
00066       int animationStyle() const;
00067       int titleHeight() const;
00068       int resizeHeight() const;
00069 
00070   private:
00071 
00072       void _init();
00073 
00074       void _drawBorder(QPixmap&, int, int);
00075       void _createTexture(QPixmap&, int, bool);
00076 
00077       void _initSizes();
00078 
00079       void _resizeAllPixmaps();
00080       void _blankAllPixmaps();
00081 
00082       void _initPalettes();
00083       void _initTextures();
00084 
00085       void _drawTitleTextAreaSides();
00086       void _drawResizeCentralAreaSides();
00087       void _drawTitleTextAreaBackground();
00088       void _drawResizeCentralAreaBackground();
00089       void _drawResizeHandles();
00090       void _drawButtonBackgrounds();
00091 
00092       static Static *instance_;
00093 
00094       Palette
00095          aTitlePal_,
00096          iTitlePal_,
00097          aResizePal_,
00098          iResizePal_,
00099          aButPal_,
00100          iButPal_;
00101 
00102       QPixmap
00103          aButtonUp_,         iButtonUp_,
00104          aButtonDown_,       iButtonDown_,
00105          aResize_,           iResize_,
00106          aResizeDown_,       iResizeDown_,
00107          aTitleTextLeft_,    iTitleTextLeft_,
00108          aTitleTextRight_,   iTitleTextRight_,
00109          aTitleTextMid_,     iTitleTextMid_,
00110          aResizeMidLeft_,    iResizeMidLeft_,
00111          aResizeMidRight_,   iResizeMidRight_,
00112          aResizeMid_,        iResizeMid_;
00113 
00114       QPixmap aTexture_, iTexture_, abTexture_, ibTexture_;
00115 
00116       QPainter painter_;
00117       bool down_;
00118       Palette palette_;
00119       double transx, transy;
00120 
00121       int animationStyle_;
00122 
00123       int titleHeight_;
00124       int buttonSize_;
00125       int resizeHeight_;
00126 
00127       bool hicolour_;
00128 };
00129 
00130 } // End namespace
00131 
00132 #endif
00133  
00134 // vim:ts=2:sw=2:tw=78