YggdrasilWM
0.1.1
A tiny window manager coded in C++
|
The Client class is responsible for managing the client windows. It creates a frame around the client window, Map the frame, Add the window to the save set, Reparent it, grab the buttons It also unframe the client window by removing the frame and reparenting the window to the root window It also move, resize, restack the client window. More...
#include <Client.hpp>
Public Member Functions | |
Client (Display *display, Window root, Window window, std::shared_ptr< Group > group, unsigned long inActiveColor, int borderSize, std::shared_ptr< BaseX11Wrapper > wrapper) | |
Client constructor.get window class and title. More... | |
~Client () | |
Client destructor Destroy the Client object & the Frame Window it needed. More... | |
void | frame () |
Client::frame create a frame around the client window, Map the frame, Add the window to the save set Reparent it, grab the buttons. More... | |
void | unframe () |
Client::unframe unframe the client window by removing the frame and reparenting the window to the root window. More... | |
Window | getWindow () const |
Client::getWindow return the window attribute of the client. More... | |
std::shared_ptr< Group > | getGroup () const |
return the group of the client More... | |
void | move (int x, int y) |
: Client::move move the client window to the given position More... | |
void | resize (unsigned int width, unsigned int height) |
Client::resize resize the client window to the given size. More... | |
bool | isFramed () const |
Client::isFramed() check if the client is framed. More... | |
void | setMapped (bool mapped) |
Client::setMapped() set the mapped status of the client. More... | |
bool | isMapped () const |
Client::isMapped() check if the client is mapped. More... | |
const std::string & | getTitle () const |
Client::getTitle() return the title of the client, the title is get during the construction of the client. More... | |
const std::string & | getClass () const |
Client::getClass() return the class of the client, the class is get during the construction of the client. More... | |
Window | getFrame () const |
Client::getFrame() return the frame Window of the client. More... | |
void | restack () |
Client::restack() restack the client window to avoid the frame to get in front of the client. More... | |
void | setGroup (std::shared_ptr< Group > g) |
Private Attributes | |
Display * | display_ |
Window | root_ |
Window | window_ |
Window | frame_ |
unsigned int | border_width |
unsigned long | border_color |
bool | framed |
bool | mapped {} |
std::string | title_ |
std::string | class_ |
std::weak_ptr< Group > | group_ |
std::shared_ptr< BaseX11Wrapper > | wrapper |
The Client class is responsible for managing the client windows. It creates a frame around the client window, Map the frame, Add the window to the save set, Reparent it, grab the buttons It also unframe the client window by removing the frame and reparenting the window to the root window It also move, resize, restack the client window.
Client::Client | ( | Display * | display, |
Window | root, | ||
Window | window, | ||
std::shared_ptr< Group > | group, | ||
unsigned long | inActiveColor, | ||
int | borderSize, | ||
std::shared_ptr< BaseX11Wrapper > | wrapper | ||
) |
Client constructor.get window class and title.
display | X11 display |
root | root window |
window | window to manage |
layout_manager | Reference to the layout manager |
inActiveColor | color of the border |
borderSize | size of the border |
wrapper | X11 wrapper |
References class_, Logger::GetInstance(), L_ERROR, Logger::Log(), title_, and wrapper.
Client::~Client | ( | ) |
void Client::frame | ( | ) |
Client::frame create a frame around the client window, Map the frame, Add the window to the save set Reparent it, grab the buttons.
References border_color, border_width, display_, frame_, framed, ConfigHandler::getConfigData(), ConfigHandler::GetInstance(), Logger::GetInstance(), group_, L_ERROR, Logger::Log(), root_, window_, and wrapper.
const std::string & Client::getClass | ( | ) | const |
Client::getClass() return the class of the client, the class is get during the construction of the client.
References class_.
Window Client::getFrame | ( | ) | const |
Client::getFrame() return the frame Window of the client.
References frame_.
Referenced by EventHandler::handleFocusIn(), EventHandler::handleFocusOut(), and EventHandler::handleMapNotify().
Group * Client::getGroup | ( | ) | const |
return the group of the client
References group_.
Referenced by EventHandler::handleFocusIn(), and EventHandler::handleFocusOut().
const std::string & Client::getTitle | ( | ) | const |
Client::getTitle() return the title of the client, the title is get during the construction of the client.
References title_.
Referenced by EventHandler::handleFocusIn(), EventHandler::handleFocusOut(), and EventHandler::handleMapNotify().
Window Client::getWindow | ( | ) | const |
Client::getWindow return the window attribute of the client.
References window_.
Referenced by Group::removeClient(), and WindowManager::setFocus().
bool Client::isFramed | ( | ) | const |
bool Client::isMapped | ( | ) | const |
void Client::move | ( | int | x, |
int | y | ||
) |
: Client::move move the client window to the given position
x | |
y |
References border_width, display_, frame_, framed, Logger::GetInstance(), L_ERROR, Logger::Log(), window_, and wrapper.
void Client::resize | ( | unsigned int | width, |
unsigned int | height | ||
) |
Client::resize resize the client window to the given size.
width | |
height |
References border_width, display_, frame_, framed, Logger::GetInstance(), L_ERROR, Logger::Log(), window_, and wrapper.
void Client::restack | ( | ) |
Client::restack() restack the client window to avoid the frame to get in front of the client.
References display_, frame_, framed, Logger::GetInstance(), L_ERROR, Logger::Log(), window_, and wrapper.
Referenced by EventHandler::handleMapNotify().
void Client::setGroup | ( | std::shared_ptr< Group > | g | ) |
void Client::setMapped | ( | bool | mapped | ) |
Client::setMapped() set the mapped status of the client.
mapped |
References mapped.
Referenced by EventHandler::handleMapNotify().
void Client::unframe | ( | ) |
Client::unframe unframe the client window by removing the frame and reparenting the window to the root window.
References display_, frame_, framed, Logger::GetInstance(), L_ERROR, Logger::Log(), and wrapper.
|
private |
Referenced by frame().
|
private |
Referenced by Client(), and getClass().
|
private |
|
private |
|
private |
|
private |
Referenced by frame(), getGroup(), and setGroup().
|
private |
Referenced by isMapped(), and setMapped().
|
private |
Referenced by frame().
|
private |
Referenced by Client(), getTitle(), and ~Client().
|
private |
Referenced by frame(), getWindow(), move(), resize(), and restack().
|
private |