// Code generated by wlbgen; DO NOT EDIT. // Upstream protocol copyright and license: // Copyright © 2022 Andri Yngvason // Copyright © 2024 Simon Ser // // 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 extimagecapturesource import ( "fmt" extforeigntoplevellist "github.com/bnema/go-wayland-bindings/server/extforeigntoplevellist" wayland "github.com/bnema/go-wayland-bindings/server/wayland" "github.com/bnema/purego-libwayland/server" ) var ExtImageCaptureSourceV1Interface *server.Interface var ExtOutputImageCaptureSourceManagerV1Interface *server.Interface var ExtForeignToplevelImageCaptureSourceManagerV1Interface *server.Interface func init() { ExtImageCaptureSourceV1Interface = &server.Interface{Name: "ext_image_capture_source_v1", Version: 1} ExtOutputImageCaptureSourceManagerV1Interface = &server.Interface{Name: "ext_output_image_capture_source_manager_v1", Version: 1} ExtForeignToplevelImageCaptureSourceManagerV1Interface = &server.Interface{Name: "ext_foreign_toplevel_image_capture_source_manager_v1", Version: 1} ExtImageCaptureSourceV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } ExtImageCaptureSourceV1Interface.Events = []server.Message{} ExtOutputImageCaptureSourceManagerV1Interface.Requests = []server.Message{ {Name: "create_source", Signature: "no", Types: []*server.Interface{ExtImageCaptureSourceV1Interface, wayland.OutputInterface}}, {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } ExtOutputImageCaptureSourceManagerV1Interface.Events = []server.Message{} ExtForeignToplevelImageCaptureSourceManagerV1Interface.Requests = []server.Message{ {Name: "create_source", Signature: "no", Types: []*server.Interface{ExtImageCaptureSourceV1Interface, extforeigntoplevellist.ExtForeignToplevelHandleV1Interface}}, {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } ExtForeignToplevelImageCaptureSourceManagerV1Interface.Events = []server.Message{} if err := server.NewInterfaces(ExtImageCaptureSourceV1Interface, ExtOutputImageCaptureSourceManagerV1Interface, ExtForeignToplevelImageCaptureSourceManagerV1Interface); err != nil { panic(err) } } // ExtImageCaptureSourceV1 opaque image capture source object. type ExtImageCaptureSourceV1 struct{ *server.Resource } func WrapExtImageCaptureSourceV1(r *server.Resource) *ExtImageCaptureSourceV1 { if r == nil { return nil } return &ExtImageCaptureSourceV1{r} } const ExtImageCaptureSourceV1RequestDestroy uint32 = 0 // ExtImageCaptureSourceV1Handler handles ext_image_capture_source_v1 requests. type ExtImageCaptureSourceV1Handler interface { Destroy(self *ExtImageCaptureSourceV1) } func NewExtImageCaptureSourceV1(c server.Client, version int32, id uint32, h ExtImageCaptureSourceV1Handler) (*ExtImageCaptureSourceV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_image_capture_source_v1") } var self *ExtImageCaptureSourceV1 r, err := c.CreateResource(ExtImageCaptureSourceV1Interface, 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 = WrapExtImageCaptureSourceV1(r) r.Data = self return self, nil } func NewExtImageCaptureSourceV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtImageCaptureSourceV1Interface, version, bind) } // ExtOutputImageCaptureSourceManagerV1 image capture source manager for outputs. type ExtOutputImageCaptureSourceManagerV1 struct{ *server.Resource } func WrapExtOutputImageCaptureSourceManagerV1(r *server.Resource) *ExtOutputImageCaptureSourceManagerV1 { if r == nil { return nil } return &ExtOutputImageCaptureSourceManagerV1{r} } const ExtOutputImageCaptureSourceManagerV1RequestCreateSource uint32 = 0 const ExtOutputImageCaptureSourceManagerV1RequestDestroy uint32 = 1 // ExtOutputImageCaptureSourceManagerV1Handler handles ext_output_image_capture_source_manager_v1 requests. type ExtOutputImageCaptureSourceManagerV1Handler interface { CreateSource(self *ExtOutputImageCaptureSourceManagerV1, source uint32, output *wayland.Output) Destroy(self *ExtOutputImageCaptureSourceManagerV1) } func NewExtOutputImageCaptureSourceManagerV1(c server.Client, version int32, id uint32, h ExtOutputImageCaptureSourceManagerV1Handler) (*ExtOutputImageCaptureSourceManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_output_image_capture_source_manager_v1") } var self *ExtOutputImageCaptureSourceManagerV1 r, err := c.CreateResource(ExtOutputImageCaptureSourceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.CreateSource(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource())) case 1: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapExtOutputImageCaptureSourceManagerV1(r) r.Data = self return self, nil } func NewExtOutputImageCaptureSourceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtOutputImageCaptureSourceManagerV1Interface, version, bind) } // ExtForeignToplevelImageCaptureSourceManagerV1 image capture source manager for foreign toplevels. type ExtForeignToplevelImageCaptureSourceManagerV1 struct{ *server.Resource } func WrapExtForeignToplevelImageCaptureSourceManagerV1(r *server.Resource) *ExtForeignToplevelImageCaptureSourceManagerV1 { if r == nil { return nil } return &ExtForeignToplevelImageCaptureSourceManagerV1{r} } const ExtForeignToplevelImageCaptureSourceManagerV1RequestCreateSource uint32 = 0 const ExtForeignToplevelImageCaptureSourceManagerV1RequestDestroy uint32 = 1 // ExtForeignToplevelImageCaptureSourceManagerV1Handler handles ext_foreign_toplevel_image_capture_source_manager_v1 requests. type ExtForeignToplevelImageCaptureSourceManagerV1Handler interface { CreateSource(self *ExtForeignToplevelImageCaptureSourceManagerV1, source uint32, toplevelHandle *extforeigntoplevellist.ExtForeignToplevelHandleV1) Destroy(self *ExtForeignToplevelImageCaptureSourceManagerV1) } func NewExtForeignToplevelImageCaptureSourceManagerV1(c server.Client, version int32, id uint32, h ExtForeignToplevelImageCaptureSourceManagerV1Handler) (*ExtForeignToplevelImageCaptureSourceManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_foreign_toplevel_image_capture_source_manager_v1") } var self *ExtForeignToplevelImageCaptureSourceManagerV1 r, err := c.CreateResource(ExtForeignToplevelImageCaptureSourceManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.CreateSource(self, args[0].NewID(), extforeigntoplevellist.WrapExtForeignToplevelHandleV1(args[1].Resource())) case 1: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapExtForeignToplevelImageCaptureSourceManagerV1(r) r.Data = self return self, nil } func NewExtForeignToplevelImageCaptureSourceManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtForeignToplevelImageCaptureSourceManagerV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *ExtImageCaptureSourceV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ExtOutputImageCaptureSourceManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ExtForeignToplevelImageCaptureSourceManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }