// Code generated by wlbgen. DO NOT EDIT. // Protocol: xwayland_shell_v1 // Source: xwayland-shell-v1.xml // Upstream protocol copyright and license: // Copyright © 2022 Joshua Ashton // // 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 xwaylandshell import ( cross_wl_surface "github.com/bnema/go-wayland-bindings/client/wayland" "github.com/bnema/wlturbo/wl" ) // ERROR_ROLE is the error role value. const ERROR_ROLE = 0 // ERROR_ALREADY_ASSOCIATED is the error already_associated value. const ERROR_ALREADY_ASSOCIATED = 0 // ERROR_INVALID_SERIAL is the error invalid_serial value. const ERROR_INVALID_SERIAL = 1 // XwaylandShellInterface is the protocol interface name. const XwaylandShellInterface = "xwayland_shell_v1" // XwaylandShell is the generated binding for xwayland_shell_v1 version 1. type XwaylandShell struct { wl.BaseProxy } // NewXwaylandShell returns an unbound XwaylandShell. func NewXwaylandShell(ctx *wl.Context) *XwaylandShell { obj := &XwaylandShell{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the xwayland_shell_v1 object. The child objects created via this interface are unaffected. func (o *XwaylandShell) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "xwayland_shell_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Create an xwayland_surface_v1 interface for a given wl_surface object and gives it the xwayland_surface role. It is illegal to create an xwayland_surface_v1 for a wl_surface which already has an assigned role and this will result in the `role` protocol error. See the documentation of xwayland_surface_v1 for more details about what an xwayland_surface_v1 is and how it is used. func (o *XwaylandShell) GetXwaylandSurface(surface *cross_wl_surface.Surface) (*XwaylandSurface, error) { var arg1 wl.Object if surface != nil { arg1 = surface } child := &XwaylandSurface{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "xwayland_shell_v1.get_xwayland_surface", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *XwaylandShell) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on xwayland_shell_v1 and calls the registered handlers. func (o *XwaylandShell) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // XwaylandSurfaceInterface is the protocol interface name. const XwaylandSurfaceInterface = "xwayland_surface_v1" // XwaylandSurface is the generated binding for xwayland_surface_v1 version 1. type XwaylandSurface struct { wl.BaseProxy } // NewXwaylandSurface returns an unbound XwaylandSurface. func NewXwaylandSurface(ctx *wl.Context) *XwaylandSurface { obj := &XwaylandSurface{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Associates an Xwayland window to a wl_surface. The association state is double-buffered, see wl_surface.commit. The `serial_lo` and `serial_hi` parameters specify a non-zero monotonic serial number which is entirely unique and provided by the Xwayland server equal to the serial value provided by a client message with a message type of the `WL_SURFACE_SERIAL` atom on the X11 window for this surface to be associated to. The serial value in the `WL_SURFACE_SERIAL` client message is specified as having the lo-bits specified in `l[0]` and the hi-bits specified in `l[1]`. If the serial value provided by `serial_lo` and `serial_hi` is not valid, the `invalid_serial` protocol error will be raised. An X11 window may be associated with multiple surfaces throughout its lifespan. (eg. unmapping and remapping a window). For each wl_surface, this state must not be committed more than once, otherwise the `already_associated` protocol error will be raised. func (o *XwaylandSurface) SetSerial(serialLo uint32, serialHi uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "xwayland_surface_v1.set_serial"}, wl.ArgUint(serialLo), wl.ArgUint(serialHi)); err != nil { return err } return nil } // Destroy the xwayland_surface_v1 object. Any already existing associations are unaffected by this action. func (o *XwaylandSurface) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "xwayland_surface_v1.destroy", Destructor: true}); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *XwaylandSurface) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on xwayland_surface_v1 and calls the registered handlers. func (o *XwaylandSurface) Dispatch(event *wl.Event) { switch event.Opcode { default: } }