#include "ui/gfx/x/connection.h"
#include <xcb/xcb.h>
#include <xcb/xcbext.h>
#include <algorithm>
#include <string>
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/no_destructor.h"
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_local.h"
#include "base/trace_event/trace_event.h"
#include "ui/gfx/switches.h"
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/bigreq.h"
#include "ui/gfx/x/dri3.h"
#include "ui/gfx/x/event.h"
#include "ui/gfx/x/glx.h"
#include "ui/gfx/x/keyboard_state.h"
#include "ui/gfx/x/property_cache.h"
#include "ui/gfx/x/randr.h"
#include "ui/gfx/x/render.h"
#include "ui/gfx/x/screensaver.h"
#include "ui/gfx/x/shape.h"
#include "ui/gfx/x/shm.h"
#include "ui/gfx/x/sync.h"
#include "ui/gfx/x/visual_manager.h"
#include "ui/gfx/x/window_event_manager.h"
#include "ui/gfx/x/wm_sync.h"
#include "ui/gfx/x/xfixes.h"
#include "ui/gfx/x/xinput.h"
#include "ui/gfx/x/xkb.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_internal.h"
#include "ui/gfx/x/xproto_types.h"
#include "ui/gfx/x/xtest.h"
namespace x11 {
namespace {
base::ThreadLocalOwnedPointer<Connection>& GetConnectionTLS() { … }
void DefaultErrorHandler(const Error* error, const char* request_name) { … }
void DefaultIOErrorHandler() { … }
class UnknownError : public Error { … };
Window GetWindowPropertyAsWindow(const GetPropertyResponse& value) { … }
}
Connection* Connection::Get() { … }
void Connection::Set(std::unique_ptr<Connection> connection) { … }
Connection::Connection(const std::string& address)
: … { … }
Connection::~Connection() { … }
size_t Connection::MaxRequestSizeInBytes() const { … }
XlibDisplay& Connection::GetXlibDisplay() { … }
void Connection::DeleteProperty(Window window, Atom name) { … }
void Connection::SetStringProperty(Window window,
Atom property,
Atom type,
const std::string& value) { … }
Window Connection::CreateDummyWindow(const std::string& name) { … }
VisualManager& Connection::GetOrCreateVisualManager() { … }
bool Connection::GetWmNormalHints(Window window, SizeHints* hints) { … }
void Connection::SetWmNormalHints(Window window, const SizeHints& hints) { … }
bool Connection::GetWmHints(Window window, WmHints* hints) { … }
void Connection::SetWmHints(Window window, const WmHints& hints) { … }
void Connection::WithdrawWindow(Window window) { … }
void Connection::RaiseWindow(Window window) { … }
void Connection::LowerWindow(Window window) { … }
void Connection::DefineCursor(Window window, Cursor cursor) { … }
ScopedEventSelector Connection::ScopedSelectEvent(Window window,
EventMask event_mask) { … }
Atom Connection::GetAtom(const char* name) const { … }
std::string Connection::GetWmName() const { … }
bool Connection::WmSupportsHint(Atom atom) const { … }
Connection::Request::Request(ResponseCallback callback)
: … { … }
Connection::Request::Request(Request&& other) = default;
Connection::Request::~Request() = default;
void Connection::Request::SetResponse(Connection* connection,
void* raw_reply,
void* raw_error) { … }
bool Connection::HasNextResponse() { … }
bool Connection::HasNextEvent() { … }
int Connection::GetFd() { … }
const std::string& Connection::DisplayString() const { … }
std::string Connection::GetConnectionHostname() const { … }
int Connection::DefaultScreenId() const { … }
bool Connection::Ready() const { … }
void Connection::Flush() { … }
void Connection::Sync() { … }
void Connection::SynchronizeForTest(bool synchronous) { … }
void Connection::ReadResponses() { … }
bool Connection::ReadResponse(bool queued) { … }
bool Connection::HasPendingResponses() { … }
const Connection::VisualInfo* Connection::GetVisualInfoFromId(
VisualId id) const { … }
KeyCode Connection::KeysymToKeycode(uint32_t keysym) const { … }
uint32_t Connection::KeycodeToKeysym(KeyCode keycode,
uint32_t modifiers) const { … }
std::unique_ptr<Connection> Connection::Clone() const { … }
void Connection::DetachFromSequence() { … }
bool Connection::Dispatch() { … }
void Connection::DispatchAll() { … }
void Connection::DispatchEvent(const Event& event) { … }
void Connection::SetIOErrorHandler(IOErrorHandler new_handler) { … }
void Connection::AddEventObserver(EventObserver* observer) { … }
void Connection::RemoveEventObserver(EventObserver* observer) { … }
xcb_connection_t* Connection::XcbConnection() { … }
void Connection::InitRootDepthAndVisual() { … }
void Connection::InitializeExtensions() { … }
void Connection::ProcessNextEvent() { … }
void Connection::ProcessNextResponse() { … }
Future<void> Connection::SetArrayPropertyImpl(
Window window,
Atom name,
Atom type,
uint8_t format,
base::span<const uint8_t> values) { … }
std::unique_ptr<FutureImpl> Connection::SendRequestImpl(
WriteBuffer* buf,
const char* request_name_for_tracing,
bool generates_reply,
bool reply_has_fds) { … }
void Connection::WaitForResponse(FutureImpl* future) { … }
Connection::Request* Connection::GetRequestForFuture(FutureImpl* future) { … }
void Connection::PreDispatchEvent(const Event& event) { … }
int Connection::ScreenIndexFromRootWindow(Window root) const { … }
std::unique_ptr<Error> Connection::ParseError(RawError error_bytes) { … }
uint32_t Connection::GenerateIdImpl() { … }
void Connection::OnRootPropertyChanged(Atom property,
const GetPropertyResponse& value) { … }
bool Connection::WmSupportsEwmh() const { … }
void Connection::AttemptSyncWithWm() { … }
void Connection::OnWmSynced() { … }
}