Convert Screen::reconfigureSig to FbTk::Signal
This commit is contained in:
parent
e1b0decf55
commit
79d526b968
5 changed files with 10 additions and 29 deletions
|
@ -59,7 +59,6 @@
|
||||||
#include "Debug.hh"
|
#include "Debug.hh"
|
||||||
|
|
||||||
#include "FbTk/I18n.hh"
|
#include "FbTk/I18n.hh"
|
||||||
#include "FbTk/Subject.hh"
|
|
||||||
#include "FbTk/FbWindow.hh"
|
#include "FbTk/FbWindow.hh"
|
||||||
#include "FbTk/SimpleCommand.hh"
|
#include "FbTk/SimpleCommand.hh"
|
||||||
#include "FbTk/MultLayers.hh"
|
#include "FbTk/MultLayers.hh"
|
||||||
|
@ -301,7 +300,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
||||||
const string &screenname,
|
const string &screenname,
|
||||||
const string &altscreenname,
|
const string &altscreenname,
|
||||||
int scrn, int num_layers) :
|
int scrn, int num_layers) :
|
||||||
m_reconfigure_sig(*this), // reconfigure signal
|
|
||||||
m_layermanager(num_layers),
|
m_layermanager(num_layers),
|
||||||
m_image_control(0),
|
m_image_control(0),
|
||||||
m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
|
m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
|
||||||
|
@ -918,7 +916,7 @@ void BScreen::reconfigure() {
|
||||||
|
|
||||||
imageControl().cleanCache();
|
imageControl().cleanCache();
|
||||||
// notify objects that the screen is reconfigured
|
// notify objects that the screen is reconfigured
|
||||||
m_reconfigure_sig.notify();
|
m_reconfigure_sig.emit(*this);
|
||||||
|
|
||||||
// Reload style
|
// Reload style
|
||||||
FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
|
FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
|
||||||
|
|
|
@ -213,7 +213,7 @@ public:
|
||||||
/// focused window signal
|
/// focused window signal
|
||||||
FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; }
|
FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; }
|
||||||
/// reconfigure signal
|
/// reconfigure signal
|
||||||
FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; }
|
ScreenSignal &reconfigureSig() { return m_reconfigure_sig; }
|
||||||
ScreenSignal &resizeSig() { return m_resize_sig; }
|
ScreenSignal &resizeSig() { return m_resize_sig; }
|
||||||
ScreenSignal &bgChangeSig() { return m_bg_change_sig; }
|
ScreenSignal &bgChangeSig() { return m_bg_change_sig; }
|
||||||
//@}
|
//@}
|
||||||
|
@ -455,18 +455,6 @@ public:
|
||||||
/// when screen dies
|
/// when screen dies
|
||||||
void addManagedResource(FbTk::Resource_base *resource);
|
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:
|
private:
|
||||||
void setupConfigmenu(FbTk::Menu &menu);
|
void setupConfigmenu(FbTk::Menu &menu);
|
||||||
void renderGeomWindow();
|
void renderGeomWindow();
|
||||||
|
@ -476,8 +464,7 @@ private:
|
||||||
const Strut* availableWorkspaceArea(int head) const;
|
const Strut* availableWorkspaceArea(int head) const;
|
||||||
|
|
||||||
FbTk::SignalTracker m_tracker;
|
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
|
FbTk::Signal<BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal
|
||||||
ScreenSignal m_resize_sig; ///< resize signal
|
ScreenSignal m_resize_sig; ///< resize signal
|
||||||
|
|
|
@ -271,7 +271,7 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename)
|
||||||
join(scr.bgChangeSig(),
|
join(scr.bgChangeSig(),
|
||||||
FbTk::MemFunIgnoreArgs(*this, &Slit::reconfigure));
|
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);
|
scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu);
|
||||||
|
|
||||||
|
@ -1042,10 +1042,6 @@ void Slit::screenSizeChanged(BScreen &screen) {
|
||||||
#endif // XINERAMA
|
#endif // XINERAMA
|
||||||
}
|
}
|
||||||
|
|
||||||
void Slit::update(FbTk::Subject*) {
|
|
||||||
reconfigure();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Slit::clearWindow() {
|
void Slit::clearWindow() {
|
||||||
frame.window.clear();
|
frame.window.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,7 @@ class Strut;
|
||||||
class Layer;
|
class Layer;
|
||||||
|
|
||||||
/// Handles dock apps
|
/// Handles dock apps
|
||||||
class Slit: public FbTk::EventHandler, public FbTk::Observer,
|
class Slit: public FbTk::EventHandler, public LayerObject, private FbTk::SignalTracker
|
||||||
public LayerObject, private FbTk::SignalTracker
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::list<SlitClient *> SlitClients;
|
typedef std::list<SlitClient *> SlitClients;
|
||||||
|
@ -102,8 +101,6 @@ public:
|
||||||
void exposeEvent(XExposeEvent &event);
|
void exposeEvent(XExposeEvent &event);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void update(FbTk::Subject *subj);
|
|
||||||
|
|
||||||
void moveToLayer(int layernum);
|
void moveToLayer(int layernum);
|
||||||
void toggleHidden();
|
void toggleHidden();
|
||||||
|
|
||||||
|
|
|
@ -229,9 +229,12 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
|
||||||
_FB_USES_NLS;
|
_FB_USES_NLS;
|
||||||
// NOTE: first subject is always the rearrangeItem !
|
// NOTE: first subject is always the rearrangeItem !
|
||||||
m_observers.push_back(makeObserver(*this, &Toolbar::rearrangeItems));
|
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
|
// 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));
|
m_signal_tracker.join(m_theme.reconfigSig(), FbTk::MemFun(*this, &Toolbar::reconfigure));
|
||||||
|
|
||||||
// listen to screen size changes
|
// listen to screen size changes
|
||||||
|
|
Loading…
Reference in a new issue