1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

Start bringing up LibGUI properly (formerly Widgets.)

This commit is contained in:
Andreas Kling 2019-01-20 05:48:43 +01:00
parent b91479d9b9
commit 8eae89a405
17 changed files with 258 additions and 33 deletions

View file

@ -5,11 +5,15 @@
#include <SharedGraphics/GraphicsBitmap.h>
#include <AK/AKString.h>
class GWidget;
class GWindow final : public GObject {
public:
explicit GWindow(int window_id);
GWindow(GObject* parent = nullptr);
virtual ~GWindow() override;
static GWindow* from_window_id(int);
int window_id() const { return m_window_id; }
String title() const { return m_title; }
@ -29,21 +33,24 @@ public:
virtual void event(GEvent&) override;
bool is_being_dragged() const { return m_is_being_dragged; }
void set_is_being_dragged(bool b) { m_is_being_dragged = b; }
bool is_visible() const;
void close();
void set_main_widget(GWidget*);
GraphicsBitmap* backing() { return m_backing.ptr(); }
void show();
void update();
private:
String m_title;
Rect m_rect;
bool m_is_being_dragged { false };
RetainPtr<GraphicsBitmap> m_backing;
int m_window_id { -1 };
GWidget* m_main_widget { nullptr };
};