summaryrefslogtreecommitdiffstats
path: root/twin-styles/riscos/Static.h
blob: 8e2012cafcc199a521e76bd1315446790ff53df2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
  RISC OS KWin client
  
  Copyright 2000
    Rik Hemsley <rik@kde.org>

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public
  License as published by the Free Software Foundation; either
  version 2 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; see the file COPYING.  If not, write to
  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  Boston, MA 02110-1301, USA.
*/

#ifndef RISC_OS_STATIC_H
#define RISC_OS_STATIC_H

#include <tqimage.h>
#include <tqpixmap.h>
#include <tqpainter.h>
#include <tqstringlist.h>

#include "Palette.h"

namespace RiscOS
{

enum SymbolType { Lower, Close, Iconify, Max, Unmax };

class Static
{
   public:

      Static();

      ~Static();

      static Static* instance()
      {
         if (instance_ == 0)
         new Static;

         return instance_;
      }

      void reset();
      void updatePixmaps();

      const TQPixmap& titleTextLeft(bool active) const;
      const TQPixmap& titleTextRight(bool active) const;
      const TQPixmap& resizeMidLeft(bool active) const;
      const TQPixmap& resizeMidRight(bool active) const;
      const TQPixmap& titleTextMid(bool active) const;
      const TQPixmap& resizeMidMid(bool active) const;
      const TQPixmap& buttonBase(bool active, bool down) const;
      const TQPixmap& resize(bool active) const;

      int animationStyle() const;
      int titleHeight() const;
      int resizeHeight() const;

  private:

      void _init();

      void _drawBorder(TQPixmap&, int, int);
      void _createTexture(TQPixmap&, int, bool);

      void _initSizes();

      void _resizeAllPixmaps();
      void _blankAllPixmaps();

      void _initPalettes();
      void _initTextures();

      void _drawTitleTextAreaSides();
      void _drawResizeCentralAreaSides();
      void _drawTitleTextAreaBackground();
      void _drawResizeCentralAreaBackground();
      void _drawResizeHandles();
      void _drawButtonBackgrounds();

      static Static *instance_;

      Palette
         aTitlePal_,
         iTitlePal_,
         aResizePal_,
         iResizePal_,
         aButPal_,
         iButPal_;

      TQPixmap
         aButtonUp_,         iButtonUp_,
         aButtonDown_,       iButtonDown_,
         aResize_,           iResize_,
         aResizeDown_,       iResizeDown_,
         aTitleTextLeft_,    iTitleTextLeft_,
         aTitleTextRight_,   iTitleTextRight_,
         aTitleTextMid_,     iTitleTextMid_,
         aResizeMidLeft_,    iResizeMidLeft_,
         aResizeMidRight_,   iResizeMidRight_,
         aResizeMid_,        iResizeMid_;

      TQPixmap aTexture_, iTexture_, abTexture_, ibTexture_;

      TQPainter painter_;
      bool down_;
      Palette palette_;
      double transx, transy;

      int animationStyle_;

      int titleHeight_;
      int buttonSize_;
      int resizeHeight_;

      bool hicolour_;
};

} // End namespace

#endif