main 5004296

linuxdmabuf_generated.go RawHistoryFolder

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

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 1

↑↓ moveenter openesc close