// Code generated by wlgen; DO NOT EDIT. package contenttype import ( "fmt" wayland "github.com/bnema/purego-libwayland/protocol/wayland" "github.com/bnema/purego-libwayland/server" ) var WpContentTypeManagerV1Interface *server.Interface var WpContentTypeV1Interface *server.Interface func init() { WpContentTypeManagerV1Interface = &server.Interface{Name: "wp_content_type_manager_v1", Version: 1} WpContentTypeV1Interface = &server.Interface{Name: "wp_content_type_v1", Version: 1} WpContentTypeManagerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "get_surface_content_type", Signature: "no", Types: []*server.Interface{WpContentTypeV1Interface, wayland.SurfaceInterface}}, } WpContentTypeManagerV1Interface.Events = []server.Message{} WpContentTypeV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "set_content_type", Signature: "u", Types: []*server.Interface{nil}}, } WpContentTypeV1Interface.Events = []server.Message{} if err := server.NewInterfaces(WpContentTypeManagerV1Interface, WpContentTypeV1Interface); err != nil { panic(err) } } // WpContentTypeManagerV1 surface content type manager. type WpContentTypeManagerV1 struct{ *server.Resource } func WrapWpContentTypeManagerV1(r *server.Resource) *WpContentTypeManagerV1 { if r == nil { return nil } return &WpContentTypeManagerV1{r} } const WpContentTypeManagerV1RequestDestroy uint32 = 0 const WpContentTypeManagerV1RequestGetSurfaceContentType uint32 = 1 // WpContentTypeManagerV1Error . type WpContentTypeManagerV1Error uint32 const ( WpContentTypeManagerV1ErrorAlreadyConstructed WpContentTypeManagerV1Error = 0 ) // WpContentTypeManagerV1Handler handles wp_content_type_manager_v1 requests. type WpContentTypeManagerV1Handler interface { Destroy(self *WpContentTypeManagerV1) GetSurfaceContentType(self *WpContentTypeManagerV1, id uint32, surface *wayland.Surface) } func NewWpContentTypeManagerV1(c server.Client, version int32, id uint32, h WpContentTypeManagerV1Handler) (*WpContentTypeManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for wp_content_type_manager_v1") } var self *WpContentTypeManagerV1 r, err := c.CreateResource(WpContentTypeManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.GetSurfaceContentType(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource())) } }) if err != nil { return nil, err } self = WrapWpContentTypeManagerV1(r) r.Data = self return self, nil } func NewWpContentTypeManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(WpContentTypeManagerV1Interface, version, bind) } // WpContentTypeV1 content type object for a surface. type WpContentTypeV1 struct{ *server.Resource } func WrapWpContentTypeV1(r *server.Resource) *WpContentTypeV1 { if r == nil { return nil } return &WpContentTypeV1{r} } const WpContentTypeV1RequestDestroy uint32 = 0 const WpContentTypeV1RequestSetContentType uint32 = 1 // WpContentTypeV1Type possible content types. type WpContentTypeV1Type uint32 const ( WpContentTypeV1TypeNone WpContentTypeV1Type = 0 WpContentTypeV1TypePhoto WpContentTypeV1Type = 1 WpContentTypeV1TypeVideo WpContentTypeV1Type = 2 WpContentTypeV1TypeGame WpContentTypeV1Type = 3 ) // WpContentTypeV1Handler handles wp_content_type_v1 requests. type WpContentTypeV1Handler interface { Destroy(self *WpContentTypeV1) SetContentType(self *WpContentTypeV1, contentType uint32) } func NewWpContentTypeV1(c server.Client, version int32, id uint32, h WpContentTypeV1Handler) (*WpContentTypeV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for wp_content_type_v1") } var self *WpContentTypeV1 r, err := c.CreateResource(WpContentTypeV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.SetContentType(self, args[0].Uint()) } }) if err != nil { return nil, err } self = WrapWpContentTypeV1(r) r.Data = self return self, nil } func NewWpContentTypeV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(WpContentTypeV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *WpContentTypeManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *WpContentTypeV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }