// Code generated by wlbgen. DO NOT EDIT. // Protocol: pointer_warp_v1 // Source: pointer-warp-v1.xml // Upstream protocol copyright and license: // Copyright © 2024 Neal Gompa // Copyright © 2024 Xaver Hugl // Copyright © 2024 Matthias Klumpp // Copyright © 2024 Vlad Zahorodnii // // 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 pointerwarp import ( cross_wl_pointer "github.com/bnema/go-wayland-bindings/client/wayland" cross_wl_surface "github.com/bnema/go-wayland-bindings/client/wayland" "github.com/bnema/wlturbo/wl" ) // WpPointerWarpInterface is the protocol interface name. const WpPointerWarpInterface = "wp_pointer_warp_v1" // WpPointerWarp is the generated binding for wp_pointer_warp_v1 version 1. type WpPointerWarp struct { wl.BaseProxy } // NewWpPointerWarp returns an unbound WpPointerWarp. func NewWpPointerWarp(ctx *wl.Context) *WpPointerWarp { obj := &WpPointerWarp{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the pointer warp manager. func (o *WpPointerWarp) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_pointer_warp_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Request the compositor to move the pointer to a surface-local position. Whether or not the compositor honors the request is implementation defined, but it should - honor it if the surface has pointer focus, including when it has an implicit pointer grab - reject it if the enter serial is incorrect - reject it if the requested position is outside of the surface Note that the enter serial is valid for any surface of the client, and does not have to be from the surface the pointer is warped to. func (o *WpPointerWarp) WarpPointer(surface *cross_wl_surface.Surface, pointer *cross_wl_pointer.Pointer, x wl.Fixed, y wl.Fixed, serial uint32) error { var arg0 wl.Object if surface != nil { arg0 = surface } var arg1 wl.Object if pointer != nil { arg1 = pointer } if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_pointer_warp_v1.warp_pointer"}, wl.ArgObject(arg0), wl.ArgObject(arg1), wl.ArgFixed(x), wl.ArgFixed(y), wl.ArgUint(serial)); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *WpPointerWarp) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_pointer_warp_v1 and calls the registered handlers. func (o *WpPointerWarp) Dispatch(event *wl.Event) { switch event.Opcode { default: } }