aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/XLayerItem.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-03 13:43:46 (GMT)
committerfluxgen <fluxgen>2003-02-03 13:43:46 (GMT)
commit4870c5f0913dd212837c4970e14510520d7bcd84 (patch)
tree6eba000279c98b01654d07d9dd715240b345054b /src/FbTk/XLayerItem.cc
parentb8cc8770e8b36fdc054575cc921cdcfab56c2eaf (diff)
downloadfluxbox_pavel-4870c5f0913dd212837c4970e14510520d7bcd84.zip
fluxbox_pavel-4870c5f0913dd212837c4970e14510520d7bcd84.tar.bz2
cleaning
Diffstat (limited to 'src/FbTk/XLayerItem.cc')
-rw-r--r--src/FbTk/XLayerItem.cc43
1 files changed, 12 insertions, 31 deletions
diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc
index 872216b..f959c5e 100644
--- a/src/FbTk/XLayerItem.cc
+++ b/src/FbTk/XLayerItem.cc
@@ -20,32 +20,31 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: XLayerItem.cc,v 1.3 2003/02/02 16:32:41 rathnor Exp $ 23// $Id: XLayerItem.cc,v 1.4 2003/02/03 13:43:46 fluxgen Exp $
24 24
25#include "XLayerItem.hh" 25#include "XLayerItem.hh"
26#include "XLayer.hh" 26#include "XLayer.hh"
27 27
28using namespace FbTk; 28using namespace FbTk;
29 29
30XLayerItem::XLayerItem(Window win) : 30XLayerItem::XLayerItem(Window win, XLayer &layer) :
31 m_layer(0), m_layeriterator(0) { 31 m_layer(&layer), m_layeriterator(0) {
32 m_windows.push_front(win); 32 m_window = win;
33} 33}
34 34
35/*
36XLayerItem::XLayerItem(XLayer &layer):
37 m_layer(&layer) {
38 m_layeriterator = layer.insert(*this);
39 }*/
40 35
41XLayerItem::~XLayerItem() { 36XLayerItem::~XLayerItem() {
42 if (m_layer) 37 m_layer->remove(*this);
43 m_layer->remove(*this);
44} 38}
45 39
46void XLayerItem::setLayer(XLayer *layer) { 40void XLayerItem::setLayer(XLayer &layer) {
47 // make sure we don't try to set the same layer 41 // make sure we don't try to set the same layer
48 m_layer = layer; 42 if (m_layer == &layer)
43 return;
44
45 m_layer->remove(*this);
46 m_layer = &layer;
47 m_layer->insert(*this);
49} 48}
50 49
51void XLayerItem::raise() { 50void XLayerItem::raise() {
@@ -64,21 +63,3 @@ void XLayerItem::stepDown() {
64 m_layer->stepDown(*this); 63 m_layer->stepDown(*this);
65} 64}
66 65
67void XLayerItem::addWindow(Window win) {
68 // I'd like to think we can trust ourselves that it won't be added twice...
69 // Otherwise we're always scanning through the list.
70 m_windows.push_back(win);
71}
72
73void XLayerItem::removeWindow(Window win) {
74 // I'd like to think we can trust ourselves that it won't be added twice...
75 // Otherwise we're always scanning through the list.
76
77 XLayerItem::Windows::iterator it = std::find(m_windows.begin(), m_windows.end(), win);
78 m_windows.erase(it);
79}
80
81void XLayerItem::bringToTop(Window win) {
82 removeWindow(win);
83 addWindow(win);
84}