v0.6.0 d4696de

wlrscreencopy.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package wlrscreencopy
3
4import (
5	"fmt"
6	wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7	"github.com/bnema/purego-libwayland/server"
8)
9
10var ZwlrScreencopyManagerV1Interface *server.Interface
11var ZwlrScreencopyFrameV1Interface *server.Interface
12
13func init() {
14	ZwlrScreencopyManagerV1Interface = &server.Interface{Name: "zwlr_screencopy_manager_v1", Version: 3}
15	ZwlrScreencopyFrameV1Interface = &server.Interface{Name: "zwlr_screencopy_frame_v1", Version: 3}
16	ZwlrScreencopyManagerV1Interface.Requests = []server.Message{
17		{Name: "capture_output", Signature: "nio", Types: []*server.Interface{ZwlrScreencopyFrameV1Interface, nil, wayland.OutputInterface}},
18		{Name: "capture_output_region", Signature: "nioiiii", Types: []*server.Interface{ZwlrScreencopyFrameV1Interface, nil, wayland.OutputInterface, nil, nil, nil, nil}},
19		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
20	}
21	ZwlrScreencopyManagerV1Interface.Events = []server.Message{}
22	ZwlrScreencopyFrameV1Interface.Requests = []server.Message{
23		{Name: "copy", Signature: "o", Types: []*server.Interface{wayland.BufferInterface}},
24		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
25		{Name: "copy_with_damage", Signature: "2o", Types: []*server.Interface{wayland.BufferInterface}},
26	}
27	ZwlrScreencopyFrameV1Interface.Events = []server.Message{
28		{Name: "buffer", Signature: "uuuu", Types: []*server.Interface{nil, nil, nil, nil}},
29		{Name: "flags", Signature: "u", Types: []*server.Interface{nil}},
30		{Name: "ready", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}},
31		{Name: "failed", Signature: "", Types: []*server.Interface{}},
32		{Name: "damage", Signature: "2uuuu", Types: []*server.Interface{nil, nil, nil, nil}},
33		{Name: "linux_dmabuf", Signature: "3uuu", Types: []*server.Interface{nil, nil, nil}},
34		{Name: "buffer_done", Signature: "3", Types: []*server.Interface{}},
35	}
36	if err := server.NewInterfaces(ZwlrScreencopyManagerV1Interface, ZwlrScreencopyFrameV1Interface); err != nil {
37		panic(err)
38	}
39}
40
41// ZwlrScreencopyManagerV1 manager to inform clients and begin capturing.
42type ZwlrScreencopyManagerV1 struct{ *server.Resource }
43
44func WrapZwlrScreencopyManagerV1(r *server.Resource) *ZwlrScreencopyManagerV1 {
45	if r == nil {
46		return nil
47	}
48	return &ZwlrScreencopyManagerV1{r}
49}
50
51const ZwlrScreencopyManagerV1RequestCaptureOutput uint32 = 0
52const ZwlrScreencopyManagerV1RequestCaptureOutputRegion uint32 = 1
53const ZwlrScreencopyManagerV1RequestDestroy uint32 = 2
54
55// ZwlrScreencopyManagerV1Handler handles zwlr_screencopy_manager_v1 requests.
56type ZwlrScreencopyManagerV1Handler interface {
57	CaptureOutput(self *ZwlrScreencopyManagerV1, frame uint32, overlayCursor int32, output *wayland.Output)
58	CaptureOutputRegion(self *ZwlrScreencopyManagerV1, frame uint32, overlayCursor int32, output *wayland.Output, x int32, y int32, width int32, height int32)
59	Destroy(self *ZwlrScreencopyManagerV1)
60}
61
62func NewZwlrScreencopyManagerV1(c server.Client, version int32, id uint32, h ZwlrScreencopyManagerV1Handler) (*ZwlrScreencopyManagerV1, error) {
63	if h == nil {
64		return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_screencopy_manager_v1")
65	}
66	var self *ZwlrScreencopyManagerV1
67	r, err := c.CreateResource(ZwlrScreencopyManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
68		switch opcode {
69		case 0:
70			h.CaptureOutput(self, args[0].NewID(), args[1].Int(), wayland.WrapOutput(args[2].Resource()))
71		case 1:
72			h.CaptureOutputRegion(self, args[0].NewID(), args[1].Int(), wayland.WrapOutput(args[2].Resource()), args[3].Int(), args[4].Int(), args[5].Int(), args[6].Int())
73		case 2:
74			h.Destroy(self)
75			self.Destroy()
76		}
77	})
78	if err != nil {
79		return nil, err
80	}
81	self = WrapZwlrScreencopyManagerV1(r)
82	r.Data = self
83	return self, nil
84}
85func NewZwlrScreencopyManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
86	return d.CreateGlobal(ZwlrScreencopyManagerV1Interface, version, bind)
87}
88
89// ZwlrScreencopyFrameV1 a frame ready for copy.
90type ZwlrScreencopyFrameV1 struct{ *server.Resource }
91
92func WrapZwlrScreencopyFrameV1(r *server.Resource) *ZwlrScreencopyFrameV1 {
93	if r == nil {
94		return nil
95	}
96	return &ZwlrScreencopyFrameV1{r}
97}
98
99const ZwlrScreencopyFrameV1RequestCopy uint32 = 0
100const ZwlrScreencopyFrameV1RequestDestroy uint32 = 1
101const ZwlrScreencopyFrameV1RequestCopyWithDamage uint32 = 2
102const ZwlrScreencopyFrameV1EventBuffer uint32 = 0
103const ZwlrScreencopyFrameV1EventFlags uint32 = 1
104const ZwlrScreencopyFrameV1EventReady uint32 = 2
105const ZwlrScreencopyFrameV1EventFailed uint32 = 3
106const ZwlrScreencopyFrameV1EventDamage uint32 = 4
107const ZwlrScreencopyFrameV1EventLinuxDmabuf uint32 = 5
108const ZwlrScreencopyFrameV1EventBufferDone uint32 = 6
109
110// ZwlrScreencopyFrameV1Error .
111type ZwlrScreencopyFrameV1Error uint32
112
113const (
114	ZwlrScreencopyFrameV1ErrorAlreadyUsed   ZwlrScreencopyFrameV1Error = 0
115	ZwlrScreencopyFrameV1ErrorInvalidBuffer ZwlrScreencopyFrameV1Error = 1
116)
117
118// ZwlrScreencopyFrameV1Flags  (bitfield).
119type ZwlrScreencopyFrameV1Flags uint32
120
121const (
122	ZwlrScreencopyFrameV1FlagsYInvert ZwlrScreencopyFrameV1Flags = 1
123)
124
125// ZwlrScreencopyFrameV1Handler handles zwlr_screencopy_frame_v1 requests.
126type ZwlrScreencopyFrameV1Handler interface {
127	Copy(self *ZwlrScreencopyFrameV1, buffer *wayland.Buffer)
128	Destroy(self *ZwlrScreencopyFrameV1)
129	CopyWithDamage(self *ZwlrScreencopyFrameV1, buffer *wayland.Buffer)
130}
131
132func NewZwlrScreencopyFrameV1(c server.Client, version int32, id uint32, h ZwlrScreencopyFrameV1Handler) (*ZwlrScreencopyFrameV1, error) {
133	if h == nil {
134		return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_screencopy_frame_v1")
135	}
136	var self *ZwlrScreencopyFrameV1
137	r, err := c.CreateResource(ZwlrScreencopyFrameV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
138		switch opcode {
139		case 0:
140			h.Copy(self, wayland.WrapBuffer(args[0].Resource()))
141		case 1:
142			h.Destroy(self)
143			self.Destroy()
144		case 2:
145			h.CopyWithDamage(self, wayland.WrapBuffer(args[0].Resource()))
146		}
147	})
148	if err != nil {
149		return nil, err
150	}
151	self = WrapZwlrScreencopyFrameV1(r)
152	r.Data = self
153	return self, nil
154}
155
156// SendBuffer wl_shm buffer information.
157func (self *ZwlrScreencopyFrameV1) SendBuffer(format uint32, width uint32, height uint32, stride uint32) {
158	self.PostEvent(ZwlrScreencopyFrameV1EventBuffer, server.Uint(format), server.Uint(width), server.Uint(height), server.Uint(stride))
159}
160
161// SendFlags frame flags.
162func (self *ZwlrScreencopyFrameV1) SendFlags(flags uint32) {
163	self.PostEvent(ZwlrScreencopyFrameV1EventFlags, server.Uint(flags))
164}
165
166// SendReady indicates frame is available for reading.
167func (self *ZwlrScreencopyFrameV1) SendReady(tvSecHi uint32, tvSecLo uint32, tvNsec uint32) {
168	self.PostEvent(ZwlrScreencopyFrameV1EventReady, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec))
169}
170
171// SendFailed frame copy failed.
172func (self *ZwlrScreencopyFrameV1) SendFailed() {
173	self.PostEvent(ZwlrScreencopyFrameV1EventFailed)
174}
175
176// SendDamage carries the coordinates of the damaged region (since version 2).
177func (self *ZwlrScreencopyFrameV1) SendDamage(x uint32, y uint32, width uint32, height uint32) {
178	self.PostEvent(ZwlrScreencopyFrameV1EventDamage, server.Uint(x), server.Uint(y), server.Uint(width), server.Uint(height))
179}
180
181// SendLinuxDmabuf linux-dmabuf buffer information (since version 3).
182func (self *ZwlrScreencopyFrameV1) SendLinuxDmabuf(format uint32, width uint32, height uint32) {
183	self.PostEvent(ZwlrScreencopyFrameV1EventLinuxDmabuf, server.Uint(format), server.Uint(width), server.Uint(height))
184}
185
186// SendBufferDone all buffer types reported (since version 3).
187func (self *ZwlrScreencopyFrameV1) SendBufferDone() {
188	self.PostEvent(ZwlrScreencopyFrameV1EventBufferDone)
189}
190func NewZwlrScreencopyFrameV1Global(d *server.Display, version int32, bind server.BindFunc) error {
191	return d.CreateGlobal(ZwlrScreencopyFrameV1Interface, version, bind)
192}
193func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
194	if v == nil {
195		return nil
196	}
197	return v.GetResource()
198}
199func (self *ZwlrScreencopyManagerV1) GetResource() *server.Resource {
200	if self == nil {
201		return nil
202	}
203	return self.Resource
204}
205func (self *ZwlrScreencopyFrameV1) GetResource() *server.Resource {
206	if self == nil {
207		return nil
208	}
209	return self.Resource
210}

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