-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
286 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Yb dP 8 w 8 Yb dP 8b d8 | ||
* YbdP .d88 .d88 .d88 8d8b .d88 d88b w 8 Yb db dP 8YbmdP8 | ||
* YP 8 8 8 8 8 8 8P 8 8 `Yb. 8 8 YbdPYbdP 8 " 8 | ||
* 88 `Y88 `Y88 `Y88 8 `Y88 Y88P 8 8 YP YP 8 8 | ||
* wwdP wwdP | ||
* Yggdrasil Window Manager | ||
* https://github.com/corecaps/YggdrasilWM | ||
* Copyright (C) 2024 jgarcia <[email protected]> <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* @file MasterLayoutManager.hpp | ||
* @brief handle Master Style Layout. | ||
* @date 2024-03-21 | ||
*/ | ||
#ifndef YGGDRASILWM_MASTERLAYOUTMANAGER_HPP | ||
#define YGGDRASILWM_MASTERLAYOUTMANAGER_HPP | ||
#include "Layouts/LayoutManager.hpp" | ||
class MasterSpace; | ||
class MasterLayoutManager : public LayoutManager { | ||
MasterLayoutManager(Display* display, | ||
Window root, | ||
int sizeX, | ||
int sizeY, | ||
int posX, | ||
int posY, | ||
int borderSize, | ||
int gap, | ||
int barHeight); | ||
~MasterLayoutManager() override = default; | ||
void updateGeometry(unsigned int sizeX, unsigned int sizeY, unsigned int posX, unsigned int posY) override; | ||
void reSize(const Point &size,const Point &pos) override; | ||
void addClient(std::shared_ptr<Client> client) override; | ||
void removeClient(Client *client) override; | ||
private: | ||
std::unique_ptr<MasterSpace> rootSpace_; | ||
}; | ||
|
||
#endif // YGGDRASILWM_MASTERLAYOUTMANAGER_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Yb dP 8 w 8 Yb dP 8b d8 | ||
* YbdP .d88 .d88 .d88 8d8b .d88 d88b w 8 Yb db dP 8YbmdP8 | ||
* YP 8 8 8 8 8 8 8P 8 8 `Yb. 8 8 YbdPYbdP 8 " 8 | ||
* 88 `Y88 `Y88 `Y88 8 `Y88 Y88P 8 8 YP YP 8 8 | ||
* wwdP wwdP | ||
* Yggdrasil Window Manager | ||
* https://github.com/corecaps/YggdrasilWM | ||
* Copyright (C) 2024 jgarcia <[email protected]> <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* @file MasterSpace.hpp | ||
* @brief MasterSpace class header. | ||
* @date 2024-03-21 | ||
*/ | ||
|
||
#ifndef YGGDRASILWM_MASTERSPACE_HPP | ||
#define YGGDRASILWM_MASTERSPACE_HPP | ||
#include "Layouts/Point.hpp" | ||
#include <memory> | ||
#include <vector> | ||
class Client; | ||
class MasterSpace { | ||
public: | ||
MasterSpace(Point pos, | ||
Point size, | ||
int index, | ||
bool master, | ||
bool vertical, | ||
MasterSpace* parent = nullptr); | ||
~MasterSpace(); | ||
const Point &getPos() const; | ||
void setPos(const Point &pos); | ||
const Point &getSize() const; | ||
void setSize(const Point &size); | ||
bool isMaster() const; | ||
void setIsMaster(bool isMaster); | ||
bool isVertical() const; | ||
void setIsVertical(bool isVertical); | ||
int getIndex() const; | ||
void setIndex(int index); | ||
int getSubspaceCount() const; | ||
void setSubspaceCount(int subspaceCount); | ||
MasterSpace *getParent() const; | ||
void setParent(MasterSpace *parent); | ||
MasterSpace *getMaster() const; | ||
void setMaster(std::unique_ptr<MasterSpace>master); | ||
const std::vector<std::unique_ptr<MasterSpace>> &getSlaves() const; | ||
const std::weak_ptr<Client> &getClient() const; | ||
|
||
void setClient(const std::weak_ptr<Client> &client); | ||
|
||
private: | ||
Point pos_; | ||
Point size_; | ||
bool is_master_; | ||
bool is_vertical_; | ||
int index_; | ||
int subspace_count_; | ||
MasterSpace* parent_; | ||
std::unique_ptr<MasterSpace> master_; | ||
std::vector<std::unique_ptr<MasterSpace>> slaves_; | ||
std::weak_ptr<Client> client_; | ||
}; | ||
#endif //YGGDRASILWM_MASTERSPACE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Yb dP 8 w 8 Yb dP 8b d8 | ||
* YbdP .d88 .d88 .d88 8d8b .d88 d88b w 8 Yb db dP 8YbmdP8 | ||
* YP 8 8 8 8 8 8 8P 8 8 `Yb. 8 8 YbdPYbdP 8 " 8 | ||
* 88 `Y88 `Y88 `Y88 8 `Y88 Y88P 8 8 YP YP 8 8 | ||
* wwdP wwdP | ||
* Yggdrasil Window Manager | ||
* https://github.com/corecaps/YggdrasilWM | ||
* Copyright (C) 2024 jgarcia <[email protected]> <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* @file MasterLayoutManager.cpp | ||
* @brief handle Master Style Layout. | ||
* @date 2024-03-21 | ||
*/ | ||
|
||
#include "Layouts/MasterLayoutManager.hpp" | ||
#include "Layouts/MasterSpace.hpp" | ||
|
||
void MasterLayoutManager::removeClient(Client *client) { | ||
|
||
} | ||
|
||
void MasterLayoutManager::addClient(std::shared_ptr<Client> client) { | ||
|
||
} | ||
|
||
void MasterLayoutManager::reSize(const Point &size, const Point &pos) { | ||
|
||
} | ||
|
||
void MasterLayoutManager::updateGeometry(unsigned int sizeX, unsigned int sizeY, unsigned int posX, unsigned int posY) { | ||
|
||
} | ||
|
||
MasterLayoutManager::MasterLayoutManager(Display *display, | ||
Window root, | ||
int sizeX, | ||
int sizeY, | ||
int posX, | ||
int posY, | ||
int borderSize, | ||
int gap, | ||
int barHeight) : | ||
LayoutManager(display,root,sizeX,sizeY,posX,posY,gap,barHeight) { | ||
Point pos(posX, posY); | ||
Point size(sizeX - borderSize, sizeY - borderSize); | ||
this->rootSpace_ = std::make_unique<MasterSpace>(pos, size,0, true, true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Yb dP 8 w 8 Yb dP 8b d8 | ||
* YbdP .d88 .d88 .d88 8d8b .d88 d88b w 8 Yb db dP 8YbmdP8 | ||
* YP 8 8 8 8 8 8 8P 8 8 `Yb. 8 8 YbdPYbdP 8 " 8 | ||
* 88 `Y88 `Y88 `Y88 8 `Y88 Y88P 8 8 YP YP 8 8 | ||
* wwdP wwdP | ||
* Yggdrasil Window Manager | ||
* https://github.com/corecaps/YggdrasilWM | ||
* Copyright (C) 2024 jgarcia <[email protected]> <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* @file MasterSpace.cpp | ||
* @brief MasterSpace class implementation. | ||
* @date 2024-03-21 | ||
*/ | ||
#include "Layouts/MasterSpace.hpp" | ||
|
||
MasterSpace::MasterSpace(Point pos, | ||
Point size, | ||
int index, | ||
bool master, | ||
bool vertical, | ||
MasterSpace *parent) : | ||
pos_(pos), | ||
size_(size), | ||
index_(index), | ||
is_master_(master), | ||
is_vertical_(vertical), | ||
subspace_count_(0){ | ||
if (parent) { | ||
parent_ = parent; | ||
} | ||
} | ||
MasterSpace::~MasterSpace() = default; | ||
const Point &MasterSpace::getPos() const { return pos_; } | ||
void MasterSpace::setPos(const Point &pos) { pos_ = pos; } | ||
const Point &MasterSpace::getSize() const { return size_; } | ||
void MasterSpace::setSize(const Point &size) { size_ = size; } | ||
bool MasterSpace::isMaster() const { return is_master_; } | ||
void MasterSpace::setIsMaster(bool isMaster) { is_master_ = isMaster; } | ||
bool MasterSpace::isVertical() const { return is_vertical_; } | ||
void MasterSpace::setIsVertical(bool isVertical) { is_vertical_ = isVertical; } | ||
int MasterSpace::getIndex() const { return index_; } | ||
void MasterSpace::setIndex(int index) { index_ = index; } | ||
int MasterSpace::getSubspaceCount() const { return subspace_count_; } | ||
void MasterSpace::setSubspaceCount(int subspaceCount) { subspace_count_ = subspaceCount; } | ||
MasterSpace *MasterSpace::getParent() const { return parent_; } | ||
void MasterSpace::setParent(MasterSpace *parent) { parent_ = parent; } | ||
MasterSpace *MasterSpace::getMaster() const { return master_.get(); } | ||
void MasterSpace::setMaster(std::unique_ptr<MasterSpace> master) { master_ = std::move(master); } | ||
const std::vector<std::unique_ptr<MasterSpace>> &MasterSpace::getSlaves() const { return slaves_; } | ||
const std::weak_ptr<Client> &MasterSpace::getClient() const { return client_; } | ||
void MasterSpace::setClient(const std::weak_ptr<Client> &client) { client_ = client; } |
Oops, something went wrong.