statusbar.h (1181B)
1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us> 2 // See LICENSE for license details. 3 4 #ifndef __STATUSBAR_H 5 #define __STATUSBAR_H 6 7 #include "bar.h" 8 9 #include <set> 10 #include <string> 11 #include "wmi.h" 12 13 class Kernel; 14 class Monitor; 15 16 /** 17 * Represents the statusbar of WMI. 18 */ 19 class StatusBar : public Bar { 20 21 public: 22 23 StatusBar(Monitor *monitor, Rectangle *rect); 24 25 ~StatusBar(); 26 27 virtual void illuminate(); 28 29 virtual void handleMotionNotify(XMotionEvent *event); 30 virtual void handleButtonPress(XButtonEvent *event); 31 virtual void handleButtonRelease(XButtonEvent *event); 32 33 void setText(const string text); 34 void setMeterText(const string meterText); 35 36 private: 37 38 unsigned int calculateMetersWidth(); 39 unsigned int calculateWorkspaceWidth(); 40 void invokeClickedThing(int xPosition); 41 42 void updateInputModeButton(unsigned int *offsetX); 43 void updateWorkspacePager(unsigned int *offsetX); 44 void updateDetachedClients(unsigned int *offsetX); 45 void updateStatus(unsigned int *offsetX); 46 void updateMeters(unsigned int offsetX); 47 48 string meterText_; 49 string text_; 50 bool buttonPressed_; 51 }; 52 53 #endif // __STATUSBAR_H