mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:47:36 +00:00
Rename all the LibGUI classes to GClassName.
This commit is contained in:
parent
a026da47e7
commit
b91479d9b9
33 changed files with 623 additions and 581 deletions
40
LibGUI/GObject.h
Normal file
40
LibGUI/GObject.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/Weakable.h>
|
||||
|
||||
class GEvent;
|
||||
class GTimerEvent;
|
||||
|
||||
class GObject : public Weakable<GObject> {
|
||||
public:
|
||||
GObject(GObject* parent = nullptr);
|
||||
virtual ~GObject();
|
||||
|
||||
virtual const char* class_name() const { return "GObject"; }
|
||||
|
||||
virtual void event(GEvent&);
|
||||
|
||||
Vector<GObject*>& children() { return m_children; }
|
||||
|
||||
GObject* parent() { return m_parent; }
|
||||
const GObject* parent() const { return m_parent; }
|
||||
|
||||
void startTimer(int ms);
|
||||
void stopTimer();
|
||||
bool hasTimer() const { return m_timerID; }
|
||||
|
||||
void addChild(GObject&);
|
||||
void removeChild(GObject&);
|
||||
|
||||
void deleteLater();
|
||||
|
||||
private:
|
||||
virtual void timerEvent(GTimerEvent&);
|
||||
|
||||
GObject* m_parent { nullptr };
|
||||
|
||||
int m_timerID { 0 };
|
||||
|
||||
Vector<GObject*> m_children;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue