chromium/ui/gfx/x/connection.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_GFX_X_CONNECTION_H_
#define UI_GFX_X_CONNECTION_H_

#include <optional>

#include "base/component_export.h"
#include "base/containers/circular_deque.h"
#include "base/containers/flat_map.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "base/scoped_observation_traits.h"
#include "base/sequence_checker.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/event_observer.h"
#include "ui/gfx/x/extension_manager.h"
#include "ui/gfx/x/future.h"
#include "ui/gfx/x/window_event_manager.h"
#include "ui/gfx/x/xlib_support.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_types.h"

xcb_connection_t;

namespace x11 {

class AtomCache;
class Event;
class KeyboardState;
class PropertyCache;
class VisualManager;
class WmSync;
class WriteBuffer;

enum WmState : uint32_t {};

enum SizeHintsFlags : int32_t {};

struct SizeHints {};

enum WinGravityHint : int32_t {};

enum WmHintsFlags : uint32_t {};

struct WmHints {};

// On the wire, sequence IDs are 16 bits.  In xcb, they're usually extended to
// 32 and sometimes 64 bits.  In Xlib, they're extended to unsigned long, which
// may be 32 or 64 bits depending on the platform.  This function is intended to
// prevent bugs caused by comparing two differently sized sequences.  Also
// handles rollover.  To use, compare the result of this function with 0.  For
// example, to compare seq1 <= seq2, use CompareSequenceIds(seq1, seq2) <= 0.
template <typename T, typename U>
auto CompareSequenceIds(T t, U u) {}

// Represents a socket to the X11 server.
class COMPONENT_EXPORT(X11) Connection final : public XProto,
                                               public ExtensionManager {};

}  // namespace x11

namespace base {

template <>
struct ScopedObservationTraits<x11::Connection, x11::EventObserver> {};

}  // namespace base

#endif  // UI_GFX_X_CONNECTION_H_