v0.6.0 d4696de

xdgsessionmanagement.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package xdgsessionmanagement
3
4import (
5	"fmt"
6	xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell"
7	"github.com/bnema/purego-libwayland/server"
8	"runtime"
9)
10
11var SessionManagerV1Interface *server.Interface
12var SessionV1Interface *server.Interface
13var ToplevelSessionV1Interface *server.Interface
14
15func init() {
16	SessionManagerV1Interface = &server.Interface{Name: "xdg_session_manager_v1", Version: 1}
17	SessionV1Interface = &server.Interface{Name: "xdg_session_v1", Version: 1}
18	ToplevelSessionV1Interface = &server.Interface{Name: "xdg_toplevel_session_v1", Version: 1}
19	SessionManagerV1Interface.Requests = []server.Message{
20		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
21		{Name: "get_session", Signature: "nu?s", Types: []*server.Interface{SessionV1Interface, nil, nil}},
22	}
23	SessionManagerV1Interface.Events = []server.Message{}
24	SessionV1Interface.Requests = []server.Message{
25		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
26		{Name: "remove", Signature: "", Types: []*server.Interface{}},
27		{Name: "add_toplevel", Signature: "nos", Types: []*server.Interface{ToplevelSessionV1Interface, xdgshell.ToplevelInterface, nil}},
28		{Name: "restore_toplevel", Signature: "nos", Types: []*server.Interface{ToplevelSessionV1Interface, xdgshell.ToplevelInterface, nil}},
29		{Name: "remove_toplevel", Signature: "s", Types: []*server.Interface{nil}},
30	}
31	SessionV1Interface.Events = []server.Message{
32		{Name: "created", Signature: "s", Types: []*server.Interface{nil}},
33		{Name: "restored", Signature: "", Types: []*server.Interface{}},
34		{Name: "replaced", Signature: "", Types: []*server.Interface{}},
35	}
36	ToplevelSessionV1Interface.Requests = []server.Message{
37		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
38		{Name: "rename", Signature: "s", Types: []*server.Interface{nil}},
39	}
40	ToplevelSessionV1Interface.Events = []server.Message{
41		{Name: "restored", Signature: "", Types: []*server.Interface{}},
42	}
43	if err := server.NewInterfaces(SessionManagerV1Interface, SessionV1Interface, ToplevelSessionV1Interface); err != nil {
44		panic(err)
45	}
46}
47
48// SessionManagerV1 manage sessions for applications.
49type SessionManagerV1 struct{ *server.Resource }
50
51func WrapSessionManagerV1(r *server.Resource) *SessionManagerV1 {
52	if r == nil {
53		return nil
54	}
55	return &SessionManagerV1{r}
56}
57
58const SessionManagerV1RequestDestroy uint32 = 0
59const SessionManagerV1RequestGetSession uint32 = 1
60
61// SessionManagerV1Error .
62type SessionManagerV1Error uint32
63
64const (
65	SessionManagerV1ErrorInUse            SessionManagerV1Error = 1
66	SessionManagerV1ErrorInvalidSessionId SessionManagerV1Error = 2
67	SessionManagerV1ErrorInvalidReason    SessionManagerV1Error = 3
68)
69
70// SessionManagerV1Reason reason for getting a session.
71type SessionManagerV1Reason uint32
72
73const (
74	SessionManagerV1ReasonLaunch         SessionManagerV1Reason = 1
75	SessionManagerV1ReasonRecover        SessionManagerV1Reason = 2
76	SessionManagerV1ReasonSessionRestore SessionManagerV1Reason = 3
77)
78
79// SessionManagerV1Handler handles xdg_session_manager_v1 requests.
80type SessionManagerV1Handler interface {
81	Destroy(self *SessionManagerV1)
82	GetSession(self *SessionManagerV1, id uint32, reason uint32, sessionId string)
83}
84
85func NewSessionManagerV1(c server.Client, version int32, id uint32, h SessionManagerV1Handler) (*SessionManagerV1, error) {
86	if h == nil {
87		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_session_manager_v1")
88	}
89	var self *SessionManagerV1
90	r, err := c.CreateResource(SessionManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
91		switch opcode {
92		case 0:
93			h.Destroy(self)
94			self.Destroy()
95		case 1:
96			h.GetSession(self, args[0].NewID(), args[1].Uint(), args[2].String())
97		}
98	})
99	if err != nil {
100		return nil, err
101	}
102	self = WrapSessionManagerV1(r)
103	r.Data = self
104	return self, nil
105}
106func NewSessionManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
107	return d.CreateGlobal(SessionManagerV1Interface, version, bind)
108}
109
110// SessionV1 A session for an application.
111type SessionV1 struct{ *server.Resource }
112
113func WrapSessionV1(r *server.Resource) *SessionV1 {
114	if r == nil {
115		return nil
116	}
117	return &SessionV1{r}
118}
119
120const SessionV1RequestDestroy uint32 = 0
121const SessionV1RequestRemove uint32 = 1
122const SessionV1RequestAddToplevel uint32 = 2
123const SessionV1RequestRestoreToplevel uint32 = 3
124const SessionV1RequestRemoveToplevel uint32 = 4
125const SessionV1EventCreated uint32 = 0
126const SessionV1EventRestored uint32 = 1
127const SessionV1EventReplaced uint32 = 2
128
129// SessionV1Error .
130type SessionV1Error uint32
131
132const (
133	SessionV1ErrorNameInUse     SessionV1Error = 1
134	SessionV1ErrorAlreadyMapped SessionV1Error = 2
135	SessionV1ErrorInvalidName   SessionV1Error = 3
136	SessionV1ErrorAlreadyAdded  SessionV1Error = 4
137)
138
139// SessionV1Handler handles xdg_session_v1 requests.
140type SessionV1Handler interface {
141	Destroy(self *SessionV1)
142	Remove(self *SessionV1)
143	AddToplevel(self *SessionV1, id uint32, toplevel *xdgshell.Toplevel, name string)
144	RestoreToplevel(self *SessionV1, id uint32, toplevel *xdgshell.Toplevel, name string)
145	RemoveToplevel(self *SessionV1, name string)
146}
147
148func NewSessionV1(c server.Client, version int32, id uint32, h SessionV1Handler) (*SessionV1, error) {
149	if h == nil {
150		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_session_v1")
151	}
152	var self *SessionV1
153	r, err := c.CreateResource(SessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
154		switch opcode {
155		case 0:
156			h.Destroy(self)
157			self.Destroy()
158		case 1:
159			h.Remove(self)
160			self.Destroy()
161		case 2:
162			h.AddToplevel(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()), args[2].String())
163		case 3:
164			h.RestoreToplevel(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()), args[2].String())
165		case 4:
166			h.RemoveToplevel(self, args[0].String())
167		}
168	})
169	if err != nil {
170		return nil, err
171	}
172	self = WrapSessionV1(r)
173	r.Data = self
174	return self, nil
175}
176
177// SendCreated newly-created session id.
178func (self *SessionV1) SendCreated(sessionId string) {
179	var p runtime.Pinner
180	defer p.Unpin()
181	self.PostEvent(SessionV1EventCreated, server.String(&p, sessionId, false))
182}
183
184// SendRestored the session has been restored.
185func (self *SessionV1) SendRestored() {
186	self.PostEvent(SessionV1EventRestored)
187}
188
189// SendReplaced the session has been replaced.
190func (self *SessionV1) SendReplaced() {
191	self.PostEvent(SessionV1EventReplaced)
192}
193func NewSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
194	return d.CreateGlobal(SessionV1Interface, version, bind)
195}
196
197// ToplevelSessionV1 A session for an application.
198type ToplevelSessionV1 struct{ *server.Resource }
199
200func WrapToplevelSessionV1(r *server.Resource) *ToplevelSessionV1 {
201	if r == nil {
202		return nil
203	}
204	return &ToplevelSessionV1{r}
205}
206
207const ToplevelSessionV1RequestDestroy uint32 = 0
208const ToplevelSessionV1RequestRename uint32 = 1
209const ToplevelSessionV1EventRestored uint32 = 0
210
211// ToplevelSessionV1Handler handles xdg_toplevel_session_v1 requests.
212type ToplevelSessionV1Handler interface {
213	Destroy(self *ToplevelSessionV1)
214	Rename(self *ToplevelSessionV1, name string)
215}
216
217func NewToplevelSessionV1(c server.Client, version int32, id uint32, h ToplevelSessionV1Handler) (*ToplevelSessionV1, error) {
218	if h == nil {
219		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_session_v1")
220	}
221	var self *ToplevelSessionV1
222	r, err := c.CreateResource(ToplevelSessionV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
223		switch opcode {
224		case 0:
225			h.Destroy(self)
226			self.Destroy()
227		case 1:
228			h.Rename(self, args[0].String())
229		}
230	})
231	if err != nil {
232		return nil, err
233	}
234	self = WrapToplevelSessionV1(r)
235	r.Data = self
236	return self, nil
237}
238
239// SendRestored a toplevel's session has been restored.
240func (self *ToplevelSessionV1) SendRestored() {
241	self.PostEvent(ToplevelSessionV1EventRestored)
242}
243func NewToplevelSessionV1Global(d *server.Display, version int32, bind server.BindFunc) error {
244	return d.CreateGlobal(ToplevelSessionV1Interface, version, bind)
245}
246func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
247	if v == nil {
248		return nil
249	}
250	return v.GetResource()
251}
252func (self *SessionManagerV1) GetResource() *server.Resource {
253	if self == nil {
254		return nil
255	}
256	return self.Resource
257}
258func (self *SessionV1) GetResource() *server.Resource {
259	if self == nil {
260		return nil
261	}
262	return self.Resource
263}
264func (self *ToplevelSessionV1) GetResource() *server.Resource {
265	if self == nil {
266		return nil
267	}
268	return self.Resource
269}

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