diff options
Diffstat (limited to 'src/FbTk/XLayerItem.hh')
-rw-r--r-- | src/FbTk/XLayerItem.hh | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/FbTk/XLayerItem.hh b/src/FbTk/XLayerItem.hh new file mode 100644 index 0000000..bf53aa6 --- /dev/null +++ b/src/FbTk/XLayerItem.hh | |||
@@ -0,0 +1,88 @@ | |||
1 | // XLayerItem.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: XLayerItem.hh,v 1.7 2003/04/15 23:09:26 rathnor Exp $ | ||
24 | |||
25 | #ifndef FBTK_XLAYERITEM_HH | ||
26 | #define FBTK_XLAYERITEM_HH | ||
27 | |||
28 | #include "LayerItem.hh" | ||
29 | #include "XLayer.hh" | ||
30 | #include "NotCopyable.hh" | ||
31 | #include "FbWindow.hh" | ||
32 | |||
33 | #include <X11/Xlib.h> | ||
34 | |||
35 | |||
36 | namespace FbTk { | ||
37 | |||
38 | class XLayerItem : public LayerItem, private NotCopyable { | ||
39 | public: | ||
40 | typedef std::list<FbWindow *> Windows; | ||
41 | |||
42 | XLayerItem(FbWindow &win, XLayer &layer); | ||
43 | ~XLayerItem(); | ||
44 | |||
45 | void setLayer(XLayer &layer); | ||
46 | |||
47 | void raise(); | ||
48 | void lower(); | ||
49 | void tempRaise(); // this raise gets reverted by a restack() | ||
50 | |||
51 | // go above the next item visible in this layer | ||
52 | void stepUp(); | ||
53 | void stepDown(); | ||
54 | |||
55 | // send to next layer up | ||
56 | void raiseLayer(); | ||
57 | void lowerLayer(); | ||
58 | void moveToLayer(int layernum); | ||
59 | |||
60 | // this is needed for step and cycle functions | ||
61 | // (you need to know the next one visible, otherwise nothing may appear to happen) | ||
62 | // not yet implemented | ||
63 | bool visible() const { return true; } | ||
64 | |||
65 | const XLayer &getLayer() const { return *m_layer; } | ||
66 | XLayer &getLayer() { return *m_layer; } | ||
67 | int getLayerNum() { return m_layer->getLayerNum(); } | ||
68 | |||
69 | // an XLayerItem holds several windows that are equivalent in a layer | ||
70 | // (i.e. if one is raised, then they should all be). | ||
71 | void addWindow(FbWindow &win); | ||
72 | void removeWindow(FbWindow &win); | ||
73 | |||
74 | // using this you can bring one window to the top of this item (equivalent to add then remove) | ||
75 | void bringToTop(FbWindow &win); | ||
76 | |||
77 | Windows &getWindows() { return m_windows; } | ||
78 | size_t numWindows() const { return m_windows.size(); } | ||
79 | |||
80 | private: | ||
81 | XLayer *m_layer; | ||
82 | XLayer::iterator m_layeriterator; | ||
83 | Windows m_windows; | ||
84 | }; | ||
85 | |||
86 | }; | ||
87 | |||
88 | #endif // FBTK_XLAYERITEM_HH | ||