-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathShmPool.go
61 lines (44 loc) · 943 Bytes
/
ShmPool.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
package gowl
import (
"bytes"
)
var _ bytes.Buffer
type ShmPool struct {
id int32
events []func(s *ShmPool, msg message) error
name string
}
func NewShmPool() (s *ShmPool) {
s = new(ShmPool)
s.name = "ShmPool"
return
}
func (s *ShmPool) HandleEvent(msg message) {
if s.events[msg.opcode] != nil {
s.events[msg.opcode](s, msg)
}
}
func (s *ShmPool) SetId(id int32) {
s.id = id
}
func (s *ShmPool) Id() int32 {
return s.id
}
func (s *ShmPool) Name() string {
return s.name
}
////
//// REQUESTS
////
func (s *ShmPool) CreateBuffer(id *Buffer, offset int32, width int32, height int32, stride int32, format uint32) {
sendrequest(s, "wl_shm_pool_create_buffer", id, offset, width, height, stride, format)
}
func (s *ShmPool) Destroy() {
sendrequest(s, "wl_shm_pool_destroy", )
}
func (s *ShmPool) Resize(size int32) {
sendrequest(s, "wl_shm_pool_resize", size)
}
////
//// EVENTS
////