Macros | Functions
ui.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include "nvim/vim.h"
#include "nvim/log.h"
#include "nvim/ui.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_getln.h"
#include "nvim/fold.h"
#include "nvim/main.h"
#include "nvim/ascii.h"
#include "nvim/misc1.h"
#include "nvim/mbyte.h"
#include "nvim/garray.h"
#include "nvim/memory.h"
#include "nvim/move.h"
#include "nvim/normal.h"
#include "nvim/option.h"
#include "nvim/os_unix.h"
#include "nvim/event/loop.h"
#include "nvim/os/time.h"
#include "nvim/os/input.h"
#include "nvim/os/signal.h"
#include "nvim/popupmnu.h"
#include "nvim/screen.h"
#include "nvim/highlight.h"
#include "nvim/window.h"
#include "nvim/cursor_shape.h"
#include "nvim/msgpack_rpc/server.h"
#include "nvim/api/private/helpers.h"

Macros

#define MAX_UI_COUNT   16
 
#define UI_LOG(funname, ...)
 
#define UI_CALL(...)
 
#define CNT(...)
 
#define SELECT_NTH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, ...)   a11
 
#define UI_CALL_HELPER(c, ...)   UI_CALL_HELPER2(c, __VA_ARGS__)
 
#define UI_CALL_HELPER2(c, ...)   UI_CALL_##c(__VA_ARGS__)
 
#define UI_CALL_MORE(method, ...)   if (ui->method) ui->method(ui, __VA_ARGS__)
 
#define UI_CALL_ZERO(method)   if (ui->method) ui->method(ui)
 

Functions

void ui_builtin_start (void)
 
void ui_builtin_stop (void)
 
bool ui_rgb_attached (void)
 
bool ui_active (void)
 
void ui_event (char *name, Array args)
 
void ui_refresh (void)
 
void ui_schedule_refresh (void)
 
void ui_resize (int width, int height)
 
void ui_default_colors_set (void)
 
void ui_busy_start (void)
 
void ui_busy_stop (void)
 
void ui_attach_impl (UI *ui)
 
void ui_detach_impl (UI *ui)
 
void ui_set_ext_option (UI *ui, UIExtension ext, bool active)
 
void ui_line (ScreenGrid *grid, int row, int startcol, int endcol, int clearcol, int clearattr, bool wrap)
 
void ui_cursor_goto (int new_row, int new_col)
 
void ui_grid_cursor_goto (handle_T grid_handle, int new_row, int new_col)
 
void ui_mode_info_set (void)
 
int ui_current_row (void)
 
int ui_current_col (void)
 
void ui_flush (void)
 
void ui_cursor_shape (void)
 
bool ui_is_external (UIExtension widget)
 Returns true if widget is externalized. More...
 
Array ui_array (void)
 
void ui_grid_resize (handle_T grid_handle, int width, int height, Error *error)
 

Macro Definition Documentation

#define CNT (   ...)
Value:
SELECT_NTH(__VA_ARGS__, MORE, MORE, MORE, MORE, MORE, \
MORE, MORE, MORE, MORE, ZERO, ignore)
#define SELECT_NTH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,...)
Definition: ui.c:108
#define MAX_UI_COUNT   16
#define SELECT_NTH (   a1,
  a2,
  a3,
  a4,
  a5,
  a6,
  a7,
  a8,
  a9,
  a10,
  a11,
  ... 
)    a11
#define UI_CALL (   ...)
Value:
do { \
UI_LOG(__VA_ARGS__, 0); \
for (size_t i = 0; i < ui_count; i++) { \
UI *ui = uis[i]; \
UI_CALL_HELPER(CNT(__VA_ARGS__), __VA_ARGS__); \
} \
} while (0)
for(size_t i=1;i< ARRAY_SIZE(argv);i++)
Definition: typval.c:1215
#define UI_CALL_HELPER(c,...)
Definition: ui.c:109
struct ui_t UI
Definition: ui.h:35
#define CNT(...)
Definition: ui.c:106
int i
Definition: typval.c:868
#define UI_LOG(funname,...)
Definition: ui.c:67
#define UI_CALL_HELPER (   c,
  ... 
)    UI_CALL_HELPER2(c, __VA_ARGS__)
#define UI_CALL_HELPER2 (   c,
  ... 
)    UI_CALL_##c(__VA_ARGS__)
#define UI_CALL_MORE (   method,
  ... 
)    if (ui->method) ui->method(ui, __VA_ARGS__)
#define UI_CALL_ZERO (   method)    if (ui->method) ui->method(ui)
#define UI_LOG (   funname,
  ... 
)
Value:
do { \
if (strequal(uilog_last_event, STR(funname))) { \
uilog_seen++; \
} else { \
if (uilog_seen > 0) { \
logmsg(DEBUG_LOG_LEVEL, "UI: ", NULL, -1, true, \
"%s (+%zu times...)", uilog_last_event, uilog_seen); \
} \
logmsg(DEBUG_LOG_LEVEL, "UI: ", NULL, -1, true, STR(funname)); \
uilog_seen = 0; \
xstrlcpy(uilog_last_event, STR(funname), sizeof(uilog_last_event)); \
} \
} while (0)
if(len)
Definition: encode.c:226
size_t xstrlcpy(char *restrict dst, const char *restrict src, size_t dsize) FUNC_ATTR_NONNULL_ALL
Definition: memory.c:380
return NULL
Definition: eval.c:22198
bool strequal(const char *a, const char *b) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
Returns true if strings a and b are equal. Arguments may be NULL.
Definition: memory.c:497
bool logmsg(int log_level, const char *context, const char *func_name, int line_num, bool eol, const char *fmt,...) FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6
#define STR(x)
Definition: macros.h:154
#define DEBUG_LOG_LEVEL
Definition: log.h:7

Function Documentation

bool ui_active ( void  )
Array ui_array ( void  )
void ui_attach_impl ( UI ui)
void ui_builtin_start ( void  )
void ui_builtin_stop ( void  )
void ui_busy_start ( void  )
void ui_busy_stop ( void  )
int ui_current_col ( void  )
int ui_current_row ( void  )
void ui_cursor_goto ( int  new_row,
int  new_col 
)
void ui_cursor_shape ( void  )

Check if current mode has changed. May update the shape of the cursor.

void ui_default_colors_set ( void  )
void ui_detach_impl ( UI ui)
void ui_event ( char *  name,
Array  args 
)
void ui_flush ( void  )
void ui_grid_cursor_goto ( handle_T  grid_handle,
int  new_row,
int  new_col 
)
void ui_grid_resize ( handle_T  grid_handle,
int  width,
int  height,
Error error 
)
bool ui_is_external ( UIExtension  widget)

Returns true if widget is externalized.

void ui_line ( ScreenGrid grid,
int  row,
int  startcol,
int  endcol,
int  clearcol,
int  clearattr,
bool  wrap 
)
void ui_mode_info_set ( void  )
void ui_refresh ( void  )
void ui_resize ( int  width,
int  height 
)
bool ui_rgb_attached ( void  )
void ui_schedule_refresh ( void  )
void ui_set_ext_option ( UI ui,
UIExtension  ext,
bool  active 
)