-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRegion.go
61 lines (44 loc) · 898 Bytes
/
Region.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 Region struct {
id int32
events []func(r *Region, msg message) error
name string
}
func NewRegion() (r *Region) {
r = new(Region)
r.name = "Region"
return
}
func (r *Region) HandleEvent(msg message) {
if r.events[msg.opcode] != nil {
r.events[msg.opcode](r, msg)
}
}
func (r *Region) SetId(id int32) {
r.id = id
}
func (r *Region) Id() int32 {
return r.id
}
func (r *Region) Name() string {
return r.name
}
////
//// REQUESTS
////
func (r *Region) Destroy() {
sendrequest(r, "wl_region_destroy", )
}
func (r *Region) Add(x int32, y int32, width int32, height int32) {
sendrequest(r, "wl_region_add", x, y, width, height)
}
func (r *Region) Subtract(x int32, y int32, width int32, height int32) {
sendrequest(r, "wl_region_subtract", x, y, width, height)
}
////
//// EVENTS
////