Initial commit

This commit is contained in:
Gericom
2025-11-22 17:21:45 +01:00
commit 5d6f67c612
517 changed files with 63025 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
class View;
class InputProvider;
/// @brief Class for managing focus.
class FocusManager
{
public:
/// @brief Focuses the given view.
/// @param newFocus The view to focus.
void Focus(View* newFocus);
/// @brief Clears the current focus.
void Unfocus();
/// @brief Updates the focus using the given input provider.
/// @param inputProvider The input provider to use.
void Update(const InputProvider& inputProvider);
/// @brief Gets the currently focused view.
/// @return A pointer to the view that is currently focused, or null if none.
constexpr View* GetCurrentFocus() const { return _currentFocus; }
/// @brief Checks whether the current focus lies inside the given view.
/// @param view The view to check for.
/// @return True if the current focus lies inside the given view, or false otherwise.
bool IsFocusInside(const View* view) const;
private:
View* _currentFocus = nullptr;
};