File: auto.go

package info (click to toggle)
golang-github-linuxdeepin-go-x11-client 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,784 kB
  • sloc: python: 944; sh: 38; makefile: 17
file content (325 lines) | stat: -rw-r--r-- 8,187 bytes parent folder | download
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

package randr

import x "github.com/linuxdeepin/go-x11-client"

// _ns.ext_name: RandR
const MajorVersion = 1
const MinorVersion = 6

var _ext *x.Extension

func Ext() *x.Extension {
	return _ext
}

// simple ('xcb', 'RandR', 'MODE')
type Mode uint32

// simple ('xcb', 'RandR', 'CRTC')
type Crtc uint32

// simple ('xcb', 'RandR', 'OUTPUT')
type Output uint32

// simple ('xcb', 'RandR', 'PROVIDER')
type Provider uint32

// simple ('xcb', 'RandR', 'LEASE')
type Lease uint32

const BadOutputErrorCode = 0
const BadCrtcErrorCode = 1
const BadModeErrorCode = 2
const BadProviderErrorCode = 3

// enum Rotation
const (
	RotationRotate0   = 1
	RotationRotate90  = 2
	RotationRotate180 = 4
	RotationRotate270 = 8
	RotationReflectX  = 16
	RotationReflectY  = 32
)

const QueryVersionOpcode = 0

type QueryVersionCookie x.SeqNum

// enum SetConfig
const (
	SetConfigSuccess           = 0
	SetConfigInvalidConfigTime = 1
	SetConfigInvalidTime       = 2
	SetConfigFailed            = 3
)

const SetScreenConfigOpcode = 2

type SetScreenConfigCookie x.SeqNum

// enum NotifyMask
const (
	NotifyMaskScreenChange     = 1
	NotifyMaskCrtcChange       = 2
	NotifyMaskOutputChange     = 4
	NotifyMaskOutputProperty   = 8
	NotifyMaskProviderChange   = 16
	NotifyMaskProviderProperty = 32
	NotifyMaskResourceChange   = 64
	NotifyMaskLease            = 128
)

const SelectInputOpcode = 4
const GetScreenInfoOpcode = 5

type GetScreenInfoCookie x.SeqNum

const GetScreenSizeRangeOpcode = 6

type GetScreenSizeRangeCookie x.SeqNum

const SetScreenSizeOpcode = 7

// enum ModeFlag
const (
	ModeFlagHsyncPositive  = 1
	ModeFlagHsyncNegative  = 2
	ModeFlagVsyncPositive  = 4
	ModeFlagVsyncNegative  = 8
	ModeFlagInterlace      = 16
	ModeFlagDoubleScan     = 32
	ModeFlagCsync          = 64
	ModeFlagCsyncPositive  = 128
	ModeFlagCsyncNegative  = 256
	ModeFlagHskewPresent   = 512
	ModeFlagBcast          = 1024
	ModeFlagPixelMultiplex = 2048
	ModeFlagDoubleClock    = 4096
	ModeFlagHalveClock     = 8192
)

const GetScreenResourcesOpcode = 8

type GetScreenResourcesCookie x.SeqNum

// enum Connection
const (
	ConnectionConnected    = 0
	ConnectionDisconnected = 1
	ConnectionUnknown      = 2
)

const GetOutputInfoOpcode = 9

type GetOutputInfoCookie x.SeqNum

const ListOutputPropertiesOpcode = 10

type ListOutputPropertiesCookie x.SeqNum

const QueryOutputPropertyOpcode = 11

type QueryOutputPropertyCookie x.SeqNum

const ConfigureOutputPropertyOpcode = 12
const ChangeOutputPropertyOpcode = 13
const DeleteOutputPropertyOpcode = 14
const GetOutputPropertyOpcode = 15

type GetOutputPropertyCookie x.SeqNum

const CreateModeOpcode = 16

type CreateModeCookie x.SeqNum

const DestroyModeOpcode = 17
const AddOutputModeOpcode = 18
const DeleteOutputModeOpcode = 19
const GetCrtcInfoOpcode = 20

type GetCrtcInfoCookie x.SeqNum

const SetCrtcConfigOpcode = 21

type SetCrtcConfigCookie x.SeqNum

const GetCrtcGammaSizeOpcode = 22

type GetCrtcGammaSizeCookie x.SeqNum

const GetCrtcGammaOpcode = 23

type GetCrtcGammaCookie x.SeqNum

const SetCrtcGammaOpcode = 24
const GetScreenResourcesCurrentOpcode = 25

type GetScreenResourcesCurrentCookie x.SeqNum

// enum Transform
const (
	TransformUnit       = 1
	TransformScaleUp    = 2
	TransformScaleDown  = 4
	TransformProjective = 8
)

const SetCrtcTransformOpcode = 26
const GetCrtcTransformOpcode = 27

type GetCrtcTransformCookie x.SeqNum

const GetPanningOpcode = 28

type GetPanningCookie x.SeqNum

const SetPanningOpcode = 29

type SetPanningCookie x.SeqNum

const SetOutputPrimaryOpcode = 30
const GetOutputPrimaryOpcode = 31

type GetOutputPrimaryCookie x.SeqNum

const GetProvidersOpcode = 32

type GetProvidersCookie x.SeqNum

// enum ProviderCapability
const (
	ProviderCapabilitySourceOutput  = 1
	ProviderCapabilitySinkOutput    = 2
	ProviderCapabilitySourceOffload = 4
	ProviderCapabilitySinkOffload   = 8
)

