From 98165c5b2f90a89a683565fae3bc013f150de223 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 28 Jun 2023 16:24:10 -0700 Subject: [PATCH] Fix unclear/missing parameter names in Hy3Layout.hpp --- src/Hy3Layout.cpp | 26 ++++++++++++++------------ src/Hy3Layout.hpp | 44 ++++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index e9dcbc8..8d4fc86 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -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; } -void Hy3Node::recalcSizePosRecursive(bool force) { +void Hy3Node::recalcSizePosRecursive(bool no_animation) { // clang-format off static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->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) { this->data.as_window->setHidden(this->hidden); - this->layout->applyNodeDataToWindow(this, force); + this->layout->applyNodeDataToWindow(this, no_animation); return; } @@ -178,7 +178,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) { child->setHidden(this->hidden); - child->recalcSizePosRecursive(force); + child->recalcSizePosRecursive(no_animation); this->updateTabBar(); return; } @@ -214,7 +214,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) { child->position.y = tpos.y; child->size.y = tsize.y; child->setHidden(this->hidden); - child->recalcSizePosRecursive(force); + child->recalcSizePosRecursive(no_animation); break; case Hy3GroupLayout::SplitV: child->position.y = tpos.y + offset; @@ -223,7 +223,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) { child->position.x = tpos.x; child->size.x = tsize.x; child->setHidden(this->hidden); - child->recalcSizePosRecursive(force); + child->recalcSizePosRecursive(no_animation); break; case Hy3GroupLayout::Tabbed: child->position.y = tpos.y + tab_height_offset; @@ -232,7 +232,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) { child->size.x = tsize.x; bool hidden = this->hidden || group->focused_child != child; child->setHidden(hidden); - child->recalcSizePosRecursive(force); + child->recalcSizePosRecursive(no_animation); break; } @@ -645,9 +645,11 @@ Hy3Node* Hy3Layout::getNodeFromWindow(CWindow* window) { return nullptr; } -Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& id) { +Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& workspace) { 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; } } @@ -655,13 +657,13 @@ Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& id) { return nullptr; } -Hy3Node* Hy3Layout::getWorkspaceFocusedNode(const int& id) { - auto* rootNode = this->getWorkspaceRootGroup(id); +Hy3Node* Hy3Layout::getWorkspaceFocusedNode(const int& workspace) { + auto* rootNode = this->getWorkspaceRootGroup(workspace); if (rootNode == nullptr) return nullptr; 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; CWindow* window = node->data.as_window; @@ -744,7 +746,7 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool force) { g_pXWaylandManager->setWindowSize(window, calcSize); - if (force) { + if (no_animation) { g_pHyprRenderer->damageWindow(window); window->m_vRealPosition.warp(); diff --git a/src/Hy3Layout.hpp b/src/Hy3Layout.hpp index 944b2f0..ba201cf 100644 --- a/src/Hy3Layout.hpp +++ b/src/Hy3Layout.hpp @@ -75,8 +75,8 @@ public: Hy3NodeData(); ~Hy3NodeData(); - Hy3NodeData(CWindow*); - Hy3NodeData(Hy3GroupLayout); + Hy3NodeData(CWindow* window); + Hy3NodeData(Hy3GroupLayout layout); Hy3NodeData& operator=(CWindow*); Hy3NodeData& operator=(Hy3GroupLayout); @@ -99,7 +99,7 @@ struct Hy3Node { bool valid = true; Hy3Layout* layout = nullptr; - void recalcSizePosRecursive(bool force = false); + void recalcSizePosRecursive(bool no_animation = false); std::string debugNode(); void markFocused(); void focus(); @@ -107,7 +107,7 @@ struct Hy3Node { void raiseToTop(); Hy3Node* getFocusedNode(); void updateDecos(); - void setHidden(bool hidden); + void setHidden(bool); void updateTabBar(); void updateTabBarRecursive(); bool isUrgent(); @@ -119,7 +119,7 @@ struct Hy3Node { bool operator==(const Hy3Node&) const; // 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 // the only child and recursing if the parent was the only child of it's // parent. @@ -137,36 +137,36 @@ public: virtual void onWindowRemovedTiling(CWindow*); virtual void onWindowFocusChange(CWindow*); virtual bool isWindowTiled(CWindow*); - virtual void recalculateMonitor(const int&); + virtual void recalculateMonitor(const int& monitor_id); virtual void recalculateWindow(CWindow*); virtual void onBeginDragWindow(); - virtual void resizeActiveWindow(const Vector2D&, CWindow* pWindow = nullptr); - virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool); - virtual std::any layoutMessage(SLayoutMessageHeader, std::string); + virtual void resizeActiveWindow(const Vector2D& delta, CWindow* pWindow = nullptr); + virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool enable_fullscreen); + virtual std::any layoutMessage(SLayoutMessageHeader header, std::string content); virtual SWindowRenderLayoutHints requestRenderHints(CWindow*); virtual void switchWindows(CWindow*, CWindow*); virtual void alterSplitRatio(CWindow*, float, bool); virtual std::string getLayoutName(); virtual CWindow* getNextWindowCandidate(CWindow*); - virtual void replaceWindowDataWith(CWindow*, CWindow*); + virtual void replaceWindowDataWith(CWindow* from, CWindow* to); virtual void onEnable(); virtual void onDisable(); - void makeGroupOnWorkspace(int, Hy3GroupLayout); - void makeOppositeGroupOnWorkspace(int); + void makeGroupOnWorkspace(int workspace, Hy3GroupLayout); + void makeOppositeGroupOnWorkspace(int workspace); void makeGroupOn(Hy3Node*, Hy3GroupLayout); void makeOppositeGroupOn(Hy3Node*); - void shiftWindow(int, ShiftDirection, bool); - void shiftFocus(int, ShiftDirection, bool); - void changeFocus(int, FocusShift); - void focusTab(int, TabFocus, TabFocusMousePriority, bool, int); - void killFocusedNode(int); + void shiftWindow(int workspace, ShiftDirection, bool once); + void shiftFocus(int workspace, ShiftDirection, bool visible); + void changeFocus(int workspace, FocusShift); + void focusTab(int workspace, TabFocus target, TabFocusMousePriority, bool wrap_scroll, int index); + void killFocusedNode(int workspace); bool shouldRenderSelected(CWindow*); - Hy3Node* getWorkspaceRootGroup(const int&); - Hy3Node* getWorkspaceFocusedNode(const int&); + Hy3Node* getWorkspaceRootGroup(const int& workspace); + Hy3Node* getWorkspaceFocusedNode(const int& workspace); static void renderHook(void*, std::any); static void windowGroupUrgentHook(void*, std::any); @@ -183,14 +183,14 @@ private: bool yExtent = false; } drag_flags; - int getWorkspaceNodeCount(const int&); + int getWorkspaceNodeCount(const int& workspace); 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 // 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 - Hy3Node* shiftOrGetFocus(Hy3Node&, ShiftDirection, bool, bool, bool); + Hy3Node* shiftOrGetFocus(Hy3Node&, ShiftDirection, bool shift, bool once, bool visible); friend struct Hy3Node; };