![]() |
YggdrasilWM
0.1.1
A tiny window manager coded in C++
|
Groups are defined in the config file. Each group use a specific layout manager and manage it's list of clients, a client can be in multiple groups. More...
#include <Group.hpp>


Public Member Functions | |
| Group (const std::shared_ptr< ConfigDataGroup > &config, std::shared_ptr< BaseX11Wrapper > x11Wrapper, Display *display, Window root) | |
| Group constructor. More... | |
| ~Group () | |
| Group destructor. More... | |
| void | addClient (Window window, std::shared_ptr< Client > client) |
| Add a client to the group. More... | |
| void | removeClient (Window window) |
| Definitely remove a client from the group. More... | |
| void | removeClient (Client *client) |
| Definitely remove a client from the group. More... | |
| void | moveClientToGroup (Window window, Group *group) |
| Move a client to another group. More... | |
| void | setActive (bool active) |
| Set the group as active. More... | |
| bool | isActive () const |
| Check if the group is active. More... | |
| void | setName (std::string name) |
| Set the name of the group. More... | |
| std::string | getName () |
| Get the name of the group. More... | |
| std::shared_ptr< Client > | getClient (Window window) |
| Get a client from the group. More... | |
| std::unordered_map< Window, std::shared_ptr< Client > > | getClients () |
| Get the list of clients of the group. More... | |
| std::shared_ptr< LayoutManager > | getLayoutManager () |
| Get the layout manager of the group. More... | |
| void | switchTo () |
| Switch to this group Set this group as active, switch the layout manager and map the clients. More... | |
| void | switchFrom () |
| Switch from this group Set this group as inactive, switch the layout manager and unmap the clients. More... | |
| int | getBorderSize () const |
| Get the border size of the group. More... | |
| int | getGap () const |
| Get the gap of the group. More... | |
| unsigned long | getInactiveColor () const |
| Get the inactive color of the group. More... | |
| unsigned long | getActiveColor () const |
| Get the active color of the group. More... | |
| void | resize (unsigned int sizeX, unsigned int sizeY, unsigned int posX, unsigned int posY) |
Private Attributes | |
| std::string | name_ |
| std::unordered_map< Window, std::shared_ptr< Client > > | clients_ |
| std::shared_ptr< LayoutManager > | layoutManager_ |
| int | borderSize_ |
| int | gap_ |
| unsigned long | inactiveColor_ |
| unsigned long | activeColor_ |
| int | barHeight_ |
| bool | active_ {} |
| std::shared_ptr< BaseX11Wrapper > | wrapper |
Groups are defined in the config file. Each group use a specific layout manager and manage it's list of clients, a client can be in multiple groups.
|
explicit |
Group constructor.
| name | The name of the group |
| borderSize | The size of the border |
| gap | The gap between the clients |
| barHeight | The height of the bar |
| layoutType | The layout type |
References active_, activeColor_, barHeight_, borderSize_, gap_, Logger::GetInstance(), inactiveColor_, L_INFO, layoutManager_, Logger::Log(), MASTER_HORIZONTAL, MASTER_VERTICAL, MAX, name_, TREE, and wrapper.

| Group::~Group | ( | ) |
Group destructor.
| void Group::addClient | ( | Window | window, |
| std::shared_ptr< Client > | client | ||
| ) |
Add a client to the group.
| window | |
| client |
References clients_, and layoutManager_.
Referenced by moveClientToGroup().

| unsigned long Group::getActiveColor | ( | ) | const |
| int Group::getBorderSize | ( | ) | const |
| Client * Group::getClient | ( | Window | window | ) |
| std::unordered_map< Window, Client * > Group::getClients | ( | ) |
Get the list of clients of the group.
References clients_.
Referenced by switchFrom(), and switchTo().

| unsigned long Group::getInactiveColor | ( | ) | const |
| LayoutManager * Group::getLayoutManager | ( | ) |
| std::string Group::getName | ( | ) |
| bool Group::isActive | ( | ) | const |
| void Group::moveClientToGroup | ( | Window | window, |
| Group * | group | ||
| ) |
Move a client to another group.
| window | |
| group |
References addClient(), clients_, WindowManager::getClient(), Logger::GetInstance(), WindowManager::getInstance(), L_ERROR, and Logger::Log().

| void Group::removeClient | ( | Client * | client | ) |
Definitely remove a client from the group.
| client |
References clients_, Client::getWindow(), and layoutManager_.

| void Group::removeClient | ( | Window | window | ) |
Definitely remove a client from the group.
| window |
References clients_, WindowManager::getClient(), Logger::GetInstance(), WindowManager::getInstance(), L_ERROR, layoutManager_, and Logger::Log().

| void Group::resize | ( | unsigned int | sizeX, |
| unsigned int | sizeY, | ||
| unsigned int | posX, | ||
| unsigned int | posY | ||
| ) |
References layoutManager_.
| void Group::setActive | ( | bool | active | ) |
| void Group::setName | ( | std::string | name | ) |
| void Group::switchFrom | ( | ) |
Switch from this group Set this group as inactive, switch the layout manager and unmap the clients.
References active_, getClients(), Logger::GetInstance(), WindowManager::getInstance(), L_INFO, Logger::Log(), name_, and wrapper.

| void Group::switchTo | ( | ) |
Switch to this group Set this group as active, switch the layout manager and map the clients.
References active_, getClients(), Logger::GetInstance(), WindowManager::getInstance(), L_INFO, Logger::Log(), name_, WindowManager::setActiveGroup(), and wrapper.

|
private |
Referenced by Group(), isActive(), setActive(), switchFrom(), and switchTo().
|
private |
Referenced by getActiveColor(), and Group().
|
private |
Referenced by Group().
|
private |
Referenced by getBorderSize(), and Group().
|
private |
Referenced by addClient(), getClient(), getClients(), moveClientToGroup(), and removeClient().
|
private |
Referenced by getInactiveColor(), and Group().
|
private |
Referenced by addClient(), getLayoutManager(), Group(), removeClient(), and resize().
|
private |
Referenced by getName(), Group(), setName(), switchFrom(), and switchTo().
|
private |
Referenced by Group(), switchFrom(), and switchTo().