1// Code generated by wlbgen. DO NOT EDIT.
2// Protocol: virtual_keyboard_unstable_v1
3// Source: virtual-keyboard-unstable-v1.xml
4
5// Upstream protocol copyright and license:
6// Copyright © 2008-2011 Kristian Høgsberg
7// Copyright © 2010-2013 Intel Corporation
8// Copyright © 2012-2013 Collabora, Ltd.
9// Copyright © 2018 Purism SPC
10//
11// Permission is hereby granted, free of charge, to any person obtaining a
12// copy of this software and associated documentation files (the "Software"),
13// to deal in the Software without restriction, including without limitation
14// the rights to use, copy, modify, merge, publish, distribute, sublicense,
15// and/or sell copies of the Software, and to permit persons to whom the
16// Software is furnished to do so, subject to the following conditions:
17//
18// The above copyright notice and this permission notice (including the next
19// paragraph) shall be included in all copies or substantial portions of the
20// Software.
21//
22// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28// DEALINGS IN THE SOFTWARE.
29
30package virtualkeyboard
31
32import (
33 cross_wl_seat "github.com/bnema/go-wayland-bindings/client/wayland"
34 "github.com/bnema/wlturbo/wl"
35)
36
37// ERROR_NO_KEYMAP is the error no_keymap value.
38const ERROR_NO_KEYMAP = 0
39
40// ERROR_UNAUTHORIZED is the error unauthorized value.
41const ERROR_UNAUTHORIZED = 0
42
43// VirtualKeyboardInterface is the protocol interface name.
44const VirtualKeyboardInterface = "zwp_virtual_keyboard_v1"
45
46// VirtualKeyboard is the generated binding for zwp_virtual_keyboard_v1 version 1.
47type VirtualKeyboard struct {
48 wl.BaseProxy
49}
50
51// NewVirtualKeyboard returns an unbound VirtualKeyboard.
52func NewVirtualKeyboard(ctx *wl.Context) *VirtualKeyboard {
53 obj := &VirtualKeyboard{}
54 obj.SetContext(ctx)
55 ctx.Register(obj)
56 return obj
57}
58
59// Provide a file descriptor to the compositor which can be memory-mapped to provide a keyboard mapping description. Format carries a value from the keymap_format enumeration.
60func (o *VirtualKeyboard) Keymap(format uint32, fd int, size uint32) error {
61 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "zwp_virtual_keyboard_v1.keymap", FDs: []int{fd}}, wl.ArgUint(format), wl.ArgFD(), wl.ArgUint(size)); err != nil {
62 return err
63 }
64 return nil
65}
66
67// A key was pressed or released. The time argument is a timestamp with millisecond granularity, with an undefined base. All requests regarding a single object must share the same clock. Keymap must be set before issuing this request. State carries a value from the key_state enumeration.
68func (o *VirtualKeyboard) Key(time uint32, key uint32, state uint32) error {
69 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "zwp_virtual_keyboard_v1.key"}, wl.ArgUint(time), wl.ArgUint(key), wl.ArgUint(state)); err != nil {
70 return err
71 }
72 return nil
73}
74
75// Notifies the compositor that the modifier and/or group state has changed, and it should update state. The client should use wl_keyboard.modifiers event to synchronize its internal state with seat state. Keymap must be set before issuing this request.
76func (o *VirtualKeyboard) Modifiers(modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32) error {
77 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 2, Name: "zwp_virtual_keyboard_v1.modifiers"}, wl.ArgUint(modsDepressed), wl.ArgUint(modsLatched), wl.ArgUint(modsLocked), wl.ArgUint(group)); err != nil {
78 return err
79 }
80 return nil
81}
82
83// destroy the virtual keyboard keyboard object
84func (o *VirtualKeyboard) Destroy() error {
85 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 3, Name: "zwp_virtual_keyboard_v1.destroy", Destructor: true}); err != nil {
86 return err
87 }
88 return nil
89}
90
91// EventSignature returns the declared event argument types in wire order.
92func (o *VirtualKeyboard) EventSignature(opcode uint16) (string, bool) {
93 switch opcode {
94 default:
95 return "", false
96 }
97}
98
99// Dispatch decodes one event on zwp_virtual_keyboard_v1 and calls the registered handlers.
100func (o *VirtualKeyboard) Dispatch(event *wl.Event) {
101 switch event.Opcode {
102 default:
103 }
104}
105
106// VirtualKeyboardManagerInterface is the protocol interface name.
107const VirtualKeyboardManagerInterface = "zwp_virtual_keyboard_manager_v1"
108
109// VirtualKeyboardManager is the generated binding for zwp_virtual_keyboard_manager_v1 version 1.
110type VirtualKeyboardManager struct {
111 wl.BaseProxy
112}
113
114// NewVirtualKeyboardManager returns an unbound VirtualKeyboardManager.
115func NewVirtualKeyboardManager(ctx *wl.Context) *VirtualKeyboardManager {
116 obj := &VirtualKeyboardManager{}
117 obj.SetContext(ctx)
118 ctx.Register(obj)
119 return obj
120}
121
122// Creates a new virtual keyboard associated to a seat. If the compositor enables a keyboard to perform arbitrary actions, it should present an error when an untrusted client requests a new keyboard.
123func (o *VirtualKeyboardManager) CreateVirtualKeyboard(seat *cross_wl_seat.Seat) (*VirtualKeyboard, error) {
124 var arg0 wl.Object
125 if seat != nil {
126 arg0 = seat
127 }
128 child := &VirtualKeyboard{}
129 child.SetContext(o.Context())
130 if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "zwp_virtual_keyboard_manager_v1.create_virtual_keyboard", Child: child}, wl.ArgObject(arg0), wl.ArgObject(child)); err != nil {
131 return nil, err
132 }
133 return child, nil
134}
135
136// EventSignature returns the declared event argument types in wire order.
137func (o *VirtualKeyboardManager) EventSignature(opcode uint16) (string, bool) {
138 switch opcode {
139 default:
140 return "", false
141 }
142}
143
144// Dispatch decodes one event on zwp_virtual_keyboard_manager_v1 and calls the registered handlers.
145func (o *VirtualKeyboardManager) Dispatch(event *wl.Event) {
146 switch event.Opcode {
147 default:
148 }
149}