aboutsummaryrefslogtreecommitdiff
path: root/src/ToolbarHandler.hh
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-03-03 21:51:13 (GMT)
committerrathnor <rathnor>2003-03-03 21:51:13 (GMT)
commit19875e5a5ba474387971ede597cdc4aa7454d4c0 (patch)
tree99d672abcffa86d74734deacbd888eccde02ffd2 /src/ToolbarHandler.hh
parent824fd0db7a4b8117fecba9bb46053bdd38691803 (diff)
downloadfluxbox-19875e5a5ba474387971ede597cdc4aa7454d4c0.zip
fluxbox-19875e5a5ba474387971ede597cdc4aa7454d4c0.tar.bz2
Add code for toolbar modes
Diffstat (limited to 'src/ToolbarHandler.hh')
-rw-r--r--src/ToolbarHandler.hh93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/ToolbarHandler.hh b/src/ToolbarHandler.hh
new file mode 100644
index 0000000..6e5f450
--- /dev/null
+++ b/src/ToolbarHandler.hh
@@ -0,0 +1,93 @@
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.hh,v 1.1 2003/03/03 21:51:09 rathnor Exp $
24
25#ifndef TOOLBARHANDLER_HH
26#define TOOLBARHANDLER_HH
27
28#include "AtomHandler.hh"
29#include "Menu.hh"
30#include "Toolbar.hh"
31
32class FluxboxWindow;
33class BScreen;
34
35class ToolbarHandler : public AtomHandler {
36public:
37 enum ToolbarMode {
38 OFF=0,
39 NONE,
40 ICONS,
41 WORKSPACEICONS,
42 WORKSPACE,
43 ALLWINDOWS,
44 LASTMODE
45 };
46
47 ToolbarHandler(BScreen &screen, ToolbarMode mode);
48 ~ToolbarHandler() { }
49
50 void setMode(ToolbarMode mode, bool initialise = true);
51 ToolbarMode getMode() { return m_mode; };
52
53 inline const Toolbar *getToolbar() const { return m_toolbar.get(); }
54 inline Toolbar *getToolbar() { return m_toolbar.get(); }
55
56
57 void initForScreen(BScreen &screen);
58 void setupWindow(FluxboxWindow &win);
59
60 void updateState(FluxboxWindow &win);
61 void updateWindowClose(FluxboxWindow &win);
62 void updateWorkspace(FluxboxWindow &win);
63 void updateCurrentWorkspace(BScreen &screen);
64
65 // these ones don't affect us
66 void updateWorkspaceNames(BScreen &screen) {}
67 void updateWorkspaceCount(BScreen &screen) {}
68 void updateClientList(BScreen &screen) {}
69 void updateHints(FluxboxWindow &win) {}
70 void updateLayer(FluxboxWindow &win) {}
71
72 bool checkClientMessage(const XClientMessageEvent &ce,
73 BScreen * screen, FluxboxWindow * const win) { return false; }
74
75 inline FbTk::Menu &getModeMenu() { return m_modemenu; }
76 inline const FbTk::Menu &getModeMenu() const { return m_modemenu; }
77 inline FbTk::Menu &getToolbarMenu() { return m_toolbarmenu; }
78 inline const FbTk::Menu &getToolbarMenu() const { return m_toolbarmenu; }
79
80 inline BScreen &screen() { return m_screen; }
81 inline const BScreen &screen() const { return m_screen; }
82
83private:
84 BScreen &m_screen;
85 ToolbarMode m_mode;
86 std::auto_ptr<Toolbar> m_toolbar;
87 unsigned int m_current_workspace;
88
89 FbTk::Menu m_modemenu;
90 FbTk::Menu m_toolbarmenu;
91};
92
93#endif // TOOLBARHANDLER_HH