]> icculus.org git repositories - mikachu/openbox.git/blob - otk/renderstyle.hh
save/load the pixel in the cache
[mikachu/openbox.git] / otk / renderstyle.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __renderstyle_hh
3 #define __renderstyle_hh
4
5 #include "rendertexture.hh"
6 #include "rendercolor.hh"
7 #include "font.hh"
8
9 #include <string>
10
11 namespace otk {
12
13 class RenderStyle {
14 public:
15   enum TextJustify {
16     LeftJustify,
17     RightJustify,
18     CenterJustify
19   };
20
21 private:
22   int _screen;
23   std::string _file;
24   
25   RenderColor *_text_color_focus;
26   RenderColor *_text_color_unfocus;
27
28   RenderColor *_button_color_focus;
29   RenderColor *_button_color_unfocus;
30
31   RenderColor *_frame_border_color;
32   int _frame_border_width;
33
34   RenderColor *_client_border_color_focus; 
35   RenderColor *_client_border_color_unfocus;
36   int _client_border_width;
37  
38   RenderTexture *_titlebar_focus;
39   RenderTexture *_titlebar_unfocus;
40
41   RenderTexture *_label_focus;
42   RenderTexture *_label_unfocus;
43
44   RenderTexture *_handle_focus;
45   RenderTexture *_handle_unfocus;
46
47   RenderTexture *_button_unpress_focus;
48   RenderTexture *_button_unpress_unfocus;
49   RenderTexture *_button_press_focus;
50   RenderTexture *_button_press_unfocus;
51
52   RenderTexture *_grip_focus;
53   RenderTexture *_grip_unfocus;
54
55   Font *_label_font;
56   TextJustify _label_justify;
57
58   int _handle_width;
59   int _bevel_width;
60
61 public:
62   RenderStyle(int screen, const std::string &stylefile);
63   virtual ~RenderStyle();
64
65   inline int screen() const { return _screen; }
66   
67   inline RenderColor *textFocusColor() const { return _text_color_focus; }
68   inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; }
69
70   inline RenderColor *buttonFocusColor() const { return _button_color_focus; }
71   inline RenderColor *buttonUnfocusColor() const
72     { return _button_color_unfocus; }
73
74   inline RenderColor *frameBorderColor() const { return _frame_border_color; }
75   inline int frameBorderWidth() const { return _frame_border_width; }
76
77   inline RenderColor *clientBorderFocusColor() const
78     { return _client_border_color_focus; }
79   inline RenderColor *clientBorderUnfocusColor() const
80     { return _client_border_color_unfocus; }
81   inline int clientBorderWidth() const { return _client_border_width; }
82  
83   inline RenderTexture *titlebarFocusBackground() const
84     { return _titlebar_focus; }
85   inline RenderTexture *titlebarUnfocusBackground() const
86     { return _titlebar_unfocus; }
87
88   inline RenderTexture *labelFocusBackground() const { return _label_focus; }
89   inline RenderTexture *labelUnfocusBackground() const { return _label_unfocus;}
90
91   inline RenderTexture *handleFocusBackground() const { return _handle_focus; }
92   inline RenderTexture *handleUnfocusBackground() const
93     { return _handle_unfocus; }
94
95   inline RenderTexture *buttonUnpressFocusBackground() const
96     { return _button_unpress_focus; }
97   inline RenderTexture *buttonUnpressUnfocusBackground() const
98     { return _button_unpress_unfocus; }
99   inline RenderTexture *buttonPressFocusBackground() const
100     { return _button_press_focus; }
101   inline RenderTexture *buttonPressUnfocusBackground() const
102     { return _button_press_unfocus; }
103
104   inline RenderTexture *gripdFocusBackground() const { return _grip_focus; }
105   inline RenderTexture *gripUnfocusBackground() const { return _grip_unfocus; }
106
107   inline Font *labelFont() const { return _label_font; }
108   inline TextJustify labelTextJustify() const { return _label_justify; }
109
110   inline int handleWidth() const { return _handle_width; }
111   inline int bevelWidth() const { return _bevel_width; }
112 };
113
114 }
115
116 #endif // __rendertexture_hh