mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
SpiceAgent: Rename ClipboardServerConnection
Rename ClipboardServerConnection=>ConnectionToClipboardServer. This was done with CLion's automatic rename feature.
This commit is contained in:
parent
75ee77f8a1
commit
493f604dba
Notes:
sideshowbarker
2024-07-17 23:07:41 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/493f604dba Pull-request: https://github.com/SerenityOS/serenity/pull/12760
6 changed files with 13 additions and 13 deletions
|
@ -6,7 +6,7 @@ serenity_component(
|
|||
set(SOURCES
|
||||
main.cpp
|
||||
SpiceAgent.cpp
|
||||
ClipboardServerConnection.cpp
|
||||
ConnectionToClipboardServer.cpp
|
||||
)
|
||||
|
||||
serenity_bin(SpiceAgent)
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "ClipboardServerConnection.h"
|
||||
#include "ConnectionToClipboardServer.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Function.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
||||
// Copied from LibGUI/Clipboard.cpp
|
||||
RefPtr<Gfx::Bitmap> ClipboardServerConnection::get_bitmap()
|
||||
RefPtr<Gfx::Bitmap> ConnectionToClipboardServer::get_bitmap()
|
||||
{
|
||||
auto clipping = get_clipboard_data();
|
||||
|
||||
|
@ -58,7 +58,7 @@ RefPtr<Gfx::Bitmap> ClipboardServerConnection::get_bitmap()
|
|||
}
|
||||
|
||||
// Copied from LibGUI/Clipboard.cpp
|
||||
void ClipboardServerConnection::set_bitmap(Gfx::Bitmap const& bitmap)
|
||||
void ConnectionToClipboardServer::set_bitmap(Gfx::Bitmap const& bitmap)
|
||||
{
|
||||
HashMap<String, String> metadata;
|
||||
metadata.set("width", String::number(bitmap.width()));
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
class ClipboardServerConnection final
|
||||
class ConnectionToClipboardServer final
|
||||
: public IPC::ConnectionToServer<ClipboardClientEndpoint, ClipboardServerEndpoint>
|
||||
, public ClipboardClientEndpoint {
|
||||
IPC_CLIENT_CONNECTION(ClipboardServerConnection, "/tmp/portal/clipboard")
|
||||
IPC_CLIENT_CONNECTION(ConnectionToClipboardServer, "/tmp/portal/clipboard")
|
||||
|
||||
public:
|
||||
Function<void()> on_data_changed;
|
||||
|
@ -23,7 +23,7 @@ public:
|
|||
void set_bitmap(Gfx::Bitmap const& bitmap);
|
||||
|
||||
private:
|
||||
ClipboardServerConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
|
||||
ConnectionToClipboardServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
|
||||
: IPC::ConnectionToServer<ClipboardClientEndpoint, ClipboardServerEndpoint>(*this, move(socket))
|
||||
{
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "SpiceAgent.h"
|
||||
#include "ClipboardServerConnection.h"
|
||||
#include "ConnectionToClipboardServer.h"
|
||||
#include <AK/String.h>
|
||||
#include <LibC/memory.h>
|
||||
#include <LibC/unistd.h>
|
||||
|
@ -16,7 +16,7 @@
|
|||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGfx/PNGWriter.h>
|
||||
|
||||
SpiceAgent::SpiceAgent(int fd, ClipboardServerConnection& connection)
|
||||
SpiceAgent::SpiceAgent(int fd, ConnectionToClipboardServer& connection)
|
||||
: m_fd(fd)
|
||||
, m_clipboard_connection(connection)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "ClipboardServerConnection.h"
|
||||
#include "ConnectionToClipboardServer.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/Notifier.h>
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
class SpiceAgent {
|
||||
public:
|
||||
SpiceAgent(int fd, ClipboardServerConnection&);
|
||||
SpiceAgent(int fd, ConnectionToClipboardServer&);
|
||||
|
||||
static constexpr u32 AGENT_PROTOCOL = 1;
|
||||
enum class Port {
|
||||
|
@ -117,7 +117,7 @@ public:
|
|||
private:
|
||||
int m_fd { -1 };
|
||||
RefPtr<Core::Notifier> m_notifier;
|
||||
ClipboardServerConnection& m_clipboard_connection;
|
||||
ConnectionToClipboardServer& m_clipboard_connection;
|
||||
|
||||
void on_message_received();
|
||||
void send_message(const ByteBuffer& buffer);
|
||||
|
|
|
@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
|
||||
int serial_port_fd = TRY(Core::System::open(SPICE_DEVICE, O_RDWR));
|
||||
|
||||
auto conn = TRY(ClipboardServerConnection::try_create());
|
||||
auto conn = TRY(ConnectionToClipboardServer::try_create());
|
||||
auto agent = SpiceAgent(serial_port_fd, conn);
|
||||
|
||||
return loop.exec();
|
||||
|
|
Loading…
Reference in a new issue