]> icculus.org git repositories - mikachu/openbox.git/blob - otk/renderstyle.hh
all new stacked cycling code. so much sexy.
[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 struct PixmapMask {
14   Pixmap mask;
15   unsigned int w, h;
16   PixmapMask() { mask = None; w = h = 0; }
17 };
18
19 class RenderStyle {
20 public:
21   enum TextJustify {
22     LeftJustify,
23     RightJustify,
24     CenterJustify
25   };
26
27 private:
28   int _screen;
29   std::string _file;
30
31   RenderColor *_root_color;
32   
33   RenderColor *_text_color_focus;
34   RenderColor *_text_color_unfocus;
35
36   RenderColor *_button_color_focus;
37   RenderColor *_button_color_unfocus;
38
39   RenderColor *_frame_border_color;
40   int _frame_border_width;
41
42   RenderColor *_client_border_color_focus; 
43   RenderColor *_client_border_color_unfocus;
44   int _client_border_width;
45  
46   RenderTexture *_titlebar_focus;
47   RenderTexture *_titlebar_unfocus;
48
49   RenderTexture *_label_focus;
50   RenderTexture *_label_unfocus;
51
52   RenderTexture *_handle_focus;
53   RenderTexture *_handle_unfocus;
54
55   RenderTexture *_button_unpress_focus;
56   RenderTexture *_button_unpress_unfocus;
57   RenderTexture *_button_press_focus;
58   RenderTexture *_button_press_unfocus;
59
60   RenderTexture *_grip_focus;
61   RenderTexture *_grip_unfocus;
62
63   Font *_label_font;
64   TextJustify _label_justify;
65
66   PixmapMask *_max_mask;
67   PixmapMask *_icon_mask;
68   PixmapMask *_alldesk_mask;
69   PixmapMask *_close_mask;
70
71   int _handle_width;
72   int _bevel_width;
73
74 public:
75   RenderStyle(int screen, const std::string &stylefile);
76   virtual ~RenderStyle();
77
78   inline int screen() const { return _screen; }
79   
80   inline RenderColor *rootColor() const { return _root_color; }
81   
82   inline RenderColor *textFocusColor() const { return _text_color_focus; }
83   inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; }
84
85   inline RenderColor *buttonFocusColor() const { return _button_color_focus; }
86   inline RenderColor *buttonUnfocusColor() const
87     { return _button_color_unfocus; }
88
89   inline RenderColor *frameBorderColor() const { return _frame_border_color; }
90   inline int frameBorderWidth() const { return _frame_border_width; }
91
92   inline RenderColor *clientBorderFocusColor() const
93     { return _client_border_color_focus; }
94   inline RenderColor *clientBorderUnfocusColor() const
95     { return _client_border_color_unfocus; }
96   inline int clientBorderWidth() const { return _client_border_width; }
97  
98   inline RenderTexture *titlebarFocusBackground() const
99     { return _titlebar_focus; }
100   inline RenderTexture *titlebarUnfocusBackground() const
101     { return _titlebar_unfocus; }
102
103   inline RenderTexture *labelFocusBackground() const { return _label_focus; }
104   inline RenderTexture *labelUnfocusBackground() const { return _label_unfocus;}
105
106   inline RenderTexture *handleFocusBackground() const { return _handle_focus; }
107   inline RenderTexture *handleUnfocusBackground() const
108     { return _handle_unfocus; }
109
110   inline RenderTexture *buttonUnpressFocusBackground() const
111     { return _button_unpress_focus; }
112   inline RenderTexture *buttonUnpressUnfocusBackground() const
113     { return _button_unpress_unfocus; }
114   inline RenderTexture *buttonPressFocusBackground() const
115     { return _button_press_focus; }
116   inline RenderTexture *buttonPressUnfocusBackground() const
117     { return _button_press_unfocus; }
118
119   inline RenderTexture *gripFocusBackground() const { return _grip_focus; }
120   inline RenderTexture *gripUnfocusBackground() const { return _grip_unfocus; }
121
122   inline Font *labelFont() const { return _label_font; }
123   inline TextJustify labelTextJustify() const { return _label_justify; }
124
125   inline PixmapMask *maximizeMask() const { return _max_mask; }
126   inline PixmapMask *iconifyMask() const { return _icon_mask; }
127   inline PixmapMask *alldesktopsMask() const { return _alldesk_mask; }
128   inline PixmapMask *closeMask() const { return _close_mask; }
129   
130   inline int handleWidth() const { return _handle_width; }
131   inline int bevelWidth() const { return _bevel_width; }
132 };
133
134 }
135
136 #endif // __rendertexture_hh