extimagecapturesource_generated.go RawHistoryFolder
1// Code generated by wlbgen. DO NOT EDIT.
2// Protocol: ext_image_capture_source_v1
3// Source: ext-image-capture-source-v1.xml
4
5// Upstream protocol copyright and license:
6// Copyright © 2022 Andri Yngvason
7// Copyright © 2024 Simon Ser
8//
9// Permission is hereby granted, free of charge, to any person obtaining a
10// copy of this software and associated documentation files (the "Software"),
11// to deal in the Software without restriction, including without limitation
12// the rights to use, copy, modify, merge, publish, distribute, sublicense,
13// and/or sell copies of the Software, and to permit persons to whom the
14// Software is furnished to do so, subject to the following conditions:
15//
16// The above copyright notice and this permission notice (including the next
17// paragraph) shall be included in all copies or substantial portions of the
18// Software.
19//
20// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26// DEALINGS IN THE SOFTWARE.
27
28package extimagecapturesource
29
30import (
31 cross_ext_foreign_toplevel_handle_v1 "github.com/bnema/go-wayland-bindings/client/extforeigntoplevellist"
32 cross_wl_output "github.com/bnema/go-wayland-bindings/client/wayland"
33 "github.com/bnema/wlturbo/wl"
34)
35
36// ExtImageCaptureSourceInterface is the protocol interface name.
37const ExtImageCaptureSourceInterface = "ext_image_capture_source_v1"
38
39// ExtImageCaptureSource is the generated binding for ext_image_capture_source_v1 version 1.
40type ExtImageCaptureSource struct {
41 wl.BaseProxy
42}
43
44// NewExtImageCaptureSource returns an unbound ExtImageCaptureSource.
45func NewExtImageCaptureSource(ctx *wl.Context) *ExtImageCaptureSource {
46 obj := &ExtImageCaptureSource{}
47 obj.SetContext(ctx)
48 ctx.Register(obj)
49 return obj
50}
51
52// Destroys the image capture source. This request may be sent at any time by the client.
53func (o *ExtImageCaptureSource) Destroy() error {
54 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "ext_image_capture_source_v1.destroy", Destructor: true}); err != nil {
55 return err
56 }
57 return nil
58}
59
60// EventSignature returns the declared event argument types in wire order.
61func (o *ExtImageCaptureSource) EventSignature(opcode uint16) (string, bool) {
62 switch opcode {
63 default:
64 return "", false
65 }
66}
67
68// Dispatch decodes one event on ext_image_capture_source_v1 and calls the registered handlers.
69func (o *ExtImageCaptureSource) Dispatch(event *wl.Event) {
70 switch event.Opcode {
71 default:
72 }
73}
74
75// ExtOutputImageCaptureSourceManagerInterface is the protocol interface name.
76const ExtOutputImageCaptureSourceManagerInterface = "ext_output_image_capture_source_manager_v1"
77
78// ExtOutputImageCaptureSourceManager is the generated binding for ext_output_image_capture_source_manager_v1 version 1.
79type ExtOutputImageCaptureSourceManager struct {
80 wl.BaseProxy
81}
82
83// NewExtOutputImageCaptureSourceManager returns an unbound ExtOutputImageCaptureSourceManager.
84func NewExtOutputImageCaptureSourceManager(ctx *wl.Context) *ExtOutputImageCaptureSourceManager {
85 obj := &ExtOutputImageCaptureSourceManager{}
86 obj.SetContext(ctx)
87 ctx.Register(obj)
88 return obj
89}
90
91// Creates a source object for an output. Images captured from this source will show the same content as the output. Some elements may be omitted, such as cursors and overlays that have been marked as transparent to capturing.
92func (o *ExtOutputImageCaptureSourceManager) CreateSource(output *cross_wl_output.Output) (*ExtImageCaptureSource, error) {
93 var arg1 wl.Object
94 if output != nil {
95 arg1 = output
96 }
97 child := &ExtImageCaptureSource{}
98 child.SetContext(o.Context())
99 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "ext_output_image_capture_source_manager_v1.create_source", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil {
100 return nil, err
101 }
102 return child, nil
103}
104
105// Destroys the manager. This request may be sent at any time by the client and objects created by the manager will remain valid after its destruction.
106func (o *ExtOutputImageCaptureSourceManager) Destroy() error {
107 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "ext_output_image_capture_source_manager_v1.destroy", Destructor: true}); err != nil {
108 return err
109 }
110 return nil
111}
112
113// EventSignature returns the declared event argument types in wire order.
114func (o *ExtOutputImageCaptureSourceManager) EventSignature(opcode uint16) (string, bool) {
115 switch opcode {
116 default:
117 return "", false
118 }
119}
120
121// Dispatch decodes one event on ext_output_image_capture_source_manager_v1 and calls the registered handlers.
122func (o *ExtOutputImageCaptureSourceManager) Dispatch(event *wl.Event) {
123 switch event.Opcode {
124 default:
125 }
126}
127
128// ExtForeignToplevelImageCaptureSourceManagerInterface is the protocol interface name.
129const ExtForeignToplevelImageCaptureSourceManagerInterface = "ext_foreign_toplevel_image_capture_source_manager_v1"
130
131// ExtForeignToplevelImageCaptureSourceManager is the generated binding for ext_foreign_toplevel_image_capture_source_manager_v1 version 1.
132type ExtForeignToplevelImageCaptureSourceManager struct {
133 wl.BaseProxy
134}
135
136// NewExtForeignToplevelImageCaptureSourceManager returns an unbound ExtForeignToplevelImageCaptureSourceManager.
137func NewExtForeignToplevelImageCaptureSourceManager(ctx *wl.Context) *ExtForeignToplevelImageCaptureSourceManager {
138 obj := &ExtForeignToplevelImageCaptureSourceManager{}
139 obj.SetContext(ctx)
140 ctx.Register(obj)
141 return obj
142}
143
144// Creates a source object for a foreign toplevel handle. Images captured from this source will show the same content as the toplevel.
145func (o *ExtForeignToplevelImageCaptureSourceManager) CreateSource(toplevelHandle *cross_ext_foreign_toplevel_handle_v1.ExtForeignToplevelHandle) (*ExtImageCaptureSource, error) {
146 var arg1 wl.Object
147 if toplevelHandle != nil {
148 arg1 = toplevelHandle
149 }
150 child := &ExtImageCaptureSource{}
151 child.SetContext(o.Context())
152 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "ext_foreign_toplevel_image_capture_source_manager_v1.create_source", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil {
153 return nil, err
154 }
155 return child, nil
156}
157
158// Destroys the manager. This request may be sent at any time by the client and objects created by the manager will remain valid after its destruction.
159func (o *ExtForeignToplevelImageCaptureSourceManager) Destroy() error {
160 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "ext_foreign_toplevel_image_capture_source_manager_v1.destroy", Destructor: true}); err != nil {
161 return err
162 }
163 return nil
164}
165
166// EventSignature returns the declared event argument types in wire order.
167func (o *ExtForeignToplevelImageCaptureSourceManager) EventSignature(opcode uint16) (string, bool) {
168 switch opcode {
169 default:
170 return "", false
171 }
172}
173
174// Dispatch decodes one event on ext_foreign_toplevel_image_capture_source_manager_v1 and calls the registered handlers.
175func (o *ExtForeignToplevelImageCaptureSourceManager) Dispatch(event *wl.Event) {
176 switch event.Opcode {
177 default:
178 }
179}