YggdrasilWM
0.1.1
A tiny window manager coded in C++
|
BinarySpace class This class represents a space in the layout. it's designed like a binary tree, with a parent, a right and a left child. Only leaf spaces have clients. More...
#include <BinarySpace.hpp>
Public Member Functions | |
BinarySpace (Point pos, Point size, int index, BinarySpace *parent=nullptr) | |
Construct a new BinarySpace object. More... | |
~BinarySpace ()=default | |
const Point & | getPos () const |
void | setPos (const Point &pos) |
const Point & | getSize () const |
void | setSize (const Point &size) |
int | getSubspaceCount () const |
int | getIndex () const |
void | setIndex (int index) |
BinarySpace * | getParent () const |
void | setParent (BinarySpace *parent) |
const std::unique_ptr< BinarySpace > & | getRight () const |
void | setRight (std::unique_ptr< BinarySpace > right) |
const std::unique_ptr< BinarySpace > & | getLeft () const |
void | setLeft (std::unique_ptr< BinarySpace > left) |
std::shared_ptr< Client > | getClient () const |
void | setClient (std::shared_ptr< Client > client) |
void | incSubSpaceCount () |
Private Attributes | |
Point | pos_ |
Point | size_ |
int | index_ |
int | subspace_count_ |
BinarySpace * | parent_ |
std::unique_ptr< BinarySpace > | right_ |
std::unique_ptr< BinarySpace > | left_ |
std::weak_ptr< Client > | client_ |
BinarySpace class This class represents a space in the layout. it's designed like a binary tree, with a parent, a right and a left child. Only leaf spaces have clients.
create an interface for Spaces and implement it in BinarySpace
redefine BinarySpace not as a nested class but as a separate class
BinarySpace::BinarySpace | ( | Point | pos, |
Point | size, | ||
int | index, | ||
BinarySpace * | parent = nullptr |
||
) |
|
default |
std::shared_ptr< Client > BinarySpace::getClient | ( | ) | const |
References client_.
Referenced by TreeLayoutManager::addClientRecursive(), TreeLayoutManager::findSpaceRecursive(), TreeLayoutManager::growSpace(), TreeLayoutManager::placeClientInSpace(), TreeLayoutManager::recursiveResize(), TreeLayoutManager::recursiveShrinkSiblingSpace(), TreeLayoutManager::removeClientRecursive(), and TreeLayoutManager::splitSpace().
const std::unique_ptr< BinarySpace > & BinarySpace::getLeft | ( | ) | const |
References left_.
Referenced by TreeLayoutManager::addClientRecursive(), TreeLayoutManager::deleteSpace(), TreeLayoutManager::findSpaceRecursive(), TreeLayoutManager::growSpace(), TreeLayoutManager::recursiveResize(), TreeLayoutManager::recursiveShrinkSiblingSpace(), and TreeLayoutManager::removeClientRecursive().
BinarySpace * BinarySpace::getParent | ( | ) | const |
References parent_.
Referenced by TreeLayoutManager::growSpace(), TreeLayoutManager::removeClientRecursive(), and TreeLayoutManager::splitSpace().
const Point & BinarySpace::getPos | ( | ) | const |
References pos_.
Referenced by TreeLayoutManager::growSpace(), TreeLayoutManager::placeClientInSpace(), and TreeLayoutManager::splitSpace().
const std::unique_ptr< BinarySpace > & BinarySpace::getRight | ( | ) | const |
References right_.
Referenced by TreeLayoutManager::addClientRecursive(), TreeLayoutManager::deleteSpace(), TreeLayoutManager::findSpaceRecursive(), TreeLayoutManager::growSpace(), TreeLayoutManager::recursiveResize(), TreeLayoutManager::recursiveShrinkSiblingSpace(), and TreeLayoutManager::removeClientRecursive().
const Point & BinarySpace::getSize | ( | ) | const |
References size_.
Referenced by TreeLayoutManager::addClientRecursive(), TreeLayoutManager::growSpace(), TreeLayoutManager::placeClientInSpace(), TreeLayoutManager::recursiveResize(), TreeLayoutManager::recursiveShrinkSiblingSpace(), and TreeLayoutManager::splitSpace().
int BinarySpace::getSubspaceCount | ( | ) | const |
References subspace_count_.
void BinarySpace::incSubSpaceCount | ( | ) |
References subspace_count_.
Referenced by TreeLayoutManager::splitSpace().
void BinarySpace::setClient | ( | std::shared_ptr< Client > | client | ) |
References client_.
Referenced by TreeLayoutManager::placeClientInSpace(), TreeLayoutManager::removeClientRecursive(), and TreeLayoutManager::splitSpace().
void BinarySpace::setIndex | ( | int | index | ) |
References index_.
void BinarySpace::setLeft | ( | std::unique_ptr< BinarySpace > | left | ) |
References left_.
Referenced by TreeLayoutManager::removeClientRecursive(), and TreeLayoutManager::splitSpace().
void BinarySpace::setParent | ( | BinarySpace * | parent | ) |
References parent_.
void BinarySpace::setPos | ( | const Point & | pos | ) |
References pos_.
Referenced by TreeLayoutManager::growSpace(), and TreeLayoutManager::recursiveResize().
void BinarySpace::setRight | ( | std::unique_ptr< BinarySpace > | right | ) |
References right_.
Referenced by TreeLayoutManager::removeClientRecursive(), and TreeLayoutManager::splitSpace().
void BinarySpace::setSize | ( | const Point & | size | ) |
References size_.
Referenced by TreeLayoutManager::growSpace(), TreeLayoutManager::recursiveResize(), and TreeLayoutManager::recursiveShrinkSiblingSpace().
|
private |
Referenced by getClient(), and setClient().
|
private |
Referenced by getIndex(), and setIndex().
|
private |
|
private |
Referenced by getParent(), and setParent().
|
private |
Referenced by getRight(), and setRight().
|
private |
Referenced by getSubspaceCount(), and incSubSpaceCount().