1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// neferwl private protocol. No stability promise beyond the version of the
5// interface.
6
7package imagecapture
8
9import (
10 "fmt"
11 extimagecapturesource "github.com/bnema/go-wayland-bindings/server/extimagecapturesource"
12 extimagecopycapture "github.com/bnema/go-wayland-bindings/server/extimagecopycapture"
13 extworkspace "github.com/bnema/go-wayland-bindings/server/extworkspace"
14 wayland "github.com/bnema/go-wayland-bindings/server/wayland"
15 "github.com/bnema/purego-libwayland/server"
16 "runtime"
17)
18
19var NeferwlImageCaptureSourceManagerV1Interface *server.Interface
20var NeferwlWorkspaceFrameV1Interface *server.Interface
21var NeferwlCaptureExclusionManagerV1Interface *server.Interface
22var NeferwlCaptureExclusionV1Interface *server.Interface
23var NeferwlCaptureLayerV1Interface *server.Interface
24
25func init() {
26 NeferwlImageCaptureSourceManagerV1Interface = &server.Interface{Name: "neferwl_image_capture_source_manager_v1", Version: 1}
27 NeferwlWorkspaceFrameV1Interface = &server.Interface{Name: "neferwl_workspace_frame_v1", Version: 1}
28 NeferwlCaptureExclusionManagerV1Interface = &server.Interface{Name: "neferwl_capture_exclusion_manager_v1", Version: 1}
29 NeferwlCaptureExclusionV1Interface = &server.Interface{Name: "neferwl_capture_exclusion_v1", Version: 1}
30 NeferwlCaptureLayerV1Interface = &server.Interface{Name: "neferwl_capture_layer_v1", Version: 1}
31 NeferwlImageCaptureSourceManagerV1Interface.Requests = []server.Message{
32 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
33 {Name: "create_workspace_source", Signature: "no", Types: []*server.Interface{extimagecapturesource.ExtImageCaptureSourceV1Interface, extworkspace.ExtWorkspaceHandleV1Interface}},
34 {Name: "create_output_region_source", Signature: "noiiii", Types: []*server.Interface{extimagecapturesource.ExtImageCaptureSourceV1Interface, wayland.OutputInterface, nil, nil, nil, nil}},
35 {Name: "get_workspace_frame", Signature: "no", Types: []*server.Interface{NeferwlWorkspaceFrameV1Interface, extworkspace.ExtWorkspaceHandleV1Interface}},
36 }
37 NeferwlImageCaptureSourceManagerV1Interface.Events = []server.Message{}
38 NeferwlWorkspaceFrameV1Interface.Requests = []server.Message{
39 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
40 }
41 NeferwlWorkspaceFrameV1Interface.Events = []server.Message{
42 {Name: "frame", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
43 }
44 NeferwlCaptureExclusionManagerV1Interface.Requests = []server.Message{
45 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
46 {Name: "get_exclusion", Signature: "no", Types: []*server.Interface{NeferwlCaptureExclusionV1Interface, extimagecopycapture.ExtImageCopyCaptureSessionV1Interface}},
47 {Name: "attach_surface", Signature: "nso", Types: []*server.Interface{NeferwlCaptureLayerV1Interface, nil, wayland.SurfaceInterface}},
48 }
49 NeferwlCaptureExclusionManagerV1Interface.Events = []server.Message{}
50 NeferwlCaptureExclusionV1Interface.Requests = []server.Message{
51 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
52 }
53 NeferwlCaptureExclusionV1Interface.Events = []server.Message{
54 {Name: "token", Signature: "s", Types: []*server.Interface{nil}},
55 {Name: "failed", Signature: "u", Types: []*server.Interface{nil}},
56 }
57 NeferwlCaptureLayerV1Interface.Requests = []server.Message{
58 {Name: "destroy", Signature: "", Types: []*server.Interface{}},
59 }
60 NeferwlCaptureLayerV1Interface.Events = []server.Message{
61 {Name: "attached", Signature: "", Types: []*server.Interface{}},
62 {Name: "failed", Signature: "u", Types: []*server.Interface{nil}},
63 {Name: "detached", Signature: "u", Types: []*server.Interface{nil}},
64 }
65 if err := server.NewInterfaces(NeferwlImageCaptureSourceManagerV1Interface, NeferwlWorkspaceFrameV1Interface, NeferwlCaptureExclusionManagerV1Interface, NeferwlCaptureExclusionV1Interface, NeferwlCaptureLayerV1Interface); err != nil {
66 panic(err)
67 }
68}
69
70// NeferwlImageCaptureSourceManagerV1 workspace and output-region capture sources.
71type NeferwlImageCaptureSourceManagerV1 struct{ *server.Resource }
72
73func WrapNeferwlImageCaptureSourceManagerV1(r *server.Resource) *NeferwlImageCaptureSourceManagerV1 {
74 if r == nil {
75 return nil
76 }
77 return &NeferwlImageCaptureSourceManagerV1{r}
78}
79
80const NeferwlImageCaptureSourceManagerV1RequestDestroy uint32 = 0
81const NeferwlImageCaptureSourceManagerV1RequestCreateWorkspaceSource uint32 = 1
82const NeferwlImageCaptureSourceManagerV1RequestCreateOutputRegionSource uint32 = 2
83const NeferwlImageCaptureSourceManagerV1RequestGetWorkspaceFrame uint32 = 3
84
85// NeferwlImageCaptureSourceManagerV1Error .
86type NeferwlImageCaptureSourceManagerV1Error uint32
87
88const (
89 NeferwlImageCaptureSourceManagerV1ErrorInvalidRegion NeferwlImageCaptureSourceManagerV1Error = 0
90)
91
92// NeferwlImageCaptureSourceManagerV1Handler handles neferwl_image_capture_source_manager_v1 requests.
93type NeferwlImageCaptureSourceManagerV1Handler interface {
94 Destroy(self *NeferwlImageCaptureSourceManagerV1)
95 CreateWorkspaceSource(self *NeferwlImageCaptureSourceManagerV1, source uint32, workspace *extworkspace.ExtWorkspaceHandleV1)
96 CreateOutputRegionSource(self *NeferwlImageCaptureSourceManagerV1, source uint32, output *wayland.Output, x int32, y int32, width int32, height int32)
97 GetWorkspaceFrame(self *NeferwlImageCaptureSourceManagerV1, id uint32, workspace *extworkspace.ExtWorkspaceHandleV1)
98}
99
100func NewNeferwlImageCaptureSourceManagerV1(c server.Client, version int32, id uint32, h NeferwlImageCaptureSourceManagerV1Handler) (*NeferwlImageCaptureSourceManagerV1, error) {
101 if h == nil {
102 return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_image_capture_source_manager_v1")
103 }
104 var self *NeferwlImageCaptureSourceManagerV1
105 r, err := c.CreateResource(NeferwlImageCaptureSourceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
106 switch opcode {
107 case 0:
108 h.Destroy(self)
109 self.Destroy()
110 case 1:
111 h.CreateWorkspaceSource(self, args[0].NewID(), extworkspace.WrapExtWorkspaceHandleV1(args[1].Resource()))
112 case 2:
113 h.CreateOutputRegionSource(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource()), args[2].Int(), args[3].Int(), args[4].Int(), args[5].Int())
114 case 3:
115 h.GetWorkspaceFrame(self, args[0].NewID(), extworkspace.WrapExtWorkspaceHandleV1(args[1].Resource()))
116 }
117 })
118 if err != nil {
119 return nil, err
120 }
121 self = WrapNeferwlImageCaptureSourceManagerV1(r)
122 r.Data = self
123 return self, nil
124}
125func NewNeferwlImageCaptureSourceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
126 return d.CreateGlobal(NeferwlImageCaptureSourceManagerV1Interface, version, bind)
127}
128
129// NeferwlWorkspaceFrameV1 the frame of one workspace.
130type NeferwlWorkspaceFrameV1 struct{ *server.Resource }
131
132func WrapNeferwlWorkspaceFrameV1(r *server.Resource) *NeferwlWorkspaceFrameV1 {
133 if r == nil {
134 return nil
135 }
136 return &NeferwlWorkspaceFrameV1{r}
137}
138
139const NeferwlWorkspaceFrameV1RequestDestroy uint32 = 0
140const NeferwlWorkspaceFrameV1EventFrame uint32 = 0
141
142// NeferwlWorkspaceFrameV1Handler handles neferwl_workspace_frame_v1 requests.
143type NeferwlWorkspaceFrameV1Handler interface {
144 Destroy(self *NeferwlWorkspaceFrameV1)
145}
146
147func NewNeferwlWorkspaceFrameV1(c server.Client, version int32, id uint32, h NeferwlWorkspaceFrameV1Handler) (*NeferwlWorkspaceFrameV1, error) {
148 if h == nil {
149 return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_workspace_frame_v1")
150 }
151 var self *NeferwlWorkspaceFrameV1
152 r, err := c.CreateResource(NeferwlWorkspaceFrameV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
153 switch opcode {
154 case 0:
155 h.Destroy(self)
156 self.Destroy()
157 }
158 })
159 if err != nil {
160 return nil, err
161 }
162 self = WrapNeferwlWorkspaceFrameV1(r)
163 r.Data = self
164 return self, nil
165}
166
167// SendFrame the workspace frame.
168func (self *NeferwlWorkspaceFrameV1) SendFrame(x int32, y int32, width int32, height int32) {
169 self.PostEvent(NeferwlWorkspaceFrameV1EventFrame, server.Int(x), server.Int(y), server.Int(width), server.Int(height))
170}
171func NewNeferwlWorkspaceFrameV1Global(d *server.Display, version int32, bind server.BindFunc) error {
172 return d.CreateGlobal(NeferwlWorkspaceFrameV1Interface, version, bind)
173}
174
175// NeferwlCaptureExclusionManagerV1 leave a client's own surfaces out of its captures.
176type NeferwlCaptureExclusionManagerV1 struct{ *server.Resource }
177
178func WrapNeferwlCaptureExclusionManagerV1(r *server.Resource) *NeferwlCaptureExclusionManagerV1 {
179 if r == nil {
180 return nil
181 }
182 return &NeferwlCaptureExclusionManagerV1{r}
183}
184
185const NeferwlCaptureExclusionManagerV1RequestDestroy uint32 = 0
186const NeferwlCaptureExclusionManagerV1RequestGetExclusion uint32 = 1
187const NeferwlCaptureExclusionManagerV1RequestAttachSurface uint32 = 2
188
189// NeferwlCaptureExclusionManagerV1Error .
190type NeferwlCaptureExclusionManagerV1Error uint32
191
192const (
193 NeferwlCaptureExclusionManagerV1ErrorSurfaceRole NeferwlCaptureExclusionManagerV1Error = 0
194 NeferwlCaptureExclusionManagerV1ErrorInvalidLayer NeferwlCaptureExclusionManagerV1Error = 1
195 NeferwlCaptureExclusionManagerV1ErrorExclusiveKeyboard NeferwlCaptureExclusionManagerV1Error = 2
196 NeferwlCaptureExclusionManagerV1ErrorInvalidSurface NeferwlCaptureExclusionManagerV1Error = 3
197 NeferwlCaptureExclusionManagerV1ErrorAlreadyExcluded NeferwlCaptureExclusionManagerV1Error = 4
198)
199
200// NeferwlCaptureExclusionManagerV1Handler handles neferwl_capture_exclusion_manager_v1 requests.
201type NeferwlCaptureExclusionManagerV1Handler interface {
202 Destroy(self *NeferwlCaptureExclusionManagerV1)
203 GetExclusion(self *NeferwlCaptureExclusionManagerV1, id uint32, session *extimagecopycapture.ExtImageCopyCaptureSessionV1)
204 AttachSurface(self *NeferwlCaptureExclusionManagerV1, id uint32, token string, surface *wayland.Surface)
205}
206
207func NewNeferwlCaptureExclusionManagerV1(c server.Client, version int32, id uint32, h NeferwlCaptureExclusionManagerV1Handler) (*NeferwlCaptureExclusionManagerV1, error) {
208 if h == nil {
209 return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_capture_exclusion_manager_v1")
210 }
211 var self *NeferwlCaptureExclusionManagerV1
212 r, err := c.CreateResource(NeferwlCaptureExclusionManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
213 switch opcode {
214 case 0:
215 h.Destroy(self)
216 self.Destroy()
217 case 1:
218 h.GetExclusion(self, args[0].NewID(), extimagecopycapture.WrapExtImageCopyCaptureSessionV1(args[1].Resource()))
219 case 2:
220 h.AttachSurface(self, args[0].NewID(), args[1].String(), wayland.WrapSurface(args[2].Resource()))
221 }
222 })
223 if err != nil {
224 return nil, err
225 }
226 self = WrapNeferwlCaptureExclusionManagerV1(r)
227 r.Data = self
228 return self, nil
229}
230func NewNeferwlCaptureExclusionManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
231 return d.CreateGlobal(NeferwlCaptureExclusionManagerV1Interface, version, bind)
232}
233
234// NeferwlCaptureExclusionV1 the exclusion of one capture session.
235type NeferwlCaptureExclusionV1 struct{ *server.Resource }
236
237func WrapNeferwlCaptureExclusionV1(r *server.Resource) *NeferwlCaptureExclusionV1 {
238 if r == nil {
239 return nil
240 }
241 return &NeferwlCaptureExclusionV1{r}
242}
243
244const NeferwlCaptureExclusionV1RequestDestroy uint32 = 0
245const NeferwlCaptureExclusionV1EventToken uint32 = 0
246const NeferwlCaptureExclusionV1EventFailed uint32 = 1
247
248// NeferwlCaptureExclusionV1Failure .
249type NeferwlCaptureExclusionV1Failure uint32
250
251const (
252 NeferwlCaptureExclusionV1FailureBusy NeferwlCaptureExclusionV1Failure = 0
253 NeferwlCaptureExclusionV1FailureSessionStopped NeferwlCaptureExclusionV1Failure = 1
254)
255
256// NeferwlCaptureExclusionV1Handler handles neferwl_capture_exclusion_v1 requests.
257type NeferwlCaptureExclusionV1Handler interface {
258 Destroy(self *NeferwlCaptureExclusionV1)
259}
260
261func NewNeferwlCaptureExclusionV1(c server.Client, version int32, id uint32, h NeferwlCaptureExclusionV1Handler) (*NeferwlCaptureExclusionV1, error) {
262 if h == nil {
263 return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_capture_exclusion_v1")
264 }
265 var self *NeferwlCaptureExclusionV1
266 r, err := c.CreateResource(NeferwlCaptureExclusionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
267 switch opcode {
268 case 0:
269 h.Destroy(self)
270 self.Destroy()
271 }
272 })
273 if err != nil {
274 return nil, err
275 }
276 self = WrapNeferwlCaptureExclusionV1(r)
277 r.Data = self
278 return self, nil
279}
280
281// SendToken the attachment token.
282func (self *NeferwlCaptureExclusionV1) SendToken(token string) {
283 var p runtime.Pinner
284 defer p.Unpin()
285 self.PostEvent(NeferwlCaptureExclusionV1EventToken, server.String(&p, token, false))
286}
287
288// SendFailed no exclusion.
289func (self *NeferwlCaptureExclusionV1) SendFailed(reason uint32) {
290 self.PostEvent(NeferwlCaptureExclusionV1EventFailed, server.Uint(reason))
291}
292func NewNeferwlCaptureExclusionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
293 return d.CreateGlobal(NeferwlCaptureExclusionV1Interface, version, bind)
294}
295
296// NeferwlCaptureLayerV1 a layer surface attached to an exclusion.
297type NeferwlCaptureLayerV1 struct{ *server.Resource }
298
299func WrapNeferwlCaptureLayerV1(r *server.Resource) *NeferwlCaptureLayerV1 {
300 if r == nil {
301 return nil
302 }
303 return &NeferwlCaptureLayerV1{r}
304}
305
306const NeferwlCaptureLayerV1RequestDestroy uint32 = 0
307const NeferwlCaptureLayerV1EventAttached uint32 = 0
308const NeferwlCaptureLayerV1EventFailed uint32 = 1
309const NeferwlCaptureLayerV1EventDetached uint32 = 2
310
311// NeferwlCaptureLayerV1Failure .
312type NeferwlCaptureLayerV1Failure uint32
313
314const (
315 NeferwlCaptureLayerV1FailureUnknownToken NeferwlCaptureLayerV1Failure = 0
316 NeferwlCaptureLayerV1FailureUnauthorized NeferwlCaptureLayerV1Failure = 1
317 NeferwlCaptureLayerV1FailureTooManyLayers NeferwlCaptureLayerV1Failure = 2
318 NeferwlCaptureLayerV1FailureAlreadyAttached NeferwlCaptureLayerV1Failure = 3
319 NeferwlCaptureLayerV1FailureExclusionEnded NeferwlCaptureLayerV1Failure = 4
320 NeferwlCaptureLayerV1FailureLayerDestroyed NeferwlCaptureLayerV1Failure = 5
321)
322
323// NeferwlCaptureLayerV1DetachReason .
324type NeferwlCaptureLayerV1DetachReason uint32
325
326const (
327 NeferwlCaptureLayerV1DetachReasonExclusionEnded NeferwlCaptureLayerV1DetachReason = 0
328 NeferwlCaptureLayerV1DetachReasonLayerDestroyed NeferwlCaptureLayerV1DetachReason = 1
329)
330
331// NeferwlCaptureLayerV1Handler handles neferwl_capture_layer_v1 requests.
332type NeferwlCaptureLayerV1Handler interface {
333 Destroy(self *NeferwlCaptureLayerV1)
334}
335
336func NewNeferwlCaptureLayerV1(c server.Client, version int32, id uint32, h NeferwlCaptureLayerV1Handler) (*NeferwlCaptureLayerV1, error) {
337 if h == nil {
338 return nil, fmt.Errorf("purego-libwayland: nil handler for neferwl_capture_layer_v1")
339 }
340 var self *NeferwlCaptureLayerV1
341 r, err := c.CreateResource(NeferwlCaptureLayerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
342 switch opcode {
343 case 0:
344 h.Destroy(self)
345 self.Destroy()
346 }
347 })
348 if err != nil {
349 return nil, err
350 }
351 self = WrapNeferwlCaptureLayerV1(r)
352 r.Data = self
353 return self, nil
354}
355
356// SendAttached the layer is excluded.
357func (self *NeferwlCaptureLayerV1) SendAttached() {
358 self.PostEvent(NeferwlCaptureLayerV1EventAttached)
359}
360
361// SendFailed the attachment was refused.
362func (self *NeferwlCaptureLayerV1) SendFailed(reason uint32) {
363 self.PostEvent(NeferwlCaptureLayerV1EventFailed, server.Uint(reason))
364}
365
366// SendDetached the layer left the exclusion.
367func (self *NeferwlCaptureLayerV1) SendDetached(reason uint32) {
368 self.PostEvent(NeferwlCaptureLayerV1EventDetached, server.Uint(reason))
369}
370func NewNeferwlCaptureLayerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
371 return d.CreateGlobal(NeferwlCaptureLayerV1Interface, version, bind)
372}
373func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
374 if v == nil {
375 return nil
376 }
377 return v.GetResource()
378}
379func (self *NeferwlImageCaptureSourceManagerV1) GetResource() *server.Resource {
380 if self == nil {
381 return nil
382 }
383 return self.Resource
384}
385func (self *NeferwlWorkspaceFrameV1) GetResource() *server.Resource {
386 if self == nil {
387 return nil
388 }
389 return self.Resource
390}
391func (self *NeferwlCaptureExclusionManagerV1) GetResource() *server.Resource {
392 if self == nil {
393 return nil
394 }
395 return self.Resource
396}
397func (self *NeferwlCaptureExclusionV1) GetResource() *server.Resource {
398 if self == nil {
399 return nil
400 }
401 return self.Resource
402}
403func (self *NeferwlCaptureLayerV1) GetResource() *server.Resource {
404 if self == nil {
405 return nil
406 }
407 return self.Resource
408}