#pragma once #include class GLabel; class QSLabel; class QSWidget final : public GFrame { public: QSWidget(GWidget* parent); virtual ~QSWidget() override; void set_bitmap(NonnullRefPtr); Function on_scale_change; private: virtual void paint_event(GPaintEvent&) override; virtual void resize_event(GResizeEvent&) override; virtual void mousedown_event(GMouseEvent&) override; virtual void mouseup_event(GMouseEvent&) override; virtual void mousemove_event(GMouseEvent&) override; virtual void mousewheel_event(GMouseEvent&) override; void relayout(); RefPtr m_bitmap; Rect m_bitmap_rect; int m_scale { 100 }; Point m_pan_origin; Point m_pan_bitmap_origin; };