summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-03 13:56:12 (GMT)
committerfluxgen <fluxgen>2003-02-03 13:56:12 (GMT)
commit1ac79b97332af0fe27f3ca1a850e4989aa9389b2 (patch)
tree43cbc824918f7a327d8081281d053af39177401a /src
parent128bdea1a8533b8eab68e359cd06c60084bbc24d (diff)
downloadfluxbox_lack-1ac79b97332af0fe27f3ca1a850e4989aa9389b2.zip
fluxbox_lack-1ac79b97332af0fe27f3ca1a850e4989aa9389b2.tar.bz2
cleaning
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc61
-rw-r--r--src/Window.cc23
-rw-r--r--src/Workspace.cc6
3 files changed, 46 insertions, 44 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 864bc50..39cfa7b 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.101 2003/02/02 16:32:38 rathnor Exp $ 25// $Id: Screen.cc,v 1.102 2003/02/03 13:52:31 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -45,6 +45,7 @@
45#include "MacroCommand.hh" 45#include "MacroCommand.hh"
46#include "XLayerItem.hh" 46#include "XLayerItem.hh"
47#include "MultLayers.hh" 47#include "MultLayers.hh"
48#include "LayeredMenu.hh"
48 49
49//use GNU extensions 50//use GNU extensions
50#ifndef _GNU_SOURCE 51#ifndef _GNU_SOURCE
@@ -134,10 +135,10 @@ int dcmp(const void *one, const void *two) {
134} 135}
135 136
136FbTk::Menu *createMenuFromScreen(BScreen &screen) { 137FbTk::Menu *createMenuFromScreen(BScreen &screen) {
137 FbTk::Menu *menu = new FbTk::Menu(*screen.menuTheme(), screen.getScreenNumber(), *screen.getImageControl()); 138 FbTk::Menu *menu = new LayeredMenu(*screen.menuTheme(),
138 menu->setLayerItem(new FbTk::XLayerItem(menu->windowID())); 139 screen.getScreenNumber(),
139 140 *screen.getImageControl(),
140 screen.setLayer(*menu->getLayerItem(), Fluxbox::instance()->getMenuLayer()); 141 *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()));
141 return menu; 142 return menu;
142} 143}
143}; 144};
@@ -341,12 +342,12 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
341 342
342BScreen::BScreen(ResourceManager &rm, 343BScreen::BScreen(ResourceManager &rm,
343 const string &screenname, const string &altscreenname, 344 const string &screenname, const string &altscreenname,
344 int scrn) : ScreenInfo(scrn), 345 int scrn, int num_layers) : ScreenInfo(scrn),
345 m_clientlist_sig(*this), // client signal 346 m_clientlist_sig(*this), // client signal
346 m_workspacecount_sig(*this), // workspace count signal 347 m_workspacecount_sig(*this), // workspace count signal
347 m_workspacenames_sig(*this), // workspace names signal 348 m_workspacenames_sig(*this), // workspace names signal
348 m_currentworkspace_sig(*this), // current workspace signal 349 m_currentworkspace_sig(*this), // current workspace signal
349 m_layermanager(0), 350 m_layermanager(num_layers),
350 theme(0), m_windowtheme(scrn), 351 theme(0), m_windowtheme(scrn),
351 m_menutheme(new FbTk::MenuTheme(scrn)), 352 m_menutheme(new FbTk::MenuTheme(scrn)),
352 resource(rm, screenname, altscreenname), 353 resource(rm, screenname, altscreenname),
@@ -399,7 +400,6 @@ BScreen::BScreen(ResourceManager &rm,
399 400
400 fluxbox->load_rc(this); 401 fluxbox->load_rc(this);
401 402
402 m_layermanager = new FbTk::MultLayers(fluxbox->getNumberOfLayers());
403 image_control->setDither(*resource.image_dither); 403 image_control->setDither(*resource.image_dither);
404 theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(), 404 theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(),
405 fluxbox->getStyleFilename(), getRootCommand().c_str()); 405 fluxbox->getStyleFilename(), getRootCommand().c_str());
@@ -469,12 +469,12 @@ BScreen::BScreen(ResourceManager &rm,
469 Workspace *wkspc = (Workspace *) 0; 469 Workspace *wkspc = (Workspace *) 0;
470 if (*resource.workspaces != 0) { 470 if (*resource.workspaces != 0) {
471 for (int i = 0; i < *resource.workspaces; ++i) { 471 for (int i = 0; i < *resource.workspaces; ++i) {
472 wkspc = new Workspace(this, *m_layermanager, workspacesList.size()); 472 wkspc = new Workspace(this, m_layermanager, workspacesList.size());
473 workspacesList.push_back(wkspc); 473 workspacesList.push_back(wkspc);
474 workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu()); 474 workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu());
475 } 475 }
476 } else { 476 } else {
477 wkspc = new Workspace(this, *m_layermanager, workspacesList.size()); 477 wkspc = new Workspace(this, m_layermanager, workspacesList.size());
478 workspacesList.push_back(wkspc); 478 workspacesList.push_back(wkspc);
479 workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu()); 479 workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu());
480 } 480 }
@@ -816,7 +816,7 @@ void BScreen::setAntialias(bool value) {
816} 816}
817 817
818int BScreen::addWorkspace() { 818int BScreen::addWorkspace() {
819 Workspace *wkspc = new Workspace(this, *m_layermanager, workspacesList.size()); 819 Workspace *wkspc = new Workspace(this, m_layermanager, workspacesList.size());
820 workspacesList.push_back(wkspc); 820 workspacesList.push_back(wkspc);
821 addWorkspaceName(wkspc->name().c_str()); // update names 821 addWorkspaceName(wkspc->name().c_str()); // update names
822 //add workspace to workspacemenu 822 //add workspace to workspacemenu
@@ -1086,7 +1086,8 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) {
1086 1086
1087FluxboxWindow *BScreen::createWindow(Window client) { 1087FluxboxWindow *BScreen::createWindow(Window client) {
1088 FluxboxWindow *win = new FluxboxWindow(client, this, getScreenNumber(), *getImageControl(), 1088 FluxboxWindow *win = new FluxboxWindow(client, this, getScreenNumber(), *getImageControl(),
1089 winFrameTheme(), *menuTheme()); 1089 winFrameTheme(), *menuTheme(),
1090 *layerManager().getLayer(0));
1090 1091
1091#ifdef SLIT 1092#ifdef SLIT
1092 if (win->initialState() == WithdrawnState) 1093 if (win->initialState() == WithdrawnState)
@@ -1946,15 +1947,14 @@ void BScreen::lower(FbTk::XLayerItem &item) {
1946} 1947}
1947 1948
1948void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) { 1949void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) {
1949 m_layermanager->moveToLayer(item, layernum); 1950 m_layermanager.moveToLayer(item, layernum);
1950} 1951}
1951 1952
1952void BScreen::removeLayerItem(FbTk::XLayerItem *item) {
1953 m_layermanager->remove(*item);
1954 delete item;
1955}
1956 1953
1957void BScreen::raiseWindow(FluxboxWindow *w) { 1954void BScreen::raiseWindow(FluxboxWindow *w) {
1955 if (w == 0)
1956 return;
1957
1958 FluxboxWindow *win = w; 1958 FluxboxWindow *win = w;
1959 1959
1960 while (win->getTransientFor()) { 1960 while (win->getTransientFor()) {
@@ -1962,16 +1962,20 @@ void BScreen::raiseWindow(FluxboxWindow *w) {
1962 assert(win != win->getTransientFor()); 1962 assert(win != win->getTransientFor());
1963 } 1963 }
1964 1964
1965 if (win == 0)
1966 win = w;
1967
1965 if (!win->isIconic()) { 1968 if (!win->isIconic()) {
1966 updateNetizenWindowRaise(win->getClientWindow()); 1969 updateNetizenWindowRaise(win->getClientWindow());
1967 win->getLayerItem()->raise(); 1970 win->getLayerItem().raise();
1968 } 1971 }
1972
1969 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin(); 1973 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
1970 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end(); 1974 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
1971 for (; it != it_end; ++it) { 1975 for (; it != it_end; ++it) {
1972 if (!(*it)->isIconic()) { 1976 if (!(*it)->isIconic()) {
1973 updateNetizenWindowRaise((*it)->getClientWindow()); 1977 updateNetizenWindowRaise((*it)->getClientWindow());
1974 (*it)->getLayerItem()->raise(); 1978 (*it)->getLayerItem().raise();
1975 } 1979 }
1976 } 1980 }
1977} 1981}
@@ -1988,14 +1992,14 @@ void BScreen::lowerWindow(FluxboxWindow *w) {
1988 1992
1989 if (!win->isIconic()) { 1993 if (!win->isIconic()) {
1990 updateNetizenWindowLower(win->getClientWindow()); 1994 updateNetizenWindowLower(win->getClientWindow());
1991 win->getLayerItem()->lower(); 1995 win->getLayerItem().lower();
1992 } 1996 }
1993 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin(); 1997 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
1994 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end(); 1998 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
1995 for (; it != it_end; ++it) { 1999 for (; it != it_end; ++it) {
1996 if (!(*it)->isIconic()) { 2000 if (!(*it)->isIconic()) {
1997 updateNetizenWindowLower((*it)->getClientWindow()); 2001 updateNetizenWindowLower((*it)->getClientWindow());
1998 (*it)->getLayerItem()->lower(); 2002 (*it)->getLayerItem().lower();
1999 } 2003 }
2000 } 2004 }
2001 2005
@@ -2011,15 +2015,16 @@ void BScreen::raiseWindowLayer(FluxboxWindow *w) {
2011 2015
2012 if (!win->isIconic()) { 2016 if (!win->isIconic()) {
2013 updateNetizenWindowRaise(win->getClientWindow()); 2017 updateNetizenWindowRaise(win->getClientWindow());
2014 m_layermanager->raise(*win->getLayerItem()); 2018 win->getLayerItem().raise();
2015 win->setLayerNum(win->getLayerNum()-1); 2019 win->setLayerNum(win->getLayerNum()-1);
2016 } 2020 }
2021
2017 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin(); 2022 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
2018 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end(); 2023 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
2019 for (; it != it_end; ++it) { 2024 for (; it != it_end; ++it) {
2020 if (!(*it)->isIconic()) { 2025 if (!(*it)->isIconic()) {
2021 updateNetizenWindowRaise((*it)->getClientWindow()); 2026 updateNetizenWindowRaise((*it)->getClientWindow());
2022 m_layermanager->raise(*(*it)->getLayerItem()); 2027 (*it)->getLayerItem().raise();
2023 (*it)->setLayerNum((*it)->getLayerNum()-1); 2028 (*it)->setLayerNum((*it)->getLayerNum()-1);
2024 } 2029 }
2025 } 2030 }
@@ -2037,7 +2042,7 @@ void BScreen::lowerWindowLayer(FluxboxWindow *w) {
2037 2042
2038 if (!win->isIconic()) { 2043 if (!win->isIconic()) {
2039 updateNetizenWindowLower(win->getClientWindow()); 2044 updateNetizenWindowLower(win->getClientWindow());
2040 m_layermanager->lower(*win->getLayerItem()); 2045 win->getLayerItem().lower();
2041 win->setLayerNum(win->getLayerNum()+1); 2046 win->setLayerNum(win->getLayerNum()+1);
2042 } 2047 }
2043 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin(); 2048 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
@@ -2045,7 +2050,7 @@ void BScreen::lowerWindowLayer(FluxboxWindow *w) {
2045 for (; it != it_end; ++it) { 2050 for (; it != it_end; ++it) {
2046 if (!(*it)->isIconic()) { 2051 if (!(*it)->isIconic()) {
2047 updateNetizenWindowLower((*it)->getClientWindow()); 2052 updateNetizenWindowLower((*it)->getClientWindow());
2048 m_layermanager->lower(*(*it)->getLayerItem()); 2053 (*it)->getLayerItem().lower();
2049 (*it)->setLayerNum((*it)->getLayerNum()+1); 2054 (*it)->setLayerNum((*it)->getLayerNum()+1);
2050 } 2055 }
2051 } 2056 }
@@ -2067,7 +2072,8 @@ void BScreen::moveWindowToLayer(FluxboxWindow *win, int layernum) {
2067 2072
2068 if (!win->isIconic()) { 2073 if (!win->isIconic()) {
2069 updateNetizenWindowRaise(win->getClientWindow()); 2074 updateNetizenWindowRaise(win->getClientWindow());
2070 m_layermanager->moveToLayer(*win->getLayerItem(),layernum); 2075 //!! TODO
2076 //anager->moveToLayer(*win->getLayerItem(),layernum);
2071 win->setLayerNum(layernum); 2077 win->setLayerNum(layernum);
2072 } 2078 }
2073 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin(); 2079 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
@@ -2075,7 +2081,8 @@ void BScreen::moveWindowToLayer(FluxboxWindow *win, int layernum) {
2075 for (; it != it_end; ++it) { 2081 for (; it != it_end; ++it) {
2076 if (!(*it)->isIconic()) { 2082 if (!(*it)->isIconic()) {
2077 updateNetizenWindowRaise((*it)->getClientWindow()); 2083 updateNetizenWindowRaise((*it)->getClientWindow());
2078 m_layermanager->moveToLayer(*(*it)->getLayerItem(), layernum); 2084 //!! TODO
2085 //m_layermanager->moveToLayer(*(*it)->getLayerItem(), layernum);
2079 (*it)->setLayerNum(layernum); 2086 (*it)->setLayerNum(layernum);
2080 } 2087 }
2081 } 2088 }
diff --git a/src/Window.cc b/src/Window.cc
index ca26e5a..f47f829 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.113 2003/02/02 16:32:39 rathnor Exp $ 25// $Id: Window.cc,v 1.114 2003/02/03 13:55:08 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -95,8 +95,10 @@ void grabButton(Display *display, unsigned int button,
95 95
96}; 96};
97 97
98FluxboxWindow::FluxboxWindow(Window w, BScreen *s, int screen_num, FbTk::ImageControl &imgctrl, FbWinFrameTheme &tm, 98FluxboxWindow::FluxboxWindow(Window w, BScreen *s, int screen_num,
99 FbTk::MenuTheme &menutheme): 99 FbTk::ImageControl &imgctrl, FbWinFrameTheme &tm,
100 FbTk::MenuTheme &menutheme,
101 FbTk::XLayer &layer):
100 m_hintsig(*this), 102 m_hintsig(*this),
101 m_statesig(*this), 103 m_statesig(*this),
102 m_layersig(*this), 104 m_layersig(*this),
@@ -110,12 +112,14 @@ FluxboxWindow::FluxboxWindow(Window w, BScreen *s, int screen_num, FbTk::ImageCo
110 display(0), 112 display(0),
111 lastButtonPressTime(0), 113 lastButtonPressTime(0),
112 m_windowmenu(menutheme, screen_num, imgctrl), 114 m_windowmenu(menutheme, screen_num, imgctrl),
113 m_layeritem(0), 115 m_layeritem(getFrameWindow(), layer),
114 m_layernum(4), 116 m_layernum(4),
115 old_decoration(DECOR_NORMAL), 117 old_decoration(DECOR_NORMAL),
116 tab(0), 118 tab(0),
117 m_frame(tm, imgctrl, screen_num, 0, 0, 100, 100) { 119 m_frame(tm, imgctrl, screen_num, 0, 0, 100, 100) {
118 120
121
122
119 // redirect events from frame to us 123 // redirect events from frame to us
120 m_frame.setEventHandler(*this); 124 m_frame.setEventHandler(*this);
121 125
@@ -252,7 +256,7 @@ FluxboxWindow::FluxboxWindow(Window w, BScreen *s, int screen_num, FbTk::ImageCo
252 256
253 positionWindows(); 257 positionWindows();
254 258
255 m_layeritem = new FbTk::XLayerItem(getFrameWindow()); 259
256 260
257 if (workspace_number < 0 || workspace_number >= screen->getCount()) 261 if (workspace_number < 0 || workspace_number >= screen->getCount())
258 workspace_number = screen->getCurrentWorkspaceID(); 262 workspace_number = screen->getCurrentWorkspaceID();
@@ -358,15 +362,6 @@ FluxboxWindow::~FluxboxWindow() {
358 if (client.window) 362 if (client.window)
359 fluxbox->removeWindowSearch(client.window); 363 fluxbox->removeWindowSearch(client.window);
360 364
361 if (m_layeritem) {
362 m_layeritem->removeWindow(getFrameWindow());
363 //if (hasTab())
364 // m_layeritem->removeWindow(get tab window)
365 if (m_layeritem->isEmpty()) {
366 screen->removeLayerItem(m_layeritem);
367 }
368 }
369
370#ifdef DEBUG 365#ifdef DEBUG
371 cerr<<__FILE__<<"("<<__LINE__<<"): ~FluxboxWindow("<<this<<")"<<endl; 366 cerr<<__FILE__<<"("<<__LINE__<<"): ~FluxboxWindow("<<this<<")"<<endl;
372#endif // DEBUG 367#endif // DEBUG
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 67b984c..091e14d 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.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: Workspace.cc,v 1.44 2003/02/02 16:32:40 rathnor Exp $ 25// $Id: Workspace.cc,v 1.45 2003/02/03 13:56:12 fluxgen Exp $
26 26
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
@@ -175,7 +175,7 @@ int Workspace::removeWindow(FluxboxWindow *w) {
175 // this bit is pretty dodgy at present 175 // this bit is pretty dodgy at present
176 // it gets the next item down, then scans through our windowlist to see if it is 176 // it gets the next item down, then scans through our windowlist to see if it is
177 // in this workspace. If not, goes down more 177 // in this workspace. If not, goes down more
178 FbTk::XLayerItem *item = 0, *lastitem = w->getLayerItem(); 178 /* //!! TODO! FbTk::XLayerItem *item = 0, *lastitem = w->getLayerItem();
179 do { 179 do {
180 item = m_layermanager.getItemBelow(*lastitem); 180 item = m_layermanager.getItemBelow(*lastitem);
181 Windows::iterator it = m_windowlist.begin(); 181 Windows::iterator it = m_windowlist.begin();
@@ -208,7 +208,7 @@ int Workspace::removeWindow(FluxboxWindow *w) {
208 } while (item && !top); 208 } while (item && !top);
209 209
210 } 210 }
211 211 */
212 if (top == 0|| !top->setInputFocus()) { 212 if (top == 0|| !top->setInputFocus()) {
213 Fluxbox::instance()->setFocusedWindow(0); // set focused window to none 213 Fluxbox::instance()->setFocusedWindow(0); // set focused window to none
214 } 214 }