mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 16:47: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:
parent
bdf696e488
commit
ddbe6bd7b4
128 changed files with 399 additions and 401 deletions
|
@ -123,7 +123,7 @@ private:
|
|||
FadingProperty<double> m_volume { 1 };
|
||||
};
|
||||
|
||||
class Mixer : public Core::Object {
|
||||
class Mixer : public Core::EventReceiver {
|
||||
C_OBJECT_ABSTRACT(Mixer)
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<Mixer>> try_create(NonnullRefPtr<Core::ConfigFile> config)
|
||||
|
|
|
@ -35,7 +35,7 @@ static MACAddress mac_from_string(DeprecatedString const& str)
|
|||
};
|
||||
}
|
||||
|
||||
static bool send(InterfaceDescriptor const& iface, DHCPv4Packet const& packet, Core::Object*)
|
||||
static bool send(InterfaceDescriptor const& iface, DHCPv4Packet const& packet, Core::EventReceiver*)
|
||||
{
|
||||
int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (fd < 0) {
|
||||
|
|
|
@ -36,7 +36,7 @@ struct DHCPv4Transaction {
|
|||
u32 offered_lease_time { 0 };
|
||||
};
|
||||
|
||||
class DHCPv4Client final : public Core::Object {
|
||||
class DHCPv4Client final : public Core::EventReceiver {
|
||||
C_OBJECT(DHCPv4Client)
|
||||
|
||||
public:
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace LookupServer {
|
|||
|
||||
using namespace DNS;
|
||||
|
||||
DNSServer::DNSServer(Object* parent)
|
||||
DNSServer::DNSServer(Core::EventReceiver* parent)
|
||||
: Core::UDPServer(parent)
|
||||
{
|
||||
bind(IPv4Address(), 53);
|
||||
|
|
|
@ -14,7 +14,7 @@ class DNSServer : public Core::UDPServer {
|
|||
C_OBJECT(DNSServer)
|
||||
|
||||
private:
|
||||
explicit DNSServer(Object* parent = nullptr);
|
||||
explicit DNSServer(Core::EventReceiver* parent = nullptr);
|
||||
|
||||
ErrorOr<void> handle_client();
|
||||
};
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "ConnectionFromClient.h"
|
||||
#include "DNSServer.h"
|
||||
#include "MulticastDNS.h"
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibCore/FileWatcher.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibDNS/Name.h>
|
||||
#include <LibDNS/Packet.h>
|
||||
#include <LibIPC/MultiServer.h>
|
||||
|
@ -19,7 +19,7 @@ namespace LookupServer {
|
|||
|
||||
using namespace DNS;
|
||||
|
||||
class LookupServer final : public Core::Object {
|
||||
class LookupServer final : public Core::EventReceiver {
|
||||
C_OBJECT(LookupServer);
|
||||
|
||||
public:
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace LookupServer {
|
||||
|
||||
MulticastDNS::MulticastDNS(Object* parent)
|
||||
MulticastDNS::MulticastDNS(Core::EventReceiver* parent)
|
||||
: Core::UDPServer(parent)
|
||||
, m_hostname("courage.local")
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
ErrorOr<Vector<Answer>> lookup(Name const&, RecordType record_type);
|
||||
|
||||
private:
|
||||
explicit MulticastDNS(Object* parent = nullptr);
|
||||
explicit MulticastDNS(Core::EventReceiver* parent = nullptr);
|
||||
|
||||
void announce();
|
||||
ErrorOr<size_t> emit_packet(Packet const&, sockaddr_in const* destination = nullptr);
|
||||
|
|
|
@ -49,8 +49,7 @@ ErrorOr<NonnullRefPtr<DatabaseConnection>> DatabaseConnection::create(StringView
|
|||
}
|
||||
|
||||
DatabaseConnection::DatabaseConnection(NonnullRefPtr<SQL::Database> database, DeprecatedString database_name, int client_id)
|
||||
: Object()
|
||||
, m_database(move(database))
|
||||
: m_database(move(database))
|
||||
, m_database_name(move(database_name))
|
||||
, m_connection_id(s_next_connection_id++)
|
||||
, m_client_id(client_id)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibSQL/Database.h>
|
||||
#include <LibSQL/Result.h>
|
||||
#include <LibSQL/Type.h>
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace SQLServer {
|
||||
|
||||
class DatabaseConnection final : public Core::Object {
|
||||
class DatabaseConnection final : public Core::EventReceiver {
|
||||
C_OBJECT_ABSTRACT(DatabaseConnection)
|
||||
|
||||
public:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibSQL/AST/Parser.h>
|
||||
#include <SQLServer/ConnectionFromClient.h>
|
||||
#include <SQLServer/DatabaseConnection.h>
|
||||
|
@ -35,7 +35,7 @@ SQL::ResultOr<NonnullRefPtr<SQLStatement>> SQLStatement::create(DatabaseConnecti
|
|||
}
|
||||
|
||||
SQLStatement::SQLStatement(DatabaseConnection& connection, NonnullRefPtr<SQL::AST::Statement> statement)
|
||||
: Core::Object(&connection)
|
||||
: Core::EventReceiver(&connection)
|
||||
, m_statement_id(s_next_statement_id++)
|
||||
, m_statement(move(statement))
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibSQL/AST/AST.h>
|
||||
#include <LibSQL/Result.h>
|
||||
#include <LibSQL/ResultSet.h>
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
namespace SQLServer {
|
||||
|
||||
class SQLStatement final : public Core::Object {
|
||||
class SQLStatement final : public Core::EventReceiver {
|
||||
C_OBJECT_ABSTRACT(SQLStatement)
|
||||
|
||||
public:
|
||||
|
|
|
@ -282,7 +282,7 @@ ErrorOr<void> Service::did_exit(int status)
|
|||
}
|
||||
|
||||
Service::Service(Core::ConfigFile const& config, StringView name)
|
||||
: Core::Object(nullptr)
|
||||
: Core::EventReceiver(nullptr)
|
||||
{
|
||||
VERIFY(config.has_group(name));
|
||||
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
#include <AK/RefPtr.h>
|
||||
#include <LibCore/Account.h>
|
||||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibCore/Notifier.h>
|
||||
#include <LibCore/Object.h>
|
||||
|
||||
class Service final : public Core::Object {
|
||||
class Service final : public Core::EventReceiver {
|
||||
C_OBJECT_ABSTRACT(Service)
|
||||
|
||||
public:
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace WebDriver {
|
|||
Atomic<unsigned> Client::s_next_session_id;
|
||||
HashMap<unsigned, NonnullRefPtr<Session>> Client::s_sessions;
|
||||
|
||||
ErrorOr<NonnullRefPtr<Client>> Client::try_create(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallbacks callbacks, Core::Object* parent)
|
||||
ErrorOr<NonnullRefPtr<Client>> Client::try_create(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallbacks callbacks, Core::EventReceiver* parent)
|
||||
{
|
||||
if (!callbacks.launch_browser || !callbacks.launch_headless_browser)
|
||||
return Error::from_string_view("All callbacks to launch a browser must be provided"sv);
|
||||
|
@ -29,7 +29,7 @@ ErrorOr<NonnullRefPtr<Client>> Client::try_create(NonnullOwnPtr<Core::BufferedTC
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) Client(move(socket), move(callbacks), parent));
|
||||
}
|
||||
|
||||
Client::Client(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallbacks callbacks, Core::Object* parent)
|
||||
Client::Client(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallbacks callbacks, Core::EventReceiver* parent)
|
||||
: Web::WebDriver::Client(move(socket), parent)
|
||||
, m_callbacks(move(callbacks))
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <AK/Function.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibWeb/WebDriver/Client.h>
|
||||
#include <LibWeb/WebDriver/Error.h>
|
||||
#include <LibWeb/WebDriver/Response.h>
|
||||
|
@ -27,13 +27,13 @@ class Client final : public Web::WebDriver::Client {
|
|||
C_OBJECT_ABSTRACT(Client);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<Client>> try_create(NonnullOwnPtr<Core::BufferedTCPSocket>, LaunchBrowserCallbacks, Core::Object* parent);
|
||||
static ErrorOr<NonnullRefPtr<Client>> try_create(NonnullOwnPtr<Core::BufferedTCPSocket>, LaunchBrowserCallbacks, Core::EventReceiver* parent);
|
||||
virtual ~Client() override;
|
||||
|
||||
void close_session(unsigned session_id);
|
||||
|
||||
private:
|
||||
Client(NonnullOwnPtr<Core::BufferedTCPSocket>, LaunchBrowserCallbacks, Core::Object* parent);
|
||||
Client(NonnullOwnPtr<Core::BufferedTCPSocket>, LaunchBrowserCallbacks, Core::EventReceiver* parent);
|
||||
|
||||
ErrorOr<NonnullRefPtr<Session>, Web::WebDriver::Error> find_session_with_id(StringView session_id);
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
|
||||
namespace WebServer {
|
||||
|
||||
Client::Client(NonnullOwnPtr<Core::BufferedTCPSocket> socket, Core::Object* parent)
|
||||
: Core::Object(parent)
|
||||
Client::Client(NonnullOwnPtr<Core::BufferedTCPSocket> socket, Core::EventReceiver* parent)
|
||||
: Core::EventReceiver(parent)
|
||||
, m_socket(move(socket))
|
||||
{
|
||||
}
|
||||
|
|
|
@ -8,21 +8,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibCore/Socket.h>
|
||||
#include <LibHTTP/Forward.h>
|
||||
#include <LibHTTP/HttpRequest.h>
|
||||
|
||||
namespace WebServer {
|
||||
|
||||
class Client final : public Core::Object {
|
||||
class Client final : public Core::EventReceiver {
|
||||
C_OBJECT(Client);
|
||||
|
||||
public:
|
||||
void start();
|
||||
|
||||
private:
|
||||
Client(NonnullOwnPtr<Core::BufferedTCPSocket>, Core::Object* parent);
|
||||
Client(NonnullOwnPtr<Core::BufferedTCPSocket>, Core::EventReceiver* parent);
|
||||
|
||||
using WrappedError = Variant<AK::Error, HTTP::HttpRequest::ParseError>;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace WindowServer {
|
||||
|
||||
class AppletManager : public Core::Object {
|
||||
class AppletManager : public Core::EventReceiver {
|
||||
C_OBJECT(AppletManager)
|
||||
public:
|
||||
~AppletManager() = default;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/DisjointRectSet.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
|
@ -87,7 +87,7 @@ struct CompositorScreenData {
|
|||
}
|
||||
};
|
||||
|
||||
class Compositor final : public Core::Object {
|
||||
class Compositor final : public Core::EventReceiver {
|
||||
C_OBJECT(Compositor)
|
||||
friend struct CompositorScreenData;
|
||||
friend class Overlay;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <AK/Optional.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibCore/FileWatcher.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibKeyboard/CharacterMap.h>
|
||||
#include <WindowServer/WMConnectionFromClient.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
||||
class KeymapSwitcher final : public Core::Object {
|
||||
class KeymapSwitcher final : public Core::EventReceiver {
|
||||
C_OBJECT(KeymapSwitcher)
|
||||
public:
|
||||
virtual ~KeymapSwitcher() override = default;
|
||||
|
|
|
@ -39,7 +39,7 @@ u32 find_ampersand_shortcut_character(StringView string)
|
|||
}
|
||||
|
||||
Menu::Menu(ConnectionFromClient* client, int menu_id, String name)
|
||||
: Core::Object(client)
|
||||
: Core::EventReceiver(client)
|
||||
, m_client(client)
|
||||
, m_menu_id(menu_id)
|
||||
, m_name(move(name))
|
||||
|
@ -491,7 +491,7 @@ void Menu::event(Core::Event& event)
|
|||
return;
|
||||
}
|
||||
}
|
||||
Core::Object::event(event);
|
||||
Core::EventReceiver::event(event);
|
||||
}
|
||||
|
||||
void Menu::clear_hovered_item()
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
@ -23,7 +23,7 @@ class ConnectionFromClient;
|
|||
class Menubar;
|
||||
class Window;
|
||||
|
||||
class Menu final : public Core::Object {
|
||||
class Menu final : public Core::EventReceiver {
|
||||
C_OBJECT(Menu);
|
||||
|
||||
public:
|
||||
|
|
|
@ -149,7 +149,7 @@ void MenuManager::event(Core::Event& event)
|
|||
}
|
||||
}
|
||||
|
||||
return Core::Object::event(event);
|
||||
return Core::EventReceiver::event(event);
|
||||
}
|
||||
|
||||
void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace WindowServer {
|
||||
|
||||
class MenuManager final : public Core::Object {
|
||||
class MenuManager final : public Core::EventReceiver {
|
||||
C_OBJECT(MenuManager);
|
||||
|
||||
public:
|
||||
|
|
|
@ -84,8 +84,8 @@ static Gfx::Bitmap& move_icon()
|
|||
return *s_icon;
|
||||
}
|
||||
|
||||
Window::Window(Core::Object& parent, WindowType type)
|
||||
: Core::Object(&parent)
|
||||
Window::Window(Core::EventReceiver& parent, WindowType type)
|
||||
: Core::EventReceiver(&parent)
|
||||
, m_type(type)
|
||||
, m_icon(default_window_icon())
|
||||
, m_frame(*this)
|
||||
|
@ -95,7 +95,7 @@ Window::Window(Core::Object& parent, WindowType type)
|
|||
}
|
||||
|
||||
Window::Window(ConnectionFromClient& client, WindowType window_type, WindowMode window_mode, int window_id, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, Window* parent_window)
|
||||
: Core::Object(&client)
|
||||
: Core::EventReceiver(&client)
|
||||
, m_client(&client)
|
||||
, m_type(window_type)
|
||||
, m_mode(window_mode)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/IntrusiveList.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/DisjointRectSet.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
@ -81,7 +81,7 @@ enum class WindowMinimizedState : u32 {
|
|||
Hidden,
|
||||
};
|
||||
|
||||
class Window final : public Core::Object {
|
||||
class Window final : public Core::EventReceiver {
|
||||
C_OBJECT(Window);
|
||||
|
||||
public:
|
||||
|
@ -375,7 +375,7 @@ public:
|
|||
|
||||
private:
|
||||
Window(ConnectionFromClient&, WindowType, WindowMode, int window_id, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, Window* parent_window = nullptr);
|
||||
Window(Core::Object&, WindowType);
|
||||
Window(Core::EventReceiver&, WindowType);
|
||||
|
||||
virtual void event(Core::Event&) override;
|
||||
void handle_mouse_event(MouseEvent const&);
|
||||
|
|
|
@ -1559,7 +1559,7 @@ void WindowManager::event(Core::Event& event)
|
|||
return;
|
||||
}
|
||||
|
||||
Core::Object::event(event);
|
||||
Core::EventReceiver::event(event);
|
||||
}
|
||||
|
||||
bool WindowManager::is_window_in_modal_chain(Window& chain_window, Window& other_window)
|
||||
|
|
|
@ -45,7 +45,7 @@ class DndOverlay;
|
|||
class WindowGeometryOverlay;
|
||||
class TileWindowOverlay;
|
||||
|
||||
class WindowManager : public Core::Object {
|
||||
class WindowManager : public Core::EventReceiver {
|
||||
C_OBJECT(WindowManager)
|
||||
|
||||
friend class Compositor;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
||||
|
@ -17,7 +17,7 @@ namespace WindowServer {
|
|||
class KeyEvent;
|
||||
class Window;
|
||||
|
||||
class WindowSwitcher final : public Core::Object {
|
||||
class WindowSwitcher final : public Core::EventReceiver {
|
||||
C_OBJECT(WindowSwitcher)
|
||||
public:
|
||||
enum class Mode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue