Replace Old Widgets
This commit is contained in:
parent
03da5e41d6
commit
c41dc20132
81 changed files with 388 additions and 278 deletions
53
Widgets/public/RootWidget.hpp
Normal file
53
Widgets/public/RootWidget.hpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#pragma once
|
||||
|
||||
#include "Widget.hpp"
|
||||
|
||||
#include "UpdateManager.hpp"
|
||||
#include "LayoutManager.hpp"
|
||||
#include "DebugManager.hpp"
|
||||
|
||||
namespace tp {
|
||||
class RootWidget : public WidgetManagerInterface {
|
||||
friend DebugManager;
|
||||
|
||||
public:
|
||||
RootWidget();
|
||||
|
||||
// User Interface
|
||||
public:
|
||||
void setRootWidget(Widget* widget);
|
||||
static void setWidgetArea(Widget& widget, const RectF& rect);
|
||||
|
||||
[[nodiscard]] bool isDebug() const;
|
||||
|
||||
// Graphic Application Interface
|
||||
public:
|
||||
void processFrame(EventHandler* events, const RectF& screenArea);
|
||||
void drawFrame(Canvas& canvas);
|
||||
[[nodiscard]] bool needsUpdate() const;
|
||||
|
||||
// Internals
|
||||
private:
|
||||
void drawRecursion(Canvas& canvas, Widget* active, const Vec2F& pos);
|
||||
|
||||
void updateWidget(Widget*, const char* reason = nullptr) override;
|
||||
|
||||
void openPopup(Widget*) override;
|
||||
void closePopup(Widget*) override;
|
||||
|
||||
void lockFocus(Widget*) override;
|
||||
void freeFocus(Widget*) override;
|
||||
|
||||
void updateAnimations();
|
||||
void updateAreaCache(Widget* iter, bool read);
|
||||
|
||||
private:
|
||||
Widget mRoot;
|
||||
Widget mPopups;
|
||||
|
||||
Widget* mUserRoot = nullptr;
|
||||
|
||||
LayoutManager mLayoutManager;
|
||||
UpdateManager mUpdateManager;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue