From 667e678aa6a37c4df1b4a72a09ef4069ac003f3c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 12 Apr 2019 00:03:21 +0200 Subject: [PATCH] LibCore: Prune remaining knowledge about LibGUI. --- LibCore/CNotifier.cpp | 7 ++++--- LibCore/CObject.cpp | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/LibCore/CNotifier.cpp b/LibCore/CNotifier.cpp index 59c2a460fe..a7e1344900 100644 --- a/LibCore/CNotifier.cpp +++ b/LibCore/CNotifier.cpp @@ -1,15 +1,16 @@ #include -#include +#include +#include CNotifier::CNotifier(int fd, unsigned event_mask) : m_fd(fd) , m_event_mask(event_mask) { - GEventLoop::register_notifier(Badge(), *this); + CEventLoop::register_notifier(Badge(), *this); } CNotifier::~CNotifier() { - GEventLoop::unregister_notifier(Badge(), *this); + CEventLoop::unregister_notifier(Badge(), *this); } diff --git a/LibCore/CObject.cpp b/LibCore/CObject.cpp index 59ecfea62a..42b471eba0 100644 --- a/LibCore/CObject.cpp +++ b/LibCore/CObject.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -24,15 +24,15 @@ CObject::~CObject() void CObject::event(CEvent& event) { switch (event.type()) { - case GEvent::Timer: + case CEvent::Timer: return timer_event(static_cast(event)); - case GEvent::DeferredDestroy: + case CEvent::DeferredDestroy: delete this; break; - case GEvent::ChildAdded: - case GEvent::ChildRemoved: + case CEvent::ChildAdded: + case CEvent::ChildRemoved: return child_event(static_cast(event)); - case GEvent::Invalid: + case CEvent::Invalid: ASSERT_NOT_REACHED(); break; default: @@ -43,7 +43,7 @@ void CObject::event(CEvent& event) void CObject::add_child(CObject& object) { m_children.append(&object); - GEventLoop::current().post_event(*this, make(GEvent::ChildAdded, object)); + CEventLoop::current().post_event(*this, make(CEvent::ChildAdded, object)); } void CObject::remove_child(CObject& object) @@ -51,7 +51,7 @@ void CObject::remove_child(CObject& object) for (ssize_t i = 0; i < m_children.size(); ++i) { if (m_children[i] == &object) { m_children.remove(i); - GEventLoop::current().post_event(*this, make(GEvent::ChildRemoved, object)); + CEventLoop::current().post_event(*this, make(CEvent::ChildRemoved, object)); return; } } @@ -72,21 +72,21 @@ void CObject::start_timer(int ms) ASSERT_NOT_REACHED(); } - m_timer_id = GEventLoop::register_timer(*this, ms, true); + m_timer_id = CEventLoop::register_timer(*this, ms, true); } void CObject::stop_timer() { if (!m_timer_id) return; - bool success = GEventLoop::unregister_timer(m_timer_id); + bool success = CEventLoop::unregister_timer(m_timer_id); ASSERT(success); m_timer_id = 0; } void CObject::delete_later() { - GEventLoop::current().post_event(*this, make(CEvent::DeferredDestroy)); + CEventLoop::current().post_event(*this, make(CEvent::DeferredDestroy)); } void CObject::dump_tree(int indent) @@ -103,5 +103,5 @@ void CObject::dump_tree(int indent) void CObject::deferred_invoke(Function invokee) { - GEventLoop::current().post_event(*this, make(move(invokee))); + CEventLoop::current().post_event(*this, make(move(invokee))); }