robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
7673adc952
master
1#pragma once 2 3// This file is not compiled, just parsed for definitions 4#error "don't include this file, include nvim/ui.h" 5 6#include "nvim/api/private/defs.h" 7#include "nvim/func_attr.h" 8#include "nvim/ui.h" 9 10void mode_info_set (Boolean enabled ,Array cursor_styles ) 11FUNC_API_SINCE (3 ); 12void update_menu (void ) 13FUNC_API_SINCE (3 ); 14void busy_start (void ) 15FUNC_API_SINCE (3 ); 16void busy_stop (void ) 17FUNC_API_SINCE (3 ); 18void mouse_on (void ) 19FUNC_API_SINCE (3 ); 20void mouse_off (void ) 21FUNC_API_SINCE (3 ); 22void mode_change (String mode ,Integer mode_idx ) 23FUNC_API_SINCE (3 ); 24void bell (void ) 25FUNC_API_SINCE (3 ); 26void visual_bell (void ) 27FUNC_API_SINCE (3 ); 28void flush (void ) 29FUNC_API_SINCE (3 )FUNC_API_REMOTE_IMPL ; 30void connect (String server_addr ) 31FUNC_API_SINCE (14 )FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL FUNC_API_CLIENT_IMPL ; 32void restart (String listen_addr ) 33FUNC_API_SINCE (14 )FUNC_API_REMOTE_ONLY FUNC_API_CLIENT_IMPL ; 34void suspend (void ) 35FUNC_API_SINCE (3 ); 36void set_title (String title ) 37FUNC_API_SINCE (3 ); 38void set_icon (String icon ) 39FUNC_API_SINCE (3 ); 40void screenshot (String path ) 41FUNC_API_SINCE (7 ); 42void option_set (String name ,Object value ) 43FUNC_API_SINCE (4 ); 44void chdir (String path ) 45FUNC_API_SINCE (12 ); 46// Stop event is not exported as such, represented by EOF in the msgpack stream. 47void stop (void ) 48FUNC_API_NOEXPORT ; 49void ui_send (String content ) 50FUNC_API_SINCE (14 )FUNC_API_REMOTE_IMPL ; 51 52// First revision of the grid protocol, used by default 53void update_fg (Integer fg ) 54FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 55void update_bg (Integer bg ) 56FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 57void update_sp (Integer sp ) 58FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 59void resize (Integer width ,Integer height ) 60FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 61void clear (void ) 62FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 63void eol_clear (void ) 64FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 65void cursor_goto (Integer row ,Integer col ) 66FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 67void highlight_set (HlAttrs attrs ) 68FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL ; 69void put (String str ) 70FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 71void set_scroll_region (Integer top ,Integer bot ,Integer left ,Integer right ) 72FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 73void scroll (Integer count ) 74FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 75 76// Second revision of the grid protocol, used with ext_linegrid ui option 77void default_colors_set (Integer rgb_fg ,Integer rgb_bg ,Integer rgb_sp ,Integer cterm_fg , 78Integer cterm_bg ) 79FUNC_API_SINCE (4 )FUNC_API_REMOTE_IMPL ; 80void hl_attr_define (Integer id ,HlAttrs rgb_attrs ,HlAttrs cterm_attrs ,Array info ) 81FUNC_API_SINCE (5 )FUNC_API_REMOTE_IMPL ; 82void hl_group_set (String name ,Integer id ) 83FUNC_API_SINCE (6 )FUNC_API_CLIENT_IGNORE ; 84void grid_resize (Integer grid ,Integer width ,Integer height ) 85FUNC_API_SINCE (5 )FUNC_API_REMOTE_IMPL FUNC_API_COMPOSITOR_IMPL FUNC_API_CLIENT_IMPL ; 86void grid_clear (Integer grid ) 87FUNC_API_SINCE (5 )FUNC_API_REMOTE_IMPL ; 88void grid_cursor_goto (Integer grid ,Integer row ,Integer col ) 89FUNC_API_SINCE (5 )FUNC_API_REMOTE_IMPL FUNC_API_COMPOSITOR_IMPL ; 90void grid_line (Integer grid ,Integer row ,Integer col_start ,Array data ,Boolean wrap ) 91FUNC_API_SINCE (5 )FUNC_API_REMOTE_ONLY FUNC_API_CLIENT_IMPL ; 92void grid_scroll (Integer grid ,Integer top ,Integer bot ,Integer left ,Integer right ,Integer rows , 93Integer cols ) 94FUNC_API_SINCE (5 )FUNC_API_REMOTE_IMPL FUNC_API_COMPOSITOR_IMPL ; 95void grid_destroy (Integer grid ) 96FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 97 98// For performance and simplicity, we use the dense screen representation 99// in internal code, such as compositor and TUI. The remote_ui module will 100// translate this in to the public grid_line format. 101void raw_line (Integer grid ,Integer row ,Integer startcol ,Integer endcol ,Integer clearcol , 102Integer clearattr ,LineFlags flags ,const schar_T * chunk ,const sattr_T * attrs ) 103FUNC_API_NOEXPORT FUNC_API_COMPOSITOR_IMPL ; 104 105void win_pos (Integer grid ,Window win ,Integer startrow ,Integer startcol ,Integer width , 106Integer height ) 107FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 108void win_float_pos (Integer grid ,Window win ,String anchor ,Integer anchor_grid ,Float anchor_row , 109Float anchor_col ,Boolean mouse_enabled ,Integer zindex ,Integer compindex , 110Integer screen_row ,Integer screen_col ) 111FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 112void win_external_pos (Integer grid ,Window win ) 113FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 114void win_hide (Integer grid ) 115FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 116void win_close (Integer grid ) 117FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 118 119void msg_set_pos (Integer grid ,Integer row ,Boolean scrolled ,String sep_char ,Integer zindex , 120Integer compindex ) 121FUNC_API_SINCE (6 )FUNC_API_COMPOSITOR_IMPL FUNC_API_CLIENT_IGNORE ; 122 123void win_viewport (Integer grid ,Window win ,Integer topline ,Integer botline ,Integer curline , 124Integer curcol ,Integer line_count ,Integer scroll_delta ) 125FUNC_API_SINCE (7 )FUNC_API_CLIENT_IGNORE ; 126 127void win_viewport_margins (Integer grid ,Window win ,Integer top ,Integer bottom ,Integer left , 128Integer right ) 129FUNC_API_SINCE (12 )FUNC_API_CLIENT_IGNORE ; 130 131void win_extmark (Integer grid ,Window win ,Integer ns_id ,Integer mark_id ,Integer row ,Integer col ) 132FUNC_API_SINCE (10 )FUNC_API_REMOTE_ONLY ; 133 134void popupmenu_show (Array items ,Integer selected ,Integer row ,Integer col ,Integer grid ) 135FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 136void popupmenu_hide (void ) 137FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 138void popupmenu_select (Integer selected ) 139FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 140 141void tabline_update (Tabpage current ,Array tabs ,Buffer current_buffer ,Array buffers ) 142FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 143 144void cmdline_show (Array content ,Integer pos ,String firstc ,String prompt ,Integer indent , 145Integer level ,Integer hl_id ) 146FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 147void cmdline_pos (Integer pos ,Integer level ) 148FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 149void cmdline_special_char (String c ,Boolean shift ,Integer level ) 150FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 151void cmdline_hide (Integer level ,Boolean abort ) 152FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 153void cmdline_block_show (Array lines ) 154FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 155void cmdline_block_append (Array lines ) 156FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 157void cmdline_block_hide (void ) 158FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 159 160void wildmenu_show (Array items ) 161FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 162void wildmenu_select (Integer selected ) 163FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 164void wildmenu_hide (void ) 165FUNC_API_SINCE (3 )FUNC_API_REMOTE_ONLY ; 166 167void msg_show (String kind ,Array content ,Boolean replace_last ,Boolean history ,Boolean append , 168Object id ,String trigger ) 169FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 170void msg_clear (void ) 171FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 172void msg_showcmd (Array content ) 173FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 174void msg_showmode (Array content ) 175FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 176void msg_ruler (Array content ) 177FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 178void msg_history_show (Array entries ,Boolean prev_cmd ) 179FUNC_API_SINCE (6 )FUNC_API_REMOTE_ONLY ; 180 181// These UI events are currently documented only internally: 182// - When the server needs to intentionally exit with an exit code, and there is no 183// message in server stderr for the user, this event is sent with positive `status` 184// argument, to indicate that the UI should exit normally with `status`. 185// - When the server has crashed or there is a message in server stderr for the user, 186// this event is not sent, and the UI should make server stderr visible. 187// If "_set_restart_on_crash_exit" has been sent, the UI may start 188// a new nvim server with this command line and attach to it. 189// - When :detach is used on the server, this event is sent with a zero `status` 190// argument, to indicate that the UI shouldn't wait for server exit. 191void error_exit (Integer status ) 192FUNC_API_SINCE (12 )FUNC_API_CLIENT_IMPL ; 193 194// Sets a hint for how a client can handle neovim unexpectedly exiting 195// with an error code or signal (without using "error_exit" to indicate 196// an intentional `:cquit`). This should then be handled by starting a new 197// server. Use `progpath` as the full path to the Nvim executable 198// |v:progpath| and `argv` as its arguments |v:argv|, and reattach to the new 199// server. 200void _set_restart_on_crash_exit (String progpath ,Array argv )FUNC_API_CLIENT_IMPL ;