// Code generated by wlgen; DO NOT EDIT. package wlrlayershell import ( "fmt" wayland "github.com/bnema/purego-libwayland/protocol/wayland" xdgshell "github.com/bnema/purego-libwayland/protocol/xdgshell" "github.com/bnema/purego-libwayland/server" ) var ZwlrLayerShellV1Interface *server.Interface var ZwlrLayerSurfaceV1Interface *server.Interface func init() { ZwlrLayerShellV1Interface = &server.Interface{Name: "zwlr_layer_shell_v1", Version: 5} ZwlrLayerSurfaceV1Interface = &server.Interface{Name: "zwlr_layer_surface_v1", Version: 5} ZwlrLayerShellV1Interface.Requests = []server.Message{ {Name: "get_layer_surface", Signature: "no?ous", Types: []*server.Interface{ZwlrLayerSurfaceV1Interface, wayland.SurfaceInterface, wayland.OutputInterface, nil, nil}}, {Name: "destroy", Signature: "3", Types: []*server.Interface{}}, } ZwlrLayerShellV1Interface.Events = []server.Message{} ZwlrLayerSurfaceV1Interface.Requests = []server.Message{ {Name: "set_size", Signature: "uu", Types: []*server.Interface{nil, nil}}, {Name: "set_anchor", Signature: "u", Types: []*server.Interface{nil}}, {Name: "set_exclusive_zone", Signature: "i", Types: []*server.Interface{nil}}, {Name: "set_margin", Signature: "iiii", Types: []*server.Interface{nil, nil, nil, nil}}, {Name: "set_keyboard_interactivity", Signature: "u", Types: []*server.Interface{nil}}, {Name: "get_popup", Signature: "o", Types: []*server.Interface{xdgshell.PopupInterface}}, {Name: "ack_configure", Signature: "u", Types: []*server.Interface{nil}}, {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "set_layer", Signature: "2u", Types: []*server.Interface{nil}}, {Name: "set_exclusive_edge", Signature: "5u", Types: []*server.Interface{nil}}, } ZwlrLayerSurfaceV1Interface.Events = []server.Message{ {Name: "configure", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, {Name: "closed", Signature: "", Types: []*server.Interface{}}, } if err := server.NewInterfaces(ZwlrLayerShellV1Interface, ZwlrLayerSurfaceV1Interface); err != nil { panic(err) } } // ZwlrLayerShellV1 create surfaces that are layers of the desktop. type ZwlrLayerShellV1 struct{ *server.Resource } func WrapZwlrLayerShellV1(r *server.Resource) *ZwlrLayerShellV1 { if r == nil { return nil } return &ZwlrLayerShellV1{r} } const ZwlrLayerShellV1RequestGetLayerSurface uint32 = 0 const ZwlrLayerShellV1RequestDestroy uint32 = 1 // ZwlrLayerShellV1Error . type ZwlrLayerShellV1Error uint32 const ( ZwlrLayerShellV1ErrorRole ZwlrLayerShellV1Error = 0 ZwlrLayerShellV1ErrorInvalidLayer ZwlrLayerShellV1Error = 1 ZwlrLayerShellV1ErrorAlreadyConstructed ZwlrLayerShellV1Error = 2 ) // ZwlrLayerShellV1Layer available layers for surfaces. type ZwlrLayerShellV1Layer uint32 const ( ZwlrLayerShellV1LayerBackground ZwlrLayerShellV1Layer = 0 ZwlrLayerShellV1LayerBottom ZwlrLayerShellV1Layer = 1 ZwlrLayerShellV1LayerTop ZwlrLayerShellV1Layer = 2 ZwlrLayerShellV1LayerOverlay ZwlrLayerShellV1Layer = 3 ) // ZwlrLayerShellV1Handler handles zwlr_layer_shell_v1 requests. type ZwlrLayerShellV1Handler interface { GetLayerSurface(self *ZwlrLayerShellV1, id uint32, surface *wayland.Surface, output *wayland.Output, layer uint32, namespace string) Destroy(self *ZwlrLayerShellV1) } func NewZwlrLayerShellV1(c server.Client, version int32, id uint32, h ZwlrLayerShellV1Handler) (*ZwlrLayerShellV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_layer_shell_v1") } var self *ZwlrLayerShellV1 r, err := c.CreateResource(ZwlrLayerShellV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.GetLayerSurface(self, args[0].NewID(), wayland.WrapSurface(args[1].Resource()), wayland.WrapOutput(args[2].Resource()), args[3].Uint(), args[4].String()) case 1: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapZwlrLayerShellV1(r) r.Data = self return self, nil } func NewZwlrLayerShellV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ZwlrLayerShellV1Interface, version, bind) } // ZwlrLayerSurfaceV1 layer metadata interface. type ZwlrLayerSurfaceV1 struct{ *server.Resource } func WrapZwlrLayerSurfaceV1(r *server.Resource) *ZwlrLayerSurfaceV1 { if r == nil { return nil } return &ZwlrLayerSurfaceV1{r} } const ZwlrLayerSurfaceV1RequestSetSize uint32 = 0 const ZwlrLayerSurfaceV1RequestSetAnchor uint32 = 1 const ZwlrLayerSurfaceV1RequestSetExclusiveZone uint32 = 2 const ZwlrLayerSurfaceV1RequestSetMargin uint32 = 3 const ZwlrLayerSurfaceV1RequestSetKeyboardInteractivity uint32 = 4 const ZwlrLayerSurfaceV1RequestGetPopup uint32 = 5 const ZwlrLayerSurfaceV1RequestAckConfigure uint32 = 6 const ZwlrLayerSurfaceV1RequestDestroy uint32 = 7 const ZwlrLayerSurfaceV1RequestSetLayer uint32 = 8 const ZwlrLayerSurfaceV1RequestSetExclusiveEdge uint32 = 9 const ZwlrLayerSurfaceV1EventConfigure uint32 = 0 const ZwlrLayerSurfaceV1EventClosed uint32 = 1 // ZwlrLayerSurfaceV1KeyboardInteractivity types of keyboard interaction possible for a layer shell surface. type ZwlrLayerSurfaceV1KeyboardInteractivity uint32 const ( ZwlrLayerSurfaceV1KeyboardInteractivityNone ZwlrLayerSurfaceV1KeyboardInteractivity = 0 ZwlrLayerSurfaceV1KeyboardInteractivityExclusive ZwlrLayerSurfaceV1KeyboardInteractivity = 1 ZwlrLayerSurfaceV1KeyboardInteractivityOnDemand ZwlrLayerSurfaceV1KeyboardInteractivity = 2 ) // ZwlrLayerSurfaceV1Error . type ZwlrLayerSurfaceV1Error uint32 const ( ZwlrLayerSurfaceV1ErrorInvalidSurfaceState ZwlrLayerSurfaceV1Error = 0 ZwlrLayerSurfaceV1ErrorInvalidSize ZwlrLayerSurfaceV1Error = 1 ZwlrLayerSurfaceV1ErrorInvalidAnchor ZwlrLayerSurfaceV1Error = 2 ZwlrLayerSurfaceV1ErrorInvalidKeyboardInteractivity ZwlrLayerSurfaceV1Error = 3 ZwlrLayerSurfaceV1ErrorInvalidExclusiveEdge ZwlrLayerSurfaceV1Error = 4 ) // ZwlrLayerSurfaceV1Anchor (bitfield). type ZwlrLayerSurfaceV1Anchor uint32 const ( ZwlrLayerSurfaceV1AnchorTop ZwlrLayerSurfaceV1Anchor = 1 ZwlrLayerSurfaceV1AnchorBottom ZwlrLayerSurfaceV1Anchor = 2 ZwlrLayerSurfaceV1AnchorLeft ZwlrLayerSurfaceV1Anchor = 4 ZwlrLayerSurfaceV1AnchorRight ZwlrLayerSurfaceV1Anchor = 8 ) // ZwlrLayerSurfaceV1Handler handles zwlr_layer_surface_v1 requests. type ZwlrLayerSurfaceV1Handler interface { SetSize(self *ZwlrLayerSurfaceV1, width uint32, height uint32) SetAnchor(self *ZwlrLayerSurfaceV1, anchor uint32) SetExclusiveZone(self *ZwlrLayerSurfaceV1, zone int32) SetMargin(self *ZwlrLayerSurfaceV1, top int32, right int32, bottom int32, left int32) SetKeyboardInteractivity(self *ZwlrLayerSurfaceV1, keyboardInteractivity uint32) GetPopup(self *ZwlrLayerSurfaceV1, popup *xdgshell.Popup) AckConfigure(self *ZwlrLayerSurfaceV1, serial uint32) Destroy(self *ZwlrLayerSurfaceV1) SetLayer(self *ZwlrLayerSurfaceV1, layer uint32) SetExclusiveEdge(self *ZwlrLayerSurfaceV1, edge uint32) } func NewZwlrLayerSurfaceV1(c server.Client, version int32, id uint32, h ZwlrLayerSurfaceV1Handler) (*ZwlrLayerSurfaceV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for zwlr_layer_surface_v1") } var self *ZwlrLayerSurfaceV1 r, err := c.CreateResource(ZwlrLayerSurfaceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.SetSize(self, args[0].Uint(), args[1].Uint()) case 1: h.SetAnchor(self, args[0].Uint()) case 2: h.SetExclusiveZone(self, args[0].Int()) case 3: h.SetMargin(self, args[0].Int(), args[1].Int(), args[2].Int(), args[3].Int()) case 4: h.SetKeyboardInteractivity(self, args[0].Uint()) case 5: h.GetPopup(self, xdgshell.WrapPopup(args[0].Resource())) case 6: h.AckConfigure(self, args[0].Uint()) case 7: h.Destroy(self) self.Destroy() case 8: h.SetLayer(self, args[0].Uint()) case 9: h.SetExclusiveEdge(self, args[0].Uint()) } }) if err != nil { return nil, err } self = WrapZwlrLayerSurfaceV1(r) r.Data = self return self, nil } // SendConfigure suggest a surface change. func (self *ZwlrLayerSurfaceV1) SendConfigure(serial uint32, width uint32, height uint32) { self.PostEvent(ZwlrLayerSurfaceV1EventConfigure, server.Uint(serial), server.Uint(width), server.Uint(height)) } // SendClosed surface should be closed. func (self *ZwlrLayerSurfaceV1) SendClosed() { self.PostEvent(ZwlrLayerSurfaceV1EventClosed) } func NewZwlrLayerSurfaceV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ZwlrLayerSurfaceV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *ZwlrLayerShellV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ZwlrLayerSurfaceV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }