#pragma once

#include "widget.h"
#include <functional>

class EditorWidget : public Widget
{
public:

    struct Callbacks
    {
        std::function<void(const kku::SystemEvent& event)> onInput;
        std::function<void(const kku::microsec& dt)> onUpdate;
        std::function<void(void)> onDisplay;
    };

    explicit EditorWidget(Callbacks&& callbacks);

    virtual void input(const kku::SystemEvent& event) override;
    virtual void update(const kku::microsec& dt) override;
    virtual void display() const override;
    virtual void move(const kku::Vector2<float>& delta) override;
    virtual bool isUnderMouse(const kku::Point& position) const override;

    virtual void setRect(const kku::Area<float>& rect) override;
    virtual kku::Area<float> getRect() const override;

    virtual void setPosition(const kku::Point& position) override;
    virtual kku::Point getPosition() const override;

private:
    std::function<void(const kku::SystemEvent& event)> _input;
    std::function<void(const kku::microsec& dt)> _update;
    std::function<void(void)> _draw;
};

