v0.6.0 d4696de

extidlenotify.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package extidlenotify
3
4import (
5	"fmt"
6	wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7	"github.com/bnema/purego-libwayland/server"
8)
9
10var ExtIdleNotifierV1Interface *server.Interface
11var ExtIdleNotificationV1Interface *server.Interface
12
13func init() {
14	ExtIdleNotifierV1Interface = &server.Interface{Name: "ext_idle_notifier_v1", Version: 2}
15	ExtIdleNotificationV1Interface = &server.Interface{Name: "ext_idle_notification_v1", Version: 2}
16	ExtIdleNotifierV1Interface.Requests = []server.Message{
17		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
18		{Name: "get_idle_notification", Signature: "nuo", Types: []*server.Interface{ExtIdleNotificationV1Interface, nil, wayland.SeatInterface}},
19		{Name: "get_input_idle_notification", Signature: "2nuo", Types: []*server.Interface{ExtIdleNotificationV1Interface, nil, wayland.SeatInterface}},
20	}
21	ExtIdleNotifierV1Interface.Events = []server.Message{}
22	ExtIdleNotificationV1Interface.Requests = []server.Message{
23		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
24	}
25	ExtIdleNotificationV1Interface.Events = []server.Message{
26		{Name: "idled", Signature: "", Types: []*server.Interface{}},
27		{Name: "resumed", Signature: "", Types: []*server.Interface{}},
28	}
29	if err := server.NewInterfaces(ExtIdleNotifierV1Interface, ExtIdleNotificationV1Interface); err != nil {
30		panic(err)
31	}
32}
33
34// ExtIdleNotifierV1 idle notification manager.
35type ExtIdleNotifierV1 struct{ *server.Resource }
36
37func WrapExtIdleNotifierV1(r *server.Resource) *ExtIdleNotifierV1 {
38	if r == nil {
39		return nil
40	}
41	return &ExtIdleNotifierV1{r}
42}
43
44const ExtIdleNotifierV1RequestDestroy uint32 = 0
45const ExtIdleNotifierV1RequestGetIdleNotification uint32 = 1
46const ExtIdleNotifierV1RequestGetInputIdleNotification uint32 = 2
47
48// ExtIdleNotifierV1Handler handles ext_idle_notifier_v1 requests.
49type ExtIdleNotifierV1Handler interface {
50	Destroy(self *ExtIdleNotifierV1)
51	GetIdleNotification(self *ExtIdleNotifierV1, id uint32, timeout uint32, seat *wayland.Seat)
52	GetInputIdleNotification(self *ExtIdleNotifierV1, id uint32, timeout uint32, seat *wayland.Seat)
53}
54
55func NewExtIdleNotifierV1(c server.Client, version int32, id uint32, h ExtIdleNotifierV1Handler) (*ExtIdleNotifierV1, error) {
56	if h == nil {
57		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_idle_notifier_v1")
58	}
59	var self *ExtIdleNotifierV1
60	r, err := c.CreateResource(ExtIdleNotifierV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
61		switch opcode {
62		case 0:
63			h.Destroy(self)
64			self.Destroy()
65		case 1:
66			h.GetIdleNotification(self, args[0].NewID(), args[1].Uint(), wayland.WrapSeat(args[2].Resource()))
67		case 2:
68			h.GetInputIdleNotification(self, args[0].NewID(), args[1].Uint(), wayland.WrapSeat(args[2].Resource()))
69		}
70	})
71	if err != nil {
72		return nil, err
73	}
74	self = WrapExtIdleNotifierV1(r)
75	r.Data = self
76	return self, nil
77}
78func NewExtIdleNotifierV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79	return d.CreateGlobal(ExtIdleNotifierV1Interface, version, bind)
80}
81
82// ExtIdleNotificationV1 idle notification.
83type ExtIdleNotificationV1 struct{ *server.Resource }
84
85func WrapExtIdleNotificationV1(r *server.Resource) *ExtIdleNotificationV1 {
86	if r == nil {
87		return nil
88	}
89	return &ExtIdleNotificationV1{r}
90}
91
92const ExtIdleNotificationV1RequestDestroy uint32 = 0
93const ExtIdleNotificationV1EventIdled uint32 = 0
94const ExtIdleNotificationV1EventResumed uint32 = 1
95
96// ExtIdleNotificationV1Handler handles ext_idle_notification_v1 requests.
97type ExtIdleNotificationV1Handler interface {
98	Destroy(self *ExtIdleNotificationV1)
99}
100
101func NewExtIdleNotificationV1(c server.Client, version int32, id uint32, h ExtIdleNotificationV1Handler) (*ExtIdleNotificationV1, error) {
102	if h == nil {
103		return nil, fmt.Errorf("purego-libwayland: nil handler for ext_idle_notification_v1")
104	}
105	var self *ExtIdleNotificationV1
106	r, err := c.CreateResource(ExtIdleNotificationV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
107		switch opcode {
108		case 0:
109			h.Destroy(self)
110			self.Destroy()
111		}
112	})
113	if err != nil {
114		return nil, err
115	}
116	self = WrapExtIdleNotificationV1(r)
117	r.Data = self
118	return self, nil
119}
120
121// SendIdled notification object is idle.
122func (self *ExtIdleNotificationV1) SendIdled() {
123	self.PostEvent(ExtIdleNotificationV1EventIdled)
124}
125
126// SendResumed notification object is no longer idle.
127func (self *ExtIdleNotificationV1) SendResumed() {
128	self.PostEvent(ExtIdleNotificationV1EventResumed)
129}
130func NewExtIdleNotificationV1Global(d *server.Display, version int32, bind server.BindFunc) error {
131	return d.CreateGlobal(ExtIdleNotificationV1Interface, version, bind)
132}
133func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
134	if v == nil {
135		return nil
136	}
137	return v.GetResource()
138}
139func (self *ExtIdleNotifierV1) GetResource() *server.Resource {
140	if self == nil {
141		return nil
142	}
143	return self.Resource
144}
145func (self *ExtIdleNotificationV1) GetResource() *server.Resource {
146	if self == nil {
147		return nil
148	}
149	return self.Resource
150}

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