// Code generated by wlgen; DO NOT EDIT. package pointerwarp import ( "fmt" wayland "github.com/bnema/purego-libwayland/protocol/wayland" "github.com/bnema/purego-libwayland/server" ) var WpPointerWarpV1Interface *server.Interface func init() { WpPointerWarpV1Interface = &server.Interface{Name: "wp_pointer_warp_v1", Version: 1} WpPointerWarpV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "warp_pointer", Signature: "ooffu", Types: []*server.Interface{wayland.SurfaceInterface, wayland.PointerInterface, nil, nil, nil}}, } WpPointerWarpV1Interface.Events = []server.Message{} if err := server.NewInterfaces(WpPointerWarpV1Interface); err != nil { panic(err) } } // WpPointerWarpV1 reposition the pointer to a location on a surface. type WpPointerWarpV1 struct{ *server.Resource } func WrapWpPointerWarpV1(r *server.Resource) *WpPointerWarpV1 { if r == nil { return nil } return &WpPointerWarpV1{r} } const WpPointerWarpV1RequestDestroy uint32 = 0 const WpPointerWarpV1RequestWarpPointer uint32 = 1 // WpPointerWarpV1Handler handles wp_pointer_warp_v1 requests. type WpPointerWarpV1Handler interface { Destroy(self *WpPointerWarpV1) WarpPointer(self *WpPointerWarpV1, surface *wayland.Surface, pointer *wayland.Pointer, x server.Fixed, y server.Fixed, serial uint32) } func NewWpPointerWarpV1(c server.Client, version int32, id uint32, h WpPointerWarpV1Handler) (*WpPointerWarpV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for wp_pointer_warp_v1") } var self *WpPointerWarpV1 r, err := c.CreateResource(WpPointerWarpV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.WarpPointer(self, wayland.WrapSurface(args[0].Resource()), wayland.WrapPointer(args[1].Resource()), args[2].Fixed(), args[3].Fixed(), args[4].Uint()) } }) if err != nil { return nil, err } self = WrapWpPointerWarpV1(r) r.Data = self return self, nil } func NewWpPointerWarpV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(WpPointerWarpV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *WpPointerWarpV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }