From 813e6c4402b7d13a9e7b1ce3e391bc4c8d894ea3 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Wed, 23 Feb 2011 22:46:13 +0100 Subject: disabled overhead base classes 'FbTk::Layer' and 'FbTk::LayerItem' had to add at various other files as a result of this change. --- src/ClientPattern.cc | 1 + src/FbTk/XLayer.cc | 13 +++++++------ src/FbTk/XLayer.hh | 9 +++++---- src/FbTk/XLayerItem.cc | 18 ++++++++++-------- src/FbTk/XLayerItem.hh | 6 +++--- src/FocusControl.cc | 1 + src/FocusableList.cc | 1 + src/MenuCreator.cc | 1 + src/Toolbar.cc | 1 + 9 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index 3802e59..500574e 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef HAVE_CSTDIO #include #else diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 21790cb..f20f8ff 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc @@ -27,9 +27,9 @@ #include "MultLayers.hh" #include +#include #include -using std::find; using namespace FbTk; #ifdef DEBUG @@ -91,7 +91,7 @@ void XLayer::restack(const std::vector& layers) { std::vector stack; std::vector::const_iterator l; for (l = layers.begin(); l != layers.end(); ++l) { - extract_windows_to_stack((*l)->getItemList(), 0, stack); + extract_windows_to_stack((*l)->itemList(), 0, stack); } if (!stack.empty()) @@ -160,7 +160,7 @@ void XLayer::alignItem(XLayerItem &item) { // Note: some other things effectively assume that the window list is // sorted from highest to lowest // get our item - iterator myit = find(itemList().begin(), itemList().end(), &item); + iterator myit = std::find(itemList().begin(), itemList().end(), &item); iterator it = myit; // go to the one above it in our layer (top is front, so we decrement) @@ -211,7 +211,8 @@ void XLayer::raise(XLayerItem &item) { return; // nothing to do } - iterator it = find(itemList().begin(), itemList().end(), &item); + + iterator it = std::find(itemList().begin(), itemList().end(), &item); if (it != itemList().end()) itemList().erase(it); else { @@ -232,7 +233,7 @@ void XLayer::tempRaise(XLayerItem &item) { if (!m_needs_restack && &item == itemList().front()) return; // nothing to do - iterator it = find(itemList().begin(), itemList().end(), &item); + iterator it = std::find(itemList().begin(), itemList().end(), &item); if (it == itemList().end()) { #ifdef DEBUG cerr<<__FILE__<<"("<<__LINE__<<"): WARNING: raise on item not in layer["< #include namespace FbTk { @@ -31,7 +31,7 @@ namespace FbTk { class MultLayers; class XLayerItem; -class XLayer : public FbTk::LayerBase > { +class XLayer { public: XLayer(MultLayers &manager, int layernum); @@ -49,8 +49,8 @@ public: int countWindows(); void stackBelowItem(XLayerItem &item, XLayerItem *above); XLayerItem *getLowestItem(); - const ItemList &getItemList() const { return itemList(); } - ItemList &getItemList() { return itemList(); } + const ItemList &itemList() const { return m_items; } + ItemList &itemList() { return m_items; } // we redefine these as XLayer has special optimisations, and X restacking needs iterator insert(XLayerItem &item, unsigned int pos=0); @@ -77,6 +77,7 @@ private: MultLayers &m_manager; int m_layernum; bool m_needs_restack; + ItemList m_items; }; } // namespace FbTk diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc index d822590..7f6f594 100644 --- a/src/FbTk/XLayerItem.cc +++ b/src/FbTk/XLayerItem.cc @@ -23,11 +23,13 @@ #include "XLayerItem.hh" #include "XLayer.hh" +#include + using namespace FbTk; XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) : m_layer(&layer) { - m_windows.push_front(&win); + m_windows.push_back(&win); m_layer->insert(*this); } @@ -78,15 +80,15 @@ void XLayerItem::addWindow(FbWindow &win) { } void XLayerItem::removeWindow(FbWindow &win) { - // I'd like to think we can trust ourselves that it won't be added twice... - // Otherwise we're always scanning through the list. + // I'd like to think we can trust ourselves that it won't be added twice... + // Otherwise we're always scanning through the list. - XLayerItem::Windows::iterator it = std::find(m_windows.begin(), m_windows.end(), &win); - if (it != m_windows.end()) - m_windows.erase(it); + XLayerItem::Windows::iterator it = std::find(m_windows.begin(), m_windows.end(), &win); + if (it != m_windows.end()) + m_windows.erase(it); } void XLayerItem::bringToTop(FbWindow &win) { - removeWindow(win); - addWindow(win); + removeWindow(win); + addWindow(win); } diff --git a/src/FbTk/XLayerItem.hh b/src/FbTk/XLayerItem.hh index 8f9aebe..67da511 100644 --- a/src/FbTk/XLayerItem.hh +++ b/src/FbTk/XLayerItem.hh @@ -23,17 +23,17 @@ #ifndef FBTK_XLAYERITEM_HH #define FBTK_XLAYERITEM_HH -#include "LayerItem.hh" #include "XLayer.hh" #include "NotCopyable.hh" +#include namespace FbTk { class FbWindow; -class XLayerItem : public LayerItem, private NotCopyable { +class XLayerItem : private NotCopyable { public: - typedef std::list Windows; + typedef std::vector Windows; XLayerItem(FbWindow &win, XLayer &layer); ~XLayerItem(); diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 9afa605..5bf113f 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -34,6 +34,7 @@ #include #include +#include #ifdef HAVE_CSTRING #include #else diff --git a/src/FocusableList.cc b/src/FocusableList.cc index 77e0a76..748e940 100644 --- a/src/FocusableList.cc +++ b/src/FocusableList.cc @@ -31,6 +31,7 @@ #include "FbTk/MemFun.hh" #include +#include #ifdef HAVE_CSTRING #include diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 63691af..72e55ca 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -54,6 +54,7 @@ #include "FbTk/Transparent.hh" #include +#include using std::cerr; using std::endl; diff --git a/src/Toolbar.cc b/src/Toolbar.cc index ac53af2..26722f7 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -75,6 +75,7 @@ #include #include #include +#include using std::string; using std::pair; -- cgit v0.11.2