Replace Old Widgets
This commit is contained in:
parent
cce8f0e1bc
commit
fcd5eb2d2a
81 changed files with 388 additions and 278 deletions
|
|
@ -1,46 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "Widget.hpp"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace tp {
|
||||
// FIXME : desperately needs refactor
|
||||
class UpdateManager {
|
||||
friend DebugManager;
|
||||
|
||||
public:
|
||||
UpdateManager() = default;
|
||||
|
||||
void scheduleUpdate(Widget* widget, const char* reason);
|
||||
|
||||
void lockFocus(Widget* widget);
|
||||
void freeFocus(Widget* widget);
|
||||
|
||||
[[nodiscard]] bool isPendingUpdates() const {
|
||||
return !mTriggeredWidgets.empty();
|
||||
}
|
||||
|
||||
void processWidgets(Widget* root, EventHandler& eventHandler);
|
||||
void clean();
|
||||
|
||||
void updateTreeToProcess(Widget* root);
|
||||
void handleFocusChanges(Widget* root, EventHandler& events);
|
||||
|
||||
void findFocusWidget(Widget* iter, Widget** focus, const Vec2F& pointer);
|
||||
static void getWidgetPath(Widget* widget, std::vector<Widget*>& out);
|
||||
void processActiveTree(Widget* iter, EventHandler& events, Vec2F pos);
|
||||
void processFocusItems(EventHandler& events);
|
||||
|
||||
private:
|
||||
static void procWidget(Widget* widget, EventHandler& events, bool withEvents = false);
|
||||
|
||||
private:
|
||||
std::map<Widget*, bool> mTriggeredWidgets;
|
||||
Widget* mInFocusWidget = nullptr;
|
||||
Widget* mFocusLockWidget = nullptr;
|
||||
|
||||
private:
|
||||
int mDebugWidgetsToProcess = 0;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue