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
|
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
package shm
import x "github.com/linuxdeepin/go-x11-client"
// _ns.ext_name: Shm
const MajorVersion = 1
const MinorVersion = 2
var _ext *x.Extension
func Ext() *x.Extension {
return _ext
}
// simple ('xcb', 'Shm', 'SEG')
type Seg uint32
const CompletionEventCode = 0
func NewCompletionEvent(data []byte) (*CompletionEvent, error) {
var ev CompletionEvent
r := x.NewReaderFromData(data)
err := readCompletionEvent(r, &ev)
if err != nil {
return nil, err
}
return &ev, nil
}
const BadSegErrorCode = 0
const QueryVersionOpcode = 0
type QueryVersionCookie x.SeqNum
const AttachOpcode = 1
const DetachOpcode = 2
const PutImageOpcode = 3
const GetImageOpcode = 4
type GetImageCookie x.SeqNum
const CreatePixmapOpcode = 5
const AttachFdOpcode = 6
const CreateSegmentOpcode = 7
type CreateSegmentCookie x.SeqNum
var errorCodeNameMap = map[uint8]string{
BadSegErrorCode: "BadSeg",
}
var requestOpcodeNameMap = map[uint]string{
QueryVersionOpcode: "QueryVersion",
AttachOpcode: "Attach",
DetachOpcode: "Detach",
PutImageOpcode: "PutImage",
GetImageOpcode: "GetImage",
CreatePixmapOpcode: "CreatePixmap",
AttachFdOpcode: "AttachFd",
CreateSegmentOpcode: "CreateSegment",
}
func init() {
_ext = x.NewExtension("MIT-SHM", 0, errorCodeNameMap, requestOpcodeNameMap)
}
|