aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-11-27 12:20:23 (GMT)
committerfluxgen <fluxgen>2002-11-27 12:20:23 (GMT)
commit06ad66a21153adaf7a8c117106c066e58caa4a8a (patch)
tree05bde5bba229fe582e5f05e22728272362c8a547 /src/Toolbar.hh
parent4ce0b722822e9d4863915eba7a9fd58e25f683f8 (diff)
downloadfluxbox-06ad66a21153adaf7a8c117106c066e58caa4a8a.zip
fluxbox-06ad66a21153adaf7a8c117106c066e58caa4a8a.tar.bz2
cleaning
Diffstat (limited to 'src/Toolbar.hh')
-rw-r--r--src/Toolbar.hh76
1 files changed, 32 insertions, 44 deletions
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index 29756d5..ce7dbd1 100644
--- a/src/Toolbar.hh
+++ b/src/Toolbar.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.hh,v 1.13 2002/11/15 12:04:27 fluxgen Exp $ 25// $Id: Toolbar.hh,v 1.14 2002/11/27 12:20:23 fluxgen Exp $
26 26
27#ifndef TOOLBAR_HH 27#ifndef TOOLBAR_HH
28#define TOOLBAR_HH 28#define TOOLBAR_HH
@@ -31,6 +31,7 @@
31#include "Timer.hh" 31#include "Timer.hh"
32#include "IconBar.hh" 32#include "IconBar.hh"
33 33
34#include <memory>
34 35
35class Toolbar; 36class Toolbar;
36 37
@@ -40,14 +41,13 @@ class Toolbar;
40*/ 41*/
41class Toolbarmenu:public Basemenu { 42class Toolbarmenu:public Basemenu {
42public: 43public:
43 explicit Toolbarmenu(Toolbar *tb); 44 explicit Toolbarmenu(Toolbar &tb);
44 ~Toolbarmenu(); 45 ~Toolbarmenu();
45 #ifdef XINERAMA
46 inline Basemenu *getHeadmenu() { return headmenu; }
47 #endif // XINERAMA
48 46
49 inline Basemenu *getPlacementmenu() { return placementmenu; } 47 inline const Basemenu *headmenu() const { return m_headmenu.get(); }
50 inline const Basemenu *getPlacementmenu() const { return placementmenu; } 48
49 inline Basemenu *placementmenu() { return &m_placementmenu; }
50 inline const Basemenu *placementmenu() const { return &m_placementmenu; }
51 51
52 void reconfigure(); 52 void reconfigure();
53 53
@@ -57,35 +57,31 @@ protected:
57 57
58private: 58private:
59 class Placementmenu : public Basemenu { 59 class Placementmenu : public Basemenu {
60 private: 60 public:
61 Toolbarmenu *toolbarmenu; 61 Placementmenu(Toolbarmenu &tm);
62
63 protected: 62 protected:
64 virtual void itemSelected(int button, unsigned int index); 63 virtual void itemSelected(int button, unsigned int index);
65 64 private:
66 public: 65 Toolbarmenu &m_toolbarmenu;
67 Placementmenu(Toolbarmenu *);
68 }; 66 };
67 friend class Placementmenu;
69 68
70#ifdef XINERAMA
71 class Headmenu : public Basemenu { 69 class Headmenu : public Basemenu {
72 public: 70 public:
73 Headmenu(Toolbarmenu *); 71 Headmenu(Toolbarmenu &tm);
74 private:
75 Toolbarmenu *toolbarmenu;
76
77 protected: 72 protected:
78 virtual void itemSelected(int button, unsigned int index); 73 virtual void itemSelected(int button, unsigned int index);
74 private:
75 Toolbarmenu &m_toolbarmenu;
79 }; 76 };
80 Headmenu *headmenu; 77 std::auto_ptr<Headmenu> m_headmenu;
81 friend class Headmenu; 78 friend class Headmenu;
82#endif // XINERAMA
83 79
84 80
85 Toolbar *toolbar; 81 Toolbar &m_toolbar;
86 Placementmenu *placementmenu; 82 Placementmenu m_placementmenu;
87 83
88 friend class Placementmenu; 84
89 friend class Toolbar; 85 friend class Toolbar;
90 86
91}; 87};
@@ -109,11 +105,7 @@ public:
109 /// remove icon from iconbar 105 /// remove icon from iconbar
110 void delIcon(FluxboxWindow *w); 106 void delIcon(FluxboxWindow *w);
111 107
112 inline Toolbarmenu *getMenu() { return toolbarmenu; } 108 inline const Toolbarmenu &menu() const { return m_toolbarmenu; }
113 inline const Toolbarmenu *getMenu() const { return toolbarmenu; }
114
115 //inline Window getWindowLabel(void) { return frame.window_label; }
116
117 /// are we in workspacename editing? 109 /// are we in workspacename editing?
118 inline bool isEditing() const { return editing; } 110 inline bool isEditing() const { return editing; }
119 /// always on top? 111 /// always on top?
@@ -122,17 +114,17 @@ public:
122 inline bool isHidden() const { return hidden; } 114 inline bool isHidden() const { return hidden; }
123 /// do we auto hide the toolbar? 115 /// do we auto hide the toolbar?
124 inline bool doAutoHide() const { return do_auto_hide; } 116 inline bool doAutoHide() const { return do_auto_hide; }
125 /** 117 /// @return X window of the toolbar
126 @return X window of the toolbar
127 */
128 inline Window getWindowID() const { return frame.window; } 118 inline Window getWindowID() const { return frame.window; }
129 119 inline BScreen *screen() { return m_screen; }
120 inline const BScreen *screen() const { return m_screen; }
130 inline unsigned int width() const { return frame.width; } 121 inline unsigned int width() const { return frame.width; }
131 inline unsigned int height() const { return frame.height; } 122 inline unsigned int height() const { return frame.height; }
132 inline unsigned int getExposedHeight() const { return ((do_auto_hide) ? frame.bevel_w : frame.height); } 123 inline unsigned int exposedHeight() const { return ((do_auto_hide) ? frame.bevel_w : frame.height); }
133 inline int x() const { return ((hidden) ? frame.x_hidden : frame.x); } 124 inline int x() const { return ((hidden) ? frame.x_hidden : frame.x); }
134 inline int y() const { return ((hidden) ? frame.y_hidden : frame.y); } 125 inline int y() const { return ((hidden) ? frame.y_hidden : frame.y); }
135 inline const IconBar *iconBar() const { return iconbar; } 126 /// @return pointer to iconbar if it got one, else 0
127 inline const IconBar *iconBar() const { return m_iconbar.get(); }
136 /** 128 /**
137 @name eventhandlers 129 @name eventhandlers
138 */ 130 */
@@ -155,11 +147,7 @@ public:
155 void edit(); 147 void edit();
156 void reconfigure(); 148 void reconfigure();
157 149
158#ifdef HAVE_STRFTIME
159 void checkClock(bool redraw = false);
160#else // HAVE_STRFTIME
161 void checkClock(bool redraw = false, bool date = false); 150 void checkClock(bool redraw = false, bool date = false);
162#endif // HAVE_STRFTIME
163 151
164 virtual void timeout(); 152 virtual void timeout();
165 153
@@ -189,20 +177,20 @@ private:
189 virtual void timeout(); 177 virtual void timeout();
190 } hide_handler; 178 } hide_handler;
191 179
192 BScreen *screen; 180 BScreen *m_screen;
193 BImageControl *image_ctrl; 181 BImageControl *image_ctrl;
194 BTimer clock_timer, hide_timer; 182 BTimer clock_timer; ///< timer to update clock
195 Toolbarmenu *toolbarmenu; 183 BTimer hide_timer; ///< timer to for auto hide toolbar
196 IconBar *iconbar; 184 Toolbarmenu m_toolbarmenu;
185 std::auto_ptr<IconBar> m_iconbar;
197 186
198 std::string new_workspace_name; ///< temp variable in edit workspace name mode 187 std::string new_workspace_name; ///< temp variable in edit workspace name mode
199 188
200 friend class HideHandler; 189 friend class HideHandler;
201 friend class Toolbarmenu; 190 friend class Toolbarmenu;
202 friend class Toolbarmenu::Placementmenu; 191 friend class Toolbarmenu::Placementmenu;
203 #ifdef XINERAMA 192
204 friend class Toolbarmenu::Headmenu; 193 friend class Toolbarmenu::Headmenu;
205 #endif // XINERAMA
206}; 194};
207 195
208 196