aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-05-07 20:32:48 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-05-10 11:00:46 (GMT)
commit79d526b968b0e8cec31a66b0eafa8ddeb32cc16e (patch)
treec5308c180986495086f389f2f52c8f230418708e /src
parente1b0decf559113b43162d9e54bdbf75ee1d80b1f (diff)
downloadfluxbox_paul-79d526b968b0e8cec31a66b0eafa8ddeb32cc16e.zip
fluxbox_paul-79d526b968b0e8cec31a66b0eafa8ddeb32cc16e.tar.bz2
Convert Screen::reconfigureSig to FbTk::Signal
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc4
-rw-r--r--src/Screen.hh17
-rw-r--r--src/Slit.cc6
-rw-r--r--src/Slit.hh5
-rw-r--r--src/Toolbar.cc7
5 files changed, 10 insertions, 29 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index ce1f8ed..bfb6221 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -59,7 +59,6 @@
59#include "Debug.hh" 59#include "Debug.hh"
60 60
61#include "FbTk/I18n.hh" 61#include "FbTk/I18n.hh"
62#include "FbTk/Subject.hh"
63#include "FbTk/FbWindow.hh" 62#include "FbTk/FbWindow.hh"
64#include "FbTk/SimpleCommand.hh" 63#include "FbTk/SimpleCommand.hh"
65#include "FbTk/MultLayers.hh" 64#include "FbTk/MultLayers.hh"
@@ -301,7 +300,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
301 const string &screenname, 300 const string &screenname,
302 const string &altscreenname, 301 const string &altscreenname,
303 int scrn, int num_layers) : 302 int scrn, int num_layers) :
304 m_reconfigure_sig(*this), // reconfigure signal
305 m_layermanager(num_layers), 303 m_layermanager(num_layers),
306 m_image_control(0), 304 m_image_control(0),
307 m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")), 305 m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
@@ -918,7 +916,7 @@ void BScreen::reconfigure() {
918 916
919 imageControl().cleanCache(); 917 imageControl().cleanCache();
920 // notify objects that the screen is reconfigured 918 // notify objects that the screen is reconfigured
921 m_reconfigure_sig.notify(); 919 m_reconfigure_sig.emit(*this);
922 920
923 // Reload style 921 // Reload style
924 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(), 922 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
diff --git a/src/Screen.hh b/src/Screen.hh
index 96a4d43..a237b36 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -213,7 +213,7 @@ public:
213 /// focused window signal 213 /// focused window signal
214 FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; } 214 FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; }
215 /// reconfigure signal 215 /// reconfigure signal
216 FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } 216 ScreenSignal &reconfigureSig() { return m_reconfigure_sig; }
217 ScreenSignal &resizeSig() { return m_resize_sig; } 217 ScreenSignal &resizeSig() { return m_resize_sig; }
218 ScreenSignal &bgChangeSig() { return m_bg_change_sig; } 218 ScreenSignal &bgChangeSig() { return m_bg_change_sig; }
219 //@} 219 //@}
@@ -455,18 +455,6 @@ public:
455 /// when screen dies 455 /// when screen dies
456 void addManagedResource(FbTk::Resource_base *resource); 456 void addManagedResource(FbTk::Resource_base *resource);
457 457
458 /**
459 * Used to emit different signals for the screen
460 */
461 class ScreenSubject:public FbTk::Subject {
462 public:
463 ScreenSubject(BScreen &scr):m_scr(scr) { }
464 const BScreen &screen() const { return m_scr; }
465 BScreen &screen() { return m_scr; }
466 private:
467 BScreen &m_scr;
468 };
469
470private: 458private:
471 void setupConfigmenu(FbTk::Menu &menu); 459 void setupConfigmenu(FbTk::Menu &menu);
472 void renderGeomWindow(); 460 void renderGeomWindow();
@@ -476,8 +464,7 @@ private:
476 const Strut* availableWorkspaceArea(int head) const; 464 const Strut* availableWorkspaceArea(int head) const;
477 465
478 FbTk::SignalTracker m_tracker; 466 FbTk::SignalTracker m_tracker;
479 ScreenSubject m_reconfigure_sig; ///< reconfigure signal 467 ScreenSignal m_reconfigure_sig; ///< reconfigure signal
480
481 468
482 FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal 469 FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal
483 ScreenSignal m_resize_sig; ///< resize signal 470 ScreenSignal m_resize_sig; ///< resize signal
diff --git a/src/Slit.cc b/src/Slit.cc
index f3e24a9..ccd60ab 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -271,7 +271,7 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename)
271 join(scr.bgChangeSig(), 271 join(scr.bgChangeSig(),
272 FbTk::MemFunIgnoreArgs(*this, &Slit::reconfigure)); 272 FbTk::MemFunIgnoreArgs(*this, &Slit::reconfigure));
273 273
274 scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) 274 join(scr.reconfigureSig(), FbTk::MemFunIgnoreArgs(*this, &Slit::reconfigure));
275 275
276 scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu); 276 scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu);
277 277
@@ -1042,10 +1042,6 @@ void Slit::screenSizeChanged(BScreen &screen) {
1042#endif // XINERAMA 1042#endif // XINERAMA
1043} 1043}
1044 1044
1045void Slit::update(FbTk::Subject*) {
1046 reconfigure();
1047}
1048
1049void Slit::clearWindow() { 1045void Slit::clearWindow() {
1050 frame.window.clear(); 1046 frame.window.clear();
1051} 1047}
diff --git a/src/Slit.hh b/src/Slit.hh
index 2f2eac8..5753565 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -52,8 +52,7 @@ class Strut;
52class Layer; 52class Layer;
53 53
54/// Handles dock apps 54/// Handles dock apps
55class Slit: public FbTk::EventHandler, public FbTk::Observer, 55class Slit: public FbTk::EventHandler, public LayerObject, private FbTk::SignalTracker
56 public LayerObject, private FbTk::SignalTracker
57{ 56{
58public: 57public:
59 typedef std::list<SlitClient *> SlitClients; 58 typedef std::list<SlitClient *> SlitClients;
@@ -102,8 +101,6 @@ public:
102 void exposeEvent(XExposeEvent &event); 101 void exposeEvent(XExposeEvent &event);
103 //@} 102 //@}
104 103
105 void update(FbTk::Subject *subj);
106
107 void moveToLayer(int layernum); 104 void moveToLayer(int layernum);
108 void toggleHidden(); 105 void toggleHidden();
109 106
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 1778a02..9c2d2bf 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -229,9 +229,12 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
229 _FB_USES_NLS; 229 _FB_USES_NLS;
230 // NOTE: first subject is always the rearrangeItem ! 230 // NOTE: first subject is always the rearrangeItem !
231 m_observers.push_back(makeObserver(*this, &Toolbar::rearrangeItems)); 231 m_observers.push_back(makeObserver(*this, &Toolbar::rearrangeItems));
232
233 // get this on antialias change
234 m_signal_tracker.join(screen().reconfigureSig(),
235 FbTk::MemFunIgnoreArgs(*this, &Toolbar::reconfigure));
236
232 // we need to get notified when the theme is reloaded 237 // we need to get notified when the theme is reloaded
233 m_observers.push_back(makeObserver(*this, &Toolbar::reconfigure));
234 screen().reconfigureSig().attach(m_observers.back()); // get this on antialias change
235 m_signal_tracker.join(m_theme.reconfigSig(), FbTk::MemFun(*this, &Toolbar::reconfigure)); 238 m_signal_tracker.join(m_theme.reconfigSig(), FbTk::MemFun(*this, &Toolbar::reconfigure));
236 239
237 // listen to screen size changes 240 // listen to screen size changes