console: allow retrieving cursor state

This adds two functions to retrieve x/y positions of the cursor. This can
be used to save and restore cursor positions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-07-14 13:36:46 +02:00
parent 93ccbdc699
commit 2a648c54dd
2 changed files with 19 additions and 0 deletions

View File

@ -632,6 +632,22 @@ unsigned int kmscon_console_get_flags(struct kmscon_console *con)
return con->flags;
}
unsigned int kmscon_console_get_cursor_x(struct kmscon_console *con)
{
if (!con)
return 0;
return con->cursor_x;
}
unsigned int kmscon_console_get_cursor_y(struct kmscon_console *con)
{
if (!con)
return 0;
return con->cursor_y;
}
void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr)
{
unsigned int cur_x, cur_y;

View File

@ -69,6 +69,9 @@ void kmscon_console_set_flags(struct kmscon_console *con, unsigned int flags);
void kmscon_console_reset_flags(struct kmscon_console *con, unsigned int flags);
unsigned int kmscon_console_get_flags(struct kmscon_console *con);
unsigned int kmscon_console_get_cursor_x(struct kmscon_console *con);
unsigned int kmscon_console_get_cursor_y(struct kmscon_console *con);
void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr);
void kmscon_console_write(struct kmscon_console *con, kmscon_symbol_t ch,