diff options
| author | Ray Strode <rstrode@redhat.com> | 2008-06-18 22:45:49 -0400 |
|---|---|---|
| committer | Ray Strode <rstrode@redhat.com> | 2008-06-18 22:45:49 -0400 |
| commit | 6bda9aa4d1bb949cc9aa448b2b43fbb46e667691 (patch) | |
| tree | b639475f29750bd0223b43c937215c6219f94101 /src/splash-plugins/text | |
| parent | 4d686ee8e8cb43b791fb3a03773c1a44ae27aeaf (diff) | |
| download | plymouth-6bda9aa4d1bb949cc9aa448b2b43fbb46e667691.tar.gz plymouth-6bda9aa4d1bb949cc9aa448b2b43fbb46e667691.tar.xz plymouth-6bda9aa4d1bb949cc9aa448b2b43fbb46e667691.zip | |
Hide cursor and clear screen in text plugin
Diffstat (limited to 'src/splash-plugins/text')
| -rw-r--r-- | src/splash-plugins/text/plugin.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/splash-plugins/text/plugin.c b/src/splash-plugins/text/plugin.c index 7e8a4e6..83f5e60 100644 --- a/src/splash-plugins/text/plugin.c +++ b/src/splash-plugins/text/plugin.c @@ -54,6 +54,9 @@ #include <linux/kd.h> #define CLEAR_LINE_SEQUENCE "\033[2K\r\n" +#define CLEAR_SCREEN_SEQUENCE "\033[2J" +#define HIDE_CURSOR_SEQUENCE "\033[?25l" +#define SHOW_CURSOR_SEQUENCE "\033[?25h" #define BACKSPACE "\b\033[0K" struct _ply_boot_splash_plugin @@ -126,6 +129,24 @@ on_enter (ply_boot_splash_plugin_t *plugin, } } +static void +clear_screen (ply_boot_splash_plugin_t *plugin) +{ + write (STDOUT_FILENO, CLEAR_SCREEN_SEQUENCE, strlen (CLEAR_SCREEN_SEQUENCE)); +} + +static void +hide_cursor (ply_boot_splash_plugin_t *plugin) +{ + write (STDOUT_FILENO, HIDE_CURSOR_SEQUENCE, strlen (HIDE_CURSOR_SEQUENCE)); +} + +static void +show_cursor (ply_boot_splash_plugin_t *plugin) +{ + write (STDOUT_FILENO, SHOW_CURSOR_SEQUENCE, strlen (SHOW_CURSOR_SEQUENCE)); +} + bool show_splash_screen (ply_boot_splash_plugin_t *plugin, ply_event_loop_t *loop, @@ -149,6 +170,9 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, detach_from_event_loop, plugin); + clear_screen (plugin); + hide_cursor (plugin); + return true; } @@ -183,6 +207,9 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin, plugin); detach_from_event_loop (plugin); } + + clear_screen (plugin); + show_cursor (plugin); } void |
