// Code generated by wlbgen; DO NOT EDIT. // Upstream protocol copyright and license: // Copyright © 2017 Red Hat Inc. // // 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 xdgoutput import ( "fmt" wayland "github.com/bnema/go-wayland-bindings/server/wayland" "github.com/bnema/purego-libwayland/server" "runtime" ) var ZxdgOutputManagerV1Interface *server.Interface var ZxdgOutputV1Interface *server.Interface func init() { ZxdgOutputManagerV1Interface = &server.Interface{Name: "zxdg_output_manager_v1", Version: 3} ZxdgOutputV1Interface = &server.Interface{Name: "zxdg_output_v1", Version: 3} ZxdgOutputManagerV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, {Name: "get_xdg_output", Signature: "no", Types: []*server.Interface{ZxdgOutputV1Interface, wayland.OutputInterface}}, } ZxdgOutputManagerV1Interface.Events = []server.Message{} ZxdgOutputV1Interface.Requests = []server.Message{ {Name: "destroy", Signature: "", Types: []*server.Interface{}}, } ZxdgOutputV1Interface.Events = []server.Message{ {Name: "logical_position", Signature: "ii", Types: []*server.Interface{nil, nil}}, {Name: "logical_size", Signature: "ii", Types: []*server.Interface{nil, nil}}, {Name: "done", Signature: "", Types: []*server.Interface{}}, {Name: "name", Signature: "2s", Types: []*server.Interface{nil}}, {Name: "description", Signature: "2s", Types: []*server.Interface{nil}}, } if err := server.NewInterfaces(ZxdgOutputManagerV1Interface, ZxdgOutputV1Interface); err != nil { panic(err) } } // ZxdgOutputManagerV1 manage xdg_output objects. type ZxdgOutputManagerV1 struct{ *server.Resource } func WrapZxdgOutputManagerV1(r *server.Resource) *ZxdgOutputManagerV1 { if r == nil { return nil } return &ZxdgOutputManagerV1{r} } const ZxdgOutputManagerV1RequestDestroy uint32 = 0 const ZxdgOutputManagerV1RequestGetXdgOutput uint32 = 1 // ZxdgOutputManagerV1Handler handles zxdg_output_manager_v1 requests. type ZxdgOutputManagerV1Handler interface { Destroy(self *ZxdgOutputManagerV1) GetXdgOutput(self *ZxdgOutputManagerV1, id uint32, output *wayland.Output) } func NewZxdgOutputManagerV1(c server.Client, version int32, id uint32, h ZxdgOutputManagerV1Handler) (*ZxdgOutputManagerV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_output_manager_v1") } var self *ZxdgOutputManagerV1 r, err := c.CreateResource(ZxdgOutputManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() case 1: h.GetXdgOutput(self, args[0].NewID(), wayland.WrapOutput(args[1].Resource())) } }) if err != nil { return nil, err } self = WrapZxdgOutputManagerV1(r) r.Data = self return self, nil } func NewZxdgOutputManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ZxdgOutputManagerV1Interface, version, bind) } // ZxdgOutputV1 compositor logical output region. type ZxdgOutputV1 struct{ *server.Resource } func WrapZxdgOutputV1(r *server.Resource) *ZxdgOutputV1 { if r == nil { return nil } return &ZxdgOutputV1{r} } const ZxdgOutputV1RequestDestroy uint32 = 0 const ZxdgOutputV1EventLogicalPosition uint32 = 0 const ZxdgOutputV1EventLogicalSize uint32 = 1 const ZxdgOutputV1EventDone uint32 = 2 const ZxdgOutputV1EventName uint32 = 3 const ZxdgOutputV1EventDescription uint32 = 4 // ZxdgOutputV1Handler handles zxdg_output_v1 requests. type ZxdgOutputV1Handler interface { Destroy(self *ZxdgOutputV1) } func NewZxdgOutputV1(c server.Client, version int32, id uint32, h ZxdgOutputV1Handler) (*ZxdgOutputV1, error) { if h == nil { return nil, fmt.Errorf("purego-libwayland: nil handler for zxdg_output_v1") } var self *ZxdgOutputV1 r, err := c.CreateResource(ZxdgOutputV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { switch opcode { case 0: h.Destroy(self) self.Destroy() } }) if err != nil { return nil, err } self = WrapZxdgOutputV1(r) r.Data = self return self, nil } // SendLogicalPosition position of the output within the global compositor space. func (self *ZxdgOutputV1) SendLogicalPosition(x int32, y int32) { self.PostEvent(ZxdgOutputV1EventLogicalPosition, server.Int(x), server.Int(y)) } // SendLogicalSize size of the output in the global compositor space. func (self *ZxdgOutputV1) SendLogicalSize(width int32, height int32) { self.PostEvent(ZxdgOutputV1EventLogicalSize, server.Int(width), server.Int(height)) } // SendDone all information about the output have been sent. func (self *ZxdgOutputV1) SendDone() { self.PostEvent(ZxdgOutputV1EventDone) } // SendName name of this output (since version 2). func (self *ZxdgOutputV1) SendName(name string) { var p runtime.Pinner defer p.Unpin() self.PostEvent(ZxdgOutputV1EventName, server.String(&p, name, false)) } // SendDescription human-readable description of this output (since version 2). func (self *ZxdgOutputV1) SendDescription(description string) { var p runtime.Pinner defer p.Unpin() self.PostEvent(ZxdgOutputV1EventDescription, server.String(&p, description, false)) } func NewZxdgOutputV1Global(d *server.Display, version int32, bind server.BindFunc) error { return d.CreateGlobal(ZxdgOutputV1Interface, version, bind) } func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { if v == nil { return nil } return v.GetResource() } func (self *ZxdgOutputManagerV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource } func (self *ZxdgOutputV1) GetResource() *server.Resource { if self == nil { return nil } return self.Resource }