File: extension_manager.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (113 lines) | stat: -rw-r--r-- 2,750 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file was automatically generated with:
// ../../ui/gfx/x/gen_xproto.py \
//    ../../third_party/xcbproto/src \
//    gen/ui/gfx/x \
//    bigreq \
//    dri3 \
//    glx \
//    randr \
//    render \
//    screensaver \
//    shape \
//    shm \
//    sync \
//    xfixes \
//    xinput \
//    xkb \
//    xproto \
//    xtest

#ifndef UI_GFX_X_GENERATED_PROTOS_EXTENSION_MANAGER_H_
#define UI_GFX_X_GENERATED_PROTOS_EXTENSION_MANAGER_H_

#include <stdint.h>

#include <memory>

#include "base/component_export.h"

namespace x11 {

class Connection;

class BigRequests;
class Dri3;
class Glx;
class RandR;
class Render;
class ScreenSaver;
class Shape;
class Shm;
class Sync;
class XFixes;
class Input;
class Xkb;
class XProto;
class Test;

class COMPONENT_EXPORT(X11) ExtensionManager {
 public:
  ExtensionManager();
  ~ExtensionManager();

  void GetEventTypeAndOp(const void* raw_event,
                         uint8_t* type_id,
                         uint8_t* opcode) const;

  BigRequests& bigreq() { return *bigreq_; }
  Dri3& dri3() { return *dri3_; }
  Glx& glx() { return *glx_; }
  RandR& randr() { return *randr_; }
  Render& render() { return *render_; }
  ScreenSaver& screensaver() { return *screensaver_; }
  Shape& shape() { return *shape_; }
  Shm& shm() { return *shm_; }
  Sync& sync() { return *sync_; }
  XFixes& xfixes() { return *xfixes_; }
  Input& xinput() { return *xinput_; }
  Xkb& xkb() { return *xkb_; }
  Test& xtest() { return *xtest_; }

 protected:
  void Init(Connection* conn);

 private:
  struct ExtensionGeMap {
    // The extension ID provided by the server.
    uint8_t extension_id = 0;
    // The count of generic events for this extension.
    uint8_t ge_count = 0;
    // The index in `ge_type_ids_` for this extension.
    uint16_t offset = 0;
  };

  std::unique_ptr<BigRequests> bigreq_;
  std::unique_ptr<Dri3> dri3_;
  std::unique_ptr<Glx> glx_;
  std::unique_ptr<RandR> randr_;
  std::unique_ptr<Render> render_;
  std::unique_ptr<ScreenSaver> screensaver_;
  std::unique_ptr<Shape> shape_;
  std::unique_ptr<Shm> shm_;
  std::unique_ptr<Sync> sync_;
  std::unique_ptr<XFixes> xfixes_;
  std::unique_ptr<Input> xinput_;
  std::unique_ptr<Xkb> xkb_;
  std::unique_ptr<Test> xtest_;

  // Event opcodes indexed by response ID.
  uint8_t opcodes_[128] = {};
  // Event type IDs indexed by response ID.
  uint8_t event_type_ids_[128] = {};
  // Generic event type IDs for all extensions.
  uint8_t ge_type_ids_[33] = {};
  ExtensionGeMap ge_extensions_[1] = {};
};

}  // namespace x11

#endif  // UI_GFX_X_GENERATED_PROTOS_EXTENSION_MANAGER_H_