aboutsummaryrefslogtreecommitdiff
path: root/src/IconbarTool.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconbarTool.hh')
-rw-r--r--src/IconbarTool.hh33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
index 3512f78..323c714 100644
--- a/src/IconbarTool.hh
+++ b/src/IconbarTool.hh
@@ -41,7 +41,7 @@
41class IconbarTheme; 41class IconbarTheme;
42class BScreen; 42class BScreen;
43class IconButton; 43class IconButton;
44class FluxboxWindow; 44class Focusable;
45 45
46class IconbarTool: public ToolbarItem, public FbTk::Observer { 46class IconbarTool: public ToolbarItem, public FbTk::Observer {
47public: 47public:
@@ -57,13 +57,6 @@ public:
57 ALLWINDOWS ///< all windows and all icons from all workspaces 57 ALLWINDOWS ///< all windows and all icons from all workspaces
58 }; 58 };
59 59
60 /// wheeling on iconbutton
61 enum WheelMode {
62 OFF, ///< no wheeling, default mode
63 ON, ///< enabled wheeling
64 SCREEN ///< in perfect harmony with desktopwheeling-value
65 };
66
67 IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, 60 IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
68 BScreen &screen, FbTk::Menu &menu); 61 BScreen &screen, FbTk::Menu &menu);
69 ~IconbarTool(); 62 ~IconbarTool();
@@ -85,60 +78,48 @@ public:
85 unsigned int borderWidth() const; 78 unsigned int borderWidth() const;
86 79
87 Mode mode() const { return *m_rc_mode; } 80 Mode mode() const { return *m_rc_mode; }
88 WheelMode wheelMode() const { return *m_wheel_mode; }
89 81
90 void setOrientation(FbTk::Orientation orient); 82 void setOrientation(FbTk::Orientation orient);
91 Container::Alignment alignment() const { return m_icon_container.alignment(); } 83 Container::Alignment alignment() const { return m_icon_container.alignment(); }
92 84
85 const BScreen &screen() const { return m_screen; }
93private: 86private:
94 87
95 /// @return button associated with window 88 /// @return button associated with window
96 IconButton *findButton(FluxboxWindow &win); 89 IconButton *findButton(Focusable &win);
97 90
98 void updateSizing(); 91 void updateSizing();
99 92
100 /// render single button that holds win
101 // void renderWindow(FluxboxWindow &win);
102 /// render single button, and probably apply changes (clear) 93 /// render single button, and probably apply changes (clear)
103 /// @param button the button to render 94 /// @param button the button to render
104 /// @param clear if the window should be cleared first 95 /// @param clear if the window should be cleared first
105 /// @param focusOption -1 = use window focus, 0 = render no focus, 1 = render focus 96 void renderButton(IconButton &button, bool clear = true);
106 void renderButton(IconButton &button, bool clear = true,
107 int focusOption = -1);
108 /// render all buttons 97 /// render all buttons
109 void renderTheme(); 98 void renderTheme();
110 void renderTheme(unsigned char alpha); 99 void renderTheme(unsigned char alpha);
111 /// destroy all icons 100 /// destroy all icons
112 void deleteIcons(); 101 void deleteIcons();
113 /// remove a single window 102 /// remove a single window
114 void removeWindow(FluxboxWindow &win); 103 void removeWindow(Focusable &win);
115 /// add a single window 104 /// add a single window
116 void addWindow(FluxboxWindow &win); 105 void addWindow(Focusable &win);
117 /// add icons to the list 106 /// add icons to the list
118 void updateList(); 107 void updateList();
119 /// check if window is already in the list 108 /// check if window is already in the list
120 bool checkDuplicate(FluxboxWindow &win); 109 bool checkDuplicate(Focusable &win);
121 /// so we can update current window without flicker
122 void timedRender();
123 110
124 BScreen &m_screen; 111 BScreen &m_screen;
125 Container m_icon_container; 112 Container m_icon_container;
126 IconbarTheme &m_theme; 113 IconbarTheme &m_theme;
127 // cached pixmaps
128 FbTk::CachedPixmap m_focused_pm, m_unfocused_pm;
129 // some are a fraction bigger due to rounding
130 FbTk::CachedPixmap m_focused_err_pm, m_unfocused_err_pm;
131 FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container 114 FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container
132 115
133 116
134 IconList m_icon_list; 117 IconList m_icon_list;
135 FbTk::Resource<Mode> m_rc_mode; 118 FbTk::Resource<Mode> m_rc_mode;
136 FbTk::Resource<WheelMode> m_wheel_mode;
137 FbTk::Resource<Container::Alignment> m_rc_alignment; ///< alignment of buttons 119 FbTk::Resource<Container::Alignment> m_rc_alignment; ///< alignment of buttons
138 FbTk::Resource<int> m_rc_client_width; ///< size of client button in LEFT/RIGHT mode 120 FbTk::Resource<int> m_rc_client_width; ///< size of client button in LEFT/RIGHT mode
139 FbTk::Resource<unsigned int> m_rc_client_padding; ///< padding of the text 121 FbTk::Resource<unsigned int> m_rc_client_padding; ///< padding of the text
140 FbTk::Resource<bool> m_rc_use_pixmap; ///< if iconbar should use win pixmap or not 122 FbTk::Resource<bool> m_rc_use_pixmap; ///< if iconbar should use win pixmap or not
141 FbTk::Timer m_focus_timer; ///< so we can update current window without flicker while changing attached clients
142 FbMenu m_menu; 123 FbMenu m_menu;
143 unsigned char m_alpha; 124 unsigned char m_alpha;
144}; 125};