Convert Screen::reconfigureSig to FbTk::Signal

This commit is contained in:
Pavel Labath 2011-05-07 22:32:48 +02:00
parent e1b0decf55
commit 79d526b968
5 changed files with 10 additions and 29 deletions

View file

@ -59,7 +59,6 @@
#include "Debug.hh"
#include "FbTk/I18n.hh"
#include "FbTk/Subject.hh"
#include "FbTk/FbWindow.hh"
#include "FbTk/SimpleCommand.hh"
#include "FbTk/MultLayers.hh"
@ -301,7 +300,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
const string &screenname,
const string &altscreenname,
int scrn, int num_layers) :
m_reconfigure_sig(*this), // reconfigure signal
m_layermanager(num_layers),
m_image_control(0),
m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
@ -918,7 +916,7 @@ void BScreen::reconfigure() {
imageControl().cleanCache();
// notify objects that the screen is reconfigured
m_reconfigure_sig.notify();
m_reconfigure_sig.emit(*this);
// Reload style
FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),

View file

@ -213,7 +213,7 @@ public:
/// focused window signal
FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; }
/// reconfigure signal
FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; }
ScreenSignal &reconfigureSig() { return m_reconfigure_sig; }
ScreenSignal &resizeSig() { return m_resize_sig; }
ScreenSignal &bgChangeSig() { return m_bg_change_sig; }
//@}
@ -455,18 +455,6 @@ public:
/// when screen dies
void addManagedResource(FbTk::Resource_base *resource);
/**
* Used to emit different signals for the screen
*/
class ScreenSubject:public FbTk::Subject {
public:
ScreenSubject(BScreen &scr):m_scr(scr) { }
const BScreen &screen() const { return m_scr; }
BScreen &screen() { return m_scr; }
private:
BScreen &m_scr;
};
private:
void setupConfigmenu(FbTk::Menu &menu);
void renderGeomWindow();
@ -476,8 +464,7 @@ private:
const Strut* availableWorkspaceArea(int head) const;
FbTk::SignalTracker m_tracker;
ScreenSubject m_reconfigure_sig; ///< reconfigure signal
ScreenSignal m_reconfigure_sig; ///< reconfigure signal
FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal
ScreenSignal m_resize_sig; ///< resize signal

View file

@ -271,7 +271,7 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename)
join(scr.bgChangeSig(),
FbTk::MemFunIgnoreArgs(*this, &Slit::reconfigure));
scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig)
join(scr.reconfigureSig(), FbTk::MemFunIgnoreArgs(*this, &Slit::reconfigure));
scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu);
@ -1042,10 +1042,6 @@ void Slit::screenSizeChanged(BScreen &screen) {
#endif // XINERAMA
}
void Slit::update(FbTk::Subject*) {
reconfigure();
}
void Slit::clearWindow() {
frame.window.clear();
}

View file

@ -52,8 +52,7 @@ class Strut;
class Layer;
/// Handles dock apps
class Slit: public FbTk::EventHandler, public FbTk::Observer,
public LayerObject, private FbTk::SignalTracker
class Slit: public FbTk::EventHandler, public LayerObject, private FbTk::SignalTracker
{
public:
typedef std::list<SlitClient *> SlitClients;
@ -102,8 +101,6 @@ public:
void exposeEvent(XExposeEvent &event);
//@}
void update(FbTk::Subject *subj);
void moveToLayer(int layernum);
void toggleHidden();

View file

@ -229,9 +229,12 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
_FB_USES_NLS;
// NOTE: first subject is always the rearrangeItem !
m_observers.push_back(makeObserver(*this, &Toolbar::rearrangeItems));
// get this on antialias change
m_signal_tracker.join(screen().reconfigureSig(),
FbTk::MemFunIgnoreArgs(*this, &Toolbar::reconfigure));
// we need to get notified when the theme is reloaded
m_observers.push_back(makeObserver(*this, &Toolbar::reconfigure));
screen().reconfigureSig().attach(m_observers.back()); // get this on antialias change
m_signal_tracker.join(m_theme.reconfigSig(), FbTk::MemFun(*this, &Toolbar::reconfigure));
// listen to screen size changes