2002-01-09 14:11:20 +00:00
|
|
|
// IconBar.hh for Fluxbox Window Manager
|
|
|
|
// Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
|
2001-12-11 20:47:02 +00:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
2002-01-09 14:11:20 +00:00
|
|
|
|
2002-10-29 15:52:44 +00:00
|
|
|
// $Id: IconBar.hh,v 1.8 2002/10/29 15:52:44 fluxgen Exp $
|
2002-01-09 14:11:20 +00:00
|
|
|
|
2002-02-17 19:00:24 +00:00
|
|
|
#ifndef ICONBAR_HH
|
|
|
|
#define ICONBAR_HH
|
2001-12-11 20:47:02 +00:00
|
|
|
|
|
|
|
#include "Window.hh"
|
2002-02-04 22:43:15 +00:00
|
|
|
|
|
|
|
#include <list>
|
2001-12-11 20:47:02 +00:00
|
|
|
|
2002-08-04 15:55:13 +00:00
|
|
|
/**
|
|
|
|
Icon object in IconBar
|
|
|
|
*/
|
2001-12-11 20:47:02 +00:00
|
|
|
class IconBarObj
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IconBarObj(FluxboxWindow *fluxboxwin, Window iconwin);
|
|
|
|
~IconBarObj();
|
2002-08-04 15:55:13 +00:00
|
|
|
Window getIconWin() const { return m_iconwin; }
|
|
|
|
FluxboxWindow *getFluxboxWin() { return m_fluxboxwin; }
|
|
|
|
const FluxboxWindow *getFluxboxWin() const { return m_fluxboxwin; }
|
|
|
|
unsigned int width() const;
|
|
|
|
|
2001-12-11 20:47:02 +00:00
|
|
|
private:
|
|
|
|
FluxboxWindow *m_fluxboxwin;
|
2002-01-04 21:21:43 +00:00
|
|
|
Window m_iconwin;
|
2001-12-11 20:47:02 +00:00
|
|
|
};
|
|
|
|
|
2002-08-04 15:55:13 +00:00
|
|
|
/**
|
|
|
|
Icon container
|
|
|
|
*/
|
2001-12-11 20:47:02 +00:00
|
|
|
class IconBar
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IconBar(BScreen *scrn, Window parent);
|
|
|
|
~IconBar();
|
2002-01-04 21:21:43 +00:00
|
|
|
void draw(); //TODO
|
2001-12-11 20:47:02 +00:00
|
|
|
void reconfigure();
|
|
|
|
Window addIcon(FluxboxWindow *fluxboxwin);
|
|
|
|
Window delIcon(FluxboxWindow *fluxboxwin);
|
|
|
|
void buttonPressEvent(XButtonEvent *be);
|
|
|
|
FluxboxWindow *findWindow(Window w);
|
2002-10-29 15:52:44 +00:00
|
|
|
IconBarObj *findIcon(FluxboxWindow * const fluxboxwin);
|
|
|
|
const IconBarObj *findIcon(const FluxboxWindow * const fluxboxwin) const;
|
2001-12-11 20:47:02 +00:00
|
|
|
void exposeEvent(XExposeEvent *ee);
|
2002-01-04 21:21:43 +00:00
|
|
|
|
2002-10-29 15:52:44 +00:00
|
|
|
void draw(const IconBarObj * const obj, int width) const;
|
2001-12-11 20:47:02 +00:00
|
|
|
private:
|
2002-02-04 22:43:15 +00:00
|
|
|
typedef std::list<IconBarObj *> IconList;
|
2001-12-17 19:26:26 +00:00
|
|
|
|
2002-01-04 21:21:43 +00:00
|
|
|
// void draw(IconBarObj *obj, int width);
|
2001-12-11 20:47:02 +00:00
|
|
|
void loadTheme(unsigned int width, unsigned int height);
|
|
|
|
void decorate(Window win);
|
2002-01-04 21:21:43 +00:00
|
|
|
// IconBarObj *findIcon(FluxboxWindow *fluxboxwin);
|
2002-08-04 15:55:13 +00:00
|
|
|
void repositionIcons();
|
2001-12-11 20:47:02 +00:00
|
|
|
Window createIconWindow(FluxboxWindow *fluxboxwin, Window parent);
|
|
|
|
BScreen *m_screen;
|
|
|
|
Display *m_display;
|
|
|
|
Window m_parent;
|
2002-02-04 22:43:15 +00:00
|
|
|
IconList m_iconlist;
|
2001-12-11 20:47:02 +00:00
|
|
|
Pixmap m_focus_pm;
|
|
|
|
unsigned long m_focus_pixel;
|
|
|
|
};
|
|
|
|
|
2002-08-04 15:55:13 +00:00
|
|
|
#endif // ICONBAR_HH
|