1// Code generated by wlgen; DO NOT EDIT.
2package cursorshape
3
4import (
5 "fmt"
6 tabletv2 "github.com/bnema/purego-libwayland/protocol/tabletv2"
7 wayland "github.com/bnema/purego-libwayland/protocol/wayland"
8 "github.com/bnema/purego-libwayland/server"
9)
10
11var WpCursorShapeManagerV1Interface *server.Interface
12var WpCursorShapeDeviceV1Interface *server.Interface
13
14func init() {
15 WpCursorShapeManagerV1Interface = &server.Interface{Name: "wp_cursor_shape_manager_v1", Version: 2}
16 WpCursorShapeDeviceV1Interface = &server.Interface{Name: "wp_cursor_shape_device_v1", Version: 2}
17 WpCursorShapeManagerV1Interface.Requests = []server.Message{
18 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
19 {Name: "get_pointer", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, wayland.PointerInterface}},
20 {Name: "get_tablet_tool_v2", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, tabletv2.ZwpTabletToolV2Interface}},
21 }
22 WpCursorShapeManagerV1Interface.Events = []server.Message{}
23 WpCursorShapeDeviceV1Interface.Requests = []server.Message{
24 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
25 {Name: "set_shape", Signature: "uu", Types: []*server.Interface{nil, nil}},
26 }
27 WpCursorShapeDeviceV1Interface.Events = []server.Message{}
28 if err := server.NewInterfaces(WpCursorShapeManagerV1Interface, WpCursorShapeDeviceV1Interface); err != nil {
29 panic(err)
30 }
31}
32
33// WpCursorShapeManagerV1 cursor shape manager.
34type WpCursorShapeManagerV1 struct{ *server.Resource }
35
36func WrapWpCursorShapeManagerV1(r *server.Resource) *WpCursorShapeManagerV1 {
37 if r == nil {
38 return nil
39 }
40 return &WpCursorShapeManagerV1{r}
41}
42
43const WpCursorShapeManagerV1RequestDestroy uint32 = 0
44const WpCursorShapeManagerV1RequestGetPointer uint32 = 1
45const WpCursorShapeManagerV1RequestGetTabletToolV2 uint32 = 2
46
47// WpCursorShapeManagerV1Handler handles wp_cursor_shape_manager_v1 requests.
48type WpCursorShapeManagerV1Handler interface {
49 Destroy(self *WpCursorShapeManagerV1)
50 GetPointer(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, pointer *wayland.Pointer)
51 GetTabletToolV2(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, tabletTool *tabletv2.ZwpTabletToolV2)
52}
53
54func NewWpCursorShapeManagerV1(c server.Client, version int32, id uint32, h WpCursorShapeManagerV1Handler) (*WpCursorShapeManagerV1, error) {
55 if h == nil {
56 return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_manager_v1")
57 }
58 var self *WpCursorShapeManagerV1
59 r, err := c.CreateResource(WpCursorShapeManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
60 switch opcode {
61 case 0:
62 h.Destroy(self)
63 self.Destroy()
64 case 1:
65 h.GetPointer(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource()))
66 case 2:
67 h.GetTabletToolV2(self, args[0].NewID(), tabletv2.WrapZwpTabletToolV2(args[1].Resource()))
68 }
69 })
70 if err != nil {
71 return nil, err
72 }
73 self = WrapWpCursorShapeManagerV1(r)
74 r.Data = self
75 return self, nil
76}
77func NewWpCursorShapeManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
78 return d.CreateGlobal(WpCursorShapeManagerV1Interface, version, bind)
79}
80
81// WpCursorShapeDeviceV1 cursor shape for a device.
82type WpCursorShapeDeviceV1 struct{ *server.Resource }
83
84func WrapWpCursorShapeDeviceV1(r *server.Resource) *WpCursorShapeDeviceV1 {
85 if r == nil {
86 return nil
87 }
88 return &WpCursorShapeDeviceV1{r}
89}
90
91const WpCursorShapeDeviceV1RequestDestroy uint32 = 0
92const WpCursorShapeDeviceV1RequestSetShape uint32 = 1
93
94// WpCursorShapeDeviceV1Shape cursor shapes.
95type WpCursorShapeDeviceV1Shape uint32
96
97const (
98 WpCursorShapeDeviceV1ShapeDefault WpCursorShapeDeviceV1Shape = 1
99 WpCursorShapeDeviceV1ShapeContextMenu WpCursorShapeDeviceV1Shape = 2
100 WpCursorShapeDeviceV1ShapeHelp WpCursorShapeDeviceV1Shape = 3
101 WpCursorShapeDeviceV1ShapePointer WpCursorShapeDeviceV1Shape = 4
102 WpCursorShapeDeviceV1ShapeProgress WpCursorShapeDeviceV1Shape = 5
103 WpCursorShapeDeviceV1ShapeWait WpCursorShapeDeviceV1Shape = 6
104 WpCursorShapeDeviceV1ShapeCell WpCursorShapeDeviceV1Shape = 7
105 WpCursorShapeDeviceV1ShapeCrosshair WpCursorShapeDeviceV1Shape = 8
106 WpCursorShapeDeviceV1ShapeText WpCursorShapeDeviceV1Shape = 9
107 WpCursorShapeDeviceV1ShapeVerticalText WpCursorShapeDeviceV1Shape = 10
108 WpCursorShapeDeviceV1ShapeAlias WpCursorShapeDeviceV1Shape = 11
109 WpCursorShapeDeviceV1ShapeCopy WpCursorShapeDeviceV1Shape = 12
110 WpCursorShapeDeviceV1ShapeMove WpCursorShapeDeviceV1Shape = 13
111 WpCursorShapeDeviceV1ShapeNoDrop WpCursorShapeDeviceV1Shape = 14
112 WpCursorShapeDeviceV1ShapeNotAllowed WpCursorShapeDeviceV1Shape = 15
113 WpCursorShapeDeviceV1ShapeGrab WpCursorShapeDeviceV1Shape = 16
114 WpCursorShapeDeviceV1ShapeGrabbing WpCursorShapeDeviceV1Shape = 17
115 WpCursorShapeDeviceV1ShapeEResize WpCursorShapeDeviceV1Shape = 18
116 WpCursorShapeDeviceV1ShapeNResize WpCursorShapeDeviceV1Shape = 19
117 WpCursorShapeDeviceV1ShapeNeResize WpCursorShapeDeviceV1Shape = 20
118 WpCursorShapeDeviceV1ShapeNwResize WpCursorShapeDeviceV1Shape = 21
119 WpCursorShapeDeviceV1ShapeSResize WpCursorShapeDeviceV1Shape = 22
120 WpCursorShapeDeviceV1ShapeSeResize WpCursorShapeDeviceV1Shape = 23
121 WpCursorShapeDeviceV1ShapeSwResize WpCursorShapeDeviceV1Shape = 24
122 WpCursorShapeDeviceV1ShapeWResize WpCursorShapeDeviceV1Shape = 25
123 WpCursorShapeDeviceV1ShapeEwResize WpCursorShapeDeviceV1Shape = 26
124 WpCursorShapeDeviceV1ShapeNsResize WpCursorShapeDeviceV1Shape = 27
125 WpCursorShapeDeviceV1ShapeNeswResize WpCursorShapeDeviceV1Shape = 28
126 WpCursorShapeDeviceV1ShapeNwseResize WpCursorShapeDeviceV1Shape = 29
127 WpCursorShapeDeviceV1ShapeColResize WpCursorShapeDeviceV1Shape = 30
128 WpCursorShapeDeviceV1ShapeRowResize WpCursorShapeDeviceV1Shape = 31
129 WpCursorShapeDeviceV1ShapeAllScroll WpCursorShapeDeviceV1Shape = 32
130 WpCursorShapeDeviceV1ShapeZoomIn WpCursorShapeDeviceV1Shape = 33
131 WpCursorShapeDeviceV1ShapeZoomOut WpCursorShapeDeviceV1Shape = 34
132 WpCursorShapeDeviceV1ShapeDndAsk WpCursorShapeDeviceV1Shape = 35
133 WpCursorShapeDeviceV1ShapeAllResize WpCursorShapeDeviceV1Shape = 36
134)
135
136// WpCursorShapeDeviceV1Error .
137type WpCursorShapeDeviceV1Error uint32
138
139const (
140 WpCursorShapeDeviceV1ErrorInvalidShape WpCursorShapeDeviceV1Error = 1
141)
142
143// WpCursorShapeDeviceV1Handler handles wp_cursor_shape_device_v1 requests.
144type WpCursorShapeDeviceV1Handler interface {
145 Destroy(self *WpCursorShapeDeviceV1)
146 SetShape(self *WpCursorShapeDeviceV1, serial uint32, shape uint32)
147}
148
149func NewWpCursorShapeDeviceV1(c server.Client, version int32, id uint32, h WpCursorShapeDeviceV1Handler) (*WpCursorShapeDeviceV1, error) {
150 if h == nil {
151 return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_device_v1")
152 }
153 var self *WpCursorShapeDeviceV1
154 r, err := c.CreateResource(WpCursorShapeDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
155 switch opcode {
156 case 0:
157 h.Destroy(self)
158 self.Destroy()
159 case 1:
160 h.SetShape(self, args[0].Uint(), args[1].Uint())
161 }
162 })
163 if err != nil {
164 return nil, err
165 }
166 self = WrapWpCursorShapeDeviceV1(r)
167 r.Data = self
168 return self, nil
169}
170func NewWpCursorShapeDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
171 return d.CreateGlobal(WpCursorShapeDeviceV1Interface, version, bind)
172}
173func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
174 if v == nil {
175 return nil
176 }
177 return v.GetResource()
178}
179func (self *WpCursorShapeManagerV1) GetResource() *server.Resource {
180 if self == nil {
181 return nil
182 }
183 return self.Resource
184}
185func (self *WpCursorShapeDeviceV1) GetResource() *server.Resource {
186 if self == nil {
187 return nil
188 }
189 return self.Resource
190}