robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
38986188ba
master
1#pragma once 2 3#include <stdbool.h> 4#include <stddef.h> 5#include <stdint.h> 6#include <uv.h> 7 8#include "nvim/event/defs.h" 9#include "nvim/tui/input_defs.h" // IWYU pragma: keep 10#include "nvim/tui/termkey/termkey_defs.h" 11#include "nvim/tui/tui_defs.h" 12#include "nvim/types_defs.h" 13 14typedef enum { 15kKeyEncodingLegacy ,///< Legacy key encoding 16kKeyEncodingKitty ,///< Kitty keyboard protocol encoding 17kKeyEncodingXterm ,///< Xterm's modifyOtherKeys encoding (XTMODKEYS) 18}KeyEncoding ; 19 20typedef struct { 21void (* primary_device_attr )(TUIData * tui ); 22}TermInputCallbacks ; 23 24#define KEY_BUFFER_SIZE 0x1000 25typedef struct { 26int in_fd ; 27// Phases: -1=all 0=disabled 1=first-chunk 2=continue 3=last-chunk 28int8_t paste ; 29bool ttimeout ; 30 31TermInputCallbacks callbacks ; 32 33KeyEncoding key_encoding ;///< The key encoding used by the terminal emulator 34 35OptInt ttimeoutlen ; 36TermKey * tk ; 37TermKey_Terminfo_Getstr_Hook * tk_ti_hook_fn ;///< libtermkey terminfo hook 38uv_timer_t timer_handle ; 39uv_timer_t bg_query_timer ;///< timer used to batch background color queries 40Loop * loop ; 41RStream read_stream ; 42TUIData * tui_data ; 43char key_buffer [KEY_BUFFER_SIZE ]; 44size_t key_buffer_len ; 45}TermInput ; 46 47#include "tui/input.h.generated.h"