#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#ifndef UI_GFX_X_XPROTO_INTERNAL_H_
#define UI_GFX_X_XPROTO_INTERNAL_H_
#include <string_view>
#include "base/memory/raw_ptr.h"
#ifndef IS_X11_IMPL
#error "This file should only be included by //ui/gfx/x"
#endif
#include <bitset>
#include <type_traits>
#include "base/component_export.h"
#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "ui/gfx/x/future.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_types.h"
namespace x11 {
class Connection;
template <typename T, typename Enable = void>
struct EnumBase { … };
EnumBase<T, typename std::enable_if_t<std::is_enum<T>::value>>;
EnumBaseType;
template <typename T>
void ReadError(T* error, ReadBuffer* buf);
class COMPONENT_EXPORT(X11) MallocedRefCountedMemory
: public UnsizedRefCountedMemory { … };
class COMPONENT_EXPORT(X11) OffsetRefCountedMemory
: public UnsizedRefCountedMemory { … };
class COMPONENT_EXPORT(X11) UnretainedRefCountedMemory
: public UnsizedRefCountedMemory { … };
template <typename T>
void Read(T* t, ReadBuffer* buf) { … }
inline void Pad(WriteBuffer* buf, size_t amount) { … }
inline void Pad(ReadBuffer* buf, size_t amount) { … }
inline void Align(WriteBuffer* buf, size_t align) { … }
inline void Align(ReadBuffer* buf, size_t align) { … }
template <typename T>
size_t PopCount(T t) { … }
template <typename F, typename T>
auto SumOf(F&& f, T& t) { … }
template <typename T, typename S>
bool CaseEq(T t, S s) { … }
template <typename T, typename S>
bool CaseAnd(T t, S s) { … }
template <typename T, typename S>
auto BitAnd(T t, S s) { … }
template <typename T>
auto BitNot(T t) { … }
template <typename T>
auto SwitchVar(T enum_val, bool condition, bool is_bitcase, T* switch_var) { … }
template <typename T>
std::unique_ptr<T> MakeExtension(Connection* connection,
Future<QueryExtensionReply> future) { … }
}
#endif