From 2630ee585b38b8370bac03ab9bd63428e9153b5c Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 30 May 2012 18:19:03 +0200 Subject: [PATCH] console: allow retrieving console flags This adds a new function that allows external subsystems to retrieve the current flags of the console. Signed-off-by: David Herrmann --- src/console.c | 8 ++++++++ src/console.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/console.c b/src/console.c index f1d63aa..177c182 100644 --- a/src/console.c +++ b/src/console.c @@ -1061,6 +1061,14 @@ void kmscon_console_reset_flags(struct kmscon_console *con, unsigned int flags) con->cells->flags &= ~flags; } +unsigned int kmscon_console_get_flags(struct kmscon_console *con) +{ + if (!con) + return 0; + + return con->cells->flags; +} + void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr) { if (!con) diff --git a/src/console.h b/src/console.h index 620ac92..d48bc06 100644 --- a/src/console.h +++ b/src/console.h @@ -44,8 +44,10 @@ struct kmscon_console; /* console objects */ +/* modes for kmscon_console_write() */ #define KMSCON_CONSOLE_INSERT 0x01 #define KMSCON_CONSOLE_WRAP 0x02 +/* modes for kmscon_console_re/set() */ #define KMSCON_CONSOLE_REL_ORIGIN 0x04 int kmscon_console_new(struct kmscon_console **out); @@ -59,6 +61,7 @@ int kmscon_console_resize(struct kmscon_console *con, unsigned int x, 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); +unsigned int kmscon_console_get_flags(struct kmscon_console *con); void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr);