robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

bfredlMerge pull request #38675 from bfredl/errdefer7673adc952

master
8.4 KiB200 linesraw
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)
11  FUNC_API_SINCE(3);
12void update_menu(void)
13  FUNC_API_SINCE(3);
14void busy_start(void)
15  FUNC_API_SINCE(3);
16void busy_stop(void)
17  FUNC_API_SINCE(3);
18void mouse_on(void)
19  FUNC_API_SINCE(3);
20void mouse_off(void)
21  FUNC_API_SINCE(3);
22void mode_change(String mode, Integer mode_idx)
23  FUNC_API_SINCE(3);
24void bell(void)
25  FUNC_API_SINCE(3);
26void visual_bell(void)
27  FUNC_API_SINCE(3);
28void flush(void)
29  FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL;
30void connect(String server_addr)
31  FUNC_API_SINCE(14) FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL FUNC_API_CLIENT_IMPL;
32void restart(String listen_addr)
33  FUNC_API_SINCE(14) FUNC_API_REMOTE_ONLY FUNC_API_CLIENT_IMPL;
34void suspend(void)
35  FUNC_API_SINCE(3);
36void set_title(String title)
37  FUNC_API_SINCE(3);
38void set_icon(String icon)
39  FUNC_API_SINCE(3);
40void screenshot(String path)
41  FUNC_API_SINCE(7);
42void option_set(String name, Object value)
43  FUNC_API_SINCE(4);
44void chdir(String path)
45  FUNC_API_SINCE(12);
46// Stop event is not exported as such, represented by EOF in the msgpack stream.
47void stop(void)
48  FUNC_API_NOEXPORT;
49void ui_send(String content)
50  FUNC_API_SINCE(14) FUNC_API_REMOTE_IMPL;
51
52// First revision of the grid protocol, used by default
53void update_fg(Integer fg)
54  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
55void update_bg(Integer bg)
56  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
57void update_sp(Integer sp)
58  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
59void resize(Integer width, Integer height)
60  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
61void clear(void)
62  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
63void eol_clear(void)
64  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
65void cursor_goto(Integer row, Integer col)
66  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
67void highlight_set(HlAttrs attrs)
68  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL;
69void put(String str)
70  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
71void set_scroll_region(Integer top, Integer bot, Integer left, Integer right)
72  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
73void scroll(Integer count)
74  FUNC_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,
78                        Integer cterm_bg)
79  FUNC_API_SINCE(4) FUNC_API_REMOTE_IMPL;
80void hl_attr_define(Integer id, HlAttrs rgb_attrs, HlAttrs cterm_attrs, Array info)
81  FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL;
82void hl_group_set(String name, Integer id)
83  FUNC_API_SINCE(6) FUNC_API_CLIENT_IGNORE;
84void grid_resize(Integer grid, Integer width, Integer height)
85  FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL FUNC_API_COMPOSITOR_IMPL FUNC_API_CLIENT_IMPL;
86void grid_clear(Integer grid)
87  FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL;
88void grid_cursor_goto(Integer grid, Integer row, Integer col)
89  FUNC_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)
91  FUNC_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,
93                 Integer cols)
94  FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL FUNC_API_COMPOSITOR_IMPL;
95void grid_destroy(Integer grid)
96  FUNC_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,
102              Integer clearattr, LineFlags flags, const schar_T *chunk, const sattr_T *attrs)
103  FUNC_API_NOEXPORT FUNC_API_COMPOSITOR_IMPL;
104
105void win_pos(Integer grid, Window win, Integer startrow, Integer startcol, Integer width,
106             Integer height)
107  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
108void win_float_pos(Integer grid, Window win, String anchor, Integer anchor_grid, Float anchor_row,
109                   Float anchor_col, Boolean mouse_enabled, Integer zindex, Integer compindex,
110                   Integer screen_row, Integer screen_col)
111  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
112void win_external_pos(Integer grid, Window win)
113  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
114void win_hide(Integer grid)
115  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
116void win_close(Integer grid)
117  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
118
119void msg_set_pos(Integer grid, Integer row, Boolean scrolled, String sep_char, Integer zindex,
120                 Integer compindex)
121  FUNC_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,
124                  Integer curcol, Integer line_count, Integer scroll_delta)
125  FUNC_API_SINCE(7) FUNC_API_CLIENT_IGNORE;
126
127void win_viewport_margins(Integer grid, Window win, Integer top, Integer bottom, Integer left,
128                          Integer right)
129  FUNC_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)
132  FUNC_API_SINCE(10) FUNC_API_REMOTE_ONLY;
133
134void popupmenu_show(Array items, Integer selected, Integer row, Integer col, Integer grid)
135  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
136void popupmenu_hide(void)
137  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
138void popupmenu_select(Integer selected)
139  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
140
141void tabline_update(Tabpage current, Array tabs, Buffer current_buffer, Array buffers)
142  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
143
144void cmdline_show(Array content, Integer pos, String firstc, String prompt, Integer indent,
145                  Integer level, Integer hl_id)
146  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
147void cmdline_pos(Integer pos, Integer level)
148  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
149void cmdline_special_char(String c, Boolean shift, Integer level)
150  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
151void cmdline_hide(Integer level, Boolean abort)
152  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
153void cmdline_block_show(Array lines)
154  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
155void cmdline_block_append(Array lines)
156  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
157void cmdline_block_hide(void)
158  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
159
160void wildmenu_show(Array items)
161  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
162void wildmenu_select(Integer selected)
163  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
164void wildmenu_hide(void)
165  FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
166
167void msg_show(String kind, Array content, Boolean replace_last, Boolean history, Boolean append,
168              Object id, String trigger)
169  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
170void msg_clear(void)
171  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
172void msg_showcmd(Array content)
173  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
174void msg_showmode(Array content)
175  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
176void msg_ruler(Array content)
177  FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY;
178void msg_history_show(Array entries, Boolean prev_cmd)
179  FUNC_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)
192  FUNC_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;