// Code generated by wlgen; DO NOT EDIT. package alphamodifier import ( "fmt" wayland "github.com/bnema/purego-libwayland/protocol/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 }