aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/XLayerItem.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/XLayerItem.cc')
-rw-r--r--src/FbTk/XLayerItem.cc94
1 files changed, 0 insertions, 94 deletions
diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc
deleted file mode 100644
index 7f6f594..0000000
--- a/src/FbTk/XLayerItem.cc
+++ /dev/null
@@ -1,94 +0,0 @@
1// XLayerItem.cc for FbTk - fluxbox toolkit
2// Copyright (c) 2003 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
3// and Simon Bowden (rathnor at users.sourceforge.net)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a
6// copy of this software and associated documentation files (the "Software"),
7// to deal in the Software without restriction, including without limitation
8// the rights to use, copy, modify, merge, publish, distribute, sublicense,
9// and/or sell copies of the Software, and to permit persons to whom the
10// Software is furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE.
22
23#include "XLayerItem.hh"
24#include "XLayer.hh"
25
26#include <algorithm>
27
28using namespace FbTk;
29
30XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) :
31 m_layer(&layer) {
32 m_windows.push_back(&win);
33 m_layer->insert(*this);
34}
35
36
37XLayerItem::~XLayerItem() {
38 m_layer->remove(*this);
39}
40
41void XLayerItem::setLayer(XLayer &layer) {
42 // make sure we don't try to set the same layer
43 if (m_layer == &layer)
44 return;
45
46 m_layer->remove(*this);
47 m_layer = &layer;
48 m_layer->insert(*this);
49}
50
51void XLayerItem::raise() {
52 m_layer->raise(*this);
53}
54
55void XLayerItem::lower() {
56 m_layer->lower(*this);
57}
58
59void XLayerItem::tempRaise() {
60 m_layer->tempRaise(*this);
61}
62
63void XLayerItem::raiseLayer() {
64 m_layer->raiseLayer(*this);
65}
66
67void XLayerItem::lowerLayer() {
68 m_layer->lowerLayer(*this);
69}
70
71void XLayerItem::moveToLayer(int layernum) {
72 m_layer->moveToLayer(*this, layernum);
73}
74
75void XLayerItem::addWindow(FbWindow &win) {
76 // I'd like to think we can trust ourselves that it won't be added twice...
77 // Otherwise we're always scanning through the list.
78 m_windows.push_back(&win);
79 m_layer->alignItem(*this);
80}
81
82void XLayerItem::removeWindow(FbWindow &win) {
83 // I'd like to think we can trust ourselves that it won't be added twice...
84 // Otherwise we're always scanning through the list.
85
86 XLayerItem::Windows::iterator it = std::find(m_windows.begin(), m_windows.end(), &win);
87 if (it != m_windows.end())
88 m_windows.erase(it);
89}
90
91void XLayerItem::bringToTop(FbWindow &win) {
92 removeWindow(win);
93 addWindow(win);
94}