aboutsummaryrefslogtreecommitdiff
path: root/src/Focusable.hh
diff options
context:
space:
mode:
authormarkt <markt>2007-04-07 17:39:27 (GMT)
committermarkt <markt>2007-04-07 17:39:27 (GMT)
commit12a8b3c038c9ccb577c699d41a1d19602132a7a8 (patch)
tree2a23392db366c10c8b6f7ee444ee8ac578010b5c /src/Focusable.hh
parent416578138e899f817b875ad55a5252a19aa6cb07 (diff)
downloadfluxbox-12a8b3c038c9ccb577c699d41a1d19602132a7a8.zip
fluxbox-12a8b3c038c9ccb577c699d41a1d19602132a7a8.tar.bz2
more of the same
Diffstat (limited to 'src/Focusable.hh')
-rw-r--r--src/Focusable.hh19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Focusable.hh b/src/Focusable.hh
index 8982f29..e02e0d7 100644
--- a/src/Focusable.hh
+++ b/src/Focusable.hh
@@ -41,8 +41,10 @@ class Focusable: public FbTk::ITypeAheadable {
41public: 41public:
42 Focusable(BScreen &scr, FluxboxWindow *fbwin = 0): 42 Focusable(BScreen &scr, FluxboxWindow *fbwin = 0):
43 m_screen(scr), m_fbwin(fbwin), 43 m_screen(scr), m_fbwin(fbwin),
44 m_instance_name("fluxbox"), m_class_name("fluxbox"), m_focused(false), 44 m_instance_name("fluxbox"), m_class_name("fluxbox"),
45 m_titlesig(*this), m_focussig(*this), m_diesig(*this) { } 45 m_focused(false), m_attention_state(false),
46 m_titlesig(*this), m_focussig(*this), m_diesig(*this),
47 m_attentionsig(*this) { }
46 virtual ~Focusable() { } 48 virtual ~Focusable() { }
47 /** 49 /**
48 * Take focus. 50 * Take focus.
@@ -54,6 +56,14 @@ public:
54 virtual bool isFocused() const { return m_focused; } 56 virtual bool isFocused() const { return m_focused; }
55 /// @return return true if it can be focused 57 /// @return return true if it can be focused
56 virtual bool acceptsFocus() const { return true; } 58 virtual bool acceptsFocus() const { return true; }
59
60 /// @return true if icon button should appear focused
61 inline bool getAttentionState() const { return m_attention_state; }
62 /// @set the attention state
63 virtual void setAttentionState(bool value) {
64 m_attention_state = value; attentionSig().notify();
65 }
66
57 /// @return the screen in which this object resides 67 /// @return the screen in which this object resides
58 inline BScreen &screen() { return m_screen; } 68 inline BScreen &screen() { return m_screen; }
59 /// @return the screen in which this object resides 69 /// @return the screen in which this object resides
@@ -110,6 +120,8 @@ public:
110 const FbTk::Subject &focusSig() const { return m_focussig; } 120 const FbTk::Subject &focusSig() const { return m_focussig; }
111 FbTk::Subject &dieSig() { return m_diesig; } 121 FbTk::Subject &dieSig() { return m_diesig; }
112 const FbTk::Subject &dieSig() const { return m_diesig; } 122 const FbTk::Subject &dieSig() const { return m_diesig; }
123 FbTk::Subject &attentionSig() { return m_attentionsig; }
124 const FbTk::Subject &attentionSig() const { return m_attentionsig; }
113 /** @} */ // end group signals 125 /** @} */ // end group signals
114 126
115protected: 127protected:
@@ -118,10 +130,11 @@ protected:
118 130
119 std::string m_title, m_instance_name, m_class_name; 131 std::string m_title, m_instance_name, m_class_name;
120 bool m_focused; //< whether or not it has focus 132 bool m_focused; //< whether or not it has focus
133 bool m_attention_state; //< state of icon button while demanding attention
121 FbTk::PixmapWithMask m_icon; //< icon pixmap with mask 134 FbTk::PixmapWithMask m_icon; //< icon pixmap with mask
122 135
123 // state and hint signals 136 // state and hint signals
124 FocusSubject m_titlesig, m_focussig, m_diesig; 137 FocusSubject m_titlesig, m_focussig, m_diesig, m_attentionsig;
125}; 138};
126 139
127#endif // FOCUSABLE_HH 140#endif // FOCUSABLE_HH