aboutsummaryrefslogtreecommitdiff
path: root/src/Theme.hh
diff options
context:
space:
mode:
authorunknown <unknown>2002-01-11 11:59:54 (GMT)
committerunknown <unknown>2002-01-11 11:59:54 (GMT)
commit61661d638e34b3ce6c986d5a53b8c08c1051d422 (patch)
treef0b87676e95070afee163f76902efd0c4d5b5fe6 /src/Theme.hh
parentf98c3c9045397bd9497621deb55b310366f8a5de (diff)
parenta3d2a1cf0a5ab724e19a91915fe97842f52260d5 (diff)
downloadfluxbox-c325ffaa4e094163340f957e87463c8a526b4d5b.zip
fluxbox-c325ffaa4e094163340f957e87463c8a526b4d5b.tar.bz2
This commit was manufactured by cvs2svn to create tagRelease-0_1_6
'Release-0_1_6'.
Diffstat (limited to 'src/Theme.hh')
-rw-r--r--src/Theme.hh134
1 files changed, 72 insertions, 62 deletions
diff --git a/src/Theme.hh b/src/Theme.hh
index c090a19..0365114 100644
--- a/src/Theme.hh
+++ b/src/Theme.hh
@@ -42,85 +42,93 @@
42// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 42// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
43// DEALINGS IN THE SOFTWARE. 43// DEALINGS IN THE SOFTWARE.
44 44
45// $Id: Theme.hh,v 1.5 2002/01/08 00:14:40 fluxgen Exp $
46
45#ifndef _THEME_HH_ 47#ifndef _THEME_HH_
46#define _THEME_HH_ 48#define _THEME_HH_
47 49
48 50
51#ifndef _IMAGE_HH_
49#include "Image.hh" 52#include "Image.hh"
53#endif //!_IMAGE_HH_
54
55#ifndef _DRAWUTIL_HH_
56#include "DrawUtil.hh"
57#endif //!_MISC_HH_
58
50#include <X11/Xlib.h> 59#include <X11/Xlib.h>
51#include <X11/Xresource.h> 60#include <X11/Xresource.h>
52 61
53#include "Rotated.hh" // TODO: should bake this into misc.hh some day 62#include <string>
54 63
55typedef struct FFont 64class Theme
56{ 65{
57 enum FontJustify {Left=0, Right, Center}; 66public:
67
68 Theme(Display *display, Window rootwindow, Colormap colormap,
69 int screennum, BImageControl *ic, const char *filename, const char *rootcommand);
70 ~Theme();
58 71
59 XFontSet set;
60 XFontSetExtents *set_extents;
61 XFontStruct *fontstruct;
62 FontJustify justify;
63} FFont;
64
65typedef struct LabelStyle
66{
67 BTexture l_focus, l_unfocus,
68 t_focus, t_unfocus;
69 GC l_text_focus_gc, l_text_unfocus_gc;
70 FFont font;
71 BColor l_text_focus, l_text_unfocus;
72} LabelStyle;
73
74typedef struct WindowStyle:public LabelStyle {
75 BColor f_focus, f_unfocus, b_pic_focus,
76 b_pic_unfocus;
77 BTexture h_focus, h_unfocus,
78 b_focus, b_unfocus, b_pressed, g_focus, g_unfocus;
79 GC b_pic_focus_gc, b_pic_unfocus_gc;
80
81 struct t_tab:public LabelStyle {
82 BColor border_color;
83 unsigned int border_width;
84 unsigned int border_width_2x;
85 XRotFontStruct *rot_font;
86 } tab;
87 72
88} WindowStyle; 73 typedef struct MenuStyle {
89 74 BColor t_text, f_text, h_text, d_text;
90typedef struct ToolbarStyle { 75 BTexture title, frame, hilite;
91 BColor l_text, w_text, c_text, b_pic; 76 GC t_text_gc, f_text_gc, h_text_gc, d_text_gc, hilite_gc;
92 BTexture toolbar, label, window, button, pressed, clock; 77 DrawUtil::Font titlefont, framefont;
93 GC l_text_gc, w_text_gc, c_text_gc, b_pic_gc; 78 int bullet, bullet_pos;
94 FFont font; 79 } MenuStyle;
95 80
96} ToolbarStyle; 81 typedef struct LabelStyle
82 {
83 BTexture l_focus, l_unfocus,
84 t_focus, t_unfocus;
85 GC l_text_focus_gc, l_text_unfocus_gc;
86 DrawUtil::Font font;
87 BColor l_text_focus, l_text_unfocus;
88 } LabelStyle;
97 89
98typedef struct MenuStyle { 90
99 BColor t_text, f_text, h_text, d_text; 91 typedef struct WindowStyle:public LabelStyle {
100 BTexture title, frame, hilite; 92 BColor f_focus, f_unfocus, b_pic_focus,
101 GC t_text_gc, f_text_gc, h_text_gc, d_text_gc, hilite_gc; 93 b_pic_unfocus;
102 FFont titlefont, framefont; 94 BTexture h_focus, h_unfocus,
103 int bullet, bullet_pos; 95 b_focus, b_unfocus, b_pressed, g_focus, g_unfocus;
104} MenuStyle; 96 GC b_pic_focus_gc, b_pic_unfocus_gc;
97
98 struct t_tab:public LabelStyle {
99 BColor border_color;
100 unsigned int border_width;
101 unsigned int border_width_2x;
102 DrawUtil::XRotFontStruct *rot_font;
103 } tab;
104
105 } WindowStyle;
105 106
106//singleton class 107
107class Theme 108 typedef struct ToolbarStyle {
108{ 109 BColor l_text, w_text, c_text, b_pic;
109public: 110 BTexture toolbar, label, window, button, pressed, clock;
110 Theme(Display *display, Colormap colormap, int screennum, BImageControl *ic, const char *filename); 111 GC l_text_gc, w_text_gc, c_text_gc, b_pic_gc;
111 ~Theme(); 112 DrawUtil::Font font;
112 113
114 } ToolbarStyle;
115
116 inline WindowStyle &getWindowStyle(void) { return m_windowstyle; }
117 inline MenuStyle &getMenuStyle(void) { return m_menustyle; }
118 inline ToolbarStyle &getToolbarStyle(void) { return m_toolbarstyle; }
119 inline unsigned int getBevelWidth(void) const { return m_bevel_width; }
120 inline unsigned int getBorderWidth(void) const { return m_border_width; }
121 inline unsigned int getHandleWidth(void) const { return m_handle_width; }
122 inline unsigned int getFrameWidth(void) const { return m_frame_width; }
123 inline const GC &getOpGC(void) const { return m_opgc; }
124 inline const BColor &getBorderColor(void) const { return m_border_color; }
113 void load(const char *filename); 125 void load(const char *filename);
114 void reconfigure(); 126 void reconfigure();
115 inline WindowStyle *getWindowStyle(void) { return &m_windowstyle; } 127
116 inline MenuStyle *getMenuStyle(void) { return &m_menustyle; } 128 inline void setRootCommand(std::string command) { m_rootcommand = command; }
117 inline ToolbarStyle *getToolbarStyle(void) { return &m_toolbarstyle; } 129
118 inline const unsigned int & getBevelWidth(void) const { return m_bevel_width; } 130
119 inline const unsigned int & getBorderWidth(void) const { return m_border_width; } 131
120 inline const unsigned int & getHandleWidth(void) const { return m_handle_width; }
121 inline const unsigned int & getFrameWidth(void) const { return m_frame_width; }
122 inline const GC &getOpGC(void) const { return m_opgc; }
123 inline const BColor & getBorderColor(void) const { return m_border_color; }
124private: 132private:
125 133
126 void loadMenuStyle(); 134 void loadMenuStyle();
@@ -156,6 +164,8 @@ private:
156 XrmDatabase m_database; 164 XrmDatabase m_database;
157 Colormap m_colormap; 165 Colormap m_colormap;
158 int m_screennum; 166 int m_screennum;
167 std::string m_rootcommand;
168
159}; 169};
160 170
161 171