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/ui_compositor.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(cond, funname, ...)
 

Functions

void ui_init (void)
 
void ui_builtin_start (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_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_has (UIExtension ext)
 Returns true if the given UI extension is enabled. More...
 
Array ui_array (void)
 
void ui_grid_resize (handle_T grid_handle, int width, int height, Error *error)
 

Macro Definition Documentation

#define MAX_UI_COUNT   16
#define UI_CALL (   cond,
  funname,
  ... 
)
Value:
do { \
bool any_call = false; \
for (size_t i = 0; i < ui_count; i++) { \
UI *ui = uis[i]; \
if (ui->funname && (cond)) { \
ui->funname(__VA_ARGS__); \
any_call = true; \
} \
} \
if (any_call) { \
UI_LOG(funname); \
} \
} while (0)
#define UI_LOG(funname)
Definition: ui.c:68
if(len)
Definition: encode.c:222
for(size_t i=1;i< ARRAY_SIZE(argv);i++)
Definition: typval.c:1215
struct ui_t UI
Definition: ui.h:40
int i
Definition: typval.c:868
#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:222
size_t xstrlcpy(char *restrict dst, const char *restrict src, size_t dsize) FUNC_ATTR_NONNULL_ALL
Definition: memory.c:360
return NULL
Definition: eval.c:22212
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:477
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:9

Function Documentation

bool ui_active ( void  )
Array ui_array ( void  )
void ui_attach_impl ( UI ui)
void ui_builtin_start ( 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_has ( UIExtension  ext)

Returns true if the given UI extension is enabled.

void ui_init ( void  )
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  )
bool ui_rgb_attached ( void  )
void ui_schedule_refresh ( void  )
void ui_set_ext_option ( UI ui,
UIExtension  ext,
bool  active 
)