arg, handler, failed_handler, user_data);
}
+void
+ply_boot_client_tell_daemon_to_reload (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_RELOAD,
+ NULL, handler, failed_handler, user_data);
+}
+
void
ply_boot_client_tell_daemon_to_progress_pause (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_reload (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_progress_pause (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
on_failure, state);
}
+static void
+on_reload_request (state_t *state,
+ const char *command)
+{
+ ply_boot_client_tell_daemon_to_reload (state->client,
+ (ply_boot_client_response_handler_t)
+ on_success,
+ (ply_boot_client_response_handler_t)
+ on_failure, state);
+}
+
static void
on_update_root_fs_request (state_t *state,
const char *command)
"retain-splash", "Don't explicitly hide boot splash on exit",
PLY_COMMAND_OPTION_TYPE_FLAG, NULL);
+ ply_command_parser_add_command (state.command_parser,
+ "reload", "Tell the daemon to reload the theme",
+ (ply_command_handler_t)
+ on_reload_request, &state, NULL);
+
if (!ply_command_parser_parse_arguments (state.command_parser, state.loop, argv, argc)) {
char *help_string;
return false;
}
+static void
+on_reload (state_t *state)
+{
+ ply_trace ("reloading");
+ if (state->boot_splash != NULL) {
+ ply_boot_splash_hide (state->boot_splash);
+ ply_boot_splash_free (state->boot_splash);
+ state->boot_splash = NULL;
+ }
+
+ free (state->override_splash_path);
+ state->override_splash_path = NULL;
+ free (state->system_default_splash_path);
+ state->system_default_splash_path = NULL;
+ free (state->distribution_default_splash_path);
+ state->distribution_default_splash_path = NULL;
+
+ find_override_splash (state);
+ find_system_default_splash (state);
+ find_distribution_default_splash (state);
+
+ if (state->is_inactive) {
+ ply_trace ("reload while inactive");
+ return;
+ }
+
+ if (!state->is_shown) {
+ ply_trace ("reload while not shown");
+ return;
+ }
+
+ if (state->showing_details) {
+ show_detailed_splash (state);
+ } else {
+ show_default_splash (state);
+ }
+}
+
+
static void
on_show_splash (state_t *state)
{
(ply_boot_server_reactivate_handler_t) on_reactivate,
(ply_boot_server_quit_handler_t) on_quit,
(ply_boot_server_has_active_vt_handler_t) on_has_active_vt,
+ (ply_boot_server_reload_handler_t) on_reload,
state);
if (!ply_boot_server_listen (server)) {
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_DEACTIVATE "D"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_REACTIVATE "r"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT "Q"
+#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_RELOAD "l"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD "*"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_CACHED_PASSWORD "c"
#define PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUESTION "W"
ply_boot_server_reactivate_handler_t reactivate_handler;
ply_boot_server_quit_handler_t quit_handler;
ply_boot_server_has_active_vt_handler_t has_active_vt_handler;
+ ply_boot_server_reload_handler_t reload_handler;
void *user_data;
uint32_t is_listening : 1;
ply_boot_server_reactivate_handler_t reactivate_handler,
ply_boot_server_quit_handler_t quit_handler,
ply_boot_server_has_active_vt_handler_t has_active_vt_handler,
+ ply_boot_server_reload_handler_t reload_handler,
void *user_data)
{
ply_boot_server_t *server;
server->reactivate_handler = reactivate_handler;
server->quit_handler = quit_handler;
server->has_active_vt_handler = has_active_vt_handler;
+ server->reload_handler = reload_handler;
server->user_data = user_data;
return server;
free (argument);
free (command);
return;
+ } else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_RELOAD) == 0) {
+ ply_trace ("got reload request");
+ if (server->reload_handler != NULL)
+ server->reload_handler (server->user_data, server);
} else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD) == 0) {
ply_trigger_t *answer;
ply_boot_server_t *server);
typedef bool (*ply_boot_server_has_active_vt_handler_t) (void *user_data,
ply_boot_server_t *server);
+typedef bool (*ply_boot_server_reload_handler_t) (void *user_data,
+ ply_boot_server_t *server);
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
ply_boot_server_t *ply_boot_server_new (ply_boot_server_update_handler_t update_handler,
ply_boot_server_reactivate_handler_t reactivate_handler,
ply_boot_server_quit_handler_t quit_handler,
ply_boot_server_has_active_vt_handler_t has_active_vt_handler,
+ ply_boot_server_reload_handler_t reload_handler,
void *user_data);
void ply_boot_server_free (ply_boot_server_t *server);