aboutsummaryrefslogtreecommitdiff
path: root/src/IconBar.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconBar.hh')
-rw-r--r--src/IconBar.hh72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/IconBar.hh b/src/IconBar.hh
new file mode 100644
index 0000000..f6b7509
--- /dev/null
+++ b/src/IconBar.hh
@@ -0,0 +1,72 @@
1// IconBar.hh
2// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21#ifndef _ICONBAR_HH_
22#define _ICONBAR_HH_
23
24#include <vector>
25#include "Window.hh"
26#include "LinkedList.hh"
27
28class Fluxbox;
29
30class IconBarObj
31{
32public:
33 IconBarObj(FluxboxWindow *fluxboxwin, Window iconwin);
34 ~IconBarObj();
35 inline Window getIconWin(void) { return m_iconwin; }
36 inline FluxboxWindow *getFluxboxWin(void) { return m_fluxboxwin; }
37private:
38 Window m_iconwin;
39 FluxboxWindow *m_fluxboxwin;
40};
41
42typedef LinkedList<IconBarObj> IconList;
43typedef LinkedListIterator<IconBarObj> IconListIterator;
44
45class IconBar
46{
47public:
48 IconBar(BScreen *scrn, Window parent);
49 ~IconBar();
50 void draw();
51 void reconfigure();
52 Window addIcon(FluxboxWindow *fluxboxwin);
53 Window delIcon(FluxboxWindow *fluxboxwin);
54 void buttonPressEvent(XButtonEvent *be);
55 FluxboxWindow *findWindow(Window w);
56 void exposeEvent(XExposeEvent *ee);
57private:
58 void draw(IconBarObj *obj, int width);
59 void loadTheme(unsigned int width, unsigned int height);
60 void decorate(Window win);
61 IconBarObj *findIcon(FluxboxWindow *fluxboxwin);
62 void repositionIcons(void);
63 Window createIconWindow(FluxboxWindow *fluxboxwin, Window parent);
64 BScreen *m_screen;
65 Display *m_display;
66 Window m_parent;
67 IconList *m_iconlist;
68 Pixmap m_focus_pm;
69 unsigned long m_focus_pixel;
70};
71
72#endif // _ICONBAR_HH_