v0.2.0 107c393

viewporter.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package viewporter
3
4import (
5	"fmt"
6	wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7	"github.com/bnema/purego-libwayland/server"
8)
9
10var WpViewporterInterface *server.Interface
11var WpViewportInterface *server.Interface
12
13func init() {
14	WpViewporterInterface = &server.Interface{Name: "wp_viewporter", Version: 1}
15	WpViewportInterface = &server.Interface{Name: "wp_viewport", Version: 1}
16	WpViewporterInterface.Requests = []server.Message{
17		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
18		{Name: "get_viewport", Signature: "no", Types: []*server.Interface{WpViewportInterface, wayland.SurfaceInterface}},
19	}
20	WpViewporterInterface.Events = []server.Message{}
21	WpViewportInterface.Requests = []server.Message{
22		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
23		{Name: "set_source", Signature: "ffff", Types: []*server.Interface{nil, nil, nil, nil}},
24		{Name: "set_destination", Signature: "ii", Types: []*server.Interface{nil, nil}},
25	}
26	WpViewportInterface.Events = []server.Message{}
27	if err := server.NewInterfaces(WpViewporterInterface, WpViewportInterface); err != nil {
28		panic(err)
29	}
30}
31
32// WpViewporter surface cropping and scaling.
33type WpViewporter struct{ *server.Resource }
34
35func WrapWpViewporter(r *server.Resource) *WpViewporter {
36	if r == nil {
37		return nil
38	}
39	return &WpViewporter{r}
40}
41
42const WpViewporterRequestDestroy uint32 = 0
43const WpViewporterRequestGetViewport uint32 = 1
44
45// WpViewporterError .
46type WpViewporterError uint32
47
48const (
49	WpViewporterErrorViewportExists WpViewporterError = 0
50)
51
52// WpViewporterHandler handles wp_viewporter requests.
53type WpViewporterHandler interface {
54	Destroy(self *WpViewporter)
55	GetViewport(self *WpViewporter, id uint32, surface *wayland.Surface)
56}
57
58func NewWpViewporter(c server.Client, version int32, id uint32, h WpViewporterHandler) (*WpViewporter, error) {
59	if h == nil {
60		return nil, fmt.Errorf("purego-libwayland: nil handler for wp_viewporter")
61	}
62	var self *WpViewporter
63	r, err := c.CreateResource(WpViewporterInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
64		switch opcode {
65		case 0:
66			h.Destroy(self)
67			self.Destroy()
68		case 1:
69			h.GetViewport(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
70		}
71	})
72	if err != nil {
73		return nil, err
74	}
75	self = WrapWpViewporter(r)
76	r.Data = self
77	return self, nil
78}
79func NewWpViewporterGlobal(d *server.Display, version int32, bind server.BindFunc) error {
80	return d.CreateGlobal(WpViewporterInterface, version, bind)
81}
82
83// WpViewport crop and scale interface to a wl_surface.
84type WpViewport struct{ *server.Resource }
85
86func WrapWpViewport(r *server.Resource) *WpViewport {
87	if r == nil {
88		return nil
89	}
90	return &WpViewport{r}
91}
92
93const WpViewportRequestDestroy uint32 = 0
94const WpViewportRequestSetSource uint32 = 1
95const WpViewportRequestSetDestination uint32 = 2
96
97// WpViewportError .
98type WpViewportError uint32
99
100const (
101	WpViewportErrorBadValue    WpViewportError = 0
102	WpViewportErrorBadSize     WpViewportError = 1
103	WpViewportErrorOutOfBuffer WpViewportError = 2
104	WpViewportErrorNoSurface   WpViewportError = 3
105)
106
107// WpViewportHandler handles wp_viewport requests.
108type WpViewportHandler interface {
109	Destroy(self *WpViewport)
110	SetSource(self *WpViewport, x server.Fixed, y server.Fixed, width server.Fixed, height server.Fixed)
111	SetDestination(self *WpViewport, width int32, height int32)
112}
113
114func NewWpViewport(c server.Client, version int32, id uint32, h WpViewportHandler) (*WpViewport, error) {
115	if h == nil {
116		return nil, fmt.Errorf("purego-libwayland: nil handler for wp_viewport")
117	}
118	var self *WpViewport
119	r, err := c.CreateResource(WpViewportInterface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
120		switch opcode {
121		case 0:
122			h.Destroy(self)
123			self.Destroy()
124		case 1:
125			h.SetSource(self, args[0].Fixed(), args[1].Fixed(), args[2].Fixed(), args[3].Fixed())
126		case 2:
127			h.SetDestination(self, args[0].Int(), args[1].Int())
128		}
129	})
130	if err != nil {
131		return nil, err
132	}
133	self = WrapWpViewport(r)
134	r.Data = self
135	return self, nil
136}
137func NewWpViewportGlobal(d *server.Display, version int32, bind server.BindFunc) error {
138	return d.CreateGlobal(WpViewportInterface, version, bind)
139}
140func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
141	if v == nil {
142		return nil
143	}
144	return v.GetResource()
145}
146func (self *WpViewporter) GetResource() *server.Resource {
147	if self == nil {
148		return nil
149	}
150	return self.Resource
151}
152func (self *WpViewport) GetResource() *server.Resource {
153	if self == nil {
154		return nil
155	}
156	return self.Resource
157}

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