YggdrasilWM  0.1.1
A tiny window manager coded in C++
LayoutManager.hpp
Go to the documentation of this file.
1 
29 #ifndef YGGDRASILWM_LAYOUTMANAGER_HPP
30 #define YGGDRASILWM_LAYOUTMANAGER_HPP
31 
32 #include <memory>
33 #include <stdexcept>
34 #include "Client.hpp"
35 #include "Layouts/Point.hpp"
36 class BaseX11Wrapper;
43 public:
57  LayoutManager(Display* display,
58  Window root,
59  int size_x,
60  int size_y,
61  int pos_x,
62  int pos_y,
63  int gap,
64  int border_size);
65  virtual ~LayoutManager() = default;
70  virtual void updateGeometry(unsigned int sizeX, unsigned int sizeY, unsigned int posX, unsigned int posY) = 0;
71  virtual void reSize(const Point &size, const Point &pos) = 0;
77  virtual void addClient(std::shared_ptr<Client> client) = 0;
83  virtual void removeClient(Client* client) = 0;
84 protected:
87  int gap_;
90  Display *display_;
91  Window rootWindow_;
92 };
93 #endif //YGGDRASILWM_LAYOUTMANAGER_HPP
This class is responsible for managing the client windows.
Definition: baseX11Wrapper.hpp:37
The Client class is responsible for managing the client windows. It creates a frame around the client...
Definition: Client.hpp:47
LayoutManager class Interface for the layout managers.
Definition: LayoutManager.hpp:42
int space_count_
Definition: LayoutManager.hpp:89
int gap_
Definition: LayoutManager.hpp:87
int border_size_
Definition: LayoutManager.hpp:88
int screen_height_
Definition: LayoutManager.hpp:86
virtual void reSize(const Point &size, const Point &pos)=0
Display * display_
Definition: LayoutManager.hpp:90
virtual ~LayoutManager()=default
virtual void removeClient(Client *client)=0
remove a client from the layout
LayoutManager(Display *display, Window root, int size_x, int size_y, int pos_x, int pos_y, int gap, int border_size)
Construct a new LayoutManager object.
Definition: LayoutManager.cpp:29
virtual void addClient(std::shared_ptr< Client > client)=0
add a client to the layout
int screen_width_
Definition: LayoutManager.hpp:85
Window rootWindow_
Definition: LayoutManager.hpp:91
virtual void updateGeometry(unsigned int sizeX, unsigned int sizeY, unsigned int posX, unsigned int posY)=0
update the geometry of the layout used to resize the layout
Point struct This struct represents a 2D point.
Definition: Point.hpp:8