feat(protocol): add zwp_virtual_keyboard_v1 server bindings
- commit
- ac96fe0bd3c38c14c4cb9b69a36fced075974a8d
- author
- brice · · 2026-09-26 08:56 UTC
- parent
- 24ec840
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email - refs
- tag: v0.1.1
3 files · +267 -0
M protocol/gen.go +1 -0
| @@ -21,3 +21,4 @@ package protocol | |||
| 21 | 21 | //go:generate go run ../cmd/wlgen -package committiming -out committiming/committiming.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/commit-timing-v1.xml | |
| 22 | 22 | //go:generate go run ../cmd/wlgen -package contenttype -out contenttype/contenttype.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/content-type-v1.xml | |
| 23 | 23 | //go:generate go run ../cmd/wlgen -package xdgactivation -out xdgactivation/xdgactivation.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-activation-v1.xml | |
| 24 | + | //go:generate go run ../cmd/wlgen -package virtualkeyboard -out virtualkeyboard/virtualkeyboard.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/virtual-keyboard-unstable-v1.xml | |
| @@ -21,3 +21,4 @@ package protocol | |||||
| 21 | //go:generate go run ../cmd/wlgen -package committiming -out committiming/committiming.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/commit-timing-v1.xml | 21 | //go:generate go run ../cmd/wlgen -package committiming -out committiming/committiming.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/commit-timing-v1.xml | ||
| 22 | //go:generate go run ../cmd/wlgen -package contenttype -out contenttype/contenttype.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/content-type-v1.xml | 22 | //go:generate go run ../cmd/wlgen -package contenttype -out contenttype/contenttype.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/content-type-v1.xml | ||
| 23 | //go:generate go run ../cmd/wlgen -package xdgactivation -out xdgactivation/xdgactivation.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-activation-v1.xml | 23 | //go:generate go run ../cmd/wlgen -package xdgactivation -out xdgactivation/xdgactivation.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/xdg-activation-v1.xml | ||
| 24 | + | //go:generate go run ../cmd/wlgen -package virtualkeyboard -out virtualkeyboard/virtualkeyboard.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/virtual-keyboard-unstable-v1.xml | |||
A protocol/virtualkeyboard/virtualkeyboard.go +153 -0
| @@ -0,0 +1,153 @@ | |||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |
| 2 | + | package virtualkeyboard | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "fmt" | |
| 6 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |
| 7 | + | "github.com/bnema/purego-libwayland/server" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | var ZwpVirtualKeyboardV1Interface *server.Interface | |
| 11 | + | var ZwpVirtualKeyboardManagerV1Interface *server.Interface | |
| 12 | + | ||
| 13 | + | func init() { | |
| 14 | + | ZwpVirtualKeyboardV1Interface = &server.Interface{Name: "zwp_virtual_keyboard_v1", Version: 1} | |
| 15 | + | ZwpVirtualKeyboardManagerV1Interface = &server.Interface{Name: "zwp_virtual_keyboard_manager_v1", Version: 1} | |
| 16 | + | ZwpVirtualKeyboardV1Interface.Requests = []server.Message{ | |
| 17 | + | {Name: "keymap", Signature: "uhu", Types: []*server.Interface{nil, nil, nil}}, | |
| 18 | + | {Name: "key", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |
| 19 | + | {Name: "modifiers", Signature: "uuuu", Types: []*server.Interface{nil, nil, nil, nil}}, | |
| 20 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 21 | + | } | |
| 22 | + | ZwpVirtualKeyboardV1Interface.Events = []server.Message{} | |
| 23 | + | ZwpVirtualKeyboardManagerV1Interface.Requests = []server.Message{ | |
| 24 | + | {Name: "create_virtual_keyboard", Signature: "on", Types: []*server.Interface{wayland.SeatInterface, ZwpVirtualKeyboardV1Interface}}, | |
| 25 | + | } | |
| 26 | + | ZwpVirtualKeyboardManagerV1Interface.Events = []server.Message{} | |
| 27 | + | if err := server.NewInterfaces(ZwpVirtualKeyboardV1Interface, ZwpVirtualKeyboardManagerV1Interface); err != nil { | |
| 28 | + | panic(err) | |
| 29 | + | } | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | // ZwpVirtualKeyboardV1 virtual keyboard. | |
| 33 | + | type ZwpVirtualKeyboardV1 struct{ *server.Resource } | |
| 34 | + | ||
| 35 | + | func WrapZwpVirtualKeyboardV1(r *server.Resource) *ZwpVirtualKeyboardV1 { | |
| 36 | + | if r == nil { | |
| 37 | + | return nil | |
| 38 | + | } | |
| 39 | + | return &ZwpVirtualKeyboardV1{r} | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | const ZwpVirtualKeyboardV1RequestKeymap uint32 = 0 | |
| 43 | + | const ZwpVirtualKeyboardV1RequestKey uint32 = 1 | |
| 44 | + | const ZwpVirtualKeyboardV1RequestModifiers uint32 = 2 | |
| 45 | + | const ZwpVirtualKeyboardV1RequestDestroy uint32 = 3 | |
| 46 | + | ||
| 47 | + | // ZwpVirtualKeyboardV1Error . | |
| 48 | + | type ZwpVirtualKeyboardV1Error uint32 | |
| 49 | + | ||
| 50 | + | const ( | |
| 51 | + | ZwpVirtualKeyboardV1ErrorNoKeymap ZwpVirtualKeyboardV1Error = 0 | |
| 52 | + | ) | |
| 53 | + | ||
| 54 | + | // ZwpVirtualKeyboardV1Handler handles zwp_virtual_keyboard_v1 requests. | |
| 55 | + | type ZwpVirtualKeyboardV1Handler interface { | |
| 56 | + | Keymap(self *ZwpVirtualKeyboardV1, format uint32, fd int, size uint32) | |
| 57 | + | Key(self *ZwpVirtualKeyboardV1, time uint32, key uint32, state uint32) | |
| 58 | + | Modifiers(self *ZwpVirtualKeyboardV1, modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32) | |
| 59 | + | Destroy(self *ZwpVirtualKeyboardV1) | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | func NewZwpVirtualKeyboardV1(c server.Client, version int32, id uint32, h ZwpVirtualKeyboardV1Handler) (*ZwpVirtualKeyboardV1, error) { | |
| 63 | + | if h == nil { | |
| 64 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_virtual_keyboard_v1") | |
| 65 | + | } | |
| 66 | + | var self *ZwpVirtualKeyboardV1 | |
| 67 | + | r, err := c.CreateResource(ZwpVirtualKeyboardV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 68 | + | switch opcode { | |
| 69 | + | case 0: | |
| 70 | + | h.Keymap(self, args[0].Uint(), args[1].Fd(), args[2].Uint()) | |
| 71 | + | case 1: | |
| 72 | + | h.Key(self, args[0].Uint(), args[1].Uint(), args[2].Uint()) | |
| 73 | + | case 2: | |
| 74 | + | h.Modifiers(self, args[0].Uint(), args[1].Uint(), args[2].Uint(), args[3].Uint()) | |
| 75 | + | case 3: | |
| 76 | + | h.Destroy(self) | |
| 77 | + | self.Destroy() | |
| 78 | + | } | |
| 79 | + | }) | |
| 80 | + | if err != nil { | |
| 81 | + | return nil, err | |
| 82 | + | } | |
| 83 | + | self = WrapZwpVirtualKeyboardV1(r) | |
| 84 | + | r.Data = self | |
| 85 | + | return self, nil | |
| 86 | + | } | |
| 87 | + | func NewZwpVirtualKeyboardV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 88 | + | return d.CreateGlobal(ZwpVirtualKeyboardV1Interface, version, bind) | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // ZwpVirtualKeyboardManagerV1 virtual keyboard manager. | |
| 92 | + | type ZwpVirtualKeyboardManagerV1 struct{ *server.Resource } | |
| 93 | + | ||
| 94 | + | func WrapZwpVirtualKeyboardManagerV1(r *server.Resource) *ZwpVirtualKeyboardManagerV1 { | |
| 95 | + | if r == nil { | |
| 96 | + | return nil | |
| 97 | + | } | |
| 98 | + | return &ZwpVirtualKeyboardManagerV1{r} | |
| 99 | + | } | |
| 100 | + | ||
| 101 | + | const ZwpVirtualKeyboardManagerV1RequestCreateVirtualKeyboard uint32 = 0 | |
| 102 | + | ||
| 103 | + | // ZwpVirtualKeyboardManagerV1Error . | |
| 104 | + | type ZwpVirtualKeyboardManagerV1Error uint32 | |
| 105 | + | ||
| 106 | + | const ( | |
| 107 | + | ZwpVirtualKeyboardManagerV1ErrorUnauthorized ZwpVirtualKeyboardManagerV1Error = 0 | |
| 108 | + | ) | |
| 109 | + | ||
| 110 | + | // ZwpVirtualKeyboardManagerV1Handler handles zwp_virtual_keyboard_manager_v1 requests. | |
| 111 | + | type ZwpVirtualKeyboardManagerV1Handler interface { | |
| 112 | + | CreateVirtualKeyboard(self *ZwpVirtualKeyboardManagerV1, seat *wayland.Seat, id uint32) | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | func NewZwpVirtualKeyboardManagerV1(c server.Client, version int32, id uint32, h ZwpVirtualKeyboardManagerV1Handler) (*ZwpVirtualKeyboardManagerV1, error) { | |
| 116 | + | if h == nil { | |
| 117 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_virtual_keyboard_manager_v1") | |
| 118 | + | } | |
| 119 | + | var self *ZwpVirtualKeyboardManagerV1 | |
| 120 | + | r, err := c.CreateResource(ZwpVirtualKeyboardManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 121 | + | switch opcode { | |
| 122 | + | case 0: | |
| 123 | + | h.CreateVirtualKeyboard(self, wayland.WrapSeat(args[0].Resource()), args[1].NewID()) | |
| 124 | + | } | |
| 125 | + | }) | |
| 126 | + | if err != nil { | |
| 127 | + | return nil, err | |
| 128 | + | } | |
| 129 | + | self = WrapZwpVirtualKeyboardManagerV1(r) | |
| 130 | + | r.Data = self | |
| 131 | + | return self, nil | |
| 132 | + | } | |
| 133 | + | func NewZwpVirtualKeyboardManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 134 | + | return d.CreateGlobal(ZwpVirtualKeyboardManagerV1Interface, version, bind) | |
| 135 | + | } | |
| 136 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |
| 137 | + | if v == nil { | |
| 138 | + | return nil | |
| 139 | + | } | |
| 140 | + | return v.GetResource() | |
| 141 | + | } | |
| 142 | + | func (self *ZwpVirtualKeyboardV1) GetResource() *server.Resource { | |
| 143 | + | if self == nil { | |
| 144 | + | return nil | |
| 145 | + | } | |
| 146 | + | return self.Resource | |
| 147 | + | } | |
| 148 | + | func (self *ZwpVirtualKeyboardManagerV1) GetResource() *server.Resource { | |
| 149 | + | if self == nil { | |
| 150 | + | return nil | |
| 151 | + | } | |
| 152 | + | return self.Resource | |
| 153 | + | } | |
| @@ -0,0 +1,153 @@ | |||||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |||
| 2 | + | package virtualkeyboard | |||
| 3 | + | ||||
| 4 | + | import ( | |||
| 5 | + | "fmt" | |||
| 6 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |||
| 7 | + | "github.com/bnema/purego-libwayland/server" | |||
| 8 | + | ) | |||
| 9 | + | ||||
| 10 | + | var ZwpVirtualKeyboardV1Interface *server.Interface | |||
| 11 | + | var ZwpVirtualKeyboardManagerV1Interface *server.Interface | |||
| 12 | + | ||||
| 13 | + | func init() { | |||
| 14 | + | ZwpVirtualKeyboardV1Interface = &server.Interface{Name: "zwp_virtual_keyboard_v1", Version: 1} | |||
| 15 | + | ZwpVirtualKeyboardManagerV1Interface = &server.Interface{Name: "zwp_virtual_keyboard_manager_v1", Version: 1} | |||
| 16 | + | ZwpVirtualKeyboardV1Interface.Requests = []server.Message{ | |||
| 17 | + | {Name: "keymap", Signature: "uhu", Types: []*server.Interface{nil, nil, nil}}, | |||
| 18 | + | {Name: "key", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |||
| 19 | + | {Name: "modifiers", Signature: "uuuu", Types: []*server.Interface{nil, nil, nil, nil}}, | |||
| 20 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 21 | + | } | |||
| 22 | + | ZwpVirtualKeyboardV1Interface.Events = []server.Message{} | |||
| 23 | + | ZwpVirtualKeyboardManagerV1Interface.Requests = []server.Message{ | |||
| 24 | + | {Name: "create_virtual_keyboard", Signature: "on", Types: []*server.Interface{wayland.SeatInterface, ZwpVirtualKeyboardV1Interface}}, | |||
| 25 | + | } | |||
| 26 | + | ZwpVirtualKeyboardManagerV1Interface.Events = []server.Message{} | |||
| 27 | + | if err := server.NewInterfaces(ZwpVirtualKeyboardV1Interface, ZwpVirtualKeyboardManagerV1Interface); err != nil { | |||
| 28 | + | panic(err) | |||
| 29 | + | } | |||
| 30 | + | } | |||
| 31 | + | ||||
| 32 | + | // ZwpVirtualKeyboardV1 virtual keyboard. | |||
| 33 | + | type ZwpVirtualKeyboardV1 struct{ *server.Resource } | |||
| 34 | + | ||||
| 35 | + | func WrapZwpVirtualKeyboardV1(r *server.Resource) *ZwpVirtualKeyboardV1 { | |||
| 36 | + | if r == nil { | |||
| 37 | + | return nil | |||
| 38 | + | } | |||
| 39 | + | return &ZwpVirtualKeyboardV1{r} | |||
| 40 | + | } | |||
| 41 | + | ||||
| 42 | + | const ZwpVirtualKeyboardV1RequestKeymap uint32 = 0 | |||
| 43 | + | const ZwpVirtualKeyboardV1RequestKey uint32 = 1 | |||
| 44 | + | const ZwpVirtualKeyboardV1RequestModifiers uint32 = 2 | |||
| 45 | + | const ZwpVirtualKeyboardV1RequestDestroy uint32 = 3 | |||
| 46 | + | ||||
| 47 | + | // ZwpVirtualKeyboardV1Error . | |||
| 48 | + | type ZwpVirtualKeyboardV1Error uint32 | |||
| 49 | + | ||||
| 50 | + | const ( | |||
| 51 | + | ZwpVirtualKeyboardV1ErrorNoKeymap ZwpVirtualKeyboardV1Error = 0 | |||
| 52 | + | ) | |||
| 53 | + | ||||
| 54 | + | // ZwpVirtualKeyboardV1Handler handles zwp_virtual_keyboard_v1 requests. | |||
| 55 | + | type ZwpVirtualKeyboardV1Handler interface { | |||
| 56 | + | Keymap(self *ZwpVirtualKeyboardV1, format uint32, fd int, size uint32) | |||
| 57 | + | Key(self *ZwpVirtualKeyboardV1, time uint32, key uint32, state uint32) | |||
| 58 | + | Modifiers(self *ZwpVirtualKeyboardV1, modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32) | |||
| 59 | + | Destroy(self *ZwpVirtualKeyboardV1) | |||
| 60 | + | } | |||
| 61 | + | ||||
| 62 | + | func NewZwpVirtualKeyboardV1(c server.Client, version int32, id uint32, h ZwpVirtualKeyboardV1Handler) (*ZwpVirtualKeyboardV1, error) { | |||
| 63 | + | if h == nil { | |||
| 64 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_virtual_keyboard_v1") | |||
| 65 | + | } | |||
| 66 | + | var self *ZwpVirtualKeyboardV1 | |||
| 67 | + | r, err := c.CreateResource(ZwpVirtualKeyboardV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 68 | + | switch opcode { | |||
| 69 | + | case 0: | |||
| 70 | + | h.Keymap(self, args[0].Uint(), args[1].Fd(), args[2].Uint()) | |||
| 71 | + | case 1: | |||
| 72 | + | h.Key(self, args[0].Uint(), args[1].Uint(), args[2].Uint()) | |||
| 73 | + | case 2: | |||
| 74 | + | h.Modifiers(self, args[0].Uint(), args[1].Uint(), args[2].Uint(), args[3].Uint()) | |||
| 75 | + | case 3: | |||
| 76 | + | h.Destroy(self) | |||
| 77 | + | self.Destroy() | |||
| 78 | + | } | |||
| 79 | + | }) | |||
| 80 | + | if err != nil { | |||
| 81 | + | return nil, err | |||
| 82 | + | } | |||
| 83 | + | self = WrapZwpVirtualKeyboardV1(r) | |||
| 84 | + | r.Data = self | |||
| 85 | + | return self, nil | |||
| 86 | + | } | |||
| 87 | + | func NewZwpVirtualKeyboardV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 88 | + | return d.CreateGlobal(ZwpVirtualKeyboardV1Interface, version, bind) | |||
| 89 | + | } | |||
| 90 | + | ||||
| 91 | + | // ZwpVirtualKeyboardManagerV1 virtual keyboard manager. | |||
| 92 | + | type ZwpVirtualKeyboardManagerV1 struct{ *server.Resource } | |||
| 93 | + | ||||
| 94 | + | func WrapZwpVirtualKeyboardManagerV1(r *server.Resource) *ZwpVirtualKeyboardManagerV1 { | |||
| 95 | + | if r == nil { | |||
| 96 | + | return nil | |||
| 97 | + | } | |||
| 98 | + | return &ZwpVirtualKeyboardManagerV1{r} | |||
| 99 | + | } | |||
| 100 | + | ||||
| 101 | + | const ZwpVirtualKeyboardManagerV1RequestCreateVirtualKeyboard uint32 = 0 | |||
| 102 | + | ||||
| 103 | + | // ZwpVirtualKeyboardManagerV1Error . | |||
| 104 | + | type ZwpVirtualKeyboardManagerV1Error uint32 | |||
| 105 | + | ||||
| 106 | + | const ( | |||
| 107 | + | ZwpVirtualKeyboardManagerV1ErrorUnauthorized ZwpVirtualKeyboardManagerV1Error = 0 | |||
| 108 | + | ) | |||
| 109 | + | ||||
| 110 | + | // ZwpVirtualKeyboardManagerV1Handler handles zwp_virtual_keyboard_manager_v1 requests. | |||
| 111 | + | type ZwpVirtualKeyboardManagerV1Handler interface { | |||
| 112 | + | CreateVirtualKeyboard(self *ZwpVirtualKeyboardManagerV1, seat *wayland.Seat, id uint32) | |||
| 113 | + | } | |||
| 114 | + | ||||
| 115 | + | func NewZwpVirtualKeyboardManagerV1(c server.Client, version int32, id uint32, h ZwpVirtualKeyboardManagerV1Handler) (*ZwpVirtualKeyboardManagerV1, error) { | |||
| 116 | + | if h == nil { | |||
| 117 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_virtual_keyboard_manager_v1") | |||
| 118 | + | } | |||
| 119 | + | var self *ZwpVirtualKeyboardManagerV1 | |||
| 120 | + | r, err := c.CreateResource(ZwpVirtualKeyboardManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 121 | + | switch opcode { | |||
| 122 | + | case 0: | |||
| 123 | + | h.CreateVirtualKeyboard(self, wayland.WrapSeat(args[0].Resource()), args[1].NewID()) | |||
| 124 | + | } | |||
| 125 | + | }) | |||
| 126 | + | if err != nil { | |||
| 127 | + | return nil, err | |||
| 128 | + | } | |||
| 129 | + | self = WrapZwpVirtualKeyboardManagerV1(r) | |||
| 130 | + | r.Data = self | |||
| 131 | + | return self, nil | |||
| 132 | + | } | |||
| 133 | + | func NewZwpVirtualKeyboardManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 134 | + | return d.CreateGlobal(ZwpVirtualKeyboardManagerV1Interface, version, bind) | |||
| 135 | + | } | |||
| 136 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |||
| 137 | + | if v == nil { | |||
| 138 | + | return nil | |||
| 139 | + | } | |||
| 140 | + | return v.GetResource() | |||
| 141 | + | } | |||
| 142 | + | func (self *ZwpVirtualKeyboardV1) GetResource() *server.Resource { | |||
| 143 | + | if self == nil { | |||
| 144 | + | return nil | |||
| 145 | + | } | |||
| 146 | + | return self.Resource | |||
| 147 | + | } | |||
| 148 | + | func (self *ZwpVirtualKeyboardManagerV1) GetResource() *server.Resource { | |||
| 149 | + | if self == nil { | |||
| 150 | + | return nil | |||
| 151 | + | } | |||
| 152 | + | return self.Resource | |||
| 153 | + | } | |||
A protocols/virtual-keyboard-unstable-v1.xml +113 -0
| @@ -0,0 +1,113 @@ | |||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + | <protocol name="virtual_keyboard_unstable_v1"> | |
| 3 | + | <copyright> | |
| 4 | + | Copyright © 2008-2011 Kristian Høgsberg | |
| 5 | + | Copyright © 2010-2013 Intel Corporation | |
| 6 | + | Copyright © 2012-2013 Collabora, Ltd. | |
| 7 | + | Copyright © 2018 Purism SPC | |
| 8 | + | ||
| 9 | + | Permission is hereby granted, free of charge, to any person obtaining a | |
| 10 | + | copy of this software and associated documentation files (the "Software"), | |
| 11 | + | to deal in the Software without restriction, including without limitation | |
| 12 | + | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| 13 | + | and/or sell copies of the Software, and to permit persons to whom the | |
| 14 | + | Software is furnished to do so, subject to the following conditions: | |
| 15 | + | ||
| 16 | + | The above copyright notice and this permission notice (including the next | |
| 17 | + | paragraph) shall be included in all copies or substantial portions of the | |
| 18 | + | Software. | |
| 19 | + | ||
| 20 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 21 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 22 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
| 23 | + | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 24 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
| 25 | + | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
| 26 | + | DEALINGS IN THE SOFTWARE. | |
| 27 | + | </copyright> | |
| 28 | + | ||
| 29 | + | <interface name="zwp_virtual_keyboard_v1" version="1"> | |
| 30 | + | <description summary="virtual keyboard"> | |
| 31 | + | The virtual keyboard provides an application with requests which emulate | |
| 32 | + | the behaviour of a physical keyboard. | |
| 33 | + | ||
| 34 | + | This interface can be used by clients on its own to provide raw input | |
| 35 | + | events, or it can accompany the input method protocol. | |
| 36 | + | </description> | |
| 37 | + | ||
| 38 | + | <request name="keymap"> | |
| 39 | + | <description summary="keyboard mapping"> | |
| 40 | + | Provide a file descriptor to the compositor which can be | |
| 41 | + | memory-mapped to provide a keyboard mapping description. | |
| 42 | + | ||
| 43 | + | Format carries a value from the keymap_format enumeration. | |
| 44 | + | </description> | |
| 45 | + | <arg name="format" type="uint" summary="keymap format"/> | |
| 46 | + | <arg name="fd" type="fd" summary="keymap file descriptor"/> | |
| 47 | + | <arg name="size" type="uint" summary="keymap size, in bytes"/> | |
| 48 | + | </request> | |
| 49 | + | ||
| 50 | + | <enum name="error"> | |
| 51 | + | <entry name="no_keymap" value="0" summary="No keymap was set"/> | |
| 52 | + | </enum> | |
| 53 | + | ||
| 54 | + | <request name="key"> | |
| 55 | + | <description summary="key event"> | |
| 56 | + | A key was pressed or released. | |
| 57 | + | The time argument is a timestamp with millisecond granularity, with an | |
| 58 | + | undefined base. All requests regarding a single object must share the | |
| 59 | + | same clock. | |
| 60 | + | ||
| 61 | + | Keymap must be set before issuing this request. | |
| 62 | + | ||
| 63 | + | State carries a value from the key_state enumeration. | |
| 64 | + | </description> | |
| 65 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |
| 66 | + | <arg name="key" type="uint" summary="key that produced the event"/> | |
| 67 | + | <arg name="state" type="uint" summary="physical state of the key"/> | |
| 68 | + | </request> | |
| 69 | + | ||
| 70 | + | <request name="modifiers"> | |
| 71 | + | <description summary="modifier and group state"> | |
| 72 | + | Notifies the compositor that the modifier and/or group state has | |
| 73 | + | changed, and it should update state. | |
| 74 | + | ||
| 75 | + | The client should use wl_keyboard.modifiers event to synchronize its | |
| 76 | + | internal state with seat state. | |
| 77 | + | ||
| 78 | + | Keymap must be set before issuing this request. | |
| 79 | + | </description> | |
| 80 | + | <arg name="mods_depressed" type="uint" summary="depressed modifiers"/> | |
| 81 | + | <arg name="mods_latched" type="uint" summary="latched modifiers"/> | |
| 82 | + | <arg name="mods_locked" type="uint" summary="locked modifiers"/> | |
| 83 | + | <arg name="group" type="uint" summary="keyboard layout"/> | |
| 84 | + | </request> | |
| 85 | + | ||
| 86 | + | <request name="destroy" type="destructor" since="1"> | |
| 87 | + | <description summary="destroy the virtual keyboard keyboard object"/> | |
| 88 | + | </request> | |
| 89 | + | </interface> | |
| 90 | + | ||
| 91 | + | <interface name="zwp_virtual_keyboard_manager_v1" version="1"> | |
| 92 | + | <description summary="virtual keyboard manager"> | |
| 93 | + | A virtual keyboard manager allows an application to provide keyboard | |
| 94 | + | input events as if they came from a physical keyboard. | |
| 95 | + | </description> | |
| 96 | + | ||
| 97 | + | <enum name="error"> | |
| 98 | + | <entry name="unauthorized" value="0" summary="client not authorized to use the interface"/> | |
| 99 | + | </enum> | |
| 100 | + | ||
| 101 | + | <request name="create_virtual_keyboard"> | |
| 102 | + | <description summary="Create a new virtual keyboard"> | |
| 103 | + | Creates a new virtual keyboard associated to a seat. | |
| 104 | + | ||
| 105 | + | If the compositor enables a keyboard to perform arbitrary actions, it | |
| 106 | + | should present an error when an untrusted client requests a new | |
| 107 | + | keyboard. | |
| 108 | + | </description> | |
| 109 | + | <arg name="seat" type="object" interface="wl_seat"/> | |
| 110 | + | <arg name="id" type="new_id" interface="zwp_virtual_keyboard_v1"/> | |
| 111 | + | </request> | |
| 112 | + | </interface> | |
| 113 | + | </protocol> | |
| @@ -0,0 +1,113 @@ | |||||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |||
| 2 | + | <protocol name="virtual_keyboard_unstable_v1"> | |||
| 3 | + | <copyright> | |||
| 4 | + | Copyright © 2008-2011 Kristian Høgsberg | |||
| 5 | + | Copyright © 2010-2013 Intel Corporation | |||
| 6 | + | Copyright © 2012-2013 Collabora, Ltd. | |||
| 7 | + | Copyright © 2018 Purism SPC | |||
| 8 | + | ||||
| 9 | + | Permission is hereby granted, free of charge, to any person obtaining a | |||
| 10 | + | copy of this software and associated documentation files (the "Software"), | |||
| 11 | + | to deal in the Software without restriction, including without limitation | |||
| 12 | + | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
| 13 | + | and/or sell copies of the Software, and to permit persons to whom the | |||
| 14 | + | Software is furnished to do so, subject to the following conditions: | |||
| 15 | + | ||||
| 16 | + | The above copyright notice and this permission notice (including the next | |||
| 17 | + | paragraph) shall be included in all copies or substantial portions of the | |||
| 18 | + | Software. | |||
| 19 | + | ||||
| 20 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| 21 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| 22 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
| 23 | + | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| 24 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |||
| 25 | + | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
| 26 | + | DEALINGS IN THE SOFTWARE. | |||
| 27 | + | </copyright> | |||
| 28 | + | ||||
| 29 | + | <interface name="zwp_virtual_keyboard_v1" version="1"> | |||
| 30 | + | <description summary="virtual keyboard"> | |||
| 31 | + | The virtual keyboard provides an application with requests which emulate | |||
| 32 | + | the behaviour of a physical keyboard. | |||
| 33 | + | ||||
| 34 | + | This interface can be used by clients on its own to provide raw input | |||
| 35 | + | events, or it can accompany the input method protocol. | |||
| 36 | + | </description> | |||
| 37 | + | ||||
| 38 | + | <request name="keymap"> | |||
| 39 | + | <description summary="keyboard mapping"> | |||
| 40 | + | Provide a file descriptor to the compositor which can be | |||
| 41 | + | memory-mapped to provide a keyboard mapping description. | |||
| 42 | + | ||||
| 43 | + | Format carries a value from the keymap_format enumeration. | |||
| 44 | + | </description> | |||
| 45 | + | <arg name="format" type="uint" summary="keymap format"/> | |||
| 46 | + | <arg name="fd" type="fd" summary="keymap file descriptor"/> | |||
| 47 | + | <arg name="size" type="uint" summary="keymap size, in bytes"/> | |||
| 48 | + | </request> | |||
| 49 | + | ||||
| 50 | + | <enum name="error"> | |||
| 51 | + | <entry name="no_keymap" value="0" summary="No keymap was set"/> | |||
| 52 | + | </enum> | |||
| 53 | + | ||||
| 54 | + | <request name="key"> | |||
| 55 | + | <description summary="key event"> | |||
| 56 | + | A key was pressed or released. | |||
| 57 | + | The time argument is a timestamp with millisecond granularity, with an | |||
| 58 | + | undefined base. All requests regarding a single object must share the | |||
| 59 | + | same clock. | |||
| 60 | + | ||||
| 61 | + | Keymap must be set before issuing this request. | |||
| 62 | + | ||||
| 63 | + | State carries a value from the key_state enumeration. | |||
| 64 | + | </description> | |||
| 65 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |||
| 66 | + | <arg name="key" type="uint" summary="key that produced the event"/> | |||
| 67 | + | <arg name="state" type="uint" summary="physical state of the key"/> | |||
| 68 | + | </request> | |||
| 69 | + | ||||
| 70 | + | <request name="modifiers"> | |||
| 71 | + | <description summary="modifier and group state"> | |||
| 72 | + | Notifies the compositor that the modifier and/or group state has | |||
| 73 | + | changed, and it should update state. | |||
| 74 | + | ||||
| 75 | + | The client should use wl_keyboard.modifiers event to synchronize its | |||
| 76 | + | internal state with seat state. | |||
| 77 | + | ||||
| 78 | + | Keymap must be set before issuing this request. | |||
| 79 | + | </description> | |||
| 80 | + | <arg name="mods_depressed" type="uint" summary="depressed modifiers"/> | |||
| 81 | + | <arg name="mods_latched" type="uint" summary="latched modifiers"/> | |||
| 82 | + | <arg name="mods_locked" type="uint" summary="locked modifiers"/> | |||
| 83 | + | <arg name="group" type="uint" summary="keyboard layout"/> | |||
| 84 | + | </request> | |||
| 85 | + | ||||
| 86 | + | <request name="destroy" type="destructor" since="1"> | |||
| 87 | + | <description summary="destroy the virtual keyboard keyboard object"/> | |||
| 88 | + | </request> | |||
| 89 | + | </interface> | |||
| 90 | + | ||||
| 91 | + | <interface name="zwp_virtual_keyboard_manager_v1" version="1"> | |||
| 92 | + | <description summary="virtual keyboard manager"> | |||
| 93 | + | A virtual keyboard manager allows an application to provide keyboard | |||
| 94 | + | input events as if they came from a physical keyboard. | |||
| 95 | + | </description> | |||
| 96 | + | ||||
| 97 | + | <enum name="error"> | |||
| 98 | + | <entry name="unauthorized" value="0" summary="client not authorized to use the interface"/> | |||
| 99 | + | </enum> | |||
| 100 | + | ||||
| 101 | + | <request name="create_virtual_keyboard"> | |||
| 102 | + | <description summary="Create a new virtual keyboard"> | |||
| 103 | + | Creates a new virtual keyboard associated to a seat. | |||
| 104 | + | ||||
| 105 | + | If the compositor enables a keyboard to perform arbitrary actions, it | |||
| 106 | + | should present an error when an untrusted client requests a new | |||
| 107 | + | keyboard. | |||
| 108 | + | </description> | |||
| 109 | + | <arg name="seat" type="object" interface="wl_seat"/> | |||
| 110 | + | <arg name="id" type="new_id" interface="zwp_virtual_keyboard_v1"/> | |||
| 111 | + | </request> | |||
| 112 | + | </interface> | |||
| 113 | + | </protocol> | |||