v0.8.0 5f793eb

extimagecopycapture.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package extimagecopycapture
3
4import (
5	"fmt"
6	extimagecapturesource "github.com/bnema/purego-libwayland/protocol/extimagecapturesource"
7	wayland "github.com/bnema/purego-libwayland/protocol/wayland"
8	"github.com/bnema/purego-libwayland/server"
9	"runtime"
10)
11
12var ExtImageCopyCaptureManagerV1Interface *server.Interface
13var ExtImageCopyCaptureSessionV1Interface *server.Interface
14var ExtImageCopyCaptureFrameV1Interface *server.Interface
15var ExtImageCopyCaptureCursorSessionV1Interface *server.Interface
16
17func init() {
18	ExtImageCopyCaptureManagerV1Interface = &server.Interface{Name: "ext_image_copy_capture_manager_v1", Version: 1}
19	ExtImageCopyCaptureSessionV1Interface = &server.Interface{Name: "ext_image_copy_capture_session_v1", Version: 1}
20	ExtImageCopyCaptureFrameV1Interface = &server.Interface{Name: "ext_image_copy_capture_frame_v1", Version: 1}
21	ExtImageCopyCaptureCursorSessionV1Interface = &server.Interface{Name: "ext_image_copy_capture_cursor_session_v1", Version: 1}
22	ExtImageCopyCaptureManagerV1Interface.Requests = []server.Message{
23		{Name: "create_session", Signature: "nou", Types: []*server.Interface{ExtImageCopyCaptureSessionV1Interface, extimagecapturesource.ExtImageCaptureSourceV1Interface, nil}},
24		{Name: "create_pointer_cursor_session", Signature: "noo", Types: []*server.Interface{ExtImageCopyCaptureCursorSessionV1Interface, extimagecapturesource.ExtImageCaptureSourceV1Interface, wayland.PointerInterface}},
25		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
26	}
27	ExtImageCopyCaptureManagerV1Interface.Events = []server.Message{}
28	ExtImageCopyCaptureSessionV1Interface.Requests = []server.Message{
29		{Name: "create_frame", Signature: "n", Types: []*server.Interface{ExtImageCopyCaptureFrameV1Interface}},
30		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
31	}
32	ExtImageCopyCaptureSessionV1Interface.Events = []server.Message{
33		{Name: "buffer_size", Signature: "uu", Types: []*server.Interface{nil, nil}},
34		{Name: "shm_format", Signature: "u", Types: []*server.Interface{nil}},
35		{Name: "dmabuf_device", Signature: "a", Types: []*server.Interface{nil}},
36		{Name: "dmabuf_format", Signature: "ua", Types: []*server.Interface{nil, nil}},
37		{Name: "done", Signature: "", Types: []*server.Interface{}},
38		{Name: "stopped", Signature: "", Types: []*server.Interface{}},
39	}
40	ExtImageCopyCaptureFrameV1Interface.Requests = []server.Message{
41		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
42		{Name: "attach_buffer", Signature: "o", Types: []*server.Interface{wayland.BufferInterface}},
43		{Name: "damage_buffer", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
44		{Name: "capture", Signature: "", Types: []*server.Interface{}},
45	}
46	ExtImageCopyCaptureFrameV1Interface.Events = []server.Message{
47		{Name: "transform", Signature: "u", Types: []*server.Interface{nil}},
48		{Name: "damage", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}},
49		{Name: "presentation_time", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
50		{Name: "ready", Signature: "", Types: []*server.Interface{}},
51		{Name: "failed", Signature: "u", Types: []*server.Interface{nil}},
52	}
53	ExtImageCopyCaptureCursorSessionV1Interface.Requests = []server.Message{
54		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
55		{Name: "get_capture_session", Signature: "n", Types: []*server.Interface{ExtImageCopyCaptureSessionV1Interface}},
56	}
57	ExtImageCopyCaptureCursorSessionV1Interface.Events = []server.Message{
58		{Name: "enter", Signature: "", Types: []*server.Interface{}},
59		{Name: "leave", Signature: "", Types: []*server.Interface{}},
60		{Name: "position", Signature: "ii", Types: []*server.Interface{nil, nil}},
61		{Name: "hotspot", Signature: "ii", Types: []*server.Interface{nil, nil}},
62	}
63	if err := server.NewInterfaces(ExtImageCopyCaptureManagerV1Interface, ExtImageCopyCaptureSessionV1Interface, ExtImageCopyCaptureFrameV1Interface, ExtImageCopyCaptureCursorSessionV1Interface); err != nil {
64		panic(err)
65	}
66}
67
68// ExtImageCopyCaptureManagerV1 manager to inform clients and begin capturing.
69type ExtImageCopyCaptureManagerV1 struct{ *server.Resource }
70
71func WrapExtImageCopyCaptureManagerV1(r *server.Resource) *ExtImageCopyCaptureManagerV1 {
72	if r == nil {
73		return nil
74	}
75	return &ExtImageCopyCaptureManagerV1{r}
76}
77
78const ExtImageCopyCaptureManagerV1RequestCreateSession uint32 = 0
79const ExtImageCopyCaptureManagerV1RequestCreatePointerCursorSession uint32 = 1
80const ExtImageCopyCaptureManagerV1RequestDestroy uint32 = 2
81
82// ExtImageCopyCaptureManagerV1Error .
83type ExtImageCopyCaptureManagerV1Error uint32
84
85const (
86	ExtImageCopyCaptureManagerV1ErrorInvalidOption ExtImageCopyCaptureManagerV1Error = 1
87)
88
89// ExtImageCopyCaptureManagerV1Options  (bitfield).
90type ExtImageCopyCaptureManagerV1Options uint32
91
92const (
93	ExtImageCopyCaptureManagerV1OptionsPaintCursors ExtImageCopyCaptureManagerV1Options = 1
94)
95
96// ExtImageCopyCaptureManagerV1Handler handles ext_image_copy_capture_manager_v1 requests.
97type ExtImageCopyCaptureManagerV1Handler interface {
98	CreateSession(self *ExtImageCopyCaptureManagerV1, session uint32, source *extimagecapturesource.ExtImageCaptureSourceV1, options uint32)
99	CreatePointerCursorSession(self *ExtImageCopyCaptureManagerV1, session uint32, source *extimagecapturesource.ExtImageCaptureSourceV1, pointer *wayland.Pointer)
100	Destroy(self *ExtImageCopyCaptureManagerV1)
101}
102
103func NewExtImageCopyCaptureManagerV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureManagerV1Handler) (*ExtImageCopyCaptureManagerV1, error) {
104	if h == nil {
105		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_manager_v1")
106	}
107	var self *ExtImageCopyCaptureManagerV1
108	r, err := c.CreateResource(ExtImageCopyCaptureManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
109		switch opcode {
110		case 0:
111			h.CreateSession(self, args[0].NewID(), extimagecapturesource.WrapExtImageCaptureSourceV1(args[1].Resource()), args[2].Uint())
112		case 1:
113			h.CreatePointerCursorSession(self, args[0].NewID(), extimagecapturesource.WrapExtImageCaptureSourceV1(args[1].Resource()), wayland.WrapPointer(args[2].Resource()))
114		case 2:
115			h.Destroy(self)
116			self.Destroy()
117		}
118	})
119	if err != nil {
120		return nil, err
121	}
122	self = WrapExtImageCopyCaptureManagerV1(r)
123	r.Data = self
124	return self, nil
125}
126func NewExtImageCopyCaptureManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
127	return d.CreateGlobal(ExtImageCopyCaptureManagerV1Interface, version, bind)
128}
129
130// ExtImageCopyCaptureSessionV1 image copy capture session.
131type ExtImageCopyCaptureSessionV1 struct{ *server.Resource }
132
133func WrapExtImageCopyCaptureSessionV1(r *server.Resource) *ExtImageCopyCaptureSessionV1 {
134	if r == nil {
135		return nil
136	}
137	return &ExtImageCopyCaptureSessionV1{r}
138}
139
140const ExtImageCopyCaptureSessionV1RequestCreateFrame uint32 = 0
141const ExtImageCopyCaptureSessionV1RequestDestroy uint32 = 1
142const ExtImageCopyCaptureSessionV1EventBufferSize uint32 = 0
143const ExtImageCopyCaptureSessionV1EventShmFormat uint32 = 1
144const ExtImageCopyCaptureSessionV1EventDmabufDevice uint32 = 2
145const ExtImageCopyCaptureSessionV1EventDmabufFormat uint32 = 3
146const ExtImageCopyCaptureSessionV1EventDone uint32 = 4
147const ExtImageCopyCaptureSessionV1EventStopped uint32 = 5
148
149// ExtImageCopyCaptureSessionV1Error .
150type ExtImageCopyCaptureSessionV1Error uint32
151
152const (
153	ExtImageCopyCaptureSessionV1ErrorDuplicateFrame ExtImageCopyCaptureSessionV1Error = 1
154)
155
156// ExtImageCopyCaptureSessionV1Handler handles ext_image_copy_capture_session_v1 requests.
157type ExtImageCopyCaptureSessionV1Handler interface {
158	CreateFrame(self *ExtImageCopyCaptureSessionV1, frame uint32)
159	Destroy(self *ExtImageCopyCaptureSessionV1)
160}
161
162func NewExtImageCopyCaptureSessionV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureSessionV1Handler) (*ExtImageCopyCaptureSessionV1, error) {
163	if h == nil {
164		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_session_v1")
165	}
166	var self *ExtImageCopyCaptureSessionV1
167	r, err := c.CreateResource(ExtImageCopyCaptureSessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
168		switch opcode {
169		case 0:
170			h.CreateFrame(self, args[0].NewID())
171		case 1:
172			h.Destroy(self)
173			self.Destroy()
174		}
175	})
176	if err != nil {
177		return nil, err
178	}
179	self = WrapExtImageCopyCaptureSessionV1(r)
180	r.Data = self
181	return self, nil
182}
183
184// SendBufferSize image capture source dimensions.
185func (self *ExtImageCopyCaptureSessionV1) SendBufferSize(width uint32, height uint32) {
186	self.PostEvent(ExtImageCopyCaptureSessionV1EventBufferSize, server.Uint(width), server.Uint(height))
187}
188
189// SendShmFormat shm buffer format.
190func (self *ExtImageCopyCaptureSessionV1) SendShmFormat(format uint32) {
191	self.PostEvent(ExtImageCopyCaptureSessionV1EventShmFormat, server.Uint(format))
192}
193
194// SendDmabufDevice dma-buf device.
195func (self *ExtImageCopyCaptureSessionV1) SendDmabufDevice(device []byte) {
196	var p runtime.Pinner
197	defer p.Unpin()
198	self.PostEvent(ExtImageCopyCaptureSessionV1EventDmabufDevice, server.Array(&p, device))
199}
200
201// SendDmabufFormat dma-buf format.
202func (self *ExtImageCopyCaptureSessionV1) SendDmabufFormat(format uint32, modifiers []byte) {
203	var p runtime.Pinner
204	defer p.Unpin()
205	self.PostEvent(ExtImageCopyCaptureSessionV1EventDmabufFormat, server.Uint(format), server.Array(&p, modifiers))
206}
207
208// SendDone all constraints have been sent.
209func (self *ExtImageCopyCaptureSessionV1) SendDone() {
210	self.PostEvent(ExtImageCopyCaptureSessionV1EventDone)
211}
212
213// SendStopped session is no longer available.
214func (self *ExtImageCopyCaptureSessionV1) SendStopped() {
215	self.PostEvent(ExtImageCopyCaptureSessionV1EventStopped)
216}
217func NewExtImageCopyCaptureSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
218	return d.CreateGlobal(ExtImageCopyCaptureSessionV1Interface, version, bind)
219}
220
221// ExtImageCopyCaptureFrameV1 image capture frame.
222type ExtImageCopyCaptureFrameV1 struct{ *server.Resource }
223
224func WrapExtImageCopyCaptureFrameV1(r *server.Resource) *ExtImageCopyCaptureFrameV1 {
225	if r == nil {
226		return nil
227	}
228	return &ExtImageCopyCaptureFrameV1{r}
229}
230
231const ExtImageCopyCaptureFrameV1RequestDestroy uint32 = 0
232const ExtImageCopyCaptureFrameV1RequestAttachBuffer uint32 = 1
233const ExtImageCopyCaptureFrameV1RequestDamageBuffer uint32 = 2
234const ExtImageCopyCaptureFrameV1RequestCapture uint32 = 3
235const ExtImageCopyCaptureFrameV1EventTransform uint32 = 0
236const ExtImageCopyCaptureFrameV1EventDamage uint32 = 1
237const ExtImageCopyCaptureFrameV1EventPresentationTime uint32 = 2
238const ExtImageCopyCaptureFrameV1EventReady uint32 = 3
239const ExtImageCopyCaptureFrameV1EventFailed uint32 = 4
240
241// ExtImageCopyCaptureFrameV1Error .
242type ExtImageCopyCaptureFrameV1Error uint32
243
244const (
245	ExtImageCopyCaptureFrameV1ErrorNoBuffer            ExtImageCopyCaptureFrameV1Error = 1
246	ExtImageCopyCaptureFrameV1ErrorInvalidBufferDamage ExtImageCopyCaptureFrameV1Error = 2
247	ExtImageCopyCaptureFrameV1ErrorAlreadyCaptured     ExtImageCopyCaptureFrameV1Error = 3
248)
249
250// ExtImageCopyCaptureFrameV1FailureReason .
251type ExtImageCopyCaptureFrameV1FailureReason uint32
252
253const (
254	ExtImageCopyCaptureFrameV1FailureReasonUnknown           ExtImageCopyCaptureFrameV1FailureReason = 0
255	ExtImageCopyCaptureFrameV1FailureReasonBufferConstraints ExtImageCopyCaptureFrameV1FailureReason = 1
256	ExtImageCopyCaptureFrameV1FailureReasonStopped           ExtImageCopyCaptureFrameV1FailureReason = 2
257)
258
259// ExtImageCopyCaptureFrameV1Handler handles ext_image_copy_capture_frame_v1 requests.
260type ExtImageCopyCaptureFrameV1Handler interface {
261	Destroy(self *ExtImageCopyCaptureFrameV1)
262	AttachBuffer(self *ExtImageCopyCaptureFrameV1, buffer *wayland.Buffer)
263	DamageBuffer(self *ExtImageCopyCaptureFrameV1, x int32, y int32, width int32, height int32)
264	Capture(self *ExtImageCopyCaptureFrameV1)
265}
266
267func NewExtImageCopyCaptureFrameV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureFrameV1Handler) (*ExtImageCopyCaptureFrameV1, error) {
268	if h == nil {
269		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_frame_v1")
270	}
271	var self *ExtImageCopyCaptureFrameV1
272	r, err := c.CreateResource(ExtImageCopyCaptureFrameV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
273		switch opcode {
274		case 0:
275			h.Destroy(self)
276			self.Destroy()
277		case 1:
278			h.AttachBuffer(self, wayland.WrapBuffer(args[0].Resource()))
279		case 2:
280			h.DamageBuffer(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int())
281		case 3:
282			h.Capture(self)
283		}
284	})
285	if err != nil {
286		return nil, err
287	}
288	self = WrapExtImageCopyCaptureFrameV1(r)
289	r.Data = self
290	return self, nil
291}
292
293// SendTransform buffer transform.
294func (self *ExtImageCopyCaptureFrameV1) SendTransform(transform uint32) {
295	self.PostEvent(ExtImageCopyCaptureFrameV1EventTransform, server.Uint(transform))
296}
297
298// SendDamage buffer damaged region.
299func (self *ExtImageCopyCaptureFrameV1) SendDamage(x int32, y int32, width int32, height int32) {
300	self.PostEvent(ExtImageCopyCaptureFrameV1EventDamage, server.Int(x), server.Int(y), server.Int(width), server.Int(height))
301}
302
303// SendPresentationTime presentation time of the frame.
304func (self *ExtImageCopyCaptureFrameV1) SendPresentationTime(tvSecHi uint32, tvSecLo uint32, tvNsec uint32) {
305	self.PostEvent(ExtImageCopyCaptureFrameV1EventPresentationTime, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec))
306}
307
308// SendReady frame is available for reading.
309func (self *ExtImageCopyCaptureFrameV1) SendReady() {
310	self.PostEvent(ExtImageCopyCaptureFrameV1EventReady)
311}
312
313// SendFailed capture failed.
314func (self *ExtImageCopyCaptureFrameV1) SendFailed(reason uint32) {
315	self.PostEvent(ExtImageCopyCaptureFrameV1EventFailed, server.Uint(reason))
316}
317func NewExtImageCopyCaptureFrameV1Global(d *server.Display, version int32, bind server.BindFunc) error {
318	return d.CreateGlobal(ExtImageCopyCaptureFrameV1Interface, version, bind)
319}
320
321// ExtImageCopyCaptureCursorSessionV1 cursor capture session.
322type ExtImageCopyCaptureCursorSessionV1 struct{ *server.Resource }
323
324func WrapExtImageCopyCaptureCursorSessionV1(r *server.Resource) *ExtImageCopyCaptureCursorSessionV1 {
325	if r == nil {
326		return nil
327	}
328	return &ExtImageCopyCaptureCursorSessionV1{r}
329}
330
331const ExtImageCopyCaptureCursorSessionV1RequestDestroy uint32 = 0
332const ExtImageCopyCaptureCursorSessionV1RequestGetCaptureSession uint32 = 1
333const ExtImageCopyCaptureCursorSessionV1EventEnter uint32 = 0
334const ExtImageCopyCaptureCursorSessionV1EventLeave uint32 = 1
335const ExtImageCopyCaptureCursorSessionV1EventPosition uint32 = 2
336const ExtImageCopyCaptureCursorSessionV1EventHotspot uint32 = 3
337
338// ExtImageCopyCaptureCursorSessionV1Error .
339type ExtImageCopyCaptureCursorSessionV1Error uint32
340
341const (
342	ExtImageCopyCaptureCursorSessionV1ErrorDuplicateSession ExtImageCopyCaptureCursorSessionV1Error = 1
343)
344
345// ExtImageCopyCaptureCursorSessionV1Handler handles ext_image_copy_capture_cursor_session_v1 requests.
346type ExtImageCopyCaptureCursorSessionV1Handler interface {
347	Destroy(self *ExtImageCopyCaptureCursorSessionV1)
348	GetCaptureSession(self *ExtImageCopyCaptureCursorSessionV1, session uint32)
349}
350
351func NewExtImageCopyCaptureCursorSessionV1(c server.Client, version int32, id uint32, h ExtImageCopyCaptureCursorSessionV1Handler) (*ExtImageCopyCaptureCursorSessionV1, error) {
352	if h == nil {
353		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_copy_capture_cursor_session_v1")
354	}
355	var self *ExtImageCopyCaptureCursorSessionV1
356	r, err := c.CreateResource(ExtImageCopyCaptureCursorSessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
357		switch opcode {
358		case 0:
359			h.Destroy(self)
360			self.Destroy()
361		case 1:
362			h.GetCaptureSession(self, args[0].NewID())
363		}
364	})
365	if err != nil {
366		return nil, err
367	}
368	self = WrapExtImageCopyCaptureCursorSessionV1(r)
369	r.Data = self
370	return self, nil
371}
372
373// SendEnter cursor entered captured area.
374func (self *ExtImageCopyCaptureCursorSessionV1) SendEnter() {
375	self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventEnter)
376}
377
378// SendLeave cursor left captured area.
379func (self *ExtImageCopyCaptureCursorSessionV1) SendLeave() {
380	self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventLeave)
381}
382
383// SendPosition position changed.
384func (self *ExtImageCopyCaptureCursorSessionV1) SendPosition(x int32, y int32) {
385	self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventPosition, server.Int(x), server.Int(y))
386}
387
388// SendHotspot hotspot changed.
389func (self *ExtImageCopyCaptureCursorSessionV1) SendHotspot(x int32, y int32) {
390	self.PostEvent(ExtImageCopyCaptureCursorSessionV1EventHotspot, server.Int(x), server.Int(y))
391}
392func NewExtImageCopyCaptureCursorSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
393	return d.CreateGlobal(ExtImageCopyCaptureCursorSessionV1Interface, version, bind)
394}
395func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
396	if v == nil {
397		return nil
398	}
399	return v.GetResource()
400}
401func (self *ExtImageCopyCaptureManagerV1) GetResource() *server.Resource {
402	if self == nil {
403		return nil
404	}
405	return self.Resource
406}
407func (self *ExtImageCopyCaptureSessionV1) GetResource() *server.Resource {
408	if self == nil {
409		return nil
410	}
411	return self.Resource
412}
413func (self *ExtImageCopyCaptureFrameV1) GetResource() *server.Resource {
414	if self == nil {
415		return nil
416	}
417	return self.Resource
418}
419func (self *ExtImageCopyCaptureCursorSessionV1) GetResource() *server.Resource {
420	if self == nil {
421		return nil
422	}
423	return self.Resource
424}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 14

↑↓ moveenter openesc close