v0.2.0 107c393

xdgactivation.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package xdgactivation
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 ActivationV1Interface *server.Interface
12var ActivationTokenV1Interface *server.Interface
13
14func init() {
15	ActivationV1Interface = &server.Interface{Name: "xdg_activation_v1", Version: 1}
16	ActivationTokenV1Interface = &server.Interface{Name: "xdg_activation_token_v1", Version: 1}
17	ActivationV1Interface.Requests = []server.Message{
18		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
19		{Name: "get_activation_token", Signature: "n", Types: []*server.Interface{ActivationTokenV1Interface}},
20		{Name: "activate", Signature: "so", Types: []*server.Interface{nil, wayland.SurfaceInterface}},
21	}
22	ActivationV1Interface.Events = []server.Message{}
23	ActivationTokenV1Interface.Requests = []server.Message{
24		{Name: "set_serial", Signature: "uo", Types: []*server.Interface{nil, wayland.SeatInterface}},
25		{Name: "set_app_id", Signature: "s", Types: []*server.Interface{nil}},
26		{Name: "set_surface", Signature: "o", Types: []*server.Interface{wayland.SurfaceInterface}},
27		{Name: "commit", Signature: "", Types: []*server.Interface{}},
28		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
29	}
30	ActivationTokenV1Interface.Events = []server.Message{
31		{Name: "done", Signature: "s", Types: []*server.Interface{nil}},
32	}
33	if err := server.NewInterfaces(ActivationV1Interface, ActivationTokenV1Interface); err != nil {
34		panic(err)
35	}
36}
37
38// ActivationV1 interface for activating surfaces.
39type ActivationV1 struct{ *server.Resource }
40
41func WrapActivationV1(r *server.Resource) *ActivationV1 {
42	if r == nil {
43		return nil
44	}
45	return &ActivationV1{r}
46}
47
48const ActivationV1RequestDestroy uint32 = 0
49const ActivationV1RequestGetActivationToken uint32 = 1
50const ActivationV1RequestActivate uint32 = 2
51
52// ActivationV1Handler handles xdg_activation_v1 requests.
53type ActivationV1Handler interface {
54	Destroy(self *ActivationV1)
55	GetActivationToken(self *ActivationV1, id uint32)
56	Activate(self *ActivationV1, token string, surface *wayland.Surface)
57}
58
59func NewActivationV1(c server.Client, version int32, id uint32, h ActivationV1Handler) (*ActivationV1, error) {
60	if h == nil {
61		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_activation_v1")
62	}
63	var self *ActivationV1
64	r, err := c.CreateResource(ActivationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
65		switch opcode {
66		case 0:
67			h.Destroy(self)
68			self.Destroy()
69		case 1:
70			h.GetActivationToken(self, args[0].NewID())
71		case 2:
72			h.Activate(self, args[0].String(), wayland.WrapSurface(args[1].Resource()))
73		}
74	})
75	if err != nil {
76		return nil, err
77	}
78	self = WrapActivationV1(r)
79	r.Data = self
80	return self, nil
81}
82func NewActivationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
83	return d.CreateGlobal(ActivationV1Interface, version, bind)
84}
85
86// ActivationTokenV1 an exported activation handle.
87type ActivationTokenV1 struct{ *server.Resource }
88
89func WrapActivationTokenV1(r *server.Resource) *ActivationTokenV1 {
90	if r == nil {
91		return nil
92	}
93	return &ActivationTokenV1{r}
94}
95
96const ActivationTokenV1RequestSetSerial uint32 = 0
97const ActivationTokenV1RequestSetAppId uint32 = 1
98const ActivationTokenV1RequestSetSurface uint32 = 2
99const ActivationTokenV1RequestCommit uint32 = 3
100const ActivationTokenV1RequestDestroy uint32 = 4
101const ActivationTokenV1EventDone uint32 = 0
102
103// ActivationTokenV1Error .
104type ActivationTokenV1Error uint32
105
106const (
107	ActivationTokenV1ErrorAlreadyUsed ActivationTokenV1Error = 0
108)
109
110// ActivationTokenV1Handler handles xdg_activation_token_v1 requests.
111type ActivationTokenV1Handler interface {
112	SetSerial(self *ActivationTokenV1, serial uint32, seat *wayland.Seat)
113	SetAppId(self *ActivationTokenV1, appId string)
114	SetSurface(self *ActivationTokenV1, surface *wayland.Surface)
115	Commit(self *ActivationTokenV1)
116	Destroy(self *ActivationTokenV1)
117}
118
119func NewActivationTokenV1(c server.Client, version int32, id uint32, h ActivationTokenV1Handler) (*ActivationTokenV1, error) {
120	if h == nil {
121		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_activation_token_v1")
122	}
123	var self *ActivationTokenV1
124	r, err := c.CreateResource(ActivationTokenV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
125		switch opcode {
126		case 0:
127			h.SetSerial(self, args[0].Uint(), wayland.WrapSeat(args[1].Resource()))
128		case 1:
129			h.SetAppId(self, args[0].String())
130		case 2:
131			h.SetSurface(self, wayland.WrapSurface(args[0].Resource()))
132		case 3:
133			h.Commit(self)
134		case 4:
135			h.Destroy(self)
136			self.Destroy()
137		}
138	})
139	if err != nil {
140		return nil, err
141	}
142	self = WrapActivationTokenV1(r)
143	r.Data = self
144	return self, nil
145}
146
147// SendDone the exported activation token.
148func (self *ActivationTokenV1) SendDone(token string) {
149	var p runtime.Pinner
150	defer p.Unpin()
151	self.PostEvent(ActivationTokenV1EventDone, server.String(&p, token, false))
152}
153func NewActivationTokenV1Global(d *server.Display, version int32, bind server.BindFunc) error {
154	return d.CreateGlobal(ActivationTokenV1Interface, version, bind)
155}
156func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
157	if v == nil {
158		return nil
159	}
160	return v.GetResource()
161}
162func (self *ActivationV1) GetResource() *server.Resource {
163	if self == nil {
164		return nil
165	}
166	return self.Resource
167}
168func (self *ActivationTokenV1) GetResource() *server.Resource {
169	if self == nil {
170		return nil
171	}
172	return self.Resource
173}

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