layout: rethonk layouts from the ground up (#12890)
Rewrites layouts to be much smaller, and deal with much less annoying BS. Improves the overall architecture, unifies handling of pseudotiling, and various other improvements.
This commit is contained in:
parent
51f8849e54
commit
723870337f
82 changed files with 8431 additions and 5527 deletions
68
src/desktop/view/Group.hpp
Normal file
68
src/desktop/view/Group.hpp
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#pragma once
|
||||
|
||||
#include "../DesktopTypes.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Layout {
|
||||
class CWindowGroupTarget;
|
||||
};
|
||||
|
||||
namespace Desktop::View {
|
||||
class CGroup {
|
||||
public:
|
||||
static SP<CGroup> create(std::vector<PHLWINDOWREF>&& windows);
|
||||
~CGroup();
|
||||
|
||||
bool has(PHLWINDOW w) const;
|
||||
|
||||
void add(PHLWINDOW w);
|
||||
void remove(PHLWINDOW w);
|
||||
void moveCurrent(bool next);
|
||||
void setCurrent(size_t idx);
|
||||
void setCurrent(PHLWINDOW w);
|
||||
size_t getCurrentIdx() const;
|
||||
size_t size() const;
|
||||
void destroy();
|
||||
void updateWorkspace(PHLWORKSPACE);
|
||||
|
||||
void swapWithNext();
|
||||
void swapWithLast();
|
||||
|
||||
PHLWINDOW head() const;
|
||||
PHLWINDOW tail() const;
|
||||
PHLWINDOW current() const;
|
||||
PHLWINDOW next() const;
|
||||
|
||||
PHLWINDOW fromIndex(size_t idx) const;
|
||||
|
||||
bool locked() const;
|
||||
void setLocked(bool x);
|
||||
|
||||
bool denied() const;
|
||||
void setDenied(bool x);
|
||||
|
||||
const std::vector<PHLWINDOWREF>& windows() const;
|
||||
|
||||
SP<Layout::CWindowGroupTarget> m_target;
|
||||
|
||||
private:
|
||||
CGroup(std::vector<PHLWINDOWREF>&& windows);
|
||||
|
||||
void applyWindowDecosAndUpdates(PHLWINDOW x);
|
||||
void removeWindowDecos(PHLWINDOW x);
|
||||
void init();
|
||||
void updateWindowVisibility();
|
||||
|
||||
WP<CGroup> m_self;
|
||||
|
||||
std::vector<PHLWINDOWREF> m_windows;
|
||||
|
||||
bool m_locked = false;
|
||||
bool m_deny = false;
|
||||
|
||||
size_t m_current = 0;
|
||||
};
|
||||
|
||||
std::vector<WP<CGroup>>& groups();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue