message, handler, failed_handler, user_data);
}
+void
+ply_boot_client_tell_daemon_to_hide_message (ply_boot_client_t *client,
+ const char *message,
+ ply_boot_client_response_handler_t handler,
+ ply_boot_client_response_handler_t failed_handler,
+ void *user_data)
+{
+ assert (client != NULL);
+ assert (message != NULL);
+
+ ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_MESSAGE,
+ message, handler, failed_handler, user_data);
+}
+
void
ply_boot_client_tell_daemon_system_is_initialized (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_message (ply_boot_client_t *client,
+ const char *message,
+ ply_boot_client_response_handler_t handler,
+ ply_boot_client_response_handler_t failed_handler,
+ void *user_data);
void ply_boot_client_ask_daemon_for_password (ply_boot_client_t *client,
const char *prompt,
ply_boot_client_answer_handler_t handler,
}
static void
-on_message_request (state_t *state,
- const char *command)
+on_display_message_request (state_t *state,
+ const char *command)
{
char *text;
}
}
+static void
+on_hide_message_request (state_t *state,
+ const char *command)
+{
+ char *text;
+
+ text = NULL;
+ ply_command_parser_get_command_options (state->command_parser,
+ command,
+ "text", &text,
+ NULL);
+ if (text != NULL)
+ {
+ ply_boot_client_tell_daemon_to_hide_message (state->client,
+ text,
+ (ply_boot_client_response_handler_t)
+ on_success,
+ (ply_boot_client_response_handler_t)
+ on_failure, state);
+ free (text);
+ }
+}
+
static void
on_keystroke_request (state_t *state,
const char *command)
NULL);
ply_command_parser_add_command (state.command_parser,
- "message", "Display a message",
+ "display-message", "Display a message",
+ (ply_command_handler_t)
+ on_display_message_request, &state,
+ "text", "The message text",
+ PLY_COMMAND_OPTION_TYPE_STRING,
+ NULL);
+
+ ply_command_parser_add_command (state.command_parser,
+ "hide-message", "Hide a message",
(ply_command_handler_t)
- on_message_request, &state,
+ on_hide_message_request, &state,
"text", "The message text",
PLY_COMMAND_OPTION_TYPE_STRING,
NULL);