name change of the list
This commit is contained in:
parent
239c673965
commit
720423af01
2 changed files with 40 additions and 39 deletions
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Workspace.cc,v 1.34 2002/10/29 16:00:20 fluxgen Exp $
|
// $Id: Workspace.cc,v 1.35 2002/11/03 15:02:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ Workspace::~Workspace() {
|
||||||
|
|
||||||
void Workspace::setLastFocusedWindow(FluxboxWindow *win) {
|
void Workspace::setLastFocusedWindow(FluxboxWindow *win) {
|
||||||
// make sure we have this window in the list
|
// make sure we have this window in the list
|
||||||
if (std::find(windowList.begin(), windowList.end(), win) != windowList.end())
|
if (std::find(m_windowlist.begin(), m_windowlist.end(), win) != m_windowlist.end())
|
||||||
lastfocus = win;
|
lastfocus = win;
|
||||||
else
|
else
|
||||||
lastfocus = 0;
|
lastfocus = 0;
|
||||||
|
@ -107,7 +107,7 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) {
|
||||||
placeWindow(w);
|
placeWindow(w);
|
||||||
|
|
||||||
w->setWorkspace(m_id);
|
w->setWorkspace(m_id);
|
||||||
w->setWindowNumber(windowList.size());
|
w->setWindowNumber(m_windowlist.size());
|
||||||
|
|
||||||
stackingList.push_front(w);
|
stackingList.push_front(w);
|
||||||
|
|
||||||
|
@ -117,20 +117,20 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) {
|
||||||
//if there isn't any window that's focused, just add it to the end of the list
|
//if there isn't any window that's focused, just add it to the end of the list
|
||||||
/*
|
/*
|
||||||
if (focused == 0) {
|
if (focused == 0) {
|
||||||
windowList.push_back(w);
|
m_windowlist.push_back(w);
|
||||||
//Add client to clientmenu
|
//Add client to clientmenu
|
||||||
m_clientmenu.insert(w->getTitle().c_str());
|
m_clientmenu.insert(w->getTitle().c_str());
|
||||||
} else {
|
} else {
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
size_t client_insertpoint=0;
|
size_t client_insertpoint=0;
|
||||||
for (; it != windowList.end(); ++it, ++client_insertpoint) {
|
for (; it != m_windowlist.end(); ++it, ++client_insertpoint) {
|
||||||
if (*it == focused) {
|
if (*it == focused) {
|
||||||
++it;
|
++it;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
windowList.insert(it, w);
|
m_windowlist.insert(it, w);
|
||||||
//Add client to clientmenu
|
//Add client to clientmenu
|
||||||
m_clientmenu.insert(w->getTitle().c_str(), client_insertpoint);
|
m_clientmenu.insert(w->getTitle().c_str(), client_insertpoint);
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) {
|
||||||
*/
|
*/
|
||||||
//add to list
|
//add to list
|
||||||
m_clientmenu.insert(w->getTitle().c_str());
|
m_clientmenu.insert(w->getTitle().c_str());
|
||||||
windowList.push_back(w);
|
m_windowlist.push_back(w);
|
||||||
|
|
||||||
//update menugraphics
|
//update menugraphics
|
||||||
m_clientmenu.update();
|
m_clientmenu.update();
|
||||||
|
@ -190,11 +190,11 @@ int Workspace::removeWindow(FluxboxWindow *w) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::iterator it_end = windowList.end();
|
Windows::iterator it_end = m_windowlist.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it) {
|
||||||
if (*it == w) {
|
if (*it == w) {
|
||||||
windowList.erase(it);
|
m_windowlist.erase(it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,17 +206,17 @@ int Workspace::removeWindow(FluxboxWindow *w) {
|
||||||
screen->updateNetizenWindowDel(w->getClientWindow());
|
screen->updateNetizenWindowDel(w->getClientWindow());
|
||||||
|
|
||||||
{
|
{
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::const_iterator it_end = windowList.end();
|
Windows::const_iterator it_end = m_windowlist.end();
|
||||||
for (int i = 0; it != it_end; ++it, ++i) {
|
for (int i = 0; it != it_end; ++it, ++i) {
|
||||||
(*it)->setWindowNumber(i);
|
(*it)->setWindowNumber(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastfocus == w || windowList.empty())
|
if (lastfocus == w || m_windowlist.empty())
|
||||||
lastfocus = 0;
|
lastfocus = 0;
|
||||||
|
|
||||||
return windowList.size();
|
return m_windowlist.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -240,8 +240,8 @@ void Workspace::hideAll(void) {
|
||||||
|
|
||||||
|
|
||||||
void Workspace::removeAll(void) {
|
void Workspace::removeAll(void) {
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::const_iterator it_end = windowList.end();
|
Windows::const_iterator it_end = m_windowlist.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it) {
|
||||||
(*it)->iconify();
|
(*it)->iconify();
|
||||||
}
|
}
|
||||||
|
@ -305,11 +305,11 @@ void Workspace::lowerWindow(FluxboxWindow *w) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Workspace::reconfigure(void) {
|
void Workspace::reconfigure() {
|
||||||
m_clientmenu.reconfigure();
|
m_clientmenu.reconfigure();
|
||||||
|
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::iterator it_end = windowList.end();
|
Windows::iterator it_end = m_windowlist.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it) {
|
||||||
if ((*it)->validateClient())
|
if ((*it)->validateClient())
|
||||||
(*it)->reconfigure();
|
(*it)->reconfigure();
|
||||||
|
@ -318,20 +318,20 @@ void Workspace::reconfigure(void) {
|
||||||
|
|
||||||
|
|
||||||
const FluxboxWindow *Workspace::getWindow(unsigned int index) const {
|
const FluxboxWindow *Workspace::getWindow(unsigned int index) const {
|
||||||
if (index < windowList.size())
|
if (index < m_windowlist.size())
|
||||||
return windowList[index];
|
return m_windowlist[index];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FluxboxWindow *Workspace::getWindow(unsigned int index) {
|
FluxboxWindow *Workspace::getWindow(unsigned int index) {
|
||||||
if (index < windowList.size())
|
if (index < m_windowlist.size())
|
||||||
return windowList[index];
|
return m_windowlist[index];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Workspace::getCount() const {
|
int Workspace::getCount() const {
|
||||||
return windowList.size();
|
return m_windowlist.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -360,6 +360,7 @@ void Workspace::checkGrouping(FluxboxWindow &win) {
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// go throu every group and search for matching win instancename
|
// go throu every group and search for matching win instancename
|
||||||
GroupList::iterator g(m_groups.begin());
|
GroupList::iterator g(m_groups.begin());
|
||||||
GroupList::iterator g_end(m_groups.end());
|
GroupList::iterator g_end(m_groups.end());
|
||||||
|
@ -372,8 +373,8 @@ void Workspace::checkGrouping(FluxboxWindow &win) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// find a window with the specific name
|
// find a window with the specific name
|
||||||
Windows::iterator wit(getWindowList().begin());
|
Windows::iterator wit(m_windowlist.begin());
|
||||||
Windows::iterator wit_end(getWindowList().end());
|
Windows::iterator wit_end(m_windowlist.end());
|
||||||
for (; wit != wit_end; ++wit) {
|
for (; wit != wit_end; ++wit) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<__FILE__<<" check group with : "<<(*wit)->instanceName()<<endl;
|
cerr<<__FILE__<<" check group with : "<<(*wit)->instanceName()<<endl;
|
||||||
|
@ -431,7 +432,7 @@ bool Workspace::isCurrent() const{
|
||||||
|
|
||||||
|
|
||||||
bool Workspace::isLastWindow(FluxboxWindow *w) const{
|
bool Workspace::isLastWindow(FluxboxWindow *w) const{
|
||||||
return (w == windowList.back());
|
return (w == m_windowlist.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::setCurrent() {
|
void Workspace::setCurrent() {
|
||||||
|
@ -460,13 +461,13 @@ void Workspace::setName(const std::string &name) {
|
||||||
//------------ shutdown ---------
|
//------------ shutdown ---------
|
||||||
// Calls restore on all windows
|
// Calls restore on all windows
|
||||||
// on the workspace and then
|
// on the workspace and then
|
||||||
// clears the windowList
|
// clears the m_windowlist
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
void Workspace::shutdown() {
|
void Workspace::shutdown() {
|
||||||
// note: when the window dies it'll remove it self from the list
|
// note: when the window dies it'll remove it self from the list
|
||||||
while (!windowList.empty()) {
|
while (!m_windowlist.empty()) {
|
||||||
windowList.back()->restore(true); // restore with remap
|
m_windowlist.back()->restore(true); // restore with remap
|
||||||
delete windowList.back(); //delete window (the window removes it self from windowList)
|
delete m_windowlist.back(); //delete window (the window removes it self from m_windowlist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,8 +571,8 @@ void Workspace::placeWindow(FluxboxWindow *win) {
|
||||||
|
|
||||||
placed = True;
|
placed = True;
|
||||||
|
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::iterator it_end = windowList.end();
|
Windows::iterator it_end = m_windowlist.end();
|
||||||
|
|
||||||
for (; it != it_end && placed; ++it) {
|
for (; it != it_end && placed; ++it) {
|
||||||
curr_x = (*it)->getXFrame();
|
curr_x = (*it)->getXFrame();
|
||||||
|
@ -689,8 +690,8 @@ void Workspace::placeWindow(FluxboxWindow *win) {
|
||||||
! placed) {
|
! placed) {
|
||||||
placed = True;
|
placed = True;
|
||||||
|
|
||||||
Windows::iterator it = windowList.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::iterator it_end = windowList.end();
|
Windows::iterator it_end = m_windowlist.end();
|
||||||
for (; it != it_end && placed; ++it) {
|
for (; it != it_end && placed; ++it) {
|
||||||
curr_x = (*it)->getXFrame();
|
curr_x = (*it)->getXFrame();
|
||||||
curr_y = (*it)->getYFrame();
|
curr_y = (*it)->getYFrame();
|
||||||
|
|
|
@ -87,8 +87,8 @@ public:
|
||||||
*/
|
*/
|
||||||
FluxboxWindow *getWindow(unsigned int id);
|
FluxboxWindow *getWindow(unsigned int id);
|
||||||
const FluxboxWindow *getWindow(unsigned int id) const;
|
const FluxboxWindow *getWindow(unsigned int id) const;
|
||||||
const Windows &getWindowList() const { return windowList; }
|
const Windows &getWindowList() const { return m_windowlist; }
|
||||||
Windows &getWindowList() { return windowList; }
|
Windows &getWindowList() { return m_windowlist; }
|
||||||
|
|
||||||
bool isCurrent() const;
|
bool isCurrent() const;
|
||||||
bool isLastWindow(FluxboxWindow *window) const;
|
bool isLastWindow(FluxboxWindow *window) const;
|
||||||
|
@ -114,7 +114,7 @@ private:
|
||||||
static GroupList m_groups; ///< handle auto groupings
|
static GroupList m_groups; ///< handle auto groupings
|
||||||
|
|
||||||
WindowStack stackingList;
|
WindowStack stackingList;
|
||||||
Windows windowList;
|
Windows m_windowlist;
|
||||||
|
|
||||||
std::string m_name; ///< name of this workspace
|
std::string m_name; ///< name of this workspace
|
||||||
unsigned int m_id; ///< id, obsolete, this should be in BScreen
|
unsigned int m_id; ///< id, obsolete, this should be in BScreen
|
||||||
|
|
Loading…
Reference in a new issue