// Code generated by wlbgen. DO NOT EDIT. // Protocol: virtual_keyboard_unstable_v1 // Source: virtual-keyboard-unstable-v1.xml // Upstream protocol copyright and license: // Copyright © 2008-2011 Kristian Høgsberg // Copyright © 2010-2013 Intel Corporation // Copyright © 2012-2013 Collabora, Ltd. // Copyright © 2018 Purism SPC // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice (including the next // paragraph) shall be included in all copies or substantial portions of the // Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. package virtualkeyboard import ( cross_wl_seat "github.com/bnema/go-wayland-bindings/client/wayland" "github.com/bnema/wlturbo/wl" ) // ERROR_NO_KEYMAP is the error no_keymap value. const ERROR_NO_KEYMAP = 0 // ERROR_UNAUTHORIZED is the error unauthorized value. const ERROR_UNAUTHORIZED = 0 // VirtualKeyboardInterface is the protocol interface name. const VirtualKeyboardInterface = "zwp_virtual_keyboard_v1" // VirtualKeyboard is the generated binding for zwp_virtual_keyboard_v1 version 1. type VirtualKeyboard struct { wl.BaseProxy } // NewVirtualKeyboard returns an unbound VirtualKeyboard. func NewVirtualKeyboard(ctx *wl.Context) *VirtualKeyboard { obj := &VirtualKeyboard{} obj.SetContext(ctx) ctx.Register(obj) return obj } // 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. func (o *VirtualKeyboard) Keymap(format uint32, fd int, size uint32) error { 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 { return err } return nil } // 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. func (o *VirtualKeyboard) Key(time uint32, key uint32, state uint32) error { 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 { return err } return nil } // 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. func (o *VirtualKeyboard) Modifiers(modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32) error { 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 { return err } return nil } // destroy the virtual keyboard keyboard object func (o *VirtualKeyboard) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 3, Name: "zwp_virtual_keyboard_v1.destroy", Destructor: true}); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *VirtualKeyboard) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on zwp_virtual_keyboard_v1 and calls the registered handlers. func (o *VirtualKeyboard) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // VirtualKeyboardManagerInterface is the protocol interface name. const VirtualKeyboardManagerInterface = "zwp_virtual_keyboard_manager_v1" // VirtualKeyboardManager is the generated binding for zwp_virtual_keyboard_manager_v1 version 1. type VirtualKeyboardManager struct { wl.BaseProxy } // NewVirtualKeyboardManager returns an unbound VirtualKeyboardManager. func NewVirtualKeyboardManager(ctx *wl.Context) *VirtualKeyboardManager { obj := &VirtualKeyboardManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // 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. func (o *VirtualKeyboardManager) CreateVirtualKeyboard(seat *cross_wl_seat.Seat) (*VirtualKeyboard, error) { var arg0 wl.Object if seat != nil { arg0 = seat } child := &VirtualKeyboard{} child.SetContext(o.Context()) 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 { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *VirtualKeyboardManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on zwp_virtual_keyboard_manager_v1 and calls the registered handlers. func (o *VirtualKeyboardManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } }