v0.1.0 24ec840

linuxdmabuf.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package linuxdmabuf
3
4import (
5	"fmt"
6	wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7	"github.com/bnema/purego-libwayland/server"
8	"runtime"
9)
10
11var ZwpLinuxDmabufV1Interface *server.Interface
12var ZwpLinuxBufferParamsV1Interface *server.Interface
13var ZwpLinuxDmabufFeedbackV1Interface *server.Interface
14
15func init() {
16	ZwpLinuxDmabufV1Interface = &server.Interface{Name: "zwp_linux_dmabuf_v1", Version: 6}
17	ZwpLinuxBufferParamsV1Interface = &server.Interface{Name: "zwp_linux_buffer_params_v1", Version: 6}
18	ZwpLinuxDmabufFeedbackV1Interface = &server.Interface{Name: "zwp_linux_dmabuf_feedback_v1", Version: 6}
19	ZwpLinuxDmabufV1Interface.Requests = []server.Message{
20		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
21		{Name: "create_params", Signature: "n", Types: []*server.Interface{ZwpLinuxBufferParamsV1Interface}},
22		{Name: "get_default_feedback", Signature: "4n", Types: []*server.Interface{ZwpLinuxDmabufFeedbackV1Interface}},
23		{Name: "get_surface_feedback", Signature: "4no", Types: []*server.Interface{ZwpLinuxDmabufFeedbackV1Interface, wayland.SurfaceInterface}},
24	}
25	ZwpLinuxDmabufV1Interface.Events = []server.Message{
26		{Name: "format", Signature: "u", Types: []*server.Interface{nil}},
27		{Name: "modifier", Signature: "3uuu", Types: []*server.Interface{nil, nil, nil}},
28	}
29	ZwpLinuxBufferParamsV1Interface.Requests = []server.Message{
30		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
31		{Name: "add", Signature: "huuuuu", Types: []*server.Interface{nil, nil, nil, nil, nil, nil}},
32		{Name: "create", Signature: "iiuu", Types: []*server.Interface{nil, nil, nil, nil}},
33		{Name: "create_immed", Signature: "2niiuu", Types: []*server.Interface{wayland.BufferInterface, nil, nil, nil, nil}},
34		{Name: "set_sampling_device", Signature: "6a", Types: []*server.Interface{nil}},
35	}
36	ZwpLinuxBufferParamsV1Interface.Events = []server.Message{
37		{Name: "created", Signature: "n", Types: []*server.Interface{wayland.BufferInterface}},
38		{Name: "failed", Signature: "", Types: []*server.Interface{}},
39	}
40	ZwpLinuxDmabufFeedbackV1Interface.Requests = []server.Message{
41		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
42	}
43	ZwpLinuxDmabufFeedbackV1Interface.Events = []server.Message{
44		{Name: "done", Signature: "", Types: []*server.Interface{}},
45		{Name: "format_table", Signature: "hu", Types: []*server.Interface{nil, nil}},
46		{Name: "main_device", Signature: "a", Types: []*server.Interface{nil}},
47		{Name: "tranche_done", Signature: "", Types: []*server.Interface{}},
48		{Name: "tranche_target_device", Signature: "a", Types: []*server.Interface{nil}},
49		{Name: "tranche_formats", Signature: "a", Types: []*server.Interface{nil}},
50		{Name: "tranche_flags", Signature: "u", Types: []*server.Interface{nil}},
51	}
52	if err := server.NewInterfaces(ZwpLinuxDmabufV1Interface, ZwpLinuxBufferParamsV1Interface, ZwpLinuxDmabufFeedbackV1Interface); err != nil {
53		panic(err)
54	}
55}
56
57// ZwpLinuxDmabufV1 factory for creating dmabuf-based wl_buffers.
58type ZwpLinuxDmabufV1 struct{ *server.Resource }
59
60func WrapZwpLinuxDmabufV1(r *server.Resource) *ZwpLinuxDmabufV1 {
61	if r == nil {
62		return nil
63	}
64	return &ZwpLinuxDmabufV1{r}
65}
66
67const ZwpLinuxDmabufV1RequestDestroy uint32 = 0
68const ZwpLinuxDmabufV1RequestCreateParams uint32 = 1
69const ZwpLinuxDmabufV1RequestGetDefaultFeedback uint32 = 2
70const ZwpLinuxDmabufV1RequestGetSurfaceFeedback uint32 = 3
71const ZwpLinuxDmabufV1EventFormat uint32 = 0
72const ZwpLinuxDmabufV1EventModifier uint32 = 1
73
74// ZwpLinuxDmabufV1Handler handles zwp_linux_dmabuf_v1 requests.
75type ZwpLinuxDmabufV1Handler interface {
76	Destroy(self *ZwpLinuxDmabufV1)
77	CreateParams(self *ZwpLinuxDmabufV1, paramsId uint32)
78	GetDefaultFeedback(self *ZwpLinuxDmabufV1, id uint32)
79	GetSurfaceFeedback(self *ZwpLinuxDmabufV1, id uint32, surface *wayland.Surface)
80}
81
82func NewZwpLinuxDmabufV1(c server.Client, version int32, id uint32, h ZwpLinuxDmabufV1Handler) (*ZwpLinuxDmabufV1, error) {
83	if h == nil {
84		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_linux_dmabuf_v1")
85	}
86	var self *ZwpLinuxDmabufV1
87	r, err := c.CreateResource(ZwpLinuxDmabufV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
88		switch opcode {
89		case 0:
90			h.Destroy(self)
91			self.Destroy()
92		case 1:
93			h.CreateParams(self, args[0].NewID())
94		case 2:
95			h.GetDefaultFeedback(self, args[0].NewID())
96		case 3:
97			h.GetSurfaceFeedback(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
98		}
99	})
100	if err != nil {
101		return nil, err
102	}
103	self = WrapZwpLinuxDmabufV1(r)
104	r.Data = self
105	return self, nil
106}
107
108// SendFormat supported buffer format.
109func (self *ZwpLinuxDmabufV1) SendFormat(format uint32) {
110	self.PostEvent(ZwpLinuxDmabufV1EventFormat, server.Uint(format))
111}
112
113// SendModifier supported buffer format modifier (since version 3).
114func (self *ZwpLinuxDmabufV1) SendModifier(format uint32, modifierHi uint32, modifierLo uint32) {
115	self.PostEvent(ZwpLinuxDmabufV1EventModifier, server.Uint(format), server.Uint(modifierHi), server.Uint(modifierLo))
116}
117func NewZwpLinuxDmabufV1Global(d *server.Display, version int32, bind server.BindFunc) error {
118	return d.CreateGlobal(ZwpLinuxDmabufV1Interface, version, bind)
119}
120
121// ZwpLinuxBufferParamsV1 parameters for creating a dmabuf-based wl_buffer.
122type ZwpLinuxBufferParamsV1 struct{ *server.Resource }
123
124func WrapZwpLinuxBufferParamsV1(r *server.Resource) *ZwpLinuxBufferParamsV1 {
125	if r == nil {
126		return nil
127	}
128	return &ZwpLinuxBufferParamsV1{r}
129}
130
131const ZwpLinuxBufferParamsV1RequestDestroy uint32 = 0
132const ZwpLinuxBufferParamsV1RequestAdd uint32 = 1
133const ZwpLinuxBufferParamsV1RequestCreate uint32 = 2
134const ZwpLinuxBufferParamsV1RequestCreateImmed uint32 = 3
135const ZwpLinuxBufferParamsV1RequestSetSamplingDevice uint32 = 4
136const ZwpLinuxBufferParamsV1EventCreated uint32 = 0
137const ZwpLinuxBufferParamsV1EventFailed uint32 = 1
138
139// ZwpLinuxBufferParamsV1Error .
140type ZwpLinuxBufferParamsV1Error uint32
141
142const (
143	ZwpLinuxBufferParamsV1ErrorAlreadyUsed       ZwpLinuxBufferParamsV1Error = 0
144	ZwpLinuxBufferParamsV1ErrorPlaneIdx          ZwpLinuxBufferParamsV1Error = 1
145	ZwpLinuxBufferParamsV1ErrorPlaneSet          ZwpLinuxBufferParamsV1Error = 2
146	ZwpLinuxBufferParamsV1ErrorIncomplete        ZwpLinuxBufferParamsV1Error = 3
147	ZwpLinuxBufferParamsV1ErrorInvalidFormat     ZwpLinuxBufferParamsV1Error = 4
148	ZwpLinuxBufferParamsV1ErrorInvalidDimensions ZwpLinuxBufferParamsV1Error = 5
149	ZwpLinuxBufferParamsV1ErrorOutOfBounds       ZwpLinuxBufferParamsV1Error = 6
150	ZwpLinuxBufferParamsV1ErrorInvalidWlBuffer   ZwpLinuxBufferParamsV1Error = 7
151	ZwpLinuxBufferParamsV1ErrorInvalidDevTSize   ZwpLinuxBufferParamsV1Error = 8
152)
153
154// ZwpLinuxBufferParamsV1Flags  (bitfield).
155type ZwpLinuxBufferParamsV1Flags uint32
156
157const (
158	ZwpLinuxBufferParamsV1FlagsYInvert     ZwpLinuxBufferParamsV1Flags = 1
159	ZwpLinuxBufferParamsV1FlagsInterlaced  ZwpLinuxBufferParamsV1Flags = 2
160	ZwpLinuxBufferParamsV1FlagsBottomFirst ZwpLinuxBufferParamsV1Flags = 4
161)
162
163// ZwpLinuxBufferParamsV1Handler handles zwp_linux_buffer_params_v1 requests.
164type ZwpLinuxBufferParamsV1Handler interface {
165	Destroy(self *ZwpLinuxBufferParamsV1)
166	Add(self *ZwpLinuxBufferParamsV1, fd int, planeIdx uint32, offset uint32, stride uint32, modifierHi uint32, modifierLo uint32)
167	Create(self *ZwpLinuxBufferParamsV1, width int32, height int32, format uint32, flags uint32)
168	CreateImmed(self *ZwpLinuxBufferParamsV1, bufferId uint32, width int32, height int32, format uint32, flags uint32)
169	SetSamplingDevice(self *ZwpLinuxBufferParamsV1, device []byte)
170}
171
172func NewZwpLinuxBufferParamsV1(c server.Client, version int32, id uint32, h ZwpLinuxBufferParamsV1Handler) (*ZwpLinuxBufferParamsV1, error) {
173	if h == nil {
174		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_linux_buffer_params_v1")
175	}
176	var self *ZwpLinuxBufferParamsV1
177	r, err := c.CreateResource(ZwpLinuxBufferParamsV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
178		switch opcode {
179		case 0:
180			h.Destroy(self)
181			self.Destroy()
182		case 1:
183			h.Add(self, args[0].Fd(), args[1].Uint(), args[2].Uint(), args[3].Uint(), args[4].Uint(), args[5].Uint())
184		case 2:
185			h.Create(self, args[0].Int(), args[1].Int(), args[2].Uint(), args[3].Uint())
186		case 3:
187			h.CreateImmed(self, args[0].NewID(), args[1].Int(), args[2].Int(), args[3].Uint(), args[4].Uint())
188		case 4:
189			h.SetSamplingDevice(self, args[0].Array())
190		}
191	})
192	if err != nil {
193		return nil, err
194	}
195	self = WrapZwpLinuxBufferParamsV1(r)
196	r.Data = self
197	return self, nil
198}
199
200// SendCreated buffer creation succeeded.
201func (self *ZwpLinuxBufferParamsV1) SendCreated(buffer *wayland.Buffer) {
202	self.PostEvent(ZwpLinuxBufferParamsV1EventCreated, server.NewID(resourceOf(buffer)))
203}
204
205// SendFailed buffer creation failed.
206func (self *ZwpLinuxBufferParamsV1) SendFailed() {
207	self.PostEvent(ZwpLinuxBufferParamsV1EventFailed)
208}
209func NewZwpLinuxBufferParamsV1Global(d *server.Display, version int32, bind server.BindFunc) error {
210	return d.CreateGlobal(ZwpLinuxBufferParamsV1Interface, version, bind)
211}
212
213// ZwpLinuxDmabufFeedbackV1 dmabuf feedback.
214type ZwpLinuxDmabufFeedbackV1 struct{ *server.Resource }
215
216func WrapZwpLinuxDmabufFeedbackV1(r *server.Resource) *ZwpLinuxDmabufFeedbackV1 {
217	if r == nil {
218		return nil
219	}
220	return &ZwpLinuxDmabufFeedbackV1{r}
221}
222
223const ZwpLinuxDmabufFeedbackV1RequestDestroy uint32 = 0
224const ZwpLinuxDmabufFeedbackV1EventDone uint32 = 0
225const ZwpLinuxDmabufFeedbackV1EventFormatTable uint32 = 1
226const ZwpLinuxDmabufFeedbackV1EventMainDevice uint32 = 2
227const ZwpLinuxDmabufFeedbackV1EventTrancheDone uint32 = 3
228const ZwpLinuxDmabufFeedbackV1EventTrancheTargetDevice uint32 = 4
229const ZwpLinuxDmabufFeedbackV1EventTrancheFormats uint32 = 5
230const ZwpLinuxDmabufFeedbackV1EventTrancheFlags uint32 = 6
231
232// ZwpLinuxDmabufFeedbackV1TrancheFlags  (bitfield).
233type ZwpLinuxDmabufFeedbackV1TrancheFlags uint32
234
235const (
236	ZwpLinuxDmabufFeedbackV1TrancheFlagsScanout  ZwpLinuxDmabufFeedbackV1TrancheFlags = 1
237	ZwpLinuxDmabufFeedbackV1TrancheFlagsSampling ZwpLinuxDmabufFeedbackV1TrancheFlags = 2
238)
239
240// ZwpLinuxDmabufFeedbackV1Handler handles zwp_linux_dmabuf_feedback_v1 requests.
241type ZwpLinuxDmabufFeedbackV1Handler interface {
242	Destroy(self *ZwpLinuxDmabufFeedbackV1)
243}
244
245func NewZwpLinuxDmabufFeedbackV1(c server.Client, version int32, id uint32, h ZwpLinuxDmabufFeedbackV1Handler) (*ZwpLinuxDmabufFeedbackV1, error) {
246	if h == nil {
247		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_linux_dmabuf_feedback_v1")
248	}
249	var self *ZwpLinuxDmabufFeedbackV1
250	r, err := c.CreateResource(ZwpLinuxDmabufFeedbackV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
251		switch opcode {
252		case 0:
253			h.Destroy(self)
254			self.Destroy()
255		}
256	})
257	if err != nil {
258		return nil, err
259	}
260	self = WrapZwpLinuxDmabufFeedbackV1(r)
261	r.Data = self
262	return self, nil
263}
264
265// SendDone all feedback has been sent.
266func (self *ZwpLinuxDmabufFeedbackV1) SendDone() {
267	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventDone)
268}
269
270// SendFormatTable format and modifier table.
271func (self *ZwpLinuxDmabufFeedbackV1) SendFormatTable(fd int, size uint32) {
272	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventFormatTable, server.Fd(fd), server.Uint(size))
273}
274
275// SendMainDevice preferred main device.
276func (self *ZwpLinuxDmabufFeedbackV1) SendMainDevice(device []byte) {
277	var p runtime.Pinner
278	defer p.Unpin()
279	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventMainDevice, server.Array(&p, device))
280}
281
282// SendTrancheDone a preference tranche has been sent.
283func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheDone() {
284	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheDone)
285}
286
287// SendTrancheTargetDevice target device.
288func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheTargetDevice(device []byte) {
289	var p runtime.Pinner
290	defer p.Unpin()
291	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheTargetDevice, server.Array(&p, device))
292}
293
294// SendTrancheFormats supported buffer format modifiers.
295func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheFormats(indices []byte) {
296	var p runtime.Pinner
297	defer p.Unpin()
298	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheFormats, server.Array(&p, indices))
299}
300
301// SendTrancheFlags tranche flags.
302func (self *ZwpLinuxDmabufFeedbackV1) SendTrancheFlags(flags uint32) {
303	self.PostEvent(ZwpLinuxDmabufFeedbackV1EventTrancheFlags, server.Uint(flags))
304}
305func NewZwpLinuxDmabufFeedbackV1Global(d *server.Display, version int32, bind server.BindFunc) error {
306	return d.CreateGlobal(ZwpLinuxDmabufFeedbackV1Interface, version, bind)
307}
308func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
309	if v == nil {
310		return nil
311	}
312	return v.GetResource()
313}
314func (self *ZwpLinuxDmabufV1) GetResource() *server.Resource {
315	if self == nil {
316		return nil
317	}
318	return self.Resource
319}
320func (self *ZwpLinuxBufferParamsV1) GetResource() *server.Resource {
321	if self == nil {
322		return nil
323	}
324	return self.Resource
325}
326func (self *ZwpLinuxDmabufFeedbackV1) GetResource() *server.Resource {
327	if self == nil {
328		return nil
329	}
330	return self.Resource
331}

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