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 (75 lines) | stat: -rw-r--r-- 1,411 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
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

package screensaver

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

// _ns.ext_name: ScreenSaver
const MajorVersion = 1
const MinorVersion = 1

var _ext *x.Extension

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

// enum Kind
const (
	KindBlanked  = 0
	KindInternal = 1
	KindExternal = 2
)

// enum Event
const (
	EventNotifyMask = 1
	EventCycleMask  = 2
)

// enum State
const (
	StateOff      = 0
	StateOn       = 1
	StateCycle    = 2
	StateDisabled = 3
)

const QueryVersionOpcode = 0

type QueryVersionCookie x.SeqNum

const QueryInfoOpcode = 1

type QueryInfoCookie x.SeqNum

const SelectInputOpcode = 2
const SetAttributesOpcode = 3
const UnsetAttributesOpcode = 4
const SuspendOpcode = 5
const NotifyEventCode = 0

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 requestOpcodeNameMap = map[uint]string{
	QueryVersionOpcode:    "QueryVersion",
	QueryInfoOpcode:       "QueryInfo",
	SelectInputOpcode:     "SelectInput",
	SetAttributesOpcode:   "SetAttributes",
	UnsetAttributesOpcode: "UnsetAttributes",
	SuspendOpcode:         "Suspend",
}

func init() {
	_ext = x.NewExtension("MIT-SCREEN-SAVER", 0, nil, requestOpcodeNameMap)
}