aboutsummaryrefslogtreecommitdiff
path: root/src/ToolbarHandler.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-14 15:01:55 (GMT)
committerfluxgen <fluxgen>2003-04-14 15:01:55 (GMT)
commit2928b32f3a399527113325de3db39cd75db4ee8e (patch)
tree53c9d8e3676e35a200314df700344ef2711fb7b4 /src/ToolbarHandler.cc
parentb6ca956c821e1e968dda10ee7852c6933b549b08 (diff)
downloadfluxbox-2928b32f3a399527113325de3db39cd75db4ee8e.zip
fluxbox-2928b32f3a399527113325de3db39cd75db4ee8e.tar.bz2
merged with embedded-tab-branch
Diffstat (limited to 'src/ToolbarHandler.cc')
-rw-r--r--src/ToolbarHandler.cc32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc
index 26f601d..98a56f1 100644
--- a/src/ToolbarHandler.cc
+++ b/src/ToolbarHandler.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ToolbarHandler.cc,v 1.4 2003/03/23 05:07:03 rathnor Exp $ 23// $Id: ToolbarHandler.cc,v 1.5 2003/04/14 15:01:55 fluxgen Exp $
24 24
25/** 25/**
26 * The ToolbarHandler class acts as a rough interface to the toolbar. 26 * The ToolbarHandler class acts as a rough interface to the toolbar.
@@ -45,7 +45,9 @@ namespace {
45 45
46class ToolbarModeMenuItem : public FbTk::MenuItem { 46class ToolbarModeMenuItem : public FbTk::MenuItem {
47public: 47public:
48 ToolbarModeMenuItem(const char *label, ToolbarHandler &handler, ToolbarHandler::ToolbarMode mode, FbTk::RefCount<FbTk::Command> &cmd): 48 ToolbarModeMenuItem(const char *label, ToolbarHandler &handler,
49 ToolbarHandler::ToolbarMode mode,
50 FbTk::RefCount<FbTk::Command> &cmd):
49 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 51 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) {
50 } 52 }
51 bool isEnabled() const { return m_handler.getMode() != m_mode; } 53 bool isEnabled() const { return m_handler.getMode() != m_mode; }
@@ -134,7 +136,8 @@ void ToolbarHandler::setMode(ToolbarMode mode, bool initialise) {
134} 136}
135 137
136void ToolbarHandler::initForScreen(BScreen &screen) { 138void ToolbarHandler::initForScreen(BScreen &screen) {
137 if (&m_screen != &screen) return; 139 if (&m_screen != &screen)
140 return;
138 switch (m_mode) { 141 switch (m_mode) {
139 case OFF: 142 case OFF:
140 break; 143 break;
@@ -149,7 +152,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
149 Workspace::Windows::iterator wit = wins.begin(); 152 Workspace::Windows::iterator wit = wins.begin();
150 Workspace::Windows::iterator wit_end = wins.end(); 153 Workspace::Windows::iterator wit_end = wins.end();
151 for (; wit != wit_end; ++wit) { 154 for (; wit != wit_end; ++wit) {
152 m_toolbar->addIcon(*wit); 155 // m_toolbar->addIcon(*(*wit));
153 } 156 }
154 } 157 }
155 } 158 }
@@ -161,7 +164,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
161 BScreen::Icons::iterator iconit = iconlist.begin(); 164 BScreen::Icons::iterator iconit = iconlist.begin();
162 BScreen::Icons::iterator iconit_end = iconlist.end(); 165 BScreen::Icons::iterator iconit_end = iconlist.end();
163 for(; iconit != iconit_end; ++iconit) { 166 for(; iconit != iconit_end; ++iconit) {
164 m_toolbar->addIcon(*iconit); 167 // m_toolbar->addIcon(*iconit);
165 } 168 }
166 } 169 }
167 break; 170 break;
@@ -171,7 +174,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
171 Workspace::Windows::iterator wit = wins.begin(); 174 Workspace::Windows::iterator wit = wins.begin();
172 Workspace::Windows::iterator wit_end = wins.end(); 175 Workspace::Windows::iterator wit_end = wins.end();
173 for (; wit != wit_end; ++wit) { 176 for (; wit != wit_end; ++wit) {
174 m_toolbar->addIcon(*wit); 177 // m_toolbar->addIcon(*wit);
175 } 178 }
176 } 179 }
177 // fall through and add icons for this workspace 180 // fall through and add icons for this workspace
@@ -192,7 +195,9 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
192} 195}
193 196
194void ToolbarHandler::setupWindow(FluxboxWindow &win) { 197void ToolbarHandler::setupWindow(FluxboxWindow &win) {
195 if (win.getScreen() != &m_screen) return; 198 if (&win.getScreen() != &m_screen)
199 return;
200
196 switch (m_mode) { 201 switch (m_mode) {
197 case OFF: 202 case OFF:
198 case NONE: 203 case NONE:
@@ -218,7 +223,9 @@ void ToolbarHandler::setupWindow(FluxboxWindow &win) {
218} 223}
219 224
220void ToolbarHandler::updateWindowClose(FluxboxWindow &win) { 225void ToolbarHandler::updateWindowClose(FluxboxWindow &win) {
221 if (win.getScreen() != &m_screen) return; 226 if (&win.getScreen() != &m_screen)
227 return;
228
222 // check status of window (in current workspace, etc) and remove if necessary 229 // check status of window (in current workspace, etc) and remove if necessary
223 switch (m_mode) { 230 switch (m_mode) {
224 case OFF: 231 case OFF:
@@ -245,7 +252,8 @@ void ToolbarHandler::updateWindowClose(FluxboxWindow &win) {
245} 252}
246 253
247void ToolbarHandler::updateState(FluxboxWindow &win) { 254void ToolbarHandler::updateState(FluxboxWindow &win) {
248 if (win.getScreen() != &m_screen) return; 255 if (&win.getScreen() != &m_screen)
256 return;
249 257
250 // this function only relevant for icons 258 // this function only relevant for icons
251 switch (m_mode) { 259 switch (m_mode) {
@@ -274,12 +282,14 @@ void ToolbarHandler::updateState(FluxboxWindow &win) {
274 282
275 283
276void ToolbarHandler::updateWorkspace(FluxboxWindow &win) { 284void ToolbarHandler::updateWorkspace(FluxboxWindow &win) {
277 if (win.getScreen() != &m_screen) return; 285 if (&win.getScreen() != &m_screen)
286 return;
287
278 // don't care about current workspace except if in workspace mode 288 // don't care about current workspace except if in workspace mode
279 if (!(m_mode == WORKSPACE || (m_mode == WORKSPACEICONS && win.isIconic()))) return; 289 if (!(m_mode == WORKSPACE || (m_mode == WORKSPACEICONS && win.isIconic()))) return;
280 290
281 if (win.getWorkspaceNumber() == m_current_workspace) { 291 if (win.getWorkspaceNumber() == m_current_workspace) {
282 // TODO 292 //!! TODO
283 // this shouldn't be needed, but is until Workspaces get fixed so that 293 // this shouldn't be needed, but is until Workspaces get fixed so that
284 // you only move between them, you don't 'add' and 'remove' 294 // you only move between them, you don't 'add' and 'remove'
285 // alternatively, fix reassocaiteWindow so that the iconic stuff is 295 // alternatively, fix reassocaiteWindow so that the iconic stuff is