00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef ICONBARTOOL_HH
00026 #define ICONBARTOOL_HH
00027
00028 #include "ToolbarItem.hh"
00029 #include "Container.hh"
00030 #include "FbMenu.hh"
00031
00032 #include "FbTk/Observer.hh"
00033 #include "FbTk/Resource.hh"
00034 #include "FbTk/Menu.hh"
00035
00036 #include <X11/Xlib.h>
00037
00038 #include <list>
00039
00040 class IconbarTheme;
00041 class BScreen;
00042 class IconButton;
00043 class FluxboxWindow;
00044
00045 class IconbarTool: public ToolbarItem, public FbTk::Observer {
00046 public:
00047 typedef std::list<IconButton *> IconList;
00049 enum Mode {
00050 NONE,
00051 ICONS,
00052 WORKSPACEICONS,
00053 WORKSPACE,
00054 ALLWINDOWS
00055 };
00056
00057 IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
00058 BScreen &screen, FbTk::Menu &menu);
00059 ~IconbarTool();
00060
00061 void move(int x, int y);
00062 void resize(unsigned int width, unsigned int height);
00063 void moveResize(int x, int y,
00064 unsigned int width, unsigned int height);
00065
00066 void update(FbTk::Subject *subj);
00067 void show();
00068 void hide();
00069 void setAlignment(Container::Alignment a);
00070 void setMode(Mode mode);
00071
00072 unsigned int width() const;
00073 unsigned int height() const;
00074 unsigned int borderWidth() const;
00075
00076 Mode mode() const { return *m_rc_mode; }
00077 Container::Alignment alignment() const { return m_icon_container.alignment(); }
00078 private:
00080 IconButton *findButton(FluxboxWindow &win);
00081
00083 void renderWindow(FluxboxWindow &win);
00085 void renderButton(IconButton &button);
00087 void renderTheme();
00089 void deleteIcons();
00091 void removeWindow(FluxboxWindow &win);
00093 void addWindow(FluxboxWindow &win);
00095 void updateIcons();
00097 void updateWorkspace();
00099 void updateAllWindows();
00101 void addList(std::list<FluxboxWindow *> &winlist);
00103 void timedRender();
00104
00105 BScreen &m_screen;
00106 Container m_icon_container;
00107 const IconbarTheme &m_theme;
00108
00109 Pixmap m_focused_pm, m_unfocused_pm;
00110
00111 Pixmap m_focused_err_pm, m_unfocused_err_pm;
00112 Pixmap m_empty_pm;
00113
00114
00115 IconList m_icon_list;
00116 FbTk::Resource<Mode> m_rc_mode;
00117 FbTk::Resource<Container::Alignment> m_rc_alignment;
00118 FbTk::Resource<int> m_rc_client_width;
00119 FbTk::Resource<bool> m_rc_use_pixmap;
00120 FbTk::Timer m_focus_timer;
00121 FbMenu m_menu;
00122 };
00123
00124 #endif // ICONBARTOOL_HH