diff options
Diffstat (limited to 'src/FbTk/XLayer.hh')
-rw-r--r-- | src/FbTk/XLayer.hh | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/FbTk/XLayer.hh b/src/FbTk/XLayer.hh new file mode 100644 index 0000000..442f288 --- /dev/null +++ b/src/FbTk/XLayer.hh | |||
@@ -0,0 +1,91 @@ | |||
1 | // XLayer.hh for FbTk - fluxbox toolkit | ||
2 | // Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) | ||
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 | // $Id: XLayer.hh,v 1.5 2003/12/16 17:06:52 fluxgen Exp $ | ||
24 | |||
25 | |||
26 | #ifndef FBTK_XLAYER_HH | ||
27 | #define FBTK_XLAYER_HH | ||
28 | |||
29 | #include <list> | ||
30 | #include "Layer.hh" | ||
31 | #include "MultLayers.hh" | ||
32 | |||
33 | namespace FbTk { | ||
34 | |||
35 | class XLayerItem; | ||
36 | |||
37 | class XLayer : public FbTk::Layer<XLayerItem, std::list<XLayerItem *> > { | ||
38 | public: | ||
39 | |||
40 | XLayer(MultLayers &manager, int layernum); | ||
41 | ~XLayer(); | ||
42 | |||
43 | typedef std::list<XLayerItem *> ItemList; | ||
44 | typedef std::list<XLayerItem *>::iterator iterator; | ||
45 | |||
46 | //typedef std::list<XLayerItem *>::reverse_iterator reverse_iterator; | ||
47 | |||
48 | void setLayerNum(int layernum) { m_layernum = layernum; }; | ||
49 | int getLayerNum() { return m_layernum; }; | ||
50 | void restack(); | ||
51 | int countWindows(); | ||
52 | void stackBelowItem(XLayerItem *item, XLayerItem *above); | ||
53 | XLayerItem *getLowestItem(); | ||
54 | XLayerItem *getItemBelow(XLayerItem &item); | ||
55 | XLayerItem *getItemAbove(XLayerItem &item); | ||
56 | |||
57 | const ItemList &getItemList() const { return itemList(); } | ||
58 | ItemList &getItemList() { return itemList(); } | ||
59 | |||
60 | // we redefine these as XLayer has special optimisations, and X restacking needs | ||
61 | iterator insert(XLayerItem &item, unsigned int pos=0); | ||
62 | void remove(XLayerItem &item); | ||
63 | |||
64 | // move highest to bottom | ||
65 | void cycleUp(); | ||
66 | void cycleDown(); | ||
67 | // just go above the next window up in the current layer (not all the way to the top) | ||
68 | void stepUp(XLayerItem &item); | ||
69 | void stepDown(XLayerItem &item); | ||
70 | |||
71 | // bring to top of layer | ||
72 | void raise(XLayerItem &item); | ||
73 | void lower(XLayerItem &item); | ||
74 | |||
75 | // raise it, but don't make it permanent (i.e. restack will revert) | ||
76 | void tempRaise(XLayerItem &item); | ||
77 | |||
78 | // send to next layer up | ||
79 | void raiseLayer(XLayerItem &item); | ||
80 | void lowerLayer(XLayerItem &item); | ||
81 | void moveToLayer(XLayerItem &item, int layernum); | ||
82 | |||
83 | private: | ||
84 | MultLayers &m_manager; | ||
85 | int m_layernum; | ||
86 | |||
87 | }; | ||
88 | |||
89 | } // namespace FbTk | ||
90 | |||
91 | #endif // FBTK_XLAYER_HH | ||