NULL, handler, failed_handler, user_data);
}
+void
+ply_boot_client_tell_daemon_to_hide_splash (ply_boot_client_t *client,
+ ply_boot_client_response_handler_t handler,
+ ply_boot_client_response_handler_t failed_handler,
+ void *user_data)
+{
+ assert (client != NULL);
+
+ ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_SPLASH,
+ NULL, handler, failed_handler, user_data);
+}
+
void
ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
void *user_data);
+void ply_boot_client_tell_daemon_to_hide_splash (ply_boot_client_t *client,
+ ply_boot_client_response_handler_t handler,
+ ply_boot_client_response_handler_t failed_handler,
+ void *user_data);
void ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
ply_event_loop_t *loop;
ply_boot_client_t *client;
ply_command_parser_t *command_parser;
- bool should_help, should_quit, should_ping, should_sysinit, should_ask_for_password, should_show_splash;
+ bool should_help, should_quit, should_ping, should_sysinit, should_ask_for_password, should_show_splash, should_hide_splash;
char *status, *chroot_dir;
int exit_code;
"ping", "Check of boot daemon is running", PLY_COMMAND_OPTION_TYPE_FLAG,
"sysinit", "Tell boot daemon root filesystem is mounted read-write", PLY_COMMAND_OPTION_TYPE_FLAG,
"show-splash", "Show splash screen", PLY_COMMAND_OPTION_TYPE_FLAG,
+ "hide-splash", "Hide splash screen", PLY_COMMAND_OPTION_TYPE_FLAG,
"ask-for-password", "Ask user for password", PLY_COMMAND_OPTION_TYPE_FLAG,
"update", "Tell boot daemon an update about boot progress", PLY_COMMAND_OPTION_TYPE_STRING,
NULL);
"ping", &should_ping,
"sysinit", &should_sysinit,
"show-splash", &should_show_splash,
+ "hide-splash", &should_hide_splash,
"ask-for-password", &should_ask_for_password,
"update", &status,
NULL);
on_success,
(ply_boot_client_response_handler_t)
on_failure, loop);
+ else if (should_hide_splash)
+ ply_boot_client_tell_daemon_to_hide_splash (client,
+ (ply_boot_client_response_handler_t)
+ on_success,
+ (ply_boot_client_response_handler_t)
+ on_failure, loop);
else if (should_quit)
ply_boot_client_tell_daemon_to_quit (client,
(ply_boot_client_response_handler_t)
void
ply_window_clear_screen (ply_window_t *window)
{
+ if (ply_frame_buffer_device_is_open (window->frame_buffer))
+ ply_frame_buffer_fill_with_color (window->frame_buffer, NULL, 0.0, 0.0, 0.0, 1.0);
+
write (window->tty_fd, CLEAR_SCREEN_SEQUENCE, strlen (CLEAR_SCREEN_SEQUENCE));
ply_window_set_text_cursor_position (window, 0, 0);
-
- if (ply_frame_buffer_device_is_open (window->frame_buffer))
- ply_frame_buffer_fill_with_color (window->frame_buffer, NULL, 0.0, 0.0, 0.0, 1.0);
}
void
show_default_splash (state);
}
+static void
+on_hide_splash (state_t *state)
+{
+
+ if (state->boot_splash != NULL)
+ {
+ ply_boot_splash_hide (state->boot_splash);
+ ply_boot_splash_free (state->boot_splash);
+ state->boot_splash = NULL;
+ }
+
+ if (state->window != NULL)
+ {
+ ply_window_free (state->window);
+ state->window = NULL;
+ }
+}
+
static void
on_quit (state_t *state)
{
server = ply_boot_server_new ((ply_boot_server_update_handler_t) on_update,
(ply_boot_server_ask_for_password_handler_t) on_ask_for_password,
(ply_boot_server_show_splash_handler_t) on_show_splash,
+ (ply_boot_server_hide_splash_handler_t) on_hide_splash,
(ply_boot_server_newroot_handler_t) on_newroot,
(ply_boot_server_system_initialized_handler_t) on_system_initialized,
(ply_boot_server_quit_handler_t) on_quit,
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT "Q"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD "*"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_SHOW_SPLASH "$"
+#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_SPLASH "H"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_NEWROOT "R"
#define PLY_BOOT_PROTOCOL_RESPONSE_TYPE_ACK "\x6"
#define PLY_BOOT_PROTOCOL_RESPONSE_TYPE_NAK "\x15"
ply_boot_server_newroot_handler_t newroot_handler;
ply_boot_server_system_initialized_handler_t system_initialized_handler;
ply_boot_server_show_splash_handler_t show_splash_handler;
+ ply_boot_server_hide_splash_handler_t hide_splash_handler;
ply_boot_server_ask_for_password_handler_t ask_for_password_handler;
ply_boot_server_quit_handler_t quit_handler;
void *user_data;
ply_boot_server_new (ply_boot_server_update_handler_t update_handler,
ply_boot_server_ask_for_password_handler_t ask_for_password_handler,
ply_boot_server_show_splash_handler_t show_splash_handler,
+ ply_boot_server_hide_splash_handler_t hide_splash_handler,
ply_boot_server_newroot_handler_t newroot_handler,
ply_boot_server_system_initialized_handler_t initialized_handler,
ply_boot_server_quit_handler_t quit_handler,
server->newroot_handler = newroot_handler;
server->system_initialized_handler = initialized_handler;
server->show_splash_handler = show_splash_handler;
+ server->hide_splash_handler = hide_splash_handler;
server->quit_handler = quit_handler;
server->user_data = user_data;
if (server->show_splash_handler != NULL)
server->show_splash_handler (server->user_data, server);
}
+ else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_SPLASH) == 0)
+ {
+ ply_trace ("got hide splash request");
+ if (server->hide_splash_handler != NULL)
+ server->hide_splash_handler (server->user_data, server);
+ }
else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT) == 0)
{
if (server->quit_handler != NULL)
printf ("got show splash request\n");
}
+static void
+on_hide_splash (ply_event_loop_t *loop)
+{
+ printf ("got hide splash request\n");
+}
+
static void
on_quit (ply_event_loop_t *loop)
{
server = ply_boot_server_new ((ply_boot_server_update_handler_t) on_update,
(ply_boot_server_ask_for_password_handler_t) on_ask_for_password,
(ply_boot_server_show_splash_handler_t) on_show_splash,
+ (ply_boot_server_hide_splash_handler_t) on_hide_splash,
(ply_boot_server_newroot_handler_t) on_newroot,
(ply_boot_server_system_initialized_handler_t) on_system_initialized,
(ply_boot_server_quit_handler_t) on_quit,
typedef void (* ply_boot_server_show_splash_handler_t) (void *user_data,
ply_boot_server_t *server);
+typedef void (* ply_boot_server_hide_splash_handler_t) (void *user_data,
+ ply_boot_server_t *server);
+
typedef void (* ply_boot_server_password_answer_handler_t) (void *answer_data,
const char *password,
ply_boot_server_t *server);
ply_boot_server_t *ply_boot_server_new (ply_boot_server_update_handler_t update_handler,
ply_boot_server_ask_for_password_handler_t ask_for_password_handler,
ply_boot_server_show_splash_handler_t show_splash_handler,
+ ply_boot_server_hide_splash_handler_t hide_splash_handler,
ply_boot_server_newroot_handler_t newroot_handler,
ply_boot_server_system_initialized_handler_t initialized_handler,
ply_boot_server_quit_handler_t quit_handler,