mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
CNotifier: Turn into a CObject and Use the event queue to deliver events
This way, CNotifier can mutate state to its little heart's content without destroying the world when the global CNotifier hash changes during delivery.
This commit is contained in:
parent
a714fc661d
commit
d8387f1506
4 changed files with 50 additions and 3 deletions
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Function.h>
|
||||
#include "CObject.h"
|
||||
|
||||
class CNotifier {
|
||||
class CNotifier : public CObject {
|
||||
public:
|
||||
enum Event {
|
||||
None = 0,
|
||||
|
@ -22,6 +23,9 @@ public:
|
|||
unsigned event_mask() const { return m_event_mask; }
|
||||
void set_event_mask(unsigned event_mask) { m_event_mask = event_mask; }
|
||||
|
||||
const char* class_name() const override { return "CNotifier"; }
|
||||
void event(CEvent& event) override;
|
||||
|
||||
private:
|
||||
int m_fd { -1 };
|
||||
unsigned m_event_mask { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue