1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:27:35 +00:00

Userland: Rename IPC ClientConnection => ConnectionFromClient

This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
This commit is contained in:
Itamar 2022-02-25 12:18:30 +02:00 committed by Andreas Kling
parent efac862570
commit 3a71748e5d
137 changed files with 896 additions and 896 deletions

View file

@ -8,7 +8,7 @@ compile_ipc(NotificationServer.ipc NotificationServerEndpoint.h)
compile_ipc(NotificationClient.ipc NotificationClientEndpoint.h)
set(SOURCES
ClientConnection.cpp
ConnectionFromClient.cpp
main.cpp
NotificationWindow.cpp
NotificationServerEndpoint.h

View file

@ -4,37 +4,37 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "NotificationWindow.h"
#include <AK/HashMap.h>
#include <NotificationServer/NotificationClientEndpoint.h>
namespace NotificationServer {
static HashMap<int, RefPtr<ClientConnection>> s_connections;
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
: IPC::ClientConnection<NotificationClientEndpoint, NotificationServerEndpoint>(*this, move(client_socket), client_id)
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
: IPC::ConnectionFromClient<NotificationClientEndpoint, NotificationServerEndpoint>(*this, move(client_socket), client_id)
{
s_connections.set(client_id, *this);
}
ClientConnection::~ClientConnection()
ConnectionFromClient::~ConnectionFromClient()
{
}
void ClientConnection::die()
void ConnectionFromClient::die()
{
s_connections.remove(client_id());
}
void ClientConnection::show_notification(String const& text, String const& title, Gfx::ShareableBitmap const& icon)
void ConnectionFromClient::show_notification(String const& text, String const& title, Gfx::ShareableBitmap const& icon)
{
auto window = NotificationWindow::construct(client_id(), text, title, icon);
window->show();
}
void ClientConnection::close_notification()
void ConnectionFromClient::close_notification()
{
auto window = NotificationWindow::get_window_by_id(client_id());
if (window) {
@ -42,7 +42,7 @@ void ClientConnection::close_notification()
}
}
Messages::NotificationServer::UpdateNotificationIconResponse ClientConnection::update_notification_icon(Gfx::ShareableBitmap const& icon)
Messages::NotificationServer::UpdateNotificationIconResponse ConnectionFromClient::update_notification_icon(Gfx::ShareableBitmap const& icon)
{
auto window = NotificationWindow::get_window_by_id(client_id());
if (window) {
@ -51,7 +51,7 @@ Messages::NotificationServer::UpdateNotificationIconResponse ClientConnection::u
return !!window;
}
Messages::NotificationServer::UpdateNotificationTextResponse ClientConnection::update_notification_text(String const& text, String const& title)
Messages::NotificationServer::UpdateNotificationTextResponse ConnectionFromClient::update_notification_text(String const& text, String const& title)
{
auto window = NotificationWindow::get_window_by_id(client_id());
if (window) {
@ -61,7 +61,7 @@ Messages::NotificationServer::UpdateNotificationTextResponse ClientConnection::u
return !!window;
}
Messages::NotificationServer::IsShowingResponse ClientConnection::is_showing()
Messages::NotificationServer::IsShowingResponse ConnectionFromClient::is_showing()
{
auto window = NotificationWindow::get_window_by_id(client_id());
return !!window;

View file

@ -6,7 +6,7 @@
#pragma once
#include <LibIPC/ClientConnection.h>
#include <LibIPC/ConnectionFromClient.h>
#include <WindowServer/ScreenLayout.h>
// Must be included after WindowServer/ScreenLayout.h
@ -15,15 +15,15 @@
namespace NotificationServer {
class ClientConnection final : public IPC::ClientConnection<NotificationClientEndpoint, NotificationServerEndpoint> {
C_OBJECT(ClientConnection)
class ConnectionFromClient final : public IPC::ConnectionFromClient<NotificationClientEndpoint, NotificationServerEndpoint> {
C_OBJECT(ConnectionFromClient)
public:
~ClientConnection() override;
~ConnectionFromClient() override;
virtual void die() override;
private:
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
virtual void show_notification(String const&, String const&, Gfx::ShareableBitmap const&) override;
virtual void close_notification() override;

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibIPC/MultiServer.h>
@ -15,7 +15,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio recvfd sendfd accept rpath unix"));
auto app = TRY(GUI::Application::try_create(arguments));
auto server = TRY(IPC::MultiServer<NotificationServer::ClientConnection>::try_create());
auto server = TRY(IPC::MultiServer<NotificationServer::ConnectionFromClient>::try_create());
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil(nullptr, nullptr));