#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/ozone/platform/wayland/host/wayland_data_source.h"
#include <gtk-primary-selection-client-protocol.h>
#include <primary-selection-unstable-v1-client-protocol.h>
#include <cstdint>
#include <vector>
#include "base/files/file_util.h"
#include "base/logging.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/events/base_event_utils.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
namespace wl {
template <typename T>
DataSource<T>::DataSource(T* data_source,
ui::WaylandConnection* connection,
Delegate* delegate)
: … { … }
template <typename T>
DataSource<T>::~DataSource() { … }
template <typename T>
void DataSource<T>::HandleDropEvent() { … }
template <typename T>
void DataSource<T>::HandleFinishEvent(bool completed) { … }
bool WriteDataNonBlocking(int fd, const std::string& data_str) { … }
template <typename T>
void DataSource<T>::HandleSendEvent(const std::string& mime_type, int32_t fd) { … }
template <typename T>
void DataSource<T>::OnSend(void* data,
T* source,
const char* mime_type,
int32_t fd) { … }
template <typename T>
void DataSource<T>::OnCancelled(void* data, T* source) { … }
template <typename T>
void DataSource<T>::OnDndFinished(void* data, T* source) { … }
template <typename T>
void DataSource<T>::OnAction(void* data, T* source, uint32_t dnd_action) { … }
template <typename T>
void DataSource<T>::OnTarget(void* data, T* source, const char* mime_type) { … }
template <typename T>
void DataSource<T>::OnDndDropPerformed(void* data, T* source) { … }
template <>
void DataSource<wl_data_source>::Initialize() { … }
template <>
void DataSource<wl_data_source>::Offer(
const std::vector<std::string>& mime_types) { … }
template <typename T>
void DataSource<T>::SetDndActions(uint32_t dnd_actions) { … }
template <>
void DataSource<wl_data_source>::SetDndActions(uint32_t dnd_actions) { … }
template class DataSource<wl_data_source>;
template <>
void DataSource<gtk_primary_selection_source>::Initialize() { … }
template <>
void DataSource<gtk_primary_selection_source>::Offer(
const std::vector<std::string>& mime_types) { … }
template <>
void DataSource<zwp_primary_selection_source_v1>::Initialize() { … }
template <>
void DataSource<zwp_primary_selection_source_v1>::Offer(
const std::vector<std::string>& mime_types) { … }
template class DataSource<gtk_primary_selection_source>;
template class DataSource<zwp_primary_selection_source_v1>;
}