detached 1a6c6c9

primaryselection_generated.go RawHistoryFolder

1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// Copyright © 2015, 2016 Red Hat
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 primaryselection
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 ZwpPrimarySelectionDeviceManagerV1Interface *server.Interface
35var ZwpPrimarySelectionDeviceV1Interface *server.Interface
36var ZwpPrimarySelectionOfferV1Interface *server.Interface
37var ZwpPrimarySelectionSourceV1Interface *server.Interface
38
39func init() {
40	ZwpPrimarySelectionDeviceManagerV1Interface = &server.Interface{Name: "zwp_primary_selection_device_manager_v1", Version: 1}
41	ZwpPrimarySelectionDeviceV1Interface = &server.Interface{Name: "zwp_primary_selection_device_v1", Version: 1}
42	ZwpPrimarySelectionOfferV1Interface = &server.Interface{Name: "zwp_primary_selection_offer_v1", Version: 1}
43	ZwpPrimarySelectionSourceV1Interface = &server.Interface{Name: "zwp_primary_selection_source_v1", Version: 1}
44	ZwpPrimarySelectionDeviceManagerV1Interface.Requests = []server.Message{
45		{Name: "create_source", Signature: "n", Types: []*server.Interface{ZwpPrimarySelectionSourceV1Interface}},
46		{Name: "get_device", Signature: "no", Types: []*server.Interface{ZwpPrimarySelectionDeviceV1Interface, wayland.SeatInterface}},
47		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
48	}
49	ZwpPrimarySelectionDeviceManagerV1Interface.Events = []server.Message{}
50	ZwpPrimarySelectionDeviceV1Interface.Requests = []server.Message{
51		{Name: "set_selection", Signature: "?ou", Types: []*server.Interface{ZwpPrimarySelectionSourceV1Interface, nil}},
52		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
53	}
54	ZwpPrimarySelectionDeviceV1Interface.Events = []server.Message{
55		{Name: "data_offer", Signature: "n", Types: []*server.Interface{ZwpPrimarySelectionOfferV1Interface}},
56		{Name: "selection", Signature: "?o", Types: []*server.Interface{ZwpPrimarySelectionOfferV1Interface}},
57	}
58	ZwpPrimarySelectionOfferV1Interface.Requests = []server.Message{
59		{Name: "receive", Signature: "sh", Types: []*server.Interface{nil, nil}},
60		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
61	}
62	ZwpPrimarySelectionOfferV1Interface.Events = []server.Message{
63		{Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
64	}
65	ZwpPrimarySelectionSourceV1Interface.Requests = []server.Message{
66		{Name: "offer", Signature: "s", Types: []*server.Interface{nil}},
67		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
68	}
69	ZwpPrimarySelectionSourceV1Interface.Events = []server.Message{
70		{Name: "send", Signature: "sh", Types: []*server.Interface{nil, nil}},
71		{Name: "cancelled", Signature: "", Types: []*server.Interface{}},
72	}
73	if err := server.NewInterfaces(ZwpPrimarySelectionDeviceManagerV1Interface, ZwpPrimarySelectionDeviceV1Interface, ZwpPrimarySelectionOfferV1Interface, ZwpPrimarySelectionSourceV1Interface); err != nil {
74		panic(err)
75	}
76}
77
78// ZwpPrimarySelectionDeviceManagerV1 X primary selection emulation.
79type ZwpPrimarySelectionDeviceManagerV1 struct{ *server.Resource }
80
81func WrapZwpPrimarySelectionDeviceManagerV1(r *server.Resource) *ZwpPrimarySelectionDeviceManagerV1 {
82	if r == nil {
83		return nil
84	}
85	return &ZwpPrimarySelectionDeviceManagerV1{r}
86}
87
88const ZwpPrimarySelectionDeviceManagerV1RequestCreateSource uint32 = 0
89const ZwpPrimarySelectionDeviceManagerV1RequestGetDevice uint32 = 1
90const ZwpPrimarySelectionDeviceManagerV1RequestDestroy uint32 = 2
91
92// ZwpPrimarySelectionDeviceManagerV1Handler handles zwp_primary_selection_device_manager_v1 requests.
93type ZwpPrimarySelectionDeviceManagerV1Handler interface {
94	CreateSource(self *ZwpPrimarySelectionDeviceManagerV1, id uint32)
95	GetDevice(self *ZwpPrimarySelectionDeviceManagerV1, id uint32, seat *wayland.Seat)
96	Destroy(self *ZwpPrimarySelectionDeviceManagerV1)
97}
98
99func NewZwpPrimarySelectionDeviceManagerV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionDeviceManagerV1Handler) (*ZwpPrimarySelectionDeviceManagerV1, error) {
100	if h == nil {
101		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_device_manager_v1")
102	}
103	var self *ZwpPrimarySelectionDeviceManagerV1
104	r, err := c.CreateResource(ZwpPrimarySelectionDeviceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
105		switch opcode {
106		case 0:
107			h.CreateSource(self, args[0].NewID())
108		case 1:
109			h.GetDevice(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource()))
110		case 2:
111			h.Destroy(self)
112			self.Destroy()
113		}
114	})
115	if err != nil {
116		return nil, err
117	}
118	self = WrapZwpPrimarySelectionDeviceManagerV1(r)
119	r.Data = self
120	return self, nil
121}
122func NewZwpPrimarySelectionDeviceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
123	return d.CreateGlobal(ZwpPrimarySelectionDeviceManagerV1Interface, version, bind)
124}
125
126// ZwpPrimarySelectionDeviceV1 .
127type ZwpPrimarySelectionDeviceV1 struct{ *server.Resource }
128
129func WrapZwpPrimarySelectionDeviceV1(r *server.Resource) *ZwpPrimarySelectionDeviceV1 {
130	if r == nil {
131		return nil
132	}
133	return &ZwpPrimarySelectionDeviceV1{r}
134}
135
136const ZwpPrimarySelectionDeviceV1RequestSetSelection uint32 = 0
137const ZwpPrimarySelectionDeviceV1RequestDestroy uint32 = 1
138const ZwpPrimarySelectionDeviceV1EventDataOffer uint32 = 0
139const ZwpPrimarySelectionDeviceV1EventSelection uint32 = 1
140
141// ZwpPrimarySelectionDeviceV1Handler handles zwp_primary_selection_device_v1 requests.
142type ZwpPrimarySelectionDeviceV1Handler interface {
143	SetSelection(self *ZwpPrimarySelectionDeviceV1, source *ZwpPrimarySelectionSourceV1, serial uint32)
144	Destroy(self *ZwpPrimarySelectionDeviceV1)
145}
146
147func NewZwpPrimarySelectionDeviceV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionDeviceV1Handler) (*ZwpPrimarySelectionDeviceV1, error) {
148	if h == nil {
149		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_device_v1")
150	}
151	var self *ZwpPrimarySelectionDeviceV1
152	r, err := c.CreateResource(ZwpPrimarySelectionDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
153		switch opcode {
154		case 0:
155			h.SetSelection(self, WrapZwpPrimarySelectionSourceV1(args[0].Resource()), args[1].Uint())
156		case 1:
157			h.Destroy(self)
158			self.Destroy()
159		}
160	})
161	if err != nil {
162		return nil, err
163	}
164	self = WrapZwpPrimarySelectionDeviceV1(r)
165	r.Data = self
166	return self, nil
167}
168
169// SendDataOffer introduce a new wp_primary_selection_offer.
170func (self *ZwpPrimarySelectionDeviceV1) SendDataOffer(offer *ZwpPrimarySelectionOfferV1) {
171	self.PostEvent(ZwpPrimarySelectionDeviceV1EventDataOffer, server.NewID(resourceOf(offer)))
172}
173
174// SendSelection advertise a new primary selection.
175func (self *ZwpPrimarySelectionDeviceV1) SendSelection(id *ZwpPrimarySelectionOfferV1) {
176	self.PostEvent(ZwpPrimarySelectionDeviceV1EventSelection, server.Object(resourceOf(id)))
177}
178func NewZwpPrimarySelectionDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
179	return d.CreateGlobal(ZwpPrimarySelectionDeviceV1Interface, version, bind)
180}
181
182// ZwpPrimarySelectionOfferV1 offer to transfer primary selection contents.
183type ZwpPrimarySelectionOfferV1 struct{ *server.Resource }
184
185func WrapZwpPrimarySelectionOfferV1(r *server.Resource) *ZwpPrimarySelectionOfferV1 {
186	if r == nil {
187		return nil
188	}
189	return &ZwpPrimarySelectionOfferV1{r}
190}
191
192const ZwpPrimarySelectionOfferV1RequestReceive uint32 = 0
193const ZwpPrimarySelectionOfferV1RequestDestroy uint32 = 1
194const ZwpPrimarySelectionOfferV1EventOffer uint32 = 0
195
196// ZwpPrimarySelectionOfferV1Handler handles zwp_primary_selection_offer_v1 requests.
197type ZwpPrimarySelectionOfferV1Handler interface {
198	Receive(self *ZwpPrimarySelectionOfferV1, mimeType string, fd int)
199	Destroy(self *ZwpPrimarySelectionOfferV1)
200}
201
202func NewZwpPrimarySelectionOfferV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionOfferV1Handler) (*ZwpPrimarySelectionOfferV1, error) {
203	if h == nil {
204		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_offer_v1")
205	}
206	var self *ZwpPrimarySelectionOfferV1
207	r, err := c.CreateResource(ZwpPrimarySelectionOfferV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
208		switch opcode {
209		case 0:
210			h.Receive(self, args[0].String(), args[1].Fd())
211		case 1:
212			h.Destroy(self)
213			self.Destroy()
214		}
215	})
216	if err != nil {
217		return nil, err
218	}
219	self = WrapZwpPrimarySelectionOfferV1(r)
220	r.Data = self
221	return self, nil
222}
223
224// SendOffer advertise offered mime type.
225func (self *ZwpPrimarySelectionOfferV1) SendOffer(mimeType string) {
226	var p runtime.Pinner
227	defer p.Unpin()
228	self.PostEvent(ZwpPrimarySelectionOfferV1EventOffer, server.String(&p, mimeType, false))
229}
230func NewZwpPrimarySelectionOfferV1Global(d *server.Display, version int32, bind server.BindFunc) error {
231	return d.CreateGlobal(ZwpPrimarySelectionOfferV1Interface, version, bind)
232}
233
234// ZwpPrimarySelectionSourceV1 offer to replace the contents of the primary selection.
235type ZwpPrimarySelectionSourceV1 struct{ *server.Resource }
236
237func WrapZwpPrimarySelectionSourceV1(r *server.Resource) *ZwpPrimarySelectionSourceV1 {
238	if r == nil {
239		return nil
240	}
241	return &ZwpPrimarySelectionSourceV1{r}
242}
243
244const ZwpPrimarySelectionSourceV1RequestOffer uint32 = 0
245const ZwpPrimarySelectionSourceV1RequestDestroy uint32 = 1
246const ZwpPrimarySelectionSourceV1EventSend uint32 = 0
247const ZwpPrimarySelectionSourceV1EventCancelled uint32 = 1
248
249// ZwpPrimarySelectionSourceV1Handler handles zwp_primary_selection_source_v1 requests.
250type ZwpPrimarySelectionSourceV1Handler interface {
251	Offer(self *ZwpPrimarySelectionSourceV1, mimeType string)
252	Destroy(self *ZwpPrimarySelectionSourceV1)
253}
254
255func NewZwpPrimarySelectionSourceV1(c server.Client, version int32, id uint32, h ZwpPrimarySelectionSourceV1Handler) (*ZwpPrimarySelectionSourceV1, error) {
256	if h == nil {
257		return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_primary_selection_source_v1")
258	}
259	var self *ZwpPrimarySelectionSourceV1
260	r, err := c.CreateResource(ZwpPrimarySelectionSourceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
261		switch opcode {
262		case 0:
263			h.Offer(self, args[0].String())
264		case 1:
265			h.Destroy(self)
266			self.Destroy()
267		}
268	})
269	if err != nil {
270		return nil, err
271	}
272	self = WrapZwpPrimarySelectionSourceV1(r)
273	r.Data = self
274	return self, nil
275}
276
277// SendSend send the primary selection contents.
278func (self *ZwpPrimarySelectionSourceV1) SendSend(mimeType string, fd int) {
279	var p runtime.Pinner
280	defer p.Unpin()
281	self.PostEvent(ZwpPrimarySelectionSourceV1EventSend, server.String(&p, mimeType, false), server.Fd(fd))
282}
283
284// SendCancelled request for primary selection contents was canceled.
285func (self *ZwpPrimarySelectionSourceV1) SendCancelled() {
286	self.PostEvent(ZwpPrimarySelectionSourceV1EventCancelled)
287}
288func NewZwpPrimarySelectionSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
289	return d.CreateGlobal(ZwpPrimarySelectionSourceV1Interface, version, bind)
290}
291func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
292	if v == nil {
293		return nil
294	}
295	return v.GetResource()
296}
297func (self *ZwpPrimarySelectionDeviceManagerV1) GetResource() *server.Resource {
298	if self == nil {
299		return nil
300	}
301	return self.Resource
302}
303func (self *ZwpPrimarySelectionDeviceV1) GetResource() *server.Resource {
304	if self == nil {
305		return nil
306	}
307	return self.Resource
308}
309func (self *ZwpPrimarySelectionOfferV1) GetResource() *server.Resource {
310	if self == nil {
311		return nil
312	}
313	return self.Resource
314}
315func (self *ZwpPrimarySelectionSourceV1) GetResource() *server.Resource {
316	if self == nil {
317		return nil
318	}
319	return self.Resource
320}

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