aboutsummaryrefslogtreecommitdiff
path: root/src/ToolbarHandler.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-15 12:00:46 (GMT)
committerfluxgen <fluxgen>2003-05-15 12:00:46 (GMT)
commit988392b1eb89deaddfddfcb37a15e8f55d58bb70 (patch)
tree493d69abd418722498d1b53982653eae1d4a37e6 /src/ToolbarHandler.cc
parentcbce8634dde14fd7000fde92e86f4bd4bf3525c2 (diff)
downloadfluxbox_pavel-988392b1eb89deaddfddfcb37a15e8f55d58bb70.zip
fluxbox_pavel-988392b1eb89deaddfddfcb37a15e8f55d58bb70.tar.bz2
minor cleaning in BScreen interface
Diffstat (limited to 'src/ToolbarHandler.cc')
-rw-r--r--src/ToolbarHandler.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc
index 1bc13c1..174f28c 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.11 2003/05/15 11:17:27 fluxgen Exp $ 23// $Id: ToolbarHandler.cc,v 1.12 2003/05/15 12:00:45 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.
@@ -91,9 +91,9 @@ void setupModeMenu(FbTk::Menu &menu, ToolbarHandler &handler) {
91ToolbarHandler::ToolbarHandler(BScreen &screen, ToolbarMode mode) 91ToolbarHandler::ToolbarHandler(BScreen &screen, ToolbarMode mode)
92 : m_screen(screen), m_mode(mode), m_toolbar(0), m_current_workspace(0), 92 : m_screen(screen), m_mode(mode), m_toolbar(0), m_current_workspace(0),
93 m_modemenu(*screen.menuTheme(), 93 m_modemenu(*screen.menuTheme(),
94 screen.getScreenNumber(), *screen.getImageControl()), 94 screen.screenNumber(), *screen.getImageControl()),
95 m_toolbarmenu(*screen.menuTheme(), 95 m_toolbarmenu(*screen.menuTheme(),
96 screen.getScreenNumber(), *screen.getImageControl()) 96 screen.screenNumber(), *screen.getImageControl())
97{ 97{
98 m_modemenu.setInternalMenu(); 98 m_modemenu.setInternalMenu();
99 setupModeMenu(m_modemenu, *this); 99 setupModeMenu(m_modemenu, *this);
@@ -147,8 +147,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
147 break; 147 break;
148 case NONE: 148 case NONE:
149 break; 149 break;
150 case ALLWINDOWS: 150 case ALLWINDOWS: {
151 {
152 BScreen::Workspaces::const_iterator workspace_it = m_screen.getWorkspacesList().begin(); 151 BScreen::Workspaces::const_iterator workspace_it = m_screen.getWorkspacesList().begin();
153 BScreen::Workspaces::const_iterator workspace_it_end = m_screen.getWorkspacesList().end(); 152 BScreen::Workspaces::const_iterator workspace_it_end = m_screen.getWorkspacesList().end();
154 for (; workspace_it != workspace_it_end; ++workspace_it) { 153 for (; workspace_it != workspace_it_end; ++workspace_it) {
@@ -168,8 +167,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
168 } 167 }
169 // fall through and add icons 168 // fall through and add icons
170 case LASTMODE: 169 case LASTMODE:
171 case ICONS: 170 case ICONS: {
172 {
173 BScreen::Icons &iconlist = m_screen.getIconList(); 171 BScreen::Icons &iconlist = m_screen.getIconList();
174 BScreen::Icons::iterator iconit = iconlist.begin(); 172 BScreen::Icons::iterator iconit = iconlist.begin();
175 BScreen::Icons::iterator iconit_end = iconlist.end(); 173 BScreen::Icons::iterator iconit_end = iconlist.end();
@@ -178,9 +176,8 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
178 } 176 }
179 } 177 }
180 break; 178 break;
181 case WORKSPACE: 179 case WORKSPACE: {
182 { 180 Workspace::Windows &wins = m_screen.currentWorkspace()->windowList();
183 Workspace::Windows &wins = m_screen.getCurrentWorkspace()->windowList();
184 Workspace::Windows::iterator wit = wins.begin(); 181 Workspace::Windows::iterator wit = wins.begin();
185 Workspace::Windows::iterator wit_end = wins.end(); 182 Workspace::Windows::iterator wit_end = wins.end();
186 for (; wit != wit_end; ++wit) { 183 for (; wit != wit_end; ++wit) {
@@ -188,9 +185,8 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
188 } 185 }
189 } 186 }
190 // fall through and add icons for this workspace 187 // fall through and add icons for this workspace
191 case WORKSPACEICONS: 188 case WORKSPACEICONS: {
192 { 189 m_current_workspace = m_screen.currentWorkspaceID();
193 m_current_workspace = m_screen.getCurrentWorkspaceID();
194 190
195 BScreen::Icons &wiconlist = m_screen.getIconList(); 191 BScreen::Icons &wiconlist = m_screen.getIconList();
196 BScreen::Icons::iterator iconit = wiconlist.begin(); 192 BScreen::Icons::iterator iconit = wiconlist.begin();
@@ -273,7 +269,8 @@ void ToolbarHandler::updateState(FluxboxWindow &win) {
273 case ALLWINDOWS: 269 case ALLWINDOWS:
274 break; 270 break;
275 case WORKSPACEICONS: 271 case WORKSPACEICONS:
276 if (win.workspaceNumber() != m_current_workspace) break; 272 if (win.workspaceNumber() != m_current_workspace)
273 break;
277 // else fall through and do the same as icons (knowing it is the right ws) 274 // else fall through and do the same as icons (knowing it is the right ws)
278 case LASTMODE: 275 case LASTMODE:
279 case ICONS: 276 case ICONS:
@@ -313,10 +310,12 @@ void ToolbarHandler::updateWorkspace(FluxboxWindow &win) {
313} 310}
314 311
315void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) { 312void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) {
316 if (&screen != &m_screen) return; 313 if (&screen != &m_screen)
314 return;
317 // if only displaying current workspace, update list 315 // if only displaying current workspace, update list
318 // otherwise ignore it 316 // otherwise ignore it
319 if (m_mode != WORKSPACE && m_mode != WORKSPACEICONS) return; 317 if (m_mode != WORKSPACE && m_mode != WORKSPACEICONS)
318 return;
320 m_toolbar->delAllIcons(); 319 m_toolbar->delAllIcons();
321 initForScreen(m_screen); 320 initForScreen(m_screen);
322} 321}