// Code generated by wlbgen. DO NOT EDIT. // Protocol: single_pixel_buffer_v1 // Source: single-pixel-buffer-v1.xml // Upstream protocol copyright and license: // Copyright © 2022 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 singlepixelbuffer import ( cross_wl_buffer "github.com/bnema/go-wayland-bindings/client/wayland" "github.com/bnema/wlturbo/wl" ) // WpSinglePixelBufferManagerInterface is the protocol interface name. const WpSinglePixelBufferManagerInterface = "wp_single_pixel_buffer_manager_v1" // WpSinglePixelBufferManager is the generated binding for wp_single_pixel_buffer_manager_v1 version 1. type WpSinglePixelBufferManager struct { wl.BaseProxy } // NewWpSinglePixelBufferManager returns an unbound WpSinglePixelBufferManager. func NewWpSinglePixelBufferManager(ctx *wl.Context) *WpSinglePixelBufferManager { obj := &WpSinglePixelBufferManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the wp_single_pixel_buffer_manager_v1 object. The child objects created via this interface are unaffected. func (o *WpSinglePixelBufferManager) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_single_pixel_buffer_manager_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Create a single-pixel buffer from four 32-bit RGBA values. Unless specified in another protocol extension, the RGBA values use pre-multiplied alpha. The width and height of the buffer are 1. The r, g, b and a arguments valid range is from UINT32_MIN (0) to UINT32_MAX (0xffffffff). These arguments should be interpreted as a percentage, i.e. - UINT32_MIN = 0% of the given color component - UINT32_MAX = 100% of the given color component func (o *WpSinglePixelBufferManager) CreateU32RgbaBuffer(r uint32, g uint32, b uint32, a uint32) (*cross_wl_buffer.Buffer, error) { child := cross_wl_buffer.NewBuffer(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_single_pixel_buffer_manager_v1.create_u32_rgba_buffer", Child: child}, wl.ArgObject(child), wl.ArgUint(r), wl.ArgUint(g), wl.ArgUint(b), wl.ArgUint(a)); err != nil { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *WpSinglePixelBufferManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_single_pixel_buffer_manager_v1 and calls the registered handlers. func (o *WpSinglePixelBufferManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } }