Notcurses
3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
in.h
Go to the documentation of this file.
1
#ifndef NOTCURSES_IN
2
#define NOTCURSES_IN
3
4
#ifdef __cplusplus
5
extern
"C"
{
6
#endif
7
8
// internal header, not installed
9
10
#include <stdio.h>
11
12
struct
tinfo
;
13
struct
inputctx
;
14
struct
ncsharedstats
;
15
16
int
init_inputlayer
(
struct
tinfo
* ti, FILE* infp,
int
lmargin,
int
tmargin,
17
int
rmargin,
int
bmargin,
struct
ncsharedstats
* stats,
18
unsigned
drain,
int
linesigs_enabled)
19
__attribute__
((nonnull (1, 2, 7)));
20
21
int
stop_inputlayer
(
struct
tinfo
* ti);
22
23
int
inputready_fd
(
const
struct
inputctx
* ictx)
24
__attribute__
((nonnull (1)));
25
26
// allow another source provide raw input for distribution to client code.
27
// drops input if there is no room in appropriate output queue.
28
int
ncinput_shovel
(
struct
inputctx
* ictx,
const
void
* buf,
int
len
)
29
__attribute__
((nonnull (1, 2)));
30
31
typedef
enum
{
32
TERMINAL_UNKNOWN
,
// no useful information from queries; use termname
33
// the very limited linux VGA/serial console, or possibly the (deprecated,
34
// pixel-drawable, RGBA8888) linux framebuffer console. *not* fbterm.
35
TERMINAL_LINUX
,
// ioctl()s
36
// the linux KMS/DRM console, *not* kmscon, but DRM direct dumb buffers
37
TERMINAL_LINUXDRM
,
// ioctl()s
38
TERMINAL_XTERM
,
// XTVERSION == 'XTerm(ver)'
39
TERMINAL_VTE
,
// TDA: "~VTE"
40
TERMINAL_KITTY
,
// XTGETTCAP['TN'] == 'xterm-kitty'
41
TERMINAL_FOOT
,
// TDA: "\EP!|464f4f54\E\\"
42
TERMINAL_MLTERM
,
// XTGETTCAP['TN'] == 'mlterm'
43
TERMINAL_TMUX
,
// XTVERSION == "tmux ver"
44
TERMINAL_GNUSCREEN
,
// SDA: "83;ver;0c"
45
TERMINAL_WEZTERM
,
// XTVERSION == 'WezTerm *'
46
TERMINAL_ALACRITTY
,
// can't be detected; match TERM+SDA
47
TERMINAL_CONTOUR
,
// XTVERSION == 'contour ver'
48
TERMINAL_ITERM
,
// XTVERSION == 'iTerm2 [ver]'
49
TERMINAL_TERMINOLOGY
,
// TDA: "~~TY"
50
TERMINAL_APPLE
,
// Terminal.App, determined by TERM_PROGRAM + macOS
51
TERMINAL_RXVT
,
// rxvt/urxvt, determined by TERM + UNIX
52
TERMINAL_MSTERMINAL
,
// Microsoft Windows Terminal
53
TERMINAL_MINTTY
,
// XTVERSION == 'mintty ver' MinTTY (Cygwin, MSYS2)
54
TERMINAL_KONSOLE
,
// TDA: "~KDE" (7e4b4445)
55
}
queried_terminals_e
;
56
57
// after spawning the input layer, send initial queries to the terminal. its
58
// responses will be built up herein. it's dangerous to go alone! take this!
59
struct
initial_responses
{
60
int
cursory
;
// cursor location, -1 for none
61
int
cursorx
;
// cursor location, -1 for none
62
unsigned
appsync_supported
;
// is application-synchronized mode supported?
63
queried_terminals_e
qterm
;
// determined terminal
64
unsigned
kitty_graphics
;
// kitty graphics supported
65
uint32_t
bg
;
// default background
66
uint32_t
fg
;
// default foreground
67
bool
got_bg
;
// have we read default background?
68
bool
got_fg
;
// have we read default foreground?
69
bool
rgb
;
// was RGB DirectColor advertised?
70
bool
rectangular_edits
;
// were rectangular edits advertised?
71
int
pixx
;
// screen geometry in pixels
72
int
pixy
;
// screen geometry in pixels
73
int
dimx
;
// screen geometry in cells
74
int
dimy
;
// screen geometry in cells
75
// these next three might be set even if there is no actual Sixel support
76
// (see e.g. XTerm prior to 370). we determine whether there is Sixel
77
// support by checking the DA1 attributes, and scrub them if necessary.
78
int
color_registers
;
// sixel color registers
79
int
sixely
;
// maximum sixel height
80
int
sixelx
;
// maximum sixel width
81
char
*
version
;
// version string, heap-allocated
82
unsigned
kbdlevel
;
// enabled kitty keyboard functions
83
ncpalette
palette
;
// palette entries
84
int
maxpaletteread
;
// maximum palette index read
85
bool
pixelmice
;
// have we pixel-based mice events?
86
char
*
hpa
;
// control sequence for hpa via XTGETTCAP
87
};
88
89
// Blocking call. Waits until the input thread has processed all responses to
90
// our initial queries, and returns them.
91
struct
initial_responses
*
inputlayer_get_responses
(
struct
inputctx
* ictx)
92
__attribute__
((nonnull (1)));
93
94
int
get_cursor_location
(
struct
inputctx
* ictx,
const
char
* u7,
unsigned
*
y
,
unsigned
*
x
)
95
__attribute__
((nonnull (1, 2)));
96
97
#ifdef __cplusplus
98
}
99
#endif
100
101
#endif
__attribute__
__attribute__((nonnull(1, 2))) static inline int egcpool_stash(egcpool *pool
inputready_fd
int inputready_fd(const struct inputctx *ictx) __attribute__((nonnull(1)))
ncinput_shovel
int ncinput_shovel(struct inputctx *ictx, const void *buf, int len) __attribute__((nonnull(1
get_cursor_location
int get_cursor_location(struct inputctx *ictx, const char *u7, unsigned *y, unsigned *x) __attribute__((nonnull(1
init_inputlayer
int init_inputlayer(struct tinfo *ti, FILE *infp, int lmargin, int tmargin, int rmargin, int bmargin, struct ncsharedstats *stats, unsigned drain, int linesigs_enabled) __attribute__((nonnull(1
inputlayer_get_responses
struct initial_responses * inputlayer_get_responses(struct inputctx *ictx) __attribute__((nonnull(1)))
Definition
in.c:2896
stop_inputlayer
int int stop_inputlayer(struct tinfo *ti)
Definition
in.c:2644
queried_terminals_e
queried_terminals_e
Definition
in.h:31
TERMINAL_XTERM
@ TERMINAL_XTERM
Definition
in.h:38
TERMINAL_LINUX
@ TERMINAL_LINUX
Definition
in.h:35
TERMINAL_CONTOUR
@ TERMINAL_CONTOUR
Definition
in.h:47
TERMINAL_APPLE
@ TERMINAL_APPLE
Definition
in.h:50
TERMINAL_UNKNOWN
@ TERMINAL_UNKNOWN
Definition
in.h:32
TERMINAL_ALACRITTY
@ TERMINAL_ALACRITTY
Definition
in.h:46
TERMINAL_GNUSCREEN
@ TERMINAL_GNUSCREEN
Definition
in.h:44
TERMINAL_TERMINOLOGY
@ TERMINAL_TERMINOLOGY
Definition
in.h:49
TERMINAL_LINUXDRM
@ TERMINAL_LINUXDRM
Definition
in.h:37
TERMINAL_MSTERMINAL
@ TERMINAL_MSTERMINAL
Definition
in.h:52
TERMINAL_RXVT
@ TERMINAL_RXVT
Definition
in.h:51
TERMINAL_KONSOLE
@ TERMINAL_KONSOLE
Definition
in.h:54
TERMINAL_MLTERM
@ TERMINAL_MLTERM
Definition
in.h:42
TERMINAL_KITTY
@ TERMINAL_KITTY
Definition
in.h:40
TERMINAL_MINTTY
@ TERMINAL_MINTTY
Definition
in.h:53
TERMINAL_ITERM
@ TERMINAL_ITERM
Definition
in.h:48
TERMINAL_WEZTERM
@ TERMINAL_WEZTERM
Definition
in.h:45
TERMINAL_VTE
@ TERMINAL_VTE
Definition
in.h:39
TERMINAL_FOOT
@ TERMINAL_FOOT
Definition
in.h:41
TERMINAL_TMUX
@ TERMINAL_TMUX
Definition
in.h:43
y
int y
Definition
notcurses.h:1905
x
int int x
Definition
notcurses.h:1905
len
API int API int const nccell unsigned len
Definition
notcurses.h:2588
initial_responses
Definition
in.h:59
initial_responses::qterm
queried_terminals_e qterm
Definition
in.h:63
initial_responses::maxpaletteread
int maxpaletteread
Definition
in.h:84
initial_responses::appsync_supported
unsigned appsync_supported
Definition
in.h:62
initial_responses::palette
ncpalette palette
Definition
in.h:83
initial_responses::pixelmice
bool pixelmice
Definition
in.h:85
initial_responses::kbdlevel
unsigned kbdlevel
Definition
in.h:82
initial_responses::dimy
int dimy
Definition
in.h:74
initial_responses::rectangular_edits
bool rectangular_edits
Definition
in.h:70
initial_responses::rgb
bool rgb
Definition
in.h:69
initial_responses::version
char * version
Definition
in.h:81
initial_responses::kitty_graphics
unsigned kitty_graphics
Definition
in.h:64
initial_responses::pixx
int pixx
Definition
in.h:71
initial_responses::sixelx
int sixelx
Definition
in.h:80
initial_responses::cursorx
int cursorx
Definition
in.h:61
initial_responses::pixy
int pixy
Definition
in.h:72
initial_responses::dimx
int dimx
Definition
in.h:73
initial_responses::cursory
int cursory
Definition
in.h:60
initial_responses::sixely
int sixely
Definition
in.h:79
initial_responses::fg
uint32_t fg
Definition
in.h:66
initial_responses::got_fg
bool got_fg
Definition
in.h:68
initial_responses::got_bg
bool got_bg
Definition
in.h:67
initial_responses::bg
uint32_t bg
Definition
in.h:65
initial_responses::hpa
char * hpa
Definition
in.h:86
initial_responses::color_registers
int color_registers
Definition
in.h:78
inputctx
Definition
in.c:52
ncpalette
Definition
notcurses.h:1584
ncsharedstats
Definition
internal.h:245
tinfo
Definition
termdesc.h:107
src
lib
in.h
Generated by
1.9.8