v0.5.0 ad674f5

extdatacontrol.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package extdatacontrol
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 ExtDataControlManagerV1Interface *server.Interface
12var ExtDataControlDeviceV1Interface *server.Interface
13var ExtDataControlSourceV1Interface *server.Interface
14var ExtDataControlOfferV1Interface *server.Interface
15
16func init() {
17	ExtDataControlManagerV1Interface = &server.Interface{Name: "ext_data_control_manager_v1", Version: 1}
18	ExtDataControlDeviceV1Interface = &server.Interface{Name: "ext_data_control_device_v1", Version: 1}
19	ExtDataControlSourceV1Interface = &server.Interface{Name: "ext_data_control_source_v1", Version: 1}
20	ExtDataControlOfferV1Interface = &server.Interface{Name: "ext_data_control_offer_v1", Version: 1}
21	ExtDataControlManagerV1Interface.Requests = []server.Message{
22		{Name: "create_data_source", Signature: "n", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
23		{Name: "get_data_device", Signature: "no", Types: []*server.Interface{ExtDataControlDeviceV1Interface, wayland.SeatInterface}},
24		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
25	}
26	ExtDataControlManagerV1Interface.Events = []server.Message{}
27	ExtDataControlDeviceV1Interface.Requests = []server.Message{
28		{Name: "set_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
29		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
30		{Name: "set_primary_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlSourceV1Interface}},
31	}
32	ExtDataControlDeviceV1Interface.Events = []server.Message{
33		{Name: "data_offer", Signature: "n", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
34		{Name: "selection", Signature: "?o", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
35		{Name: "finished", Signature: "", Types: []*server.Interface{}},
36		{Name: "primary_selection", Signature: "?o", Types: []*server.Interface{ExtDataControlOfferV1Interface}},
37	}
38	ExtDataControlSourceV1Interface.Requests = []server.Message{
39		{Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
40		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
41	}
42	ExtDataControlSourceV1Interface.Events = []server.Message{
43		{Name: "send", Signature: "sh", Types: []*server.Interface{nil, nil}},
44		{Name: "cancelled", Signature: "", Types: []*server.Interface{}},
45	}
46	ExtDataControlOfferV1Interface.Requests = []server.Message{
47		{Name: "receive", Signature: "sh", Types: []*server.Interface{nil, nil}},
48		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
49	}
50	ExtDataControlOfferV1Interface.Events = []server.Message{
51		{Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
52	}
53	if err := server.NewInterfaces(ExtDataControlManagerV1Interface, ExtDataControlDeviceV1Interface, ExtDataControlSourceV1Interface, ExtDataControlOfferV1Interface); err != nil {
54		panic(err)
55	}
56}
57
58// ExtDataControlManagerV1 manager to control data devices.
59type ExtDataControlManagerV1 struct{ *server.Resource }
60
61func WrapExtDataControlManagerV1(r *server.Resource) *ExtDataControlManagerV1 {
62	if r == nil {
63		return nil
64	}
65	return &ExtDataControlManagerV1{r}
66}
67
68const ExtDataControlManagerV1RequestCreateDataSource uint32 = 0
69const ExtDataControlManagerV1RequestGetDataDevice uint32 = 1
70const ExtDataControlManagerV1RequestDestroy uint32 = 2
71
72// ExtDataControlManagerV1Handler handles ext_data_control_manager_v1 requests.
73type ExtDataControlManagerV1Handler interface {
74	CreateDataSource(self *ExtDataControlManagerV1, id uint32)
75	GetDataDevice(self *ExtDataControlManagerV1, id uint32, seat *wayland.Seat)
76	Destroy(self *ExtDataControlManagerV1)
77}
78
79func NewExtDataControlManagerV1(c server.Client, version int32, id uint32, h ExtDataControlManagerV1Handler) (*ExtDataControlManagerV1, error) {
80	if h == nil {
81		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_manager_v1")
82	}
83	var self *ExtDataControlManagerV1
84	r, err := c.CreateResource(ExtDataControlManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
85		switch opcode {
86		case 0:
87			h.CreateDataSource(self, args[0].NewID())
88		case 1:
89			h.GetDataDevice(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
90		case 2:
91			h.Destroy(self)
92			self.Destroy()
93		}
94	})
95	if err != nil {
96		return nil, err
97	}
98	self = WrapExtDataControlManagerV1(r)
99	r.Data = self
100	return self, nil
101}
102func NewExtDataControlManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
103	return d.CreateGlobal(ExtDataControlManagerV1Interface, version, bind)
104}
105
106// ExtDataControlDeviceV1 manage a data device for a seat.
107type ExtDataControlDeviceV1 struct{ *server.Resource }
108
109func WrapExtDataControlDeviceV1(r *server.Resource) *ExtDataControlDeviceV1 {
110	if r == nil {
111		return nil
112	}
113	return &ExtDataControlDeviceV1{r}
114}
115
116const ExtDataControlDeviceV1RequestSetSelection uint32 = 0
117const ExtDataControlDeviceV1RequestDestroy uint32 = 1
118const ExtDataControlDeviceV1RequestSetPrimarySelection uint32 = 2
119const ExtDataControlDeviceV1EventDataOffer uint32 = 0
120const ExtDataControlDeviceV1EventSelection uint32 = 1
121const ExtDataControlDeviceV1EventFinished uint32 = 2
122const ExtDataControlDeviceV1EventPrimarySelection uint32 = 3
123
124// ExtDataControlDeviceV1Error .
125type ExtDataControlDeviceV1Error uint32
126
127const (
128	ExtDataControlDeviceV1ErrorUsedSource ExtDataControlDeviceV1Error = 1
129)
130
131// ExtDataControlDeviceV1Handler handles ext_data_control_device_v1 requests.
132type ExtDataControlDeviceV1Handler interface {
133	SetSelection(self *ExtDataControlDeviceV1, source *ExtDataControlSourceV1)
134	Destroy(self *ExtDataControlDeviceV1)
135	SetPrimarySelection(self *ExtDataControlDeviceV1, source *ExtDataControlSourceV1)
136}
137
138func NewExtDataControlDeviceV1(c server.Client, version int32, id uint32, h ExtDataControlDeviceV1Handler) (*ExtDataControlDeviceV1, error) {
139	if h == nil {
140		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_device_v1")
141	}
142	var self *ExtDataControlDeviceV1
143	r, err := c.CreateResource(ExtDataControlDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
144		switch opcode {
145		case 0:
146			h.SetSelection(self, WrapExtDataControlSourceV1(args[0].Resource()))
147		case 1:
148			h.Destroy(self)
149			self.Destroy()
150		case 2:
151			h.SetPrimarySelection(self, WrapExtDataControlSourceV1(args[0].Resource()))
152		}
153	})
154	if err != nil {
155		return nil, err
156	}
157	self = WrapExtDataControlDeviceV1(r)
158	r.Data = self
159	return self, nil
160}
161
162// SendDataOffer introduce a new ext_data_control_offer.
163func (self *ExtDataControlDeviceV1) SendDataOffer(id *ExtDataControlOfferV1) {
164	self.PostEvent(ExtDataControlDeviceV1EventDataOffer, server.NewID(resourceOf(id)))
165}
166
167// SendSelection advertise new selection.
168func (self *ExtDataControlDeviceV1) SendSelection(id *ExtDataControlOfferV1) {
169	self.PostEvent(ExtDataControlDeviceV1EventSelection, server.Object(resourceOf(id)))
170}
171
172// SendFinished this data control is no longer valid.
173func (self *ExtDataControlDeviceV1) SendFinished() {
174	self.PostEvent(ExtDataControlDeviceV1EventFinished)
175}
176
177// SendPrimarySelection advertise new primary selection.
178func (self *ExtDataControlDeviceV1) SendPrimarySelection(id *ExtDataControlOfferV1) {
179	self.PostEvent(ExtDataControlDeviceV1EventPrimarySelection, server.Object(resourceOf(id)))
180}
181func NewExtDataControlDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
182	return d.CreateGlobal(ExtDataControlDeviceV1Interface, version, bind)
183}
184
185// ExtDataControlSourceV1 offer to transfer data.
186type ExtDataControlSourceV1 struct{ *server.Resource }
187
188func WrapExtDataControlSourceV1(r *server.Resource) *ExtDataControlSourceV1 {
189	if r == nil {
190		return nil
191	}
192	return &ExtDataControlSourceV1{r}
193}
194
195const ExtDataControlSourceV1RequestOffer uint32 = 0
196const ExtDataControlSourceV1RequestDestroy uint32 = 1
197const ExtDataControlSourceV1EventSend uint32 = 0
198const ExtDataControlSourceV1EventCancelled uint32 = 1
199
200// ExtDataControlSourceV1Error .
201type ExtDataControlSourceV1Error uint32
202
203const (
204	ExtDataControlSourceV1ErrorInvalidOffer ExtDataControlSourceV1Error = 1
205)
206
207// ExtDataControlSourceV1Handler handles ext_data_control_source_v1 requests.
208type ExtDataControlSourceV1Handler interface {
209	Offer(self *ExtDataControlSourceV1, mimeType string)
210	Destroy(self *ExtDataControlSourceV1)
211}
212
213func NewExtDataControlSourceV1(c server.Client, version int32, id uint32, h ExtDataControlSourceV1Handler) (*ExtDataControlSourceV1, error) {
214	if h == nil {
215		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_source_v1")
216	}
217	var self *ExtDataControlSourceV1
218	r, err := c.CreateResource(ExtDataControlSourceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
219		switch opcode {
220		case 0:
221			h.Offer(self, args[0].String())
222		case 1:
223			h.Destroy(self)
224			self.Destroy()
225		}
226	})
227	if err != nil {
228		return nil, err
229	}
230	self = WrapExtDataControlSourceV1(r)
231	r.Data = self
232	return self, nil
233}
234
235// SendSend send the data.
236func (self *ExtDataControlSourceV1) SendSend(mimeType string, fd int) {
237	var p runtime.Pinner
238	defer p.Unpin()
239	self.PostEvent(ExtDataControlSourceV1EventSend, server.String(&p, mimeType, false), server.Fd(fd))
240}
241
242// SendCancelled selection was cancelled.
243func (self *ExtDataControlSourceV1) SendCancelled() {
244	self.PostEvent(ExtDataControlSourceV1EventCancelled)
245}
246func NewExtDataControlSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
247	return d.CreateGlobal(ExtDataControlSourceV1Interface, version, bind)
248}
249
250// ExtDataControlOfferV1 offer to transfer data.
251type ExtDataControlOfferV1 struct{ *server.Resource }
252
253func WrapExtDataControlOfferV1(r *server.Resource) *ExtDataControlOfferV1 {
254	if r == nil {
255		return nil
256	}
257	return &ExtDataControlOfferV1{r}
258}
259
260const ExtDataControlOfferV1RequestReceive uint32 = 0
261const ExtDataControlOfferV1RequestDestroy uint32 = 1
262const ExtDataControlOfferV1EventOffer uint32 = 0
263
264// ExtDataControlOfferV1Handler handles ext_data_control_offer_v1 requests.
265type ExtDataControlOfferV1Handler interface {
266	Receive(self *ExtDataControlOfferV1, mimeType string, fd int)
267	Destroy(self *ExtDataControlOfferV1)
268}
269
270func NewExtDataControlOfferV1(c server.Client, version int32, id uint32, h ExtDataControlOfferV1Handler) (*ExtDataControlOfferV1, error) {
271	if h == nil {
272		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_data_control_offer_v1")
273	}
274	var self *ExtDataControlOfferV1
275	r, err := c.CreateResource(ExtDataControlOfferV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
276		switch opcode {
277		case 0:
278			h.Receive(self, args[0].String(), args[1].Fd())
279		case 1:
280			h.Destroy(self)
281			self.Destroy()
282		}
283	})
284	if err != nil {
285		return nil, err
286	}
287	self = WrapExtDataControlOfferV1(r)
288	r.Data = self
289	return self, nil
290}
291
292// SendOffer advertise offered MIME type.
293func (self *ExtDataControlOfferV1) SendOffer(mimeType string) {
294	var p runtime.Pinner
295	defer p.Unpin()
296	self.PostEvent(ExtDataControlOfferV1EventOffer, server.String(&p, mimeType, false))
297}
298func NewExtDataControlOfferV1Global(d *server.Display, version int32, bind server.BindFunc) error {
299	return d.CreateGlobal(ExtDataControlOfferV1Interface, version, bind)
300}
301func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
302	if v == nil {
303		return nil
304	}
305	return v.GetResource()
306}
307func (self *ExtDataControlManagerV1) GetResource() *server.Resource {
308	if self == nil {
309		return nil
310	}
311	return self.Resource
312}
313func (self *ExtDataControlDeviceV1) GetResource() *server.Resource {
314	if self == nil {
315		return nil
316	}
317	return self.Resource
318}
319func (self *ExtDataControlSourceV1) GetResource() *server.Resource {
320	if self == nil {
321		return nil
322	}
323	return self.Resource
324}
325func (self *ExtDataControlOfferV1) GetResource() *server.Resource {
326	if self == nil {
327		return nil
328	}
329	return self.Resource
330}

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