#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/host/linux/x_server_clipboard.h"
#include <limits>
#include "base/containers/contains.h"
#include "base/containers/span.h"
#include "base/functional/callback.h"
#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_util.h"
#include "remoting/base/constants.h"
#include "remoting/base/logging.h"
#include "remoting/base/util.h"
#include "ui/gfx/x/extension_manager.h"
#include "ui/gfx/x/future.h"
#include "ui/gfx/x/xproto.h"
namespace remoting {
XServerClipboard::XServerClipboard() = default;
XServerClipboard::~XServerClipboard() = default;
void XServerClipboard::Init(x11::Connection* connection,
const ClipboardChangedCallback& callback) { … }
void XServerClipboard::SetClipboard(const std::string& mime_type,
const std::string& data) { … }
void XServerClipboard::ProcessXEvent(const x11::Event& event) { … }
void XServerClipboard::OnSetSelectionOwnerNotify(x11::Atom selection,
x11::Time timestamp) { … }
void XServerClipboard::OnPropertyNotify(const x11::PropertyNotifyEvent& event) { … }
void XServerClipboard::OnSelectionNotify(
const x11::SelectionNotifyEvent& event) { … }
void XServerClipboard::OnSelectionRequest(
const x11::SelectionRequestEvent& event) { … }
void XServerClipboard::OnSelectionClear(const x11::SelectionClearEvent& event) { … }
void XServerClipboard::SendTargetsResponse(x11::Window requestor,
x11::Atom property) { … }
void XServerClipboard::SendTimestampResponse(x11::Window requestor,
x11::Atom property) { … }
void XServerClipboard::SendStringResponse(x11::Window requestor,
x11::Atom property,
x11::Atom target) { … }
void XServerClipboard::HandleSelectionNotify(
const x11::SelectionNotifyEvent& event,
x11::Atom type,
int format,
int item_count,
const void* data) { … }
bool XServerClipboard::HandleSelectionTargetsEvent(
const x11::SelectionNotifyEvent& event,
int format,
int item_count,
const void* data) { … }
bool XServerClipboard::HandleSelectionStringEvent(
const x11::SelectionNotifyEvent& event,
int format,
int item_count,
const void* data) { … }
void XServerClipboard::NotifyClipboardText(const std::string& text) { … }
void XServerClipboard::RequestSelectionTargets(x11::Atom selection) { … }
void XServerClipboard::RequestSelectionString(x11::Atom selection,
x11::Atom target) { … }
void XServerClipboard::AssertSelectionOwnership(x11::Atom selection) { … }
bool XServerClipboard::IsSelectionOwner(x11::Atom selection) { … }
}