[PATCH 13/20] [client] Add new reactivate command
Scott James Remnant
scott at ubuntu.com
Thu Mar 18 13:56:39 PDT 2010
This tells the daemon to reactivate itself after having previously
been suspended by the deactivate command.
---
src/client/ply-boot-client.c | 12 ++++++++++++
src/client/ply-boot-client.h | 4 ++++
src/client/plymouth.c | 16 ++++++++++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/client/ply-boot-client.c b/src/client/ply-boot-client.c
index fef7fb1..58c5e44 100644
--- a/src/client/ply-boot-client.c
+++ b/src/client/ply-boot-client.c
@@ -675,6 +675,18 @@ ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t *c
}
void
+ply_boot_client_tell_daemon_to_reactivate (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_REACTIVATE,
+ NULL, handler, failed_handler, user_data);
+}
+
+void
ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client,
bool retain_splash,
ply_boot_client_response_handler_t handler,
diff --git a/src/client/ply-boot-client.h b/src/client/ply-boot-client.h
index 0e9122c..046b6f7 100644
--- a/src/client/ply-boot-client.h
+++ b/src/client/ply-boot-client.h
@@ -108,6 +108,10 @@ void ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t
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_reactivate (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,
bool retain_splash,
ply_boot_client_response_handler_t handler,
diff --git a/src/client/plymouth.c b/src/client/plymouth.c
index a520901..5dffba8 100644
--- a/src/client/plymouth.c
+++ b/src/client/plymouth.c
@@ -679,6 +679,17 @@ on_deactivate_request (state_t *state,
}
static void
+on_reactivate_request (state_t *state,
+ const char *command)
+{
+ ply_boot_client_tell_daemon_to_reactivate (state->client,
+ (ply_boot_client_response_handler_t)
+ on_success,
+ (ply_boot_client_response_handler_t)
+ on_failure, state);
+}
+
+static void
on_quit_request (state_t *state,
const char *command)
{
@@ -827,6 +838,11 @@ main (int argc,
on_deactivate_request, &state, NULL);
ply_command_parser_add_command (state.command_parser,
+ "reactivate", "Tell boot daemon to reactivate",
+ (ply_command_handler_t)
+ on_reactivate_request, &state, NULL);
+
+ ply_command_parser_add_command (state.command_parser,
"quit", "Tell boot daemon to quit",
(ply_command_handler_t)
on_quit_request, &state,
--
1.7.0
More information about the plymouth
mailing list