Fix unclear/missing parameter names in Hy3Layout.hpp

This commit is contained in:
outfoxxed 2023-06-28 16:24:10 -07:00
parent c087452a8f
commit 98165c5b2f
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
2 changed files with 36 additions and 34 deletions

View file

@ -109,7 +109,7 @@ bool Hy3NodeData::operator==(const Hy3NodeData& rhs) const { return this == &rhs
bool Hy3Node::operator==(const Hy3Node& rhs) const { return this->data == rhs.data; } bool Hy3Node::operator==(const Hy3Node& rhs) const { return this->data == rhs.data; }
void Hy3Node::recalcSizePosRecursive(bool force) { void Hy3Node::recalcSizePosRecursive(bool no_animation) {
// clang-format off // clang-format off
static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue; static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue; static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
@ -138,7 +138,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
if (this->data.type != Hy3NodeData::Group) { if (this->data.type != Hy3NodeData::Group) {
this->data.as_window->setHidden(this->hidden); this->data.as_window->setHidden(this->hidden);
this->layout->applyNodeDataToWindow(this, force); this->layout->applyNodeDataToWindow(this, no_animation);
return; return;
} }
@ -178,7 +178,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
child->setHidden(this->hidden); child->setHidden(this->hidden);
child->recalcSizePosRecursive(force); child->recalcSizePosRecursive(no_animation);
this->updateTabBar(); this->updateTabBar();
return; return;
} }
@ -214,7 +214,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
child->position.y = tpos.y; child->position.y = tpos.y;
child->size.y = tsize.y; child->size.y = tsize.y;
child->setHidden(this->hidden); child->setHidden(this->hidden);
child->recalcSizePosRecursive(force); child->recalcSizePosRecursive(no_animation);
break; break;
case Hy3GroupLayout::SplitV: case Hy3GroupLayout::SplitV:
child->position.y = tpos.y + offset; child->position.y = tpos.y + offset;
@ -223,7 +223,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
child->position.x = tpos.x; child->position.x = tpos.x;
child->size.x = tsize.x; child->size.x = tsize.x;
child->setHidden(this->hidden); child->setHidden(this->hidden);
child->recalcSizePosRecursive(force); child->recalcSizePosRecursive(no_animation);
break; break;
case Hy3GroupLayout::Tabbed: case Hy3GroupLayout::Tabbed:
child->position.y = tpos.y + tab_height_offset; child->position.y = tpos.y + tab_height_offset;
@ -232,7 +232,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
child->size.x = tsize.x; child->size.x = tsize.x;
bool hidden = this->hidden || group->focused_child != child; bool hidden = this->hidden || group->focused_child != child;
child->setHidden(hidden); child->setHidden(hidden);
child->recalcSizePosRecursive(force); child->recalcSizePosRecursive(no_animation);
break; break;
} }
@ -645,9 +645,11 @@ Hy3Node* Hy3Layout::getNodeFromWindow(CWindow* window) {
return nullptr; return nullptr;
} }
Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& id) { Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& workspace) {
for (auto& node: this->nodes) { for (auto& node: this->nodes) {
if (node.workspace_id == id && node.parent == nullptr && node.data.type == Hy3NodeData::Group) { if (node.workspace_id == workspace && node.parent == nullptr
&& node.data.type == Hy3NodeData::Group)
{
return &node; return &node;
} }
} }
@ -655,13 +657,13 @@ Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& id) {
return nullptr; return nullptr;
} }
Hy3Node* Hy3Layout::getWorkspaceFocusedNode(const int& id) { Hy3Node* Hy3Layout::getWorkspaceFocusedNode(const int& workspace) {
auto* rootNode = this->getWorkspaceRootGroup(id); auto* rootNode = this->getWorkspaceRootGroup(workspace);
if (rootNode == nullptr) return nullptr; if (rootNode == nullptr) return nullptr;
return rootNode->getFocusedNode(); return rootNode->getFocusedNode();
} }
void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool force) { void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
if (node->data.type != Hy3NodeData::Window) return; if (node->data.type != Hy3NodeData::Window) return;
CWindow* window = node->data.as_window; CWindow* window = node->data.as_window;
@ -744,7 +746,7 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool force) {
g_pXWaylandManager->setWindowSize(window, calcSize); g_pXWaylandManager->setWindowSize(window, calcSize);
if (force) { if (no_animation) {
g_pHyprRenderer->damageWindow(window); g_pHyprRenderer->damageWindow(window);
window->m_vRealPosition.warp(); window->m_vRealPosition.warp();

View file

@ -75,8 +75,8 @@ public:
Hy3NodeData(); Hy3NodeData();
~Hy3NodeData(); ~Hy3NodeData();
Hy3NodeData(CWindow*); Hy3NodeData(CWindow* window);
Hy3NodeData(Hy3GroupLayout); Hy3NodeData(Hy3GroupLayout layout);
Hy3NodeData& operator=(CWindow*); Hy3NodeData& operator=(CWindow*);
Hy3NodeData& operator=(Hy3GroupLayout); Hy3NodeData& operator=(Hy3GroupLayout);
@ -99,7 +99,7 @@ struct Hy3Node {
bool valid = true; bool valid = true;
Hy3Layout* layout = nullptr; Hy3Layout* layout = nullptr;
void recalcSizePosRecursive(bool force = false); void recalcSizePosRecursive(bool no_animation = false);
std::string debugNode(); std::string debugNode();
void markFocused(); void markFocused();
void focus(); void focus();
@ -107,7 +107,7 @@ struct Hy3Node {
void raiseToTop(); void raiseToTop();
Hy3Node* getFocusedNode(); Hy3Node* getFocusedNode();
void updateDecos(); void updateDecos();
void setHidden(bool hidden); void setHidden(bool);
void updateTabBar(); void updateTabBar();
void updateTabBarRecursive(); void updateTabBarRecursive();
bool isUrgent(); bool isUrgent();
@ -119,7 +119,7 @@ struct Hy3Node {
bool operator==(const Hy3Node&) const; bool operator==(const Hy3Node&) const;
// Attempt to swallow a group. returns true if swallowed // Attempt to swallow a group. returns true if swallowed
static bool swallowGroups(Hy3Node*); static bool swallowGroups(Hy3Node* into);
// Remove this node from its parent, deleting the parent if it was // Remove this node from its parent, deleting the parent if it was
// the only child and recursing if the parent was the only child of it's // the only child and recursing if the parent was the only child of it's
// parent. // parent.
@ -137,36 +137,36 @@ public:
virtual void onWindowRemovedTiling(CWindow*); virtual void onWindowRemovedTiling(CWindow*);
virtual void onWindowFocusChange(CWindow*); virtual void onWindowFocusChange(CWindow*);
virtual bool isWindowTiled(CWindow*); virtual bool isWindowTiled(CWindow*);
virtual void recalculateMonitor(const int&); virtual void recalculateMonitor(const int& monitor_id);
virtual void recalculateWindow(CWindow*); virtual void recalculateWindow(CWindow*);
virtual void onBeginDragWindow(); virtual void onBeginDragWindow();
virtual void resizeActiveWindow(const Vector2D&, CWindow* pWindow = nullptr); virtual void resizeActiveWindow(const Vector2D& delta, CWindow* pWindow = nullptr);
virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool); virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool enable_fullscreen);
virtual std::any layoutMessage(SLayoutMessageHeader, std::string); virtual std::any layoutMessage(SLayoutMessageHeader header, std::string content);
virtual SWindowRenderLayoutHints requestRenderHints(CWindow*); virtual SWindowRenderLayoutHints requestRenderHints(CWindow*);
virtual void switchWindows(CWindow*, CWindow*); virtual void switchWindows(CWindow*, CWindow*);
virtual void alterSplitRatio(CWindow*, float, bool); virtual void alterSplitRatio(CWindow*, float, bool);
virtual std::string getLayoutName(); virtual std::string getLayoutName();
virtual CWindow* getNextWindowCandidate(CWindow*); virtual CWindow* getNextWindowCandidate(CWindow*);
virtual void replaceWindowDataWith(CWindow*, CWindow*); virtual void replaceWindowDataWith(CWindow* from, CWindow* to);
virtual void onEnable(); virtual void onEnable();
virtual void onDisable(); virtual void onDisable();
void makeGroupOnWorkspace(int, Hy3GroupLayout); void makeGroupOnWorkspace(int workspace, Hy3GroupLayout);
void makeOppositeGroupOnWorkspace(int); void makeOppositeGroupOnWorkspace(int workspace);
void makeGroupOn(Hy3Node*, Hy3GroupLayout); void makeGroupOn(Hy3Node*, Hy3GroupLayout);
void makeOppositeGroupOn(Hy3Node*); void makeOppositeGroupOn(Hy3Node*);
void shiftWindow(int, ShiftDirection, bool); void shiftWindow(int workspace, ShiftDirection, bool once);
void shiftFocus(int, ShiftDirection, bool); void shiftFocus(int workspace, ShiftDirection, bool visible);
void changeFocus(int, FocusShift); void changeFocus(int workspace, FocusShift);
void focusTab(int, TabFocus, TabFocusMousePriority, bool, int); void focusTab(int workspace, TabFocus target, TabFocusMousePriority, bool wrap_scroll, int index);
void killFocusedNode(int); void killFocusedNode(int workspace);
bool shouldRenderSelected(CWindow*); bool shouldRenderSelected(CWindow*);
Hy3Node* getWorkspaceRootGroup(const int&); Hy3Node* getWorkspaceRootGroup(const int& workspace);
Hy3Node* getWorkspaceFocusedNode(const int&); Hy3Node* getWorkspaceFocusedNode(const int& workspace);
static void renderHook(void*, std::any); static void renderHook(void*, std::any);
static void windowGroupUrgentHook(void*, std::any); static void windowGroupUrgentHook(void*, std::any);
@ -183,14 +183,14 @@ private:
bool yExtent = false; bool yExtent = false;
} drag_flags; } drag_flags;
int getWorkspaceNodeCount(const int&); int getWorkspaceNodeCount(const int& workspace);
Hy3Node* getNodeFromWindow(CWindow*); Hy3Node* getNodeFromWindow(CWindow*);
void applyNodeDataToWindow(Hy3Node*, bool force = false); void applyNodeDataToWindow(Hy3Node*, bool no_animation = false);
// if shift is true, shift the window in the given direction, returning // if shift is true, shift the window in the given direction, returning
// nullptr, if shift is false, return the window in the given direction or // nullptr, if shift is false, return the window in the given direction or
// nullptr. if once is true, only one group will be broken out of / into // nullptr. if once is true, only one group will be broken out of / into
Hy3Node* shiftOrGetFocus(Hy3Node&, ShiftDirection, bool, bool, bool); Hy3Node* shiftOrGetFocus(Hy3Node&, ShiftDirection, bool shift, bool once, bool visible);
friend struct Hy3Node; friend struct Hy3Node;
}; };