Merge branch 'master' into SDL2

This commit is contained in:
Jérôme Leclercq
2020-05-27 11:11:21 +02:00
committed by GitHub
211 changed files with 7628 additions and 2883 deletions

View File

@@ -26,8 +26,6 @@ namespace Ndk
friend Canvas;
public:
struct Padding;
BaseWidget(BaseWidget* parent);
BaseWidget(const BaseWidget&) = delete;
BaseWidget(BaseWidget&&) = delete;
@@ -41,6 +39,7 @@ namespace Ndk
inline void CenterVertical();
void ClearFocus();
inline void ClearRenderingRect();
void Destroy();
@@ -68,12 +67,15 @@ namespace Ndk
inline Nz::Vector2f GetPreferredSize() const;
inline float GetPreferredWidth() const;
inline const Nz::Rectf& GetRenderingRect() const;
inline Nz::Vector2f GetSize() const;
inline float GetWidth() const;
inline std::size_t GetWidgetChildCount() const;
bool HasFocus() const;
inline void Hide();
inline bool IsVisible() const;
void Resize(const Nz::Vector2f& size);
@@ -81,6 +83,7 @@ namespace Ndk
void SetBackgroundColor(const Nz::Color& color);
void SetCursor(Nz::SystemCursor systemCursor);
void SetFocus();
void SetParent(BaseWidget* widget);
inline void SetFixedHeight(float fixedHeight);
inline void SetFixedSize(const Nz::Vector2f& fixedSize);
@@ -94,6 +97,8 @@ namespace Ndk
inline void SetMinimumSize(const Nz::Vector2f& minimumSize);
inline void SetMinimumWidth(float minimumWidth);
virtual void SetRenderingRect(const Nz::Rectf& renderingRect);
void Show(bool show = true);
BaseWidget& operator=(const BaseWidget&) = delete;
@@ -106,6 +111,8 @@ namespace Ndk
void InvalidateNode() override;
Nz::Rectf GetScissorRect() const;
virtual bool IsFocusable() const;
virtual void OnFocusLost();
virtual void OnFocusReceived();
@@ -115,6 +122,7 @@ namespace Ndk
virtual void OnMouseMoved(int x, int y, int deltaX, int deltaY);
virtual void OnMouseButtonPress(int x, int y, Nz::Mouse::Button button);
virtual void OnMouseButtonRelease(int x, int y, Nz::Mouse::Button button);
virtual void OnMouseWheelMoved(int x, int y, float delta);
virtual void OnMouseExit();
virtual void OnParentResized(const Nz::Vector2f& newSize);
virtual void OnTextEntered(char32_t character, bool repeated);
@@ -122,6 +130,8 @@ namespace Ndk
inline void SetPreferredSize(const Nz::Vector2f& preferredSize);
virtual void ShowChildren(bool show);
private:
inline BaseWidget();
@@ -137,6 +147,10 @@ namespace Ndk
struct WidgetEntity
{
EntityOwner handle;
bool isEnabled = true;
NazaraSlot(Ndk::Entity, OnEntityDisabled, onDisabledSlot);
NazaraSlot(Ndk::Entity, OnEntityEnabled, onEnabledSlot);
};
static constexpr std::size_t InvalidCanvasIndex = std::numeric_limits<std::size_t>::max();
@@ -148,6 +162,7 @@ namespace Ndk
EntityOwner m_backgroundEntity;
WorldHandle m_world;
Nz::Color m_backgroundColor;
Nz::Rectf m_renderingRect;
Nz::SpriteRef m_backgroundSprite;
Nz::SystemCursor m_cursor;
Nz::Vector2f m_maximumSize;