summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc63
1 files changed, 12 insertions, 51 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index dd5be04..d4e7d3c 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.193 2003/06/24 14:55:55 fluxgen Exp $ 25// $Id: Screen.cc,v 1.194 2003/06/24 16:30:13 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -31,6 +31,7 @@
31#include "fluxbox.hh" 31#include "fluxbox.hh"
32#include "ImageControl.hh" 32#include "ImageControl.hh"
33#include "Toolbar.hh" 33#include "Toolbar.hh"
34#include "ToolbarHandler.hh"
34#include "Window.hh" 35#include "Window.hh"
35#include "Workspace.hh" 36#include "Workspace.hh"
36#include "StringUtil.hh" 37#include "StringUtil.hh"
@@ -175,53 +176,6 @@ private:
175}; // End anonymous namespace 176}; // End anonymous namespace
176 177
177 178
178template<>
179void FbTk::Resource<ToolbarHandler::ToolbarMode>::
180setFromString(const char *strval) {
181 if (strcasecmp(strval, "Off") == 0)
182 m_value = ToolbarHandler::OFF;
183 else if (strcasecmp(strval, "None") == 0)
184 m_value = ToolbarHandler::NONE;
185 else if (strcasecmp(strval, "Icons") == 0)
186 m_value = ToolbarHandler::ICONS;
187 else if (strcasecmp(strval, "WorkspaceIcons") == 0)
188 m_value = ToolbarHandler::WORKSPACEICONS;
189 else if (strcasecmp(strval, "Workspace") == 0)
190 m_value = ToolbarHandler::WORKSPACE;
191 else if (strcasecmp(strval, "AllWindows") == 0)
192 m_value = ToolbarHandler::ALLWINDOWS;
193 else
194 setDefaultValue();
195}
196
197
198template<>
199string FbTk::Resource<ToolbarHandler::ToolbarMode>::
200getString() {
201 switch (m_value) {
202 case ToolbarHandler::OFF:
203 return string("Off");
204 break;
205 case ToolbarHandler::NONE:
206 return string("None");
207 break;
208 case ToolbarHandler::LASTMODE:
209 case ToolbarHandler::ICONS:
210 return string("Icons");
211 break;
212 case ToolbarHandler::WORKSPACEICONS:
213 return string("WorkspaceIcons");
214 break;
215 case ToolbarHandler::WORKSPACE:
216 return string("Workspace");
217 break;
218 case ToolbarHandler::ALLWINDOWS:
219 return string("AllWindows");
220 break;
221 }
222 // default string
223 return string("Icons");
224}
225 179
226namespace { 180namespace {
227 181
@@ -323,8 +277,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
323 focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), 277 focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
324 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), 278 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
325 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), 279 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
326 menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha"), 280 menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha") {
327 toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode") {
328 281
329}; 282};
330 283
@@ -467,7 +420,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
467 420
468 // create toolbarhandler for toolbar 421 // create toolbarhandler for toolbar
469 422
470 m_toolbarhandler.reset(new ToolbarHandler(*this, toolbarMode())); 423 m_toolbarhandler.reset(new ToolbarHandler(*this));
471 424
472 //!! TODO: we shouldn't do this more than once, but since slit/toolbar handles their 425 //!! TODO: we shouldn't do this more than once, but since slit/toolbar handles their
473 // own resources we must do this. 426 // own resources we must do this.
@@ -607,6 +560,14 @@ FbTk::Menu &BScreen::toolbarModemenu() {
607 return m_toolbarhandler->getModeMenu(); 560 return m_toolbarhandler->getModeMenu();
608} 561}
609 562
563const Toolbar *BScreen::toolbar() const {
564 return m_toolbarhandler->toolbar();
565}
566
567Toolbar *BScreen::toolbar() {
568 return m_toolbarhandler->toolbar();
569}
570
610unsigned int BScreen::currentWorkspaceID() const { 571unsigned int BScreen::currentWorkspaceID() const {
611 return m_current_workspace->workspaceID(); 572 return m_current_workspace->workspaceID();
612} 573}