summaryrefslogtreecommitdiff
path: root/src/ToolbarHandler.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-03 00:32:58 (GMT)
committerfluxgen <fluxgen>2003-12-03 00:32:58 (GMT)
commit8971b068ac4ab9a74bccfee93b3314a83b3cbc15 (patch)
tree036880c1d7e4a5bbb2da59f178e0a973caf8bfa0 /src/ToolbarHandler.cc
parent82e72ab49336368284f38130c751e266338900a9 (diff)
downloadfluxbox_lack-8971b068ac4ab9a74bccfee93b3314a83b3cbc15.zip
fluxbox_lack-8971b068ac4ab9a74bccfee93b3314a83b3cbc15.tar.bz2
removed
Diffstat (limited to 'src/ToolbarHandler.cc')
-rw-r--r--src/ToolbarHandler.cc227
1 files changed, 0 insertions, 227 deletions
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc
deleted file mode 100644
index 4a8ff3d..0000000
--- a/src/ToolbarHandler.cc
+++ /dev/null
@@ -1,227 +0,0 @@
1// ToolbarHandler for fluxbox
2// Copyright (c) 2003 Simon Bowden (rathnor at fluxbox.org)
3// and Henrik Kinnunen (fluxgen at fluxbox.org)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a
6// copy of this software and associated documentation files (the "Software"),
7// to deal in the Software without restriction, including without limitation
8// the rights to use, copy, modify, merge, publish, distribute, sublicense,
9// and/or sell copies of the Software, and to permit persons to whom the
10// Software is furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE.
22
23// $Id: ToolbarHandler.cc,v 1.29 2003/10/06 06:22:43 rathnor Exp $
24
25/**
26 * The ToolbarHandler class acts as a rough interface to the toolbar.
27 * It deals with whether it should be there or not, so anything that
28 * always needs to be accessible must come through the handler.
29 */
30
31#include "ToolbarHandler.hh"
32#include "Window.hh"
33#include "Screen.hh"
34#include "Workspace.hh"
35#include "MenuItem.hh"
36#include "FbMenu.hh"
37#include "FbCommands.hh"
38#include "RefCount.hh"
39#include "SimpleCommand.hh"
40#include "MacroCommand.hh"
41#include "IntResMenuItem.hh"
42#include "BoolMenuItem.hh"
43
44#include <string>
45
46using namespace std;
47
48ToolbarHandler::ToolbarHandler(BScreen &screen)
49 : m_screen(screen),
50 // no need to lock since only one resource
51 m_toolbar(0),
52 m_current_workspace(0),
53 m_modemenu(*screen.menuTheme(),
54 screen.screenNumber(), screen.imageControl(),
55 *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
56 m_toolbarmenu(*screen.menuTheme(),
57 screen.screenNumber(), screen.imageControl(),
58 *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) {
59 m_modemenu.setInternalMenu();
60 m_toolbarmenu.setInternalMenu();
61
62 m_mode = WORKSPACE;
63 m_toolbar.reset(new Toolbar(m_screen,
64 *m_screen.layerManager().getLayer(Fluxbox::instance()->getNormalLayer()),
65 m_toolbarmenu));
66 // now add this to the config menus for the screen
67 // (we only want it done once, so it can't go in initforscreen)
68
69 screen.addConfigMenu("Toolbar", m_toolbarmenu);
70 enableUpdate();
71}
72
73void ToolbarHandler::setMode(ToolbarMode newmode, bool initialise) {
74 if (newmode < 0 || newmode >= LASTMODE)
75 return;
76
77
78 if (newmode == OFF) {
79 m_toolbarmenu.removeAll();
80 //TODO: nls
81 m_toolbarmenu.insert("Mode...", &m_modemenu);
82 m_toolbar.reset(0);
83 m_toolbarmenu.update();
84
85 return;
86 } else if (!m_toolbar.get()) {
87 m_toolbarmenu.removeAll();
88 m_toolbar.reset(new Toolbar(m_screen,
89 *m_screen.layerManager().getLayer(Fluxbox::instance()->getNormalLayer()), m_toolbarmenu));
90 m_toolbar->reconfigure();
91
92 m_toolbarmenu.insert("Mode...", &m_modemenu);
93 m_toolbarmenu.update();
94 }
95
96
97 if (newmode == NONE) {
98 //!! TODO disable iconbar
99 } else {
100 // rebuild it
101 // be sure the iconbar is on
102 //!! TODO enable iconbar
103 }
104
105 if (initialise)
106 initForScreen(m_screen);
107}
108
109void ToolbarHandler::initForScreen(BScreen &screen) {
110 if (&m_screen != &screen)
111 return;
112
113 switch (mode()) {
114 case OFF:
115 break;
116 case NONE:
117 break;
118 case ALLWINDOWS:
119 //!! TODO: change iconbar mode
120
121 // fall through and add icons
122 case LASTMODE:
123 case ICONS:
124 //!! TODO: update iconbar mode
125 break;
126 case WORKSPACE:
127 //!! TODO: update iconbar mode
128
129 // fall through and add icons for this workspace
130 case WORKSPACEICONS:
131 //!! TODO: update iconbar mode
132 break;
133 }
134
135}
136
137void ToolbarHandler::setupFrame(FluxboxWindow &win) {
138 if (&win.screen() != &m_screen)
139 return;
140
141 switch (mode()) {
142 case OFF:
143 case NONE:
144 break;
145 case WORKSPACE:
146 break;
147 case WORKSPACEICONS:
148 break;
149 // else fall through and add the icon
150 case LASTMODE:
151 case ICONS:
152 break;
153 case ALLWINDOWS:
154 break;
155 }
156}
157
158void ToolbarHandler::updateFrameClose(FluxboxWindow &win) {
159 if (&win.screen() != &m_screen)
160 return;
161
162 // check status of window (in current workspace, etc) and remove if necessary
163 switch (mode()) {
164 case OFF:
165 case NONE:
166 break;
167 case WORKSPACEICONS:
168 if (win.workspaceNumber() != m_current_workspace)
169 break;
170 // else fall through and remove the icon
171 case LASTMODE:
172 case ICONS:
173 break;
174 case WORKSPACE:
175 break;
176 case ALLWINDOWS:
177 break;
178 }
179}
180
181void ToolbarHandler::updateState(FluxboxWindow &win) {
182 if (&win.screen() != &m_screen)
183 return;
184
185 // this function only relevant for icons
186 switch (mode()) {
187 case OFF:
188 case NONE:
189 case WORKSPACE:
190 case ALLWINDOWS:
191 break;
192 case WORKSPACEICONS:
193 if (win.workspaceNumber() != m_current_workspace)
194 break;
195 // else fall through and do the same as icons (knowing it is the right ws)
196 case LASTMODE:
197 case ICONS:
198 break;
199 }
200}
201
202
203void ToolbarHandler::updateWorkspace(FluxboxWindow &win) {
204 if (&win.screen() != &m_screen)
205 return;
206
207 // don't care about current workspace except if in workspace mode
208 if (!(mode() == WORKSPACE ||
209 (mode() == WORKSPACEICONS && win.isIconic())))
210 return;
211
212 if (win.workspaceNumber() == m_current_workspace) {
213
214 } else {
215
216 }
217}
218
219void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) {
220 if (&screen != &m_screen || mode() == OFF)
221 return;
222
223 if (mode() != NONE)
224 initForScreen(m_screen);
225
226}
227