main 5004296

xdgdialog_generated.go RawHistoryFolder

1// Code generated by wlbgen; DO NOT EDIT.
2
3// Upstream protocol copyright and license:
4// Copyright © 2023 Carlos Garnacho
5//
6// Permission is hereby granted, free of charge, to any person obtaining a
7// copy of this software and associated documentation files (the "Software"),
8// to deal in the Software without restriction, including without limitation
9// the rights to use, copy, modify, merge, publish, distribute, sublicense,
10// and/or sell copies of the Software, and to permit persons to whom the
11// Software is furnished to do so, subject to the following conditions:
12//
13// The above copyright notice and this permission notice (including the next
14// paragraph) shall be included in all copies or substantial portions of the
15// Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE.
24
25package xdgdialog
26
27import (
28	"fmt"
29	xdgshell "github.com/bnema/go-wayland-bindings/server/xdgshell"
30	"github.com/bnema/purego-libwayland/server"
31)
32
33var WmDialogV1Interface *server.Interface
34var DialogV1Interface *server.Interface
35
36func init() {
37	WmDialogV1Interface = &server.Interface{Name: "xdg_wm_dialog_v1", Version: 1}
38	DialogV1Interface = &server.Interface{Name: "xdg_dialog_v1", Version: 1}
39	WmDialogV1Interface.Requests = []server.Message{
40		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
41		{Name: "get_xdg_dialog", Signature: "no", Types: []*server.Interface{DialogV1Interface, xdgshell.ToplevelInterface}},
42	}
43	WmDialogV1Interface.Events = []server.Message{}
44	DialogV1Interface.Requests = []server.Message{
45		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
46		{Name: "set_modal", Signature: "", Types: []*server.Interface{}},
47		{Name: "unset_modal", Signature: "", Types: []*server.Interface{}},
48	}
49	DialogV1Interface.Events = []server.Message{}
50	if err := server.NewInterfaces(WmDialogV1Interface, DialogV1Interface); err != nil {
51		panic(err)
52	}
53}
54
55// WmDialogV1 create dialogs related to other toplevels.
56type WmDialogV1 struct{ *server.Resource }
57
58func WrapWmDialogV1(r *server.Resource) *WmDialogV1 {
59	if r == nil {
60		return nil
61	}
62	return &WmDialogV1{r}
63}
64
65const WmDialogV1RequestDestroy uint32 = 0
66const WmDialogV1RequestGetXdgDialog uint32 = 1
67
68// WmDialogV1Error .
69type WmDialogV1Error uint32
70
71const (
72	WmDialogV1ErrorAlreadyUsed WmDialogV1Error = 0
73)
74
75// WmDialogV1Handler handles xdg_wm_dialog_v1 requests.
76type WmDialogV1Handler interface {
77	Destroy(self *WmDialogV1)
78	GetXdgDialog(self *WmDialogV1, id uint32, toplevel *xdgshell.Toplevel)
79}
80
81func NewWmDialogV1(c server.Client, version int32, id uint32, h WmDialogV1Handler) (*WmDialogV1, error) {
82	if h == nil {
83		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_wm_dialog_v1")
84	}
85	var self *WmDialogV1
86	r, err := c.CreateResource(WmDialogV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
87		switch opcode {
88		case 0:
89			h.Destroy(self)
90			self.Destroy()
91		case 1:
92			h.GetXdgDialog(self, args[0].NewID(), xdgshell.WrapToplevel(args[1].Resource()))
93		}
94	})
95	if err != nil {
96		return nil, err
97	}
98	self = WrapWmDialogV1(r)
99	r.Data = self
100	return self, nil
101}
102func NewWmDialogV1Global(d *server.Display, version int32, bind server.BindFunc) error {
103	return d.CreateGlobal(WmDialogV1Interface, version, bind)
104}
105
106// DialogV1 dialog object.
107type DialogV1 struct{ *server.Resource }
108
109func WrapDialogV1(r *server.Resource) *DialogV1 {
110	if r == nil {
111		return nil
112	}
113	return &DialogV1{r}
114}
115
116const DialogV1RequestDestroy uint32 = 0
117const DialogV1RequestSetModal uint32 = 1
118const DialogV1RequestUnsetModal uint32 = 2
119
120// DialogV1Handler handles xdg_dialog_v1 requests.
121type DialogV1Handler interface {
122	Destroy(self *DialogV1)
123	SetModal(self *DialogV1)
124	UnsetModal(self *DialogV1)
125}
126
127func NewDialogV1(c server.Client, version int32, id uint32, h DialogV1Handler) (*DialogV1, error) {
128	if h == nil {
129		return nil, fmt.Errorf("purego-libwayland: nil handler for xdg_dialog_v1")
130	}
131	var self *DialogV1
132	r, err := c.CreateResource(DialogV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
133		switch opcode {
134		case 0:
135			h.Destroy(self)
136			self.Destroy()
137		case 1:
138			h.SetModal(self)
139		case 2:
140			h.UnsetModal(self)
141		}
142	})
143	if err != nil {
144		return nil, err
145	}
146	self = WrapDialogV1(r)
147	r.Data = self
148	return self, nil
149}
150func NewDialogV1Global(d *server.Display, version int32, bind server.BindFunc) error {
151	return d.CreateGlobal(DialogV1Interface, version, bind)
152}
153func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
154	if v == nil {
155		return nil
156	}
157	return v.GetResource()
158}
159func (self *WmDialogV1) GetResource() *server.Resource {
160	if self == nil {
161		return nil
162	}
163	return self.Resource
164}
165func (self *DialogV1) GetResource() *server.Resource {
166	if self == nil {
167		return nil
168	}
169	return self.Resource
170}

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