#ifndef UI_OZONE_PLATFORM_WAYLAND_TEST_SERVER_OBJECT_H_
#define UI_OZONE_PLATFORM_WAYLAND_TEST_SERVER_OBJECT_H_
#include <memory>
#include <type_traits>
#include <utility>
#include <wayland-server-core.h>
#include "base/memory/raw_ptr.h"
struct wl_client;
struct wl_resource;
namespace wl {
class ServerObject { … };
template <class T>
T* GetUserDataAs(wl_resource* resource) { … }
template <class T>
std::unique_ptr<T> TakeUserDataAs(wl_resource* resource) { … }
template <class T>
void DestroyUserData(wl_resource* resource) { … }
template <class T>
void SetImplementation(wl_resource* resource,
const void* implementation,
std::unique_ptr<T> user_data) { … }
template <typename ImplClass, typename... ImplArgs>
wl_resource* CreateResourceWithImpl(wl_client* client,
const struct wl_interface* interface,
int version,
const void* implementation,
uint32_t id,
ImplArgs&&... impl_args) { … }
template <class T>
void SetImplementationUnretained(wl_resource* resource,
const void* implementation,
T* user_data) { … }
bool ResourceHasImplementation(wl_resource* resource,
const wl_interface* interface,
const void* impl);
void DestroyResource(wl_client* client, wl_resource* resource);
}
#endif