diff options
author | fluxgen <fluxgen> | 2002-02-27 23:43:41 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-02-27 23:43:41 (GMT) |
commit | 188d53a879f1c61c95f0c281c3100b08e57df2f4 (patch) | |
tree | aaa6ab9d77dc9f337727258bd8caea62dc7d4208 /src | |
parent | 0cba1e7dffae670d1a4bbaa6fb300d6888f1e7ce (diff) | |
download | fluxbox-188d53a879f1c61c95f0c281c3100b08e57df2f4.zip fluxbox-188d53a879f1c61c95f0c281c3100b08e57df2f4.tar.bz2 |
added remove/add workspace
Diffstat (limited to 'src')
-rw-r--r-- | src/Workspacemenu.cc | 21 | ||||
-rw-r--r-- | src/Workspacemenu.hh | 12 |
2 files changed, 25 insertions, 8 deletions
diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc index 29033fa..dace287 100644 --- a/src/Workspacemenu.cc +++ b/src/Workspacemenu.cc | |||
@@ -1,3 +1,5 @@ | |||
1 | // Workspacemenu.cc for Fluxbox | ||
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
1 | // Workspacemenu.cc for Blackbox - an X11 Window manager | 3 | // Workspacemenu.cc for Blackbox - an X11 Window manager |
2 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 4 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) |
3 | // | 5 | // |
@@ -35,7 +37,8 @@ | |||
35 | #include "Toolbar.hh" | 37 | #include "Toolbar.hh" |
36 | #include "Workspacemenu.hh" | 38 | #include "Workspacemenu.hh" |
37 | #include "Workspace.hh" | 39 | #include "Workspace.hh" |
38 | 40 | #include <iostream> | |
41 | #include <cassert> | ||
39 | 42 | ||
40 | Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { | 43 | Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { |
41 | screen = scrn; | 44 | screen = scrn; |
@@ -82,3 +85,19 @@ void Workspacemenu::itemSelected(int button, int index) { | |||
82 | hide(); | 85 | hide(); |
83 | } | 86 | } |
84 | } | 87 | } |
88 | |||
89 | void Workspacemenu::removeWorkspace(unsigned int id) { | ||
90 | if (id<getCount()) { | ||
91 | remove(id+2); // + 2 is where workspaces starts | ||
92 | #ifdef DEBUG | ||
93 | using namespace std; | ||
94 | cerr<<__FILE__<<"("<<__LINE__<<"): Removing "<<id<<endl; | ||
95 | #endif | ||
96 | } | ||
97 | } | ||
98 | |||
99 | void Workspacemenu::addWorkspace(Workspace *wkspc) { | ||
100 | assert(wkspc); | ||
101 | insert(wkspc->getName(), wkspc->getMenu(), | ||
102 | wkspc->getWorkspaceID() + 2); | ||
103 | } | ||
diff --git a/src/Workspacemenu.hh b/src/Workspacemenu.hh index fc18654..80732b2 100644 --- a/src/Workspacemenu.hh +++ b/src/Workspacemenu.hh | |||
@@ -1,3 +1,5 @@ | |||
1 | // Workspacemenu.hh for Fluxbox | ||
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
1 | // WorkspaceMenu.hh for Blackbox - an X11 Window manager | 3 | // WorkspaceMenu.hh for Blackbox - an X11 Window manager |
2 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 4 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) |
3 | // | 5 | // |
@@ -22,24 +24,20 @@ | |||
22 | #ifndef WORKSPACEMENU_HH | 24 | #ifndef WORKSPACEMENU_HH |
23 | #define WORKSPACEMENU_HH | 25 | #define WORKSPACEMENU_HH |
24 | 26 | ||
25 | // forward declaration | ||
26 | class Workspacemenu; | ||
27 | class Toolbar; | ||
28 | |||
29 | #include "Basemenu.hh" | 27 | #include "Basemenu.hh" |
30 | 28 | class Workspace; | |
31 | 29 | ||
32 | class Workspacemenu : public Basemenu { | 30 | class Workspacemenu : public Basemenu { |
33 | private: | 31 | private: |
34 | BScreen *screen; | 32 | BScreen *screen; |
35 | 33 | ||
36 | |||
37 | protected: | 34 | protected: |
38 | virtual void itemSelected(int, int); | 35 | virtual void itemSelected(int, int); |
39 | 36 | ||
40 | |||
41 | public: | 37 | public: |
42 | Workspacemenu(BScreen *); | 38 | Workspacemenu(BScreen *); |
39 | void removeWorkspace(unsigned int id); | ||
40 | void addWorkspace(Workspace *wkspc); | ||
43 | }; | 41 | }; |
44 | 42 | ||
45 | 43 | ||