mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
terminfo_cursor_address
This commit is contained in:
parent
49f41d4371
commit
2bd6ac3f08
@ -638,8 +638,13 @@ done_screen_drivers(struct module *xxx)
|
|||||||
static inline struct string *
|
static inline struct string *
|
||||||
add_cursor_move_to_string(struct string *screen, int y, int x)
|
add_cursor_move_to_string(struct string *screen, int y, int x)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_TERMINFO
|
||||||
|
if (get_cmd_opt_bool("terminfo")) {
|
||||||
|
return add_to_string(screen, terminfo_cursor_address(y-1, x-1));
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
#define CURSOR_NUM_LEN 10 /* 10 chars for @y and @x numbers should be more than enough. */
|
#define CURSOR_NUM_LEN 10 /* 10 chars for @y and @x numbers should be more than enough. */
|
||||||
unsigned char code[4 + 2 * CURSOR_NUM_LEN + 1];
|
{ unsigned char code[4 + 2 * CURSOR_NUM_LEN + 1];
|
||||||
unsigned int length = 2;
|
unsigned int length = 2;
|
||||||
|
|
||||||
code[0] = '\033';
|
code[0] = '\033';
|
||||||
@ -656,6 +661,7 @@ add_cursor_move_to_string(struct string *screen, int y, int x)
|
|||||||
code[length++] = 'H';
|
code[length++] = 'H';
|
||||||
|
|
||||||
return add_bytes_to_string(screen, code, length);
|
return add_bytes_to_string(screen, code, length);
|
||||||
|
}
|
||||||
#undef CURSOR_NUM_LEN
|
#undef CURSOR_NUM_LEN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,3 +66,9 @@ terminfo_max_colors(void)
|
|||||||
{
|
{
|
||||||
return max_colors;
|
return max_colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
terminfo_cursor_address(int y, int x)
|
||||||
|
{
|
||||||
|
return tiparm(cursor_address, y, x);
|
||||||
|
}
|
||||||
|
@ -9,4 +9,5 @@ char *terminfo_set_underline(int arg);
|
|||||||
char *terminfo_set_foreground(int arg);
|
char *terminfo_set_foreground(int arg);
|
||||||
char *terminfo_set_background(int arg);
|
char *terminfo_set_background(int arg);
|
||||||
int terminfo_max_colors(void);
|
int terminfo_max_colors(void);
|
||||||
|
char *terminfo_cursor_address(int y, int x);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user