// Code generated by wlbgen. DO NOT EDIT. // Protocol: wlr_virtual_pointer_unstable_v1 // Source: wlr-virtual-pointer-unstable-v1.xml // Upstream protocol copyright and license: // Copyright © 2019 Josef Gajdusek // // 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 wlrvirtualpointer import ( cross_wl_output "github.com/bnema/go-wayland-bindings/client/wayland" cross_wl_seat "github.com/bnema/go-wayland-bindings/client/wayland" "github.com/bnema/wlturbo/wl" ) // ERROR_INVALID_AXIS is the error invalid_axis value. const ERROR_INVALID_AXIS = 0 // ERROR_INVALID_AXIS_SOURCE is the error invalid_axis_source value. const ERROR_INVALID_AXIS_SOURCE = 1 // VirtualPointerInterface is the protocol interface name. const VirtualPointerInterface = "zwlr_virtual_pointer_v1" // VirtualPointer is the generated binding for zwlr_virtual_pointer_v1 version 2. type VirtualPointer struct { wl.BaseProxy } // NewVirtualPointer returns an unbound VirtualPointer. func NewVirtualPointer(ctx *wl.Context) *VirtualPointer { obj := &VirtualPointer{} obj.SetContext(ctx) ctx.Register(obj) return obj } // The pointer has moved by a relative amount to the previous request. Values are in the global compositor space. func (o *VirtualPointer) Motion(time uint32, dx wl.Fixed, dy wl.Fixed) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "zwlr_virtual_pointer_v1.motion"}, wl.ArgUint(time), wl.ArgFixed(dx), wl.ArgFixed(dy)); err != nil { return err } return nil } // The pointer has moved in an absolute coordinate frame. Value of x can range from 0 to x_extent, value of y can range from 0 to y_extent. func (o *VirtualPointer) MotionAbsolute(time uint32, x uint32, y uint32, xExtent uint32, yExtent uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "zwlr_virtual_pointer_v1.motion_absolute"}, wl.ArgUint(time), wl.ArgUint(x), wl.ArgUint(y), wl.ArgUint(xExtent), wl.ArgUint(yExtent)); err != nil { return err } return nil } // A button was pressed or released. func (o *VirtualPointer) Button(time uint32, button uint32, state uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 2, Name: "zwlr_virtual_pointer_v1.button"}, wl.ArgUint(time), wl.ArgUint(button), wl.ArgUint(state)); err != nil { return err } return nil } // Scroll and other axis requests. func (o *VirtualPointer) Axis(time uint32, axis uint32, value wl.Fixed) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 3, Name: "zwlr_virtual_pointer_v1.axis"}, wl.ArgUint(time), wl.ArgUint(axis), wl.ArgFixed(value)); err != nil { return err } return nil } // Indicates the set of events that logically belong together. func (o *VirtualPointer) Frame() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 4, Name: "zwlr_virtual_pointer_v1.frame"}); err != nil { return err } return nil } // Source information for scroll and other axis. func (o *VirtualPointer) AxisSource(axisSource uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 5, Name: "zwlr_virtual_pointer_v1.axis_source"}, wl.ArgUint(axisSource)); err != nil { return err } return nil } // Stop notification for scroll and other axes. func (o *VirtualPointer) AxisStop(time uint32, axis uint32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 6, Name: "zwlr_virtual_pointer_v1.axis_stop"}, wl.ArgUint(time), wl.ArgUint(axis)); err != nil { return err } return nil } // Discrete step information for scroll and other axes. This event allows the client to extend data normally sent using the axis event with discrete value. func (o *VirtualPointer) AxisDiscrete(time uint32, axis uint32, value wl.Fixed, discrete int32) error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 7, Name: "zwlr_virtual_pointer_v1.axis_discrete"}, wl.ArgUint(time), wl.ArgUint(axis), wl.ArgFixed(value), wl.ArgInt(discrete)); err != nil { return err } return nil } // destroy the virtual pointer object func (o *VirtualPointer) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 8, Name: "zwlr_virtual_pointer_v1.destroy", Destructor: true}); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *VirtualPointer) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on zwlr_virtual_pointer_v1 and calls the registered handlers. func (o *VirtualPointer) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // VirtualPointerManagerInterface is the protocol interface name. const VirtualPointerManagerInterface = "zwlr_virtual_pointer_manager_v1" // VirtualPointerManager is the generated binding for zwlr_virtual_pointer_manager_v1 version 2. type VirtualPointerManager struct { wl.BaseProxy } // NewVirtualPointerManager returns an unbound VirtualPointerManager. func NewVirtualPointerManager(ctx *wl.Context) *VirtualPointerManager { obj := &VirtualPointerManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Creates a new virtual pointer. The optional seat is a suggestion to the compositor. func (o *VirtualPointerManager) CreateVirtualPointer(seat *cross_wl_seat.Seat) (*VirtualPointer, error) { var arg0 wl.Object if seat != nil { arg0 = seat } child := &VirtualPointer{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "zwlr_virtual_pointer_manager_v1.create_virtual_pointer", Child: child}, wl.ArgObject(arg0), wl.ArgObject(child)); err != nil { return nil, err } return child, nil } // destroy the virtual pointer manager func (o *VirtualPointerManager) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "zwlr_virtual_pointer_manager_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Creates a new virtual pointer. The seat and the output arguments are optional. If the seat argument is set, the compositor should assign the input device to the requested seat. If the output argument is set, the compositor should map the input device to the requested output. func (o *VirtualPointerManager) CreateVirtualPointerWithOutput(seat *cross_wl_seat.Seat, output *cross_wl_output.Output) (*VirtualPointer, error) { var arg0 wl.Object if seat != nil { arg0 = seat } var arg1 wl.Object if output != nil { arg1 = output } child := &VirtualPointer{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 2, Name: "zwlr_virtual_pointer_manager_v1.create_virtual_pointer_with_output", Since: 2, Child: child}, wl.ArgObject(arg0), wl.ArgObject(arg1), wl.ArgObject(child)); err != nil { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *VirtualPointerManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on zwlr_virtual_pointer_manager_v1 and calls the registered handlers. func (o *VirtualPointerManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } }