YggdrasilWM  0.1.1
A tiny window manager coded in C++
Bar.hpp
Go to the documentation of this file.
1 
25 #ifndef BAR_HPP
26 #define BAR_HPP
27 #include <vector>
28 #include <string>
29 #include <memory>
30 #include <unordered_map>
31 extern "C" {
32 #include <X11/Xlib.h>
33 }
34 
35 class ConfigDataBar;
36 class ConfigDataWidget;
37 class Widget;
38 class TSBarsData;
39 
40 class Bar
41 {
42 public:
43  Bar();
44  ~Bar();
45  void init(std::shared_ptr<ConfigDataBar> configData, std::shared_ptr<TSBarsData> tsData);
46  void draw();
47  Window getWindow() const;
48  unsigned int getSizeX() const;
49  unsigned int getSizeY() const;
50  void addWidget(void *handle, std::shared_ptr<ConfigDataWidget>);
51  const std::unordered_map<Window, Widget *> &getWidgets() const;
52 
53 private:
54  std::shared_ptr<ConfigDataBar> configData;
55  std::unordered_map<Window, Widget *> widgets;
56  std::shared_ptr<TSBarsData> tsData;
57  Display *display;
58  Window window;
59  Window root;
60  unsigned int sizeX;
61  unsigned int sizeY;
62  int pos;
63  unsigned long BGColor;
64  unsigned long FGColor;
65  unsigned long borderColor;
66  unsigned int borderSize;
67  std::string font;
68 };
69 #endif // BAR_HPP
Definition: Bar.hpp:41
void addWidget(void *handle, std::shared_ptr< ConfigDataWidget >)
Definition: Bar.cpp:116
Window window
Definition: Bar.hpp:58
std::shared_ptr< ConfigDataBar > configData
Definition: Bar.hpp:54
unsigned long BGColor
Definition: Bar.hpp:63
std::shared_ptr< TSBarsData > tsData
Definition: Bar.hpp:56
unsigned int getSizeX() const
Definition: Bar.cpp:108
std::unordered_map< Window, Widget * > widgets
Definition: Bar.hpp:55
Window root
Definition: Bar.hpp:59
unsigned long FGColor
Definition: Bar.hpp:64
unsigned long borderColor
Definition: Bar.hpp:65
unsigned int sizeY
Definition: Bar.hpp:61
Window getWindow() const
Definition: Bar.cpp:104
unsigned int getSizeY() const
Definition: Bar.cpp:112
const std::unordered_map< Window, Widget * > & getWidgets() const
Definition: Bar.cpp:147
~Bar()
Definition: Bar.cpp:38
Bar()
Definition: Bar.cpp:32
void init(std::shared_ptr< ConfigDataBar > configData, std::shared_ptr< TSBarsData > tsData)
Definition: Bar.cpp:49
std::string font
Definition: Bar.hpp:67
unsigned int sizeX
Definition: Bar.hpp:60
Display * display
Definition: Bar.hpp:57
void draw()
Definition: Bar.cpp:94
unsigned int borderSize
Definition: Bar.hpp:66
int pos
Definition: Bar.hpp:62
ConfigDataBar class Contains the configuration data for one bar in the window manager Inherits from C...
Definition: ConfigDataBar.hpp:41
Definition: ConfigDataWidget.hpp:33
Definition: TSBarsData.hpp:32
Definition: Widget.hpp:33