Formatted EVERYTHING

This commit is contained in:
Dynamitos
2024-06-09 12:20:53 +02:00
parent f18bf8acbe
commit d95dab850c
265 changed files with 8002 additions and 12310 deletions
+16 -36
View File
@@ -4,32 +4,19 @@
using namespace Seele;
Window::Window(PWindowManager owner, Gfx::OWindow handle)
: owner(owner)
, gfxHandle(std::move(handle))
{
gfxHandle->setResizeCallback([this](uint32 w, uint32 h) {onResize(w, h); });
Window::Window(PWindowManager owner, Gfx::OWindow handle) : owner(owner), gfxHandle(std::move(handle)) {
gfxHandle->setResizeCallback([this](uint32 w, uint32 h) { onResize(w, h); });
}
Window::~Window()
{
}
Window::~Window() {}
void Window::addView(PView view)
{
views.add(view);
}
void Window::addView(PView view) { views.add(view); }
void Window::pollInputs()
{
gfxHandle->pollInput();
}
void Window::pollInputs() { gfxHandle->pollInput(); }
void Window::render()
{
void Window::render() {
gfxHandle->beginFrame();
for(auto& view : views)
{
for (auto& view : views) {
view->beginUpdate();
view->update();
view->commitUpdate();
@@ -39,16 +26,13 @@ void Window::render()
gfxHandle->endFrame();
}
Gfx::PWindow Window::getGfxHandle()
{
return gfxHandle;
}
void Window::setFocused(PView view)
{
Gfx::PWindow Window::getGfxHandle() { return gfxHandle; }
void Window::setFocused(PView view) {
auto keyFunction = std::bind(&View::keyCallback, view.getHandle(), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
auto mouseMoveFunction = std::bind(&View::mouseMoveCallback, view.getHandle(), std::placeholders::_1, std::placeholders::_2);
auto mouseButtonFunction = std::bind(&View::mouseButtonCallback, view.getHandle() , std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
auto mouseButtonFunction =
std::bind(&View::mouseButtonCallback, view.getHandle(), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
auto scrollFunction = std::bind(&View::scrollCallback, view.getHandle(), std::placeholders::_1, std::placeholders::_2);
auto fileFunction = std::bind(&View::fileCallback, view.getHandle(), std::placeholders::_1, std::placeholders::_2);
gfxHandle->setKeyCallback(keyFunction);
@@ -56,19 +40,15 @@ void Window::setFocused(PView view)
gfxHandle->setMouseButtonCallback(mouseButtonFunction);
gfxHandle->setScrollCallback(scrollFunction);
gfxHandle->setFileCallback(fileFunction);
gfxHandle->setCloseCallback([this](){
owner->notifyWindowClosed(this);
});
gfxHandle->setCloseCallback([this]() { owner->notifyWindowClosed(this); });
}
void Window::onResize(uint32 width, uint32 height)
{
for (auto& view : views)
{
void Window::onResize(uint32 width, uint32 height) {
for (auto& view : views) {
// TODO: some sort of layouting algorithm should do this
view->resize(URect{
.size = UVector2(width, height),
.offset = UVector2(0, 0),
});
});
}
}