merge: cursor-shape-v1 bindings
5 files · +2632 -0
A protocol/cursorshape/cursorshape.go +190 -0
| @@ -0,0 +1,190 @@ | |||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |
| 2 | + | package cursorshape | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "fmt" | |
| 6 | + | tabletv2 "github.com/bnema/purego-libwayland/protocol/tabletv2" | |
| 7 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |
| 8 | + | "github.com/bnema/purego-libwayland/server" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | var WpCursorShapeManagerV1Interface *server.Interface | |
| 12 | + | var WpCursorShapeDeviceV1Interface *server.Interface | |
| 13 | + | ||
| 14 | + | func init() { | |
| 15 | + | WpCursorShapeManagerV1Interface = &server.Interface{Name: "wp_cursor_shape_manager_v1", Version: 2} | |
| 16 | + | WpCursorShapeDeviceV1Interface = &server.Interface{Name: "wp_cursor_shape_device_v1", Version: 2} | |
| 17 | + | WpCursorShapeManagerV1Interface.Requests = []server.Message{ | |
| 18 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 19 | + | {Name: "get_pointer", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, wayland.PointerInterface}}, | |
| 20 | + | {Name: "get_tablet_tool_v2", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, tabletv2.ZwpTabletToolV2Interface}}, | |
| 21 | + | } | |
| 22 | + | WpCursorShapeManagerV1Interface.Events = []server.Message{} | |
| 23 | + | WpCursorShapeDeviceV1Interface.Requests = []server.Message{ | |
| 24 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 25 | + | {Name: "set_shape", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |
| 26 | + | } | |
| 27 | + | WpCursorShapeDeviceV1Interface.Events = []server.Message{} | |
| 28 | + | if err := server.NewInterfaces(WpCursorShapeManagerV1Interface, WpCursorShapeDeviceV1Interface); err != nil { | |
| 29 | + | panic(err) | |
| 30 | + | } | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | // WpCursorShapeManagerV1 cursor shape manager. | |
| 34 | + | type WpCursorShapeManagerV1 struct{ *server.Resource } | |
| 35 | + | ||
| 36 | + | func WrapWpCursorShapeManagerV1(r *server.Resource) *WpCursorShapeManagerV1 { | |
| 37 | + | if r == nil { | |
| 38 | + | return nil | |
| 39 | + | } | |
| 40 | + | return &WpCursorShapeManagerV1{r} | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | const WpCursorShapeManagerV1RequestDestroy uint32 = 0 | |
| 44 | + | const WpCursorShapeManagerV1RequestGetPointer uint32 = 1 | |
| 45 | + | const WpCursorShapeManagerV1RequestGetTabletToolV2 uint32 = 2 | |
| 46 | + | ||
| 47 | + | // WpCursorShapeManagerV1Handler handles wp_cursor_shape_manager_v1 requests. | |
| 48 | + | type WpCursorShapeManagerV1Handler interface { | |
| 49 | + | Destroy(self *WpCursorShapeManagerV1) | |
| 50 | + | GetPointer(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, pointer *wayland.Pointer) | |
| 51 | + | GetTabletToolV2(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, tabletTool *tabletv2.ZwpTabletToolV2) | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | func NewWpCursorShapeManagerV1(c server.Client, version int32, id uint32, h WpCursorShapeManagerV1Handler) (*WpCursorShapeManagerV1, error) { | |
| 55 | + | if h == nil { | |
| 56 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_manager_v1") | |
| 57 | + | } | |
| 58 | + | var self *WpCursorShapeManagerV1 | |
| 59 | + | r, err := c.CreateResource(WpCursorShapeManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 60 | + | switch opcode { | |
| 61 | + | case 0: | |
| 62 | + | h.Destroy(self) | |
| 63 | + | self.Destroy() | |
| 64 | + | case 1: | |
| 65 | + | h.GetPointer(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource())) | |
| 66 | + | case 2: | |
| 67 | + | h.GetTabletToolV2(self, args[0].NewID(), tabletv2.WrapZwpTabletToolV2(args[1].Resource())) | |
| 68 | + | } | |
| 69 | + | }) | |
| 70 | + | if err != nil { | |
| 71 | + | return nil, err | |
| 72 | + | } | |
| 73 | + | self = WrapWpCursorShapeManagerV1(r) | |
| 74 | + | r.Data = self | |
| 75 | + | return self, nil | |
| 76 | + | } | |
| 77 | + | func NewWpCursorShapeManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 78 | + | return d.CreateGlobal(WpCursorShapeManagerV1Interface, version, bind) | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // WpCursorShapeDeviceV1 cursor shape for a device. | |
| 82 | + | type WpCursorShapeDeviceV1 struct{ *server.Resource } | |
| 83 | + | ||
| 84 | + | func WrapWpCursorShapeDeviceV1(r *server.Resource) *WpCursorShapeDeviceV1 { | |
| 85 | + | if r == nil { | |
| 86 | + | return nil | |
| 87 | + | } | |
| 88 | + | return &WpCursorShapeDeviceV1{r} | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | const WpCursorShapeDeviceV1RequestDestroy uint32 = 0 | |
| 92 | + | const WpCursorShapeDeviceV1RequestSetShape uint32 = 1 | |
| 93 | + | ||
| 94 | + | // WpCursorShapeDeviceV1Shape cursor shapes. | |
| 95 | + | type WpCursorShapeDeviceV1Shape uint32 | |
| 96 | + | ||
| 97 | + | const ( | |
| 98 | + | WpCursorShapeDeviceV1ShapeDefault WpCursorShapeDeviceV1Shape = 1 | |
| 99 | + | WpCursorShapeDeviceV1ShapeContextMenu WpCursorShapeDeviceV1Shape = 2 | |
| 100 | + | WpCursorShapeDeviceV1ShapeHelp WpCursorShapeDeviceV1Shape = 3 | |
| 101 | + | WpCursorShapeDeviceV1ShapePointer WpCursorShapeDeviceV1Shape = 4 | |
| 102 | + | WpCursorShapeDeviceV1ShapeProgress WpCursorShapeDeviceV1Shape = 5 | |
| 103 | + | WpCursorShapeDeviceV1ShapeWait WpCursorShapeDeviceV1Shape = 6 | |
| 104 | + | WpCursorShapeDeviceV1ShapeCell WpCursorShapeDeviceV1Shape = 7 | |
| 105 | + | WpCursorShapeDeviceV1ShapeCrosshair WpCursorShapeDeviceV1Shape = 8 | |
| 106 | + | WpCursorShapeDeviceV1ShapeText WpCursorShapeDeviceV1Shape = 9 | |
| 107 | + | WpCursorShapeDeviceV1ShapeVerticalText WpCursorShapeDeviceV1Shape = 10 | |
| 108 | + | WpCursorShapeDeviceV1ShapeAlias WpCursorShapeDeviceV1Shape = 11 | |
| 109 | + | WpCursorShapeDeviceV1ShapeCopy WpCursorShapeDeviceV1Shape = 12 | |
| 110 | + | WpCursorShapeDeviceV1ShapeMove WpCursorShapeDeviceV1Shape = 13 | |
| 111 | + | WpCursorShapeDeviceV1ShapeNoDrop WpCursorShapeDeviceV1Shape = 14 | |
| 112 | + | WpCursorShapeDeviceV1ShapeNotAllowed WpCursorShapeDeviceV1Shape = 15 | |
| 113 | + | WpCursorShapeDeviceV1ShapeGrab WpCursorShapeDeviceV1Shape = 16 | |
| 114 | + | WpCursorShapeDeviceV1ShapeGrabbing WpCursorShapeDeviceV1Shape = 17 | |
| 115 | + | WpCursorShapeDeviceV1ShapeEResize WpCursorShapeDeviceV1Shape = 18 | |
| 116 | + | WpCursorShapeDeviceV1ShapeNResize WpCursorShapeDeviceV1Shape = 19 | |
| 117 | + | WpCursorShapeDeviceV1ShapeNeResize WpCursorShapeDeviceV1Shape = 20 | |
| 118 | + | WpCursorShapeDeviceV1ShapeNwResize WpCursorShapeDeviceV1Shape = 21 | |
| 119 | + | WpCursorShapeDeviceV1ShapeSResize WpCursorShapeDeviceV1Shape = 22 | |
| 120 | + | WpCursorShapeDeviceV1ShapeSeResize WpCursorShapeDeviceV1Shape = 23 | |
| 121 | + | WpCursorShapeDeviceV1ShapeSwResize WpCursorShapeDeviceV1Shape = 24 | |
| 122 | + | WpCursorShapeDeviceV1ShapeWResize WpCursorShapeDeviceV1Shape = 25 | |
| 123 | + | WpCursorShapeDeviceV1ShapeEwResize WpCursorShapeDeviceV1Shape = 26 | |
| 124 | + | WpCursorShapeDeviceV1ShapeNsResize WpCursorShapeDeviceV1Shape = 27 | |
| 125 | + | WpCursorShapeDeviceV1ShapeNeswResize WpCursorShapeDeviceV1Shape = 28 | |
| 126 | + | WpCursorShapeDeviceV1ShapeNwseResize WpCursorShapeDeviceV1Shape = 29 | |
| 127 | + | WpCursorShapeDeviceV1ShapeColResize WpCursorShapeDeviceV1Shape = 30 | |
| 128 | + | WpCursorShapeDeviceV1ShapeRowResize WpCursorShapeDeviceV1Shape = 31 | |
| 129 | + | WpCursorShapeDeviceV1ShapeAllScroll WpCursorShapeDeviceV1Shape = 32 | |
| 130 | + | WpCursorShapeDeviceV1ShapeZoomIn WpCursorShapeDeviceV1Shape = 33 | |
| 131 | + | WpCursorShapeDeviceV1ShapeZoomOut WpCursorShapeDeviceV1Shape = 34 | |
| 132 | + | WpCursorShapeDeviceV1ShapeDndAsk WpCursorShapeDeviceV1Shape = 35 | |
| 133 | + | WpCursorShapeDeviceV1ShapeAllResize WpCursorShapeDeviceV1Shape = 36 | |
| 134 | + | ) | |
| 135 | + | ||
| 136 | + | // WpCursorShapeDeviceV1Error . | |
| 137 | + | type WpCursorShapeDeviceV1Error uint32 | |
| 138 | + | ||
| 139 | + | const ( | |
| 140 | + | WpCursorShapeDeviceV1ErrorInvalidShape WpCursorShapeDeviceV1Error = 1 | |
| 141 | + | ) | |
| 142 | + | ||
| 143 | + | // WpCursorShapeDeviceV1Handler handles wp_cursor_shape_device_v1 requests. | |
| 144 | + | type WpCursorShapeDeviceV1Handler interface { | |
| 145 | + | Destroy(self *WpCursorShapeDeviceV1) | |
| 146 | + | SetShape(self *WpCursorShapeDeviceV1, serial uint32, shape uint32) | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | func NewWpCursorShapeDeviceV1(c server.Client, version int32, id uint32, h WpCursorShapeDeviceV1Handler) (*WpCursorShapeDeviceV1, error) { | |
| 150 | + | if h == nil { | |
| 151 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_device_v1") | |
| 152 | + | } | |
| 153 | + | var self *WpCursorShapeDeviceV1 | |
| 154 | + | r, err := c.CreateResource(WpCursorShapeDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 155 | + | switch opcode { | |
| 156 | + | case 0: | |
| 157 | + | h.Destroy(self) | |
| 158 | + | self.Destroy() | |
| 159 | + | case 1: | |
| 160 | + | h.SetShape(self, args[0].Uint(), args[1].Uint()) | |
| 161 | + | } | |
| 162 | + | }) | |
| 163 | + | if err != nil { | |
| 164 | + | return nil, err | |
| 165 | + | } | |
| 166 | + | self = WrapWpCursorShapeDeviceV1(r) | |
| 167 | + | r.Data = self | |
| 168 | + | return self, nil | |
| 169 | + | } | |
| 170 | + | func NewWpCursorShapeDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 171 | + | return d.CreateGlobal(WpCursorShapeDeviceV1Interface, version, bind) | |
| 172 | + | } | |
| 173 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |
| 174 | + | if v == nil { | |
| 175 | + | return nil | |
| 176 | + | } | |
| 177 | + | return v.GetResource() | |
| 178 | + | } | |
| 179 | + | func (self *WpCursorShapeManagerV1) GetResource() *server.Resource { | |
| 180 | + | if self == nil { | |
| 181 | + | return nil | |
| 182 | + | } | |
| 183 | + | return self.Resource | |
| 184 | + | } | |
| 185 | + | func (self *WpCursorShapeDeviceV1) GetResource() *server.Resource { | |
| 186 | + | if self == nil { | |
| 187 | + | return nil | |
| 188 | + | } | |
| 189 | + | return self.Resource | |
| 190 | + | } | |
| @@ -0,0 +1,190 @@ | |||||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |||
| 2 | + | package cursorshape | |||
| 3 | + | ||||
| 4 | + | import ( | |||
| 5 | + | "fmt" | |||
| 6 | + | tabletv2 "github.com/bnema/purego-libwayland/protocol/tabletv2" | |||
| 7 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |||
| 8 | + | "github.com/bnema/purego-libwayland/server" | |||
| 9 | + | ) | |||
| 10 | + | ||||
| 11 | + | var WpCursorShapeManagerV1Interface *server.Interface | |||
| 12 | + | var WpCursorShapeDeviceV1Interface *server.Interface | |||
| 13 | + | ||||
| 14 | + | func init() { | |||
| 15 | + | WpCursorShapeManagerV1Interface = &server.Interface{Name: "wp_cursor_shape_manager_v1", Version: 2} | |||
| 16 | + | WpCursorShapeDeviceV1Interface = &server.Interface{Name: "wp_cursor_shape_device_v1", Version: 2} | |||
| 17 | + | WpCursorShapeManagerV1Interface.Requests = []server.Message{ | |||
| 18 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 19 | + | {Name: "get_pointer", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, wayland.PointerInterface}}, | |||
| 20 | + | {Name: "get_tablet_tool_v2", Signature: "no", Types: []*server.Interface{WpCursorShapeDeviceV1Interface, tabletv2.ZwpTabletToolV2Interface}}, | |||
| 21 | + | } | |||
| 22 | + | WpCursorShapeManagerV1Interface.Events = []server.Message{} | |||
| 23 | + | WpCursorShapeDeviceV1Interface.Requests = []server.Message{ | |||
| 24 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 25 | + | {Name: "set_shape", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |||
| 26 | + | } | |||
| 27 | + | WpCursorShapeDeviceV1Interface.Events = []server.Message{} | |||
| 28 | + | if err := server.NewInterfaces(WpCursorShapeManagerV1Interface, WpCursorShapeDeviceV1Interface); err != nil { | |||
| 29 | + | panic(err) | |||
| 30 | + | } | |||
| 31 | + | } | |||
| 32 | + | ||||
| 33 | + | // WpCursorShapeManagerV1 cursor shape manager. | |||
| 34 | + | type WpCursorShapeManagerV1 struct{ *server.Resource } | |||
| 35 | + | ||||
| 36 | + | func WrapWpCursorShapeManagerV1(r *server.Resource) *WpCursorShapeManagerV1 { | |||
| 37 | + | if r == nil { | |||
| 38 | + | return nil | |||
| 39 | + | } | |||
| 40 | + | return &WpCursorShapeManagerV1{r} | |||
| 41 | + | } | |||
| 42 | + | ||||
| 43 | + | const WpCursorShapeManagerV1RequestDestroy uint32 = 0 | |||
| 44 | + | const WpCursorShapeManagerV1RequestGetPointer uint32 = 1 | |||
| 45 | + | const WpCursorShapeManagerV1RequestGetTabletToolV2 uint32 = 2 | |||
| 46 | + | ||||
| 47 | + | // WpCursorShapeManagerV1Handler handles wp_cursor_shape_manager_v1 requests. | |||
| 48 | + | type WpCursorShapeManagerV1Handler interface { | |||
| 49 | + | Destroy(self *WpCursorShapeManagerV1) | |||
| 50 | + | GetPointer(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, pointer *wayland.Pointer) | |||
| 51 | + | GetTabletToolV2(self *WpCursorShapeManagerV1, cursorShapeDevice uint32, tabletTool *tabletv2.ZwpTabletToolV2) | |||
| 52 | + | } | |||
| 53 | + | ||||
| 54 | + | func NewWpCursorShapeManagerV1(c server.Client, version int32, id uint32, h WpCursorShapeManagerV1Handler) (*WpCursorShapeManagerV1, error) { | |||
| 55 | + | if h == nil { | |||
| 56 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_manager_v1") | |||
| 57 | + | } | |||
| 58 | + | var self *WpCursorShapeManagerV1 | |||
| 59 | + | r, err := c.CreateResource(WpCursorShapeManagerV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 60 | + | switch opcode { | |||
| 61 | + | case 0: | |||
| 62 | + | h.Destroy(self) | |||
| 63 | + | self.Destroy() | |||
| 64 | + | case 1: | |||
| 65 | + | h.GetPointer(self, args[0].NewID(), wayland.WrapPointer(args[1].Resource())) | |||
| 66 | + | case 2: | |||
| 67 | + | h.GetTabletToolV2(self, args[0].NewID(), tabletv2.WrapZwpTabletToolV2(args[1].Resource())) | |||
| 68 | + | } | |||
| 69 | + | }) | |||
| 70 | + | if err != nil { | |||
| 71 | + | return nil, err | |||
| 72 | + | } | |||
| 73 | + | self = WrapWpCursorShapeManagerV1(r) | |||
| 74 | + | r.Data = self | |||
| 75 | + | return self, nil | |||
| 76 | + | } | |||
| 77 | + | func NewWpCursorShapeManagerV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 78 | + | return d.CreateGlobal(WpCursorShapeManagerV1Interface, version, bind) | |||
| 79 | + | } | |||
| 80 | + | ||||
| 81 | + | // WpCursorShapeDeviceV1 cursor shape for a device. | |||
| 82 | + | type WpCursorShapeDeviceV1 struct{ *server.Resource } | |||
| 83 | + | ||||
| 84 | + | func WrapWpCursorShapeDeviceV1(r *server.Resource) *WpCursorShapeDeviceV1 { | |||
| 85 | + | if r == nil { | |||
| 86 | + | return nil | |||
| 87 | + | } | |||
| 88 | + | return &WpCursorShapeDeviceV1{r} | |||
| 89 | + | } | |||
| 90 | + | ||||
| 91 | + | const WpCursorShapeDeviceV1RequestDestroy uint32 = 0 | |||
| 92 | + | const WpCursorShapeDeviceV1RequestSetShape uint32 = 1 | |||
| 93 | + | ||||
| 94 | + | // WpCursorShapeDeviceV1Shape cursor shapes. | |||
| 95 | + | type WpCursorShapeDeviceV1Shape uint32 | |||
| 96 | + | ||||
| 97 | + | const ( | |||
| 98 | + | WpCursorShapeDeviceV1ShapeDefault WpCursorShapeDeviceV1Shape = 1 | |||
| 99 | + | WpCursorShapeDeviceV1ShapeContextMenu WpCursorShapeDeviceV1Shape = 2 | |||
| 100 | + | WpCursorShapeDeviceV1ShapeHelp WpCursorShapeDeviceV1Shape = 3 | |||
| 101 | + | WpCursorShapeDeviceV1ShapePointer WpCursorShapeDeviceV1Shape = 4 | |||
| 102 | + | WpCursorShapeDeviceV1ShapeProgress WpCursorShapeDeviceV1Shape = 5 | |||
| 103 | + | WpCursorShapeDeviceV1ShapeWait WpCursorShapeDeviceV1Shape = 6 | |||
| 104 | + | WpCursorShapeDeviceV1ShapeCell WpCursorShapeDeviceV1Shape = 7 | |||
| 105 | + | WpCursorShapeDeviceV1ShapeCrosshair WpCursorShapeDeviceV1Shape = 8 | |||
| 106 | + | WpCursorShapeDeviceV1ShapeText WpCursorShapeDeviceV1Shape = 9 | |||
| 107 | + | WpCursorShapeDeviceV1ShapeVerticalText WpCursorShapeDeviceV1Shape = 10 | |||
| 108 | + | WpCursorShapeDeviceV1ShapeAlias WpCursorShapeDeviceV1Shape = 11 | |||
| 109 | + | WpCursorShapeDeviceV1ShapeCopy WpCursorShapeDeviceV1Shape = 12 | |||
| 110 | + | WpCursorShapeDeviceV1ShapeMove WpCursorShapeDeviceV1Shape = 13 | |||
| 111 | + | WpCursorShapeDeviceV1ShapeNoDrop WpCursorShapeDeviceV1Shape = 14 | |||
| 112 | + | WpCursorShapeDeviceV1ShapeNotAllowed WpCursorShapeDeviceV1Shape = 15 | |||
| 113 | + | WpCursorShapeDeviceV1ShapeGrab WpCursorShapeDeviceV1Shape = 16 | |||
| 114 | + | WpCursorShapeDeviceV1ShapeGrabbing WpCursorShapeDeviceV1Shape = 17 | |||
| 115 | + | WpCursorShapeDeviceV1ShapeEResize WpCursorShapeDeviceV1Shape = 18 | |||
| 116 | + | WpCursorShapeDeviceV1ShapeNResize WpCursorShapeDeviceV1Shape = 19 | |||
| 117 | + | WpCursorShapeDeviceV1ShapeNeResize WpCursorShapeDeviceV1Shape = 20 | |||
| 118 | + | WpCursorShapeDeviceV1ShapeNwResize WpCursorShapeDeviceV1Shape = 21 | |||
| 119 | + | WpCursorShapeDeviceV1ShapeSResize WpCursorShapeDeviceV1Shape = 22 | |||
| 120 | + | WpCursorShapeDeviceV1ShapeSeResize WpCursorShapeDeviceV1Shape = 23 | |||
| 121 | + | WpCursorShapeDeviceV1ShapeSwResize WpCursorShapeDeviceV1Shape = 24 | |||
| 122 | + | WpCursorShapeDeviceV1ShapeWResize WpCursorShapeDeviceV1Shape = 25 | |||
| 123 | + | WpCursorShapeDeviceV1ShapeEwResize WpCursorShapeDeviceV1Shape = 26 | |||
| 124 | + | WpCursorShapeDeviceV1ShapeNsResize WpCursorShapeDeviceV1Shape = 27 | |||
| 125 | + | WpCursorShapeDeviceV1ShapeNeswResize WpCursorShapeDeviceV1Shape = 28 | |||
| 126 | + | WpCursorShapeDeviceV1ShapeNwseResize WpCursorShapeDeviceV1Shape = 29 | |||
| 127 | + | WpCursorShapeDeviceV1ShapeColResize WpCursorShapeDeviceV1Shape = 30 | |||
| 128 | + | WpCursorShapeDeviceV1ShapeRowResize WpCursorShapeDeviceV1Shape = 31 | |||
| 129 | + | WpCursorShapeDeviceV1ShapeAllScroll WpCursorShapeDeviceV1Shape = 32 | |||
| 130 | + | WpCursorShapeDeviceV1ShapeZoomIn WpCursorShapeDeviceV1Shape = 33 | |||
| 131 | + | WpCursorShapeDeviceV1ShapeZoomOut WpCursorShapeDeviceV1Shape = 34 | |||
| 132 | + | WpCursorShapeDeviceV1ShapeDndAsk WpCursorShapeDeviceV1Shape = 35 | |||
| 133 | + | WpCursorShapeDeviceV1ShapeAllResize WpCursorShapeDeviceV1Shape = 36 | |||
| 134 | + | ) | |||
| 135 | + | ||||
| 136 | + | // WpCursorShapeDeviceV1Error . | |||
| 137 | + | type WpCursorShapeDeviceV1Error uint32 | |||
| 138 | + | ||||
| 139 | + | const ( | |||
| 140 | + | WpCursorShapeDeviceV1ErrorInvalidShape WpCursorShapeDeviceV1Error = 1 | |||
| 141 | + | ) | |||
| 142 | + | ||||
| 143 | + | // WpCursorShapeDeviceV1Handler handles wp_cursor_shape_device_v1 requests. | |||
| 144 | + | type WpCursorShapeDeviceV1Handler interface { | |||
| 145 | + | Destroy(self *WpCursorShapeDeviceV1) | |||
| 146 | + | SetShape(self *WpCursorShapeDeviceV1, serial uint32, shape uint32) | |||
| 147 | + | } | |||
| 148 | + | ||||
| 149 | + | func NewWpCursorShapeDeviceV1(c server.Client, version int32, id uint32, h WpCursorShapeDeviceV1Handler) (*WpCursorShapeDeviceV1, error) { | |||
| 150 | + | if h == nil { | |||
| 151 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for wp_cursor_shape_device_v1") | |||
| 152 | + | } | |||
| 153 | + | var self *WpCursorShapeDeviceV1 | |||
| 154 | + | r, err := c.CreateResource(WpCursorShapeDeviceV1Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 155 | + | switch opcode { | |||
| 156 | + | case 0: | |||
| 157 | + | h.Destroy(self) | |||
| 158 | + | self.Destroy() | |||
| 159 | + | case 1: | |||
| 160 | + | h.SetShape(self, args[0].Uint(), args[1].Uint()) | |||
| 161 | + | } | |||
| 162 | + | }) | |||
| 163 | + | if err != nil { | |||
| 164 | + | return nil, err | |||
| 165 | + | } | |||
| 166 | + | self = WrapWpCursorShapeDeviceV1(r) | |||
| 167 | + | r.Data = self | |||
| 168 | + | return self, nil | |||
| 169 | + | } | |||
| 170 | + | func NewWpCursorShapeDeviceV1Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 171 | + | return d.CreateGlobal(WpCursorShapeDeviceV1Interface, version, bind) | |||
| 172 | + | } | |||
| 173 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |||
| 174 | + | if v == nil { | |||
| 175 | + | return nil | |||
| 176 | + | } | |||
| 177 | + | return v.GetResource() | |||
| 178 | + | } | |||
| 179 | + | func (self *WpCursorShapeManagerV1) GetResource() *server.Resource { | |||
| 180 | + | if self == nil { | |||
| 181 | + | return nil | |||
| 182 | + | } | |||
| 183 | + | return self.Resource | |||
| 184 | + | } | |||
| 185 | + | func (self *WpCursorShapeDeviceV1) GetResource() *server.Resource { | |||
| 186 | + | if self == nil { | |||
| 187 | + | return nil | |||
| 188 | + | } | |||
| 189 | + | return self.Resource | |||
| 190 | + | } | |||
M protocol/gen.go +2 -0
| @@ -10,3 +10,5 @@ package protocol | |||
| 10 | 10 | //go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml | |
| 11 | 11 | //go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml | |
| 12 | 12 | //go:generate go run ../cmd/wlgen -package kdedecoration -out kdedecoration/kdedecoration.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/server-decoration.xml | |
| 13 | + | //go:generate go run ../cmd/wlgen -package tabletv2 -out tabletv2/tabletv2.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/tablet-v2.xml | |
| 14 | + | //go:generate go run ../cmd/wlgen -package cursorshape -out cursorshape/cursorshape.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import tabletv2=github.com/bnema/purego-libwayland/protocol/tabletv2 -import-xml tabletv2=../protocols/tablet-v2.xml ../protocols/cursor-shape-v1.xml | |
| @@ -10,3 +10,5 @@ package protocol | |||||
| 10 | //go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml | 10 | //go:generate go run ../cmd/wlgen -package fractionalscale -out fractionalscale/fractionalscale.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/fractional-scale-v1.xml | ||
| 11 | //go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml | 11 | //go:generate go run ../cmd/wlgen -package linuxdmabuf -out linuxdmabuf/linuxdmabuf.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/linux-dmabuf-v1.xml | ||
| 12 | //go:generate go run ../cmd/wlgen -package kdedecoration -out kdedecoration/kdedecoration.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/server-decoration.xml | 12 | //go:generate go run ../cmd/wlgen -package kdedecoration -out kdedecoration/kdedecoration.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/server-decoration.xml | ||
| 13 | + | //go:generate go run ../cmd/wlgen -package tabletv2 -out tabletv2/tabletv2.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml ../protocols/tablet-v2.xml | |||
| 14 | + | //go:generate go run ../cmd/wlgen -package cursorshape -out cursorshape/cursorshape.go -import wayland=github.com/bnema/purego-libwayland/protocol/wayland -import-xml wayland=../protocols/wayland.xml -import tabletv2=github.com/bnema/purego-libwayland/protocol/tabletv2 -import-xml tabletv2=../protocols/tablet-v2.xml ../protocols/cursor-shape-v1.xml | |||
A protocol/tabletv2/tabletv2.go +981 -0
| @@ -0,0 +1,981 @@ | |||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |
| 2 | + | package tabletv2 | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "fmt" | |
| 6 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |
| 7 | + | "github.com/bnema/purego-libwayland/server" | |
| 8 | + | "runtime" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | var ZwpTabletManagerV2Interface *server.Interface | |
| 12 | + | var ZwpTabletSeatV2Interface *server.Interface | |
| 13 | + | var ZwpTabletToolV2Interface *server.Interface | |
| 14 | + | var ZwpTabletV2Interface *server.Interface | |
| 15 | + | var ZwpTabletPadRingV2Interface *server.Interface | |
| 16 | + | var ZwpTabletPadStripV2Interface *server.Interface | |
| 17 | + | var ZwpTabletPadGroupV2Interface *server.Interface | |
| 18 | + | var ZwpTabletPadV2Interface *server.Interface | |
| 19 | + | var ZwpTabletPadDialV2Interface *server.Interface | |
| 20 | + | ||
| 21 | + | func init() { | |
| 22 | + | ZwpTabletManagerV2Interface = &server.Interface{Name: "zwp_tablet_manager_v2", Version: 2} | |
| 23 | + | ZwpTabletSeatV2Interface = &server.Interface{Name: "zwp_tablet_seat_v2", Version: 2} | |
| 24 | + | ZwpTabletToolV2Interface = &server.Interface{Name: "zwp_tablet_tool_v2", Version: 2} | |
| 25 | + | ZwpTabletV2Interface = &server.Interface{Name: "zwp_tablet_v2", Version: 2} | |
| 26 | + | ZwpTabletPadRingV2Interface = &server.Interface{Name: "zwp_tablet_pad_ring_v2", Version: 2} | |
| 27 | + | ZwpTabletPadStripV2Interface = &server.Interface{Name: "zwp_tablet_pad_strip_v2", Version: 2} | |
| 28 | + | ZwpTabletPadGroupV2Interface = &server.Interface{Name: "zwp_tablet_pad_group_v2", Version: 2} | |
| 29 | + | ZwpTabletPadV2Interface = &server.Interface{Name: "zwp_tablet_pad_v2", Version: 2} | |
| 30 | + | ZwpTabletPadDialV2Interface = &server.Interface{Name: "zwp_tablet_pad_dial_v2", Version: 2} | |
| 31 | + | ZwpTabletManagerV2Interface.Requests = []server.Message{ | |
| 32 | + | {Name: "get_tablet_seat", Signature: "no", Types: []*server.Interface{ZwpTabletSeatV2Interface, wayland.SeatInterface}}, | |
| 33 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 34 | + | } | |
| 35 | + | ZwpTabletManagerV2Interface.Events = []server.Message{} | |
| 36 | + | ZwpTabletSeatV2Interface.Requests = []server.Message{ | |
| 37 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 38 | + | } | |
| 39 | + | ZwpTabletSeatV2Interface.Events = []server.Message{ | |
| 40 | + | {Name: "tablet_added", Signature: "n", Types: []*server.Interface{ZwpTabletV2Interface}}, | |
| 41 | + | {Name: "tool_added", Signature: "n", Types: []*server.Interface{ZwpTabletToolV2Interface}}, | |
| 42 | + | {Name: "pad_added", Signature: "n", Types: []*server.Interface{ZwpTabletPadV2Interface}}, | |
| 43 | + | } | |
| 44 | + | ZwpTabletToolV2Interface.Requests = []server.Message{ | |
| 45 | + | {Name: "set_cursor", Signature: "u?oii", Types: []*server.Interface{nil, wayland.SurfaceInterface, nil, nil}}, | |
| 46 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 47 | + | } | |
| 48 | + | ZwpTabletToolV2Interface.Events = []server.Message{ | |
| 49 | + | {Name: "type", Signature: "u", Types: []*server.Interface{nil}}, | |
| 50 | + | {Name: "hardware_serial", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |
| 51 | + | {Name: "hardware_id_wacom", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |
| 52 | + | {Name: "capability", Signature: "u", Types: []*server.Interface{nil}}, | |
| 53 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |
| 54 | + | {Name: "removed", Signature: "", Types: []*server.Interface{}}, | |
| 55 | + | {Name: "proximity_in", Signature: "uoo", Types: []*server.Interface{nil, ZwpTabletV2Interface, wayland.SurfaceInterface}}, | |
| 56 | + | {Name: "proximity_out", Signature: "", Types: []*server.Interface{}}, | |
| 57 | + | {Name: "down", Signature: "u", Types: []*server.Interface{nil}}, | |
| 58 | + | {Name: "up", Signature: "", Types: []*server.Interface{}}, | |
| 59 | + | {Name: "motion", Signature: "ff", Types: []*server.Interface{nil, nil}}, | |
| 60 | + | {Name: "pressure", Signature: "u", Types: []*server.Interface{nil}}, | |
| 61 | + | {Name: "distance", Signature: "u", Types: []*server.Interface{nil}}, | |
| 62 | + | {Name: "tilt", Signature: "ff", Types: []*server.Interface{nil, nil}}, | |
| 63 | + | {Name: "rotation", Signature: "f", Types: []*server.Interface{nil}}, | |
| 64 | + | {Name: "slider", Signature: "i", Types: []*server.Interface{nil}}, | |
| 65 | + | {Name: "wheel", Signature: "fi", Types: []*server.Interface{nil, nil}}, | |
| 66 | + | {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |
| 67 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |
| 68 | + | } | |
| 69 | + | ZwpTabletV2Interface.Requests = []server.Message{ | |
| 70 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 71 | + | } | |
| 72 | + | ZwpTabletV2Interface.Events = []server.Message{ | |
| 73 | + | {Name: "name", Signature: "s", Types: []*server.Interface{nil}}, | |
| 74 | + | {Name: "id", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |
| 75 | + | {Name: "path", Signature: "s", Types: []*server.Interface{nil}}, | |
| 76 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |
| 77 | + | {Name: "removed", Signature: "", Types: []*server.Interface{}}, | |
| 78 | + | {Name: "bustype", Signature: "2u", Types: []*server.Interface{nil}}, | |
| 79 | + | } | |
| 80 | + | ZwpTabletPadRingV2Interface.Requests = []server.Message{ | |
| 81 | + | {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}}, | |
| 82 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 83 | + | } | |
| 84 | + | ZwpTabletPadRingV2Interface.Events = []server.Message{ | |
| 85 | + | {Name: "source", Signature: "u", Types: []*server.Interface{nil}}, | |
| 86 | + | {Name: "angle", Signature: "f", Types: []*server.Interface{nil}}, | |
| 87 | + | {Name: "stop", Signature: "", Types: []*server.Interface{}}, | |
| 88 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |
| 89 | + | } | |
| 90 | + | ZwpTabletPadStripV2Interface.Requests = []server.Message{ | |
| 91 | + | {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}}, | |
| 92 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 93 | + | } | |
| 94 | + | ZwpTabletPadStripV2Interface.Events = []server.Message{ | |
| 95 | + | {Name: "source", Signature: "u", Types: []*server.Interface{nil}}, | |
| 96 | + | {Name: "position", Signature: "u", Types: []*server.Interface{nil}}, | |
| 97 | + | {Name: "stop", Signature: "", Types: []*server.Interface{}}, | |
| 98 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |
| 99 | + | } | |
| 100 | + | ZwpTabletPadGroupV2Interface.Requests = []server.Message{ | |
| 101 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 102 | + | } | |
| 103 | + | ZwpTabletPadGroupV2Interface.Events = []server.Message{ | |
| 104 | + | {Name: "buttons", Signature: "a", Types: []*server.Interface{nil}}, | |
| 105 | + | {Name: "ring", Signature: "n", Types: []*server.Interface{ZwpTabletPadRingV2Interface}}, | |
| 106 | + | {Name: "strip", Signature: "n", Types: []*server.Interface{ZwpTabletPadStripV2Interface}}, | |
| 107 | + | {Name: "modes", Signature: "u", Types: []*server.Interface{nil}}, | |
| 108 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |
| 109 | + | {Name: "mode_switch", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |
| 110 | + | {Name: "dial", Signature: "2n", Types: []*server.Interface{ZwpTabletPadDialV2Interface}}, | |
| 111 | + | } | |
| 112 | + | ZwpTabletPadV2Interface.Requests = []server.Message{ | |
| 113 | + | {Name: "set_feedback", Signature: "usu", Types: []*server.Interface{nil, nil, nil}}, | |
| 114 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 115 | + | } | |
| 116 | + | ZwpTabletPadV2Interface.Events = []server.Message{ | |
| 117 | + | {Name: "group", Signature: "n", Types: []*server.Interface{ZwpTabletPadGroupV2Interface}}, | |
| 118 | + | {Name: "path", Signature: "s", Types: []*server.Interface{nil}}, | |
| 119 | + | {Name: "buttons", Signature: "u", Types: []*server.Interface{nil}}, | |
| 120 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |
| 121 | + | {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |
| 122 | + | {Name: "enter", Signature: "uoo", Types: []*server.Interface{nil, ZwpTabletV2Interface, wayland.SurfaceInterface}}, | |
| 123 | + | {Name: "leave", Signature: "uo", Types: []*server.Interface{nil, wayland.SurfaceInterface}}, | |
| 124 | + | {Name: "removed", Signature: "", Types: []*server.Interface{}}, | |
| 125 | + | } | |
| 126 | + | ZwpTabletPadDialV2Interface.Requests = []server.Message{ | |
| 127 | + | {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}}, | |
| 128 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |
| 129 | + | } | |
| 130 | + | ZwpTabletPadDialV2Interface.Events = []server.Message{ | |
| 131 | + | {Name: "delta", Signature: "i", Types: []*server.Interface{nil}}, | |
| 132 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |
| 133 | + | } | |
| 134 | + | if err := server.NewInterfaces(ZwpTabletManagerV2Interface, ZwpTabletSeatV2Interface, ZwpTabletToolV2Interface, ZwpTabletV2Interface, ZwpTabletPadRingV2Interface, ZwpTabletPadStripV2Interface, ZwpTabletPadGroupV2Interface, ZwpTabletPadV2Interface, ZwpTabletPadDialV2Interface); err != nil { | |
| 135 | + | panic(err) | |
| 136 | + | } | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | // ZwpTabletManagerV2 controller object for graphic tablet devices. | |
| 140 | + | type ZwpTabletManagerV2 struct{ *server.Resource } | |
| 141 | + | ||
| 142 | + | func WrapZwpTabletManagerV2(r *server.Resource) *ZwpTabletManagerV2 { | |
| 143 | + | if r == nil { | |
| 144 | + | return nil | |
| 145 | + | } | |
| 146 | + | return &ZwpTabletManagerV2{r} | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | const ZwpTabletManagerV2RequestGetTabletSeat uint32 = 0 | |
| 150 | + | const ZwpTabletManagerV2RequestDestroy uint32 = 1 | |
| 151 | + | ||
| 152 | + | // ZwpTabletManagerV2Handler handles zwp_tablet_manager_v2 requests. | |
| 153 | + | type ZwpTabletManagerV2Handler interface { | |
| 154 | + | GetTabletSeat(self *ZwpTabletManagerV2, tabletSeat uint32, seat *wayland.Seat) | |
| 155 | + | Destroy(self *ZwpTabletManagerV2) | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | func NewZwpTabletManagerV2(c server.Client, version int32, id uint32, h ZwpTabletManagerV2Handler) (*ZwpTabletManagerV2, error) { | |
| 159 | + | if h == nil { | |
| 160 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_manager_v2") | |
| 161 | + | } | |
| 162 | + | var self *ZwpTabletManagerV2 | |
| 163 | + | r, err := c.CreateResource(ZwpTabletManagerV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 164 | + | switch opcode { | |
| 165 | + | case 0: | |
| 166 | + | h.GetTabletSeat(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource())) | |
| 167 | + | case 1: | |
| 168 | + | h.Destroy(self) | |
| 169 | + | self.Destroy() | |
| 170 | + | } | |
| 171 | + | }) | |
| 172 | + | if err != nil { | |
| 173 | + | return nil, err | |
| 174 | + | } | |
| 175 | + | self = WrapZwpTabletManagerV2(r) | |
| 176 | + | r.Data = self | |
| 177 | + | return self, nil | |
| 178 | + | } | |
| 179 | + | func NewZwpTabletManagerV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 180 | + | return d.CreateGlobal(ZwpTabletManagerV2Interface, version, bind) | |
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // ZwpTabletSeatV2 controller object for graphic tablet devices of a seat. | |
| 184 | + | type ZwpTabletSeatV2 struct{ *server.Resource } | |
| 185 | + | ||
| 186 | + | func WrapZwpTabletSeatV2(r *server.Resource) *ZwpTabletSeatV2 { | |
| 187 | + | if r == nil { | |
| 188 | + | return nil | |
| 189 | + | } | |
| 190 | + | return &ZwpTabletSeatV2{r} | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | const ZwpTabletSeatV2RequestDestroy uint32 = 0 | |
| 194 | + | const ZwpTabletSeatV2EventTabletAdded uint32 = 0 | |
| 195 | + | const ZwpTabletSeatV2EventToolAdded uint32 = 1 | |
| 196 | + | const ZwpTabletSeatV2EventPadAdded uint32 = 2 | |
| 197 | + | ||
| 198 | + | // ZwpTabletSeatV2Handler handles zwp_tablet_seat_v2 requests. | |
| 199 | + | type ZwpTabletSeatV2Handler interface { | |
| 200 | + | Destroy(self *ZwpTabletSeatV2) | |
| 201 | + | } | |
| 202 | + | ||
| 203 | + | func NewZwpTabletSeatV2(c server.Client, version int32, id uint32, h ZwpTabletSeatV2Handler) (*ZwpTabletSeatV2, error) { | |
| 204 | + | if h == nil { | |
| 205 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_seat_v2") | |
| 206 | + | } | |
| 207 | + | var self *ZwpTabletSeatV2 | |
| 208 | + | r, err := c.CreateResource(ZwpTabletSeatV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 209 | + | switch opcode { | |
| 210 | + | case 0: | |
| 211 | + | h.Destroy(self) | |
| 212 | + | self.Destroy() | |
| 213 | + | } | |
| 214 | + | }) | |
| 215 | + | if err != nil { | |
| 216 | + | return nil, err | |
| 217 | + | } | |
| 218 | + | self = WrapZwpTabletSeatV2(r) | |
| 219 | + | r.Data = self | |
| 220 | + | return self, nil | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // SendTabletAdded new device notification. | |
| 224 | + | func (self *ZwpTabletSeatV2) SendTabletAdded(id *ZwpTabletV2) { | |
| 225 | + | self.PostEvent(ZwpTabletSeatV2EventTabletAdded, server.NewID(resourceOf(id))) | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // SendToolAdded a new tool has been used with a tablet. | |
| 229 | + | func (self *ZwpTabletSeatV2) SendToolAdded(id *ZwpTabletToolV2) { | |
| 230 | + | self.PostEvent(ZwpTabletSeatV2EventToolAdded, server.NewID(resourceOf(id))) | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // SendPadAdded new pad notification. | |
| 234 | + | func (self *ZwpTabletSeatV2) SendPadAdded(id *ZwpTabletPadV2) { | |
| 235 | + | self.PostEvent(ZwpTabletSeatV2EventPadAdded, server.NewID(resourceOf(id))) | |
| 236 | + | } | |
| 237 | + | func NewZwpTabletSeatV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 238 | + | return d.CreateGlobal(ZwpTabletSeatV2Interface, version, bind) | |
| 239 | + | } | |
| 240 | + | ||
| 241 | + | // ZwpTabletToolV2 a physical tablet tool. | |
| 242 | + | type ZwpTabletToolV2 struct{ *server.Resource } | |
| 243 | + | ||
| 244 | + | func WrapZwpTabletToolV2(r *server.Resource) *ZwpTabletToolV2 { | |
| 245 | + | if r == nil { | |
| 246 | + | return nil | |
| 247 | + | } | |
| 248 | + | return &ZwpTabletToolV2{r} | |
| 249 | + | } | |
| 250 | + | ||
| 251 | + | const ZwpTabletToolV2RequestSetCursor uint32 = 0 | |
| 252 | + | const ZwpTabletToolV2RequestDestroy uint32 = 1 | |
| 253 | + | const ZwpTabletToolV2EventType uint32 = 0 | |
| 254 | + | const ZwpTabletToolV2EventHardwareSerial uint32 = 1 | |
| 255 | + | const ZwpTabletToolV2EventHardwareIdWacom uint32 = 2 | |
| 256 | + | const ZwpTabletToolV2EventCapability uint32 = 3 | |
| 257 | + | const ZwpTabletToolV2EventDone uint32 = 4 | |
| 258 | + | const ZwpTabletToolV2EventRemoved uint32 = 5 | |
| 259 | + | const ZwpTabletToolV2EventProximityIn uint32 = 6 | |
| 260 | + | const ZwpTabletToolV2EventProximityOut uint32 = 7 | |
| 261 | + | const ZwpTabletToolV2EventDown uint32 = 8 | |
| 262 | + | const ZwpTabletToolV2EventUp uint32 = 9 | |
| 263 | + | const ZwpTabletToolV2EventMotion uint32 = 10 | |
| 264 | + | const ZwpTabletToolV2EventPressure uint32 = 11 | |
| 265 | + | const ZwpTabletToolV2EventDistance uint32 = 12 | |
| 266 | + | const ZwpTabletToolV2EventTilt uint32 = 13 | |
| 267 | + | const ZwpTabletToolV2EventRotation uint32 = 14 | |
| 268 | + | const ZwpTabletToolV2EventSlider uint32 = 15 | |
| 269 | + | const ZwpTabletToolV2EventWheel uint32 = 16 | |
| 270 | + | const ZwpTabletToolV2EventButton uint32 = 17 | |
| 271 | + | const ZwpTabletToolV2EventFrame uint32 = 18 | |
| 272 | + | ||
| 273 | + | // ZwpTabletToolV2Type a physical tool type. | |
| 274 | + | type ZwpTabletToolV2Type uint32 | |
| 275 | + | ||
| 276 | + | const ( | |
| 277 | + | ZwpTabletToolV2TypePen ZwpTabletToolV2Type = 0x140 | |
| 278 | + | ZwpTabletToolV2TypeEraser ZwpTabletToolV2Type = 0x141 | |
| 279 | + | ZwpTabletToolV2TypeBrush ZwpTabletToolV2Type = 0x142 | |
| 280 | + | ZwpTabletToolV2TypePencil ZwpTabletToolV2Type = 0x143 | |
| 281 | + | ZwpTabletToolV2TypeAirbrush ZwpTabletToolV2Type = 0x144 | |
| 282 | + | ZwpTabletToolV2TypeFinger ZwpTabletToolV2Type = 0x145 | |
| 283 | + | ZwpTabletToolV2TypeMouse ZwpTabletToolV2Type = 0x146 | |
| 284 | + | ZwpTabletToolV2TypeLens ZwpTabletToolV2Type = 0x147 | |
| 285 | + | ) | |
| 286 | + | ||
| 287 | + | // ZwpTabletToolV2Capability capability flags for a tool. | |
| 288 | + | type ZwpTabletToolV2Capability uint32 | |
| 289 | + | ||
| 290 | + | const ( | |
| 291 | + | ZwpTabletToolV2CapabilityTilt ZwpTabletToolV2Capability = 1 | |
| 292 | + | ZwpTabletToolV2CapabilityPressure ZwpTabletToolV2Capability = 2 | |
| 293 | + | ZwpTabletToolV2CapabilityDistance ZwpTabletToolV2Capability = 3 | |
| 294 | + | ZwpTabletToolV2CapabilityRotation ZwpTabletToolV2Capability = 4 | |
| 295 | + | ZwpTabletToolV2CapabilitySlider ZwpTabletToolV2Capability = 5 | |
| 296 | + | ZwpTabletToolV2CapabilityWheel ZwpTabletToolV2Capability = 6 | |
| 297 | + | ) | |
| 298 | + | ||
| 299 | + | // ZwpTabletToolV2ButtonState physical button state. | |
| 300 | + | type ZwpTabletToolV2ButtonState uint32 | |
| 301 | + | ||
| 302 | + | const ( | |
| 303 | + | ZwpTabletToolV2ButtonStateReleased ZwpTabletToolV2ButtonState = 0 | |
| 304 | + | ZwpTabletToolV2ButtonStatePressed ZwpTabletToolV2ButtonState = 1 | |
| 305 | + | ) | |
| 306 | + | ||
| 307 | + | // ZwpTabletToolV2Error . | |
| 308 | + | type ZwpTabletToolV2Error uint32 | |
| 309 | + | ||
| 310 | + | const ( | |
| 311 | + | ZwpTabletToolV2ErrorRole ZwpTabletToolV2Error = 0 | |
| 312 | + | ) | |
| 313 | + | ||
| 314 | + | // ZwpTabletToolV2Handler handles zwp_tablet_tool_v2 requests. | |
| 315 | + | type ZwpTabletToolV2Handler interface { | |
| 316 | + | SetCursor(self *ZwpTabletToolV2, serial uint32, surface *wayland.Surface, hotspotX int32, hotspotY int32) | |
| 317 | + | Destroy(self *ZwpTabletToolV2) | |
| 318 | + | } | |
| 319 | + | ||
| 320 | + | func NewZwpTabletToolV2(c server.Client, version int32, id uint32, h ZwpTabletToolV2Handler) (*ZwpTabletToolV2, error) { | |
| 321 | + | if h == nil { | |
| 322 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_tool_v2") | |
| 323 | + | } | |
| 324 | + | var self *ZwpTabletToolV2 | |
| 325 | + | r, err := c.CreateResource(ZwpTabletToolV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 326 | + | switch opcode { | |
| 327 | + | case 0: | |
| 328 | + | h.SetCursor(self, args[0].Uint(), wayland.WrapSurface(args[1].Resource()), args[2].Int(), args[3].Int()) | |
| 329 | + | case 1: | |
| 330 | + | h.Destroy(self) | |
| 331 | + | self.Destroy() | |
| 332 | + | } | |
| 333 | + | }) | |
| 334 | + | if err != nil { | |
| 335 | + | return nil, err | |
| 336 | + | } | |
| 337 | + | self = WrapZwpTabletToolV2(r) | |
| 338 | + | r.Data = self | |
| 339 | + | return self, nil | |
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // SendType tool type. | |
| 343 | + | func (self *ZwpTabletToolV2) SendType(toolType uint32) { | |
| 344 | + | self.PostEvent(ZwpTabletToolV2EventType, server.Uint(toolType)) | |
| 345 | + | } | |
| 346 | + | ||
| 347 | + | // SendHardwareSerial unique hardware serial number of the tool. | |
| 348 | + | func (self *ZwpTabletToolV2) SendHardwareSerial(hardwareSerialHi uint32, hardwareSerialLo uint32) { | |
| 349 | + | self.PostEvent(ZwpTabletToolV2EventHardwareSerial, server.Uint(hardwareSerialHi), server.Uint(hardwareSerialLo)) | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // SendHardwareIdWacom hardware id notification in Wacom's format. | |
| 353 | + | func (self *ZwpTabletToolV2) SendHardwareIdWacom(hardwareIdHi uint32, hardwareIdLo uint32) { | |
| 354 | + | self.PostEvent(ZwpTabletToolV2EventHardwareIdWacom, server.Uint(hardwareIdHi), server.Uint(hardwareIdLo)) | |
| 355 | + | } | |
| 356 | + | ||
| 357 | + | // SendCapability tool capability notification. | |
| 358 | + | func (self *ZwpTabletToolV2) SendCapability(capability uint32) { | |
| 359 | + | self.PostEvent(ZwpTabletToolV2EventCapability, server.Uint(capability)) | |
| 360 | + | } | |
| 361 | + | ||
| 362 | + | // SendDone tool description events sequence complete. | |
| 363 | + | func (self *ZwpTabletToolV2) SendDone() { | |
| 364 | + | self.PostEvent(ZwpTabletToolV2EventDone) | |
| 365 | + | } | |
| 366 | + | ||
| 367 | + | // SendRemoved tool removed. | |
| 368 | + | func (self *ZwpTabletToolV2) SendRemoved() { | |
| 369 | + | self.PostEvent(ZwpTabletToolV2EventRemoved) | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // SendProximityIn proximity in event. | |
| 373 | + | func (self *ZwpTabletToolV2) SendProximityIn(serial uint32, tablet *ZwpTabletV2, surface *wayland.Surface) { | |
| 374 | + | self.PostEvent(ZwpTabletToolV2EventProximityIn, server.Uint(serial), server.Object(resourceOf(tablet)), server.Object(resourceOf(surface))) | |
| 375 | + | } | |
| 376 | + | ||
| 377 | + | // SendProximityOut proximity out event. | |
| 378 | + | func (self *ZwpTabletToolV2) SendProximityOut() { | |
| 379 | + | self.PostEvent(ZwpTabletToolV2EventProximityOut) | |
| 380 | + | } | |
| 381 | + | ||
| 382 | + | // SendDown tablet tool is making contact. | |
| 383 | + | func (self *ZwpTabletToolV2) SendDown(serial uint32) { | |
| 384 | + | self.PostEvent(ZwpTabletToolV2EventDown, server.Uint(serial)) | |
| 385 | + | } | |
| 386 | + | ||
| 387 | + | // SendUp tablet tool is no longer making contact. | |
| 388 | + | func (self *ZwpTabletToolV2) SendUp() { | |
| 389 | + | self.PostEvent(ZwpTabletToolV2EventUp) | |
| 390 | + | } | |
| 391 | + | ||
| 392 | + | // SendMotion motion event. | |
| 393 | + | func (self *ZwpTabletToolV2) SendMotion(x server.Fixed, y server.Fixed) { | |
| 394 | + | self.PostEvent(ZwpTabletToolV2EventMotion, server.FixedArg(x), server.FixedArg(y)) | |
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // SendPressure pressure change event. | |
| 398 | + | func (self *ZwpTabletToolV2) SendPressure(pressure uint32) { | |
| 399 | + | self.PostEvent(ZwpTabletToolV2EventPressure, server.Uint(pressure)) | |
| 400 | + | } | |
| 401 | + | ||
| 402 | + | // SendDistance distance change event. | |
| 403 | + | func (self *ZwpTabletToolV2) SendDistance(distance uint32) { | |
| 404 | + | self.PostEvent(ZwpTabletToolV2EventDistance, server.Uint(distance)) | |
| 405 | + | } | |
| 406 | + | ||
| 407 | + | // SendTilt tilt change event. | |
| 408 | + | func (self *ZwpTabletToolV2) SendTilt(tiltX server.Fixed, tiltY server.Fixed) { | |
| 409 | + | self.PostEvent(ZwpTabletToolV2EventTilt, server.FixedArg(tiltX), server.FixedArg(tiltY)) | |
| 410 | + | } | |
| 411 | + | ||
| 412 | + | // SendRotation z-rotation change event. | |
| 413 | + | func (self *ZwpTabletToolV2) SendRotation(degrees server.Fixed) { | |
| 414 | + | self.PostEvent(ZwpTabletToolV2EventRotation, server.FixedArg(degrees)) | |
| 415 | + | } | |
| 416 | + | ||
| 417 | + | // SendSlider Slider position change event. | |
| 418 | + | func (self *ZwpTabletToolV2) SendSlider(position int32) { | |
| 419 | + | self.PostEvent(ZwpTabletToolV2EventSlider, server.Int(position)) | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | // SendWheel Wheel delta event. | |
| 423 | + | func (self *ZwpTabletToolV2) SendWheel(degrees server.Fixed, clicks int32) { | |
| 424 | + | self.PostEvent(ZwpTabletToolV2EventWheel, server.FixedArg(degrees), server.Int(clicks)) | |
| 425 | + | } | |
| 426 | + | ||
| 427 | + | // SendButton button event. | |
| 428 | + | func (self *ZwpTabletToolV2) SendButton(serial uint32, button uint32, state uint32) { | |
| 429 | + | self.PostEvent(ZwpTabletToolV2EventButton, server.Uint(serial), server.Uint(button), server.Uint(state)) | |
| 430 | + | } | |
| 431 | + | ||
| 432 | + | // SendFrame frame event. | |
| 433 | + | func (self *ZwpTabletToolV2) SendFrame(time uint32) { | |
| 434 | + | self.PostEvent(ZwpTabletToolV2EventFrame, server.Uint(time)) | |
| 435 | + | } | |
| 436 | + | func NewZwpTabletToolV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 437 | + | return d.CreateGlobal(ZwpTabletToolV2Interface, version, bind) | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | // ZwpTabletV2 graphics tablet device. | |
| 441 | + | type ZwpTabletV2 struct{ *server.Resource } | |
| 442 | + | ||
| 443 | + | func WrapZwpTabletV2(r *server.Resource) *ZwpTabletV2 { | |
| 444 | + | if r == nil { | |
| 445 | + | return nil | |
| 446 | + | } | |
| 447 | + | return &ZwpTabletV2{r} | |
| 448 | + | } | |
| 449 | + | ||
| 450 | + | const ZwpTabletV2RequestDestroy uint32 = 0 | |
| 451 | + | const ZwpTabletV2EventName uint32 = 0 | |
| 452 | + | const ZwpTabletV2EventId uint32 = 1 | |
| 453 | + | const ZwpTabletV2EventPath uint32 = 2 | |
| 454 | + | const ZwpTabletV2EventDone uint32 = 3 | |
| 455 | + | const ZwpTabletV2EventRemoved uint32 = 4 | |
| 456 | + | const ZwpTabletV2EventBustype uint32 = 5 | |
| 457 | + | ||
| 458 | + | // ZwpTabletV2Bustype bus type . | |
| 459 | + | type ZwpTabletV2Bustype uint32 | |
| 460 | + | ||
| 461 | + | const ( | |
| 462 | + | ZwpTabletV2BustypeUsb ZwpTabletV2Bustype = 3 | |
| 463 | + | ZwpTabletV2BustypeBluetooth ZwpTabletV2Bustype = 5 | |
| 464 | + | ZwpTabletV2BustypeVirtual ZwpTabletV2Bustype = 6 | |
| 465 | + | ZwpTabletV2BustypeSerial ZwpTabletV2Bustype = 17 | |
| 466 | + | ZwpTabletV2BustypeI2c ZwpTabletV2Bustype = 24 | |
| 467 | + | ) | |
| 468 | + | ||
| 469 | + | // ZwpTabletV2Handler handles zwp_tablet_v2 requests. | |
| 470 | + | type ZwpTabletV2Handler interface { | |
| 471 | + | Destroy(self *ZwpTabletV2) | |
| 472 | + | } | |
| 473 | + | ||
| 474 | + | func NewZwpTabletV2(c server.Client, version int32, id uint32, h ZwpTabletV2Handler) (*ZwpTabletV2, error) { | |
| 475 | + | if h == nil { | |
| 476 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_v2") | |
| 477 | + | } | |
| 478 | + | var self *ZwpTabletV2 | |
| 479 | + | r, err := c.CreateResource(ZwpTabletV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 480 | + | switch opcode { | |
| 481 | + | case 0: | |
| 482 | + | h.Destroy(self) | |
| 483 | + | self.Destroy() | |
| 484 | + | } | |
| 485 | + | }) | |
| 486 | + | if err != nil { | |
| 487 | + | return nil, err | |
| 488 | + | } | |
| 489 | + | self = WrapZwpTabletV2(r) | |
| 490 | + | r.Data = self | |
| 491 | + | return self, nil | |
| 492 | + | } | |
| 493 | + | ||
| 494 | + | // SendName tablet device name. | |
| 495 | + | func (self *ZwpTabletV2) SendName(name string) { | |
| 496 | + | var p runtime.Pinner | |
| 497 | + | defer p.Unpin() | |
| 498 | + | self.PostEvent(ZwpTabletV2EventName, server.String(&p, name, false)) | |
| 499 | + | } | |
| 500 | + | ||
| 501 | + | // SendId tablet device vendor/product id. | |
| 502 | + | func (self *ZwpTabletV2) SendId(vid uint32, pid uint32) { | |
| 503 | + | self.PostEvent(ZwpTabletV2EventId, server.Uint(vid), server.Uint(pid)) | |
| 504 | + | } | |
| 505 | + | ||
| 506 | + | // SendPath path to the device. | |
| 507 | + | func (self *ZwpTabletV2) SendPath(path string) { | |
| 508 | + | var p runtime.Pinner | |
| 509 | + | defer p.Unpin() | |
| 510 | + | self.PostEvent(ZwpTabletV2EventPath, server.String(&p, path, false)) | |
| 511 | + | } | |
| 512 | + | ||
| 513 | + | // SendDone tablet description events sequence complete. | |
| 514 | + | func (self *ZwpTabletV2) SendDone() { | |
| 515 | + | self.PostEvent(ZwpTabletV2EventDone) | |
| 516 | + | } | |
| 517 | + | ||
| 518 | + | // SendRemoved tablet removed event. | |
| 519 | + | func (self *ZwpTabletV2) SendRemoved() { | |
| 520 | + | self.PostEvent(ZwpTabletV2EventRemoved) | |
| 521 | + | } | |
| 522 | + | ||
| 523 | + | // SendBustype tablet device bus type (since version 2). | |
| 524 | + | func (self *ZwpTabletV2) SendBustype(bustype uint32) { | |
| 525 | + | self.PostEvent(ZwpTabletV2EventBustype, server.Uint(bustype)) | |
| 526 | + | } | |
| 527 | + | func NewZwpTabletV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 528 | + | return d.CreateGlobal(ZwpTabletV2Interface, version, bind) | |
| 529 | + | } | |
| 530 | + | ||
| 531 | + | // ZwpTabletPadRingV2 pad ring. | |
| 532 | + | type ZwpTabletPadRingV2 struct{ *server.Resource } | |
| 533 | + | ||
| 534 | + | func WrapZwpTabletPadRingV2(r *server.Resource) *ZwpTabletPadRingV2 { | |
| 535 | + | if r == nil { | |
| 536 | + | return nil | |
| 537 | + | } | |
| 538 | + | return &ZwpTabletPadRingV2{r} | |
| 539 | + | } | |
| 540 | + | ||
| 541 | + | const ZwpTabletPadRingV2RequestSetFeedback uint32 = 0 | |
| 542 | + | const ZwpTabletPadRingV2RequestDestroy uint32 = 1 | |
| 543 | + | const ZwpTabletPadRingV2EventSource uint32 = 0 | |
| 544 | + | const ZwpTabletPadRingV2EventAngle uint32 = 1 | |
| 545 | + | const ZwpTabletPadRingV2EventStop uint32 = 2 | |
| 546 | + | const ZwpTabletPadRingV2EventFrame uint32 = 3 | |
| 547 | + | ||
| 548 | + | // ZwpTabletPadRingV2Source ring axis source. | |
| 549 | + | type ZwpTabletPadRingV2Source uint32 | |
| 550 | + | ||
| 551 | + | const ( | |
| 552 | + | ZwpTabletPadRingV2SourceFinger ZwpTabletPadRingV2Source = 1 | |
| 553 | + | ) | |
| 554 | + | ||
| 555 | + | // ZwpTabletPadRingV2Handler handles zwp_tablet_pad_ring_v2 requests. | |
| 556 | + | type ZwpTabletPadRingV2Handler interface { | |
| 557 | + | SetFeedback(self *ZwpTabletPadRingV2, description string, serial uint32) | |
| 558 | + | Destroy(self *ZwpTabletPadRingV2) | |
| 559 | + | } | |
| 560 | + | ||
| 561 | + | func NewZwpTabletPadRingV2(c server.Client, version int32, id uint32, h ZwpTabletPadRingV2Handler) (*ZwpTabletPadRingV2, error) { | |
| 562 | + | if h == nil { | |
| 563 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_ring_v2") | |
| 564 | + | } | |
| 565 | + | var self *ZwpTabletPadRingV2 | |
| 566 | + | r, err := c.CreateResource(ZwpTabletPadRingV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 567 | + | switch opcode { | |
| 568 | + | case 0: | |
| 569 | + | h.SetFeedback(self, args[0].String(), args[1].Uint()) | |
| 570 | + | case 1: | |
| 571 | + | h.Destroy(self) | |
| 572 | + | self.Destroy() | |
| 573 | + | } | |
| 574 | + | }) | |
| 575 | + | if err != nil { | |
| 576 | + | return nil, err | |
| 577 | + | } | |
| 578 | + | self = WrapZwpTabletPadRingV2(r) | |
| 579 | + | r.Data = self | |
| 580 | + | return self, nil | |
| 581 | + | } | |
| 582 | + | ||
| 583 | + | // SendSource ring event source. | |
| 584 | + | func (self *ZwpTabletPadRingV2) SendSource(source uint32) { | |
| 585 | + | self.PostEvent(ZwpTabletPadRingV2EventSource, server.Uint(source)) | |
| 586 | + | } | |
| 587 | + | ||
| 588 | + | // SendAngle angle changed. | |
| 589 | + | func (self *ZwpTabletPadRingV2) SendAngle(degrees server.Fixed) { | |
| 590 | + | self.PostEvent(ZwpTabletPadRingV2EventAngle, server.FixedArg(degrees)) | |
| 591 | + | } | |
| 592 | + | ||
| 593 | + | // SendStop interaction stopped. | |
| 594 | + | func (self *ZwpTabletPadRingV2) SendStop() { | |
| 595 | + | self.PostEvent(ZwpTabletPadRingV2EventStop) | |
| 596 | + | } | |
| 597 | + | ||
| 598 | + | // SendFrame end of a ring event sequence. | |
| 599 | + | func (self *ZwpTabletPadRingV2) SendFrame(time uint32) { | |
| 600 | + | self.PostEvent(ZwpTabletPadRingV2EventFrame, server.Uint(time)) | |
| 601 | + | } | |
| 602 | + | func NewZwpTabletPadRingV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 603 | + | return d.CreateGlobal(ZwpTabletPadRingV2Interface, version, bind) | |
| 604 | + | } | |
| 605 | + | ||
| 606 | + | // ZwpTabletPadStripV2 pad strip. | |
| 607 | + | type ZwpTabletPadStripV2 struct{ *server.Resource } | |
| 608 | + | ||
| 609 | + | func WrapZwpTabletPadStripV2(r *server.Resource) *ZwpTabletPadStripV2 { | |
| 610 | + | if r == nil { | |
| 611 | + | return nil | |
| 612 | + | } | |
| 613 | + | return &ZwpTabletPadStripV2{r} | |
| 614 | + | } | |
| 615 | + | ||
| 616 | + | const ZwpTabletPadStripV2RequestSetFeedback uint32 = 0 | |
| 617 | + | const ZwpTabletPadStripV2RequestDestroy uint32 = 1 | |
| 618 | + | const ZwpTabletPadStripV2EventSource uint32 = 0 | |
| 619 | + | const ZwpTabletPadStripV2EventPosition uint32 = 1 | |
| 620 | + | const ZwpTabletPadStripV2EventStop uint32 = 2 | |
| 621 | + | const ZwpTabletPadStripV2EventFrame uint32 = 3 | |
| 622 | + | ||
| 623 | + | // ZwpTabletPadStripV2Source strip axis source. | |
| 624 | + | type ZwpTabletPadStripV2Source uint32 | |
| 625 | + | ||
| 626 | + | const ( | |
| 627 | + | ZwpTabletPadStripV2SourceFinger ZwpTabletPadStripV2Source = 1 | |
| 628 | + | ) | |
| 629 | + | ||
| 630 | + | // ZwpTabletPadStripV2Handler handles zwp_tablet_pad_strip_v2 requests. | |
| 631 | + | type ZwpTabletPadStripV2Handler interface { | |
| 632 | + | SetFeedback(self *ZwpTabletPadStripV2, description string, serial uint32) | |
| 633 | + | Destroy(self *ZwpTabletPadStripV2) | |
| 634 | + | } | |
| 635 | + | ||
| 636 | + | func NewZwpTabletPadStripV2(c server.Client, version int32, id uint32, h ZwpTabletPadStripV2Handler) (*ZwpTabletPadStripV2, error) { | |
| 637 | + | if h == nil { | |
| 638 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_strip_v2") | |
| 639 | + | } | |
| 640 | + | var self *ZwpTabletPadStripV2 | |
| 641 | + | r, err := c.CreateResource(ZwpTabletPadStripV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 642 | + | switch opcode { | |
| 643 | + | case 0: | |
| 644 | + | h.SetFeedback(self, args[0].String(), args[1].Uint()) | |
| 645 | + | case 1: | |
| 646 | + | h.Destroy(self) | |
| 647 | + | self.Destroy() | |
| 648 | + | } | |
| 649 | + | }) | |
| 650 | + | if err != nil { | |
| 651 | + | return nil, err | |
| 652 | + | } | |
| 653 | + | self = WrapZwpTabletPadStripV2(r) | |
| 654 | + | r.Data = self | |
| 655 | + | return self, nil | |
| 656 | + | } | |
| 657 | + | ||
| 658 | + | // SendSource strip event source. | |
| 659 | + | func (self *ZwpTabletPadStripV2) SendSource(source uint32) { | |
| 660 | + | self.PostEvent(ZwpTabletPadStripV2EventSource, server.Uint(source)) | |
| 661 | + | } | |
| 662 | + | ||
| 663 | + | // SendPosition position changed. | |
| 664 | + | func (self *ZwpTabletPadStripV2) SendPosition(position uint32) { | |
| 665 | + | self.PostEvent(ZwpTabletPadStripV2EventPosition, server.Uint(position)) | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | // SendStop interaction stopped. | |
| 669 | + | func (self *ZwpTabletPadStripV2) SendStop() { | |
| 670 | + | self.PostEvent(ZwpTabletPadStripV2EventStop) | |
| 671 | + | } | |
| 672 | + | ||
| 673 | + | // SendFrame end of a strip event sequence. | |
| 674 | + | func (self *ZwpTabletPadStripV2) SendFrame(time uint32) { | |
| 675 | + | self.PostEvent(ZwpTabletPadStripV2EventFrame, server.Uint(time)) | |
| 676 | + | } | |
| 677 | + | func NewZwpTabletPadStripV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 678 | + | return d.CreateGlobal(ZwpTabletPadStripV2Interface, version, bind) | |
| 679 | + | } | |
| 680 | + | ||
| 681 | + | // ZwpTabletPadGroupV2 a set of buttons, rings and strips. | |
| 682 | + | type ZwpTabletPadGroupV2 struct{ *server.Resource } | |
| 683 | + | ||
| 684 | + | func WrapZwpTabletPadGroupV2(r *server.Resource) *ZwpTabletPadGroupV2 { | |
| 685 | + | if r == nil { | |
| 686 | + | return nil | |
| 687 | + | } | |
| 688 | + | return &ZwpTabletPadGroupV2{r} | |
| 689 | + | } | |
| 690 | + | ||
| 691 | + | const ZwpTabletPadGroupV2RequestDestroy uint32 = 0 | |
| 692 | + | const ZwpTabletPadGroupV2EventButtons uint32 = 0 | |
| 693 | + | const ZwpTabletPadGroupV2EventRing uint32 = 1 | |
| 694 | + | const ZwpTabletPadGroupV2EventStrip uint32 = 2 | |
| 695 | + | const ZwpTabletPadGroupV2EventModes uint32 = 3 | |
| 696 | + | const ZwpTabletPadGroupV2EventDone uint32 = 4 | |
| 697 | + | const ZwpTabletPadGroupV2EventModeSwitch uint32 = 5 | |
| 698 | + | const ZwpTabletPadGroupV2EventDial uint32 = 6 | |
| 699 | + | ||
| 700 | + | // ZwpTabletPadGroupV2Handler handles zwp_tablet_pad_group_v2 requests. | |
| 701 | + | type ZwpTabletPadGroupV2Handler interface { | |
| 702 | + | Destroy(self *ZwpTabletPadGroupV2) | |
| 703 | + | } | |
| 704 | + | ||
| 705 | + | func NewZwpTabletPadGroupV2(c server.Client, version int32, id uint32, h ZwpTabletPadGroupV2Handler) (*ZwpTabletPadGroupV2, error) { | |
| 706 | + | if h == nil { | |
| 707 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_group_v2") | |
| 708 | + | } | |
| 709 | + | var self *ZwpTabletPadGroupV2 | |
| 710 | + | r, err := c.CreateResource(ZwpTabletPadGroupV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 711 | + | switch opcode { | |
| 712 | + | case 0: | |
| 713 | + | h.Destroy(self) | |
| 714 | + | self.Destroy() | |
| 715 | + | } | |
| 716 | + | }) | |
| 717 | + | if err != nil { | |
| 718 | + | return nil, err | |
| 719 | + | } | |
| 720 | + | self = WrapZwpTabletPadGroupV2(r) | |
| 721 | + | r.Data = self | |
| 722 | + | return self, nil | |
| 723 | + | } | |
| 724 | + | ||
| 725 | + | // SendButtons buttons announced. | |
| 726 | + | func (self *ZwpTabletPadGroupV2) SendButtons(buttons []byte) { | |
| 727 | + | var p runtime.Pinner | |
| 728 | + | defer p.Unpin() | |
| 729 | + | self.PostEvent(ZwpTabletPadGroupV2EventButtons, server.Array(&p, buttons)) | |
| 730 | + | } | |
| 731 | + | ||
| 732 | + | // SendRing ring announced. | |
| 733 | + | func (self *ZwpTabletPadGroupV2) SendRing(ring *ZwpTabletPadRingV2) { | |
| 734 | + | self.PostEvent(ZwpTabletPadGroupV2EventRing, server.NewID(resourceOf(ring))) | |
| 735 | + | } | |
| 736 | + | ||
| 737 | + | // SendStrip strip announced. | |
| 738 | + | func (self *ZwpTabletPadGroupV2) SendStrip(strip *ZwpTabletPadStripV2) { | |
| 739 | + | self.PostEvent(ZwpTabletPadGroupV2EventStrip, server.NewID(resourceOf(strip))) | |
| 740 | + | } | |
| 741 | + | ||
| 742 | + | // SendModes mode-switch ability announced. | |
| 743 | + | func (self *ZwpTabletPadGroupV2) SendModes(modes uint32) { | |
| 744 | + | self.PostEvent(ZwpTabletPadGroupV2EventModes, server.Uint(modes)) | |
| 745 | + | } | |
| 746 | + | ||
| 747 | + | // SendDone tablet group description events sequence complete. | |
| 748 | + | func (self *ZwpTabletPadGroupV2) SendDone() { | |
| 749 | + | self.PostEvent(ZwpTabletPadGroupV2EventDone) | |
| 750 | + | } | |
| 751 | + | ||
| 752 | + | // SendModeSwitch mode switch event. | |
| 753 | + | func (self *ZwpTabletPadGroupV2) SendModeSwitch(time uint32, serial uint32, mode uint32) { | |
| 754 | + | self.PostEvent(ZwpTabletPadGroupV2EventModeSwitch, server.Uint(time), server.Uint(serial), server.Uint(mode)) | |
| 755 | + | } | |
| 756 | + | ||
| 757 | + | // SendDial dial announced (since version 2). | |
| 758 | + | func (self *ZwpTabletPadGroupV2) SendDial(dial *ZwpTabletPadDialV2) { | |
| 759 | + | self.PostEvent(ZwpTabletPadGroupV2EventDial, server.NewID(resourceOf(dial))) | |
| 760 | + | } | |
| 761 | + | func NewZwpTabletPadGroupV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 762 | + | return d.CreateGlobal(ZwpTabletPadGroupV2Interface, version, bind) | |
| 763 | + | } | |
| 764 | + | ||
| 765 | + | // ZwpTabletPadV2 a set of buttons, rings, strips and dials. | |
| 766 | + | type ZwpTabletPadV2 struct{ *server.Resource } | |
| 767 | + | ||
| 768 | + | func WrapZwpTabletPadV2(r *server.Resource) *ZwpTabletPadV2 { | |
| 769 | + | if r == nil { | |
| 770 | + | return nil | |
| 771 | + | } | |
| 772 | + | return &ZwpTabletPadV2{r} | |
| 773 | + | } | |
| 774 | + | ||
| 775 | + | const ZwpTabletPadV2RequestSetFeedback uint32 = 0 | |
| 776 | + | const ZwpTabletPadV2RequestDestroy uint32 = 1 | |
| 777 | + | const ZwpTabletPadV2EventGroup uint32 = 0 | |
| 778 | + | const ZwpTabletPadV2EventPath uint32 = 1 | |
| 779 | + | const ZwpTabletPadV2EventButtons uint32 = 2 | |
| 780 | + | const ZwpTabletPadV2EventDone uint32 = 3 | |
| 781 | + | const ZwpTabletPadV2EventButton uint32 = 4 | |
| 782 | + | const ZwpTabletPadV2EventEnter uint32 = 5 | |
| 783 | + | const ZwpTabletPadV2EventLeave uint32 = 6 | |
| 784 | + | const ZwpTabletPadV2EventRemoved uint32 = 7 | |
| 785 | + | ||
| 786 | + | // ZwpTabletPadV2ButtonState physical button state. | |
| 787 | + | type ZwpTabletPadV2ButtonState uint32 | |
| 788 | + | ||
| 789 | + | const ( | |
| 790 | + | ZwpTabletPadV2ButtonStateReleased ZwpTabletPadV2ButtonState = 0 | |
| 791 | + | ZwpTabletPadV2ButtonStatePressed ZwpTabletPadV2ButtonState = 1 | |
| 792 | + | ) | |
| 793 | + | ||
| 794 | + | // ZwpTabletPadV2Handler handles zwp_tablet_pad_v2 requests. | |
| 795 | + | type ZwpTabletPadV2Handler interface { | |
| 796 | + | SetFeedback(self *ZwpTabletPadV2, button uint32, description string, serial uint32) | |
| 797 | + | Destroy(self *ZwpTabletPadV2) | |
| 798 | + | } | |
| 799 | + | ||
| 800 | + | func NewZwpTabletPadV2(c server.Client, version int32, id uint32, h ZwpTabletPadV2Handler) (*ZwpTabletPadV2, error) { | |
| 801 | + | if h == nil { | |
| 802 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_v2") | |
| 803 | + | } | |
| 804 | + | var self *ZwpTabletPadV2 | |
| 805 | + | r, err := c.CreateResource(ZwpTabletPadV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 806 | + | switch opcode { | |
| 807 | + | case 0: | |
| 808 | + | h.SetFeedback(self, args[0].Uint(), args[1].String(), args[2].Uint()) | |
| 809 | + | case 1: | |
| 810 | + | h.Destroy(self) | |
| 811 | + | self.Destroy() | |
| 812 | + | } | |
| 813 | + | }) | |
| 814 | + | if err != nil { | |
| 815 | + | return nil, err | |
| 816 | + | } | |
| 817 | + | self = WrapZwpTabletPadV2(r) | |
| 818 | + | r.Data = self | |
| 819 | + | return self, nil | |
| 820 | + | } | |
| 821 | + | ||
| 822 | + | // SendGroup group announced. | |
| 823 | + | func (self *ZwpTabletPadV2) SendGroup(padGroup *ZwpTabletPadGroupV2) { | |
| 824 | + | self.PostEvent(ZwpTabletPadV2EventGroup, server.NewID(resourceOf(padGroup))) | |
| 825 | + | } | |
| 826 | + | ||
| 827 | + | // SendPath path to the device. | |
| 828 | + | func (self *ZwpTabletPadV2) SendPath(path string) { | |
| 829 | + | var p runtime.Pinner | |
| 830 | + | defer p.Unpin() | |
| 831 | + | self.PostEvent(ZwpTabletPadV2EventPath, server.String(&p, path, false)) | |
| 832 | + | } | |
| 833 | + | ||
| 834 | + | // SendButtons buttons announced. | |
| 835 | + | func (self *ZwpTabletPadV2) SendButtons(buttons uint32) { | |
| 836 | + | self.PostEvent(ZwpTabletPadV2EventButtons, server.Uint(buttons)) | |
| 837 | + | } | |
| 838 | + | ||
| 839 | + | // SendDone pad description event sequence complete. | |
| 840 | + | func (self *ZwpTabletPadV2) SendDone() { | |
| 841 | + | self.PostEvent(ZwpTabletPadV2EventDone) | |
| 842 | + | } | |
| 843 | + | ||
| 844 | + | // SendButton physical button state. | |
| 845 | + | func (self *ZwpTabletPadV2) SendButton(time uint32, button uint32, state uint32) { | |
| 846 | + | self.PostEvent(ZwpTabletPadV2EventButton, server.Uint(time), server.Uint(button), server.Uint(state)) | |
| 847 | + | } | |
| 848 | + | ||
| 849 | + | // SendEnter enter event. | |
| 850 | + | func (self *ZwpTabletPadV2) SendEnter(serial uint32, tablet *ZwpTabletV2, surface *wayland.Surface) { | |
| 851 | + | self.PostEvent(ZwpTabletPadV2EventEnter, server.Uint(serial), server.Object(resourceOf(tablet)), server.Object(resourceOf(surface))) | |
| 852 | + | } | |
| 853 | + | ||
| 854 | + | // SendLeave leave event. | |
| 855 | + | func (self *ZwpTabletPadV2) SendLeave(serial uint32, surface *wayland.Surface) { | |
| 856 | + | self.PostEvent(ZwpTabletPadV2EventLeave, server.Uint(serial), server.Object(resourceOf(surface))) | |
| 857 | + | } | |
| 858 | + | ||
| 859 | + | // SendRemoved pad removed event. | |
| 860 | + | func (self *ZwpTabletPadV2) SendRemoved() { | |
| 861 | + | self.PostEvent(ZwpTabletPadV2EventRemoved) | |
| 862 | + | } | |
| 863 | + | func NewZwpTabletPadV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 864 | + | return d.CreateGlobal(ZwpTabletPadV2Interface, version, bind) | |
| 865 | + | } | |
| 866 | + | ||
| 867 | + | // ZwpTabletPadDialV2 pad dial. | |
| 868 | + | type ZwpTabletPadDialV2 struct{ *server.Resource } | |
| 869 | + | ||
| 870 | + | func WrapZwpTabletPadDialV2(r *server.Resource) *ZwpTabletPadDialV2 { | |
| 871 | + | if r == nil { | |
| 872 | + | return nil | |
| 873 | + | } | |
| 874 | + | return &ZwpTabletPadDialV2{r} | |
| 875 | + | } | |
| 876 | + | ||
| 877 | + | const ZwpTabletPadDialV2RequestSetFeedback uint32 = 0 | |
| 878 | + | const ZwpTabletPadDialV2RequestDestroy uint32 = 1 | |
| 879 | + | const ZwpTabletPadDialV2EventDelta uint32 = 0 | |
| 880 | + | const ZwpTabletPadDialV2EventFrame uint32 = 1 | |
| 881 | + | ||
| 882 | + | // ZwpTabletPadDialV2Handler handles zwp_tablet_pad_dial_v2 requests. | |
| 883 | + | type ZwpTabletPadDialV2Handler interface { | |
| 884 | + | SetFeedback(self *ZwpTabletPadDialV2, description string, serial uint32) | |
| 885 | + | Destroy(self *ZwpTabletPadDialV2) | |
| 886 | + | } | |
| 887 | + | ||
| 888 | + | func NewZwpTabletPadDialV2(c server.Client, version int32, id uint32, h ZwpTabletPadDialV2Handler) (*ZwpTabletPadDialV2, error) { | |
| 889 | + | if h == nil { | |
| 890 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_dial_v2") | |
| 891 | + | } | |
| 892 | + | var self *ZwpTabletPadDialV2 | |
| 893 | + | r, err := c.CreateResource(ZwpTabletPadDialV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |
| 894 | + | switch opcode { | |
| 895 | + | case 0: | |
| 896 | + | h.SetFeedback(self, args[0].String(), args[1].Uint()) | |
| 897 | + | case 1: | |
| 898 | + | h.Destroy(self) | |
| 899 | + | self.Destroy() | |
| 900 | + | } | |
| 901 | + | }) | |
| 902 | + | if err != nil { | |
| 903 | + | return nil, err | |
| 904 | + | } | |
| 905 | + | self = WrapZwpTabletPadDialV2(r) | |
| 906 | + | r.Data = self | |
| 907 | + | return self, nil | |
| 908 | + | } | |
| 909 | + | ||
| 910 | + | // SendDelta delta movement. | |
| 911 | + | func (self *ZwpTabletPadDialV2) SendDelta(value120 int32) { | |
| 912 | + | self.PostEvent(ZwpTabletPadDialV2EventDelta, server.Int(value120)) | |
| 913 | + | } | |
| 914 | + | ||
| 915 | + | // SendFrame end of a dial event sequence. | |
| 916 | + | func (self *ZwpTabletPadDialV2) SendFrame(time uint32) { | |
| 917 | + | self.PostEvent(ZwpTabletPadDialV2EventFrame, server.Uint(time)) | |
| 918 | + | } | |
| 919 | + | func NewZwpTabletPadDialV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |
| 920 | + | return d.CreateGlobal(ZwpTabletPadDialV2Interface, version, bind) | |
| 921 | + | } | |
| 922 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |
| 923 | + | if v == nil { | |
| 924 | + | return nil | |
| 925 | + | } | |
| 926 | + | return v.GetResource() | |
| 927 | + | } | |
| 928 | + | func (self *ZwpTabletManagerV2) GetResource() *server.Resource { | |
| 929 | + | if self == nil { | |
| 930 | + | return nil | |
| 931 | + | } | |
| 932 | + | return self.Resource | |
| 933 | + | } | |
| 934 | + | func (self *ZwpTabletSeatV2) GetResource() *server.Resource { | |
| 935 | + | if self == nil { | |
| 936 | + | return nil | |
| 937 | + | } | |
| 938 | + | return self.Resource | |
| 939 | + | } | |
| 940 | + | func (self *ZwpTabletToolV2) GetResource() *server.Resource { | |
| 941 | + | if self == nil { | |
| 942 | + | return nil | |
| 943 | + | } | |
| 944 | + | return self.Resource | |
| 945 | + | } | |
| 946 | + | func (self *ZwpTabletV2) GetResource() *server.Resource { | |
| 947 | + | if self == nil { | |
| 948 | + | return nil | |
| 949 | + | } | |
| 950 | + | return self.Resource | |
| 951 | + | } | |
| 952 | + | func (self *ZwpTabletPadRingV2) GetResource() *server.Resource { | |
| 953 | + | if self == nil { | |
| 954 | + | return nil | |
| 955 | + | } | |
| 956 | + | return self.Resource | |
| 957 | + | } | |
| 958 | + | func (self *ZwpTabletPadStripV2) GetResource() *server.Resource { | |
| 959 | + | if self == nil { | |
| 960 | + | return nil | |
| 961 | + | } | |
| 962 | + | return self.Resource | |
| 963 | + | } | |
| 964 | + | func (self *ZwpTabletPadGroupV2) GetResource() *server.Resource { | |
| 965 | + | if self == nil { | |
| 966 | + | return nil | |
| 967 | + | } | |
| 968 | + | return self.Resource | |
| 969 | + | } | |
| 970 | + | func (self *ZwpTabletPadV2) GetResource() *server.Resource { | |
| 971 | + | if self == nil { | |
| 972 | + | return nil | |
| 973 | + | } | |
| 974 | + | return self.Resource | |
| 975 | + | } | |
| 976 | + | func (self *ZwpTabletPadDialV2) GetResource() *server.Resource { | |
| 977 | + | if self == nil { | |
| 978 | + | return nil | |
| 979 | + | } | |
| 980 | + | return self.Resource | |
| 981 | + | } | |
| @@ -0,0 +1,981 @@ | |||||
| 1 | + | // Code generated by wlgen; DO NOT EDIT. | |||
| 2 | + | package tabletv2 | |||
| 3 | + | ||||
| 4 | + | import ( | |||
| 5 | + | "fmt" | |||
| 6 | + | wayland "github.com/bnema/purego-libwayland/protocol/wayland" | |||
| 7 | + | "github.com/bnema/purego-libwayland/server" | |||
| 8 | + | "runtime" | |||
| 9 | + | ) | |||
| 10 | + | ||||
| 11 | + | var ZwpTabletManagerV2Interface *server.Interface | |||
| 12 | + | var ZwpTabletSeatV2Interface *server.Interface | |||
| 13 | + | var ZwpTabletToolV2Interface *server.Interface | |||
| 14 | + | var ZwpTabletV2Interface *server.Interface | |||
| 15 | + | var ZwpTabletPadRingV2Interface *server.Interface | |||
| 16 | + | var ZwpTabletPadStripV2Interface *server.Interface | |||
| 17 | + | var ZwpTabletPadGroupV2Interface *server.Interface | |||
| 18 | + | var ZwpTabletPadV2Interface *server.Interface | |||
| 19 | + | var ZwpTabletPadDialV2Interface *server.Interface | |||
| 20 | + | ||||
| 21 | + | func init() { | |||
| 22 | + | ZwpTabletManagerV2Interface = &server.Interface{Name: "zwp_tablet_manager_v2", Version: 2} | |||
| 23 | + | ZwpTabletSeatV2Interface = &server.Interface{Name: "zwp_tablet_seat_v2", Version: 2} | |||
| 24 | + | ZwpTabletToolV2Interface = &server.Interface{Name: "zwp_tablet_tool_v2", Version: 2} | |||
| 25 | + | ZwpTabletV2Interface = &server.Interface{Name: "zwp_tablet_v2", Version: 2} | |||
| 26 | + | ZwpTabletPadRingV2Interface = &server.Interface{Name: "zwp_tablet_pad_ring_v2", Version: 2} | |||
| 27 | + | ZwpTabletPadStripV2Interface = &server.Interface{Name: "zwp_tablet_pad_strip_v2", Version: 2} | |||
| 28 | + | ZwpTabletPadGroupV2Interface = &server.Interface{Name: "zwp_tablet_pad_group_v2", Version: 2} | |||
| 29 | + | ZwpTabletPadV2Interface = &server.Interface{Name: "zwp_tablet_pad_v2", Version: 2} | |||
| 30 | + | ZwpTabletPadDialV2Interface = &server.Interface{Name: "zwp_tablet_pad_dial_v2", Version: 2} | |||
| 31 | + | ZwpTabletManagerV2Interface.Requests = []server.Message{ | |||
| 32 | + | {Name: "get_tablet_seat", Signature: "no", Types: []*server.Interface{ZwpTabletSeatV2Interface, wayland.SeatInterface}}, | |||
| 33 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 34 | + | } | |||
| 35 | + | ZwpTabletManagerV2Interface.Events = []server.Message{} | |||
| 36 | + | ZwpTabletSeatV2Interface.Requests = []server.Message{ | |||
| 37 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 38 | + | } | |||
| 39 | + | ZwpTabletSeatV2Interface.Events = []server.Message{ | |||
| 40 | + | {Name: "tablet_added", Signature: "n", Types: []*server.Interface{ZwpTabletV2Interface}}, | |||
| 41 | + | {Name: "tool_added", Signature: "n", Types: []*server.Interface{ZwpTabletToolV2Interface}}, | |||
| 42 | + | {Name: "pad_added", Signature: "n", Types: []*server.Interface{ZwpTabletPadV2Interface}}, | |||
| 43 | + | } | |||
| 44 | + | ZwpTabletToolV2Interface.Requests = []server.Message{ | |||
| 45 | + | {Name: "set_cursor", Signature: "u?oii", Types: []*server.Interface{nil, wayland.SurfaceInterface, nil, nil}}, | |||
| 46 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 47 | + | } | |||
| 48 | + | ZwpTabletToolV2Interface.Events = []server.Message{ | |||
| 49 | + | {Name: "type", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 50 | + | {Name: "hardware_serial", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |||
| 51 | + | {Name: "hardware_id_wacom", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |||
| 52 | + | {Name: "capability", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 53 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |||
| 54 | + | {Name: "removed", Signature: "", Types: []*server.Interface{}}, | |||
| 55 | + | {Name: "proximity_in", Signature: "uoo", Types: []*server.Interface{nil, ZwpTabletV2Interface, wayland.SurfaceInterface}}, | |||
| 56 | + | {Name: "proximity_out", Signature: "", Types: []*server.Interface{}}, | |||
| 57 | + | {Name: "down", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 58 | + | {Name: "up", Signature: "", Types: []*server.Interface{}}, | |||
| 59 | + | {Name: "motion", Signature: "ff", Types: []*server.Interface{nil, nil}}, | |||
| 60 | + | {Name: "pressure", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 61 | + | {Name: "distance", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 62 | + | {Name: "tilt", Signature: "ff", Types: []*server.Interface{nil, nil}}, | |||
| 63 | + | {Name: "rotation", Signature: "f", Types: []*server.Interface{nil}}, | |||
| 64 | + | {Name: "slider", Signature: "i", Types: []*server.Interface{nil}}, | |||
| 65 | + | {Name: "wheel", Signature: "fi", Types: []*server.Interface{nil, nil}}, | |||
| 66 | + | {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |||
| 67 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 68 | + | } | |||
| 69 | + | ZwpTabletV2Interface.Requests = []server.Message{ | |||
| 70 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 71 | + | } | |||
| 72 | + | ZwpTabletV2Interface.Events = []server.Message{ | |||
| 73 | + | {Name: "name", Signature: "s", Types: []*server.Interface{nil}}, | |||
| 74 | + | {Name: "id", Signature: "uu", Types: []*server.Interface{nil, nil}}, | |||
| 75 | + | {Name: "path", Signature: "s", Types: []*server.Interface{nil}}, | |||
| 76 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |||
| 77 | + | {Name: "removed", Signature: "", Types: []*server.Interface{}}, | |||
| 78 | + | {Name: "bustype", Signature: "2u", Types: []*server.Interface{nil}}, | |||
| 79 | + | } | |||
| 80 | + | ZwpTabletPadRingV2Interface.Requests = []server.Message{ | |||
| 81 | + | {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}}, | |||
| 82 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 83 | + | } | |||
| 84 | + | ZwpTabletPadRingV2Interface.Events = []server.Message{ | |||
| 85 | + | {Name: "source", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 86 | + | {Name: "angle", Signature: "f", Types: []*server.Interface{nil}}, | |||
| 87 | + | {Name: "stop", Signature: "", Types: []*server.Interface{}}, | |||
| 88 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 89 | + | } | |||
| 90 | + | ZwpTabletPadStripV2Interface.Requests = []server.Message{ | |||
| 91 | + | {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}}, | |||
| 92 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 93 | + | } | |||
| 94 | + | ZwpTabletPadStripV2Interface.Events = []server.Message{ | |||
| 95 | + | {Name: "source", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 96 | + | {Name: "position", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 97 | + | {Name: "stop", Signature: "", Types: []*server.Interface{}}, | |||
| 98 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 99 | + | } | |||
| 100 | + | ZwpTabletPadGroupV2Interface.Requests = []server.Message{ | |||
| 101 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 102 | + | } | |||
| 103 | + | ZwpTabletPadGroupV2Interface.Events = []server.Message{ | |||
| 104 | + | {Name: "buttons", Signature: "a", Types: []*server.Interface{nil}}, | |||
| 105 | + | {Name: "ring", Signature: "n", Types: []*server.Interface{ZwpTabletPadRingV2Interface}}, | |||
| 106 | + | {Name: "strip", Signature: "n", Types: []*server.Interface{ZwpTabletPadStripV2Interface}}, | |||
| 107 | + | {Name: "modes", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 108 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |||
| 109 | + | {Name: "mode_switch", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |||
| 110 | + | {Name: "dial", Signature: "2n", Types: []*server.Interface{ZwpTabletPadDialV2Interface}}, | |||
| 111 | + | } | |||
| 112 | + | ZwpTabletPadV2Interface.Requests = []server.Message{ | |||
| 113 | + | {Name: "set_feedback", Signature: "usu", Types: []*server.Interface{nil, nil, nil}}, | |||
| 114 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 115 | + | } | |||
| 116 | + | ZwpTabletPadV2Interface.Events = []server.Message{ | |||
| 117 | + | {Name: "group", Signature: "n", Types: []*server.Interface{ZwpTabletPadGroupV2Interface}}, | |||
| 118 | + | {Name: "path", Signature: "s", Types: []*server.Interface{nil}}, | |||
| 119 | + | {Name: "buttons", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 120 | + | {Name: "done", Signature: "", Types: []*server.Interface{}}, | |||
| 121 | + | {Name: "button", Signature: "uuu", Types: []*server.Interface{nil, nil, nil}}, | |||
| 122 | + | {Name: "enter", Signature: "uoo", Types: []*server.Interface{nil, ZwpTabletV2Interface, wayland.SurfaceInterface}}, | |||
| 123 | + | {Name: "leave", Signature: "uo", Types: []*server.Interface{nil, wayland.SurfaceInterface}}, | |||
| 124 | + | {Name: "removed", Signature: "", Types: []*server.Interface{}}, | |||
| 125 | + | } | |||
| 126 | + | ZwpTabletPadDialV2Interface.Requests = []server.Message{ | |||
| 127 | + | {Name: "set_feedback", Signature: "su", Types: []*server.Interface{nil, nil}}, | |||
| 128 | + | {Name: "destroy", Signature: "", Types: []*server.Interface{}}, | |||
| 129 | + | } | |||
| 130 | + | ZwpTabletPadDialV2Interface.Events = []server.Message{ | |||
| 131 | + | {Name: "delta", Signature: "i", Types: []*server.Interface{nil}}, | |||
| 132 | + | {Name: "frame", Signature: "u", Types: []*server.Interface{nil}}, | |||
| 133 | + | } | |||
| 134 | + | if err := server.NewInterfaces(ZwpTabletManagerV2Interface, ZwpTabletSeatV2Interface, ZwpTabletToolV2Interface, ZwpTabletV2Interface, ZwpTabletPadRingV2Interface, ZwpTabletPadStripV2Interface, ZwpTabletPadGroupV2Interface, ZwpTabletPadV2Interface, ZwpTabletPadDialV2Interface); err != nil { | |||
| 135 | + | panic(err) | |||
| 136 | + | } | |||
| 137 | + | } | |||
| 138 | + | ||||
| 139 | + | // ZwpTabletManagerV2 controller object for graphic tablet devices. | |||
| 140 | + | type ZwpTabletManagerV2 struct{ *server.Resource } | |||
| 141 | + | ||||
| 142 | + | func WrapZwpTabletManagerV2(r *server.Resource) *ZwpTabletManagerV2 { | |||
| 143 | + | if r == nil { | |||
| 144 | + | return nil | |||
| 145 | + | } | |||
| 146 | + | return &ZwpTabletManagerV2{r} | |||
| 147 | + | } | |||
| 148 | + | ||||
| 149 | + | const ZwpTabletManagerV2RequestGetTabletSeat uint32 = 0 | |||
| 150 | + | const ZwpTabletManagerV2RequestDestroy uint32 = 1 | |||
| 151 | + | ||||
| 152 | + | // ZwpTabletManagerV2Handler handles zwp_tablet_manager_v2 requests. | |||
| 153 | + | type ZwpTabletManagerV2Handler interface { | |||
| 154 | + | GetTabletSeat(self *ZwpTabletManagerV2, tabletSeat uint32, seat *wayland.Seat) | |||
| 155 | + | Destroy(self *ZwpTabletManagerV2) | |||
| 156 | + | } | |||
| 157 | + | ||||
| 158 | + | func NewZwpTabletManagerV2(c server.Client, version int32, id uint32, h ZwpTabletManagerV2Handler) (*ZwpTabletManagerV2, error) { | |||
| 159 | + | if h == nil { | |||
| 160 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_manager_v2") | |||
| 161 | + | } | |||
| 162 | + | var self *ZwpTabletManagerV2 | |||
| 163 | + | r, err := c.CreateResource(ZwpTabletManagerV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 164 | + | switch opcode { | |||
| 165 | + | case 0: | |||
| 166 | + | h.GetTabletSeat(self, args[0].NewID(), wayland.WrapSeat(args[1].Resource())) | |||
| 167 | + | case 1: | |||
| 168 | + | h.Destroy(self) | |||
| 169 | + | self.Destroy() | |||
| 170 | + | } | |||
| 171 | + | }) | |||
| 172 | + | if err != nil { | |||
| 173 | + | return nil, err | |||
| 174 | + | } | |||
| 175 | + | self = WrapZwpTabletManagerV2(r) | |||
| 176 | + | r.Data = self | |||
| 177 | + | return self, nil | |||
| 178 | + | } | |||
| 179 | + | func NewZwpTabletManagerV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 180 | + | return d.CreateGlobal(ZwpTabletManagerV2Interface, version, bind) | |||
| 181 | + | } | |||
| 182 | + | ||||
| 183 | + | // ZwpTabletSeatV2 controller object for graphic tablet devices of a seat. | |||
| 184 | + | type ZwpTabletSeatV2 struct{ *server.Resource } | |||
| 185 | + | ||||
| 186 | + | func WrapZwpTabletSeatV2(r *server.Resource) *ZwpTabletSeatV2 { | |||
| 187 | + | if r == nil { | |||
| 188 | + | return nil | |||
| 189 | + | } | |||
| 190 | + | return &ZwpTabletSeatV2{r} | |||
| 191 | + | } | |||
| 192 | + | ||||
| 193 | + | const ZwpTabletSeatV2RequestDestroy uint32 = 0 | |||
| 194 | + | const ZwpTabletSeatV2EventTabletAdded uint32 = 0 | |||
| 195 | + | const ZwpTabletSeatV2EventToolAdded uint32 = 1 | |||
| 196 | + | const ZwpTabletSeatV2EventPadAdded uint32 = 2 | |||
| 197 | + | ||||
| 198 | + | // ZwpTabletSeatV2Handler handles zwp_tablet_seat_v2 requests. | |||
| 199 | + | type ZwpTabletSeatV2Handler interface { | |||
| 200 | + | Destroy(self *ZwpTabletSeatV2) | |||
| 201 | + | } | |||
| 202 | + | ||||
| 203 | + | func NewZwpTabletSeatV2(c server.Client, version int32, id uint32, h ZwpTabletSeatV2Handler) (*ZwpTabletSeatV2, error) { | |||
| 204 | + | if h == nil { | |||
| 205 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_seat_v2") | |||
| 206 | + | } | |||
| 207 | + | var self *ZwpTabletSeatV2 | |||
| 208 | + | r, err := c.CreateResource(ZwpTabletSeatV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 209 | + | switch opcode { | |||
| 210 | + | case 0: | |||
| 211 | + | h.Destroy(self) | |||
| 212 | + | self.Destroy() | |||
| 213 | + | } | |||
| 214 | + | }) | |||
| 215 | + | if err != nil { | |||
| 216 | + | return nil, err | |||
| 217 | + | } | |||
| 218 | + | self = WrapZwpTabletSeatV2(r) | |||
| 219 | + | r.Data = self | |||
| 220 | + | return self, nil | |||
| 221 | + | } | |||
| 222 | + | ||||
| 223 | + | // SendTabletAdded new device notification. | |||
| 224 | + | func (self *ZwpTabletSeatV2) SendTabletAdded(id *ZwpTabletV2) { | |||
| 225 | + | self.PostEvent(ZwpTabletSeatV2EventTabletAdded, server.NewID(resourceOf(id))) | |||
| 226 | + | } | |||
| 227 | + | ||||
| 228 | + | // SendToolAdded a new tool has been used with a tablet. | |||
| 229 | + | func (self *ZwpTabletSeatV2) SendToolAdded(id *ZwpTabletToolV2) { | |||
| 230 | + | self.PostEvent(ZwpTabletSeatV2EventToolAdded, server.NewID(resourceOf(id))) | |||
| 231 | + | } | |||
| 232 | + | ||||
| 233 | + | // SendPadAdded new pad notification. | |||
| 234 | + | func (self *ZwpTabletSeatV2) SendPadAdded(id *ZwpTabletPadV2) { | |||
| 235 | + | self.PostEvent(ZwpTabletSeatV2EventPadAdded, server.NewID(resourceOf(id))) | |||
| 236 | + | } | |||
| 237 | + | func NewZwpTabletSeatV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 238 | + | return d.CreateGlobal(ZwpTabletSeatV2Interface, version, bind) | |||
| 239 | + | } | |||
| 240 | + | ||||
| 241 | + | // ZwpTabletToolV2 a physical tablet tool. | |||
| 242 | + | type ZwpTabletToolV2 struct{ *server.Resource } | |||
| 243 | + | ||||
| 244 | + | func WrapZwpTabletToolV2(r *server.Resource) *ZwpTabletToolV2 { | |||
| 245 | + | if r == nil { | |||
| 246 | + | return nil | |||
| 247 | + | } | |||
| 248 | + | return &ZwpTabletToolV2{r} | |||
| 249 | + | } | |||
| 250 | + | ||||
| 251 | + | const ZwpTabletToolV2RequestSetCursor uint32 = 0 | |||
| 252 | + | const ZwpTabletToolV2RequestDestroy uint32 = 1 | |||
| 253 | + | const ZwpTabletToolV2EventType uint32 = 0 | |||
| 254 | + | const ZwpTabletToolV2EventHardwareSerial uint32 = 1 | |||
| 255 | + | const ZwpTabletToolV2EventHardwareIdWacom uint32 = 2 | |||
| 256 | + | const ZwpTabletToolV2EventCapability uint32 = 3 | |||
| 257 | + | const ZwpTabletToolV2EventDone uint32 = 4 | |||
| 258 | + | const ZwpTabletToolV2EventRemoved uint32 = 5 | |||
| 259 | + | const ZwpTabletToolV2EventProximityIn uint32 = 6 | |||
| 260 | + | const ZwpTabletToolV2EventProximityOut uint32 = 7 | |||
| 261 | + | const ZwpTabletToolV2EventDown uint32 = 8 | |||
| 262 | + | const ZwpTabletToolV2EventUp uint32 = 9 | |||
| 263 | + | const ZwpTabletToolV2EventMotion uint32 = 10 | |||
| 264 | + | const ZwpTabletToolV2EventPressure uint32 = 11 | |||
| 265 | + | const ZwpTabletToolV2EventDistance uint32 = 12 | |||
| 266 | + | const ZwpTabletToolV2EventTilt uint32 = 13 | |||
| 267 | + | const ZwpTabletToolV2EventRotation uint32 = 14 | |||
| 268 | + | const ZwpTabletToolV2EventSlider uint32 = 15 | |||
| 269 | + | const ZwpTabletToolV2EventWheel uint32 = 16 | |||
| 270 | + | const ZwpTabletToolV2EventButton uint32 = 17 | |||
| 271 | + | const ZwpTabletToolV2EventFrame uint32 = 18 | |||
| 272 | + | ||||
| 273 | + | // ZwpTabletToolV2Type a physical tool type. | |||
| 274 | + | type ZwpTabletToolV2Type uint32 | |||
| 275 | + | ||||
| 276 | + | const ( | |||
| 277 | + | ZwpTabletToolV2TypePen ZwpTabletToolV2Type = 0x140 | |||
| 278 | + | ZwpTabletToolV2TypeEraser ZwpTabletToolV2Type = 0x141 | |||
| 279 | + | ZwpTabletToolV2TypeBrush ZwpTabletToolV2Type = 0x142 | |||
| 280 | + | ZwpTabletToolV2TypePencil ZwpTabletToolV2Type = 0x143 | |||
| 281 | + | ZwpTabletToolV2TypeAirbrush ZwpTabletToolV2Type = 0x144 | |||
| 282 | + | ZwpTabletToolV2TypeFinger ZwpTabletToolV2Type = 0x145 | |||
| 283 | + | ZwpTabletToolV2TypeMouse ZwpTabletToolV2Type = 0x146 | |||
| 284 | + | ZwpTabletToolV2TypeLens ZwpTabletToolV2Type = 0x147 | |||
| 285 | + | ) | |||
| 286 | + | ||||
| 287 | + | // ZwpTabletToolV2Capability capability flags for a tool. | |||
| 288 | + | type ZwpTabletToolV2Capability uint32 | |||
| 289 | + | ||||
| 290 | + | const ( | |||
| 291 | + | ZwpTabletToolV2CapabilityTilt ZwpTabletToolV2Capability = 1 | |||
| 292 | + | ZwpTabletToolV2CapabilityPressure ZwpTabletToolV2Capability = 2 | |||
| 293 | + | ZwpTabletToolV2CapabilityDistance ZwpTabletToolV2Capability = 3 | |||
| 294 | + | ZwpTabletToolV2CapabilityRotation ZwpTabletToolV2Capability = 4 | |||
| 295 | + | ZwpTabletToolV2CapabilitySlider ZwpTabletToolV2Capability = 5 | |||
| 296 | + | ZwpTabletToolV2CapabilityWheel ZwpTabletToolV2Capability = 6 | |||
| 297 | + | ) | |||
| 298 | + | ||||
| 299 | + | // ZwpTabletToolV2ButtonState physical button state. | |||
| 300 | + | type ZwpTabletToolV2ButtonState uint32 | |||
| 301 | + | ||||
| 302 | + | const ( | |||
| 303 | + | ZwpTabletToolV2ButtonStateReleased ZwpTabletToolV2ButtonState = 0 | |||
| 304 | + | ZwpTabletToolV2ButtonStatePressed ZwpTabletToolV2ButtonState = 1 | |||
| 305 | + | ) | |||
| 306 | + | ||||
| 307 | + | // ZwpTabletToolV2Error . | |||
| 308 | + | type ZwpTabletToolV2Error uint32 | |||
| 309 | + | ||||
| 310 | + | const ( | |||
| 311 | + | ZwpTabletToolV2ErrorRole ZwpTabletToolV2Error = 0 | |||
| 312 | + | ) | |||
| 313 | + | ||||
| 314 | + | // ZwpTabletToolV2Handler handles zwp_tablet_tool_v2 requests. | |||
| 315 | + | type ZwpTabletToolV2Handler interface { | |||
| 316 | + | SetCursor(self *ZwpTabletToolV2, serial uint32, surface *wayland.Surface, hotspotX int32, hotspotY int32) | |||
| 317 | + | Destroy(self *ZwpTabletToolV2) | |||
| 318 | + | } | |||
| 319 | + | ||||
| 320 | + | func NewZwpTabletToolV2(c server.Client, version int32, id uint32, h ZwpTabletToolV2Handler) (*ZwpTabletToolV2, error) { | |||
| 321 | + | if h == nil { | |||
| 322 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_tool_v2") | |||
| 323 | + | } | |||
| 324 | + | var self *ZwpTabletToolV2 | |||
| 325 | + | r, err := c.CreateResource(ZwpTabletToolV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 326 | + | switch opcode { | |||
| 327 | + | case 0: | |||
| 328 | + | h.SetCursor(self, args[0].Uint(), wayland.WrapSurface(args[1].Resource()), args[2].Int(), args[3].Int()) | |||
| 329 | + | case 1: | |||
| 330 | + | h.Destroy(self) | |||
| 331 | + | self.Destroy() | |||
| 332 | + | } | |||
| 333 | + | }) | |||
| 334 | + | if err != nil { | |||
| 335 | + | return nil, err | |||
| 336 | + | } | |||
| 337 | + | self = WrapZwpTabletToolV2(r) | |||
| 338 | + | r.Data = self | |||
| 339 | + | return self, nil | |||
| 340 | + | } | |||
| 341 | + | ||||
| 342 | + | // SendType tool type. | |||
| 343 | + | func (self *ZwpTabletToolV2) SendType(toolType uint32) { | |||
| 344 | + | self.PostEvent(ZwpTabletToolV2EventType, server.Uint(toolType)) | |||
| 345 | + | } | |||
| 346 | + | ||||
| 347 | + | // SendHardwareSerial unique hardware serial number of the tool. | |||
| 348 | + | func (self *ZwpTabletToolV2) SendHardwareSerial(hardwareSerialHi uint32, hardwareSerialLo uint32) { | |||
| 349 | + | self.PostEvent(ZwpTabletToolV2EventHardwareSerial, server.Uint(hardwareSerialHi), server.Uint(hardwareSerialLo)) | |||
| 350 | + | } | |||
| 351 | + | ||||
| 352 | + | // SendHardwareIdWacom hardware id notification in Wacom's format. | |||
| 353 | + | func (self *ZwpTabletToolV2) SendHardwareIdWacom(hardwareIdHi uint32, hardwareIdLo uint32) { | |||
| 354 | + | self.PostEvent(ZwpTabletToolV2EventHardwareIdWacom, server.Uint(hardwareIdHi), server.Uint(hardwareIdLo)) | |||
| 355 | + | } | |||
| 356 | + | ||||
| 357 | + | // SendCapability tool capability notification. | |||
| 358 | + | func (self *ZwpTabletToolV2) SendCapability(capability uint32) { | |||
| 359 | + | self.PostEvent(ZwpTabletToolV2EventCapability, server.Uint(capability)) | |||
| 360 | + | } | |||
| 361 | + | ||||
| 362 | + | // SendDone tool description events sequence complete. | |||
| 363 | + | func (self *ZwpTabletToolV2) SendDone() { | |||
| 364 | + | self.PostEvent(ZwpTabletToolV2EventDone) | |||
| 365 | + | } | |||
| 366 | + | ||||
| 367 | + | // SendRemoved tool removed. | |||
| 368 | + | func (self *ZwpTabletToolV2) SendRemoved() { | |||
| 369 | + | self.PostEvent(ZwpTabletToolV2EventRemoved) | |||
| 370 | + | } | |||
| 371 | + | ||||
| 372 | + | // SendProximityIn proximity in event. | |||
| 373 | + | func (self *ZwpTabletToolV2) SendProximityIn(serial uint32, tablet *ZwpTabletV2, surface *wayland.Surface) { | |||
| 374 | + | self.PostEvent(ZwpTabletToolV2EventProximityIn, server.Uint(serial), server.Object(resourceOf(tablet)), server.Object(resourceOf(surface))) | |||
| 375 | + | } | |||
| 376 | + | ||||
| 377 | + | // SendProximityOut proximity out event. | |||
| 378 | + | func (self *ZwpTabletToolV2) SendProximityOut() { | |||
| 379 | + | self.PostEvent(ZwpTabletToolV2EventProximityOut) | |||
| 380 | + | } | |||
| 381 | + | ||||
| 382 | + | // SendDown tablet tool is making contact. | |||
| 383 | + | func (self *ZwpTabletToolV2) SendDown(serial uint32) { | |||
| 384 | + | self.PostEvent(ZwpTabletToolV2EventDown, server.Uint(serial)) | |||
| 385 | + | } | |||
| 386 | + | ||||
| 387 | + | // SendUp tablet tool is no longer making contact. | |||
| 388 | + | func (self *ZwpTabletToolV2) SendUp() { | |||
| 389 | + | self.PostEvent(ZwpTabletToolV2EventUp) | |||
| 390 | + | } | |||
| 391 | + | ||||
| 392 | + | // SendMotion motion event. | |||
| 393 | + | func (self *ZwpTabletToolV2) SendMotion(x server.Fixed, y server.Fixed) { | |||
| 394 | + | self.PostEvent(ZwpTabletToolV2EventMotion, server.FixedArg(x), server.FixedArg(y)) | |||
| 395 | + | } | |||
| 396 | + | ||||
| 397 | + | // SendPressure pressure change event. | |||
| 398 | + | func (self *ZwpTabletToolV2) SendPressure(pressure uint32) { | |||
| 399 | + | self.PostEvent(ZwpTabletToolV2EventPressure, server.Uint(pressure)) | |||
| 400 | + | } | |||
| 401 | + | ||||
| 402 | + | // SendDistance distance change event. | |||
| 403 | + | func (self *ZwpTabletToolV2) SendDistance(distance uint32) { | |||
| 404 | + | self.PostEvent(ZwpTabletToolV2EventDistance, server.Uint(distance)) | |||
| 405 | + | } | |||
| 406 | + | ||||
| 407 | + | // SendTilt tilt change event. | |||
| 408 | + | func (self *ZwpTabletToolV2) SendTilt(tiltX server.Fixed, tiltY server.Fixed) { | |||
| 409 | + | self.PostEvent(ZwpTabletToolV2EventTilt, server.FixedArg(tiltX), server.FixedArg(tiltY)) | |||
| 410 | + | } | |||
| 411 | + | ||||
| 412 | + | // SendRotation z-rotation change event. | |||
| 413 | + | func (self *ZwpTabletToolV2) SendRotation(degrees server.Fixed) { | |||
| 414 | + | self.PostEvent(ZwpTabletToolV2EventRotation, server.FixedArg(degrees)) | |||
| 415 | + | } | |||
| 416 | + | ||||
| 417 | + | // SendSlider Slider position change event. | |||
| 418 | + | func (self *ZwpTabletToolV2) SendSlider(position int32) { | |||
| 419 | + | self.PostEvent(ZwpTabletToolV2EventSlider, server.Int(position)) | |||
| 420 | + | } | |||
| 421 | + | ||||
| 422 | + | // SendWheel Wheel delta event. | |||
| 423 | + | func (self *ZwpTabletToolV2) SendWheel(degrees server.Fixed, clicks int32) { | |||
| 424 | + | self.PostEvent(ZwpTabletToolV2EventWheel, server.FixedArg(degrees), server.Int(clicks)) | |||
| 425 | + | } | |||
| 426 | + | ||||
| 427 | + | // SendButton button event. | |||
| 428 | + | func (self *ZwpTabletToolV2) SendButton(serial uint32, button uint32, state uint32) { | |||
| 429 | + | self.PostEvent(ZwpTabletToolV2EventButton, server.Uint(serial), server.Uint(button), server.Uint(state)) | |||
| 430 | + | } | |||
| 431 | + | ||||
| 432 | + | // SendFrame frame event. | |||
| 433 | + | func (self *ZwpTabletToolV2) SendFrame(time uint32) { | |||
| 434 | + | self.PostEvent(ZwpTabletToolV2EventFrame, server.Uint(time)) | |||
| 435 | + | } | |||
| 436 | + | func NewZwpTabletToolV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 437 | + | return d.CreateGlobal(ZwpTabletToolV2Interface, version, bind) | |||
| 438 | + | } | |||
| 439 | + | ||||
| 440 | + | // ZwpTabletV2 graphics tablet device. | |||
| 441 | + | type ZwpTabletV2 struct{ *server.Resource } | |||
| 442 | + | ||||
| 443 | + | func WrapZwpTabletV2(r *server.Resource) *ZwpTabletV2 { | |||
| 444 | + | if r == nil { | |||
| 445 | + | return nil | |||
| 446 | + | } | |||
| 447 | + | return &ZwpTabletV2{r} | |||
| 448 | + | } | |||
| 449 | + | ||||
| 450 | + | const ZwpTabletV2RequestDestroy uint32 = 0 | |||
| 451 | + | const ZwpTabletV2EventName uint32 = 0 | |||
| 452 | + | const ZwpTabletV2EventId uint32 = 1 | |||
| 453 | + | const ZwpTabletV2EventPath uint32 = 2 | |||
| 454 | + | const ZwpTabletV2EventDone uint32 = 3 | |||
| 455 | + | const ZwpTabletV2EventRemoved uint32 = 4 | |||
| 456 | + | const ZwpTabletV2EventBustype uint32 = 5 | |||
| 457 | + | ||||
| 458 | + | // ZwpTabletV2Bustype bus type . | |||
| 459 | + | type ZwpTabletV2Bustype uint32 | |||
| 460 | + | ||||
| 461 | + | const ( | |||
| 462 | + | ZwpTabletV2BustypeUsb ZwpTabletV2Bustype = 3 | |||
| 463 | + | ZwpTabletV2BustypeBluetooth ZwpTabletV2Bustype = 5 | |||
| 464 | + | ZwpTabletV2BustypeVirtual ZwpTabletV2Bustype = 6 | |||
| 465 | + | ZwpTabletV2BustypeSerial ZwpTabletV2Bustype = 17 | |||
| 466 | + | ZwpTabletV2BustypeI2c ZwpTabletV2Bustype = 24 | |||
| 467 | + | ) | |||
| 468 | + | ||||
| 469 | + | // ZwpTabletV2Handler handles zwp_tablet_v2 requests. | |||
| 470 | + | type ZwpTabletV2Handler interface { | |||
| 471 | + | Destroy(self *ZwpTabletV2) | |||
| 472 | + | } | |||
| 473 | + | ||||
| 474 | + | func NewZwpTabletV2(c server.Client, version int32, id uint32, h ZwpTabletV2Handler) (*ZwpTabletV2, error) { | |||
| 475 | + | if h == nil { | |||
| 476 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_v2") | |||
| 477 | + | } | |||
| 478 | + | var self *ZwpTabletV2 | |||
| 479 | + | r, err := c.CreateResource(ZwpTabletV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 480 | + | switch opcode { | |||
| 481 | + | case 0: | |||
| 482 | + | h.Destroy(self) | |||
| 483 | + | self.Destroy() | |||
| 484 | + | } | |||
| 485 | + | }) | |||
| 486 | + | if err != nil { | |||
| 487 | + | return nil, err | |||
| 488 | + | } | |||
| 489 | + | self = WrapZwpTabletV2(r) | |||
| 490 | + | r.Data = self | |||
| 491 | + | return self, nil | |||
| 492 | + | } | |||
| 493 | + | ||||
| 494 | + | // SendName tablet device name. | |||
| 495 | + | func (self *ZwpTabletV2) SendName(name string) { | |||
| 496 | + | var p runtime.Pinner | |||
| 497 | + | defer p.Unpin() | |||
| 498 | + | self.PostEvent(ZwpTabletV2EventName, server.String(&p, name, false)) | |||
| 499 | + | } | |||
| 500 | + | ||||
| 501 | + | // SendId tablet device vendor/product id. | |||
| 502 | + | func (self *ZwpTabletV2) SendId(vid uint32, pid uint32) { | |||
| 503 | + | self.PostEvent(ZwpTabletV2EventId, server.Uint(vid), server.Uint(pid)) | |||
| 504 | + | } | |||
| 505 | + | ||||
| 506 | + | // SendPath path to the device. | |||
| 507 | + | func (self *ZwpTabletV2) SendPath(path string) { | |||
| 508 | + | var p runtime.Pinner | |||
| 509 | + | defer p.Unpin() | |||
| 510 | + | self.PostEvent(ZwpTabletV2EventPath, server.String(&p, path, false)) | |||
| 511 | + | } | |||
| 512 | + | ||||
| 513 | + | // SendDone tablet description events sequence complete. | |||
| 514 | + | func (self *ZwpTabletV2) SendDone() { | |||
| 515 | + | self.PostEvent(ZwpTabletV2EventDone) | |||
| 516 | + | } | |||
| 517 | + | ||||
| 518 | + | // SendRemoved tablet removed event. | |||
| 519 | + | func (self *ZwpTabletV2) SendRemoved() { | |||
| 520 | + | self.PostEvent(ZwpTabletV2EventRemoved) | |||
| 521 | + | } | |||
| 522 | + | ||||
| 523 | + | // SendBustype tablet device bus type (since version 2). | |||
| 524 | + | func (self *ZwpTabletV2) SendBustype(bustype uint32) { | |||
| 525 | + | self.PostEvent(ZwpTabletV2EventBustype, server.Uint(bustype)) | |||
| 526 | + | } | |||
| 527 | + | func NewZwpTabletV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 528 | + | return d.CreateGlobal(ZwpTabletV2Interface, version, bind) | |||
| 529 | + | } | |||
| 530 | + | ||||
| 531 | + | // ZwpTabletPadRingV2 pad ring. | |||
| 532 | + | type ZwpTabletPadRingV2 struct{ *server.Resource } | |||
| 533 | + | ||||
| 534 | + | func WrapZwpTabletPadRingV2(r *server.Resource) *ZwpTabletPadRingV2 { | |||
| 535 | + | if r == nil { | |||
| 536 | + | return nil | |||
| 537 | + | } | |||
| 538 | + | return &ZwpTabletPadRingV2{r} | |||
| 539 | + | } | |||
| 540 | + | ||||
| 541 | + | const ZwpTabletPadRingV2RequestSetFeedback uint32 = 0 | |||
| 542 | + | const ZwpTabletPadRingV2RequestDestroy uint32 = 1 | |||
| 543 | + | const ZwpTabletPadRingV2EventSource uint32 = 0 | |||
| 544 | + | const ZwpTabletPadRingV2EventAngle uint32 = 1 | |||
| 545 | + | const ZwpTabletPadRingV2EventStop uint32 = 2 | |||
| 546 | + | const ZwpTabletPadRingV2EventFrame uint32 = 3 | |||
| 547 | + | ||||
| 548 | + | // ZwpTabletPadRingV2Source ring axis source. | |||
| 549 | + | type ZwpTabletPadRingV2Source uint32 | |||
| 550 | + | ||||
| 551 | + | const ( | |||
| 552 | + | ZwpTabletPadRingV2SourceFinger ZwpTabletPadRingV2Source = 1 | |||
| 553 | + | ) | |||
| 554 | + | ||||
| 555 | + | // ZwpTabletPadRingV2Handler handles zwp_tablet_pad_ring_v2 requests. | |||
| 556 | + | type ZwpTabletPadRingV2Handler interface { | |||
| 557 | + | SetFeedback(self *ZwpTabletPadRingV2, description string, serial uint32) | |||
| 558 | + | Destroy(self *ZwpTabletPadRingV2) | |||
| 559 | + | } | |||
| 560 | + | ||||
| 561 | + | func NewZwpTabletPadRingV2(c server.Client, version int32, id uint32, h ZwpTabletPadRingV2Handler) (*ZwpTabletPadRingV2, error) { | |||
| 562 | + | if h == nil { | |||
| 563 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_ring_v2") | |||
| 564 | + | } | |||
| 565 | + | var self *ZwpTabletPadRingV2 | |||
| 566 | + | r, err := c.CreateResource(ZwpTabletPadRingV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 567 | + | switch opcode { | |||
| 568 | + | case 0: | |||
| 569 | + | h.SetFeedback(self, args[0].String(), args[1].Uint()) | |||
| 570 | + | case 1: | |||
| 571 | + | h.Destroy(self) | |||
| 572 | + | self.Destroy() | |||
| 573 | + | } | |||
| 574 | + | }) | |||
| 575 | + | if err != nil { | |||
| 576 | + | return nil, err | |||
| 577 | + | } | |||
| 578 | + | self = WrapZwpTabletPadRingV2(r) | |||
| 579 | + | r.Data = self | |||
| 580 | + | return self, nil | |||
| 581 | + | } | |||
| 582 | + | ||||
| 583 | + | // SendSource ring event source. | |||
| 584 | + | func (self *ZwpTabletPadRingV2) SendSource(source uint32) { | |||
| 585 | + | self.PostEvent(ZwpTabletPadRingV2EventSource, server.Uint(source)) | |||
| 586 | + | } | |||
| 587 | + | ||||
| 588 | + | // SendAngle angle changed. | |||
| 589 | + | func (self *ZwpTabletPadRingV2) SendAngle(degrees server.Fixed) { | |||
| 590 | + | self.PostEvent(ZwpTabletPadRingV2EventAngle, server.FixedArg(degrees)) | |||
| 591 | + | } | |||
| 592 | + | ||||
| 593 | + | // SendStop interaction stopped. | |||
| 594 | + | func (self *ZwpTabletPadRingV2) SendStop() { | |||
| 595 | + | self.PostEvent(ZwpTabletPadRingV2EventStop) | |||
| 596 | + | } | |||
| 597 | + | ||||
| 598 | + | // SendFrame end of a ring event sequence. | |||
| 599 | + | func (self *ZwpTabletPadRingV2) SendFrame(time uint32) { | |||
| 600 | + | self.PostEvent(ZwpTabletPadRingV2EventFrame, server.Uint(time)) | |||
| 601 | + | } | |||
| 602 | + | func NewZwpTabletPadRingV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 603 | + | return d.CreateGlobal(ZwpTabletPadRingV2Interface, version, bind) | |||
| 604 | + | } | |||
| 605 | + | ||||
| 606 | + | // ZwpTabletPadStripV2 pad strip. | |||
| 607 | + | type ZwpTabletPadStripV2 struct{ *server.Resource } | |||
| 608 | + | ||||
| 609 | + | func WrapZwpTabletPadStripV2(r *server.Resource) *ZwpTabletPadStripV2 { | |||
| 610 | + | if r == nil { | |||
| 611 | + | return nil | |||
| 612 | + | } | |||
| 613 | + | return &ZwpTabletPadStripV2{r} | |||
| 614 | + | } | |||
| 615 | + | ||||
| 616 | + | const ZwpTabletPadStripV2RequestSetFeedback uint32 = 0 | |||
| 617 | + | const ZwpTabletPadStripV2RequestDestroy uint32 = 1 | |||
| 618 | + | const ZwpTabletPadStripV2EventSource uint32 = 0 | |||
| 619 | + | const ZwpTabletPadStripV2EventPosition uint32 = 1 | |||
| 620 | + | const ZwpTabletPadStripV2EventStop uint32 = 2 | |||
| 621 | + | const ZwpTabletPadStripV2EventFrame uint32 = 3 | |||
| 622 | + | ||||
| 623 | + | // ZwpTabletPadStripV2Source strip axis source. | |||
| 624 | + | type ZwpTabletPadStripV2Source uint32 | |||
| 625 | + | ||||
| 626 | + | const ( | |||
| 627 | + | ZwpTabletPadStripV2SourceFinger ZwpTabletPadStripV2Source = 1 | |||
| 628 | + | ) | |||
| 629 | + | ||||
| 630 | + | // ZwpTabletPadStripV2Handler handles zwp_tablet_pad_strip_v2 requests. | |||
| 631 | + | type ZwpTabletPadStripV2Handler interface { | |||
| 632 | + | SetFeedback(self *ZwpTabletPadStripV2, description string, serial uint32) | |||
| 633 | + | Destroy(self *ZwpTabletPadStripV2) | |||
| 634 | + | } | |||
| 635 | + | ||||
| 636 | + | func NewZwpTabletPadStripV2(c server.Client, version int32, id uint32, h ZwpTabletPadStripV2Handler) (*ZwpTabletPadStripV2, error) { | |||
| 637 | + | if h == nil { | |||
| 638 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_strip_v2") | |||
| 639 | + | } | |||
| 640 | + | var self *ZwpTabletPadStripV2 | |||
| 641 | + | r, err := c.CreateResource(ZwpTabletPadStripV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 642 | + | switch opcode { | |||
| 643 | + | case 0: | |||
| 644 | + | h.SetFeedback(self, args[0].String(), args[1].Uint()) | |||
| 645 | + | case 1: | |||
| 646 | + | h.Destroy(self) | |||
| 647 | + | self.Destroy() | |||
| 648 | + | } | |||
| 649 | + | }) | |||
| 650 | + | if err != nil { | |||
| 651 | + | return nil, err | |||
| 652 | + | } | |||
| 653 | + | self = WrapZwpTabletPadStripV2(r) | |||
| 654 | + | r.Data = self | |||
| 655 | + | return self, nil | |||
| 656 | + | } | |||
| 657 | + | ||||
| 658 | + | // SendSource strip event source. | |||
| 659 | + | func (self *ZwpTabletPadStripV2) SendSource(source uint32) { | |||
| 660 | + | self.PostEvent(ZwpTabletPadStripV2EventSource, server.Uint(source)) | |||
| 661 | + | } | |||
| 662 | + | ||||
| 663 | + | // SendPosition position changed. | |||
| 664 | + | func (self *ZwpTabletPadStripV2) SendPosition(position uint32) { | |||
| 665 | + | self.PostEvent(ZwpTabletPadStripV2EventPosition, server.Uint(position)) | |||
| 666 | + | } | |||
| 667 | + | ||||
| 668 | + | // SendStop interaction stopped. | |||
| 669 | + | func (self *ZwpTabletPadStripV2) SendStop() { | |||
| 670 | + | self.PostEvent(ZwpTabletPadStripV2EventStop) | |||
| 671 | + | } | |||
| 672 | + | ||||
| 673 | + | // SendFrame end of a strip event sequence. | |||
| 674 | + | func (self *ZwpTabletPadStripV2) SendFrame(time uint32) { | |||
| 675 | + | self.PostEvent(ZwpTabletPadStripV2EventFrame, server.Uint(time)) | |||
| 676 | + | } | |||
| 677 | + | func NewZwpTabletPadStripV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 678 | + | return d.CreateGlobal(ZwpTabletPadStripV2Interface, version, bind) | |||
| 679 | + | } | |||
| 680 | + | ||||
| 681 | + | // ZwpTabletPadGroupV2 a set of buttons, rings and strips. | |||
| 682 | + | type ZwpTabletPadGroupV2 struct{ *server.Resource } | |||
| 683 | + | ||||
| 684 | + | func WrapZwpTabletPadGroupV2(r *server.Resource) *ZwpTabletPadGroupV2 { | |||
| 685 | + | if r == nil { | |||
| 686 | + | return nil | |||
| 687 | + | } | |||
| 688 | + | return &ZwpTabletPadGroupV2{r} | |||
| 689 | + | } | |||
| 690 | + | ||||
| 691 | + | const ZwpTabletPadGroupV2RequestDestroy uint32 = 0 | |||
| 692 | + | const ZwpTabletPadGroupV2EventButtons uint32 = 0 | |||
| 693 | + | const ZwpTabletPadGroupV2EventRing uint32 = 1 | |||
| 694 | + | const ZwpTabletPadGroupV2EventStrip uint32 = 2 | |||
| 695 | + | const ZwpTabletPadGroupV2EventModes uint32 = 3 | |||
| 696 | + | const ZwpTabletPadGroupV2EventDone uint32 = 4 | |||
| 697 | + | const ZwpTabletPadGroupV2EventModeSwitch uint32 = 5 | |||
| 698 | + | const ZwpTabletPadGroupV2EventDial uint32 = 6 | |||
| 699 | + | ||||
| 700 | + | // ZwpTabletPadGroupV2Handler handles zwp_tablet_pad_group_v2 requests. | |||
| 701 | + | type ZwpTabletPadGroupV2Handler interface { | |||
| 702 | + | Destroy(self *ZwpTabletPadGroupV2) | |||
| 703 | + | } | |||
| 704 | + | ||||
| 705 | + | func NewZwpTabletPadGroupV2(c server.Client, version int32, id uint32, h ZwpTabletPadGroupV2Handler) (*ZwpTabletPadGroupV2, error) { | |||
| 706 | + | if h == nil { | |||
| 707 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_group_v2") | |||
| 708 | + | } | |||
| 709 | + | var self *ZwpTabletPadGroupV2 | |||
| 710 | + | r, err := c.CreateResource(ZwpTabletPadGroupV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 711 | + | switch opcode { | |||
| 712 | + | case 0: | |||
| 713 | + | h.Destroy(self) | |||
| 714 | + | self.Destroy() | |||
| 715 | + | } | |||
| 716 | + | }) | |||
| 717 | + | if err != nil { | |||
| 718 | + | return nil, err | |||
| 719 | + | } | |||
| 720 | + | self = WrapZwpTabletPadGroupV2(r) | |||
| 721 | + | r.Data = self | |||
| 722 | + | return self, nil | |||
| 723 | + | } | |||
| 724 | + | ||||
| 725 | + | // SendButtons buttons announced. | |||
| 726 | + | func (self *ZwpTabletPadGroupV2) SendButtons(buttons []byte) { | |||
| 727 | + | var p runtime.Pinner | |||
| 728 | + | defer p.Unpin() | |||
| 729 | + | self.PostEvent(ZwpTabletPadGroupV2EventButtons, server.Array(&p, buttons)) | |||
| 730 | + | } | |||
| 731 | + | ||||
| 732 | + | // SendRing ring announced. | |||
| 733 | + | func (self *ZwpTabletPadGroupV2) SendRing(ring *ZwpTabletPadRingV2) { | |||
| 734 | + | self.PostEvent(ZwpTabletPadGroupV2EventRing, server.NewID(resourceOf(ring))) | |||
| 735 | + | } | |||
| 736 | + | ||||
| 737 | + | // SendStrip strip announced. | |||
| 738 | + | func (self *ZwpTabletPadGroupV2) SendStrip(strip *ZwpTabletPadStripV2) { | |||
| 739 | + | self.PostEvent(ZwpTabletPadGroupV2EventStrip, server.NewID(resourceOf(strip))) | |||
| 740 | + | } | |||
| 741 | + | ||||
| 742 | + | // SendModes mode-switch ability announced. | |||
| 743 | + | func (self *ZwpTabletPadGroupV2) SendModes(modes uint32) { | |||
| 744 | + | self.PostEvent(ZwpTabletPadGroupV2EventModes, server.Uint(modes)) | |||
| 745 | + | } | |||
| 746 | + | ||||
| 747 | + | // SendDone tablet group description events sequence complete. | |||
| 748 | + | func (self *ZwpTabletPadGroupV2) SendDone() { | |||
| 749 | + | self.PostEvent(ZwpTabletPadGroupV2EventDone) | |||
| 750 | + | } | |||
| 751 | + | ||||
| 752 | + | // SendModeSwitch mode switch event. | |||
| 753 | + | func (self *ZwpTabletPadGroupV2) SendModeSwitch(time uint32, serial uint32, mode uint32) { | |||
| 754 | + | self.PostEvent(ZwpTabletPadGroupV2EventModeSwitch, server.Uint(time), server.Uint(serial), server.Uint(mode)) | |||
| 755 | + | } | |||
| 756 | + | ||||
| 757 | + | // SendDial dial announced (since version 2). | |||
| 758 | + | func (self *ZwpTabletPadGroupV2) SendDial(dial *ZwpTabletPadDialV2) { | |||
| 759 | + | self.PostEvent(ZwpTabletPadGroupV2EventDial, server.NewID(resourceOf(dial))) | |||
| 760 | + | } | |||
| 761 | + | func NewZwpTabletPadGroupV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 762 | + | return d.CreateGlobal(ZwpTabletPadGroupV2Interface, version, bind) | |||
| 763 | + | } | |||
| 764 | + | ||||
| 765 | + | // ZwpTabletPadV2 a set of buttons, rings, strips and dials. | |||
| 766 | + | type ZwpTabletPadV2 struct{ *server.Resource } | |||
| 767 | + | ||||
| 768 | + | func WrapZwpTabletPadV2(r *server.Resource) *ZwpTabletPadV2 { | |||
| 769 | + | if r == nil { | |||
| 770 | + | return nil | |||
| 771 | + | } | |||
| 772 | + | return &ZwpTabletPadV2{r} | |||
| 773 | + | } | |||
| 774 | + | ||||
| 775 | + | const ZwpTabletPadV2RequestSetFeedback uint32 = 0 | |||
| 776 | + | const ZwpTabletPadV2RequestDestroy uint32 = 1 | |||
| 777 | + | const ZwpTabletPadV2EventGroup uint32 = 0 | |||
| 778 | + | const ZwpTabletPadV2EventPath uint32 = 1 | |||
| 779 | + | const ZwpTabletPadV2EventButtons uint32 = 2 | |||
| 780 | + | const ZwpTabletPadV2EventDone uint32 = 3 | |||
| 781 | + | const ZwpTabletPadV2EventButton uint32 = 4 | |||
| 782 | + | const ZwpTabletPadV2EventEnter uint32 = 5 | |||
| 783 | + | const ZwpTabletPadV2EventLeave uint32 = 6 | |||
| 784 | + | const ZwpTabletPadV2EventRemoved uint32 = 7 | |||
| 785 | + | ||||
| 786 | + | // ZwpTabletPadV2ButtonState physical button state. | |||
| 787 | + | type ZwpTabletPadV2ButtonState uint32 | |||
| 788 | + | ||||
| 789 | + | const ( | |||
| 790 | + | ZwpTabletPadV2ButtonStateReleased ZwpTabletPadV2ButtonState = 0 | |||
| 791 | + | ZwpTabletPadV2ButtonStatePressed ZwpTabletPadV2ButtonState = 1 | |||
| 792 | + | ) | |||
| 793 | + | ||||
| 794 | + | // ZwpTabletPadV2Handler handles zwp_tablet_pad_v2 requests. | |||
| 795 | + | type ZwpTabletPadV2Handler interface { | |||
| 796 | + | SetFeedback(self *ZwpTabletPadV2, button uint32, description string, serial uint32) | |||
| 797 | + | Destroy(self *ZwpTabletPadV2) | |||
| 798 | + | } | |||
| 799 | + | ||||
| 800 | + | func NewZwpTabletPadV2(c server.Client, version int32, id uint32, h ZwpTabletPadV2Handler) (*ZwpTabletPadV2, error) { | |||
| 801 | + | if h == nil { | |||
| 802 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_v2") | |||
| 803 | + | } | |||
| 804 | + | var self *ZwpTabletPadV2 | |||
| 805 | + | r, err := c.CreateResource(ZwpTabletPadV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 806 | + | switch opcode { | |||
| 807 | + | case 0: | |||
| 808 | + | h.SetFeedback(self, args[0].Uint(), args[1].String(), args[2].Uint()) | |||
| 809 | + | case 1: | |||
| 810 | + | h.Destroy(self) | |||
| 811 | + | self.Destroy() | |||
| 812 | + | } | |||
| 813 | + | }) | |||
| 814 | + | if err != nil { | |||
| 815 | + | return nil, err | |||
| 816 | + | } | |||
| 817 | + | self = WrapZwpTabletPadV2(r) | |||
| 818 | + | r.Data = self | |||
| 819 | + | return self, nil | |||
| 820 | + | } | |||
| 821 | + | ||||
| 822 | + | // SendGroup group announced. | |||
| 823 | + | func (self *ZwpTabletPadV2) SendGroup(padGroup *ZwpTabletPadGroupV2) { | |||
| 824 | + | self.PostEvent(ZwpTabletPadV2EventGroup, server.NewID(resourceOf(padGroup))) | |||
| 825 | + | } | |||
| 826 | + | ||||
| 827 | + | // SendPath path to the device. | |||
| 828 | + | func (self *ZwpTabletPadV2) SendPath(path string) { | |||
| 829 | + | var p runtime.Pinner | |||
| 830 | + | defer p.Unpin() | |||
| 831 | + | self.PostEvent(ZwpTabletPadV2EventPath, server.String(&p, path, false)) | |||
| 832 | + | } | |||
| 833 | + | ||||
| 834 | + | // SendButtons buttons announced. | |||
| 835 | + | func (self *ZwpTabletPadV2) SendButtons(buttons uint32) { | |||
| 836 | + | self.PostEvent(ZwpTabletPadV2EventButtons, server.Uint(buttons)) | |||
| 837 | + | } | |||
| 838 | + | ||||
| 839 | + | // SendDone pad description event sequence complete. | |||
| 840 | + | func (self *ZwpTabletPadV2) SendDone() { | |||
| 841 | + | self.PostEvent(ZwpTabletPadV2EventDone) | |||
| 842 | + | } | |||
| 843 | + | ||||
| 844 | + | // SendButton physical button state. | |||
| 845 | + | func (self *ZwpTabletPadV2) SendButton(time uint32, button uint32, state uint32) { | |||
| 846 | + | self.PostEvent(ZwpTabletPadV2EventButton, server.Uint(time), server.Uint(button), server.Uint(state)) | |||
| 847 | + | } | |||
| 848 | + | ||||
| 849 | + | // SendEnter enter event. | |||
| 850 | + | func (self *ZwpTabletPadV2) SendEnter(serial uint32, tablet *ZwpTabletV2, surface *wayland.Surface) { | |||
| 851 | + | self.PostEvent(ZwpTabletPadV2EventEnter, server.Uint(serial), server.Object(resourceOf(tablet)), server.Object(resourceOf(surface))) | |||
| 852 | + | } | |||
| 853 | + | ||||
| 854 | + | // SendLeave leave event. | |||
| 855 | + | func (self *ZwpTabletPadV2) SendLeave(serial uint32, surface *wayland.Surface) { | |||
| 856 | + | self.PostEvent(ZwpTabletPadV2EventLeave, server.Uint(serial), server.Object(resourceOf(surface))) | |||
| 857 | + | } | |||
| 858 | + | ||||
| 859 | + | // SendRemoved pad removed event. | |||
| 860 | + | func (self *ZwpTabletPadV2) SendRemoved() { | |||
| 861 | + | self.PostEvent(ZwpTabletPadV2EventRemoved) | |||
| 862 | + | } | |||
| 863 | + | func NewZwpTabletPadV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 864 | + | return d.CreateGlobal(ZwpTabletPadV2Interface, version, bind) | |||
| 865 | + | } | |||
| 866 | + | ||||
| 867 | + | // ZwpTabletPadDialV2 pad dial. | |||
| 868 | + | type ZwpTabletPadDialV2 struct{ *server.Resource } | |||
| 869 | + | ||||
| 870 | + | func WrapZwpTabletPadDialV2(r *server.Resource) *ZwpTabletPadDialV2 { | |||
| 871 | + | if r == nil { | |||
| 872 | + | return nil | |||
| 873 | + | } | |||
| 874 | + | return &ZwpTabletPadDialV2{r} | |||
| 875 | + | } | |||
| 876 | + | ||||
| 877 | + | const ZwpTabletPadDialV2RequestSetFeedback uint32 = 0 | |||
| 878 | + | const ZwpTabletPadDialV2RequestDestroy uint32 = 1 | |||
| 879 | + | const ZwpTabletPadDialV2EventDelta uint32 = 0 | |||
| 880 | + | const ZwpTabletPadDialV2EventFrame uint32 = 1 | |||
| 881 | + | ||||
| 882 | + | // ZwpTabletPadDialV2Handler handles zwp_tablet_pad_dial_v2 requests. | |||
| 883 | + | type ZwpTabletPadDialV2Handler interface { | |||
| 884 | + | SetFeedback(self *ZwpTabletPadDialV2, description string, serial uint32) | |||
| 885 | + | Destroy(self *ZwpTabletPadDialV2) | |||
| 886 | + | } | |||
| 887 | + | ||||
| 888 | + | func NewZwpTabletPadDialV2(c server.Client, version int32, id uint32, h ZwpTabletPadDialV2Handler) (*ZwpTabletPadDialV2, error) { | |||
| 889 | + | if h == nil { | |||
| 890 | + | return nil, fmt.Errorf("purego-libwayland: nil handler for zwp_tablet_pad_dial_v2") | |||
| 891 | + | } | |||
| 892 | + | var self *ZwpTabletPadDialV2 | |||
| 893 | + | r, err := c.CreateResource(ZwpTabletPadDialV2Interface, version, id, func(_ *server.Resource, opcode uint32, args []server.Arg) { | |||
| 894 | + | switch opcode { | |||
| 895 | + | case 0: | |||
| 896 | + | h.SetFeedback(self, args[0].String(), args[1].Uint()) | |||
| 897 | + | case 1: | |||
| 898 | + | h.Destroy(self) | |||
| 899 | + | self.Destroy() | |||
| 900 | + | } | |||
| 901 | + | }) | |||
| 902 | + | if err != nil { | |||
| 903 | + | return nil, err | |||
| 904 | + | } | |||
| 905 | + | self = WrapZwpTabletPadDialV2(r) | |||
| 906 | + | r.Data = self | |||
| 907 | + | return self, nil | |||
| 908 | + | } | |||
| 909 | + | ||||
| 910 | + | // SendDelta delta movement. | |||
| 911 | + | func (self *ZwpTabletPadDialV2) SendDelta(value120 int32) { | |||
| 912 | + | self.PostEvent(ZwpTabletPadDialV2EventDelta, server.Int(value120)) | |||
| 913 | + | } | |||
| 914 | + | ||||
| 915 | + | // SendFrame end of a dial event sequence. | |||
| 916 | + | func (self *ZwpTabletPadDialV2) SendFrame(time uint32) { | |||
| 917 | + | self.PostEvent(ZwpTabletPadDialV2EventFrame, server.Uint(time)) | |||
| 918 | + | } | |||
| 919 | + | func NewZwpTabletPadDialV2Global(d *server.Display, version int32, bind server.BindFunc) error { | |||
| 920 | + | return d.CreateGlobal(ZwpTabletPadDialV2Interface, version, bind) | |||
| 921 | + | } | |||
| 922 | + | func resourceOf(v interface{ GetResource() *server.Resource }) *server.Resource { | |||
| 923 | + | if v == nil { | |||
| 924 | + | return nil | |||
| 925 | + | } | |||
| 926 | + | return v.GetResource() | |||
| 927 | + | } | |||
| 928 | + | func (self *ZwpTabletManagerV2) GetResource() *server.Resource { | |||
| 929 | + | if self == nil { | |||
| 930 | + | return nil | |||
| 931 | + | } | |||
| 932 | + | return self.Resource | |||
| 933 | + | } | |||
| 934 | + | func (self *ZwpTabletSeatV2) GetResource() *server.Resource { | |||
| 935 | + | if self == nil { | |||
| 936 | + | return nil | |||
| 937 | + | } | |||
| 938 | + | return self.Resource | |||
| 939 | + | } | |||
| 940 | + | func (self *ZwpTabletToolV2) GetResource() *server.Resource { | |||
| 941 | + | if self == nil { | |||
| 942 | + | return nil | |||
| 943 | + | } | |||
| 944 | + | return self.Resource | |||
| 945 | + | } | |||
| 946 | + | func (self *ZwpTabletV2) GetResource() *server.Resource { | |||
| 947 | + | if self == nil { | |||
| 948 | + | return nil | |||
| 949 | + | } | |||
| 950 | + | return self.Resource | |||
| 951 | + | } | |||
| 952 | + | func (self *ZwpTabletPadRingV2) GetResource() *server.Resource { | |||
| 953 | + | if self == nil { | |||
| 954 | + | return nil | |||
| 955 | + | } | |||
| 956 | + | return self.Resource | |||
| 957 | + | } | |||
| 958 | + | func (self *ZwpTabletPadStripV2) GetResource() *server.Resource { | |||
| 959 | + | if self == nil { | |||
| 960 | + | return nil | |||
| 961 | + | } | |||
| 962 | + | return self.Resource | |||
| 963 | + | } | |||
| 964 | + | func (self *ZwpTabletPadGroupV2) GetResource() *server.Resource { | |||
| 965 | + | if self == nil { | |||
| 966 | + | return nil | |||
| 967 | + | } | |||
| 968 | + | return self.Resource | |||
| 969 | + | } | |||
| 970 | + | func (self *ZwpTabletPadV2) GetResource() *server.Resource { | |||
| 971 | + | if self == nil { | |||
| 972 | + | return nil | |||
| 973 | + | } | |||
| 974 | + | return self.Resource | |||
| 975 | + | } | |||
| 976 | + | func (self *ZwpTabletPadDialV2) GetResource() *server.Resource { | |||
| 977 | + | if self == nil { | |||
| 978 | + | return nil | |||
| 979 | + | } | |||
| 980 | + | return self.Resource | |||
| 981 | + | } | |||
A protocols/cursor-shape-v1.xml +162 -0
| @@ -0,0 +1,162 @@ | |||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + | <protocol name="cursor_shape_v1"> | |
| 3 | + | <copyright> | |
| 4 | + | Copyright 2018 The Chromium Authors | |
| 5 | + | Copyright 2023 Simon Ser | |
| 6 | + | ||
| 7 | + | Permission is hereby granted, free of charge, to any person obtaining a | |
| 8 | + | copy of this software and associated documentation files (the "Software"), | |
| 9 | + | to deal in the Software without restriction, including without limitation | |
| 10 | + | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| 11 | + | and/or sell copies of the Software, and to permit persons to whom the | |
| 12 | + | Software is furnished to do so, subject to the following conditions: | |
| 13 | + | The above copyright notice and this permission notice (including the next | |
| 14 | + | paragraph) shall be included in all copies or substantial portions of the | |
| 15 | + | Software. | |
| 16 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 17 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 18 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
| 19 | + | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 20 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
| 21 | + | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
| 22 | + | DEALINGS IN THE SOFTWARE. | |
| 23 | + | </copyright> | |
| 24 | + | ||
| 25 | + | <interface name="wp_cursor_shape_manager_v1" version="2"> | |
| 26 | + | <description summary="cursor shape manager"> | |
| 27 | + | This global offers an alternative, optional way to set cursor images. This | |
| 28 | + | new way uses enumerated cursors instead of a wl_surface like | |
| 29 | + | wl_pointer.set_cursor does. | |
| 30 | + | ||
| 31 | + | Warning! The protocol described in this file is currently in the testing | |
| 32 | + | phase. Backward compatible changes may be added together with the | |
| 33 | + | corresponding interface version bump. Backward incompatible changes can | |
| 34 | + | only be done by creating a new major version of the extension. | |
| 35 | + | </description> | |
| 36 | + | ||
| 37 | + | <request name="destroy" type="destructor"> | |
| 38 | + | <description summary="destroy the manager"> | |
| 39 | + | Destroy the cursor shape manager. | |
| 40 | + | </description> | |
| 41 | + | </request> | |
| 42 | + | ||
| 43 | + | <request name="get_pointer"> | |
| 44 | + | <description summary="manage the cursor shape of a pointer device"> | |
| 45 | + | Obtain a wp_cursor_shape_device_v1 for a wl_pointer object. | |
| 46 | + | ||
| 47 | + | When the pointer capability is removed from the wl_seat, the | |
| 48 | + | wp_cursor_shape_device_v1 object becomes inert. | |
| 49 | + | </description> | |
| 50 | + | <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/> | |
| 51 | + | <arg name="pointer" type="object" interface="wl_pointer"/> | |
| 52 | + | </request> | |
| 53 | + | ||
| 54 | + | <request name="get_tablet_tool_v2"> | |
| 55 | + | <description summary="manage the cursor shape of a tablet tool device"> | |
| 56 | + | Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object. | |
| 57 | + | ||
| 58 | + | When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1 | |
| 59 | + | object becomes inert. | |
| 60 | + | </description> | |
| 61 | + | <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/> | |
| 62 | + | <arg name="tablet_tool" type="object" interface="zwp_tablet_tool_v2"/> | |
| 63 | + | </request> | |
| 64 | + | </interface> | |
| 65 | + | ||
| 66 | + | <interface name="wp_cursor_shape_device_v1" version="2"> | |
| 67 | + | <description summary="cursor shape for a device"> | |
| 68 | + | This interface allows clients to set the cursor shape. | |
| 69 | + | </description> | |
| 70 | + | ||
| 71 | + | <enum name="shape"> | |
| 72 | + | <description summary="cursor shapes"> | |
| 73 | + | This enum describes cursor shapes. | |
| 74 | + | ||
| 75 | + | The names are taken from the CSS W3C specification: | |
| 76 | + | https://w3c.github.io/csswg-drafts/css-ui/#cursor | |
| 77 | + | with a few additions. | |
| 78 | + | ||
| 79 | + | Note that there are some groups of cursor shapes that are related: | |
| 80 | + | The first group is drag-and-drop cursors which are used to indicate | |
| 81 | + | the selected action during dnd operations. The second group is resize | |
| 82 | + | cursors which are used to indicate resizing and moving possibilities | |
| 83 | + | on window borders. It is recommended that the shapes in these groups | |
| 84 | + | should use visually compatible images and metaphors. | |
| 85 | + | </description> | |
| 86 | + | <entry name="default" value="1" summary="default cursor"/> | |
| 87 | + | <entry name="context_menu" value="2" summary="a context menu is available for the object under the cursor"/> | |
| 88 | + | <entry name="help" value="3" summary="help is available for the object under the cursor"/> | |
| 89 | + | <entry name="pointer" value="4" summary="pointer that indicates a link or another interactive element"/> | |
| 90 | + | <entry name="progress" value="5" summary="progress indicator"/> | |
| 91 | + | <entry name="wait" value="6" summary="program is busy, user should wait"/> | |
| 92 | + | <entry name="cell" value="7" summary="a cell or set of cells may be selected"/> | |
| 93 | + | <entry name="crosshair" value="8" summary="simple crosshair"/> | |
| 94 | + | <entry name="text" value="9" summary="text may be selected"/> | |
| 95 | + | <entry name="vertical_text" value="10" summary="vertical text may be selected"/> | |
| 96 | + | <entry name="alias" value="11" summary="drag-and-drop: alias of/shortcut to something is to be created"/> | |
| 97 | + | <entry name="copy" value="12" summary="drag-and-drop: something is to be copied"/> | |
| 98 | + | <entry name="move" value="13" summary="drag-and-drop: something is to be moved"/> | |
| 99 | + | <entry name="no_drop" value="14" summary="drag-and-drop: the dragged item cannot be dropped at the current cursor location"/> | |
| 100 | + | <entry name="not_allowed" value="15" summary="drag-and-drop: the requested action will not be carried out"/> | |
| 101 | + | <entry name="grab" value="16" summary="drag-and-drop: something can be grabbed"/> | |
| 102 | + | <entry name="grabbing" value="17" summary="drag-and-drop: something is being grabbed"/> | |
| 103 | + | <entry name="e_resize" value="18" summary="resizing: the east border is to be moved"/> | |
| 104 | + | <entry name="n_resize" value="19" summary="resizing: the north border is to be moved"/> | |
| 105 | + | <entry name="ne_resize" value="20" summary="resizing: the north-east corner is to be moved"/> | |
| 106 | + | <entry name="nw_resize" value="21" summary="resizing: the north-west corner is to be moved"/> | |
| 107 | + | <entry name="s_resize" value="22" summary="resizing: the south border is to be moved"/> | |
| 108 | + | <entry name="se_resize" value="23" summary="resizing: the south-east corner is to be moved"/> | |
| 109 | + | <entry name="sw_resize" value="24" summary="resizing: the south-west corner is to be moved"/> | |
| 110 | + | <entry name="w_resize" value="25" summary="resizing: the west border is to be moved"/> | |
| 111 | + | <entry name="ew_resize" value="26" summary="resizing: the east and west borders are to be moved"/> | |
| 112 | + | <entry name="ns_resize" value="27" summary="resizing: the north and south borders are to be moved"/> | |
| 113 | + | <entry name="nesw_resize" value="28" summary="resizing: the north-east and south-west corners are to be moved"/> | |
| 114 | + | <entry name="nwse_resize" value="29" summary="resizing: the north-west and south-east corners are to be moved"/> | |
| 115 | + | <entry name="col_resize" value="30" summary="resizing: that the item/column can be resized horizontally"/> | |
| 116 | + | <entry name="row_resize" value="31" summary="resizing: that the item/row can be resized vertically"/> | |
| 117 | + | <entry name="all_scroll" value="32" summary="something can be scrolled in any direction"/> | |
| 118 | + | <entry name="zoom_in" value="33" summary="something can be zoomed in"/> | |
| 119 | + | <entry name="zoom_out" value="34" summary="something can be zoomed out"/> | |
| 120 | + | <entry name="dnd_ask" value="35" summary="drag-and-drop: the user will select which action will be carried out (non-css value)" since="2"/> | |
| 121 | + | <entry name="all_resize" value="36" summary="resizing: something can be moved or resized in any direction (non-css value)" since="2"/> | |
| 122 | + | </enum> | |
| 123 | + | ||
| 124 | + | <enum name="error"> | |
| 125 | + | <entry name="invalid_shape" value="1" | |
| 126 | + | summary="the specified shape value is invalid"/> | |
| 127 | + | </enum> | |
| 128 | + | ||
| 129 | + | <request name="destroy" type="destructor"> | |
| 130 | + | <description summary="destroy the cursor shape device"> | |
| 131 | + | Destroy the cursor shape device. | |
| 132 | + | ||
| 133 | + | The device cursor shape remains unchanged. | |
| 134 | + | </description> | |
| 135 | + | </request> | |
| 136 | + | ||
| 137 | + | <request name="set_shape"> | |
| 138 | + | <description summary="set device cursor to the shape"> | |
| 139 | + | Sets the device cursor to the specified shape. The compositor will | |
| 140 | + | change the cursor image based on the specified shape. | |
| 141 | + | ||
| 142 | + | The cursor actually changes only if the input device focus is one of | |
| 143 | + | the requesting client's surfaces. If any, the previous cursor image | |
| 144 | + | (surface or shape) is replaced. | |
| 145 | + | ||
| 146 | + | The "shape" argument must be a valid enum entry, otherwise the | |
| 147 | + | invalid_shape protocol error is raised. | |
| 148 | + | ||
| 149 | + | This is similar to the wl_pointer.set_cursor and | |
| 150 | + | zwp_tablet_tool_v2.set_cursor requests, but this request accepts a | |
| 151 | + | shape instead of contents in the form of a surface. Clients can mix | |
| 152 | + | set_cursor and set_shape requests. | |
| 153 | + | ||
| 154 | + | The serial parameter must match the latest wl_pointer.enter or | |
| 155 | + | zwp_tablet_tool_v2.proximity_in serial number sent to the client. | |
| 156 | + | Otherwise the request will be ignored. | |
| 157 | + | </description> | |
| 158 | + | <arg name="serial" type="uint" summary="serial number of the enter event"/> | |
| 159 | + | <arg name="shape" type="uint" enum="shape"/> | |
| 160 | + | </request> | |
| 161 | + | </interface> | |
| 162 | + | </protocol> | |
| @@ -0,0 +1,162 @@ | |||||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |||
| 2 | + | <protocol name="cursor_shape_v1"> | |||
| 3 | + | <copyright> | |||
| 4 | + | Copyright 2018 The Chromium Authors | |||
| 5 | + | Copyright 2023 Simon Ser | |||
| 6 | + | ||||
| 7 | + | Permission is hereby granted, free of charge, to any person obtaining a | |||
| 8 | + | copy of this software and associated documentation files (the "Software"), | |||
| 9 | + | to deal in the Software without restriction, including without limitation | |||
| 10 | + | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
| 11 | + | and/or sell copies of the Software, and to permit persons to whom the | |||
| 12 | + | Software is furnished to do so, subject to the following conditions: | |||
| 13 | + | The above copyright notice and this permission notice (including the next | |||
| 14 | + | paragraph) shall be included in all copies or substantial portions of the | |||
| 15 | + | Software. | |||
| 16 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| 17 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| 18 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
| 19 | + | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| 20 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |||
| 21 | + | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
| 22 | + | DEALINGS IN THE SOFTWARE. | |||
| 23 | + | </copyright> | |||
| 24 | + | ||||
| 25 | + | <interface name="wp_cursor_shape_manager_v1" version="2"> | |||
| 26 | + | <description summary="cursor shape manager"> | |||
| 27 | + | This global offers an alternative, optional way to set cursor images. This | |||
| 28 | + | new way uses enumerated cursors instead of a wl_surface like | |||
| 29 | + | wl_pointer.set_cursor does. | |||
| 30 | + | ||||
| 31 | + | Warning! The protocol described in this file is currently in the testing | |||
| 32 | + | phase. Backward compatible changes may be added together with the | |||
| 33 | + | corresponding interface version bump. Backward incompatible changes can | |||
| 34 | + | only be done by creating a new major version of the extension. | |||
| 35 | + | </description> | |||
| 36 | + | ||||
| 37 | + | <request name="destroy" type="destructor"> | |||
| 38 | + | <description summary="destroy the manager"> | |||
| 39 | + | Destroy the cursor shape manager. | |||
| 40 | + | </description> | |||
| 41 | + | </request> | |||
| 42 | + | ||||
| 43 | + | <request name="get_pointer"> | |||
| 44 | + | <description summary="manage the cursor shape of a pointer device"> | |||
| 45 | + | Obtain a wp_cursor_shape_device_v1 for a wl_pointer object. | |||
| 46 | + | ||||
| 47 | + | When the pointer capability is removed from the wl_seat, the | |||
| 48 | + | wp_cursor_shape_device_v1 object becomes inert. | |||
| 49 | + | </description> | |||
| 50 | + | <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/> | |||
| 51 | + | <arg name="pointer" type="object" interface="wl_pointer"/> | |||
| 52 | + | </request> | |||
| 53 | + | ||||
| 54 | + | <request name="get_tablet_tool_v2"> | |||
| 55 | + | <description summary="manage the cursor shape of a tablet tool device"> | |||
| 56 | + | Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object. | |||
| 57 | + | ||||
| 58 | + | When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1 | |||
| 59 | + | object becomes inert. | |||
| 60 | + | </description> | |||
| 61 | + | <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/> | |||
| 62 | + | <arg name="tablet_tool" type="object" interface="zwp_tablet_tool_v2"/> | |||
| 63 | + | </request> | |||
| 64 | + | </interface> | |||
| 65 | + | ||||
| 66 | + | <interface name="wp_cursor_shape_device_v1" version="2"> | |||
| 67 | + | <description summary="cursor shape for a device"> | |||
| 68 | + | This interface allows clients to set the cursor shape. | |||
| 69 | + | </description> | |||
| 70 | + | ||||
| 71 | + | <enum name="shape"> | |||
| 72 | + | <description summary="cursor shapes"> | |||
| 73 | + | This enum describes cursor shapes. | |||
| 74 | + | ||||
| 75 | + | The names are taken from the CSS W3C specification: | |||
| 76 | + | https://w3c.github.io/csswg-drafts/css-ui/#cursor | |||
| 77 | + | with a few additions. | |||
| 78 | + | ||||
| 79 | + | Note that there are some groups of cursor shapes that are related: | |||
| 80 | + | The first group is drag-and-drop cursors which are used to indicate | |||
| 81 | + | the selected action during dnd operations. The second group is resize | |||
| 82 | + | cursors which are used to indicate resizing and moving possibilities | |||
| 83 | + | on window borders. It is recommended that the shapes in these groups | |||
| 84 | + | should use visually compatible images and metaphors. | |||
| 85 | + | </description> | |||
| 86 | + | <entry name="default" value="1" summary="default cursor"/> | |||
| 87 | + | <entry name="context_menu" value="2" summary="a context menu is available for the object under the cursor"/> | |||
| 88 | + | <entry name="help" value="3" summary="help is available for the object under the cursor"/> | |||
| 89 | + | <entry name="pointer" value="4" summary="pointer that indicates a link or another interactive element"/> | |||
| 90 | + | <entry name="progress" value="5" summary="progress indicator"/> | |||
| 91 | + | <entry name="wait" value="6" summary="program is busy, user should wait"/> | |||
| 92 | + | <entry name="cell" value="7" summary="a cell or set of cells may be selected"/> | |||
| 93 | + | <entry name="crosshair" value="8" summary="simple crosshair"/> | |||
| 94 | + | <entry name="text" value="9" summary="text may be selected"/> | |||
| 95 | + | <entry name="vertical_text" value="10" summary="vertical text may be selected"/> | |||
| 96 | + | <entry name="alias" value="11" summary="drag-and-drop: alias of/shortcut to something is to be created"/> | |||
| 97 | + | <entry name="copy" value="12" summary="drag-and-drop: something is to be copied"/> | |||
| 98 | + | <entry name="move" value="13" summary="drag-and-drop: something is to be moved"/> | |||
| 99 | + | <entry name="no_drop" value="14" summary="drag-and-drop: the dragged item cannot be dropped at the current cursor location"/> | |||
| 100 | + | <entry name="not_allowed" value="15" summary="drag-and-drop: the requested action will not be carried out"/> | |||
| 101 | + | <entry name="grab" value="16" summary="drag-and-drop: something can be grabbed"/> | |||
| 102 | + | <entry name="grabbing" value="17" summary="drag-and-drop: something is being grabbed"/> | |||
| 103 | + | <entry name="e_resize" value="18" summary="resizing: the east border is to be moved"/> | |||
| 104 | + | <entry name="n_resize" value="19" summary="resizing: the north border is to be moved"/> | |||
| 105 | + | <entry name="ne_resize" value="20" summary="resizing: the north-east corner is to be moved"/> | |||
| 106 | + | <entry name="nw_resize" value="21" summary="resizing: the north-west corner is to be moved"/> | |||
| 107 | + | <entry name="s_resize" value="22" summary="resizing: the south border is to be moved"/> | |||
| 108 | + | <entry name="se_resize" value="23" summary="resizing: the south-east corner is to be moved"/> | |||
| 109 | + | <entry name="sw_resize" value="24" summary="resizing: the south-west corner is to be moved"/> | |||
| 110 | + | <entry name="w_resize" value="25" summary="resizing: the west border is to be moved"/> | |||
| 111 | + | <entry name="ew_resize" value="26" summary="resizing: the east and west borders are to be moved"/> | |||
| 112 | + | <entry name="ns_resize" value="27" summary="resizing: the north and south borders are to be moved"/> | |||
| 113 | + | <entry name="nesw_resize" value="28" summary="resizing: the north-east and south-west corners are to be moved"/> | |||
| 114 | + | <entry name="nwse_resize" value="29" summary="resizing: the north-west and south-east corners are to be moved"/> | |||
| 115 | + | <entry name="col_resize" value="30" summary="resizing: that the item/column can be resized horizontally"/> | |||
| 116 | + | <entry name="row_resize" value="31" summary="resizing: that the item/row can be resized vertically"/> | |||
| 117 | + | <entry name="all_scroll" value="32" summary="something can be scrolled in any direction"/> | |||
| 118 | + | <entry name="zoom_in" value="33" summary="something can be zoomed in"/> | |||
| 119 | + | <entry name="zoom_out" value="34" summary="something can be zoomed out"/> | |||
| 120 | + | <entry name="dnd_ask" value="35" summary="drag-and-drop: the user will select which action will be carried out (non-css value)" since="2"/> | |||
| 121 | + | <entry name="all_resize" value="36" summary="resizing: something can be moved or resized in any direction (non-css value)" since="2"/> | |||
| 122 | + | </enum> | |||
| 123 | + | ||||
| 124 | + | <enum name="error"> | |||
| 125 | + | <entry name="invalid_shape" value="1" | |||
| 126 | + | summary="the specified shape value is invalid"/> | |||
| 127 | + | </enum> | |||
| 128 | + | ||||
| 129 | + | <request name="destroy" type="destructor"> | |||
| 130 | + | <description summary="destroy the cursor shape device"> | |||
| 131 | + | Destroy the cursor shape device. | |||
| 132 | + | ||||
| 133 | + | The device cursor shape remains unchanged. | |||
| 134 | + | </description> | |||
| 135 | + | </request> | |||
| 136 | + | ||||
| 137 | + | <request name="set_shape"> | |||
| 138 | + | <description summary="set device cursor to the shape"> | |||
| 139 | + | Sets the device cursor to the specified shape. The compositor will | |||
| 140 | + | change the cursor image based on the specified shape. | |||
| 141 | + | ||||
| 142 | + | The cursor actually changes only if the input device focus is one of | |||
| 143 | + | the requesting client's surfaces. If any, the previous cursor image | |||
| 144 | + | (surface or shape) is replaced. | |||
| 145 | + | ||||
| 146 | + | The "shape" argument must be a valid enum entry, otherwise the | |||
| 147 | + | invalid_shape protocol error is raised. | |||
| 148 | + | ||||
| 149 | + | This is similar to the wl_pointer.set_cursor and | |||
| 150 | + | zwp_tablet_tool_v2.set_cursor requests, but this request accepts a | |||
| 151 | + | shape instead of contents in the form of a surface. Clients can mix | |||
| 152 | + | set_cursor and set_shape requests. | |||
| 153 | + | ||||
| 154 | + | The serial parameter must match the latest wl_pointer.enter or | |||
| 155 | + | zwp_tablet_tool_v2.proximity_in serial number sent to the client. | |||
| 156 | + | Otherwise the request will be ignored. | |||
| 157 | + | </description> | |||
| 158 | + | <arg name="serial" type="uint" summary="serial number of the enter event"/> | |||
| 159 | + | <arg name="shape" type="uint" enum="shape"/> | |||
| 160 | + | </request> | |||
| 161 | + | </interface> | |||
| 162 | + | </protocol> | |||
A protocols/tablet-v2.xml +1297 -0
| @@ -0,0 +1,1297 @@ | |||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + | <protocol name="tablet_v2"> | |
| 3 | + | ||
| 4 | + | <copyright> | |
| 5 | + | Copyright 2014 © Stephen "Lyude" Chandler Paul | |
| 6 | + | Copyright 2015-2024 © Red Hat, Inc. | |
| 7 | + | ||
| 8 | + | Permission is hereby granted, free of charge, to any person | |
| 9 | + | obtaining a copy of this software and associated documentation files | |
| 10 | + | (the "Software"), to deal in the Software without restriction, | |
| 11 | + | including without limitation the rights to use, copy, modify, merge, | |
| 12 | + | publish, distribute, sublicense, and/or sell copies of the Software, | |
| 13 | + | and to permit persons to whom the Software is furnished to do so, | |
| 14 | + | subject to the following conditions: | |
| 15 | + | ||
| 16 | + | The above copyright notice and this permission notice (including the | |
| 17 | + | next paragraph) shall be included in all copies or substantial | |
| 18 | + | portions of the Software. | |
| 19 | + | ||
| 20 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
| 21 | + | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
| 22 | + | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
| 23 | + | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |
| 24 | + | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |
| 25 | + | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
| 26 | + | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 27 | + | SOFTWARE. | |
| 28 | + | </copyright> | |
| 29 | + | ||
| 30 | + | <description summary="Wayland protocol for graphics tablets"> | |
| 31 | + | This description provides a high-level overview of the interplay between | |
| 32 | + | the interfaces defined this protocol. For details, see the protocol | |
| 33 | + | specification. | |
| 34 | + | ||
| 35 | + | More than one tablet may exist, and device-specifics matter. Tablets are | |
| 36 | + | not represented by a single virtual device like wl_pointer. A client | |
| 37 | + | binds to the tablet manager object which is just a proxy object. From | |
| 38 | + | that, the client requests zwp_tablet_manager_v2.get_tablet_seat(wl_seat) | |
| 39 | + | and that returns the actual interface that has all the tablets. With | |
| 40 | + | this indirection, we can avoid merging zwp_tablet_v2 into the actual Wayland | |
| 41 | + | protocol, a long-term benefit. | |
| 42 | + | ||
| 43 | + | The zwp_tablet_seat_v2 sends a "tablet added" event for each tablet | |
| 44 | + | connected. That event is followed by descriptive events about the | |
| 45 | + | hardware; currently that includes events for name, vid/pid and | |
| 46 | + | a zwp_tablet_v2.path event that describes a local path. This path can be | |
| 47 | + | used to uniquely identify a tablet or get more information through | |
| 48 | + | libwacom. Emulated or nested tablets can skip any of those, e.g. a | |
| 49 | + | virtual tablet may not have a vid/pid. The sequence of descriptive | |
| 50 | + | events is terminated by a zwp_tablet_v2.done event to signal that a client | |
| 51 | + | may now finalize any initialization for that tablet. | |
| 52 | + | ||
| 53 | + | Events from tablets require a tool in proximity. Tools are also managed | |
| 54 | + | by the tablet seat; a "tool added" event is sent whenever a tool is new | |
| 55 | + | to the compositor. That event is followed by a number of descriptive | |
| 56 | + | events about the hardware; currently that includes capabilities, | |
| 57 | + | hardware id and serial number, and tool type. Similar to the tablet | |
| 58 | + | interface, a zwp_tablet_tool_v2.done event is sent to terminate that initial | |
| 59 | + | sequence. | |
| 60 | + | ||
| 61 | + | Any event from a tool happens on the zwp_tablet_tool_v2 interface. When the | |
| 62 | + | tool gets into proximity of the tablet, a proximity_in event is sent on | |
| 63 | + | the zwp_tablet_tool_v2 interface, listing the tablet and the surface. That | |
| 64 | + | event is followed by a motion event with the coordinates. After that, | |
| 65 | + | it's the usual motion, axis, button, etc. events. The protocol's | |
| 66 | + | serialisation means events are grouped by zwp_tablet_tool_v2.frame events. | |
| 67 | + | ||
| 68 | + | Two special events (that don't exist in X) are down and up. They signal | |
| 69 | + | "tip touching the surface". For tablets without real proximity | |
| 70 | + | detection, the sequence is: proximity_in, motion, down, frame. | |
| 71 | + | ||
| 72 | + | When the tool leaves proximity, a proximity_out event is sent. If any | |
| 73 | + | button is still down, a button release event is sent before this | |
| 74 | + | proximity event. These button events are sent in the same frame as the | |
| 75 | + | proximity event to signal to the client that the buttons were held when | |
| 76 | + | the tool left proximity. | |
| 77 | + | ||
| 78 | + | If the tool moves out of the surface but stays in proximity (i.e. | |
| 79 | + | between windows), compositor-specific grab policies apply. This usually | |
| 80 | + | means that the proximity-out is delayed until all buttons are released. | |
| 81 | + | ||
| 82 | + | Moving a tool physically from one tablet to the other has no real effect | |
| 83 | + | on the protocol, since we already have the tool object from the "tool | |
| 84 | + | added" event. All the information is already there and the proximity | |
| 85 | + | events on both tablets are all a client needs to reconstruct what | |
| 86 | + | happened. | |
| 87 | + | ||
| 88 | + | Some extra axes are normalized, i.e. the client knows the range as | |
| 89 | + | specified in the protocol (e.g. [0, 65535]), the granularity however is | |
| 90 | + | unknown. The current normalized axes are pressure, distance, and slider. | |
| 91 | + | ||
| 92 | + | Other extra axes are in physical units as specified in the protocol. | |
| 93 | + | The current extra axes with physical units are tilt, rotation and | |
| 94 | + | wheel rotation. | |
| 95 | + | ||
| 96 | + | Since tablets work independently of the pointer controlled by the mouse, | |
| 97 | + | the focus handling is independent too and controlled by proximity. | |
| 98 | + | The zwp_tablet_tool_v2.set_cursor request sets a tool-specific cursor. | |
| 99 | + | This cursor surface may be the same as the mouse cursor, and it may be | |
| 100 | + | the same across tools but it is possible to be more fine-grained. For | |
| 101 | + | example, a client may set different cursors for the pen and eraser. | |
| 102 | + | ||
| 103 | + | Tools are generally independent of tablets and it is | |
| 104 | + | compositor-specific policy when a tool can be removed. Common approaches | |
| 105 | + | will likely include some form of removing a tool when all tablets the | |
| 106 | + | tool was used on are removed. | |
| 107 | + | </description> | |
| 108 | + | ||
| 109 | + | <interface name="zwp_tablet_manager_v2" version="2"> | |
| 110 | + | <description summary="controller object for graphic tablet devices"> | |
| 111 | + | An object that provides access to the graphics tablets available on this | |
| 112 | + | system. All tablets are associated with a seat, to get access to the | |
| 113 | + | actual tablets, use zwp_tablet_manager_v2.get_tablet_seat. | |
| 114 | + | </description> | |
| 115 | + | ||
| 116 | + | <request name="get_tablet_seat"> | |
| 117 | + | <description summary="get the tablet seat"> | |
| 118 | + | Get the zwp_tablet_seat_v2 object for the given seat. This object | |
| 119 | + | provides access to all graphics tablets in this seat. | |
| 120 | + | </description> | |
| 121 | + | <arg name="tablet_seat" type="new_id" interface="zwp_tablet_seat_v2"/> | |
| 122 | + | <arg name="seat" type="object" interface="wl_seat" summary="The wl_seat object to retrieve the tablets for" /> | |
| 123 | + | </request> | |
| 124 | + | ||
| 125 | + | <request name="destroy" type="destructor"> | |
| 126 | + | <description summary="release the memory for the tablet manager object"> | |
| 127 | + | Destroy the zwp_tablet_manager_v2 object. Objects created from this | |
| 128 | + | object are unaffected and should be destroyed separately. | |
| 129 | + | </description> | |
| 130 | + | </request> | |
| 131 | + | </interface> | |
| 132 | + | ||
| 133 | + | <interface name="zwp_tablet_seat_v2" version="2"> | |
| 134 | + | <description summary="controller object for graphic tablet devices of a seat"> | |
| 135 | + | An object that provides access to the graphics tablets available on this | |
| 136 | + | seat. After binding to this interface, the compositor sends a set of | |
| 137 | + | zwp_tablet_seat_v2.tablet_added and zwp_tablet_seat_v2.tool_added events. | |
| 138 | + | </description> | |
| 139 | + | ||
| 140 | + | <request name="destroy" type="destructor"> | |
| 141 | + | <description summary="release the memory for the tablet seat object"> | |
| 142 | + | Destroy the zwp_tablet_seat_v2 object. Objects created from this | |
| 143 | + | object are unaffected and should be destroyed separately. | |
| 144 | + | </description> | |
| 145 | + | </request> | |
| 146 | + | ||
| 147 | + | <event name="tablet_added"> | |
| 148 | + | <description summary="new device notification"> | |
| 149 | + | This event is sent whenever a new tablet becomes available on this | |
| 150 | + | seat. This event only provides the object id of the tablet, any | |
| 151 | + | static information about the tablet (device name, vid/pid, etc.) is | |
| 152 | + | sent through the zwp_tablet_v2 interface. | |
| 153 | + | </description> | |
| 154 | + | <arg name="id" type="new_id" interface="zwp_tablet_v2" summary="the newly added graphics tablet"/> | |
| 155 | + | </event> | |
| 156 | + | ||
| 157 | + | <event name="tool_added"> | |
| 158 | + | <description summary="a new tool has been used with a tablet"> | |
| 159 | + | This event is sent whenever a tool that has not previously been used | |
| 160 | + | with a tablet comes into use. This event only provides the object id | |
| 161 | + | of the tool; any static information about the tool (capabilities, | |
| 162 | + | type, etc.) is sent through the zwp_tablet_tool_v2 interface. | |
| 163 | + | </description> | |
| 164 | + | <arg name="id" type="new_id" interface="zwp_tablet_tool_v2" summary="the newly added tablet tool"/> | |
| 165 | + | </event> | |
| 166 | + | ||
| 167 | + | <event name="pad_added"> | |
| 168 | + | <description summary="new pad notification"> | |
| 169 | + | This event is sent whenever a new pad is known to the system. Typically, | |
| 170 | + | pads are physically attached to tablets and a pad_added event is | |
| 171 | + | sent immediately after the zwp_tablet_seat_v2.tablet_added. | |
| 172 | + | However, some standalone pad devices logically attach to tablets at | |
| 173 | + | runtime, and the client must wait for zwp_tablet_pad_v2.enter to know | |
| 174 | + | the tablet a pad is attached to. | |
| 175 | + | ||
| 176 | + | This event only provides the object id of the pad. All further | |
| 177 | + | features (buttons, strips, rings) are sent through the zwp_tablet_pad_v2 | |
| 178 | + | interface. | |
| 179 | + | </description> | |
| 180 | + | <arg name="id" type="new_id" interface="zwp_tablet_pad_v2" summary="the newly added pad"/> | |
| 181 | + | </event> | |
| 182 | + | </interface> | |
| 183 | + | ||
| 184 | + | <interface name="zwp_tablet_tool_v2" version="2"> | |
| 185 | + | <description summary="a physical tablet tool"> | |
| 186 | + | An object that represents a physical tool that has been, or is | |
| 187 | + | currently in use with a tablet in this seat. Each zwp_tablet_tool_v2 | |
| 188 | + | object stays valid until the client destroys it; the compositor | |
| 189 | + | reuses the zwp_tablet_tool_v2 object to indicate that the object's | |
| 190 | + | respective physical tool has come into proximity of a tablet again. | |
| 191 | + | ||
| 192 | + | A zwp_tablet_tool_v2 object's relation to a physical tool depends on the | |
| 193 | + | tablet's ability to report serial numbers. If the tablet supports | |
| 194 | + | this capability, then the object represents a specific physical tool | |
| 195 | + | and can be identified even when used on multiple tablets. | |
| 196 | + | ||
| 197 | + | A tablet tool has a number of static characteristics, e.g. tool type, | |
| 198 | + | hardware_serial and capabilities. These capabilities are sent in an | |
| 199 | + | event sequence after the zwp_tablet_seat_v2.tool_added event before any | |
| 200 | + | actual events from this tool. This initial event sequence is | |
| 201 | + | terminated by a zwp_tablet_tool_v2.done event. | |
| 202 | + | ||
| 203 | + | Tablet tool events are grouped by zwp_tablet_tool_v2.frame events. | |
| 204 | + | Any events received before a zwp_tablet_tool_v2.frame event should be | |
| 205 | + | considered part of the same hardware state change. | |
| 206 | + | </description> | |
| 207 | + | ||
| 208 | + | <request name="set_cursor"> | |
| 209 | + | <description summary="set the tablet tool's surface"> | |
| 210 | + | Sets the surface of the cursor used for this tool on the given | |
| 211 | + | tablet. This request only takes effect if the tool is in proximity | |
| 212 | + | of one of the requesting client's surfaces or the surface parameter | |
| 213 | + | is the current pointer surface. If there was a previous surface set | |
| 214 | + | with this request it is replaced. If surface is NULL, the cursor | |
| 215 | + | image is hidden. | |
| 216 | + | ||
| 217 | + | The parameters hotspot_x and hotspot_y define the position of the | |
| 218 | + | pointer surface relative to the pointer location. Its top-left corner | |
| 219 | + | is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the | |
| 220 | + | coordinates of the pointer location, in surface-local coordinates. | |
| 221 | + | ||
| 222 | + | On surface.attach requests to the pointer surface, hotspot_x and | |
| 223 | + | hotspot_y are decremented by the x and y parameters passed to the | |
| 224 | + | request. Attach must be confirmed by wl_surface.commit as usual. | |
| 225 | + | ||
| 226 | + | The hotspot can also be updated by passing the currently set pointer | |
| 227 | + | surface to this request with new values for hotspot_x and hotspot_y. | |
| 228 | + | ||
| 229 | + | The current and pending input regions of the wl_surface are cleared, | |
| 230 | + | and wl_surface.set_input_region is ignored until the wl_surface is no | |
| 231 | + | longer used as the cursor. When the use as a cursor ends, the current | |
| 232 | + | and pending input regions become undefined, and the wl_surface is | |
| 233 | + | unmapped. | |
| 234 | + | ||
| 235 | + | This request gives the surface the role of a zwp_tablet_tool_v2 cursor. A | |
| 236 | + | surface may only ever be used as the cursor surface for one | |
| 237 | + | zwp_tablet_tool_v2. If the surface already has another role or has | |
| 238 | + | previously been used as cursor surface for a different tool, a | |
| 239 | + | protocol error is raised. | |
| 240 | + | </description> | |
| 241 | + | <arg name="serial" type="uint" summary="serial of the proximity_in event"/> | |
| 242 | + | <arg name="surface" type="object" interface="wl_surface" allow-null="true"/> | |
| 243 | + | <arg name="hotspot_x" type="int" summary="surface-local x coordinate"/> | |
| 244 | + | <arg name="hotspot_y" type="int" summary="surface-local y coordinate"/> | |
| 245 | + | </request> | |
| 246 | + | ||
| 247 | + | <request name="destroy" type="destructor"> | |
| 248 | + | <description summary="destroy the tool object"> | |
| 249 | + | This destroys the client's resource for this tool object. | |
| 250 | + | </description> | |
| 251 | + | </request> | |
| 252 | + | ||
| 253 | + | <enum name="type"> | |
| 254 | + | <description summary="a physical tool type"> | |
| 255 | + | Describes the physical type of a tool. The physical type of a tool | |
| 256 | + | generally defines its base usage. | |
| 257 | + | ||
| 258 | + | The mouse tool represents a mouse-shaped tool that is not a relative | |
| 259 | + | device but bound to the tablet's surface, providing absolute | |
| 260 | + | coordinates. | |
| 261 | + | ||
| 262 | + | The lens tool is a mouse-shaped tool with an attached lens to | |
| 263 | + | provide precision focus. | |
| 264 | + | </description> | |
| 265 | + | <entry name="pen" value="0x140" summary="Pen"/> | |
| 266 | + | <entry name="eraser" value="0x141" summary="Eraser"/> | |
| 267 | + | <entry name="brush" value="0x142" summary="Brush"/> | |
| 268 | + | <entry name="pencil" value="0x143" summary="Pencil"/> | |
| 269 | + | <entry name="airbrush" value="0x144" summary="Airbrush"/> | |
| 270 | + | <entry name="finger" value="0x145" summary="Finger"/> | |
| 271 | + | <entry name="mouse" value="0x146" summary="Mouse"/> | |
| 272 | + | <entry name="lens" value="0x147" summary="Lens"/> | |
| 273 | + | </enum> | |
| 274 | + | ||
| 275 | + | <event name="type"> | |
| 276 | + | <description summary="tool type"> | |
| 277 | + | The tool type is the high-level type of the tool and usually decides | |
| 278 | + | the interaction expected from this tool. | |
| 279 | + | ||
| 280 | + | This event is sent in the initial burst of events before the | |
| 281 | + | zwp_tablet_tool_v2.done event. | |
| 282 | + | </description> | |
| 283 | + | <arg name="tool_type" type="uint" enum="type" summary="the physical tool type"/> | |
| 284 | + | </event> | |
| 285 | + | ||
| 286 | + | <event name="hardware_serial"> | |
| 287 | + | <description summary="unique hardware serial number of the tool"> | |
| 288 | + | If the physical tool can be identified by a unique 64-bit serial | |
| 289 | + | number, this event notifies the client of this serial number. | |
| 290 | + | ||
| 291 | + | If multiple tablets are available in the same seat and the tool is | |
| 292 | + | uniquely identifiable by the serial number, that tool may move | |
| 293 | + | between tablets. | |
| 294 | + | ||
| 295 | + | Otherwise, if the tool has no serial number and this event is | |
| 296 | + | missing, the tool is tied to the tablet it first comes into | |
| 297 | + | proximity with. Even if the physical tool is used on multiple | |
| 298 | + | tablets, separate zwp_tablet_tool_v2 objects will be created, one per | |
| 299 | + | tablet. | |
| 300 | + | ||
| 301 | + | This event is sent in the initial burst of events before the | |
| 302 | + | zwp_tablet_tool_v2.done event. | |
| 303 | + | </description> | |
| 304 | + | <arg name="hardware_serial_hi" type="uint" summary="the unique serial number of the tool, most significant bits"/> | |
| 305 | + | <arg name="hardware_serial_lo" type="uint" summary="the unique serial number of the tool, least significant bits"/> | |
| 306 | + | </event> | |
| 307 | + | ||
| 308 | + | <event name="hardware_id_wacom"> | |
| 309 | + | <description summary="hardware id notification in Wacom's format"> | |
| 310 | + | This event notifies the client of a hardware id available on this tool. | |
| 311 | + | ||
| 312 | + | The hardware id is a device-specific 64-bit id that provides extra | |
| 313 | + | information about the tool in use, beyond the wl_tool.type | |
| 314 | + | enumeration. The format of the id is specific to tablets made by | |
| 315 | + | Wacom Inc. For example, the hardware id of a Wacom Grip | |
| 316 | + | Pen (a stylus) is 0x802. | |
| 317 | + | ||
| 318 | + | This event is sent in the initial burst of events before the | |
| 319 | + | zwp_tablet_tool_v2.done event. | |
| 320 | + | </description> | |
| 321 | + | <arg name="hardware_id_hi" type="uint" summary="the hardware id, most significant bits"/> | |
| 322 | + | <arg name="hardware_id_lo" type="uint" summary="the hardware id, least significant bits"/> | |
| 323 | + | </event> | |
| 324 | + | ||
| 325 | + | <enum name="capability"> | |
| 326 | + | <description summary="capability flags for a tool"> | |
| 327 | + | Describes extra capabilities on a tablet. | |
| 328 | + | ||
| 329 | + | Any tool must provide x and y values, extra axes are | |
| 330 | + | device-specific. | |
| 331 | + | </description> | |
| 332 | + | <entry name="tilt" value="1" summary="Tilt axes"/> | |
| 333 | + | <entry name="pressure" value="2" summary="Pressure axis"/> | |
| 334 | + | <entry name="distance" value="3" summary="Distance axis"/> | |
| 335 | + | <entry name="rotation" value="4" summary="Z-rotation axis"/> | |
| 336 | + | <entry name="slider" value="5" summary="Slider axis"/> | |
| 337 | + | <entry name="wheel" value="6" summary="Wheel axis"/> | |
| 338 | + | </enum> | |
| 339 | + | ||
| 340 | + | <event name="capability"> | |
| 341 | + | <description summary="tool capability notification"> | |
| 342 | + | This event notifies the client of any capabilities of this tool, | |
| 343 | + | beyond the main set of x/y axes and tip up/down detection. | |
| 344 | + | ||
| 345 | + | One event is sent for each extra capability available on this tool. | |
| 346 | + | ||
| 347 | + | This event is sent in the initial burst of events before the | |
| 348 | + | zwp_tablet_tool_v2.done event. | |
| 349 | + | </description> | |
| 350 | + | <arg name="capability" type="uint" enum="capability" summary="the capability"/> | |
| 351 | + | </event> | |
| 352 | + | ||
| 353 | + | <event name="done"> | |
| 354 | + | <description summary="tool description events sequence complete"> | |
| 355 | + | This event signals the end of the initial burst of descriptive | |
| 356 | + | events. A client may consider the static description of the tool to | |
| 357 | + | be complete and finalize initialization of the tool. | |
| 358 | + | </description> | |
| 359 | + | </event> | |
| 360 | + | ||
| 361 | + | <event name="removed"> | |
| 362 | + | <description summary="tool removed"> | |
| 363 | + | This event is sent when the tool is removed from the system and will | |
| 364 | + | send no further events. Should the physical tool come back into | |
| 365 | + | proximity later, a new zwp_tablet_tool_v2 object will be created. | |
| 366 | + | ||
| 367 | + | It is compositor-dependent when a tool is removed. A compositor may | |
| 368 | + | remove a tool on proximity out, tablet removal or any other reason. | |
| 369 | + | A compositor may also keep a tool alive until shutdown. | |
| 370 | + | ||
| 371 | + | If the tool is currently in proximity, a proximity_out event will be | |
| 372 | + | sent before the removed event. See zwp_tablet_tool_v2.proximity_out for | |
| 373 | + | the handling of any buttons logically down. | |
| 374 | + | ||
| 375 | + | When this event is received, the client must zwp_tablet_tool_v2.destroy | |
| 376 | + | the object. | |
| 377 | + | </description> | |
| 378 | + | </event> | |
| 379 | + | ||
| 380 | + | <event name="proximity_in"> | |
| 381 | + | <description summary="proximity in event"> | |
| 382 | + | Notification that this tool is focused on a certain surface. | |
| 383 | + | ||
| 384 | + | This event can be received when the tool has moved from one surface to | |
| 385 | + | another, or when the tool has come back into proximity above the | |
| 386 | + | surface. | |
| 387 | + | ||
| 388 | + | If any button is logically down when the tool comes into proximity, | |
| 389 | + | the respective button event is sent after the proximity_in event but | |
| 390 | + | within the same frame as the proximity_in event. | |
| 391 | + | </description> | |
| 392 | + | <arg name="serial" type="uint"/> | |
| 393 | + | <arg name="tablet" type="object" interface="zwp_tablet_v2" summary="The tablet the tool is in proximity of"/> | |
| 394 | + | <arg name="surface" type="object" interface="wl_surface" summary="The current surface the tablet tool is over"/> | |
| 395 | + | </event> | |
| 396 | + | ||
| 397 | + | <event name="proximity_out"> | |
| 398 | + | <description summary="proximity out event"> | |
| 399 | + | Notification that this tool has either left proximity, or is no | |
| 400 | + | longer focused on a certain surface. | |
| 401 | + | ||
| 402 | + | When the tablet tool leaves proximity of the tablet, button release | |
| 403 | + | events are sent for each button that was held down at the time of | |
| 404 | + | leaving proximity. These events are sent before the proximity_out | |
| 405 | + | event but within the same zwp_tablet_v2.frame. | |
| 406 | + | ||
| 407 | + | If the tool stays within proximity of the tablet, but the focus | |
| 408 | + | changes from one surface to another, a button release event may not | |
| 409 | + | be sent until the button is actually released or the tool leaves the | |
| 410 | + | proximity of the tablet. | |
| 411 | + | </description> | |
| 412 | + | </event> | |
| 413 | + | ||
| 414 | + | <event name="down"> | |
| 415 | + | <description summary="tablet tool is making contact"> | |
| 416 | + | Sent whenever the tablet tool comes in contact with the surface of the | |
| 417 | + | tablet. | |
| 418 | + | ||
| 419 | + | If the tool is already in contact with the tablet when entering the | |
| 420 | + | input region, the client owning said region will receive a | |
| 421 | + | zwp_tablet_v2.proximity_in event, followed by a zwp_tablet_v2.down | |
| 422 | + | event and a zwp_tablet_v2.frame event. | |
| 423 | + | ||
| 424 | + | Note that this event describes logical contact, not physical | |
| 425 | + | contact. On some devices, a compositor may not consider a tool in | |
| 426 | + | logical contact until a minimum physical pressure threshold is | |
| 427 | + | exceeded. | |
| 428 | + | </description> | |
| 429 | + | <arg name="serial" type="uint"/> | |
| 430 | + | </event> | |
| 431 | + | ||
| 432 | + | <event name="up"> | |
| 433 | + | <description summary="tablet tool is no longer making contact"> | |
| 434 | + | Sent whenever the tablet tool stops making contact with the surface of | |
| 435 | + | the tablet, or when the tablet tool moves out of the input region | |
| 436 | + | and the compositor grab (if any) is dismissed. | |
| 437 | + | ||
| 438 | + | If the tablet tool moves out of the input region while in contact | |
| 439 | + | with the surface of the tablet and the compositor does not have an | |
| 440 | + | ongoing grab on the surface, the client owning said region will | |
| 441 | + | receive a zwp_tablet_v2.up event, followed by a zwp_tablet_v2.proximity_out | |
| 442 | + | event and a zwp_tablet_v2.frame event. If the compositor has an ongoing | |
| 443 | + | grab on this device, this event sequence is sent whenever the grab | |
| 444 | + | is dismissed in the future. | |
| 445 | + | ||
| 446 | + | Note that this event describes logical contact, not physical | |
| 447 | + | contact. On some devices, a compositor may not consider a tool out | |
| 448 | + | of logical contact until physical pressure falls below a specific | |
| 449 | + | threshold. | |
| 450 | + | </description> | |
| 451 | + | </event> | |
| 452 | + | ||
| 453 | + | <event name="motion"> | |
| 454 | + | <description summary="motion event"> | |
| 455 | + | Sent whenever a tablet tool moves. | |
| 456 | + | </description> | |
| 457 | + | <arg name="x" type="fixed" summary="surface-local x coordinate"/> | |
| 458 | + | <arg name="y" type="fixed" summary="surface-local y coordinate"/> | |
| 459 | + | </event> | |
| 460 | + | ||
| 461 | + | <event name="pressure"> | |
| 462 | + | <description summary="pressure change event"> | |
| 463 | + | Sent whenever the pressure axis on a tool changes. The value of this | |
| 464 | + | event is normalized to a value between 0 and 65535. | |
| 465 | + | ||
| 466 | + | Note that pressure may be nonzero even when a tool is not in logical | |
| 467 | + | contact. See the down and up events for more details. | |
| 468 | + | </description> | |
| 469 | + | <arg name="pressure" type="uint" summary="The current pressure value"/> | |
| 470 | + | </event> | |
| 471 | + | ||
| 472 | + | <event name="distance"> | |
| 473 | + | <description summary="distance change event"> | |
| 474 | + | Sent whenever the distance axis on a tool changes. The value of this | |
| 475 | + | event is normalized to a value between 0 and 65535. | |
| 476 | + | ||
| 477 | + | Note that distance may be nonzero even when a tool is not in logical | |
| 478 | + | contact. See the down and up events for more details. | |
| 479 | + | </description> | |
| 480 | + | <arg name="distance" type="uint" summary="The current distance value"/> | |
| 481 | + | </event> | |
| 482 | + | ||
| 483 | + | <event name="tilt"> | |
| 484 | + | <description summary="tilt change event"> | |
| 485 | + | Sent whenever one or both of the tilt axes on a tool change. Each tilt | |
| 486 | + | value is in degrees, relative to the z-axis of the tablet. | |
| 487 | + | The angle is positive when the top of a tool tilts along the | |
| 488 | + | positive x or y axis. | |
| 489 | + | </description> | |
| 490 | + | <arg name="tilt_x" type="fixed" summary="The current value of the X tilt axis"/> | |
| 491 | + | <arg name="tilt_y" type="fixed" summary="The current value of the Y tilt axis"/> | |
| 492 | + | </event> | |
| 493 | + | ||
| 494 | + | <event name="rotation"> | |
| 495 | + | <description summary="z-rotation change event"> | |
| 496 | + | Sent whenever the z-rotation axis on the tool changes. The | |
| 497 | + | rotation value is in degrees clockwise from the tool's | |
| 498 | + | logical neutral position. | |
| 499 | + | </description> | |
| 500 | + | <arg name="degrees" type="fixed" summary="The current rotation of the Z axis"/> | |
| 501 | + | </event> | |
| 502 | + | ||
| 503 | + | <event name="slider"> | |
| 504 | + | <description summary="Slider position change event"> | |
| 505 | + | Sent whenever the slider position on the tool changes. The | |
| 506 | + | value is normalized between -65535 and 65535, with 0 as the logical | |
| 507 | + | neutral position of the slider. | |
| 508 | + | ||
| 509 | + | The slider is available on e.g. the Wacom Airbrush tool. | |
| 510 | + | </description> | |
| 511 | + | <arg name="position" type="int" summary="The current position of slider"/> | |
| 512 | + | </event> | |
| 513 | + | ||
| 514 | + | <event name="wheel"> | |
| 515 | + | <description summary="Wheel delta event"> | |
| 516 | + | Sent whenever the wheel on the tool emits an event. This event | |
| 517 | + | contains two values for the same axis change. The degrees value is | |
| 518 | + | in the same orientation as the wl_pointer.vertical_scroll axis. The | |
| 519 | + | clicks value is in discrete logical clicks of the mouse wheel. This | |
| 520 | + | value may be zero if the movement of the wheel was less | |
| 521 | + | than one logical click. | |
| 522 | + | ||
| 523 | + | Clients should choose either value and avoid mixing degrees and | |
| 524 | + | clicks. The compositor may accumulate values smaller than a logical | |
| 525 | + | click and emulate click events when a certain threshold is met. | |
| 526 | + | Thus, zwp_tablet_tool_v2.wheel events with non-zero clicks values may | |
| 527 | + | have different degrees values. | |
| 528 | + | </description> | |
| 529 | + | <arg name="degrees" type="fixed" summary="The wheel delta in degrees"/> | |
| 530 | + | <arg name="clicks" type="int" summary="The wheel delta in discrete clicks"/> | |
| 531 | + | </event> | |
| 532 | + | ||
| 533 | + | <enum name="button_state"> | |
| 534 | + | <description summary="physical button state"> | |
| 535 | + | Describes the physical state of a button that produced the button event. | |
| 536 | + | </description> | |
| 537 | + | <entry name="released" value="0" summary="button is not pressed"/> | |
| 538 | + | <entry name="pressed" value="1" summary="button is pressed"/> | |
| 539 | + | </enum> | |
| 540 | + | ||
| 541 | + | <event name="button"> | |
| 542 | + | <description summary="button event"> | |
| 543 | + | Sent whenever a button on the tool is pressed or released. | |
| 544 | + | ||
| 545 | + | If a button is held down when the tool moves in or out of proximity, | |
| 546 | + | button events are generated by the compositor. See | |
| 547 | + | zwp_tablet_tool_v2.proximity_in and zwp_tablet_tool_v2.proximity_out for | |
| 548 | + | details. | |
| 549 | + | </description> | |
| 550 | + | <arg name="serial" type="uint"/> | |
| 551 | + | <arg name="button" type="uint" summary="The button whose state has changed"/> | |
| 552 | + | <arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/> | |
| 553 | + | </event> | |
| 554 | + | ||
| 555 | + | <event name="frame"> | |
| 556 | + | <description summary="frame event"> | |
| 557 | + | Marks the end of a series of axis and/or button updates from the | |
| 558 | + | tablet. The Wayland protocol requires axis updates to be sent | |
| 559 | + | sequentially, however all events within a frame should be considered | |
| 560 | + | one hardware event. | |
| 561 | + | </description> | |
| 562 | + | <arg name="time" type="uint" summary="The time of the event with millisecond granularity"/> | |
| 563 | + | </event> | |
| 564 | + | ||
| 565 | + | <enum name="error"> | |
| 566 | + | <entry name="role" value="0" summary="given wl_surface has another role"/> | |
| 567 | + | </enum> | |
| 568 | + | </interface> | |
| 569 | + | ||
| 570 | + | <interface name="zwp_tablet_v2" version="2"> | |
| 571 | + | <description summary="graphics tablet device"> | |
| 572 | + | The zwp_tablet_v2 interface represents one graphics tablet device. The | |
| 573 | + | tablet interface itself does not generate events; all events are | |
| 574 | + | generated by zwp_tablet_tool_v2 objects when in proximity above a tablet. | |
| 575 | + | ||
| 576 | + | A tablet has a number of static characteristics, e.g. device name and | |
| 577 | + | pid/vid. These capabilities are sent in an event sequence after the | |
| 578 | + | zwp_tablet_seat_v2.tablet_added event. This initial event sequence is | |
| 579 | + | terminated by a zwp_tablet_v2.done event. | |
| 580 | + | </description> | |
| 581 | + | ||
| 582 | + | <request name="destroy" type="destructor"> | |
| 583 | + | <description summary="destroy the tablet object"> | |
| 584 | + | This destroys the client's resource for this tablet object. | |
| 585 | + | </description> | |
| 586 | + | </request> | |
| 587 | + | ||
| 588 | + | <event name="name"> | |
| 589 | + | <description summary="tablet device name"> | |
| 590 | + | A descriptive name for the tablet device. | |
| 591 | + | ||
| 592 | + | If the device has no descriptive name, this event is not sent. | |
| 593 | + | ||
| 594 | + | This event is sent in the initial burst of events before the | |
| 595 | + | zwp_tablet_v2.done event. | |
| 596 | + | </description> | |
| 597 | + | <arg name="name" type="string" summary="the device name"/> | |
| 598 | + | </event> | |
| 599 | + | ||
| 600 | + | <event name="id"> | |
| 601 | + | <description summary="tablet device vendor/product id"> | |
| 602 | + | The vendor and product IDs for the tablet device. | |
| 603 | + | ||
| 604 | + | The interpretation of the id depends on the zwp_tablet_v2.bustype. | |
| 605 | + | Prior to version v2 of this protocol, the id was implied to be a USB | |
| 606 | + | vendor and product ID. If no zwp_tablet_v2.bustype is sent, the ID | |
| 607 | + | is to be interpreted as USB vendor and product ID. | |
| 608 | + | ||
| 609 | + | If the device has no vendor/product ID, this event is not sent. | |
| 610 | + | This can happen for virtual devices or non-USB devices, for instance. | |
| 611 | + | ||
| 612 | + | This event is sent in the initial burst of events before the | |
| 613 | + | zwp_tablet_v2.done event. | |
| 614 | + | </description> | |
| 615 | + | <arg name="vid" type="uint" summary="vendor id"/> | |
| 616 | + | <arg name="pid" type="uint" summary="product id"/> | |
| 617 | + | </event> | |
| 618 | + | ||
| 619 | + | <event name="path"> | |
| 620 | + | <description summary="path to the device"> | |
| 621 | + | A system-specific device path that indicates which device is behind | |
| 622 | + | this zwp_tablet_v2. This information may be used to gather additional | |
| 623 | + | information about the device, e.g. through libwacom. | |
| 624 | + | ||
| 625 | + | A device may have more than one device path. If so, multiple | |
| 626 | + | zwp_tablet_v2.path events are sent. A device may be emulated and not | |
| 627 | + | have a device path, and in that case this event will not be sent. | |
| 628 | + | ||
| 629 | + | The format of the path is unspecified, it may be a device node, a | |
| 630 | + | sysfs path, or some other identifier. It is up to the client to | |
| 631 | + | identify the string provided. | |
| 632 | + | ||
| 633 | + | This event is sent in the initial burst of events before the | |
| 634 | + | zwp_tablet_v2.done event. | |
| 635 | + | </description> | |
| 636 | + | <arg name="path" type="string" summary="path to local device"/> | |
| 637 | + | </event> | |
| 638 | + | ||
| 639 | + | <event name="done"> | |
| 640 | + | <description summary="tablet description events sequence complete"> | |
| 641 | + | This event is sent immediately to signal the end of the initial | |
| 642 | + | burst of descriptive events. A client may consider the static | |
| 643 | + | description of the tablet to be complete and finalize initialization | |
| 644 | + | of the tablet. | |
| 645 | + | </description> | |
| 646 | + | </event> | |
| 647 | + | ||
| 648 | + | <event name="removed"> | |
| 649 | + | <description summary="tablet removed event"> | |
| 650 | + | Sent when the tablet has been removed from the system. When a tablet | |
| 651 | + | is removed, some tools may be removed. | |
| 652 | + | ||
| 653 | + | When this event is received, the client must zwp_tablet_v2.destroy | |
| 654 | + | the object. | |
| 655 | + | </description> | |
| 656 | + | </event> | |
| 657 | + | ||
| 658 | + | <!-- Version 2 additions --> | |
| 659 | + | ||
| 660 | + | <enum name="bustype" since="2"> | |
| 661 | + | <description summary="bus type "> | |
| 662 | + | Describes the bus types this tablet is connected to. | |
| 663 | + | </description> | |
| 664 | + | <entry name="usb" value="3" summary="USB"/> | |
| 665 | + | <entry name="bluetooth" value="5" summary="Bluetooth"/> | |
| 666 | + | <entry name="virtual" value="6" summary="Virtual"/> | |
| 667 | + | <entry name="serial" value="17" summary="Serial"/> | |
| 668 | + | <entry name="i2c" value="24" summary="I2C"/> | |
| 669 | + | </enum> | |
| 670 | + | ||
| 671 | + | <event name="bustype" since="2"> | |
| 672 | + | <description summary="tablet device bus type"> | |
| 673 | + | The bustype argument is one of the BUS_ defines in the Linux kernel's | |
| 674 | + | linux/input.h | |
| 675 | + | ||
| 676 | + | If the device has no known bustype or the bustype cannot be | |
| 677 | + | queried, this event is not sent. | |
| 678 | + | ||
| 679 | + | This event is sent in the initial burst of events before the | |
| 680 | + | zwp_tablet_v2.done event. | |
| 681 | + | </description> | |
| 682 | + | <arg name="bustype" type="uint" enum="bustype" summary="bus type"/> | |
| 683 | + | </event> | |
| 684 | + | </interface> | |
| 685 | + | ||
| 686 | + | <interface name="zwp_tablet_pad_ring_v2" version="2"> | |
| 687 | + | <description summary="pad ring"> | |
| 688 | + | A circular interaction area, such as the touch ring on the Wacom Intuos | |
| 689 | + | Pro series tablets. | |
| 690 | + | ||
| 691 | + | Events on a ring are logically grouped by the zwp_tablet_pad_ring_v2.frame | |
| 692 | + | event. | |
| 693 | + | </description> | |
| 694 | + | ||
| 695 | + | <request name="set_feedback"> | |
| 696 | + | <description summary="set compositor feedback"> | |
| 697 | + | Request that the compositor use the provided feedback string | |
| 698 | + | associated with this ring. This request should be issued immediately | |
| 699 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |
| 700 | + | group is received, or whenever the ring is mapped to a different | |
| 701 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |
| 702 | + | ||
| 703 | + | Clients are encouraged to provide context-aware descriptions for | |
| 704 | + | the actions associated with the ring; compositors may use this | |
| 705 | + | information to offer visual feedback about the button layout | |
| 706 | + | (eg. on-screen displays). | |
| 707 | + | ||
| 708 | + | The provided string 'description' is a UTF-8 encoded string to be | |
| 709 | + | associated with this ring, and is considered user-visible; general | |
| 710 | + | internationalization rules apply. | |
| 711 | + | ||
| 712 | + | The serial argument will be that of the last | |
| 713 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |
| 714 | + | ring. Requests providing other serials than the most recent one will be | |
| 715 | + | ignored. | |
| 716 | + | </description> | |
| 717 | + | <arg name="description" type="string" summary="ring description"/> | |
| 718 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |
| 719 | + | </request> | |
| 720 | + | ||
| 721 | + | <request name="destroy" type="destructor"> | |
| 722 | + | <description summary="destroy the ring object"> | |
| 723 | + | This destroys the client's resource for this ring object. | |
| 724 | + | </description> | |
| 725 | + | </request> | |
| 726 | + | ||
| 727 | + | <enum name="source"> | |
| 728 | + | <description summary="ring axis source"> | |
| 729 | + | Describes the source types for ring events. This indicates to the | |
| 730 | + | client how a ring event was physically generated; a client may | |
| 731 | + | adjust the user interface accordingly. For example, events | |
| 732 | + | from a "finger" source may trigger kinetic scrolling. | |
| 733 | + | </description> | |
| 734 | + | <entry name="finger" value="1" summary="finger"/> | |
| 735 | + | </enum> | |
| 736 | + | ||
| 737 | + | <event name="source"> | |
| 738 | + | <description summary="ring event source"> | |
| 739 | + | Source information for ring events. | |
| 740 | + | ||
| 741 | + | This event does not occur on its own. It is sent before a | |
| 742 | + | zwp_tablet_pad_ring_v2.frame event and carries the source information | |
| 743 | + | for all events within that frame. | |
| 744 | + | ||
| 745 | + | The source specifies how this event was generated. If the source is | |
| 746 | + | zwp_tablet_pad_ring_v2.source.finger, a zwp_tablet_pad_ring_v2.stop event | |
| 747 | + | will be sent when the user lifts the finger off the device. | |
| 748 | + | ||
| 749 | + | This event is optional. If the source is unknown for an interaction, | |
| 750 | + | no event is sent. | |
| 751 | + | </description> | |
| 752 | + | <arg name="source" type="uint" enum="source" summary="the event source"/> | |
| 753 | + | </event> | |
| 754 | + | ||
| 755 | + | <event name="angle"> | |
| 756 | + | <description summary="angle changed"> | |
| 757 | + | Sent whenever the angle on a ring changes. | |
| 758 | + | ||
| 759 | + | The angle is provided in degrees clockwise from the logical | |
| 760 | + | north of the ring in the pad's current rotation. | |
| 761 | + | </description> | |
| 762 | + | <arg name="degrees" type="fixed" summary="the current angle in degrees"/> | |
| 763 | + | </event> | |
| 764 | + | ||
| 765 | + | <event name="stop"> | |
| 766 | + | <description summary="interaction stopped"> | |
| 767 | + | Stop notification for ring events. | |
| 768 | + | ||
| 769 | + | For some zwp_tablet_pad_ring_v2.source types, a zwp_tablet_pad_ring_v2.stop | |
| 770 | + | event is sent to notify a client that the interaction with the ring | |
| 771 | + | has terminated. This enables the client to implement kinetic scrolling. | |
| 772 | + | See the zwp_tablet_pad_ring_v2.source documentation for information on | |
| 773 | + | when this event may be generated. | |
| 774 | + | ||
| 775 | + | Any zwp_tablet_pad_ring_v2.angle events with the same source after this | |
| 776 | + | event should be considered as the start of a new interaction. | |
| 777 | + | </description> | |
| 778 | + | </event> | |
| 779 | + | ||
| 780 | + | <event name="frame"> | |
| 781 | + | <description summary="end of a ring event sequence"> | |
| 782 | + | Indicates the end of a set of ring events that logically belong | |
| 783 | + | together. A client is expected to accumulate the data in all events | |
| 784 | + | within the frame before proceeding. | |
| 785 | + | ||
| 786 | + | All zwp_tablet_pad_ring_v2 events before a zwp_tablet_pad_ring_v2.frame event belong | |
| 787 | + | logically together. For example, on termination of a finger interaction | |
| 788 | + | on a ring the compositor will send a zwp_tablet_pad_ring_v2.source event, | |
| 789 | + | a zwp_tablet_pad_ring_v2.stop event and a zwp_tablet_pad_ring_v2.frame event. | |
| 790 | + | ||
| 791 | + | A zwp_tablet_pad_ring_v2.frame event is sent for every logical event | |
| 792 | + | group, even if the group only contains a single zwp_tablet_pad_ring_v2 | |
| 793 | + | event. Specifically, a client may get a sequence: angle, frame, | |
| 794 | + | angle, frame, etc. | |
| 795 | + | </description> | |
| 796 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |
| 797 | + | </event> | |
| 798 | + | </interface> | |
| 799 | + | ||
| 800 | + | <interface name="zwp_tablet_pad_strip_v2" version="2"> | |
| 801 | + | <description summary="pad strip"> | |
| 802 | + | A linear interaction area, such as the strips found in Wacom Cintiq | |
| 803 | + | models. | |
| 804 | + | ||
| 805 | + | Events on a strip are logically grouped by the zwp_tablet_pad_strip_v2.frame | |
| 806 | + | event. | |
| 807 | + | </description> | |
| 808 | + | ||
| 809 | + | <request name="set_feedback"> | |
| 810 | + | <description summary="set compositor feedback"> | |
| 811 | + | Requests the compositor to use the provided feedback string | |
| 812 | + | associated with this strip. This request should be issued immediately | |
| 813 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |
| 814 | + | group is received, or whenever the strip is mapped to a different | |
| 815 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |
| 816 | + | ||
| 817 | + | Clients are encouraged to provide context-aware descriptions for | |
| 818 | + | the actions associated with the strip, and compositors may use this | |
| 819 | + | information to offer visual feedback about the button layout | |
| 820 | + | (eg. on-screen displays). | |
| 821 | + | ||
| 822 | + | The provided string 'description' is a UTF-8 encoded string to be | |
| 823 | + | associated with this ring, and is considered user-visible; general | |
| 824 | + | internationalization rules apply. | |
| 825 | + | ||
| 826 | + | The serial argument will be that of the last | |
| 827 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |
| 828 | + | strip. Requests providing other serials than the most recent one will be | |
| 829 | + | ignored. | |
| 830 | + | </description> | |
| 831 | + | <arg name="description" type="string" summary="strip description"/> | |
| 832 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |
| 833 | + | </request> | |
| 834 | + | ||
| 835 | + | <request name="destroy" type="destructor"> | |
| 836 | + | <description summary="destroy the strip object"> | |
| 837 | + | This destroys the client's resource for this strip object. | |
| 838 | + | </description> | |
| 839 | + | </request> | |
| 840 | + | ||
| 841 | + | <enum name="source"> | |
| 842 | + | <description summary="strip axis source"> | |
| 843 | + | Describes the source types for strip events. This indicates to the | |
| 844 | + | client how a strip event was physically generated; a client may | |
| 845 | + | adjust the user interface accordingly. For example, events | |
| 846 | + | from a "finger" source may trigger kinetic scrolling. | |
| 847 | + | </description> | |
| 848 | + | <entry name="finger" value="1" summary="finger"/> | |
| 849 | + | </enum> | |
| 850 | + | ||
| 851 | + | <event name="source"> | |
| 852 | + | <description summary="strip event source"> | |
| 853 | + | Source information for strip events. | |
| 854 | + | ||
| 855 | + | This event does not occur on its own. It is sent before a | |
| 856 | + | zwp_tablet_pad_strip_v2.frame event and carries the source information | |
| 857 | + | for all events within that frame. | |
| 858 | + | ||
| 859 | + | The source specifies how this event was generated. If the source is | |
| 860 | + | zwp_tablet_pad_strip_v2.source.finger, a zwp_tablet_pad_strip_v2.stop event | |
| 861 | + | will be sent when the user lifts their finger off the device. | |
| 862 | + | ||
| 863 | + | This event is optional. If the source is unknown for an interaction, | |
| 864 | + | no event is sent. | |
| 865 | + | </description> | |
| 866 | + | <arg name="source" type="uint" enum="source" summary="the event source"/> | |
| 867 | + | </event> | |
| 868 | + | ||
| 869 | + | <event name="position"> | |
| 870 | + | <description summary="position changed"> | |
| 871 | + | Sent whenever the position on a strip changes. | |
| 872 | + | ||
| 873 | + | The position is normalized to a range of [0, 65535], the 0-value | |
| 874 | + | represents the top-most and/or left-most position of the strip in | |
| 875 | + | the pad's current rotation. | |
| 876 | + | </description> | |
| 877 | + | <arg name="position" type="uint" summary="the current position"/> | |
| 878 | + | </event> | |
| 879 | + | ||
| 880 | + | <event name="stop"> | |
| 881 | + | <description summary="interaction stopped"> | |
| 882 | + | Stop notification for strip events. | |
| 883 | + | ||
| 884 | + | For some zwp_tablet_pad_strip_v2.source types, a zwp_tablet_pad_strip_v2.stop | |
| 885 | + | event is sent to notify a client that the interaction with the strip | |
| 886 | + | has terminated. This enables the client to implement kinetic | |
| 887 | + | scrolling. See the zwp_tablet_pad_strip_v2.source documentation for | |
| 888 | + | information on when this event may be generated. | |
| 889 | + | ||
| 890 | + | Any zwp_tablet_pad_strip_v2.position events with the same source after this | |
| 891 | + | event should be considered as the start of a new interaction. | |
| 892 | + | </description> | |
| 893 | + | </event> | |
| 894 | + | ||
| 895 | + | <event name="frame"> | |
| 896 | + | <description summary="end of a strip event sequence"> | |
| 897 | + | Indicates the end of a set of events that represent one logical | |
| 898 | + | hardware strip event. A client is expected to accumulate the data | |
| 899 | + | in all events within the frame before proceeding. | |
| 900 | + | ||
| 901 | + | All zwp_tablet_pad_strip_v2 events before a zwp_tablet_pad_strip_v2.frame event belong | |
| 902 | + | logically together. For example, on termination of a finger interaction | |
| 903 | + | on a strip the compositor will send a zwp_tablet_pad_strip_v2.source event, | |
| 904 | + | a zwp_tablet_pad_strip_v2.stop event and a zwp_tablet_pad_strip_v2.frame | |
| 905 | + | event. | |
| 906 | + | ||
| 907 | + | A zwp_tablet_pad_strip_v2.frame event is sent for every logical event | |
| 908 | + | group, even if the group only contains a single zwp_tablet_pad_strip_v2 | |
| 909 | + | event. Specifically, a client may get a sequence: position, frame, | |
| 910 | + | position, frame, etc. | |
| 911 | + | </description> | |
| 912 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |
| 913 | + | </event> | |
| 914 | + | </interface> | |
| 915 | + | ||
| 916 | + | <interface name="zwp_tablet_pad_group_v2" version="2"> | |
| 917 | + | <description summary="a set of buttons, rings and strips"> | |
| 918 | + | A pad group describes a distinct (sub)set of buttons, rings and strips | |
| 919 | + | present in the tablet. The criteria of this grouping is usually positional, | |
| 920 | + | eg. if a tablet has buttons on the left and right side, 2 groups will be | |
| 921 | + | presented. The physical arrangement of groups is undisclosed and may | |
| 922 | + | change on the fly. | |
| 923 | + | ||
| 924 | + | Pad groups will announce their features during pad initialization. Between | |
| 925 | + | the corresponding zwp_tablet_pad_v2.group event and zwp_tablet_pad_group_v2.done, the | |
| 926 | + | pad group will announce the buttons, rings and strips contained in it, | |
| 927 | + | plus the number of supported modes. | |
| 928 | + | ||
| 929 | + | Modes are a mechanism to allow multiple groups of actions for every element | |
| 930 | + | in the pad group. The number of groups and available modes in each is | |
| 931 | + | persistent across device plugs. The current mode is user-switchable, it | |
| 932 | + | will be announced through the zwp_tablet_pad_group_v2.mode_switch event both | |
| 933 | + | whenever it is switched, and after zwp_tablet_pad_v2.enter. | |
| 934 | + | ||
| 935 | + | The current mode logically applies to all elements in the pad group, | |
| 936 | + | although it is at clients' discretion whether to actually perform different | |
| 937 | + | actions, and/or issue the respective .set_feedback requests to notify the | |
| 938 | + | compositor. See the zwp_tablet_pad_group_v2.mode_switch event for more details. | |
| 939 | + | </description> | |
| 940 | + | ||
| 941 | + | <request name="destroy" type="destructor"> | |
| 942 | + | <description summary="destroy the pad object"> | |
| 943 | + | Destroy the zwp_tablet_pad_group_v2 object. Objects created from this object | |
| 944 | + | are unaffected and should be destroyed separately. | |
| 945 | + | </description> | |
| 946 | + | </request> | |
| 947 | + | ||
| 948 | + | <event name="buttons"> | |
| 949 | + | <description summary="buttons announced"> | |
| 950 | + | Sent on zwp_tablet_pad_group_v2 initialization to announce the available | |
| 951 | + | buttons in the group. Button indices start at 0, a button may only be | |
| 952 | + | in one group at a time. | |
| 953 | + | ||
| 954 | + | This event is first sent in the initial burst of events before the | |
| 955 | + | zwp_tablet_pad_group_v2.done event. | |
| 956 | + | ||
| 957 | + | Some buttons are reserved by the compositor. These buttons may not be | |
| 958 | + | assigned to any zwp_tablet_pad_group_v2. Compositors may broadcast this | |
| 959 | + | event in the case of changes to the mapping of these reserved buttons. | |
| 960 | + | If the compositor happens to reserve all buttons in a group, this event | |
| 961 | + | will be sent with an empty array. | |
| 962 | + | </description> | |
| 963 | + | <arg name="buttons" type="array" summary="buttons in this group"/> | |
| 964 | + | </event> | |
| 965 | + | ||
| 966 | + | <event name="ring"> | |
| 967 | + | <description summary="ring announced"> | |
| 968 | + | Sent on zwp_tablet_pad_group_v2 initialization to announce available rings. | |
| 969 | + | One event is sent for each ring available on this pad group. | |
| 970 | + | ||
| 971 | + | This event is sent in the initial burst of events before the | |
| 972 | + | zwp_tablet_pad_group_v2.done event. | |
| 973 | + | </description> | |
| 974 | + | <arg name="ring" type="new_id" interface="zwp_tablet_pad_ring_v2"/> | |
| 975 | + | </event> | |
| 976 | + | ||
| 977 | + | <event name="strip"> | |
| 978 | + | <description summary="strip announced"> | |
| 979 | + | Sent on zwp_tablet_pad_v2 initialization to announce available strips. | |
| 980 | + | One event is sent for each strip available on this pad group. | |
| 981 | + | ||
| 982 | + | This event is sent in the initial burst of events before the | |
| 983 | + | zwp_tablet_pad_group_v2.done event. | |
| 984 | + | </description> | |
| 985 | + | <arg name="strip" type="new_id" interface="zwp_tablet_pad_strip_v2"/> | |
| 986 | + | </event> | |
| 987 | + | ||
| 988 | + | <event name="modes"> | |
| 989 | + | <description summary="mode-switch ability announced"> | |
| 990 | + | Sent on zwp_tablet_pad_group_v2 initialization to announce that the pad | |
| 991 | + | group may switch between modes. A client may use a mode to store a | |
| 992 | + | specific configuration for buttons, rings and strips and use the | |
| 993 | + | zwp_tablet_pad_group_v2.mode_switch event to toggle between these | |
| 994 | + | configurations. Mode indices start at 0. | |
| 995 | + | ||
| 996 | + | Switching modes is compositor-dependent. See the | |
| 997 | + | zwp_tablet_pad_group_v2.mode_switch event for more details. | |
| 998 | + | ||
| 999 | + | This event is sent in the initial burst of events before the | |
| 1000 | + | zwp_tablet_pad_group_v2.done event. This event is only sent when | |
| 1001 | + | more than one mode is available. | |
| 1002 | + | </description> | |
| 1003 | + | <arg name="modes" type="uint" summary="the number of modes"/> | |
| 1004 | + | </event> | |
| 1005 | + | ||
| 1006 | + | <event name="done"> | |
| 1007 | + | <description summary="tablet group description events sequence complete"> | |
| 1008 | + | This event is sent immediately to signal the end of the initial | |
| 1009 | + | burst of descriptive events. A client may consider the static | |
| 1010 | + | description of the tablet to be complete and finalize initialization | |
| 1011 | + | of the tablet group. | |
| 1012 | + | </description> | |
| 1013 | + | </event> | |
| 1014 | + | ||
| 1015 | + | <event name="mode_switch"> | |
| 1016 | + | <description summary="mode switch event"> | |
| 1017 | + | Notification that the mode was switched. | |
| 1018 | + | ||
| 1019 | + | A mode applies to all buttons, rings, strips and dials in a group | |
| 1020 | + | simultaneously, but a client is not required to assign different actions | |
| 1021 | + | for each mode. For example, a client may have mode-specific button | |
| 1022 | + | mappings but map the ring to vertical scrolling in all modes. Mode | |
| 1023 | + | indices start at 0. | |
| 1024 | + | ||
| 1025 | + | Switching modes is compositor-dependent. The compositor may provide | |
| 1026 | + | visual cues to the user about the mode, e.g. by toggling LEDs on | |
| 1027 | + | the tablet device. Mode-switching may be software-controlled or | |
| 1028 | + | controlled by one or more physical buttons. For example, on a Wacom | |
| 1029 | + | Intuos Pro, the button inside the ring may be assigned to switch | |
| 1030 | + | between modes. | |
| 1031 | + | ||
| 1032 | + | The compositor will also send this event after zwp_tablet_pad_v2.enter on | |
| 1033 | + | each group in order to notify of the current mode. Groups that only | |
| 1034 | + | feature one mode will use mode=0 when emitting this event. | |
| 1035 | + | ||
| 1036 | + | If a button action in the new mode differs from the action in the | |
| 1037 | + | previous mode, the client should immediately issue a | |
| 1038 | + | zwp_tablet_pad_v2.set_feedback request for each changed button. | |
| 1039 | + | ||
| 1040 | + | If a ring, strip or dial action in the new mode differs from the action | |
| 1041 | + | in the previous mode, the client should immediately issue a | |
| 1042 | + | zwp_tablet_ring_v2.set_feedback, zwp_tablet_strip_v2.set_feedback or | |
| 1043 | + | zwp_tablet_dial_v2.set_feedback request for each changed ring, strip or dial. | |
| 1044 | + | </description> | |
| 1045 | + | <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/> | |
| 1046 | + | <arg name="serial" type="uint"/> | |
| 1047 | + | <arg name="mode" type="uint" summary="the new mode of the pad"/> | |
| 1048 | + | </event> | |
| 1049 | + | ||
| 1050 | + | <!-- Version 2 additions --> | |
| 1051 | + | ||
| 1052 | + | <event name="dial" since="2"> | |
| 1053 | + | <description summary="dial announced"> | |
| 1054 | + | Sent on zwp_tablet_pad_v2 initialization to announce available dials. | |
| 1055 | + | One event is sent for each dial available on this pad group. | |
| 1056 | + | ||
| 1057 | + | This event is sent in the initial burst of events before the | |
| 1058 | + | zwp_tablet_pad_group_v2.done event. | |
| 1059 | + | </description> | |
| 1060 | + | <arg name="dial" type="new_id" interface="zwp_tablet_pad_dial_v2"/> | |
| 1061 | + | </event> | |
| 1062 | + | </interface> | |
| 1063 | + | ||
| 1064 | + | <interface name="zwp_tablet_pad_v2" version="2"> | |
| 1065 | + | <description summary="a set of buttons, rings, strips and dials"> | |
| 1066 | + | A pad device is a set of buttons, rings, strips and dials | |
| 1067 | + | usually physically present on the tablet device itself. Some | |
| 1068 | + | exceptions exist where the pad device is physically detached, e.g. the | |
| 1069 | + | Wacom ExpressKey Remote. | |
| 1070 | + | ||
| 1071 | + | Pad devices have no axes that control the cursor and are generally | |
| 1072 | + | auxiliary devices to the tool devices used on the tablet surface. | |
| 1073 | + | ||
| 1074 | + | A pad device has a number of static characteristics, e.g. the number | |
| 1075 | + | of rings. These capabilities are sent in an event sequence after the | |
| 1076 | + | zwp_tablet_seat_v2.pad_added event before any actual events from this pad. | |
| 1077 | + | This initial event sequence is terminated by a zwp_tablet_pad_v2.done | |
| 1078 | + | event. | |
| 1079 | + | ||
| 1080 | + | All pad features (buttons, rings, strips and dials) are logically divided into | |
| 1081 | + | groups and all pads have at least one group. The available groups are | |
| 1082 | + | notified through the zwp_tablet_pad_v2.group event; the compositor will | |
| 1083 | + | emit one event per group before emitting zwp_tablet_pad_v2.done. | |
| 1084 | + | ||
| 1085 | + | Groups may have multiple modes. Modes allow clients to map multiple | |
| 1086 | + | actions to a single pad feature. Only one mode can be active per group, | |
| 1087 | + | although different groups may have different active modes. | |
| 1088 | + | </description> | |
| 1089 | + | ||
| 1090 | + | <request name="set_feedback"> | |
| 1091 | + | <description summary="set compositor feedback"> | |
| 1092 | + | Requests the compositor to use the provided feedback string | |
| 1093 | + | associated with this button. This request should be issued immediately | |
| 1094 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |
| 1095 | + | group is received, or whenever a button is mapped to a different | |
| 1096 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |
| 1097 | + | ||
| 1098 | + | Clients are encouraged to provide context-aware descriptions for | |
| 1099 | + | the actions associated with each button, and compositors may use | |
| 1100 | + | this information to offer visual feedback on the button layout | |
| 1101 | + | (e.g. on-screen displays). | |
| 1102 | + | ||
| 1103 | + | Button indices start at 0. Setting the feedback string on a button | |
| 1104 | + | that is reserved by the compositor (i.e. not belonging to any | |
| 1105 | + | zwp_tablet_pad_group_v2) does not generate an error but the compositor | |
| 1106 | + | is free to ignore the request. | |
| 1107 | + | ||
| 1108 | + | The provided string 'description' is a UTF-8 encoded string to be | |
| 1109 | + | associated with this ring, and is considered user-visible; general | |
| 1110 | + | internationalization rules apply. | |
| 1111 | + | ||
| 1112 | + | The serial argument will be that of the last | |
| 1113 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |
| 1114 | + | button. Requests providing other serials than the most recent one will | |
| 1115 | + | be ignored. | |
| 1116 | + | </description> | |
| 1117 | + | <arg name="button" type="uint" summary="button index"/> | |
| 1118 | + | <arg name="description" type="string" summary="button description"/> | |
| 1119 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |
| 1120 | + | </request> | |
| 1121 | + | ||
| 1122 | + | <request name="destroy" type="destructor"> | |
| 1123 | + | <description summary="destroy the pad object"> | |
| 1124 | + | Destroy the zwp_tablet_pad_v2 object. Objects created from this object | |
| 1125 | + | are unaffected and should be destroyed separately. | |
| 1126 | + | </description> | |
| 1127 | + | </request> | |
| 1128 | + | ||
| 1129 | + | <event name="group"> | |
| 1130 | + | <description summary="group announced"> | |
| 1131 | + | Sent on zwp_tablet_pad_v2 initialization to announce available groups. | |
| 1132 | + | One event is sent for each pad group available. | |
| 1133 | + | ||
| 1134 | + | This event is sent in the initial burst of events before the | |
| 1135 | + | zwp_tablet_pad_v2.done event. At least one group will be announced. | |
| 1136 | + | </description> | |
| 1137 | + | <arg name="pad_group" type="new_id" interface="zwp_tablet_pad_group_v2"/> | |
| 1138 | + | </event> | |
| 1139 | + | ||
| 1140 | + | <event name="path"> | |
| 1141 | + | <description summary="path to the device"> | |
| 1142 | + | A system-specific device path that indicates which device is behind | |
| 1143 | + | this zwp_tablet_pad_v2. This information may be used to gather additional | |
| 1144 | + | information about the device, e.g. through libwacom. | |
| 1145 | + | ||
| 1146 | + | The format of the path is unspecified, it may be a device node, a | |
| 1147 | + | sysfs path, or some other identifier. It is up to the client to | |
| 1148 | + | identify the string provided. | |
| 1149 | + | ||
| 1150 | + | This event is sent in the initial burst of events before the | |
| 1151 | + | zwp_tablet_pad_v2.done event. | |
| 1152 | + | </description> | |
| 1153 | + | <arg name="path" type="string" summary="path to local device"/> | |
| 1154 | + | </event> | |
| 1155 | + | ||
| 1156 | + | <event name="buttons"> | |
| 1157 | + | <description summary="buttons announced"> | |
| 1158 | + | Sent on zwp_tablet_pad_v2 initialization to announce the available | |
| 1159 | + | buttons. | |
| 1160 | + | ||
| 1161 | + | This event is sent in the initial burst of events before the | |
| 1162 | + | zwp_tablet_pad_v2.done event. This event is only sent when at least one | |
| 1163 | + | button is available. | |
| 1164 | + | </description> | |
| 1165 | + | <arg name="buttons" type="uint" summary="the number of buttons"/> | |
| 1166 | + | </event> | |
| 1167 | + | ||
| 1168 | + | <event name="done"> | |
| 1169 | + | <description summary="pad description event sequence complete"> | |
| 1170 | + | This event signals the end of the initial burst of descriptive | |
| 1171 | + | events. A client may consider the static description of the pad to | |
| 1172 | + | be complete and finalize initialization of the pad. | |
| 1173 | + | </description> | |
| 1174 | + | </event> | |
| 1175 | + | ||
| 1176 | + | <enum name="button_state"> | |
| 1177 | + | <description summary="physical button state"> | |
| 1178 | + | Describes the physical state of a button that caused the button | |
| 1179 | + | event. | |
| 1180 | + | </description> | |
| 1181 | + | <entry name="released" value="0" summary="the button is not pressed"/> | |
| 1182 | + | <entry name="pressed" value="1" summary="the button is pressed"/> | |
| 1183 | + | </enum> | |
| 1184 | + | ||
| 1185 | + | <event name="button"> | |
| 1186 | + | <description summary="physical button state"> | |
| 1187 | + | Sent whenever the physical state of a button changes. | |
| 1188 | + | </description> | |
| 1189 | + | <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/> | |
| 1190 | + | <arg name="button" type="uint" summary="the index of the button that changed state"/> | |
| 1191 | + | <arg name="state" type="uint" enum="button_state"/> | |
| 1192 | + | </event> | |
| 1193 | + | ||
| 1194 | + | <event name="enter"> | |
| 1195 | + | <description summary="enter event"> | |
| 1196 | + | Notification that this pad is focused on the specified surface. | |
| 1197 | + | </description> | |
| 1198 | + | <arg name="serial" type="uint" summary="serial number of the enter event"/> | |
| 1199 | + | <arg name="tablet" type="object" interface="zwp_tablet_v2" summary="the tablet the pad is attached to"/> | |
| 1200 | + | <arg name="surface" type="object" interface="wl_surface" summary="surface the pad is focused on"/> | |
| 1201 | + | </event> | |
| 1202 | + | ||
| 1203 | + | <event name="leave"> | |
| 1204 | + | <description summary="leave event"> | |
| 1205 | + | Notification that this pad is no longer focused on the specified | |
| 1206 | + | surface. | |
| 1207 | + | </description> | |
| 1208 | + | <arg name="serial" type="uint" summary="serial number of the leave event"/> | |
| 1209 | + | <arg name="surface" type="object" interface="wl_surface" summary="surface the pad is no longer focused on"/> | |
| 1210 | + | </event> | |
| 1211 | + | ||
| 1212 | + | <event name="removed"> | |
| 1213 | + | <description summary="pad removed event"> | |
| 1214 | + | Sent when the pad has been removed from the system. When a tablet | |
| 1215 | + | is removed its pad(s) will be removed too. | |
| 1216 | + | ||
| 1217 | + | When this event is received, the client must destroy all rings, strips | |
| 1218 | + | and groups that were offered by this pad, and issue zwp_tablet_pad_v2.destroy | |
| 1219 | + | the pad itself. | |
| 1220 | + | </description> | |
| 1221 | + | </event> | |
| 1222 | + | </interface> | |
| 1223 | + | ||
| 1224 | + | <interface name="zwp_tablet_pad_dial_v2" version="2"> | |
| 1225 | + | <description summary="pad dial"> | |
| 1226 | + | A rotary control, e.g. a dial or a wheel. | |
| 1227 | + | ||
| 1228 | + | Events on a dial are logically grouped by the zwp_tablet_pad_dial_v2.frame | |
| 1229 | + | event. | |
| 1230 | + | </description> | |
| 1231 | + | ||
| 1232 | + | <request name="set_feedback"> | |
| 1233 | + | <description summary="set compositor feedback"> | |
| 1234 | + | Requests the compositor to use the provided feedback string | |
| 1235 | + | associated with this dial. This request should be issued immediately | |
| 1236 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |
| 1237 | + | group is received, or whenever the dial is mapped to a different | |
| 1238 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |
| 1239 | + | ||
| 1240 | + | Clients are encouraged to provide context-aware descriptions for | |
| 1241 | + | the actions associated with the dial, and compositors may use this | |
| 1242 | + | information to offer visual feedback about the button layout | |
| 1243 | + | (eg. on-screen displays). | |
| 1244 | + | ||
| 1245 | + | The provided string 'description' is a UTF-8 encoded string to be | |
| 1246 | + | associated with this ring, and is considered user-visible; general | |
| 1247 | + | internationalization rules apply. | |
| 1248 | + | ||
| 1249 | + | The serial argument will be that of the last | |
| 1250 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |
| 1251 | + | dial. Requests providing other serials than the most recent one will be | |
| 1252 | + | ignored. | |
| 1253 | + | </description> | |
| 1254 | + | <arg name="description" type="string" summary="dial description"/> | |
| 1255 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |
| 1256 | + | </request> | |
| 1257 | + | ||
| 1258 | + | <request name="destroy" type="destructor"> | |
| 1259 | + | <description summary="destroy the dial object"> | |
| 1260 | + | This destroys the client's resource for this dial object. | |
| 1261 | + | </description> | |
| 1262 | + | </request> | |
| 1263 | + | ||
| 1264 | + | <event name="delta"> | |
| 1265 | + | <description summary="delta movement"> | |
| 1266 | + | Sent whenever the position on a dial changes. | |
| 1267 | + | ||
| 1268 | + | This event carries the wheel delta as multiples or fractions | |
| 1269 | + | of 120 with each multiple of 120 representing one logical wheel detent. | |
| 1270 | + | For example, an axis_value120 of 30 is one quarter of | |
| 1271 | + | a logical wheel step in the positive direction, a value120 of | |
| 1272 | + | -240 are two logical wheel steps in the negative direction within the | |
| 1273 | + | same hardware event. See the wl_pointer.axis_value120 for more details. | |
| 1274 | + | ||
| 1275 | + | The value120 must not be zero. | |
| 1276 | + | </description> | |
| 1277 | + | <arg name="value120" type="int" summary="rotation distance as fraction of 120"/> | |
| 1278 | + | </event> | |
| 1279 | + | ||
| 1280 | + | <event name="frame"> | |
| 1281 | + | <description summary="end of a dial event sequence"> | |
| 1282 | + | Indicates the end of a set of events that represent one logical | |
| 1283 | + | hardware dial event. A client is expected to accumulate the data | |
| 1284 | + | in all events within the frame before proceeding. | |
| 1285 | + | ||
| 1286 | + | All zwp_tablet_pad_dial_v2 events before a zwp_tablet_pad_dial_v2.frame event belong | |
| 1287 | + | logically together. | |
| 1288 | + | ||
| 1289 | + | A zwp_tablet_pad_dial_v2.frame event is sent for every logical event | |
| 1290 | + | group, even if the group only contains a single zwp_tablet_pad_dial_v2 | |
| 1291 | + | event. Specifically, a client may get a sequence: delta, frame, | |
| 1292 | + | delta, frame, etc. | |
| 1293 | + | </description> | |
| 1294 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |
| 1295 | + | </event> | |
| 1296 | + | </interface> | |
| 1297 | + | </protocol> | |
| @@ -0,0 +1,1297 @@ | |||||
| 1 | + | <?xml version="1.0" encoding="UTF-8"?> | |||
| 2 | + | <protocol name="tablet_v2"> | |||
| 3 | + | ||||
| 4 | + | <copyright> | |||
| 5 | + | Copyright 2014 © Stephen "Lyude" Chandler Paul | |||
| 6 | + | Copyright 2015-2024 © Red Hat, Inc. | |||
| 7 | + | ||||
| 8 | + | Permission is hereby granted, free of charge, to any person | |||
| 9 | + | obtaining a copy of this software and associated documentation files | |||
| 10 | + | (the "Software"), to deal in the Software without restriction, | |||
| 11 | + | including without limitation the rights to use, copy, modify, merge, | |||
| 12 | + | publish, distribute, sublicense, and/or sell copies of the Software, | |||
| 13 | + | and to permit persons to whom the Software is furnished to do so, | |||
| 14 | + | subject to the following conditions: | |||
| 15 | + | ||||
| 16 | + | The above copyright notice and this permission notice (including the | |||
| 17 | + | next paragraph) shall be included in all copies or substantial | |||
| 18 | + | portions of the Software. | |||
| 19 | + | ||||
| 20 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
| 21 | + | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
| 22 | + | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
| 23 | + | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |||
| 24 | + | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |||
| 25 | + | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
| 26 | + | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
| 27 | + | SOFTWARE. | |||
| 28 | + | </copyright> | |||
| 29 | + | ||||
| 30 | + | <description summary="Wayland protocol for graphics tablets"> | |||
| 31 | + | This description provides a high-level overview of the interplay between | |||
| 32 | + | the interfaces defined this protocol. For details, see the protocol | |||
| 33 | + | specification. | |||
| 34 | + | ||||
| 35 | + | More than one tablet may exist, and device-specifics matter. Tablets are | |||
| 36 | + | not represented by a single virtual device like wl_pointer. A client | |||
| 37 | + | binds to the tablet manager object which is just a proxy object. From | |||
| 38 | + | that, the client requests zwp_tablet_manager_v2.get_tablet_seat(wl_seat) | |||
| 39 | + | and that returns the actual interface that has all the tablets. With | |||
| 40 | + | this indirection, we can avoid merging zwp_tablet_v2 into the actual Wayland | |||
| 41 | + | protocol, a long-term benefit. | |||
| 42 | + | ||||
| 43 | + | The zwp_tablet_seat_v2 sends a "tablet added" event for each tablet | |||
| 44 | + | connected. That event is followed by descriptive events about the | |||
| 45 | + | hardware; currently that includes events for name, vid/pid and | |||
| 46 | + | a zwp_tablet_v2.path event that describes a local path. This path can be | |||
| 47 | + | used to uniquely identify a tablet or get more information through | |||
| 48 | + | libwacom. Emulated or nested tablets can skip any of those, e.g. a | |||
| 49 | + | virtual tablet may not have a vid/pid. The sequence of descriptive | |||
| 50 | + | events is terminated by a zwp_tablet_v2.done event to signal that a client | |||
| 51 | + | may now finalize any initialization for that tablet. | |||
| 52 | + | ||||
| 53 | + | Events from tablets require a tool in proximity. Tools are also managed | |||
| 54 | + | by the tablet seat; a "tool added" event is sent whenever a tool is new | |||
| 55 | + | to the compositor. That event is followed by a number of descriptive | |||
| 56 | + | events about the hardware; currently that includes capabilities, | |||
| 57 | + | hardware id and serial number, and tool type. Similar to the tablet | |||
| 58 | + | interface, a zwp_tablet_tool_v2.done event is sent to terminate that initial | |||
| 59 | + | sequence. | |||
| 60 | + | ||||
| 61 | + | Any event from a tool happens on the zwp_tablet_tool_v2 interface. When the | |||
| 62 | + | tool gets into proximity of the tablet, a proximity_in event is sent on | |||
| 63 | + | the zwp_tablet_tool_v2 interface, listing the tablet and the surface. That | |||
| 64 | + | event is followed by a motion event with the coordinates. After that, | |||
| 65 | + | it's the usual motion, axis, button, etc. events. The protocol's | |||
| 66 | + | serialisation means events are grouped by zwp_tablet_tool_v2.frame events. | |||
| 67 | + | ||||
| 68 | + | Two special events (that don't exist in X) are down and up. They signal | |||
| 69 | + | "tip touching the surface". For tablets without real proximity | |||
| 70 | + | detection, the sequence is: proximity_in, motion, down, frame. | |||
| 71 | + | ||||
| 72 | + | When the tool leaves proximity, a proximity_out event is sent. If any | |||
| 73 | + | button is still down, a button release event is sent before this | |||
| 74 | + | proximity event. These button events are sent in the same frame as the | |||
| 75 | + | proximity event to signal to the client that the buttons were held when | |||
| 76 | + | the tool left proximity. | |||
| 77 | + | ||||
| 78 | + | If the tool moves out of the surface but stays in proximity (i.e. | |||
| 79 | + | between windows), compositor-specific grab policies apply. This usually | |||
| 80 | + | means that the proximity-out is delayed until all buttons are released. | |||
| 81 | + | ||||
| 82 | + | Moving a tool physically from one tablet to the other has no real effect | |||
| 83 | + | on the protocol, since we already have the tool object from the "tool | |||
| 84 | + | added" event. All the information is already there and the proximity | |||
| 85 | + | events on both tablets are all a client needs to reconstruct what | |||
| 86 | + | happened. | |||
| 87 | + | ||||
| 88 | + | Some extra axes are normalized, i.e. the client knows the range as | |||
| 89 | + | specified in the protocol (e.g. [0, 65535]), the granularity however is | |||
| 90 | + | unknown. The current normalized axes are pressure, distance, and slider. | |||
| 91 | + | ||||
| 92 | + | Other extra axes are in physical units as specified in the protocol. | |||
| 93 | + | The current extra axes with physical units are tilt, rotation and | |||
| 94 | + | wheel rotation. | |||
| 95 | + | ||||
| 96 | + | Since tablets work independently of the pointer controlled by the mouse, | |||
| 97 | + | the focus handling is independent too and controlled by proximity. | |||
| 98 | + | The zwp_tablet_tool_v2.set_cursor request sets a tool-specific cursor. | |||
| 99 | + | This cursor surface may be the same as the mouse cursor, and it may be | |||
| 100 | + | the same across tools but it is possible to be more fine-grained. For | |||
| 101 | + | example, a client may set different cursors for the pen and eraser. | |||
| 102 | + | ||||
| 103 | + | Tools are generally independent of tablets and it is | |||
| 104 | + | compositor-specific policy when a tool can be removed. Common approaches | |||
| 105 | + | will likely include some form of removing a tool when all tablets the | |||
| 106 | + | tool was used on are removed. | |||
| 107 | + | </description> | |||
| 108 | + | ||||
| 109 | + | <interface name="zwp_tablet_manager_v2" version="2"> | |||
| 110 | + | <description summary="controller object for graphic tablet devices"> | |||
| 111 | + | An object that provides access to the graphics tablets available on this | |||
| 112 | + | system. All tablets are associated with a seat, to get access to the | |||
| 113 | + | actual tablets, use zwp_tablet_manager_v2.get_tablet_seat. | |||
| 114 | + | </description> | |||
| 115 | + | ||||
| 116 | + | <request name="get_tablet_seat"> | |||
| 117 | + | <description summary="get the tablet seat"> | |||
| 118 | + | Get the zwp_tablet_seat_v2 object for the given seat. This object | |||
| 119 | + | provides access to all graphics tablets in this seat. | |||
| 120 | + | </description> | |||
| 121 | + | <arg name="tablet_seat" type="new_id" interface="zwp_tablet_seat_v2"/> | |||
| 122 | + | <arg name="seat" type="object" interface="wl_seat" summary="The wl_seat object to retrieve the tablets for" /> | |||
| 123 | + | </request> | |||
| 124 | + | ||||
| 125 | + | <request name="destroy" type="destructor"> | |||
| 126 | + | <description summary="release the memory for the tablet manager object"> | |||
| 127 | + | Destroy the zwp_tablet_manager_v2 object. Objects created from this | |||
| 128 | + | object are unaffected and should be destroyed separately. | |||
| 129 | + | </description> | |||
| 130 | + | </request> | |||
| 131 | + | </interface> | |||
| 132 | + | ||||
| 133 | + | <interface name="zwp_tablet_seat_v2" version="2"> | |||
| 134 | + | <description summary="controller object for graphic tablet devices of a seat"> | |||
| 135 | + | An object that provides access to the graphics tablets available on this | |||
| 136 | + | seat. After binding to this interface, the compositor sends a set of | |||
| 137 | + | zwp_tablet_seat_v2.tablet_added and zwp_tablet_seat_v2.tool_added events. | |||
| 138 | + | </description> | |||
| 139 | + | ||||
| 140 | + | <request name="destroy" type="destructor"> | |||
| 141 | + | <description summary="release the memory for the tablet seat object"> | |||
| 142 | + | Destroy the zwp_tablet_seat_v2 object. Objects created from this | |||
| 143 | + | object are unaffected and should be destroyed separately. | |||
| 144 | + | </description> | |||
| 145 | + | </request> | |||
| 146 | + | ||||
| 147 | + | <event name="tablet_added"> | |||
| 148 | + | <description summary="new device notification"> | |||
| 149 | + | This event is sent whenever a new tablet becomes available on this | |||
| 150 | + | seat. This event only provides the object id of the tablet, any | |||
| 151 | + | static information about the tablet (device name, vid/pid, etc.) is | |||
| 152 | + | sent through the zwp_tablet_v2 interface. | |||
| 153 | + | </description> | |||
| 154 | + | <arg name="id" type="new_id" interface="zwp_tablet_v2" summary="the newly added graphics tablet"/> | |||
| 155 | + | </event> | |||
| 156 | + | ||||
| 157 | + | <event name="tool_added"> | |||
| 158 | + | <description summary="a new tool has been used with a tablet"> | |||
| 159 | + | This event is sent whenever a tool that has not previously been used | |||
| 160 | + | with a tablet comes into use. This event only provides the object id | |||
| 161 | + | of the tool; any static information about the tool (capabilities, | |||
| 162 | + | type, etc.) is sent through the zwp_tablet_tool_v2 interface. | |||
| 163 | + | </description> | |||
| 164 | + | <arg name="id" type="new_id" interface="zwp_tablet_tool_v2" summary="the newly added tablet tool"/> | |||
| 165 | + | </event> | |||
| 166 | + | ||||
| 167 | + | <event name="pad_added"> | |||
| 168 | + | <description summary="new pad notification"> | |||
| 169 | + | This event is sent whenever a new pad is known to the system. Typically, | |||
| 170 | + | pads are physically attached to tablets and a pad_added event is | |||
| 171 | + | sent immediately after the zwp_tablet_seat_v2.tablet_added. | |||
| 172 | + | However, some standalone pad devices logically attach to tablets at | |||
| 173 | + | runtime, and the client must wait for zwp_tablet_pad_v2.enter to know | |||
| 174 | + | the tablet a pad is attached to. | |||
| 175 | + | ||||
| 176 | + | This event only provides the object id of the pad. All further | |||
| 177 | + | features (buttons, strips, rings) are sent through the zwp_tablet_pad_v2 | |||
| 178 | + | interface. | |||
| 179 | + | </description> | |||
| 180 | + | <arg name="id" type="new_id" interface="zwp_tablet_pad_v2" summary="the newly added pad"/> | |||
| 181 | + | </event> | |||
| 182 | + | </interface> | |||
| 183 | + | ||||
| 184 | + | <interface name="zwp_tablet_tool_v2" version="2"> | |||
| 185 | + | <description summary="a physical tablet tool"> | |||
| 186 | + | An object that represents a physical tool that has been, or is | |||
| 187 | + | currently in use with a tablet in this seat. Each zwp_tablet_tool_v2 | |||
| 188 | + | object stays valid until the client destroys it; the compositor | |||
| 189 | + | reuses the zwp_tablet_tool_v2 object to indicate that the object's | |||
| 190 | + | respective physical tool has come into proximity of a tablet again. | |||
| 191 | + | ||||
| 192 | + | A zwp_tablet_tool_v2 object's relation to a physical tool depends on the | |||
| 193 | + | tablet's ability to report serial numbers. If the tablet supports | |||
| 194 | + | this capability, then the object represents a specific physical tool | |||
| 195 | + | and can be identified even when used on multiple tablets. | |||
| 196 | + | ||||
| 197 | + | A tablet tool has a number of static characteristics, e.g. tool type, | |||
| 198 | + | hardware_serial and capabilities. These capabilities are sent in an | |||
| 199 | + | event sequence after the zwp_tablet_seat_v2.tool_added event before any | |||
| 200 | + | actual events from this tool. This initial event sequence is | |||
| 201 | + | terminated by a zwp_tablet_tool_v2.done event. | |||
| 202 | + | ||||
| 203 | + | Tablet tool events are grouped by zwp_tablet_tool_v2.frame events. | |||
| 204 | + | Any events received before a zwp_tablet_tool_v2.frame event should be | |||
| 205 | + | considered part of the same hardware state change. | |||
| 206 | + | </description> | |||
| 207 | + | ||||
| 208 | + | <request name="set_cursor"> | |||
| 209 | + | <description summary="set the tablet tool's surface"> | |||
| 210 | + | Sets the surface of the cursor used for this tool on the given | |||
| 211 | + | tablet. This request only takes effect if the tool is in proximity | |||
| 212 | + | of one of the requesting client's surfaces or the surface parameter | |||
| 213 | + | is the current pointer surface. If there was a previous surface set | |||
| 214 | + | with this request it is replaced. If surface is NULL, the cursor | |||
| 215 | + | image is hidden. | |||
| 216 | + | ||||
| 217 | + | The parameters hotspot_x and hotspot_y define the position of the | |||
| 218 | + | pointer surface relative to the pointer location. Its top-left corner | |||
| 219 | + | is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the | |||
| 220 | + | coordinates of the pointer location, in surface-local coordinates. | |||
| 221 | + | ||||
| 222 | + | On surface.attach requests to the pointer surface, hotspot_x and | |||
| 223 | + | hotspot_y are decremented by the x and y parameters passed to the | |||
| 224 | + | request. Attach must be confirmed by wl_surface.commit as usual. | |||
| 225 | + | ||||
| 226 | + | The hotspot can also be updated by passing the currently set pointer | |||
| 227 | + | surface to this request with new values for hotspot_x and hotspot_y. | |||
| 228 | + | ||||
| 229 | + | The current and pending input regions of the wl_surface are cleared, | |||
| 230 | + | and wl_surface.set_input_region is ignored until the wl_surface is no | |||
| 231 | + | longer used as the cursor. When the use as a cursor ends, the current | |||
| 232 | + | and pending input regions become undefined, and the wl_surface is | |||
| 233 | + | unmapped. | |||
| 234 | + | ||||
| 235 | + | This request gives the surface the role of a zwp_tablet_tool_v2 cursor. A | |||
| 236 | + | surface may only ever be used as the cursor surface for one | |||
| 237 | + | zwp_tablet_tool_v2. If the surface already has another role or has | |||
| 238 | + | previously been used as cursor surface for a different tool, a | |||
| 239 | + | protocol error is raised. | |||
| 240 | + | </description> | |||
| 241 | + | <arg name="serial" type="uint" summary="serial of the proximity_in event"/> | |||
| 242 | + | <arg name="surface" type="object" interface="wl_surface" allow-null="true"/> | |||
| 243 | + | <arg name="hotspot_x" type="int" summary="surface-local x coordinate"/> | |||
| 244 | + | <arg name="hotspot_y" type="int" summary="surface-local y coordinate"/> | |||
| 245 | + | </request> | |||
| 246 | + | ||||
| 247 | + | <request name="destroy" type="destructor"> | |||
| 248 | + | <description summary="destroy the tool object"> | |||
| 249 | + | This destroys the client's resource for this tool object. | |||
| 250 | + | </description> | |||
| 251 | + | </request> | |||
| 252 | + | ||||
| 253 | + | <enum name="type"> | |||
| 254 | + | <description summary="a physical tool type"> | |||
| 255 | + | Describes the physical type of a tool. The physical type of a tool | |||
| 256 | + | generally defines its base usage. | |||
| 257 | + | ||||
| 258 | + | The mouse tool represents a mouse-shaped tool that is not a relative | |||
| 259 | + | device but bound to the tablet's surface, providing absolute | |||
| 260 | + | coordinates. | |||
| 261 | + | ||||
| 262 | + | The lens tool is a mouse-shaped tool with an attached lens to | |||
| 263 | + | provide precision focus. | |||
| 264 | + | </description> | |||
| 265 | + | <entry name="pen" value="0x140" summary="Pen"/> | |||
| 266 | + | <entry name="eraser" value="0x141" summary="Eraser"/> | |||
| 267 | + | <entry name="brush" value="0x142" summary="Brush"/> | |||
| 268 | + | <entry name="pencil" value="0x143" summary="Pencil"/> | |||
| 269 | + | <entry name="airbrush" value="0x144" summary="Airbrush"/> | |||
| 270 | + | <entry name="finger" value="0x145" summary="Finger"/> | |||
| 271 | + | <entry name="mouse" value="0x146" summary="Mouse"/> | |||
| 272 | + | <entry name="lens" value="0x147" summary="Lens"/> | |||
| 273 | + | </enum> | |||
| 274 | + | ||||
| 275 | + | <event name="type"> | |||
| 276 | + | <description summary="tool type"> | |||
| 277 | + | The tool type is the high-level type of the tool and usually decides | |||
| 278 | + | the interaction expected from this tool. | |||
| 279 | + | ||||
| 280 | + | This event is sent in the initial burst of events before the | |||
| 281 | + | zwp_tablet_tool_v2.done event. | |||
| 282 | + | </description> | |||
| 283 | + | <arg name="tool_type" type="uint" enum="type" summary="the physical tool type"/> | |||
| 284 | + | </event> | |||
| 285 | + | ||||
| 286 | + | <event name="hardware_serial"> | |||
| 287 | + | <description summary="unique hardware serial number of the tool"> | |||
| 288 | + | If the physical tool can be identified by a unique 64-bit serial | |||
| 289 | + | number, this event notifies the client of this serial number. | |||
| 290 | + | ||||
| 291 | + | If multiple tablets are available in the same seat and the tool is | |||
| 292 | + | uniquely identifiable by the serial number, that tool may move | |||
| 293 | + | between tablets. | |||
| 294 | + | ||||
| 295 | + | Otherwise, if the tool has no serial number and this event is | |||
| 296 | + | missing, the tool is tied to the tablet it first comes into | |||
| 297 | + | proximity with. Even if the physical tool is used on multiple | |||
| 298 | + | tablets, separate zwp_tablet_tool_v2 objects will be created, one per | |||
| 299 | + | tablet. | |||
| 300 | + | ||||
| 301 | + | This event is sent in the initial burst of events before the | |||
| 302 | + | zwp_tablet_tool_v2.done event. | |||
| 303 | + | </description> | |||
| 304 | + | <arg name="hardware_serial_hi" type="uint" summary="the unique serial number of the tool, most significant bits"/> | |||
| 305 | + | <arg name="hardware_serial_lo" type="uint" summary="the unique serial number of the tool, least significant bits"/> | |||
| 306 | + | </event> | |||
| 307 | + | ||||
| 308 | + | <event name="hardware_id_wacom"> | |||
| 309 | + | <description summary="hardware id notification in Wacom's format"> | |||
| 310 | + | This event notifies the client of a hardware id available on this tool. | |||
| 311 | + | ||||
| 312 | + | The hardware id is a device-specific 64-bit id that provides extra | |||
| 313 | + | information about the tool in use, beyond the wl_tool.type | |||
| 314 | + | enumeration. The format of the id is specific to tablets made by | |||
| 315 | + | Wacom Inc. For example, the hardware id of a Wacom Grip | |||
| 316 | + | Pen (a stylus) is 0x802. | |||
| 317 | + | ||||
| 318 | + | This event is sent in the initial burst of events before the | |||
| 319 | + | zwp_tablet_tool_v2.done event. | |||
| 320 | + | </description> | |||
| 321 | + | <arg name="hardware_id_hi" type="uint" summary="the hardware id, most significant bits"/> | |||
| 322 | + | <arg name="hardware_id_lo" type="uint" summary="the hardware id, least significant bits"/> | |||
| 323 | + | </event> | |||
| 324 | + | ||||
| 325 | + | <enum name="capability"> | |||
| 326 | + | <description summary="capability flags for a tool"> | |||
| 327 | + | Describes extra capabilities on a tablet. | |||
| 328 | + | ||||
| 329 | + | Any tool must provide x and y values, extra axes are | |||
| 330 | + | device-specific. | |||
| 331 | + | </description> | |||
| 332 | + | <entry name="tilt" value="1" summary="Tilt axes"/> | |||
| 333 | + | <entry name="pressure" value="2" summary="Pressure axis"/> | |||
| 334 | + | <entry name="distance" value="3" summary="Distance axis"/> | |||
| 335 | + | <entry name="rotation" value="4" summary="Z-rotation axis"/> | |||
| 336 | + | <entry name="slider" value="5" summary="Slider axis"/> | |||
| 337 | + | <entry name="wheel" value="6" summary="Wheel axis"/> | |||
| 338 | + | </enum> | |||
| 339 | + | ||||
| 340 | + | <event name="capability"> | |||
| 341 | + | <description summary="tool capability notification"> | |||
| 342 | + | This event notifies the client of any capabilities of this tool, | |||
| 343 | + | beyond the main set of x/y axes and tip up/down detection. | |||
| 344 | + | ||||
| 345 | + | One event is sent for each extra capability available on this tool. | |||
| 346 | + | ||||
| 347 | + | This event is sent in the initial burst of events before the | |||
| 348 | + | zwp_tablet_tool_v2.done event. | |||
| 349 | + | </description> | |||
| 350 | + | <arg name="capability" type="uint" enum="capability" summary="the capability"/> | |||
| 351 | + | </event> | |||
| 352 | + | ||||
| 353 | + | <event name="done"> | |||
| 354 | + | <description summary="tool description events sequence complete"> | |||
| 355 | + | This event signals the end of the initial burst of descriptive | |||
| 356 | + | events. A client may consider the static description of the tool to | |||
| 357 | + | be complete and finalize initialization of the tool. | |||
| 358 | + | </description> | |||
| 359 | + | </event> | |||
| 360 | + | ||||
| 361 | + | <event name="removed"> | |||
| 362 | + | <description summary="tool removed"> | |||
| 363 | + | This event is sent when the tool is removed from the system and will | |||
| 364 | + | send no further events. Should the physical tool come back into | |||
| 365 | + | proximity later, a new zwp_tablet_tool_v2 object will be created. | |||
| 366 | + | ||||
| 367 | + | It is compositor-dependent when a tool is removed. A compositor may | |||
| 368 | + | remove a tool on proximity out, tablet removal or any other reason. | |||
| 369 | + | A compositor may also keep a tool alive until shutdown. | |||
| 370 | + | ||||
| 371 | + | If the tool is currently in proximity, a proximity_out event will be | |||
| 372 | + | sent before the removed event. See zwp_tablet_tool_v2.proximity_out for | |||
| 373 | + | the handling of any buttons logically down. | |||
| 374 | + | ||||
| 375 | + | When this event is received, the client must zwp_tablet_tool_v2.destroy | |||
| 376 | + | the object. | |||
| 377 | + | </description> | |||
| 378 | + | </event> | |||
| 379 | + | ||||
| 380 | + | <event name="proximity_in"> | |||
| 381 | + | <description summary="proximity in event"> | |||
| 382 | + | Notification that this tool is focused on a certain surface. | |||
| 383 | + | ||||
| 384 | + | This event can be received when the tool has moved from one surface to | |||
| 385 | + | another, or when the tool has come back into proximity above the | |||
| 386 | + | surface. | |||
| 387 | + | ||||
| 388 | + | If any button is logically down when the tool comes into proximity, | |||
| 389 | + | the respective button event is sent after the proximity_in event but | |||
| 390 | + | within the same frame as the proximity_in event. | |||
| 391 | + | </description> | |||
| 392 | + | <arg name="serial" type="uint"/> | |||
| 393 | + | <arg name="tablet" type="object" interface="zwp_tablet_v2" summary="The tablet the tool is in proximity of"/> | |||
| 394 | + | <arg name="surface" type="object" interface="wl_surface" summary="The current surface the tablet tool is over"/> | |||
| 395 | + | </event> | |||
| 396 | + | ||||
| 397 | + | <event name="proximity_out"> | |||
| 398 | + | <description summary="proximity out event"> | |||
| 399 | + | Notification that this tool has either left proximity, or is no | |||
| 400 | + | longer focused on a certain surface. | |||
| 401 | + | ||||
| 402 | + | When the tablet tool leaves proximity of the tablet, button release | |||
| 403 | + | events are sent for each button that was held down at the time of | |||
| 404 | + | leaving proximity. These events are sent before the proximity_out | |||
| 405 | + | event but within the same zwp_tablet_v2.frame. | |||
| 406 | + | ||||
| 407 | + | If the tool stays within proximity of the tablet, but the focus | |||
| 408 | + | changes from one surface to another, a button release event may not | |||
| 409 | + | be sent until the button is actually released or the tool leaves the | |||
| 410 | + | proximity of the tablet. | |||
| 411 | + | </description> | |||
| 412 | + | </event> | |||
| 413 | + | ||||
| 414 | + | <event name="down"> | |||
| 415 | + | <description summary="tablet tool is making contact"> | |||
| 416 | + | Sent whenever the tablet tool comes in contact with the surface of the | |||
| 417 | + | tablet. | |||
| 418 | + | ||||
| 419 | + | If the tool is already in contact with the tablet when entering the | |||
| 420 | + | input region, the client owning said region will receive a | |||
| 421 | + | zwp_tablet_v2.proximity_in event, followed by a zwp_tablet_v2.down | |||
| 422 | + | event and a zwp_tablet_v2.frame event. | |||
| 423 | + | ||||
| 424 | + | Note that this event describes logical contact, not physical | |||
| 425 | + | contact. On some devices, a compositor may not consider a tool in | |||
| 426 | + | logical contact until a minimum physical pressure threshold is | |||
| 427 | + | exceeded. | |||
| 428 | + | </description> | |||
| 429 | + | <arg name="serial" type="uint"/> | |||
| 430 | + | </event> | |||
| 431 | + | ||||
| 432 | + | <event name="up"> | |||
| 433 | + | <description summary="tablet tool is no longer making contact"> | |||
| 434 | + | Sent whenever the tablet tool stops making contact with the surface of | |||
| 435 | + | the tablet, or when the tablet tool moves out of the input region | |||
| 436 | + | and the compositor grab (if any) is dismissed. | |||
| 437 | + | ||||
| 438 | + | If the tablet tool moves out of the input region while in contact | |||
| 439 | + | with the surface of the tablet and the compositor does not have an | |||
| 440 | + | ongoing grab on the surface, the client owning said region will | |||
| 441 | + | receive a zwp_tablet_v2.up event, followed by a zwp_tablet_v2.proximity_out | |||
| 442 | + | event and a zwp_tablet_v2.frame event. If the compositor has an ongoing | |||
| 443 | + | grab on this device, this event sequence is sent whenever the grab | |||
| 444 | + | is dismissed in the future. | |||
| 445 | + | ||||
| 446 | + | Note that this event describes logical contact, not physical | |||
| 447 | + | contact. On some devices, a compositor may not consider a tool out | |||
| 448 | + | of logical contact until physical pressure falls below a specific | |||
| 449 | + | threshold. | |||
| 450 | + | </description> | |||
| 451 | + | </event> | |||
| 452 | + | ||||
| 453 | + | <event name="motion"> | |||
| 454 | + | <description summary="motion event"> | |||
| 455 | + | Sent whenever a tablet tool moves. | |||
| 456 | + | </description> | |||
| 457 | + | <arg name="x" type="fixed" summary="surface-local x coordinate"/> | |||
| 458 | + | <arg name="y" type="fixed" summary="surface-local y coordinate"/> | |||
| 459 | + | </event> | |||
| 460 | + | ||||
| 461 | + | <event name="pressure"> | |||
| 462 | + | <description summary="pressure change event"> | |||
| 463 | + | Sent whenever the pressure axis on a tool changes. The value of this | |||
| 464 | + | event is normalized to a value between 0 and 65535. | |||
| 465 | + | ||||
| 466 | + | Note that pressure may be nonzero even when a tool is not in logical | |||
| 467 | + | contact. See the down and up events for more details. | |||
| 468 | + | </description> | |||
| 469 | + | <arg name="pressure" type="uint" summary="The current pressure value"/> | |||
| 470 | + | </event> | |||
| 471 | + | ||||
| 472 | + | <event name="distance"> | |||
| 473 | + | <description summary="distance change event"> | |||
| 474 | + | Sent whenever the distance axis on a tool changes. The value of this | |||
| 475 | + | event is normalized to a value between 0 and 65535. | |||
| 476 | + | ||||
| 477 | + | Note that distance may be nonzero even when a tool is not in logical | |||
| 478 | + | contact. See the down and up events for more details. | |||
| 479 | + | </description> | |||
| 480 | + | <arg name="distance" type="uint" summary="The current distance value"/> | |||
| 481 | + | </event> | |||
| 482 | + | ||||
| 483 | + | <event name="tilt"> | |||
| 484 | + | <description summary="tilt change event"> | |||
| 485 | + | Sent whenever one or both of the tilt axes on a tool change. Each tilt | |||
| 486 | + | value is in degrees, relative to the z-axis of the tablet. | |||
| 487 | + | The angle is positive when the top of a tool tilts along the | |||
| 488 | + | positive x or y axis. | |||
| 489 | + | </description> | |||
| 490 | + | <arg name="tilt_x" type="fixed" summary="The current value of the X tilt axis"/> | |||
| 491 | + | <arg name="tilt_y" type="fixed" summary="The current value of the Y tilt axis"/> | |||
| 492 | + | </event> | |||
| 493 | + | ||||
| 494 | + | <event name="rotation"> | |||
| 495 | + | <description summary="z-rotation change event"> | |||
| 496 | + | Sent whenever the z-rotation axis on the tool changes. The | |||
| 497 | + | rotation value is in degrees clockwise from the tool's | |||
| 498 | + | logical neutral position. | |||
| 499 | + | </description> | |||
| 500 | + | <arg name="degrees" type="fixed" summary="The current rotation of the Z axis"/> | |||
| 501 | + | </event> | |||
| 502 | + | ||||
| 503 | + | <event name="slider"> | |||
| 504 | + | <description summary="Slider position change event"> | |||
| 505 | + | Sent whenever the slider position on the tool changes. The | |||
| 506 | + | value is normalized between -65535 and 65535, with 0 as the logical | |||
| 507 | + | neutral position of the slider. | |||
| 508 | + | ||||
| 509 | + | The slider is available on e.g. the Wacom Airbrush tool. | |||
| 510 | + | </description> | |||
| 511 | + | <arg name="position" type="int" summary="The current position of slider"/> | |||
| 512 | + | </event> | |||
| 513 | + | ||||
| 514 | + | <event name="wheel"> | |||
| 515 | + | <description summary="Wheel delta event"> | |||
| 516 | + | Sent whenever the wheel on the tool emits an event. This event | |||
| 517 | + | contains two values for the same axis change. The degrees value is | |||
| 518 | + | in the same orientation as the wl_pointer.vertical_scroll axis. The | |||
| 519 | + | clicks value is in discrete logical clicks of the mouse wheel. This | |||
| 520 | + | value may be zero if the movement of the wheel was less | |||
| 521 | + | than one logical click. | |||
| 522 | + | ||||
| 523 | + | Clients should choose either value and avoid mixing degrees and | |||
| 524 | + | clicks. The compositor may accumulate values smaller than a logical | |||
| 525 | + | click and emulate click events when a certain threshold is met. | |||
| 526 | + | Thus, zwp_tablet_tool_v2.wheel events with non-zero clicks values may | |||
| 527 | + | have different degrees values. | |||
| 528 | + | </description> | |||
| 529 | + | <arg name="degrees" type="fixed" summary="The wheel delta in degrees"/> | |||
| 530 | + | <arg name="clicks" type="int" summary="The wheel delta in discrete clicks"/> | |||
| 531 | + | </event> | |||
| 532 | + | ||||
| 533 | + | <enum name="button_state"> | |||
| 534 | + | <description summary="physical button state"> | |||
| 535 | + | Describes the physical state of a button that produced the button event. | |||
| 536 | + | </description> | |||
| 537 | + | <entry name="released" value="0" summary="button is not pressed"/> | |||
| 538 | + | <entry name="pressed" value="1" summary="button is pressed"/> | |||
| 539 | + | </enum> | |||
| 540 | + | ||||
| 541 | + | <event name="button"> | |||
| 542 | + | <description summary="button event"> | |||
| 543 | + | Sent whenever a button on the tool is pressed or released. | |||
| 544 | + | ||||
| 545 | + | If a button is held down when the tool moves in or out of proximity, | |||
| 546 | + | button events are generated by the compositor. See | |||
| 547 | + | zwp_tablet_tool_v2.proximity_in and zwp_tablet_tool_v2.proximity_out for | |||
| 548 | + | details. | |||
| 549 | + | </description> | |||
| 550 | + | <arg name="serial" type="uint"/> | |||
| 551 | + | <arg name="button" type="uint" summary="The button whose state has changed"/> | |||
| 552 | + | <arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/> | |||
| 553 | + | </event> | |||
| 554 | + | ||||
| 555 | + | <event name="frame"> | |||
| 556 | + | <description summary="frame event"> | |||
| 557 | + | Marks the end of a series of axis and/or button updates from the | |||
| 558 | + | tablet. The Wayland protocol requires axis updates to be sent | |||
| 559 | + | sequentially, however all events within a frame should be considered | |||
| 560 | + | one hardware event. | |||
| 561 | + | </description> | |||
| 562 | + | <arg name="time" type="uint" summary="The time of the event with millisecond granularity"/> | |||
| 563 | + | </event> | |||
| 564 | + | ||||
| 565 | + | <enum name="error"> | |||
| 566 | + | <entry name="role" value="0" summary="given wl_surface has another role"/> | |||
| 567 | + | </enum> | |||
| 568 | + | </interface> | |||
| 569 | + | ||||
| 570 | + | <interface name="zwp_tablet_v2" version="2"> | |||
| 571 | + | <description summary="graphics tablet device"> | |||
| 572 | + | The zwp_tablet_v2 interface represents one graphics tablet device. The | |||
| 573 | + | tablet interface itself does not generate events; all events are | |||
| 574 | + | generated by zwp_tablet_tool_v2 objects when in proximity above a tablet. | |||
| 575 | + | ||||
| 576 | + | A tablet has a number of static characteristics, e.g. device name and | |||
| 577 | + | pid/vid. These capabilities are sent in an event sequence after the | |||
| 578 | + | zwp_tablet_seat_v2.tablet_added event. This initial event sequence is | |||
| 579 | + | terminated by a zwp_tablet_v2.done event. | |||
| 580 | + | </description> | |||
| 581 | + | ||||
| 582 | + | <request name="destroy" type="destructor"> | |||
| 583 | + | <description summary="destroy the tablet object"> | |||
| 584 | + | This destroys the client's resource for this tablet object. | |||
| 585 | + | </description> | |||
| 586 | + | </request> | |||
| 587 | + | ||||
| 588 | + | <event name="name"> | |||
| 589 | + | <description summary="tablet device name"> | |||
| 590 | + | A descriptive name for the tablet device. | |||
| 591 | + | ||||
| 592 | + | If the device has no descriptive name, this event is not sent. | |||
| 593 | + | ||||
| 594 | + | This event is sent in the initial burst of events before the | |||
| 595 | + | zwp_tablet_v2.done event. | |||
| 596 | + | </description> | |||
| 597 | + | <arg name="name" type="string" summary="the device name"/> | |||
| 598 | + | </event> | |||
| 599 | + | ||||
| 600 | + | <event name="id"> | |||
| 601 | + | <description summary="tablet device vendor/product id"> | |||
| 602 | + | The vendor and product IDs for the tablet device. | |||
| 603 | + | ||||
| 604 | + | The interpretation of the id depends on the zwp_tablet_v2.bustype. | |||
| 605 | + | Prior to version v2 of this protocol, the id was implied to be a USB | |||
| 606 | + | vendor and product ID. If no zwp_tablet_v2.bustype is sent, the ID | |||
| 607 | + | is to be interpreted as USB vendor and product ID. | |||
| 608 | + | ||||
| 609 | + | If the device has no vendor/product ID, this event is not sent. | |||
| 610 | + | This can happen for virtual devices or non-USB devices, for instance. | |||
| 611 | + | ||||
| 612 | + | This event is sent in the initial burst of events before the | |||
| 613 | + | zwp_tablet_v2.done event. | |||
| 614 | + | </description> | |||
| 615 | + | <arg name="vid" type="uint" summary="vendor id"/> | |||
| 616 | + | <arg name="pid" type="uint" summary="product id"/> | |||
| 617 | + | </event> | |||
| 618 | + | ||||
| 619 | + | <event name="path"> | |||
| 620 | + | <description summary="path to the device"> | |||
| 621 | + | A system-specific device path that indicates which device is behind | |||
| 622 | + | this zwp_tablet_v2. This information may be used to gather additional | |||
| 623 | + | information about the device, e.g. through libwacom. | |||
| 624 | + | ||||
| 625 | + | A device may have more than one device path. If so, multiple | |||
| 626 | + | zwp_tablet_v2.path events are sent. A device may be emulated and not | |||
| 627 | + | have a device path, and in that case this event will not be sent. | |||
| 628 | + | ||||
| 629 | + | The format of the path is unspecified, it may be a device node, a | |||
| 630 | + | sysfs path, or some other identifier. It is up to the client to | |||
| 631 | + | identify the string provided. | |||
| 632 | + | ||||
| 633 | + | This event is sent in the initial burst of events before the | |||
| 634 | + | zwp_tablet_v2.done event. | |||
| 635 | + | </description> | |||
| 636 | + | <arg name="path" type="string" summary="path to local device"/> | |||
| 637 | + | </event> | |||
| 638 | + | ||||
| 639 | + | <event name="done"> | |||
| 640 | + | <description summary="tablet description events sequence complete"> | |||
| 641 | + | This event is sent immediately to signal the end of the initial | |||
| 642 | + | burst of descriptive events. A client may consider the static | |||
| 643 | + | description of the tablet to be complete and finalize initialization | |||
| 644 | + | of the tablet. | |||
| 645 | + | </description> | |||
| 646 | + | </event> | |||
| 647 | + | ||||
| 648 | + | <event name="removed"> | |||
| 649 | + | <description summary="tablet removed event"> | |||
| 650 | + | Sent when the tablet has been removed from the system. When a tablet | |||
| 651 | + | is removed, some tools may be removed. | |||
| 652 | + | ||||
| 653 | + | When this event is received, the client must zwp_tablet_v2.destroy | |||
| 654 | + | the object. | |||
| 655 | + | </description> | |||
| 656 | + | </event> | |||
| 657 | + | ||||
| 658 | + | <!-- Version 2 additions --> | |||
| 659 | + | ||||
| 660 | + | <enum name="bustype" since="2"> | |||
| 661 | + | <description summary="bus type "> | |||
| 662 | + | Describes the bus types this tablet is connected to. | |||
| 663 | + | </description> | |||
| 664 | + | <entry name="usb" value="3" summary="USB"/> | |||
| 665 | + | <entry name="bluetooth" value="5" summary="Bluetooth"/> | |||
| 666 | + | <entry name="virtual" value="6" summary="Virtual"/> | |||
| 667 | + | <entry name="serial" value="17" summary="Serial"/> | |||
| 668 | + | <entry name="i2c" value="24" summary="I2C"/> | |||
| 669 | + | </enum> | |||
| 670 | + | ||||
| 671 | + | <event name="bustype" since="2"> | |||
| 672 | + | <description summary="tablet device bus type"> | |||
| 673 | + | The bustype argument is one of the BUS_ defines in the Linux kernel's | |||
| 674 | + | linux/input.h | |||
| 675 | + | ||||
| 676 | + | If the device has no known bustype or the bustype cannot be | |||
| 677 | + | queried, this event is not sent. | |||
| 678 | + | ||||
| 679 | + | This event is sent in the initial burst of events before the | |||
| 680 | + | zwp_tablet_v2.done event. | |||
| 681 | + | </description> | |||
| 682 | + | <arg name="bustype" type="uint" enum="bustype" summary="bus type"/> | |||
| 683 | + | </event> | |||
| 684 | + | </interface> | |||
| 685 | + | ||||
| 686 | + | <interface name="zwp_tablet_pad_ring_v2" version="2"> | |||
| 687 | + | <description summary="pad ring"> | |||
| 688 | + | A circular interaction area, such as the touch ring on the Wacom Intuos | |||
| 689 | + | Pro series tablets. | |||
| 690 | + | ||||
| 691 | + | Events on a ring are logically grouped by the zwp_tablet_pad_ring_v2.frame | |||
| 692 | + | event. | |||
| 693 | + | </description> | |||
| 694 | + | ||||
| 695 | + | <request name="set_feedback"> | |||
| 696 | + | <description summary="set compositor feedback"> | |||
| 697 | + | Request that the compositor use the provided feedback string | |||
| 698 | + | associated with this ring. This request should be issued immediately | |||
| 699 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |||
| 700 | + | group is received, or whenever the ring is mapped to a different | |||
| 701 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |||
| 702 | + | ||||
| 703 | + | Clients are encouraged to provide context-aware descriptions for | |||
| 704 | + | the actions associated with the ring; compositors may use this | |||
| 705 | + | information to offer visual feedback about the button layout | |||
| 706 | + | (eg. on-screen displays). | |||
| 707 | + | ||||
| 708 | + | The provided string 'description' is a UTF-8 encoded string to be | |||
| 709 | + | associated with this ring, and is considered user-visible; general | |||
| 710 | + | internationalization rules apply. | |||
| 711 | + | ||||
| 712 | + | The serial argument will be that of the last | |||
| 713 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |||
| 714 | + | ring. Requests providing other serials than the most recent one will be | |||
| 715 | + | ignored. | |||
| 716 | + | </description> | |||
| 717 | + | <arg name="description" type="string" summary="ring description"/> | |||
| 718 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |||
| 719 | + | </request> | |||
| 720 | + | ||||
| 721 | + | <request name="destroy" type="destructor"> | |||
| 722 | + | <description summary="destroy the ring object"> | |||
| 723 | + | This destroys the client's resource for this ring object. | |||
| 724 | + | </description> | |||
| 725 | + | </request> | |||
| 726 | + | ||||
| 727 | + | <enum name="source"> | |||
| 728 | + | <description summary="ring axis source"> | |||
| 729 | + | Describes the source types for ring events. This indicates to the | |||
| 730 | + | client how a ring event was physically generated; a client may | |||
| 731 | + | adjust the user interface accordingly. For example, events | |||
| 732 | + | from a "finger" source may trigger kinetic scrolling. | |||
| 733 | + | </description> | |||
| 734 | + | <entry name="finger" value="1" summary="finger"/> | |||
| 735 | + | </enum> | |||
| 736 | + | ||||
| 737 | + | <event name="source"> | |||
| 738 | + | <description summary="ring event source"> | |||
| 739 | + | Source information for ring events. | |||
| 740 | + | ||||
| 741 | + | This event does not occur on its own. It is sent before a | |||
| 742 | + | zwp_tablet_pad_ring_v2.frame event and carries the source information | |||
| 743 | + | for all events within that frame. | |||
| 744 | + | ||||
| 745 | + | The source specifies how this event was generated. If the source is | |||
| 746 | + | zwp_tablet_pad_ring_v2.source.finger, a zwp_tablet_pad_ring_v2.stop event | |||
| 747 | + | will be sent when the user lifts the finger off the device. | |||
| 748 | + | ||||
| 749 | + | This event is optional. If the source is unknown for an interaction, | |||
| 750 | + | no event is sent. | |||
| 751 | + | </description> | |||
| 752 | + | <arg name="source" type="uint" enum="source" summary="the event source"/> | |||
| 753 | + | </event> | |||
| 754 | + | ||||
| 755 | + | <event name="angle"> | |||
| 756 | + | <description summary="angle changed"> | |||
| 757 | + | Sent whenever the angle on a ring changes. | |||
| 758 | + | ||||
| 759 | + | The angle is provided in degrees clockwise from the logical | |||
| 760 | + | north of the ring in the pad's current rotation. | |||
| 761 | + | </description> | |||
| 762 | + | <arg name="degrees" type="fixed" summary="the current angle in degrees"/> | |||
| 763 | + | </event> | |||
| 764 | + | ||||
| 765 | + | <event name="stop"> | |||
| 766 | + | <description summary="interaction stopped"> | |||
| 767 | + | Stop notification for ring events. | |||
| 768 | + | ||||
| 769 | + | For some zwp_tablet_pad_ring_v2.source types, a zwp_tablet_pad_ring_v2.stop | |||
| 770 | + | event is sent to notify a client that the interaction with the ring | |||
| 771 | + | has terminated. This enables the client to implement kinetic scrolling. | |||
| 772 | + | See the zwp_tablet_pad_ring_v2.source documentation for information on | |||
| 773 | + | when this event may be generated. | |||
| 774 | + | ||||
| 775 | + | Any zwp_tablet_pad_ring_v2.angle events with the same source after this | |||
| 776 | + | event should be considered as the start of a new interaction. | |||
| 777 | + | </description> | |||
| 778 | + | </event> | |||
| 779 | + | ||||
| 780 | + | <event name="frame"> | |||
| 781 | + | <description summary="end of a ring event sequence"> | |||
| 782 | + | Indicates the end of a set of ring events that logically belong | |||
| 783 | + | together. A client is expected to accumulate the data in all events | |||
| 784 | + | within the frame before proceeding. | |||
| 785 | + | ||||
| 786 | + | All zwp_tablet_pad_ring_v2 events before a zwp_tablet_pad_ring_v2.frame event belong | |||
| 787 | + | logically together. For example, on termination of a finger interaction | |||
| 788 | + | on a ring the compositor will send a zwp_tablet_pad_ring_v2.source event, | |||
| 789 | + | a zwp_tablet_pad_ring_v2.stop event and a zwp_tablet_pad_ring_v2.frame event. | |||
| 790 | + | ||||
| 791 | + | A zwp_tablet_pad_ring_v2.frame event is sent for every logical event | |||
| 792 | + | group, even if the group only contains a single zwp_tablet_pad_ring_v2 | |||
| 793 | + | event. Specifically, a client may get a sequence: angle, frame, | |||
| 794 | + | angle, frame, etc. | |||
| 795 | + | </description> | |||
| 796 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |||
| 797 | + | </event> | |||
| 798 | + | </interface> | |||
| 799 | + | ||||
| 800 | + | <interface name="zwp_tablet_pad_strip_v2" version="2"> | |||
| 801 | + | <description summary="pad strip"> | |||
| 802 | + | A linear interaction area, such as the strips found in Wacom Cintiq | |||
| 803 | + | models. | |||
| 804 | + | ||||
| 805 | + | Events on a strip are logically grouped by the zwp_tablet_pad_strip_v2.frame | |||
| 806 | + | event. | |||
| 807 | + | </description> | |||
| 808 | + | ||||
| 809 | + | <request name="set_feedback"> | |||
| 810 | + | <description summary="set compositor feedback"> | |||
| 811 | + | Requests the compositor to use the provided feedback string | |||
| 812 | + | associated with this strip. This request should be issued immediately | |||
| 813 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |||
| 814 | + | group is received, or whenever the strip is mapped to a different | |||
| 815 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |||
| 816 | + | ||||
| 817 | + | Clients are encouraged to provide context-aware descriptions for | |||
| 818 | + | the actions associated with the strip, and compositors may use this | |||
| 819 | + | information to offer visual feedback about the button layout | |||
| 820 | + | (eg. on-screen displays). | |||
| 821 | + | ||||
| 822 | + | The provided string 'description' is a UTF-8 encoded string to be | |||
| 823 | + | associated with this ring, and is considered user-visible; general | |||
| 824 | + | internationalization rules apply. | |||
| 825 | + | ||||
| 826 | + | The serial argument will be that of the last | |||
| 827 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |||
| 828 | + | strip. Requests providing other serials than the most recent one will be | |||
| 829 | + | ignored. | |||
| 830 | + | </description> | |||
| 831 | + | <arg name="description" type="string" summary="strip description"/> | |||
| 832 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |||
| 833 | + | </request> | |||
| 834 | + | ||||
| 835 | + | <request name="destroy" type="destructor"> | |||
| 836 | + | <description summary="destroy the strip object"> | |||
| 837 | + | This destroys the client's resource for this strip object. | |||
| 838 | + | </description> | |||
| 839 | + | </request> | |||
| 840 | + | ||||
| 841 | + | <enum name="source"> | |||
| 842 | + | <description summary="strip axis source"> | |||
| 843 | + | Describes the source types for strip events. This indicates to the | |||
| 844 | + | client how a strip event was physically generated; a client may | |||
| 845 | + | adjust the user interface accordingly. For example, events | |||
| 846 | + | from a "finger" source may trigger kinetic scrolling. | |||
| 847 | + | </description> | |||
| 848 | + | <entry name="finger" value="1" summary="finger"/> | |||
| 849 | + | </enum> | |||
| 850 | + | ||||
| 851 | + | <event name="source"> | |||
| 852 | + | <description summary="strip event source"> | |||
| 853 | + | Source information for strip events. | |||
| 854 | + | ||||
| 855 | + | This event does not occur on its own. It is sent before a | |||
| 856 | + | zwp_tablet_pad_strip_v2.frame event and carries the source information | |||
| 857 | + | for all events within that frame. | |||
| 858 | + | ||||
| 859 | + | The source specifies how this event was generated. If the source is | |||
| 860 | + | zwp_tablet_pad_strip_v2.source.finger, a zwp_tablet_pad_strip_v2.stop event | |||
| 861 | + | will be sent when the user lifts their finger off the device. | |||
| 862 | + | ||||
| 863 | + | This event is optional. If the source is unknown for an interaction, | |||
| 864 | + | no event is sent. | |||
| 865 | + | </description> | |||
| 866 | + | <arg name="source" type="uint" enum="source" summary="the event source"/> | |||
| 867 | + | </event> | |||
| 868 | + | ||||
| 869 | + | <event name="position"> | |||
| 870 | + | <description summary="position changed"> | |||
| 871 | + | Sent whenever the position on a strip changes. | |||
| 872 | + | ||||
| 873 | + | The position is normalized to a range of [0, 65535], the 0-value | |||
| 874 | + | represents the top-most and/or left-most position of the strip in | |||
| 875 | + | the pad's current rotation. | |||
| 876 | + | </description> | |||
| 877 | + | <arg name="position" type="uint" summary="the current position"/> | |||
| 878 | + | </event> | |||
| 879 | + | ||||
| 880 | + | <event name="stop"> | |||
| 881 | + | <description summary="interaction stopped"> | |||
| 882 | + | Stop notification for strip events. | |||
| 883 | + | ||||
| 884 | + | For some zwp_tablet_pad_strip_v2.source types, a zwp_tablet_pad_strip_v2.stop | |||
| 885 | + | event is sent to notify a client that the interaction with the strip | |||
| 886 | + | has terminated. This enables the client to implement kinetic | |||
| 887 | + | scrolling. See the zwp_tablet_pad_strip_v2.source documentation for | |||
| 888 | + | information on when this event may be generated. | |||
| 889 | + | ||||
| 890 | + | Any zwp_tablet_pad_strip_v2.position events with the same source after this | |||
| 891 | + | event should be considered as the start of a new interaction. | |||
| 892 | + | </description> | |||
| 893 | + | </event> | |||
| 894 | + | ||||
| 895 | + | <event name="frame"> | |||
| 896 | + | <description summary="end of a strip event sequence"> | |||
| 897 | + | Indicates the end of a set of events that represent one logical | |||
| 898 | + | hardware strip event. A client is expected to accumulate the data | |||
| 899 | + | in all events within the frame before proceeding. | |||
| 900 | + | ||||
| 901 | + | All zwp_tablet_pad_strip_v2 events before a zwp_tablet_pad_strip_v2.frame event belong | |||
| 902 | + | logically together. For example, on termination of a finger interaction | |||
| 903 | + | on a strip the compositor will send a zwp_tablet_pad_strip_v2.source event, | |||
| 904 | + | a zwp_tablet_pad_strip_v2.stop event and a zwp_tablet_pad_strip_v2.frame | |||
| 905 | + | event. | |||
| 906 | + | ||||
| 907 | + | A zwp_tablet_pad_strip_v2.frame event is sent for every logical event | |||
| 908 | + | group, even if the group only contains a single zwp_tablet_pad_strip_v2 | |||
| 909 | + | event. Specifically, a client may get a sequence: position, frame, | |||
| 910 | + | position, frame, etc. | |||
| 911 | + | </description> | |||
| 912 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |||
| 913 | + | </event> | |||
| 914 | + | </interface> | |||
| 915 | + | ||||
| 916 | + | <interface name="zwp_tablet_pad_group_v2" version="2"> | |||
| 917 | + | <description summary="a set of buttons, rings and strips"> | |||
| 918 | + | A pad group describes a distinct (sub)set of buttons, rings and strips | |||
| 919 | + | present in the tablet. The criteria of this grouping is usually positional, | |||
| 920 | + | eg. if a tablet has buttons on the left and right side, 2 groups will be | |||
| 921 | + | presented. The physical arrangement of groups is undisclosed and may | |||
| 922 | + | change on the fly. | |||
| 923 | + | ||||
| 924 | + | Pad groups will announce their features during pad initialization. Between | |||
| 925 | + | the corresponding zwp_tablet_pad_v2.group event and zwp_tablet_pad_group_v2.done, the | |||
| 926 | + | pad group will announce the buttons, rings and strips contained in it, | |||
| 927 | + | plus the number of supported modes. | |||
| 928 | + | ||||
| 929 | + | Modes are a mechanism to allow multiple groups of actions for every element | |||
| 930 | + | in the pad group. The number of groups and available modes in each is | |||
| 931 | + | persistent across device plugs. The current mode is user-switchable, it | |||
| 932 | + | will be announced through the zwp_tablet_pad_group_v2.mode_switch event both | |||
| 933 | + | whenever it is switched, and after zwp_tablet_pad_v2.enter. | |||
| 934 | + | ||||
| 935 | + | The current mode logically applies to all elements in the pad group, | |||
| 936 | + | although it is at clients' discretion whether to actually perform different | |||
| 937 | + | actions, and/or issue the respective .set_feedback requests to notify the | |||
| 938 | + | compositor. See the zwp_tablet_pad_group_v2.mode_switch event for more details. | |||
| 939 | + | </description> | |||
| 940 | + | ||||
| 941 | + | <request name="destroy" type="destructor"> | |||
| 942 | + | <description summary="destroy the pad object"> | |||
| 943 | + | Destroy the zwp_tablet_pad_group_v2 object. Objects created from this object | |||
| 944 | + | are unaffected and should be destroyed separately. | |||
| 945 | + | </description> | |||
| 946 | + | </request> | |||
| 947 | + | ||||
| 948 | + | <event name="buttons"> | |||
| 949 | + | <description summary="buttons announced"> | |||
| 950 | + | Sent on zwp_tablet_pad_group_v2 initialization to announce the available | |||
| 951 | + | buttons in the group. Button indices start at 0, a button may only be | |||
| 952 | + | in one group at a time. | |||
| 953 | + | ||||
| 954 | + | This event is first sent in the initial burst of events before the | |||
| 955 | + | zwp_tablet_pad_group_v2.done event. | |||
| 956 | + | ||||
| 957 | + | Some buttons are reserved by the compositor. These buttons may not be | |||
| 958 | + | assigned to any zwp_tablet_pad_group_v2. Compositors may broadcast this | |||
| 959 | + | event in the case of changes to the mapping of these reserved buttons. | |||
| 960 | + | If the compositor happens to reserve all buttons in a group, this event | |||
| 961 | + | will be sent with an empty array. | |||
| 962 | + | </description> | |||
| 963 | + | <arg name="buttons" type="array" summary="buttons in this group"/> | |||
| 964 | + | </event> | |||
| 965 | + | ||||
| 966 | + | <event name="ring"> | |||
| 967 | + | <description summary="ring announced"> | |||
| 968 | + | Sent on zwp_tablet_pad_group_v2 initialization to announce available rings. | |||
| 969 | + | One event is sent for each ring available on this pad group. | |||
| 970 | + | ||||
| 971 | + | This event is sent in the initial burst of events before the | |||
| 972 | + | zwp_tablet_pad_group_v2.done event. | |||
| 973 | + | </description> | |||
| 974 | + | <arg name="ring" type="new_id" interface="zwp_tablet_pad_ring_v2"/> | |||
| 975 | + | </event> | |||
| 976 | + | ||||
| 977 | + | <event name="strip"> | |||
| 978 | + | <description summary="strip announced"> | |||
| 979 | + | Sent on zwp_tablet_pad_v2 initialization to announce available strips. | |||
| 980 | + | One event is sent for each strip available on this pad group. | |||
| 981 | + | ||||
| 982 | + | This event is sent in the initial burst of events before the | |||
| 983 | + | zwp_tablet_pad_group_v2.done event. | |||
| 984 | + | </description> | |||
| 985 | + | <arg name="strip" type="new_id" interface="zwp_tablet_pad_strip_v2"/> | |||
| 986 | + | </event> | |||
| 987 | + | ||||
| 988 | + | <event name="modes"> | |||
| 989 | + | <description summary="mode-switch ability announced"> | |||
| 990 | + | Sent on zwp_tablet_pad_group_v2 initialization to announce that the pad | |||
| 991 | + | group may switch between modes. A client may use a mode to store a | |||
| 992 | + | specific configuration for buttons, rings and strips and use the | |||
| 993 | + | zwp_tablet_pad_group_v2.mode_switch event to toggle between these | |||
| 994 | + | configurations. Mode indices start at 0. | |||
| 995 | + | ||||
| 996 | + | Switching modes is compositor-dependent. See the | |||
| 997 | + | zwp_tablet_pad_group_v2.mode_switch event for more details. | |||
| 998 | + | ||||
| 999 | + | This event is sent in the initial burst of events before the | |||
| 1000 | + | zwp_tablet_pad_group_v2.done event. This event is only sent when | |||
| 1001 | + | more than one mode is available. | |||
| 1002 | + | </description> | |||
| 1003 | + | <arg name="modes" type="uint" summary="the number of modes"/> | |||
| 1004 | + | </event> | |||
| 1005 | + | ||||
| 1006 | + | <event name="done"> | |||
| 1007 | + | <description summary="tablet group description events sequence complete"> | |||
| 1008 | + | This event is sent immediately to signal the end of the initial | |||
| 1009 | + | burst of descriptive events. A client may consider the static | |||
| 1010 | + | description of the tablet to be complete and finalize initialization | |||
| 1011 | + | of the tablet group. | |||
| 1012 | + | </description> | |||
| 1013 | + | </event> | |||
| 1014 | + | ||||
| 1015 | + | <event name="mode_switch"> | |||
| 1016 | + | <description summary="mode switch event"> | |||
| 1017 | + | Notification that the mode was switched. | |||
| 1018 | + | ||||
| 1019 | + | A mode applies to all buttons, rings, strips and dials in a group | |||
| 1020 | + | simultaneously, but a client is not required to assign different actions | |||
| 1021 | + | for each mode. For example, a client may have mode-specific button | |||
| 1022 | + | mappings but map the ring to vertical scrolling in all modes. Mode | |||
| 1023 | + | indices start at 0. | |||
| 1024 | + | ||||
| 1025 | + | Switching modes is compositor-dependent. The compositor may provide | |||
| 1026 | + | visual cues to the user about the mode, e.g. by toggling LEDs on | |||
| 1027 | + | the tablet device. Mode-switching may be software-controlled or | |||
| 1028 | + | controlled by one or more physical buttons. For example, on a Wacom | |||
| 1029 | + | Intuos Pro, the button inside the ring may be assigned to switch | |||
| 1030 | + | between modes. | |||
| 1031 | + | ||||
| 1032 | + | The compositor will also send this event after zwp_tablet_pad_v2.enter on | |||
| 1033 | + | each group in order to notify of the current mode. Groups that only | |||
| 1034 | + | feature one mode will use mode=0 when emitting this event. | |||
| 1035 | + | ||||
| 1036 | + | If a button action in the new mode differs from the action in the | |||
| 1037 | + | previous mode, the client should immediately issue a | |||
| 1038 | + | zwp_tablet_pad_v2.set_feedback request for each changed button. | |||
| 1039 | + | ||||
| 1040 | + | If a ring, strip or dial action in the new mode differs from the action | |||
| 1041 | + | in the previous mode, the client should immediately issue a | |||
| 1042 | + | zwp_tablet_ring_v2.set_feedback, zwp_tablet_strip_v2.set_feedback or | |||
| 1043 | + | zwp_tablet_dial_v2.set_feedback request for each changed ring, strip or dial. | |||
| 1044 | + | </description> | |||
| 1045 | + | <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/> | |||
| 1046 | + | <arg name="serial" type="uint"/> | |||
| 1047 | + | <arg name="mode" type="uint" summary="the new mode of the pad"/> | |||
| 1048 | + | </event> | |||
| 1049 | + | ||||
| 1050 | + | <!-- Version 2 additions --> | |||
| 1051 | + | ||||
| 1052 | + | <event name="dial" since="2"> | |||
| 1053 | + | <description summary="dial announced"> | |||
| 1054 | + | Sent on zwp_tablet_pad_v2 initialization to announce available dials. | |||
| 1055 | + | One event is sent for each dial available on this pad group. | |||
| 1056 | + | ||||
| 1057 | + | This event is sent in the initial burst of events before the | |||
| 1058 | + | zwp_tablet_pad_group_v2.done event. | |||
| 1059 | + | </description> | |||
| 1060 | + | <arg name="dial" type="new_id" interface="zwp_tablet_pad_dial_v2"/> | |||
| 1061 | + | </event> | |||
| 1062 | + | </interface> | |||
| 1063 | + | ||||
| 1064 | + | <interface name="zwp_tablet_pad_v2" version="2"> | |||
| 1065 | + | <description summary="a set of buttons, rings, strips and dials"> | |||
| 1066 | + | A pad device is a set of buttons, rings, strips and dials | |||
| 1067 | + | usually physically present on the tablet device itself. Some | |||
| 1068 | + | exceptions exist where the pad device is physically detached, e.g. the | |||
| 1069 | + | Wacom ExpressKey Remote. | |||
| 1070 | + | ||||
| 1071 | + | Pad devices have no axes that control the cursor and are generally | |||
| 1072 | + | auxiliary devices to the tool devices used on the tablet surface. | |||
| 1073 | + | ||||
| 1074 | + | A pad device has a number of static characteristics, e.g. the number | |||
| 1075 | + | of rings. These capabilities are sent in an event sequence after the | |||
| 1076 | + | zwp_tablet_seat_v2.pad_added event before any actual events from this pad. | |||
| 1077 | + | This initial event sequence is terminated by a zwp_tablet_pad_v2.done | |||
| 1078 | + | event. | |||
| 1079 | + | ||||
| 1080 | + | All pad features (buttons, rings, strips and dials) are logically divided into | |||
| 1081 | + | groups and all pads have at least one group. The available groups are | |||
| 1082 | + | notified through the zwp_tablet_pad_v2.group event; the compositor will | |||
| 1083 | + | emit one event per group before emitting zwp_tablet_pad_v2.done. | |||
| 1084 | + | ||||
| 1085 | + | Groups may have multiple modes. Modes allow clients to map multiple | |||
| 1086 | + | actions to a single pad feature. Only one mode can be active per group, | |||
| 1087 | + | although different groups may have different active modes. | |||
| 1088 | + | </description> | |||
| 1089 | + | ||||
| 1090 | + | <request name="set_feedback"> | |||
| 1091 | + | <description summary="set compositor feedback"> | |||
| 1092 | + | Requests the compositor to use the provided feedback string | |||
| 1093 | + | associated with this button. This request should be issued immediately | |||
| 1094 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |||
| 1095 | + | group is received, or whenever a button is mapped to a different | |||
| 1096 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |||
| 1097 | + | ||||
| 1098 | + | Clients are encouraged to provide context-aware descriptions for | |||
| 1099 | + | the actions associated with each button, and compositors may use | |||
| 1100 | + | this information to offer visual feedback on the button layout | |||
| 1101 | + | (e.g. on-screen displays). | |||
| 1102 | + | ||||
| 1103 | + | Button indices start at 0. Setting the feedback string on a button | |||
| 1104 | + | that is reserved by the compositor (i.e. not belonging to any | |||
| 1105 | + | zwp_tablet_pad_group_v2) does not generate an error but the compositor | |||
| 1106 | + | is free to ignore the request. | |||
| 1107 | + | ||||
| 1108 | + | The provided string 'description' is a UTF-8 encoded string to be | |||
| 1109 | + | associated with this ring, and is considered user-visible; general | |||
| 1110 | + | internationalization rules apply. | |||
| 1111 | + | ||||
| 1112 | + | The serial argument will be that of the last | |||
| 1113 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |||
| 1114 | + | button. Requests providing other serials than the most recent one will | |||
| 1115 | + | be ignored. | |||
| 1116 | + | </description> | |||
| 1117 | + | <arg name="button" type="uint" summary="button index"/> | |||
| 1118 | + | <arg name="description" type="string" summary="button description"/> | |||
| 1119 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |||
| 1120 | + | </request> | |||
| 1121 | + | ||||
| 1122 | + | <request name="destroy" type="destructor"> | |||
| 1123 | + | <description summary="destroy the pad object"> | |||
| 1124 | + | Destroy the zwp_tablet_pad_v2 object. Objects created from this object | |||
| 1125 | + | are unaffected and should be destroyed separately. | |||
| 1126 | + | </description> | |||
| 1127 | + | </request> | |||
| 1128 | + | ||||
| 1129 | + | <event name="group"> | |||
| 1130 | + | <description summary="group announced"> | |||
| 1131 | + | Sent on zwp_tablet_pad_v2 initialization to announce available groups. | |||
| 1132 | + | One event is sent for each pad group available. | |||
| 1133 | + | ||||
| 1134 | + | This event is sent in the initial burst of events before the | |||
| 1135 | + | zwp_tablet_pad_v2.done event. At least one group will be announced. | |||
| 1136 | + | </description> | |||
| 1137 | + | <arg name="pad_group" type="new_id" interface="zwp_tablet_pad_group_v2"/> | |||
| 1138 | + | </event> | |||
| 1139 | + | ||||
| 1140 | + | <event name="path"> | |||
| 1141 | + | <description summary="path to the device"> | |||
| 1142 | + | A system-specific device path that indicates which device is behind | |||
| 1143 | + | this zwp_tablet_pad_v2. This information may be used to gather additional | |||
| 1144 | + | information about the device, e.g. through libwacom. | |||
| 1145 | + | ||||
| 1146 | + | The format of the path is unspecified, it may be a device node, a | |||
| 1147 | + | sysfs path, or some other identifier. It is up to the client to | |||
| 1148 | + | identify the string provided. | |||
| 1149 | + | ||||
| 1150 | + | This event is sent in the initial burst of events before the | |||
| 1151 | + | zwp_tablet_pad_v2.done event. | |||
| 1152 | + | </description> | |||
| 1153 | + | <arg name="path" type="string" summary="path to local device"/> | |||
| 1154 | + | </event> | |||
| 1155 | + | ||||
| 1156 | + | <event name="buttons"> | |||
| 1157 | + | <description summary="buttons announced"> | |||
| 1158 | + | Sent on zwp_tablet_pad_v2 initialization to announce the available | |||
| 1159 | + | buttons. | |||
| 1160 | + | ||||
| 1161 | + | This event is sent in the initial burst of events before the | |||
| 1162 | + | zwp_tablet_pad_v2.done event. This event is only sent when at least one | |||
| 1163 | + | button is available. | |||
| 1164 | + | </description> | |||
| 1165 | + | <arg name="buttons" type="uint" summary="the number of buttons"/> | |||
| 1166 | + | </event> | |||
| 1167 | + | ||||
| 1168 | + | <event name="done"> | |||
| 1169 | + | <description summary="pad description event sequence complete"> | |||
| 1170 | + | This event signals the end of the initial burst of descriptive | |||
| 1171 | + | events. A client may consider the static description of the pad to | |||
| 1172 | + | be complete and finalize initialization of the pad. | |||
| 1173 | + | </description> | |||
| 1174 | + | </event> | |||
| 1175 | + | ||||
| 1176 | + | <enum name="button_state"> | |||
| 1177 | + | <description summary="physical button state"> | |||
| 1178 | + | Describes the physical state of a button that caused the button | |||
| 1179 | + | event. | |||
| 1180 | + | </description> | |||
| 1181 | + | <entry name="released" value="0" summary="the button is not pressed"/> | |||
| 1182 | + | <entry name="pressed" value="1" summary="the button is pressed"/> | |||
| 1183 | + | </enum> | |||
| 1184 | + | ||||
| 1185 | + | <event name="button"> | |||
| 1186 | + | <description summary="physical button state"> | |||
| 1187 | + | Sent whenever the physical state of a button changes. | |||
| 1188 | + | </description> | |||
| 1189 | + | <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/> | |||
| 1190 | + | <arg name="button" type="uint" summary="the index of the button that changed state"/> | |||
| 1191 | + | <arg name="state" type="uint" enum="button_state"/> | |||
| 1192 | + | </event> | |||
| 1193 | + | ||||
| 1194 | + | <event name="enter"> | |||
| 1195 | + | <description summary="enter event"> | |||
| 1196 | + | Notification that this pad is focused on the specified surface. | |||
| 1197 | + | </description> | |||
| 1198 | + | <arg name="serial" type="uint" summary="serial number of the enter event"/> | |||
| 1199 | + | <arg name="tablet" type="object" interface="zwp_tablet_v2" summary="the tablet the pad is attached to"/> | |||
| 1200 | + | <arg name="surface" type="object" interface="wl_surface" summary="surface the pad is focused on"/> | |||
| 1201 | + | </event> | |||
| 1202 | + | ||||
| 1203 | + | <event name="leave"> | |||
| 1204 | + | <description summary="leave event"> | |||
| 1205 | + | Notification that this pad is no longer focused on the specified | |||
| 1206 | + | surface. | |||
| 1207 | + | </description> | |||
| 1208 | + | <arg name="serial" type="uint" summary="serial number of the leave event"/> | |||
| 1209 | + | <arg name="surface" type="object" interface="wl_surface" summary="surface the pad is no longer focused on"/> | |||
| 1210 | + | </event> | |||
| 1211 | + | ||||
| 1212 | + | <event name="removed"> | |||
| 1213 | + | <description summary="pad removed event"> | |||
| 1214 | + | Sent when the pad has been removed from the system. When a tablet | |||
| 1215 | + | is removed its pad(s) will be removed too. | |||
| 1216 | + | ||||
| 1217 | + | When this event is received, the client must destroy all rings, strips | |||
| 1218 | + | and groups that were offered by this pad, and issue zwp_tablet_pad_v2.destroy | |||
| 1219 | + | the pad itself. | |||
| 1220 | + | </description> | |||
| 1221 | + | </event> | |||
| 1222 | + | </interface> | |||
| 1223 | + | ||||
| 1224 | + | <interface name="zwp_tablet_pad_dial_v2" version="2"> | |||
| 1225 | + | <description summary="pad dial"> | |||
| 1226 | + | A rotary control, e.g. a dial or a wheel. | |||
| 1227 | + | ||||
| 1228 | + | Events on a dial are logically grouped by the zwp_tablet_pad_dial_v2.frame | |||
| 1229 | + | event. | |||
| 1230 | + | </description> | |||
| 1231 | + | ||||
| 1232 | + | <request name="set_feedback"> | |||
| 1233 | + | <description summary="set compositor feedback"> | |||
| 1234 | + | Requests the compositor to use the provided feedback string | |||
| 1235 | + | associated with this dial. This request should be issued immediately | |||
| 1236 | + | after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding | |||
| 1237 | + | group is received, or whenever the dial is mapped to a different | |||
| 1238 | + | action. See zwp_tablet_pad_group_v2.mode_switch for more details. | |||
| 1239 | + | ||||
| 1240 | + | Clients are encouraged to provide context-aware descriptions for | |||
| 1241 | + | the actions associated with the dial, and compositors may use this | |||
| 1242 | + | information to offer visual feedback about the button layout | |||
| 1243 | + | (eg. on-screen displays). | |||
| 1244 | + | ||||
| 1245 | + | The provided string 'description' is a UTF-8 encoded string to be | |||
| 1246 | + | associated with this ring, and is considered user-visible; general | |||
| 1247 | + | internationalization rules apply. | |||
| 1248 | + | ||||
| 1249 | + | The serial argument will be that of the last | |||
| 1250 | + | zwp_tablet_pad_group_v2.mode_switch event received for the group of this | |||
| 1251 | + | dial. Requests providing other serials than the most recent one will be | |||
| 1252 | + | ignored. | |||
| 1253 | + | </description> | |||
| 1254 | + | <arg name="description" type="string" summary="dial description"/> | |||
| 1255 | + | <arg name="serial" type="uint" summary="serial of the mode switch event"/> | |||
| 1256 | + | </request> | |||
| 1257 | + | ||||
| 1258 | + | <request name="destroy" type="destructor"> | |||
| 1259 | + | <description summary="destroy the dial object"> | |||
| 1260 | + | This destroys the client's resource for this dial object. | |||
| 1261 | + | </description> | |||
| 1262 | + | </request> | |||
| 1263 | + | ||||
| 1264 | + | <event name="delta"> | |||
| 1265 | + | <description summary="delta movement"> | |||
| 1266 | + | Sent whenever the position on a dial changes. | |||
| 1267 | + | ||||
| 1268 | + | This event carries the wheel delta as multiples or fractions | |||
| 1269 | + | of 120 with each multiple of 120 representing one logical wheel detent. | |||
| 1270 | + | For example, an axis_value120 of 30 is one quarter of | |||
| 1271 | + | a logical wheel step in the positive direction, a value120 of | |||
| 1272 | + | -240 are two logical wheel steps in the negative direction within the | |||
| 1273 | + | same hardware event. See the wl_pointer.axis_value120 for more details. | |||
| 1274 | + | ||||
| 1275 | + | The value120 must not be zero. | |||
| 1276 | + | </description> | |||
| 1277 | + | <arg name="value120" type="int" summary="rotation distance as fraction of 120"/> | |||
| 1278 | + | </event> | |||
| 1279 | + | ||||
| 1280 | + | <event name="frame"> | |||
| 1281 | + | <description summary="end of a dial event sequence"> | |||
| 1282 | + | Indicates the end of a set of events that represent one logical | |||
| 1283 | + | hardware dial event. A client is expected to accumulate the data | |||
| 1284 | + | in all events within the frame before proceeding. | |||
| 1285 | + | ||||
| 1286 | + | All zwp_tablet_pad_dial_v2 events before a zwp_tablet_pad_dial_v2.frame event belong | |||
| 1287 | + | logically together. | |||
| 1288 | + | ||||
| 1289 | + | A zwp_tablet_pad_dial_v2.frame event is sent for every logical event | |||
| 1290 | + | group, even if the group only contains a single zwp_tablet_pad_dial_v2 | |||
| 1291 | + | event. Specifically, a client may get a sequence: delta, frame, | |||
| 1292 | + | delta, frame, etc. | |||
| 1293 | + | </description> | |||
| 1294 | + | <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> | |||
| 1295 | + | </event> | |||
| 1296 | + | </interface> | |||
| 1297 | + | </protocol> | |||