const GetProviderInfoOpcode = 33

type GetProviderInfoCookie x.SeqNum

const SetProviderOffloadSinkOpcode = 34
const SetProviderOutputSourceOpcode = 35
const ListProviderPropertiesOpcode = 36

type ListProviderPropertiesCookie x.SeqNum

const QueryProviderPropertyOpcode = 37

type QueryProviderPropertyCookie x.SeqNum

const ConfigureProviderPropertyOpcode = 38
const ChangeProviderPropertyOpcode = 39
const DeleteProviderPropertyOpcode = 40
const GetProviderPropertyOpcode = 41

type GetProviderPropertyCookie x.SeqNum

const ScreenChangeNotifyEventCode = 0

func NewScreenChangeNotifyEvent(data []byte) (*ScreenChangeNotifyEvent, error) {
	var ev ScreenChangeNotifyEvent
	r := x.NewReaderFromData(data)
	err := readScreenChangeNotifyEvent(r, &ev)
	if err != nil {
		return nil, err
	}
	return &ev, nil
}

// enum Notify
const (
	NotifyCrtcChange       = 0
	NotifyOutputChange     = 1
	NotifyOutputProperty   = 2
	NotifyProviderChange   = 3
	NotifyProviderProperty = 4
	NotifyResourceChange   = 5
	NotifyLease            = 6
)

const GetMonitorsOpcode = 42

type GetMonitorsCookie x.SeqNum

const SetMonitorOpcode = 43
const DeleteMonitorOpcode = 44
const CreateLeaseOpcode = 45

type CreateLeaseCookie x.SeqNum

const FreeLeaseOpcode = 46
const NotifyEventCode = 1

func NewNotifyEvent(data []byte) (*NotifyEvent, error) {
	var ev NotifyEvent
	r := x.NewReaderFromData(data)
	err := readNotifyEvent(r, &ev)
	if err != nil {
		return nil, err
	}
	return &ev, nil
}

var errorCodeNameMap = map[uint8]string{
	BadOutputErrorCode:   "BadOutput",
	BadCrtcErrorCode:     "BadCrtc",
	BadModeErrorCode:     "BadMode",
	BadProviderErrorCode: "BadProvider",
}
var requestOpcodeNameMap = map[uint]string{
	QueryVersionOpcode:              "QueryVersion",
	SetScreenConfigOpcode:           "SetScreenConfig",
	SelectInputOpcode:               "SelectInput",
	GetScreenInfoOpcode:             "GetScreenInfo",
	GetScreenSizeRangeOpcode:        "GetScreenSizeRange",
	SetScreenSizeOpcode:             "SetScreenSize",
	GetScreenResourcesOpcode:        "GetScreenResources",
	GetOutputInfoOpcode:             "GetOutputInfo",
	ListOutputPropertiesOpcode:      "ListOutputProperties",
	QueryOutputPropertyOpcode:       "QueryOutputProperty",
	ConfigureOutputPropertyOpcode:   "ConfigureOutputProperty",
	ChangeOutputPropertyOpcode:      "ChangeOutputProperty",
	DeleteOutputPropertyOpcode:      "DeleteOutputProperty",
	GetOutputPropertyOpcode:         "GetOutputProperty",
	CreateModeOpcode:                "CreateMode",
	DestroyModeOpcode:               "DestroyMode",
	AddOutputModeOpcode:             "AddOutputMode",
	DeleteOutputModeOpcode:          "DeleteOutputMode",
	GetCrtcInfoOpcode:               "GetCrtcInfo",
	SetCrtcConfigOpcode:             "SetCrtcConfig",
	GetCrtcGammaSizeOpcode:          "GetCrtcGammaSize",
	GetCrtcGammaOpcode:              "GetCrtcGamma",
	SetCrtcGammaOpcode:              "SetCrtcGamma",
	GetScreenResourcesCurrentOpcode: "GetScreenResourcesCurrent",
	SetCrtcTransformOpcode:          "SetCrtcTransform",
	GetCrtcTransformOpcode:          "GetCrtcTransform",
	GetPanningOpcode:                "GetPanning",
	SetPanningOpcode:                "SetPanning",
	SetOutputPrimaryOpcode:          "SetOutputPrimary",
	GetOutputPrimaryOpcode:          "GetOutputPrimary",
	GetProvidersOpcode:              "GetProviders",
	GetProviderInfoOpcode:           "GetProviderInfo",
	SetProviderOffloadSinkOpcode:    "SetProviderOffloadSink",
	SetProviderOutputSourceOpcode:   "SetProviderOutputSource",
	ListProviderPropertiesOpcode:    "ListProviderProperties",
	QueryProviderPropertyOpcode:     "QueryProviderProperty",
	ConfigureProviderPropertyOpcode: "ConfigureProviderProperty",
	ChangeProviderPropertyOpcode:    "ChangeProviderProperty",
	DeleteProviderPropertyOpcode:    "DeleteProviderProperty",
	GetProviderPropertyOpcode:       "GetProviderProperty",
	GetMonitorsOpcode:               "GetMonitors",
	SetMonitorOpcode:                "SetMonitor",
	DeleteMonitorOpcode:             "DeleteMonitor",
	CreateLeaseOpcode:               "CreateLease",
	FreeLeaseOpcode:                 "FreeLease",
}

func init() {
	_ext = x.NewExtension("RANDR", 3, errorCodeNameMap, requestOpcodeNameMap)
}