main 5004296

extdatacontrol_generated.go RawHistoryFolder

1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// Copyright © 2018 Simon Ser
5// Copyright © 2019 Ivan Molodetskikh
6// Copyright © 2024 Neal Gompa
7//
8// Permission to use, copy, modify, distribute, and sell this
9// software and its documentation for any purpose is hereby granted
10// without fee, provided that the above copyright notice appear in
11// all copies and that both that copyright notice and this permission
12// notice appear in supporting documentation, and that the name of
13// the copyright holders not be used in advertising or publicity
14// pertaining to distribution of the software without specific,
15// written prior permission.  The copyright holders make no
16// representations about the suitability of this software for any
17// purpose.  It is provided "as is" without express or implied
18// warranty.
19//
20// THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
21// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
22// FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
23// SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25// AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26// ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
27// THIS SOFTWARE.
28
29package extdatacontrol
30
31import (
32	"fmt"
33	wayland "github.com/bnema/go-wayland-bindings/server/wayland"
34	"github.com/bnema/purego-libwayland/server"
35	"runtime"
36)
37
38var ExtDataControlManagerV1Interface *server.Interface
39var ExtDataControlDeviceV1Interface *server.Interface
40var ExtDataControlSourceV1Interface *server.Interface
41var ExtDataControlOfferV1Interface *server.Interface
42
43func init() {
44	ExtDataControlManagerV1Interface = &server.Interface{Name: "ext_data_control_manager_v1", Version: 1}
45	ExtDataControlDeviceV1Interface = &server.Interface{Name: "ext_data_control_device_v1", Version: 1}
46	ExtDataControlSourceV1Interface = &server.Interface{Name: "ext_data_control_source_v1", Version: 1}
47	ExtDataControlOfferV1Interface = &server.Interface{Name: "ext_data_control_offer_v1", Version: 1}
48	ExtDataControlManagerV1Interface.Requests = []server.Message{
49		{Name: "create_data_source", Signature: "n", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
50		{Name: "get_data_device", Signature: "no", Types: []*server.Interface{ExtDataControlDeviceV1Interface, wayland.SeatInterface}},
51		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
52	}
53	ExtDataControlManagerV1Interface.Events = []server.Message{}
54	ExtDataControlDeviceV1Interface.Requests = []server.Message{
55		{Name: "set_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
56		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
57		{Name: "set_primary_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
58	}
59	ExtDataControlDeviceV1Interface.Events = []server.Message{
60		{Name: "data_offer", Signature: "n", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
61		{Name: "selection", Signature: "?o", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
62		{Name: "finished", Signature: "", Types: []*server.Interface{}},
63		{Name: "primary_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
64	}
65	ExtDataControlSourceV1Interface.Requests = []server.Message{
66		{Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
67		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
68	}
69	ExtDataControlSourceV1Interface.Events = []server.Message{
70		{Name: "send", Signature: "sh", Types: []*server.Interface{nil, nil}},
71		{Name: "cancelled", Signature: "", Types: []*server.Interface{}},
72	}
73	ExtDataControlOfferV1Interface.Requests = []server.Message{
74		{Name: "receive", Signature: "sh", Types: []*server.Interface{nil, nil}},
75		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
76	}
77	ExtDataControlOfferV1Interface.Events = []server.Message{
78		{Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
79	}
80	if err := server.NewInterfaces(ExtDataControlManagerV1Interface, ExtDataControlDeviceV1Interface, ExtDataControlSourceV1Interface, ExtDataControlOfferV1Interface); err != nil {
81		panic(err)
82	}
83}
84
85// ExtDataControlManagerV1 manager to control data devices.
86type ExtDataControlManagerV1 struct{ *server.Resource }
87
88func WrapExtDataControlManagerV1(r *server.Resource) *ExtDataControlManagerV1 {
89	if r == nil {
90		return nil
91	}
92	return &ExtDataControlManagerV1{r}
93}
94
95const ExtDataControlManagerV1RequestCreateDataSource uint32 = 0
96const ExtDataControlManagerV1RequestGetDataDevice uint32 = 1
97const ExtDataControlManagerV1RequestDestroy uint32 = 2
98
99// ExtDataControlManagerV1Handler handles ext_data_control_manager_v1 requests.
100type ExtDataControlManagerV1Handler interface {
101	CreateDataSource(self *ExtDataControlManagerV1, id uint32)
102	GetDataDevice(self *ExtDataControlManagerV1, id uint32, seat *wayland.Seat)
103	Destroy(self *ExtDataControlManagerV1)
104}
105
106func NewExtDataControlManagerV1(c server.Client, version int32, id uint32, h ExtDataControlManagerV1Handler) (*ExtDataControlManagerV1, error) {
107	if h == nil {
108		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_manager_v1")
109	}
110	var self *ExtDataControlManagerV1
111	r, err := c.CreateResource(ExtDataControlManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
112		switch opcode {
113		case 0:
114			h.CreateDataSource(self, args[0].NewID())
115		case 1:
116			h.GetDataDevice(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
117		case 2:
118			h.Destroy(self)
119			self.Destroy()
120		}
121	})
122	if err != nil {
123		return nil, err
124	}
125	self = WrapExtDataControlManagerV1(r)
126	r.Data = self
127	return self, nil
128}
129func NewExtDataControlManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
130	return d.CreateGlobal(ExtDataControlManagerV1Interface, version, bind)
131}
132
133// ExtDataControlDeviceV1 manage a data device for a seat.
134type ExtDataControlDeviceV1 struct{ *server.Resource }
135
136func WrapExtDataControlDeviceV1(r *server.Resource) *ExtDataControlDeviceV1 {
137	if r == nil {
138		return nil
139	}
140	return &ExtDataControlDeviceV1{r}
141}
142
143const ExtDataControlDeviceV1RequestSetSelection uint32 = 0
144const ExtDataControlDeviceV1RequestDestroy uint32 = 1
145const ExtDataControlDeviceV1RequestSetPrimarySelection uint32 = 2
146const ExtDataControlDeviceV1EventDataOffer uint32 = 0
147const ExtDataControlDeviceV1EventSelection uint32 = 1
148const ExtDataControlDeviceV1EventFinished uint32 = 2
149const ExtDataControlDeviceV1EventPrimarySelection uint32 = 3
150
151// ExtDataControlDeviceV1Error .
152type ExtDataControlDeviceV1Error uint32
153
154const (
155	ExtDataControlDeviceV1ErrorUsedSource ExtDataControlDeviceV1Error = 1
156)
157
158// ExtDataControlDeviceV1Handler handles ext_data_control_device_v1 requests.
159type ExtDataControlDeviceV1Handler interface {
160	SetSelection(self *ExtDataControlDeviceV1, source *ExtDataControlSourceV1)
161	Destroy(self *ExtDataControlDeviceV1)
162	SetPrimarySelection(self *ExtDataControlDeviceV1, source *ExtDataControlSourceV1)
163}
164
165func NewExtDataControlDeviceV1(c server.Client, version int32, id uint32, h ExtDataControlDeviceV1Handler) (*ExtDataControlDeviceV1, error) {
166	if h == nil {
167		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_device_v1")
168	}
169	var self *ExtDataControlDeviceV1
170	r, err := c.CreateResource(ExtDataControlDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
171		switch opcode {
172		case 0:
173			h.SetSelection(self, WrapExtDataControlSourceV1(args[0].Resource()))
174		case 1:
175			h.Destroy(self)
176			self.Destroy()
177		case 2:
178			h.SetPrimarySelection(self, WrapExtDataControlSourceV1(args[0].Resource()))
179		}
180	})
181	if err != nil {
182		return nil, err
183	}
184	self = WrapExtDataControlDeviceV1(r)
185	r.Data = self
186	return self, nil
187}
188
189// SendDataOffer introduce a new ext_data_control_offer.
190func (self *ExtDataControlDeviceV1) SendDataOffer(id *ExtDataControlOfferV1) {
191	self.PostEvent(ExtDataControlDeviceV1EventDataOffer, server.NewID(resourceOf(id)))
192}
193
194// SendSelection advertise new selection.
195func (self *ExtDataControlDeviceV1) SendSelection(id *ExtDataControlOfferV1) {
196	self.PostEvent(ExtDataControlDeviceV1EventSelection, server.Object(resourceOf(id)))
197}
198
199// SendFinished this data control is no longer valid.
200func (self *ExtDataControlDeviceV1) SendFinished() {
201	self.PostEvent(ExtDataControlDeviceV1EventFinished)
202}
203
204// SendPrimarySelection advertise new primary selection.
205func (self *ExtDataControlDeviceV1) SendPrimarySelection(id *ExtDataControlOfferV1) {
206	self.PostEvent(ExtDataControlDeviceV1EventPrimarySelection, server.Object(resourceOf(id)))
207}
208func NewExtDataControlDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
209	return d.CreateGlobal(ExtDataControlDeviceV1Interface, version, bind)
210}
211
212// ExtDataControlSourceV1 offer to transfer data.
213type ExtDataControlSourceV1 struct{ *server.Resource }
214
215func WrapExtDataControlSourceV1(r *server.Resource) *ExtDataControlSourceV1 {
216	if r == nil {
217		return nil
218	}
219	return &ExtDataControlSourceV1{r}
220}
221
222const ExtDataControlSourceV1RequestOffer uint32 = 0
223const ExtDataControlSourceV1RequestDestroy uint32 = 1
224const ExtDataControlSourceV1EventSend uint32 = 0
225const ExtDataControlSourceV1EventCancelled uint32 = 1
226
227// ExtDataControlSourceV1Error .
228type ExtDataControlSourceV1Error uint32
229
230const (
231	ExtDataControlSourceV1ErrorInvalidOffer ExtDataControlSourceV1Error = 1
232)
233
234// ExtDataControlSourceV1Handler handles ext_data_control_source_v1 requests.
235type ExtDataControlSourceV1Handler interface {
236	Offer(self *ExtDataControlSourceV1, mimeType string)
237	Destroy(self *ExtDataControlSourceV1)
238}
239
240func NewExtDataControlSourceV1(c server.Client, version int32, id uint32, h ExtDataControlSourceV1Handler) (*ExtDataControlSourceV1, error) {
241	if h == nil {
242		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_source_v1")
243	}
244	var self *ExtDataControlSourceV1
245	r, err := c.CreateResource(ExtDataControlSourceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
246		switch opcode {
247		case 0:
248			h.Offer(self, args[0].String())
249		case 1:
250			h.Destroy(self)
251			self.Destroy()
252		}
253	})
254	if err != nil {
255		return nil, err
256	}
257	self = WrapExtDataControlSourceV1(r)
258	r.Data = self
259	return self, nil
260}
261
262// SendSend send the data.
263func (self *ExtDataControlSourceV1) SendSend(mimeType string, fd int) {
264	var p runtime.Pinner
265	defer p.Unpin()
266	self.PostEvent(ExtDataControlSourceV1EventSend, server.String(&p, mimeType, false), server.Fd(fd))
267}
268
269// SendCancelled selection was cancelled.
270func (self *ExtDataControlSourceV1) SendCancelled() {
271	self.PostEvent(ExtDataControlSourceV1EventCancelled)
272}
273func NewExtDataControlSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
274	return d.CreateGlobal(ExtDataControlSourceV1Interface, version, bind)
275}
276
277// ExtDataControlOfferV1 offer to transfer data.
278type ExtDataControlOfferV1 struct{ *server.Resource }
279
280func WrapExtDataControlOfferV1(r *server.Resource) *ExtDataControlOfferV1 {
281	if r == nil {
282		return nil
283	}
284	return &ExtDataControlOfferV1{r}
285}
286
287const ExtDataControlOfferV1RequestReceive uint32 = 0
288const ExtDataControlOfferV1RequestDestroy uint32 = 1
289const ExtDataControlOfferV1EventOffer uint32 = 0
290
291// ExtDataControlOfferV1Handler handles ext_data_control_offer_v1 requests.
292type ExtDataControlOfferV1Handler interface {
293	Receive(self *ExtDataControlOfferV1, mimeType string, fd int)
294	Destroy(self *ExtDataControlOfferV1)
295}
296
297func NewExtDataControlOfferV1(c server.Client, version int32, id uint32, h ExtDataControlOfferV1Handler) (*ExtDataControlOfferV1, error) {
298	if h == nil {
299		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_offer_v1")
300	}
301	var self *ExtDataControlOfferV1
302	r, err := c.CreateResource(ExtDataControlOfferV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
303		switch opcode {
304		case 0:
305			h.Receive(self, args[0].String(), args[1].Fd())
306		case 1:
307			h.Destroy(self)
308			self.Destroy()
309		}
310	})
311	if err != nil {
312		return nil, err
313	}
314	self = WrapExtDataControlOfferV1(r)
315	r.Data = self
316	return self, nil
317}
318
319// SendOffer advertise offered MIME type.
320func (self *ExtDataControlOfferV1) SendOffer(mimeType string) {
321	var p runtime.Pinner
322	defer p.Unpin()
323	self.PostEvent(ExtDataControlOfferV1EventOffer, server.String(&p, mimeType, false))
324}
325func NewExtDataControlOfferV1Global(d *server.Display, version int32, bind server.BindFunc) error {
326	return d.CreateGlobal(ExtDataControlOfferV1Interface, version, bind)
327}
328func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
329	if v == nil {
330		return nil
331	}
332	return v.GetResource()
333}
334func (self *ExtDataControlManagerV1) GetResource() *server.Resource {
335	if self == nil {
336		return nil
337	}
338	return self.Resource
339}
340func (self *ExtDataControlDeviceV1) GetResource() *server.Resource {
341	if self == nil {
342		return nil
343	}
344	return self.Resource
345}
346func (self *ExtDataControlSourceV1) GetResource() *server.Resource {
347	if self == nil {
348		return nil
349	}
350	return self.Resource
351}
352func (self *ExtDataControlOfferV1) GetResource() *server.Resource {
353	if self == nil {
354		return nil
355	}
356	return self.Resource
357}

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