aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-16 08:50:59 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-16 08:50:59 (GMT)
commit4a7a143713c7febe7d3a7df9c044ed767b8bd3c6 (patch)
treef4d1f31c5167469f77408d42d6eca83a29d42b4c
parent8516f1e2a21a374127ccfa3f7b8de2443e67fe33 (diff)
downloadfluxbox_pavel-4a7a143713c7febe7d3a7df9c044ed767b8bd3c6.zip
fluxbox_pavel-4a7a143713c7febe7d3a7df9c044ed767b8bd3c6.tar.bz2
load style before loading theme objects, remove duplicate theme load
-rw-r--r--src/ButtonTheme.cc1
-rw-r--r--src/FbTk/MenuTheme.cc1
-rw-r--r--src/FbTk/Theme.cc12
-rw-r--r--src/FbWinFrameTheme.cc1
-rw-r--r--src/MenuTheme.cc1
-rw-r--r--src/RootTheme.cc1
-rw-r--r--src/Screen.cc6
-rw-r--r--src/SlitTheme.cc1
-rw-r--r--src/ToolTheme.cc1
-rw-r--r--src/ToolbarTheme.cc1
-rw-r--r--src/WinButtonTheme.cc1
-rw-r--r--src/fluxbox.cc6
12 files changed, 19 insertions, 14 deletions
diff --git a/src/ButtonTheme.cc b/src/ButtonTheme.cc
index 3966410..46d74ca 100644
--- a/src/ButtonTheme.cc
+++ b/src/ButtonTheme.cc
@@ -39,6 +39,7 @@ ButtonTheme::ButtonTheme(int screen_num,
39 m_name(name), 39 m_name(name),
40 m_fallbackname(extra_fallback), m_altfallbackname(extra_fallback_alt) { 40 m_fallbackname(extra_fallback), m_altfallbackname(extra_fallback_alt) {
41 41
42 FbTk::ThemeManager::instance().loadTheme(*this);
42} 43}
43 44
44bool ButtonTheme::fallback(FbTk::ThemeItem_base &item) { 45bool ButtonTheme::fallback(FbTk::ThemeItem_base &item) {
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc
index 3b03697..46da48e 100644
--- a/src/FbTk/MenuTheme.cc
+++ b/src/FbTk/MenuTheme.cc
@@ -98,6 +98,7 @@ MenuTheme::MenuTheme(int screen_num):
98 d_text_gc.setForeground(*d_text); 98 d_text_gc.setForeground(*d_text);
99 hilite_gc.setForeground(hilite->color()); 99 hilite_gc.setForeground(hilite->color());
100 100
101 ThemeManager::instance().loadTheme(*this);
101} 102}
102 103
103MenuTheme::~MenuTheme() { 104MenuTheme::~MenuTheme() {
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index cd03f5e..1c69bb4 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -97,12 +97,14 @@ bool ThemeManager::registerTheme(Theme &tm) {
97 // valid screen num? 97 // valid screen num?
98 if (m_max_screens < tm.screenNum() || tm.screenNum() < 0) 98 if (m_max_screens < tm.screenNum() || tm.screenNum() < 0)
99 return false; 99 return false;
100 // TODO: use find and return false if it's already there
101 // instead of unique
102 100
103 m_themes[tm.screenNum()].push_back(&tm); 101 ThemeList::const_iterator it = m_themes[tm.screenNum()].begin(),
104 m_themes[tm.screenNum()].unique(); 102 it_end = m_themes[tm.screenNum()].end();
105 return true; 103 if (std::find(it, it_end, &tm) == it_end) {
104 m_themes[tm.screenNum()].push_back(&tm);
105 return true;
106 }
107 return false;
106} 108}
107 109
108bool ThemeManager::unregisterTheme(Theme &tm) { 110bool ThemeManager::unregisterTheme(Theme &tm) {
diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc
index 33a45a8..1175297 100644
--- a/src/FbWinFrameTheme.cc
+++ b/src/FbWinFrameTheme.cc
@@ -74,6 +74,7 @@ FbWinFrameTheme::FbWinFrameTheme(int screen_num):
74 m_cursor_right_side = XCreateFontCursor(disp, XC_right_side); 74 m_cursor_right_side = XCreateFontCursor(disp, XC_right_side);
75 m_cursor_bottom_side = XCreateFontCursor(disp, XC_bottom_side); 75 m_cursor_bottom_side = XCreateFontCursor(disp, XC_bottom_side);
76 76
77 FbTk::ThemeManager::instance().loadTheme(*this);
77 reconfigTheme(); 78 reconfigTheme();
78} 79}
79 80
diff --git a/src/MenuTheme.cc b/src/MenuTheme.cc
index 4d6f55c..682239c 100644
--- a/src/MenuTheme.cc
+++ b/src/MenuTheme.cc
@@ -55,4 +55,5 @@ void FbTk::ThemeItem<Shape::ShapePlace>::setFromString(const char *str) {
55MenuTheme::MenuTheme(int screen_num):FbTk::MenuTheme(screen_num), 55MenuTheme::MenuTheme(int screen_num):FbTk::MenuTheme(screen_num),
56 m_shapeplace(*this, "menu.roundCorners", "Menu.RoundCorners") { 56 m_shapeplace(*this, "menu.roundCorners", "Menu.RoundCorners") {
57 *m_shapeplace = Shape::NONE; 57 *m_shapeplace = Shape::NONE;
58 FbTk::ThemeManager::instance().loadTheme(*this);
58} 59}
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index 90478e3..892e219 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -159,6 +159,7 @@ RootTheme::RootTheme(FbTk::ImageControl &image_control):
159 m_opgc.setFunction(GXxor); 159 m_opgc.setFunction(GXxor);
160 m_opgc.setSubwindowMode(IncludeInferiors); 160 m_opgc.setSubwindowMode(IncludeInferiors);
161 m_opgc.setLineAttributes(1, LineSolid, CapNotLast, JoinMiter); 161 m_opgc.setLineAttributes(1, LineSolid, CapNotLast, JoinMiter);
162 FbTk::ThemeManager::instance().loadTheme(*this);
162} 163}
163 164
164RootTheme::~RootTheme() { 165RootTheme::~RootTheme() {
diff --git a/src/Screen.cc b/src/Screen.cc
index d27f8c4..a74ba0e 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -525,12 +525,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
525 // and after we've load the resources 525 // and after we've load the resources
526 // else we get some bad handle/grip height/width 526 // else we get some bad handle/grip height/width
527 // FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get()); 527 // FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get());
528 //!! TODO: For some strange reason we must load everything,
529 // else the focus label doesn't get updated
530 // This must be fixed in the future.
531 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
532 fluxbox->getStyleOverlayFilename(),
533 m_root_theme->screenNum());
534 m_root_theme->setLineAttributes(*resource.gc_line_width, 528 m_root_theme->setLineAttributes(*resource.gc_line_width,
535 *resource.gc_line_style, 529 *resource.gc_line_style,
536 *resource.gc_cap_style, 530 *resource.gc_cap_style,
diff --git a/src/SlitTheme.cc b/src/SlitTheme.cc
index a9d1a07..7f2081b 100644
--- a/src/SlitTheme.cc
+++ b/src/SlitTheme.cc
@@ -34,6 +34,7 @@ SlitTheme::SlitTheme(int screen_num):FbTk::Theme(screen_num),
34 m_border_color.setDefaultValue(); 34 m_border_color.setDefaultValue();
35 // default texture type 35 // default texture type
36 m_texture->setType(FbTk::Texture::SOLID); 36 m_texture->setType(FbTk::Texture::SOLID);
37 FbTk::ThemeManager::instance().loadTheme(*this);
37} 38}
38 39
39 40
diff --git a/src/ToolTheme.cc b/src/ToolTheme.cc
index 61710ec..2432655 100644
--- a/src/ToolTheme.cc
+++ b/src/ToolTheme.cc
@@ -31,6 +31,7 @@ ToolTheme::ToolTheme(int screen_num, const std::string &name, const std::string
31 m_border(*this, name, altname), 31 m_border(*this, name, altname),
32 m_alpha(255) { 32 m_alpha(255) {
33 33
34 FbTk::ThemeManager::instance().loadTheme(*this);
34} 35}
35 36
36ToolTheme::~ToolTheme() { 37ToolTheme::~ToolTheme() {
diff --git a/src/ToolbarTheme.cc b/src/ToolbarTheme.cc
index a9f1c1c..8cadb02 100644
--- a/src/ToolbarTheme.cc
+++ b/src/ToolbarTheme.cc
@@ -42,6 +42,7 @@ ToolbarTheme::ToolbarTheme(int screen_num):
42 *m_shape = false; 42 *m_shape = false;
43 *m_height = 0; 43 *m_height = 0;
44 *m_button_size = -1; 44 *m_button_size = -1;
45 FbTk::ThemeManager::instance().loadTheme(*this);
45} 46}
46 47
47ToolbarTheme::~ToolbarTheme() { 48ToolbarTheme::~ToolbarTheme() {
diff --git a/src/WinButtonTheme.cc b/src/WinButtonTheme.cc
index ac6d5f7..6c7003e 100644
--- a/src/WinButtonTheme.cc
+++ b/src/WinButtonTheme.cc
@@ -58,6 +58,7 @@ WinButtonTheme::WinButtonTheme(int screen_num, FbWinFrameTheme &frame_theme):
58 m_stuck_unfocus_pm(*this, "window.stuck.unfocus.pixmap", "Window.Stuck.Unfocus.Pixmap"), 58 m_stuck_unfocus_pm(*this, "window.stuck.unfocus.pixmap", "Window.Stuck.Unfocus.Pixmap"),
59 m_frame_theme(frame_theme) { 59 m_frame_theme(frame_theme) {
60 60
61 FbTk::ThemeManager::instance().loadTheme(*this);
61} 62}
62 63
63WinButtonTheme::~WinButtonTheme() { 64WinButtonTheme::~WinButtonTheme() {
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index d22f496..29b3509 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -318,6 +318,9 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
318#endif // HAVE_GETPID 318#endif // HAVE_GETPID
319 319
320 320
321 // setup theme manager to have our style file ready to be scanned
322 FbTk::ThemeManager::instance().load(getStyleFilename(), getStyleOverlayFilename());
323
321 // Create keybindings handler and load keys file 324 // Create keybindings handler and load keys file
322 // Note: this needs to be done before creating screens 325 // Note: this needs to be done before creating screens
323 m_key.reset(new Keys); 326 m_key.reset(new Keys);
@@ -410,9 +413,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
410 413
411 XAllowEvents(disp, ReplayPointer, CurrentTime); 414 XAllowEvents(disp, ReplayPointer, CurrentTime);
412 415
413 // setup theme manager to have our style file ready to be scanned
414 FbTk::ThemeManager::instance().load(getStyleFilename(), getStyleOverlayFilename());
415
416 //XSynchronize(disp, False); 416 //XSynchronize(disp, False);
417 sync(false); 417 sync(false);
418 418