aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-25 05:47:23 (GMT)
committerfluxgen <fluxgen>2003-06-25 05:47:23 (GMT)
commitc3939e170e6e7163f0e23234e42084ad19d0c315 (patch)
treed09c13f7d179dea3d6509a1f0312beaed357fb3a /src
parente2548fe7ae1390216df9c9e16f1f0ca782d72676 (diff)
downloadfluxbox-c3939e170e6e7163f0e23234e42084ad19d0c315.zip
fluxbox-c3939e170e6e7163f0e23234e42084ad19d0c315.tar.bz2
removed toolbarhandler
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc62
-rw-r--r--src/Screen.hh18
2 files changed, 7 insertions, 73 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index d4e7d3c..b2d0190 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.194 2003/06/24 16:30:13 fluxgen Exp $ 25// $Id: Screen.cc,v 1.195 2003/06/25 05:47:23 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -30,8 +30,6 @@
30#include "I18n.hh" 30#include "I18n.hh"
31#include "fluxbox.hh" 31#include "fluxbox.hh"
32#include "ImageControl.hh" 32#include "ImageControl.hh"
33#include "Toolbar.hh"
34#include "ToolbarHandler.hh"
35#include "Window.hh" 33#include "Window.hh"
36#include "Workspace.hh" 34#include "Workspace.hh"
37#include "StringUtil.hh" 35#include "StringUtil.hh"
@@ -305,7 +303,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
305 m_name(screenname), 303 m_name(screenname),
306 m_altname(altscreenname), 304 m_altname(altscreenname),
307 m_resource_manager(rm), 305 m_resource_manager(rm),
308 m_toolbarhandler(0),
309 m_available_workspace_area(new Strut(0, 0, 0, 0)), 306 m_available_workspace_area(new Strut(0, 0, 0, 0)),
310 m_xinerama_headinfo(0) { 307 m_xinerama_headinfo(0) {
311 308
@@ -354,7 +351,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
354 351
355 imageControl().setDither(*resource.image_dither); 352 imageControl().setDither(*resource.image_dither);
356 353
357 // setup windowtheme, toolbartheme for antialias 354 // setup windowtheme for antialias
358 // before we load the theme 355 // before we load the theme
359 356
360 winFrameTheme().font().setAntialias(*resource.antialias); 357 winFrameTheme().font().setAntialias(*resource.antialias);
@@ -418,11 +415,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
418 415
419#endif // SLIT 416#endif // SLIT
420 417
421 // create toolbarhandler for toolbar
422
423 m_toolbarhandler.reset(new ToolbarHandler(*this));
424 418
425 //!! TODO: we shouldn't do this more than once, but since slit/toolbar handles their 419 //!! TODO: we shouldn't do this more than once, but since slit handles their
426 // own resources we must do this. 420 // own resources we must do this.
427 fluxbox->load_rc(*this); 421 fluxbox->load_rc(*this);
428 422
@@ -432,8 +426,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
432 426
433 workspacemenu->setItemSelected(2, true); 427 workspacemenu->setItemSelected(2, true);
434 428
435 // if toolbar needs initialisation, do it in ToolbarHandler instead
436 // so it will work when destroyed later etc
437 429
438 initMenu(); // create and initiate rootmenu 430 initMenu(); // create and initiate rootmenu
439 431
@@ -446,9 +438,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
446 FbTk::ThemeManager::instance().loadTheme(slit()->theme()); 438 FbTk::ThemeManager::instance().loadTheme(slit()->theme());
447#endif // SLIT 439#endif // SLIT
448 440
449 if (toolbar())
450 toolbar()->reconfigure();
451
452 // start with workspace 0 441 // start with workspace 0
453 changeWorkspaceID(0); 442 changeWorkspaceID(0);
454 updateNetizenWorkspaceCount(); 443 updateNetizenWorkspaceCount();
@@ -502,10 +491,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
502 } 491 }
503 } 492 }
504 493
505 if (! isSloppyFocus() && toolbar() != 0) {
506 XSetInputFocus(disp, toolbar()->window().window(),
507 RevertToParent, CurrentTime);
508 }
509 494
510 // set the toolbarhandler after the windows are setup, so it catches their state properly 495 // set the toolbarhandler after the windows are setup, so it catches their state properly
511 496
@@ -552,22 +537,6 @@ BScreen::~BScreen() {
552#endif // XINERAMA 537#endif // XINERAMA
553} 538}
554 539
555const FbTk::Menu &BScreen::toolbarModemenu() const {
556 return m_toolbarhandler->getModeMenu();
557}
558
559FbTk::Menu &BScreen::toolbarModemenu() {
560 return m_toolbarhandler->getModeMenu();
561}
562
563const Toolbar *BScreen::toolbar() const {
564 return m_toolbarhandler->toolbar();
565}
566
567Toolbar *BScreen::toolbar() {
568 return m_toolbarhandler->toolbar();
569}
570
571unsigned int BScreen::currentWorkspaceID() const { 540unsigned int BScreen::currentWorkspaceID() const {
572 return m_current_workspace->workspaceID(); 541 return m_current_workspace->workspaceID();
573} 542}
@@ -633,8 +602,6 @@ void BScreen::reconfigure() {
633 winFrameTheme().font().setAntialias(*resource.antialias); 602 winFrameTheme().font().setAntialias(*resource.antialias);
634 m_menutheme->titleFont().setAntialias(*resource.antialias); 603 m_menutheme->titleFont().setAntialias(*resource.antialias);
635 m_menutheme->frameFont().setAntialias(*resource.antialias); 604 m_menutheme->frameFont().setAntialias(*resource.antialias);
636 if (toolbar() && toolbar()->theme().font().isAntialias() != *resource.antialias)
637 toolbar()->theme().font().setAntialias(*resource.antialias);
638 605
639 // load theme 606 // load theme
640 std::string theme_filename(Fluxbox::instance()->getStyleFilename()); 607 std::string theme_filename(Fluxbox::instance()->getStyleFilename());
@@ -705,8 +672,6 @@ void BScreen::reconfigure() {
705 } 672 }
706 } 673 }
707 674
708 if (toolbar())
709 toolbar()->reconfigure();
710 675
711#ifdef SLIT 676#ifdef SLIT
712 if (slit()) 677 if (slit())
@@ -828,8 +793,6 @@ int BScreen::addWorkspace() {
828 793
829 workspacemenu->update(); 794 workspacemenu->update();
830 saveWorkspaces(m_workspaces_list.size()); 795 saveWorkspaces(m_workspaces_list.size());
831 if (toolbar() != 0)
832 toolbar()->reconfigure();
833 796
834 updateNetizenWorkspaceCount(); 797 updateNetizenWorkspaceCount();
835 798
@@ -856,8 +819,6 @@ int BScreen::removeLastWorkspace() {
856 m_workspaces_list.pop_back(); 819 m_workspaces_list.pop_back();
857 delete wkspc; 820 delete wkspc;
858 821
859 if (toolbar() != 0)
860 toolbar()->reconfigure();
861 822
862 updateNetizenWorkspaceCount(); 823 updateNetizenWorkspaceCount();
863 saveWorkspaces(m_workspaces_list.size()); 824 saveWorkspaces(m_workspaces_list.size());
@@ -2031,8 +1992,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
2031 menu.insert("Slit", &slit()->menu()); 1992 menu.insert("Slit", &slit()->menu());
2032 } 1993 }
2033#endif // SLIT 1994#endif // SLIT
2034 menu.insert(i18n->getMessage(ToolbarSet, ToolbarToolbarTitle, 1995
2035 "Toolbar"), &m_toolbarhandler->getToolbarMenu());
2036 menu.insert(new 1996 menu.insert(new
2037 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering, 1997 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering,
2038 "Image Dithering"), 1998 "Image Dithering"),
@@ -2380,9 +2340,6 @@ void BScreen::updateSize() {
2380 // reset background 2340 // reset background
2381 m_root_theme->reconfigTheme(); 2341 m_root_theme->reconfigTheme();
2382 2342
2383 if (toolbar())
2384 toolbar()->reconfigure();
2385
2386 if (slit()) 2343 if (slit())
2387 slit()->reconfigure(); 2344 slit()->reconfigure();
2388 2345
@@ -2555,14 +2512,3 @@ void BScreen::setOnHead<Slit>(Slit &slit, int head) {
2555 slit.reconfigure(); 2512 slit.reconfigure();
2556} 2513}
2557 2514
2558template <>
2559int BScreen::getOnHead<Toolbar>(Toolbar &tbar) {
2560 return 0;
2561 // return tbar.getOnHead();
2562}
2563
2564template <>
2565void BScreen::setOnHead<Toolbar>(Toolbar &tbar, int head) {
2566 // saveToolbarOnHead(head);
2567 tbar.reconfigure();
2568}
diff --git a/src/Screen.hh b/src/Screen.hh
index 4ee147c..d4cdb3b 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -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.hh,v 1.111 2003/06/24 16:29:54 fluxgen Exp $ 25// $Id: Screen.hh,v 1.112 2003/06/25 05:46:21 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -45,8 +45,6 @@
45#include <memory> 45#include <memory>
46 46
47class Netizen; 47class Netizen;
48class Toolbar;
49class ToolbarHandler;
50class FbWinFrameTheme; 48class FbWinFrameTheme;
51class RootTheme; 49class RootTheme;
52class WinButtonTheme; 50class WinButtonTheme;
@@ -65,7 +63,7 @@ class FbWindow;
65 63
66/// Handles screen connection, screen clients and workspaces 64/// Handles screen connection, screen clients and workspaces
67/** 65/**
68 Create a toolbar and workspaces, handles switching between workspaces and windows 66 Create workspaces, handles switching between workspaces and windows
69 */ 67 */
70class BScreen : private FbTk::NotCopyable { 68class BScreen : private FbTk::NotCopyable {
71public: 69public:
@@ -97,8 +95,6 @@ public:
97 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); } 95 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
98 const FbTk::Menu * const getRootmenu() const { return m_rootmenu.get(); } 96 const FbTk::Menu * const getRootmenu() const { return m_rootmenu.get(); }
99 FbTk::Menu * const getRootmenu() { return m_rootmenu.get(); } 97 FbTk::Menu * const getRootmenu() { return m_rootmenu.get(); }
100 const FbTk::Menu &toolbarModemenu() const;
101 FbTk::Menu &toolbarModemenu();
102 98
103 inline const std::string &getRootCommand() const { return *resource.rootcommand; } 99 inline const std::string &getRootCommand() const { return *resource.rootcommand; }
104 inline Fluxbox::FocusModel getFocusModel() const { return *resource.focus_model; } 100 inline Fluxbox::FocusModel getFocusModel() const { return *resource.focus_model; }
@@ -106,12 +102,6 @@ public:
106 inline Slit *slit() { return m_slit.get(); } 102 inline Slit *slit() { return m_slit.get(); }
107 inline const Slit *slit() const { return m_slit.get(); } 103 inline const Slit *slit() const { return m_slit.get(); }
108 104
109 const Toolbar *toolbar() const;
110 Toolbar *toolbar();
111
112 inline const ToolbarHandler &toolbarHandler() const { return *m_toolbarhandler; }
113 inline ToolbarHandler &toolbarHandler() { return *m_toolbarhandler; }
114
115 inline Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); } 105 inline Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); }
116 inline Workspace *currentWorkspace() { return m_current_workspace; } 106 inline Workspace *currentWorkspace() { return m_current_workspace; }
117 107
@@ -266,7 +256,7 @@ public:
266 FluxboxWindow* useAutoGroupWindow(); 256 FluxboxWindow* useAutoGroupWindow();
267 257
268 /// updates root window size and resizes/reconfigures screen clients 258 /// updates root window size and resizes/reconfigures screen clients
269 /// that depends on screen size (toolbar, slit) 259 /// that depends on screen size (slit)
270 /// (and maximized windows?) 260 /// (and maximized windows?)
271 void updateSize(); 261 void updateSize();
272 262
@@ -427,8 +417,6 @@ private:
427 const std::string m_name, m_altname; 417 const std::string m_name, m_altname;
428 FbTk::ResourceManager &m_resource_manager; 418 FbTk::ResourceManager &m_resource_manager;
429 419
430 std::auto_ptr<ToolbarHandler> m_toolbarhandler;
431
432 bool m_xinerama_avail; 420 bool m_xinerama_avail;
433 int m_xinerama_num_heads; 421 int m_xinerama_num_heads;
434 422