aboutsummaryrefslogtreecommitdiff
path: root/src/Theme.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-01-12 18:48:14 (GMT)
committerfluxgen <fluxgen>2003-01-12 18:48:14 (GMT)
commit84cb55696131a6d3f1c651d571297e5bb54a74af (patch)
tree6e3d6dc0672957aa4dd9e75fbf9d0a99f60d0dbf /src/Theme.cc
parent0a24450afdfa3de414f8c316b383a372ad578153 (diff)
downloadfluxbox_pavel-84cb55696131a6d3f1c651d571297e5bb54a74af.zip
fluxbox_pavel-84cb55696131a6d3f1c651d571297e5bb54a74af.tar.bz2
removed menu style
Diffstat (limited to 'src/Theme.cc')
-rw-r--r--src/Theme.cc156
1 files changed, 1 insertions, 155 deletions
diff --git a/src/Theme.cc b/src/Theme.cc
index 5306b91..ae32045 100644
--- a/src/Theme.cc
+++ b/src/Theme.cc
@@ -21,13 +21,12 @@
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE. 22// DEALINGS IN THE SOFTWARE.
23 23
24// $Id: Theme.cc,v 1.40 2003/01/09 22:09:19 fluxgen Exp $ 24// $Id: Theme.cc,v 1.41 2003/01/12 18:48:14 fluxgen Exp $
25 25
26 26
27#include "Theme.hh" 27#include "Theme.hh"
28 28
29#include "i18n.hh" 29#include "i18n.hh"
30#include "Basemenu.hh"
31#include "StringUtil.hh" 30#include "StringUtil.hh"
32 31
33#ifndef _GNU_SOURCE 32#ifndef _GNU_SOURCE
@@ -108,54 +107,13 @@ Theme::Theme(Display *display, Window rootwindow, Colormap colormap,
108 XCreateGC(m_display, rootwindow, 107 XCreateGC(m_display, rootwindow,
109 GCForeground, &gcv); 108 GCForeground, &gcv);
110 109
111 gcv.foreground = m_menustyle.t_text.pixel();
112
113 m_menustyle.t_text_gc =
114 XCreateGC(m_display, rootwindow,
115 gc_value_mask, &gcv);
116
117 gcv.foreground = m_menustyle.f_text.pixel();
118
119 m_menustyle.f_text_gc =
120 XCreateGC(m_display, rootwindow,
121 gc_value_mask, &gcv);
122
123 gcv.foreground = m_menustyle.h_text.pixel();
124 m_menustyle.h_text_gc =
125 XCreateGC(m_display, rootwindow,
126 gc_value_mask, &gcv);
127
128 gcv.foreground = m_menustyle.d_text.pixel();
129 m_menustyle.d_text_gc =
130 XCreateGC(m_display, rootwindow,
131 gc_value_mask, &gcv);
132
133 gcv.foreground = m_menustyle.hilite.color().pixel();
134 m_menustyle.hilite_gc =
135 XCreateGC(m_display, rootwindow,
136 gc_value_mask, &gcv);
137} 110}
138 111
139Theme::~Theme() { 112Theme::~Theme() {
140
141 freeMenuStyle();
142 freeWindowStyle(); 113 freeWindowStyle();
143 freeTabStyle(); 114 freeTabStyle();
144} 115}
145 116
146//----- freeMenuStyle -----
147// free memory allocated for m_menustyle
148// should only be called from ~Theme
149//--------------------
150void Theme::freeMenuStyle() {
151
152 XFreeGC(m_display, m_menustyle.t_text_gc);
153 XFreeGC(m_display, m_menustyle.f_text_gc);
154 XFreeGC(m_display, m_menustyle.h_text_gc);
155 XFreeGC(m_display, m_menustyle.d_text_gc);
156 XFreeGC(m_display, m_menustyle.hilite_gc);
157}
158
159//----- freeWindowStyle ----- 117//----- freeWindowStyle -----
160// free memory allocated for m_windowstyle 118// free memory allocated for m_windowstyle
161//-------------------- 119//--------------------
@@ -182,7 +140,6 @@ void Theme::load(const char *filename){
182 if (!m_database) 140 if (!m_database)
183 m_database = XrmGetFileDatabase(DEFAULTSTYLE); 141 m_database = XrmGetFileDatabase(DEFAULTSTYLE);
184 142
185 loadMenuStyle();
186 loadWindowStyle(); 143 loadWindowStyle();
187 loadTabStyle(); 144 loadTabStyle();
188 loadRootCommand(); 145 loadRootCommand();
@@ -191,91 +148,6 @@ void Theme::load(const char *filename){
191 XrmDestroyDatabase(m_database); 148 XrmDestroyDatabase(m_database);
192} 149}
193 150
194void Theme::loadMenuStyle() {
195
196 readDatabaseTexture("menu.title", "Menu.Title",
197 &m_menustyle.title,
198 WhitePixel(m_display, m_screennum));
199 readDatabaseTexture("menu.frame", "Menu.Frame",
200 &m_menustyle.frame,
201 BlackPixel(m_display, m_screennum));
202 readDatabaseTexture("menu.hilite", "Menu.Hilite",
203 &m_menustyle.hilite,
204 WhitePixel(m_display, m_screennum));
205 readDatabaseColor("menu.title.textColor", "Menu.Title.TextColor",
206 &m_menustyle.t_text,
207 BlackPixel(m_display, m_screennum));
208 readDatabaseColor("menu.frame.textColor", "Menu.Frame.TextColor",
209 &m_menustyle.f_text,
210 WhitePixel(m_display, m_screennum));
211 readDatabaseColor("menu.frame.disableColor", "Menu.Frame.DisableColor",
212 &m_menustyle.d_text,
213 BlackPixel(m_display, m_screennum));
214 readDatabaseColor("menu.hilite.textColor", "Menu.Hilite.TextColor",
215 &m_menustyle.h_text,
216 BlackPixel(m_display, m_screennum));
217
218 XrmValue value;
219 char *value_type=0;
220
221 if (XrmGetResource(m_database, "menu.title.justify",
222 "Menu.Title.Justify", &value_type, &value)) {
223
224 if (strstr(value.addr, "right") || strstr(value.addr, "Right"))
225 m_menustyle.titlefont_justify = DrawUtil::Font::RIGHT;
226 else if (strstr(value.addr, "center") || strstr(value.addr, "Center"))
227 m_menustyle.titlefont_justify = DrawUtil::Font::CENTER;
228 else
229 m_menustyle.titlefont_justify = DrawUtil::Font::LEFT;
230
231 } else
232 m_menustyle.titlefont_justify = DrawUtil::Font::LEFT;
233
234 if (XrmGetResource(m_database, "menu.frame.justify",
235 "Menu.Frame.Justify", &value_type, &value)) {
236
237 if (strstr(value.addr, "right") || strstr(value.addr, "Right"))
238 m_menustyle.framefont_justify = DrawUtil::Font::RIGHT;
239 else if (strstr(value.addr, "center") || strstr(value.addr, "Center"))
240 m_menustyle.framefont_justify = DrawUtil::Font::CENTER;
241 else
242 m_menustyle.framefont_justify = DrawUtil::Font::LEFT;
243
244 } else
245 m_menustyle.framefont_justify = DrawUtil::Font::LEFT;
246
247 if (XrmGetResource(m_database, "menu.bullet", "Menu.Bullet",
248 &value_type, &value)) {
249
250 if (! strncasecmp(value.addr, "empty", value.size))
251 m_menustyle.bullet = Basemenu::EMPTY;
252 else if (! strncasecmp(value.addr, "square", value.size))
253 m_menustyle.bullet = Basemenu::SQUARE;
254 else if (! strncasecmp(value.addr, "diamond", value.size))
255 m_menustyle.bullet = Basemenu::DIAMOND;
256 else
257 m_menustyle.bullet = Basemenu::TRIANGLE;
258
259 } else
260 m_menustyle.bullet = Basemenu::TRIANGLE;
261
262 if (XrmGetResource(m_database, "menu.bullet.position",
263 "Menu.Bullet.Position", &value_type, &value)) {
264
265 if (! strncasecmp(value.addr, "right", value.size))
266 m_menustyle.bullet_pos = Basemenu::RIGHT;
267 else
268 m_menustyle.bullet_pos = Basemenu::LEFT;
269
270 } else
271 m_menustyle.bullet_pos = Basemenu::LEFT;
272
273 //---------- font
274 loadFontFromDatabase(m_menustyle.framefont, "menu.frame.font", "Menu.Frame.Font");
275 loadFontFromDatabase(m_menustyle.titlefont, "menu.title.font", "Menu.Title.Font");
276
277}
278
279void Theme::loadWindowStyle() { 151void Theme::loadWindowStyle() {
280 152
281 //read textures 153 //read textures
@@ -743,32 +615,6 @@ void Theme::reconfigure(bool antialias) {
743 XChangeGC(m_display, m_windowstyle.b_pic_unfocus_gc, 615 XChangeGC(m_display, m_windowstyle.b_pic_unfocus_gc,
744 GCForeground, &gcv); 616 GCForeground, &gcv);
745 617
746 gcv.foreground = m_menustyle.t_text.pixel();
747 if (m_menustyle.titlefont.isAntialias() != antialias)
748 m_menustyle.titlefont.setAntialias(antialias);
749
750 XChangeGC(m_display, m_menustyle.t_text_gc,
751 gc_value_mask|GCForeground, &gcv);
752
753 gcv.foreground = m_menustyle.f_text.pixel();
754 if (m_menustyle.framefont.isAntialias() != antialias)
755 m_menustyle.framefont.setAntialias(antialias);
756
757 XChangeGC(m_display, m_menustyle.f_text_gc,
758 gc_value_mask, &gcv);
759
760 gcv.foreground = m_menustyle.h_text.pixel();
761 XChangeGC(m_display, m_menustyle.h_text_gc,
762 gc_value_mask, &gcv);
763
764 gcv.foreground = m_menustyle.d_text.pixel();
765 XChangeGC(m_display, m_menustyle.d_text_gc,
766 gc_value_mask, &gcv);
767
768 gcv.foreground = m_menustyle.hilite.color().pixel();
769 XChangeGC(m_display, m_menustyle.hilite_gc,
770 gc_value_mask, &gcv);
771
772} 618}
773 619
774XFontSet Theme::createFontSet(char *fontname) { 620XFontSet Theme::createFontSet(char *fontname) {