Dotfiles_ArchAP/tools/wlthumbs/proto/ext_image_capture_source.go

195 lines
7.2 KiB
Go

// Generated by go-wayland-scanner
// https://github.com/rajveermalviya/go-wayland/cmd/go-wayland-scanner
// XML file : protocol/ext-image-capture-source-v1.xml
//
// ext_image_capture_source_v1 Protocol Copyright:
//
// Copyright © 2022 Andri Yngvason
// Copyright © 2024 Simon Ser
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice (including the next
// paragraph) shall be included in all copies or substantial portions of the
// Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
package proto
import "github.com/rajveermalviya/go-wayland/wayland/client"
// ExtImageCaptureSource : opaque image capture source object
//
// The image capture source object is an opaque descriptor for a capturable
// resource. This resource may be any sort of entity from which an image
// may be derived.
//
// Note, because ext_image_capture_source_v1 objects are created from multiple
// independent factory interfaces, the ext_image_capture_source_v1 interface is
// frozen at version 1.
type ExtImageCaptureSource struct {
client.BaseProxy
}
// NewExtImageCaptureSource : opaque image capture source object
//
// The image capture source object is an opaque descriptor for a capturable
// resource. This resource may be any sort of entity from which an image
// may be derived.
//
// Note, because ext_image_capture_source_v1 objects are created from multiple
// independent factory interfaces, the ext_image_capture_source_v1 interface is
// frozen at version 1.
func NewExtImageCaptureSource(ctx *client.Context) *ExtImageCaptureSource {
extImageCaptureSourceV1 := &ExtImageCaptureSource{}
ctx.Register(extImageCaptureSourceV1)
return extImageCaptureSourceV1
}
// Destroy : delete this object
//
// Destroys the image capture source. This request may be sent at any time
// by the client.
func (i *ExtImageCaptureSource) Destroy() error {
defer i.Context().Unregister(i)
const opcode = 0
const _reqBufLen = 8
var _reqBuf [_reqBufLen]byte
l := 0
client.PutUint32(_reqBuf[l:4], i.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], uint32(_reqBufLen<<16|opcode&0x0000ffff))
l += 4
err := i.Context().WriteMsg(_reqBuf[:], nil)
return err
}
// ExtOutputImageCaptureSourceManager : image capture source manager for outputs
//
// A manager for creating image capture source objects for wl_output objects.
type ExtOutputImageCaptureSourceManager struct {
client.BaseProxy
}
// NewExtOutputImageCaptureSourceManager : image capture source manager for outputs
//
// A manager for creating image capture source objects for wl_output objects.
func NewExtOutputImageCaptureSourceManager(ctx *client.Context) *ExtOutputImageCaptureSourceManager {
extOutputImageCaptureSourceManagerV1 := &ExtOutputImageCaptureSourceManager{}
ctx.Register(extOutputImageCaptureSourceManagerV1)
return extOutputImageCaptureSourceManagerV1
}
// CreateSource : create source object for output
//
// 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.
func (i *ExtOutputImageCaptureSourceManager) CreateSource(output *client.Output) (*ExtImageCaptureSource, error) {
source := NewExtImageCaptureSource(i.Context())
const opcode = 0
const _reqBufLen = 8 + 4 + 4
var _reqBuf [_reqBufLen]byte
l := 0
client.PutUint32(_reqBuf[l:4], i.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], uint32(_reqBufLen<<16|opcode&0x0000ffff))
l += 4
client.PutUint32(_reqBuf[l:l+4], source.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], output.ID())
l += 4
err := i.Context().WriteMsg(_reqBuf[:], nil)
return source, err
}
// Destroy : delete this object
//
// 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.
func (i *ExtOutputImageCaptureSourceManager) Destroy() error {
defer i.Context().Unregister(i)
const opcode = 1
const _reqBufLen = 8
var _reqBuf [_reqBufLen]byte
l := 0
client.PutUint32(_reqBuf[l:4], i.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], uint32(_reqBufLen<<16|opcode&0x0000ffff))
l += 4
err := i.Context().WriteMsg(_reqBuf[:], nil)
return err
}
// ExtForeignToplevelImageCaptureSourceManager : image capture source manager for foreign toplevels
//
// A manager for creating image capture source objects for
// ext_foreign_toplevel_handle_v1 objects.
type ExtForeignToplevelImageCaptureSourceManager struct {
client.BaseProxy
}
// NewExtForeignToplevelImageCaptureSourceManager : image capture source manager for foreign toplevels
//
// A manager for creating image capture source objects for
// ext_foreign_toplevel_handle_v1 objects.
func NewExtForeignToplevelImageCaptureSourceManager(ctx *client.Context) *ExtForeignToplevelImageCaptureSourceManager {
extForeignToplevelImageCaptureSourceManagerV1 := &ExtForeignToplevelImageCaptureSourceManager{}
ctx.Register(extForeignToplevelImageCaptureSourceManagerV1)
return extForeignToplevelImageCaptureSourceManagerV1
}
// CreateSource : create source object for foreign toplevel
//
// Creates a source object for a foreign toplevel handle. Images captured
// from this source will show the same content as the toplevel.
func (i *ExtForeignToplevelImageCaptureSourceManager) CreateSource(toplevelHandle *ExtForeignToplevelHandle) (*ExtImageCaptureSource, error) {
source := NewExtImageCaptureSource(i.Context())
const opcode = 0
const _reqBufLen = 8 + 4 + 4
var _reqBuf [_reqBufLen]byte
l := 0
client.PutUint32(_reqBuf[l:4], i.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], uint32(_reqBufLen<<16|opcode&0x0000ffff))
l += 4
client.PutUint32(_reqBuf[l:l+4], source.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], toplevelHandle.ID())
l += 4
err := i.Context().WriteMsg(_reqBuf[:], nil)
return source, err
}
// Destroy : delete this object
//
// 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.
func (i *ExtForeignToplevelImageCaptureSourceManager) Destroy() error {
defer i.Context().Unregister(i)
const opcode = 1
const _reqBufLen = 8
var _reqBuf [_reqBufLen]byte
l := 0
client.PutUint32(_reqBuf[l:4], i.ID())
l += 4
client.PutUint32(_reqBuf[l:l+4], uint32(_reqBufLen<<16|opcode&0x0000ffff))
l += 4
err := i.Context().WriteMsg(_reqBuf[:], nil)
return err
}