#include "ui/ozone/platform/wayland/host/xdg_foreign_wrapper.h"
#include <xdg-foreign-unstable-v1-client-protocol.h>
#include <xdg-foreign-unstable-v2-client-protocol.h>
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
#include "base/ranges/algorithm.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_window.h"
#include "ui/platform_window/platform_window_init_properties.h"
namespace ui {
constexpr uint32_t kMinVersion = …;
OnHandleExported;
namespace {
template <typename ExporterType>
std::unique_ptr<XdgForeignWrapper> CreateWrapper(WaylandConnection* connection,
wl_registry* registry,
uint32_t name,
uint32_t version) { … }
}
template <typename ExportedType>
struct ExportedSurface { … };
class XdgForeignWrapper::XdgForeignWrapperInternal { … };
template <typename ExporterType, typename ExportedType>
class XdgForeignWrapperImpl
: public XdgForeignWrapper::XdgForeignWrapperInternal { … };
template <>
void XdgForeignWrapperImpl<zxdg_exporter_v1, zxdg_exported_v1>::
ExportSurfaceInternal(wl_surface* surface, OnHandleExported cb) { … }
template <>
void XdgForeignWrapperImpl<zxdg_exporter_v2, zxdg_exported_v2>::
ExportSurfaceInternal(wl_surface* surface, OnHandleExported cb) { … }
void XdgForeignWrapper::Instantiate(WaylandConnection* connection,
wl_registry* registry,
uint32_t name,
const std::string& interface,
uint32_t version) { … }
XdgForeignWrapper::XdgForeignWrapper(WaylandConnection* connection,
wl::Object<zxdg_exporter_v1> exporter_v1) { … }
XdgForeignWrapper::XdgForeignWrapper(WaylandConnection* connection,
wl::Object<zxdg_exporter_v2> exporter_v2) { … }
XdgForeignWrapper::~XdgForeignWrapper() = default;
void XdgForeignWrapper::ExportSurfaceToForeign(WaylandWindow* window,
OnHandleExported cb) { … }
void XdgForeignWrapper::OnWindowRemoved(WaylandWindow* window) { … }
}