mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
6e19ab2bbc
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
/*
|
|
* Copyright (c) 2021, Kyle Pereira <kyle@xylepereira.me>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Function.h>
|
|
#include <Clipboard/ClipboardClientEndpoint.h>
|
|
#include <Clipboard/ClipboardServerEndpoint.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <LibIPC/ConnectionToServer.h>
|
|
|
|
class ConnectionToClipboardServer final
|
|
: public IPC::ConnectionToServer<ClipboardClientEndpoint, ClipboardServerEndpoint>
|
|
, public ClipboardClientEndpoint {
|
|
IPC_CLIENT_CONNECTION(ConnectionToClipboardServer, "/tmp/session/%sid/portal/clipboard"sv)
|
|
|
|
public:
|
|
Function<void()> on_data_changed;
|
|
RefPtr<Gfx::Bitmap> get_bitmap();
|
|
void set_bitmap(Gfx::Bitmap const& bitmap);
|
|
|
|
private:
|
|
ConnectionToClipboardServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
|
|
: IPC::ConnectionToServer<ClipboardClientEndpoint, ClipboardServerEndpoint>(*this, move(socket))
|
|
{
|
|
}
|
|
virtual void clipboard_data_changed(DeprecatedString const&) override
|
|
{
|
|
on_data_changed();
|
|
}
|
|
};
|