1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

Taskbar+LibGUI: More work on bringup.

This commit is contained in:
Andreas Kling 2019-04-03 21:03:12 +02:00
parent a22774ee3f
commit aa03a07e61
16 changed files with 105 additions and 250 deletions

View file

@ -36,6 +36,9 @@ public:
WindowCloseRequest,
ChildAdded,
ChildRemoved,
WM_WindowAdded,
WM_WindowRemoved,
WM_WindowStateChanged,
};
GEvent() { }
@ -52,6 +55,65 @@ private:
Type m_type { Invalid };
};
class GWMEvent : public GEvent {
public:
GWMEvent(Type type, int client_id, int window_id)
: GEvent(type)
, m_client_id(client_id)
, m_window_id(window_id)
{
}
int client_id() const { return m_client_id; }
int window_id() const { return m_window_id; }
private:
int m_client_id { -1 };
int m_window_id { -1 };
};
class GWMWindowAddedEvent : public GWMEvent {
public:
GWMWindowAddedEvent(int client_id, int window_id, const String& title, const Rect& rect)
: GWMEvent(GEvent::Type::WM_WindowAdded, client_id, window_id)
, m_title(title)
, m_rect(rect)
{
}
String title() const { return m_title; }
Rect rect() const { return m_rect; }
private:
String m_title;
Rect m_rect;
};
class GWMWindowRemovedEvent : public GWMEvent {
public:
GWMWindowRemovedEvent(int client_id, int window_id)
: GWMEvent(GEvent::Type::WM_WindowRemoved, client_id, window_id)
{
}
};
class GWMWindowStateChangedEvent : public GWMEvent {
public:
GWMWindowStateChangedEvent(int client_id, int window_id, const String& title, const Rect& rect)
: GWMEvent(GEvent::Type::WM_WindowStateChanged, client_id, window_id)
, m_title(title)
, m_rect(rect)
{
}
String title() const { return m_title; }
Rect rect() const { return m_rect; }
private:
String m_title;
Rect m_rect;
};
class QuitEvent final : public GEvent {
public:
QuitEvent()