console: allow setting/resetting flags
Instead of writing a function for each mode we now accept flags for the console object. For now the flags are unused but other flags will be added. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
6cd591a912
commit
cce9a5df15
@ -75,6 +75,7 @@ struct kmscon_buffer {
|
||||
* the sb seems to scroll-up while staying on the line
|
||||
*/
|
||||
bool fixed_position;
|
||||
unsigned int flags;
|
||||
|
||||
/* current cell/row count of the main screen */
|
||||
unsigned int size_x; /* cell count */
|
||||
@ -1045,6 +1046,22 @@ void kmscon_console_reset(struct kmscon_console *con)
|
||||
/* TODO: reset console */
|
||||
}
|
||||
|
||||
void kmscon_console_set_flags(struct kmscon_console *con, unsigned int flags)
|
||||
{
|
||||
if (!con || !flags)
|
||||
return;
|
||||
|
||||
con->cells->flags |= flags;
|
||||
}
|
||||
|
||||
void kmscon_console_reset_flags(struct kmscon_console *con, unsigned int flags)
|
||||
{
|
||||
if (!con || !flags)
|
||||
return;
|
||||
|
||||
con->cells->flags &= ~flags;
|
||||
}
|
||||
|
||||
void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr)
|
||||
{
|
||||
if (!con)
|
||||
|
@ -56,6 +56,8 @@ unsigned int kmscon_console_get_height(struct kmscon_console *con);
|
||||
int kmscon_console_resize(struct kmscon_console *con, unsigned int x,
|
||||
unsigned int y, unsigned int height);
|
||||
void kmscon_console_reset(struct kmscon_console *con);
|
||||
void kmscon_console_set_flags(struct kmscon_console *con, unsigned int flags);
|
||||
void kmscon_console_reset_flags(struct kmscon_console *con, unsigned int flags);
|
||||
|
||||
void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user