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

Userland: Rename Core::Object to Core::EventReceiver

This is a more precise description of what this class actually does.
This commit is contained in:
Andreas Kling 2023-08-06 18:09:39 +02:00 committed by Jelle Raaijmakers
parent bdf696e488
commit ddbe6bd7b4
128 changed files with 399 additions and 401 deletions

View file

@ -8,19 +8,19 @@
#pragma once
#include <AK/Function.h>
#include <LibCore/Object.h>
#include <LibCore/EventReceiver.h>
namespace Core {
class Timer final : public Object {
class Timer final : public EventReceiver {
C_OBJECT(Timer);
public:
static ErrorOr<NonnullRefPtr<Timer>> create_repeating(int interval_ms, Function<void()>&& timeout_handler, Object* parent = nullptr)
static ErrorOr<NonnullRefPtr<Timer>> create_repeating(int interval_ms, Function<void()>&& timeout_handler, EventReceiver* parent = nullptr)
{
return adopt_nonnull_ref_or_enomem(new Timer(interval_ms, move(timeout_handler), parent));
}
static ErrorOr<NonnullRefPtr<Timer>> create_single_shot(int interval_ms, Function<void()>&& timeout_handler, Object* parent = nullptr)
static ErrorOr<NonnullRefPtr<Timer>> create_single_shot(int interval_ms, Function<void()>&& timeout_handler, EventReceiver* parent = nullptr)
{
auto timer = TRY(adopt_nonnull_ref_or_enomem(new Timer(interval_ms, move(timeout_handler), parent)));
timer->set_single_shot(true);
@ -53,8 +53,8 @@ public:
Function<void()> on_timeout;
private:
explicit Timer(Object* parent = nullptr);
Timer(int interval_ms, Function<void()>&& timeout_handler, Object* parent = nullptr);
explicit Timer(EventReceiver* parent = nullptr);
Timer(int interval_ms, Function<void()>&& timeout_handler, EventReceiver* parent = nullptr);
virtual void timer_event(TimerEvent&) override;