// Code generated by wlgen; DO NOT EDIT. package extsessionlock import ( "fmt" wayland "github.com/bnema/purego-libwayland/protocol/wayland" "github.com/bnema/purego-libwayland/server" ) var ExtSessionLockManagerV1Interface *server.Interface var ExtSessionLockV1Interface *server.Interface var ExtSessionLockSurfaceV1Interface *server.Interface func init() { ExtSessionLockManagerV1Interface = &server.Interface{Name: "ext_session_lock_manager_v1", Version: 1} ExtSessionLockV1Interface = &server.Interface{Name: "ext_session_lock_v1", Version: 1} ExtSessionLockSurfaceV1Interface = &server.Interface{Name: "ext_session_lock_surface_v1", Version: 1} ExtSessionLockManagerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "lock", Signature: "n", Types: []*server.Interface{ExtSessionLockV1Interface}}, } ExtSessionLockManagerV1Interface.Events = []server.Message{} ExtSessionLockV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "get_lock_surface", Signature: "noo", Types: []*server.Interface{ExtSessionLockSurfaceV1Interface, wayland.SurfaceInterface, wayland.OutputInterface}}, {Name: "unlock_and_destroy", Signature: "", Types: []*server.Interface{}}, } ExtSessionLockV1Interface.Events = []server.Message{ {Name: "locked", Signature: "", Types: []*server.Interface{}}, {Name: "finished", Signature: "", Types: []*server.Interface{}}, } ExtSessionLockSurfaceV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}}, } ExtSessionLockSurfaceV1Interface.Events = []server.Message{ {Name: "configure", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, } if err := server.NewInterfaces(ExtSessionLockManagerV1Interface, ExtSessionLockV1Interface, ExtSessionLockSurfaceV1Interface); err != nil { panic(err) } } // ExtSessionLockManagerV1 used to lock the session. type ExtSessionLockManagerV1 struct{ *server.Resource } func WrapExtSessionLockManagerV1(r *server.Resource) *ExtSessionLockManagerV1 { if r == nil { return nil } return &ExtSessionLockManagerV1{r} } const ExtSessionLockManagerV1RequestDestroy uint32 = 0 const ExtSessionLockManagerV1RequestLock uint32 = 1 // ExtSessionLockManagerV1Handler handles ext_session_lock_manager_v1 requests. type ExtSessionLockManagerV1Handler interface { Destroy(self *ExtSessionLockManagerV1) Lock(self *ExtSessionLockManagerV1, id uint32) } func NewExtSessionLockManagerV1(c server.Client, version int32, id uint32, h ExtSessionLockManagerV1Handler) (*ExtSessionLockManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_manager_v1") } var self *ExtSessionLockManagerV1 r, err := c.CreateResource(ExtSessionLockManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.Lock(self, args[0].NewID()) } }) if err != nil { return nil, err } self = WrapExtSessionLockManagerV1(r) r.Data = self return self, nil } func NewExtSessionLockManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtSessionLockManagerV1Interface, version, bind) } // ExtSessionLockV1 manage lock state and create lock surfaces. type ExtSessionLockV1 struct{ *server.Resource } func WrapExtSessionLockV1(r *server.Resource) *ExtSessionLockV1 { if r == nil { return nil } return &ExtSessionLockV1{r} } const ExtSessionLockV1RequestDestroy uint32 = 0 const ExtSessionLockV1RequestGetLockSurface uint32 = 1 const ExtSessionLockV1RequestUnlockAndDestroy uint32 = 2 const ExtSessionLockV1EventLocked uint32 = 0 const ExtSessionLockV1EventFinished uint32 = 1 // ExtSessionLockV1Error . type ExtSessionLockV1Error uint32 const ( ExtSessionLockV1ErrorInvalidDestroy ExtSessionLockV1Error = 0 ExtSessionLockV1ErrorInvalidUnlock ExtSessionLockV1Error = 1 ExtSessionLockV1ErrorRole ExtSessionLockV1Error = 2 ExtSessionLockV1ErrorDuplicateOutput ExtSessionLockV1Error = 3 ExtSessionLockV1ErrorAlreadyConstructed ExtSessionLockV1Error = 4 ) // ExtSessionLockV1Handler handles ext_session_lock_v1 requests. type ExtSessionLockV1Handler interface { Destroy(self *ExtSessionLockV1) GetLockSurface(self *ExtSessionLockV1, id uint32, surface *wayland.Surface, output *wayland.Output) UnlockAndDestroy(self *ExtSessionLockV1) } func NewExtSessionLockV1(c server.Client, version int32, id uint32, h ExtSessionLockV1Handler) (*ExtSessionLockV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_v1") } var self *ExtSessionLockV1 r, err := c.CreateResource(ExtSessionLockV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.GetLockSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapOutput(args[2].Resource())) case 2: h.UnlockAndDestroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapExtSessionLockV1(r) r.Data = self return self, nil } // SendLocked session successfully locked. func (self *ExtSessionLockV1) SendLocked() { self.PostEvent(ExtSessionLockV1EventLocked) } // SendFinished the session lock object should be destroyed. func (self *ExtSessionLockV1) SendFinished() { self.PostEvent(ExtSessionLockV1EventFinished) } func NewExtSessionLockV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtSessionLockV1Interface, version, bind) } // ExtSessionLockSurfaceV1 a surface displayed while the session is locked. type ExtSessionLockSurfaceV1 struct{ *server.Resource } func WrapExtSessionLockSurfaceV1(r *server.Resource) *ExtSessionLockSurfaceV1 { if r == nil { return nil } return &ExtSessionLockSurfaceV1{r} } const ExtSessionLockSurfaceV1RequestDestroy uint32 = 0 const ExtSessionLockSurfaceV1RequestAckConfigure uint32 = 1 const ExtSessionLockSurfaceV1EventConfigure uint32 = 0 // ExtSessionLockSurfaceV1Error . type ExtSessionLockSurfaceV1Error uint32 const ( ExtSessionLockSurfaceV1ErrorCommitBeforeFirstAck ExtSessionLockSurfaceV1Error = 0 ExtSessionLockSurfaceV1ErrorNullBuffer ExtSessionLockSurfaceV1Error = 1 ExtSessionLockSurfaceV1ErrorDimensionsMismatch ExtSessionLockSurfaceV1Error = 2 ExtSessionLockSurfaceV1ErrorInvalidSerial ExtSessionLockSurfaceV1Error = 3 ) // ExtSessionLockSurfaceV1Handler handles ext_session_lock_surface_v1 requests. type ExtSessionLockSurfaceV1Handler interface { Destroy(self *ExtSessionLockSurfaceV1) AckConfigure(self *ExtSessionLockSurfaceV1, serial uint32) } func NewExtSessionLockSurfaceV1(c server.Client, version int32, id uint32, h ExtSessionLockSurfaceV1Handler) (*ExtSessionLockSurfaceV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for ext_session_lock_surface_v1") } var self *ExtSessionLockSurfaceV1 r, err := c.CreateResource(ExtSessionLockSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.AckConfigure(self, args[0].Uint()) } }) if err != nil { return nil, err } self = WrapExtSessionLockSurfaceV1(r) r.Data = self return self, nil } // SendConfigure the client should resize its surface. func (self *ExtSessionLockSurfaceV1) SendConfigure(serial uint32, width uint32, height uint32) { self.PostEvent(ExtSessionLockSurfaceV1EventConfigure, server.Uint(serial), server.Uint(width), server.Uint(height)) } func NewExtSessionLockSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ExtSessionLockSurfaceV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *ExtSessionLockManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ExtSessionLockV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ExtSessionLockSurfaceV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }