v0.4.1 d14b9a5

primaryselection.go RawHistoryFolder

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

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