mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:17:35 +00:00
Start bringing up LibGUI properly (formerly Widgets.)
This commit is contained in:
parent
b91479d9b9
commit
8eae89a405
17 changed files with 258 additions and 33 deletions
|
@ -5,6 +5,8 @@
|
|||
#include <AK/Vector.h>
|
||||
|
||||
class GObject;
|
||||
class GWindow;
|
||||
struct GUI_Event;
|
||||
|
||||
class GEventLoop {
|
||||
public:
|
||||
|
@ -13,7 +15,7 @@ public:
|
|||
|
||||
int exec();
|
||||
|
||||
void postEvent(GObject* receiver, OwnPtr<GEvent>&&);
|
||||
void post_event(GObject* receiver, OwnPtr<GEvent>&&);
|
||||
|
||||
static GEventLoop& main();
|
||||
|
||||
|
@ -22,13 +24,16 @@ public:
|
|||
bool running() const { return m_running; }
|
||||
|
||||
private:
|
||||
void waitForEvent();
|
||||
void wait_for_event();
|
||||
void handle_paint_event(const GUI_Event&, GWindow&);
|
||||
void handle_mouse_event(const GUI_Event&, GWindow&);
|
||||
|
||||
struct QueuedEvent {
|
||||
GObject* receiver { nullptr };
|
||||
OwnPtr<GEvent> event;
|
||||
};
|
||||
Vector<QueuedEvent> m_queuedEvents;
|
||||
Vector<QueuedEvent> m_queued_events;
|
||||
|
||||
int m_event_fd { -1 };
|
||||
bool m_running { false };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue