#include "ui/ozone/platform/wayland/host/wayland_clipboard.h"
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "ui/base/clipboard/clipboard_buffer.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/ozone/platform/wayland/common/wayland_object.h"
#include "ui/ozone/platform/wayland/host/gtk_primary_selection_device.h"
#include "ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_data_device.h"
#include "ui/ozone/platform/wayland/host/wayland_data_device_base.h"
#include "ui/ozone/platform/wayland/host/wayland_data_device_manager.h"
#include "ui/ozone/platform/wayland/host/wayland_data_offer_base.h"
#include "ui/ozone/platform/wayland/host/wayland_data_source.h"
#include "ui/ozone/platform/wayland/host/wayland_serial_tracker.h"
#include "ui/ozone/platform/wayland/host/zwp_primary_selection_device.h"
#include "ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.h"
#include "ui/ozone/public/platform_clipboard.h"
namespace wl {
class Clipboard { … };
template <typename Manager,
typename DataSource = typename Manager::DataSource,
typename DataDevice = typename Manager::DataDevice>
class ClipboardImpl final : public Clipboard, public DataSource::Delegate { … };
}
namespace ui {
WaylandClipboard::WaylandClipboard(WaylandConnection* connection,
WaylandDataDeviceManager* manager)
: … { … }
WaylandClipboard::~WaylandClipboard() = default;
void WaylandClipboard::OfferClipboardData(
ClipboardBuffer buffer,
const PlatformClipboard::DataMap& data_map,
PlatformClipboard::OfferDataClosure callback) { … }
void WaylandClipboard::RequestClipboardData(
ClipboardBuffer buffer,
const std::string& mime_type,
PlatformClipboard::RequestDataClosure callback) { … }
void WaylandClipboard::GetAvailableMimeTypes(
ClipboardBuffer buffer,
PlatformClipboard::GetMimeTypesClosure callback) { … }
bool WaylandClipboard::IsSelectionOwner(ClipboardBuffer buffer) { … }
void WaylandClipboard::SetClipboardDataChangedCallback(
ClipboardDataChangedCallback data_changed_callback) { … }
bool WaylandClipboard::IsSelectionBufferAvailable() const { … }
wl::Clipboard* WaylandClipboard::GetClipboard(ClipboardBuffer buffer) { … }
}