v0.6.0 d4696de

alphamodifier.go RawHistoryFolder

1// Code generated by wlgen; DO NOT EDIT.
2package alphamodifier
3
4import (
5	"fmt"
6	wayland "github.com/bnema/purego-libwayland/protocol/wayland"
7	"github.com/bnema/purego-libwayland/server"
8)
9
10var WpAlphaModifierV1Interface *server.Interface
11var WpAlphaModifierSurfaceV1Interface *server.Interface
12
13func init() {
14	WpAlphaModifierV1Interface = &server.Interface{Name: "wp_alpha_modifier_v1", Version: 1}
15	WpAlphaModifierSurfaceV1Interface = &server.Interface{Name: "wp_alpha_modifier_surface_v1", Version: 1}
16	WpAlphaModifierV1Interface.Requests = []server.Message{
17		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
18		{Name: "get_surface", Signature: "no", Types: []*server.Interface{WpAlphaModifierSurfaceV1Interface, wayland.SurfaceInterface}},
19	}
20	WpAlphaModifierV1Interface.Events = []server.Message{}
21	WpAlphaModifierSurfaceV1Interface.Requests = []server.Message{
22		{Name: "destroy", Signature: "", Types: []*server.Interface{}},
23		{Name: "set_multiplier", Signature: "u", Types: []*server.Interface{nil}},
24	}
25	WpAlphaModifierSurfaceV1Interface.Events = []server.Message{}
26	if err := server.NewInterfaces(WpAlphaModifierV1Interface, WpAlphaModifierSurfaceV1Interface); err != nil {
27		panic(err)
28	}
29}
30
31// WpAlphaModifierV1 surface alpha modifier manager.
32type WpAlphaModifierV1 struct{ *server.Resource }
33
34func WrapWpAlphaModifierV1(r *server.Resource) *WpAlphaModifierV1 {
35	if r == nil {
36		return nil
37	}
38	return &WpAlphaModifierV1{r}
39}
40
41const WpAlphaModifierV1RequestDestroy uint32 = 0
42const WpAlphaModifierV1RequestGetSurface uint32 = 1
43
44// WpAlphaModifierV1Error .
45type WpAlphaModifierV1Error uint32
46
47const (
48	WpAlphaModifierV1ErrorAlreadyConstructed WpAlphaModifierV1Error = 0
49)
50
51// WpAlphaModifierV1Handler handles wp_alpha_modifier_v1 requests.
52type WpAlphaModifierV1Handler interface {
53	Destroy(self *WpAlphaModifierV1)
54	GetSurface(self *WpAlphaModifierV1, id uint32, surface *wayland.Surface)
55}
56
57func NewWpAlphaModifierV1(c server.Client, version int32, id uint32, h WpAlphaModifierV1Handler) (*WpAlphaModifierV1, error) {
58	if h == nil {
59		return nil, fmt.Errorf("purego-libwayland: nil handler for wp_alpha_modifier_v1")
60	}
61	var self *WpAlphaModifierV1
62	r, err := c.CreateResource(WpAlphaModifierV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
63		switch opcode {
64		case 0:
65			h.Destroy(self)
66			self.Destroy()
67		case 1:
68			h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()))
69		}
70	})
71	if err != nil {
72		return nil, err
73	}
74	self = WrapWpAlphaModifierV1(r)
75	r.Data = self
76	return self, nil
77}
78func NewWpAlphaModifierV1Global(d *server.Display, version int32, bind server.BindFunc) error {
79	return d.CreateGlobal(WpAlphaModifierV1Interface, version, bind)
80}
81
82// WpAlphaModifierSurfaceV1 alpha modifier object for a surface.
83type WpAlphaModifierSurfaceV1 struct{ *server.Resource }
84
85func WrapWpAlphaModifierSurfaceV1(r *server.Resource) *WpAlphaModifierSurfaceV1 {
86	if r == nil {
87		return nil
88	}
89	return &WpAlphaModifierSurfaceV1{r}
90}
91
92const WpAlphaModifierSurfaceV1RequestDestroy uint32 = 0
93const WpAlphaModifierSurfaceV1RequestSetMultiplier uint32 = 1
94
95// WpAlphaModifierSurfaceV1Error .
96type WpAlphaModifierSurfaceV1Error uint32
97
98const (
99	WpAlphaModifierSurfaceV1ErrorNoSurface WpAlphaModifierSurfaceV1Error = 0
100)
101
102// WpAlphaModifierSurfaceV1Handler handles wp_alpha_modifier_surface_v1 requests.
103type WpAlphaModifierSurfaceV1Handler interface {
104	Destroy(self *WpAlphaModifierSurfaceV1)
105	SetMultiplier(self *WpAlphaModifierSurfaceV1, factor uint32)
106}
107
108func NewWpAlphaModifierSurfaceV1(c server.Client, version int32, id uint32, h WpAlphaModifierSurfaceV1Handler) (*WpAlphaModifierSurfaceV1, error) {
109	if h == nil {
110		return nil, fmt.Errorf("purego-libwayland: nil handler for wp_alpha_modifier_surface_v1")
111	}
112	var self *WpAlphaModifierSurfaceV1
113	r, err := c.CreateResource(WpAlphaModifierSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) {
114		switch opcode {
115		case 0:
116			h.Destroy(self)
117			self.Destroy()
118		case 1:
119			h.SetMultiplier(self, args[0].Uint())
120		}
121	})
122	if err != nil {
123		return nil, err
124	}
125	self = WrapWpAlphaModifierSurfaceV1(r)
126	r.Data = self
127	return self, nil
128}
129func NewWpAlphaModifierSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error {
130	return d.CreateGlobal(WpAlphaModifierSurfaceV1Interface, version, bind)
131}
132func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource {
133	if v == nil {
134		return nil
135	}
136	return v.GetResource()
137}
138func (self *WpAlphaModifierV1) GetResource() *server.Resource {
139	if self == nil {
140		return nil
141	}
142	return self.Resource
143}
144func (self *WpAlphaModifierSurfaceV1) GetResource() *server.Resource {
145	if self == nil {
146		return nil
147	}
148	return self.Resource
149}

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