// Code generated by wlbgen; DO NOT EDIT. // Upstream protocol copyright and license: // Copyright © 2017 Collabora, Ltd. // // 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 inputtimestamps import ( "fmt" wayland "github.com/bnema/go-wayland-bindings/server/wayland" "github.com/bnema/purego-libwayland/server" ) var ZwpInputTimestampsManagerV1Interface *server.Interface var ZwpInputTimestampsV1Interface *server.Interface func init() { ZwpInputTimestampsManagerV1Interface = &server.Interface{Name: "zwp_input_timestamps_manager_v1", Version: 1} ZwpInputTimestampsV1Interface = &server.Interface{Name: "zwp_input_timestamps_v1", Version: 1} ZwpInputTimestampsManagerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "get_keyboard_timestamps", Signature: "no", Types: []*server.Interface{ZwpInputTimestampsV1Interface, wayland.KeyboardInterface}}, {Name: "get_pointer_timestamps", Signature: "no", Types: []*server.Interface{ZwpInputTimestampsV1Interface, wayland.PointerInterface}}, {Name: "get_touch_timestamps", Signature: "no", Types: []*server.Interface{ZwpInputTimestampsV1Interface, wayland.TouchInterface}}, } ZwpInputTimestampsManagerV1Interface.Events = []server.Message{} ZwpInputTimestampsV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } ZwpInputTimestampsV1Interface.Events = []server.Message{ {Name: "timestamp", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, } if err := server.NewInterfaces(ZwpInputTimestampsManagerV1Interface, ZwpInputTimestampsV1Interface); err != nil { panic(err) } } // ZwpInputTimestampsManagerV1 context object for high-resolution input timestamps. type ZwpInputTimestampsManagerV1 struct{ *server.Resource } func WrapZwpInputTimestampsManagerV1(r *server.Resource) *ZwpInputTimestampsManagerV1 { if r == nil { return nil } return &ZwpInputTimestampsManagerV1{r} } const ZwpInputTimestampsManagerV1RequestDestroy uint32 = 0 const ZwpInputTimestampsManagerV1RequestGetKeyboardTimestamps uint32 = 1 const ZwpInputTimestampsManagerV1RequestGetPointerTimestamps uint32 = 2 const ZwpInputTimestampsManagerV1RequestGetTouchTimestamps uint32 = 3 // ZwpInputTimestampsManagerV1Handler handles zwp_input_timestamps_manager_v1 requests. type ZwpInputTimestampsManagerV1Handler interface { Destroy(self *ZwpInputTimestampsManagerV1) GetKeyboardTimestamps(self *ZwpInputTimestampsManagerV1, id uint32, keyboard *wayland.Keyboard) GetPointerTimestamps(self *ZwpInputTimestampsManagerV1, id uint32, pointer *wayland.Pointer) GetTouchTimestamps(self *ZwpInputTimestampsManagerV1, id uint32, touch *wayland.Touch) } func NewZwpInputTimestampsManagerV1(c server.Client, version int32, id uint32, h ZwpInputTimestampsManagerV1Handler) (*ZwpInputTimestampsManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_input_timestamps_manager_v1") } var self *ZwpInputTimestampsManagerV1 r, err := c.CreateResource(ZwpInputTimestampsManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.GetKeyboardTimestamps(self, args[0].NewID(), wayland.WrapKeyboard(args[1].Resource())) case 2: h.GetPointerTimestamps(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource())) case 3: h.GetTouchTimestamps(self, args[0].NewID(), wayland.WrapTouch(args[1].Resource())) } }) if err != nil { return nil, err } self = WrapZwpInputTimestampsManagerV1(r) r.Data = self return self, nil } func NewZwpInputTimestampsManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ZwpInputTimestampsManagerV1Interface, version, bind) } // ZwpInputTimestampsV1 context object for input timestamps. type ZwpInputTimestampsV1 struct{ *server.Resource } func WrapZwpInputTimestampsV1(r *server.Resource) *ZwpInputTimestampsV1 { if r == nil { return nil } return &ZwpInputTimestampsV1{r} } const ZwpInputTimestampsV1RequestDestroy uint32 = 0 const ZwpInputTimestampsV1EventTimestamp uint32 = 0 // ZwpInputTimestampsV1Handler handles zwp_input_timestamps_v1 requests. type ZwpInputTimestampsV1Handler interface { Destroy(self *ZwpInputTimestampsV1) } func NewZwpInputTimestampsV1(c server.Client, version int32, id uint32, h ZwpInputTimestampsV1Handler) (*ZwpInputTimestampsV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_input_timestamps_v1") } var self *ZwpInputTimestampsV1 r, err := c.CreateResource(ZwpInputTimestampsV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapZwpInputTimestampsV1(r) r.Data = self return self, nil } // SendTimestamp high-resolution timestamp event. func (self *ZwpInputTimestampsV1) SendTimestamp(tvSecHi uint32, tvSecLo uint32, tvNsec uint32) { self.PostEvent(ZwpInputTimestampsV1EventTimestamp, server.Uint(tvSecHi), server.Uint(tvSecLo), server.Uint(tvNsec)) } func NewZwpInputTimestampsV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ZwpInputTimestampsV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *ZwpInputTimestampsManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ZwpInputTimestampsV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }