detached 1a6c6c9

extbackgroundeffect_generated.go RawHistoryFolder

1// Code generated by wlbgen. DO NOT EDIT.
2// Protocol: ext_background_effect_v1
3// Source: ext-background-effect-v1.xml
4
5// Upstream protocol copyright and license:
6// Copyright (C) 2015 Martin Gräßlin
7// Copyright (C) 2015 Marco Martin
8// Copyright (C) 2020 Vlad Zahorodnii
9// Copyright (C) 2024 Xaver Hugl
10//
11// Permission is hereby granted, free of charge, to any person obtaining a
12// copy of this software and associated documentation files (the "Software"),
13// to deal in the Software without restriction, including without limitation
14// the rights to use, copy, modify, merge, publish, distribute, sublicense,
15// and/or sell copies of the Software, and to permit persons to whom the
16// Software is furnished to do so, subject to the following conditions:
17//
18// The above copyright notice and this permission notice (including the next
19// paragraph) shall be included in all copies or substantial portions of the
20// Software.
21//
22// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
25// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28// DEALINGS IN THE SOFTWARE.
29
30package extbackgroundeffect
31
32import (
33	"sync"
34
35	cross_wl_region "github.com/bnema/go-wayland-bindings/client/wayland"
36	cross_wl_surface "github.com/bnema/go-wayland-bindings/client/wayland"
37	"github.com/bnema/wlturbo/wl"
38)
39
40// ERROR_BACKGROUND_EFFECT_EXISTS is the error background_effect_exists value.
41const ERROR_BACKGROUND_EFFECT_EXISTS = 0
42
43// CAPABILITY_BLUR is the capability blur value.
44const CAPABILITY_BLUR = 1
45
46// ERROR_SURFACE_DESTROYED is the error surface_destroyed value.
47const ERROR_SURFACE_DESTROYED = 0
48
49// ExtBackgroundEffectManagerInterface is the protocol interface name.
50const ExtBackgroundEffectManagerInterface = "ext_background_effect_manager_v1"
51
52// ExtBackgroundEffectManager is the generated binding for ext_background_effect_manager_v1 version 1.
53type ExtBackgroundEffectManager struct {
54	wl.BaseProxy
55	// handlersMu guards the handler slices: a client may register or replace
56	// handlers while another goroutine dispatches events.
57	handlersMu     sync.Mutex
58	onCapabilities []func(flags uint32)
59}
60
61// NewExtBackgroundEffectManager returns an unbound ExtBackgroundEffectManager.
62func NewExtBackgroundEffectManager(ctx *wl.Context) *ExtBackgroundEffectManager {
63	obj := &ExtBackgroundEffectManager{}
64	obj.SetContext(ctx)
65	ctx.Register(obj)
66	return obj
67}
68
69// Informs the server that the client will no longer be using this protocol object. Existing objects created by this object are not affected.
70func (o *ExtBackgroundEffectManager) Destroy() error {
71	if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "ext_background_effect_manager_v1.destroy", Destructor: true}); err != nil {
72		return err
73	}
74	return nil
75}
76
77// Instantiate an interface extension for the given wl_surface to add effects like blur for the background behind it. If the given wl_surface already has a ext_background_effect_surface_v1 object associated, the background_effect_exists protocol error will be raised.
78func (o *ExtBackgroundEffectManager) GetBackgroundEffect(surface *cross_wl_surface.Surface) (*ExtBackgroundEffectSurface, error) {
79	var arg1 wl.Object
80	if surface != nil {
81		arg1 = surface
82	}
83	child := &ExtBackgroundEffectSurface{}
84	child.SetContext(o.Context())
85	if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "ext_background_effect_manager_v1.get_background_effect", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil {
86		return nil, err
87	}
88	return child, nil
89}
90
91// OnCapabilities registers a handler for the capabilities event.
92//
93// Handlers are appended, so a second call adds another handler rather than
94// replacing the first. Registration is safe while another goroutine dispatches.
95func (o *ExtBackgroundEffectManager) OnCapabilities(handler func(flags uint32)) {
96	if handler == nil {
97		return
98	}
99	o.handlersMu.Lock()
100	defer o.handlersMu.Unlock()
101	o.onCapabilities = append(o.onCapabilities, handler)
102}
103
104// handlersForCapabilities returns the handlers registered for capabilities, taken
105// under the lock so a handler may register another handler while events are
106// being dispatched.
107func (o *ExtBackgroundEffectManager) handlersForCapabilities() []func(flags uint32) {
108	o.handlersMu.Lock()
109	defer o.handlersMu.Unlock()
110	return o.onCapabilities
111}
112
113// EventSignature returns the declared event argument types in wire order.
114func (o *ExtBackgroundEffectManager) EventSignature(opcode uint16) (string, bool) {
115	switch opcode {
116	case 0:
117		return "uint,", true
118	default:
119		return "", false
120	}
121}
122
123// Dispatch decodes one event on ext_background_effect_manager_v1 and calls the registered handlers.
124func (o *ExtBackgroundEffectManager) Dispatch(event *wl.Event) {
125	switch event.Opcode {
126	case 0: // capabilities
127		flags := event.Uint32()
128
129		for i, handler := range o.handlersForCapabilities() {
130			_ = i
131			handler(flags)
132		}
133	default:
134	}
135}
136
137// ExtBackgroundEffectSurfaceInterface is the protocol interface name.
138const ExtBackgroundEffectSurfaceInterface = "ext_background_effect_surface_v1"
139
140// ExtBackgroundEffectSurface is the generated binding for ext_background_effect_surface_v1 version 1.
141type ExtBackgroundEffectSurface struct {
142	wl.BaseProxy
143}
144
145// NewExtBackgroundEffectSurface returns an unbound ExtBackgroundEffectSurface.
146func NewExtBackgroundEffectSurface(ctx *wl.Context) *ExtBackgroundEffectSurface {
147	obj := &ExtBackgroundEffectSurface{}
148	obj.SetContext(ctx)
149	ctx.Register(obj)
150	return obj
151}
152
153// Informs the server that the client will no longer be using this protocol object. The effect regions will be removed on the next commit.
154func (o *ExtBackgroundEffectSurface) Destroy() error {
155	if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "ext_background_effect_surface_v1.destroy", Destructor: true}); err != nil {
156		return err
157	}
158	return nil
159}
160
161// This request sets the region of the surface that will have its background blurred. The blur region is specified in the surface-local coordinates, and clipped by the compositor to the surface size. The initial value for the blur region is empty. Setting the pending blur region has copy semantics, and the wl_region object can be destroyed immediately. A NULL wl_region removes the effect. The blur region is double-buffered state, and will be applied on the next wl_surface.commit. The blur algorithm is subject to compositor policies. If the associated surface has been destroyed, the surface_destroyed error will be raised.
162func (o *ExtBackgroundEffectSurface) SetBlurRegion(region *cross_wl_region.Region) error {
163	var arg0 wl.Object
164	if region != nil {
165		arg0 = region
166	}
167	if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "ext_background_effect_surface_v1.set_blur_region"}, wl.ArgObject(arg0)); err != nil {
168		return err
169	}
170	return nil
171}
172
173// EventSignature returns the declared event argument types in wire order.
174func (o *ExtBackgroundEffectSurface) EventSignature(opcode uint16) (string, bool) {
175	switch opcode {
176	default:
177		return "", false
178	}
179}
180
181// Dispatch decodes one event on ext_background_effect_surface_v1 and calls the registered handlers.
182func (o *ExtBackgroundEffectSurface) Dispatch(event *wl.Event) {
183	switch event.Opcode {
184	default:
185	}
186}

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