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:
David Herrmann 2012-05-30 17:54:31 +02:00
parent 6cd591a912
commit cce9a5df15
2 changed files with 19 additions and 0 deletions

View File

@ -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)

View File

@ -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);