-
Notifications
You must be signed in to change notification settings - Fork 0
/
composite.go
76 lines (63 loc) · 1.33 KB
/
composite.go
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
package composite
import "github.com/linuxdeepin/go-x11-client"
// #WREQ
func encodeQueryVersion(majorVersion, minorVersion uint32) (b x.RequestBody) {
b.AddBlock(2).
Write4b(majorVersion).
Write4b(minorVersion).
End()
return
}
type QueryVersionReply struct {
MajorVersion uint32
MinorVersion uint32
}
func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error {
if !r.RemainAtLeast4b(4) {
return x.ErrDataLenShort
}
r.ReadPad(8)
v.MajorVersion = r.Read4b()
v.MinorVersion = r.Read4b() // 4
return nil
}
// #WREQ
func encodeRedirectWindow(window x.Window, update uint8) (b x.RequestBody) {
b.AddBlock(2).
Write4b(uint32(window)).
Write1b(update).
WritePad(3).
End()
return
}
// #WREQ
func encodeRedirectSubwindows(window x.Window, update uint8) (b x.RequestBody) {
b.AddBlock(2).
Write4b(uint32(window)).
Write1b(update).
WritePad(3).
End()
return
}
// #WREQ
func encodeUnredirectWindow(window x.Window) (b x.RequestBody) {
b.AddBlock(1).
Write4b(uint32(window)).
End()
return
}
// #WREQ
func encodeUnredirectSubwindows(window x.Window) (b x.RequestBody) {
b.AddBlock(1).
Write4b(uint32(window)).
End()
return
}
// #WREQ
func encodeNameWindowPixmap(window x.Window, pixmap x.Pixmap) (b x.RequestBody) {
b.AddBlock(2).
Write4b(uint32(window)).
Write4b(uint32(pixmap)).
End()
return
}