// Code generated by wlbgen; DO NOT EDIT. // Upstream protocol copyright and license: // Copyright © 2024 Xaver Hugl // // 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 alphamodifier import ( "fmt" wayland "github.com/bnema/go-wayland-bindings/server/wayland" "github.com/bnema/purego-libwayland/server" ) var WpAlphaModifierV1Interface *server.Interface var WpAlphaModifierSurfaceV1Interface *server.Interface func init() { WpAlphaModifierV1Interface = &server.Interface{Name: "wp_alpha_modifier_v1", Version: 1} WpAlphaModifierSurfaceV1Interface = &server.Interface{Name: "wp_alpha_modifier_surface_v1", Version: 1} WpAlphaModifierV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "get_surface", Signature: "no", Types: []*server.Interface{WpAlphaModifierSurfaceV1Interface, wayland.SurfaceInterface}}, } WpAlphaModifierV1Interface.Events = []server.Message{} WpAlphaModifierSurfaceV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "set_multiplier", Signature: "u", Types: []*server.Interface{nil}}, } WpAlphaModifierSurfaceV1Interface.Events = []server.Message{} if err := server.NewInterfaces(WpAlphaModifierV1Interface, WpAlphaModifierSurfaceV1Interface); err != nil { panic(err) } } // WpAlphaModifierV1 surface alpha modifier manager. type WpAlphaModifierV1 struct{ *server.Resource } func WrapWpAlphaModifierV1(r *server.Resource) *WpAlphaModifierV1 { if r == nil { return nil } return &WpAlphaModifierV1{r} } const WpAlphaModifierV1RequestDestroy uint32 = 0 const WpAlphaModifierV1RequestGetSurface uint32 = 1 // WpAlphaModifierV1Error . type WpAlphaModifierV1Error uint32 const ( WpAlphaModifierV1ErrorAlreadyConstructed WpAlphaModifierV1Error = 0 ) // WpAlphaModifierV1Handler handles wp_alpha_modifier_v1 requests. type WpAlphaModifierV1Handler interface { Destroy(self *WpAlphaModifierV1) GetSurface(self *WpAlphaModifierV1, id uint32, surface *wayland.Surface) } func NewWpAlphaModifierV1(c server.Client, version int32, id uint32, h WpAlphaModifierV1Handler) (*WpAlphaModifierV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for wp_alpha_modifier_v1") } var self *WpAlphaModifierV1 r, err := c.CreateResource(WpAlphaModifierV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.GetSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource())) } }) if err != nil { return nil, err } self = WrapWpAlphaModifierV1(r) r.Data = self return self, nil } func NewWpAlphaModifierV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(WpAlphaModifierV1Interface, version, bind) } // WpAlphaModifierSurfaceV1 alpha modifier object for a surface. type WpAlphaModifierSurfaceV1 struct{ *server.Resource } func WrapWpAlphaModifierSurfaceV1(r *server.Resource) *WpAlphaModifierSurfaceV1 { if r == nil { return nil } return &WpAlphaModifierSurfaceV1{r} } const WpAlphaModifierSurfaceV1RequestDestroy uint32 = 0 const WpAlphaModifierSurfaceV1RequestSetMultiplier uint32 = 1 // WpAlphaModifierSurfaceV1Error . type WpAlphaModifierSurfaceV1Error uint32 const ( WpAlphaModifierSurfaceV1ErrorNoSurface WpAlphaModifierSurfaceV1Error = 0 ) // WpAlphaModifierSurfaceV1Handler handles wp_alpha_modifier_surface_v1 requests. type WpAlphaModifierSurfaceV1Handler interface { Destroy(self *WpAlphaModifierSurfaceV1) SetMultiplier(self *WpAlphaModifierSurfaceV1, factor uint32) } func NewWpAlphaModifierSurfaceV1(c server.Client, version int32, id uint32, h WpAlphaModifierSurfaceV1Handler) (*WpAlphaModifierSurfaceV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for wp_alpha_modifier_surface_v1") } var self *WpAlphaModifierSurfaceV1 r, err := c.CreateResource(WpAlphaModifierSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.SetMultiplier(self, args[0].Uint()) } }) if err != nil { return nil, err } self = WrapWpAlphaModifierSurfaceV1(r) r.Data = self return self, nil } func NewWpAlphaModifierSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(WpAlphaModifierSurfaceV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *WpAlphaModifierV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *WpAlphaModifierSurfaceV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }