detached 1a6c6c9

xdgtoplevelicon_generated.go RawHistoryFolder

1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// Copyright © 2023-2024 Matthias Klumpp
5// Copyright ©      2024 David Edmundson
6//
7// Permission is hereby granted, free of charge, to any person obtaining a
8// copy of this software and associated documentation files (the "Software"),
9// to deal in the Software without restriction, including without limitation
10// the rights to use, copy, modify, merge, publish, distribute, sublicense,
11// and/or sell copies of the Software, and to permit persons to whom the
12// Software is furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice (including the next
15// paragraph) shall be included in all copies or substantial portions of the
16// Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24// DEALINGS IN THE SOFTWARE.
25
26package xdgtoplevelicon
27
28import (
29	"fmt"
30	wayland "github.com/bnema/go-wayland-bindings/server/wayland"
31	xdgshell "github.com/bnema/go-wayland-bindings/server/xdgshell"
32	"github.com/bnema/purego-libwayland/server"
33)
34
35var ToplevelIconManagerV1Interface *server.Interface
36var ToplevelIconV1Interface *server.Interface
37
38func init() {
39	ToplevelIconManagerV1Interface = &server.Interface{Name: "xdg_toplevel_icon_manager_v1", Version: 1}
40	ToplevelIconV1Interface = &server.Interface{Name: "xdg_toplevel_icon_v1", Version: 1}
41	ToplevelIconManagerV1Interface.Requests = []server.Message{
42		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
43		{Name: "create_icon", Signature: "n", Types: []*server.Interface{ToplevelIconV1Interface}},
44		{Name: "set_icon", Signature: "o?o", Types: []*server.Interface{xdgshell.ToplevelInterface, ToplevelIconV1Interface}},
45	}
46	ToplevelIconManagerV1Interface.Events = []server.Message{
47		{Name: "icon_size", Signature: "i", Types: []*server.Interface{nil}},
48		{Name: "done", Signature: "", Types: []*server.Interface{}},
49	}
50	ToplevelIconV1Interface.Requests = []server.Message{
51		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
52		{Name: "set_name", Signature: "s", Types: []*server.Interface{nil}},
53		{Name: "add_buffer", Signature: "oi", Types: []*server.Interface{wayland.BufferInterface, nil}},
54	}
55	ToplevelIconV1Interface.Events = []server.Message{}
56	if err := server.NewInterfaces(ToplevelIconManagerV1Interface, ToplevelIconV1Interface); err != nil {
57		panic(err)
58	}
59}
60
61// ToplevelIconManagerV1 interface to manage toplevel icons.
62type ToplevelIconManagerV1 struct{ *server.Resource }
63
64func WrapToplevelIconManagerV1(r *server.Resource) *ToplevelIconManagerV1 {
65	if r == nil {
66		return nil
67	}
68	return &ToplevelIconManagerV1{r}
69}
70
71const ToplevelIconManagerV1RequestDestroy uint32 = 0
72const ToplevelIconManagerV1RequestCreateIcon uint32 = 1
73const ToplevelIconManagerV1RequestSetIcon uint32 = 2
74const ToplevelIconManagerV1EventIconSize uint32 = 0
75const ToplevelIconManagerV1EventDone uint32 = 1
76
77// ToplevelIconManagerV1Handler handles xdg_toplevel_icon_manager_v1 requests.
78type ToplevelIconManagerV1Handler interface {
79	Destroy(self *ToplevelIconManagerV1)
80	CreateIcon(self *ToplevelIconManagerV1, id uint32)
81	SetIcon(self *ToplevelIconManagerV1, toplevel *xdgshell.Toplevel, icon *ToplevelIconV1)
82}
83
84func NewToplevelIconManagerV1(c server.Client, version int32, id uint32, h ToplevelIconManagerV1Handler) (*ToplevelIconManagerV1, error) {
85	if h == nil {
86		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_icon_manager_v1")
87	}
88	var self *ToplevelIconManagerV1
89	r, err := c.CreateResource(ToplevelIconManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
90		switch opcode {
91		case 0:
92			h.Destroy(self)
93			self.Destroy()
94		case 1:
95			h.CreateIcon(self, args[0].NewID())
96		case 2:
97			h.SetIcon(self, xdgshell.WrapToplevel(args[0].Resource()), WrapToplevelIconV1(args[1].Resource()))
98		}
99	})
100	if err != nil {
101		return nil, err
102	}
103	self = WrapToplevelIconManagerV1(r)
104	r.Data = self
105	return self, nil
106}
107
108// SendIconSize describes a supported & preferred icon size.
109func (self *ToplevelIconManagerV1) SendIconSize(size int32) {
110	self.PostEvent(ToplevelIconManagerV1EventIconSize, server.Int(size))
111}
112
113// SendDone all information has been sent.
114func (self *ToplevelIconManagerV1) SendDone() {
115	self.PostEvent(ToplevelIconManagerV1EventDone)
116}
117func NewToplevelIconManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error {
118	return d.CreateGlobal(ToplevelIconManagerV1Interface, version, bind)
119}
120
121// ToplevelIconV1 a toplevel window icon.
122type ToplevelIconV1 struct{ *server.Resource }
123
124func WrapToplevelIconV1(r *server.Resource) *ToplevelIconV1 {
125	if r == nil {
126		return nil
127	}
128	return &ToplevelIconV1{r}
129}
130
131const ToplevelIconV1RequestDestroy uint32 = 0
132const ToplevelIconV1RequestSetName uint32 = 1
133const ToplevelIconV1RequestAddBuffer uint32 = 2
134
135// ToplevelIconV1Error .
136type ToplevelIconV1Error uint32
137
138const (
139	ToplevelIconV1ErrorInvalidBuffer ToplevelIconV1Error = 1
140	ToplevelIconV1ErrorImmutable     ToplevelIconV1Error = 2
141	ToplevelIconV1ErrorNoBuffer      ToplevelIconV1Error = 3
142)
143
144// ToplevelIconV1Handler handles xdg_toplevel_icon_v1 requests.
145type ToplevelIconV1Handler interface {
146	Destroy(self *ToplevelIconV1)
147	SetName(self *ToplevelIconV1, iconName string)
148	AddBuffer(self *ToplevelIconV1, buffer *wayland.Buffer, scale int32)
149}
150
151func NewToplevelIconV1(c server.Client, version int32, id uint32, h ToplevelIconV1Handler) (*ToplevelIconV1, error) {
152	if h == nil {
153		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_toplevel_icon_v1")
154	}
155	var self *ToplevelIconV1
156	r, err := c.CreateResource(ToplevelIconV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
157		switch opcode {
158		case 0:
159			h.Destroy(self)
160			self.Destroy()
161		case 1:
162			h.SetName(self, args[0].String())
163		case 2:
164			h.AddBuffer(self, wayland.WrapBuffer(args[0].Resource()), args[1].Int())
165		}
166	})
167	if err != nil {
168		return nil, err
169	}
170	self = WrapToplevelIconV1(r)
171	r.Data = self
172	return self, nil
173}
174func NewToplevelIconV1Global(d *server.Display, version int32, bind server.BindFunc) error {
175	return d.CreateGlobal(ToplevelIconV1Interface, version, bind)
176}
177func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
178	if v == nil {
179		return nil
180	}
181	return v.GetResource()
182}
183func (self *ToplevelIconManagerV1) GetResource() *server.Resource {
184	if self == nil {
185		return nil
186	}
187	return self.Resource
188}
189func (self *ToplevelIconV1) GetResource() *server.Resource {
190	if self == nil {
191		return nil
192	}
193	return self.Resource
194}

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