aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2001-12-14 09:50:17 (GMT)
committerfluxgen <fluxgen>2001-12-14 09:50:17 (GMT)
commit2a3abd26e650edf505f5e36e0f904aad0be7490e (patch)
treeb30c1c07408a5ba86f7d5ec99503ddfea44102d6
parenta00eabfcdf89c9f4fc4459aa70e6d819b0cd5c1c (diff)
downloadfluxbox_paul-2a3abd26e650edf505f5e36e0f904aad0be7490e.zip
fluxbox_paul-2a3abd26e650edf505f5e36e0f904aad0be7490e.tar.bz2
Moved structures around, moved struct FFont to class Misc, removed include Rotated.hh
-rw-r--r--src/Theme.hh125
1 files changed, 63 insertions, 62 deletions
diff --git a/src/Theme.hh b/src/Theme.hh
index c090a19..0054c27 100644
--- a/src/Theme.hh
+++ b/src/Theme.hh
@@ -46,81 +46,81 @@
46#define _THEME_HH_ 46#define _THEME_HH_
47 47
48 48
49#ifndef _IMAGE_HH_
49#include "Image.hh" 50#include "Image.hh"
50#include <X11/Xlib.h> 51#endif //_IMAGE_HH_
51#include <X11/Xresource.h>
52
53#include "Rotated.hh" // TODO: should bake this into misc.hh some day
54 52
55typedef struct FFont 53#ifndef _MISC_HH_
56{ 54#include "misc.hh"
57 enum FontJustify {Left=0, Right, Center}; 55#endif //_MISC_HH_
58
59 XFontSet set;
60 XFontSetExtents *set_extents;
61 XFontStruct *fontstruct;
62 FontJustify justify;
63} FFont;
64 56
65typedef struct LabelStyle 57#include <X11/Xlib.h>
66{ 58#include <X11/Xresource.h>
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
88} WindowStyle;
89
90typedef struct ToolbarStyle {
91 BColor l_text, w_text, c_text, b_pic;
92 BTexture toolbar, label, window, button, pressed, clock;
93 GC l_text_gc, w_text_gc, c_text_gc, b_pic_gc;
94 FFont font;
95
96} ToolbarStyle;
97 59
98typedef struct MenuStyle {
99 BColor t_text, f_text, h_text, d_text;
100 BTexture title, frame, hilite;
101 GC t_text_gc, f_text_gc, h_text_gc, d_text_gc, hilite_gc;
102 FFont titlefont, framefont;
103 int bullet, bullet_pos;
104} MenuStyle;
105 60
106//singleton class
107class Theme 61class Theme
108{ 62{
109public: 63public:
64
110 Theme(Display *display, Colormap colormap, int screennum, BImageControl *ic, const char *filename); 65 Theme(Display *display, Colormap colormap, int screennum, BImageControl *ic, const char *filename);
111 ~Theme(); 66 ~Theme();
67
68
69 typedef struct MenuStyle {
70 BColor t_text, f_text, h_text, d_text;
71 BTexture title, frame, hilite;
72 GC t_text_gc, f_text_gc, h_text_gc, d_text_gc, hilite_gc;
73 Misc::Font titlefont, framefont;
74 int bullet, bullet_pos;
75 } MenuStyle;
76
77 typedef struct LabelStyle
78 {
79 BTexture l_focus, l_unfocus,
80 t_focus, t_unfocus;
81 GC l_text_focus_gc, l_text_unfocus_gc;
82 Misc::Font font;
83 BColor l_text_focus, l_text_unfocus;
84 } LabelStyle;
85
86
87 typedef struct WindowStyle:public LabelStyle {
88 BColor f_focus, f_unfocus, b_pic_focus,
89 b_pic_unfocus;
90 BTexture h_focus, h_unfocus,
91 b_focus, b_unfocus, b_pressed, g_focus, g_unfocus;
92 GC b_pic_focus_gc, b_pic_unfocus_gc;
93
94 struct t_tab:public LabelStyle {
95 BColor border_color;
96 unsigned int border_width;
97 unsigned int border_width_2x;
98 Misc::XRotFontStruct *rot_font;
99 } tab;
100
101 } WindowStyle;
112 102
103
104 typedef struct ToolbarStyle {
105 BColor l_text, w_text, c_text, b_pic;
106 BTexture toolbar, label, window, button, pressed, clock;
107 GC l_text_gc, w_text_gc, c_text_gc, b_pic_gc;
108 Misc::Font font;
109
110 } ToolbarStyle;
111
113 void load(const char *filename); 112 void load(const char *filename);
114 void reconfigure(); 113 void reconfigure();
115 inline WindowStyle *getWindowStyle(void) { return &m_windowstyle; } 114 inline WindowStyle &getWindowStyle(void) { return m_windowstyle; }
116 inline MenuStyle *getMenuStyle(void) { return &m_menustyle; } 115 inline MenuStyle &getMenuStyle(void) { return m_menustyle; }
117 inline ToolbarStyle *getToolbarStyle(void) { return &m_toolbarstyle; } 116 inline ToolbarStyle &getToolbarStyle(void) { return m_toolbarstyle; }
118 inline const unsigned int & getBevelWidth(void) const { return m_bevel_width; } 117 inline unsigned int getBevelWidth(void) const { return m_bevel_width; }
119 inline const unsigned int & getBorderWidth(void) const { return m_border_width; } 118 inline unsigned int getBorderWidth(void) const { return m_border_width; }
120 inline const unsigned int & getHandleWidth(void) const { return m_handle_width; } 119 inline unsigned int getHandleWidth(void) const { return m_handle_width; }
121 inline const unsigned int & getFrameWidth(void) const { return m_frame_width; } 120 inline unsigned int getFrameWidth(void) const { return m_frame_width; }
122 inline const GC &getOpGC(void) const { return m_opgc; } 121 inline const GC &getOpGC(void) const { return m_opgc; }
123 inline const BColor & getBorderColor(void) const { return m_border_color; } 122 inline const BColor &getBorderColor(void) const { return m_border_color; }
123
124private: 124private:
125 125
126 void loadMenuStyle(); 126 void loadMenuStyle();
@@ -155,7 +155,8 @@ private:
155 Display *m_display; 155 Display *m_display;
156 XrmDatabase m_database; 156 XrmDatabase m_database;
157 Colormap m_colormap; 157 Colormap m_colormap;
158 int m_screennum; 158 int m_screennum;
159
159}; 160};
160 161
161 162