|
|
|
@ -59,6 +59,7 @@ typedef struct
|
|
|
|
|
ply_boot_client_response_handler_t handler;
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler;
|
|
|
|
|
void *user_data;
|
|
|
|
|
bool nowait;
|
|
|
|
|
} ply_boot_client_request_t;
|
|
|
|
|
|
|
|
|
|
static void ply_boot_client_cancel_request (ply_boot_client_t *client,
|
|
|
|
@ -211,7 +212,8 @@ ply_boot_client_request_new (ply_boot_client_t *client,
|
|
|
|
|
const char *request_argument,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
ply_boot_client_request_t *request;
|
|
|
|
|
|
|
|
|
@ -226,6 +228,7 @@ ply_boot_client_request_new (ply_boot_client_t *client,
|
|
|
|
|
request->handler = handler;
|
|
|
|
|
request->failed_handler = failed_handler;
|
|
|
|
|
request->user_data = user_data;
|
|
|
|
|
request->nowait = nowait;
|
|
|
|
|
|
|
|
|
|
return request;
|
|
|
|
|
}
|
|
|
|
@ -433,6 +436,15 @@ ply_boot_client_send_request (ply_boot_client_t *client,
|
|
|
|
|
}
|
|
|
|
|
free (request_string);
|
|
|
|
|
|
|
|
|
|
if (request->nowait)
|
|
|
|
|
{
|
|
|
|
|
if (request->handler != NULL)
|
|
|
|
|
request->handler (request->user_data, client);
|
|
|
|
|
|
|
|
|
|
request->handler = NULL;
|
|
|
|
|
request->failed_handler = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (client->daemon_has_reply_watch == NULL)
|
|
|
|
|
{
|
|
|
|
|
assert (ply_list_get_length (client->requests_waiting_for_replies) == 0);
|
|
|
|
@ -468,7 +480,7 @@ ply_boot_client_process_pending_requests (ply_boot_client_t *client)
|
|
|
|
|
|
|
|
|
|
if (ply_list_get_length (client->requests_to_send) == 0)
|
|
|
|
|
{
|
|
|
|
|
if (client->daemon_has_reply_watch != NULL)
|
|
|
|
|
if (client->daemon_can_take_request_watch != NULL)
|
|
|
|
|
{
|
|
|
|
|
assert (client->loop != NULL);
|
|
|
|
|
|
|
|
|
@ -485,7 +497,8 @@ ply_boot_client_queue_request (ply_boot_client_t *client,
|
|
|
|
|
const char *request_argument,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
assert (client->loop != NULL);
|
|
|
|
@ -517,7 +530,8 @@ ply_boot_client_queue_request (ply_boot_client_t *client,
|
|
|
|
|
|
|
|
|
|
request = ply_boot_client_request_new (client, request_command,
|
|
|
|
|
request_argument,
|
|
|
|
|
handler, failed_handler, user_data);
|
|
|
|
|
handler, failed_handler, user_data,
|
|
|
|
|
nowait);
|
|
|
|
|
ply_list_append_data (client->requests_to_send, request);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -531,7 +545,7 @@ ply_boot_client_ping_daemon (ply_boot_client_t *client,
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PING,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -539,12 +553,13 @@ ply_boot_client_update_daemon (ply_boot_client_t *client,
|
|
|
|
|
const char *status,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_UPDATE,
|
|
|
|
|
status, handler, failed_handler, user_data);
|
|
|
|
|
status, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -552,13 +567,14 @@ ply_boot_client_tell_daemon_to_change_root (ply_boot_client_t *
|
|
|
|
|
const char *root_dir,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
assert (root_dir != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request(client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_NEWROOT,
|
|
|
|
|
root_dir, handler, failed_handler, user_data);
|
|
|
|
|
root_dir, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -566,13 +582,14 @@ ply_boot_client_tell_daemon_to_display_message (ply_boot_client_t
|
|
|
|
|
const char *message,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
assert (message != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_SHOW_MESSAGE,
|
|
|
|
|
message, handler, failed_handler, user_data);
|
|
|
|
|
message, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -580,26 +597,28 @@ ply_boot_client_tell_daemon_to_hide_message (ply_boot_client_t
|
|
|
|
|
const char *message,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
message, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client,
|
|
|
|
|
PLY_BOOT_PROTOCOL_REQUEST_TYPE_SYSTEM_INITIALIZED,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -614,7 +633,7 @@ ply_boot_client_ask_daemon_for_password (ply_boot_client_t *cli
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD,
|
|
|
|
|
prompt, (ply_boot_client_response_handler_t)
|
|
|
|
|
handler, failed_handler, user_data);
|
|
|
|
|
handler, failed_handler, user_data, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -627,7 +646,7 @@ ply_boot_client_ask_daemon_for_cached_passwords (ply_boot_client_t
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_CACHED_PASSWORD,
|
|
|
|
|
NULL, (ply_boot_client_response_handler_t)
|
|
|
|
|
handler, failed_handler, user_data);
|
|
|
|
|
handler, failed_handler, user_data, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -641,7 +660,7 @@ ply_boot_client_ask_daemon_question (ply_boot_client_t *c
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUESTION,
|
|
|
|
|
prompt, (ply_boot_client_response_handler_t)
|
|
|
|
|
handler, failed_handler, user_data);
|
|
|
|
|
handler, failed_handler, user_data, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -655,7 +674,7 @@ ply_boot_client_ask_daemon_to_watch_for_keystroke (ply_boot_client_t *
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_KEYSTROKE,
|
|
|
|
|
keys, (ply_boot_client_response_handler_t)
|
|
|
|
|
handler, failed_handler, user_data);
|
|
|
|
|
handler, failed_handler, user_data, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -663,61 +682,66 @@ ply_boot_client_ask_daemon_to_ignore_keystroke (ply_boot_client_t
|
|
|
|
|
const char *keys,
|
|
|
|
|
ply_boot_client_answer_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_KEYSTROKE_REMOVE,
|
|
|
|
|
keys, (ply_boot_client_response_handler_t)
|
|
|
|
|
handler, failed_handler, user_data);
|
|
|
|
|
handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ply_boot_client_tell_daemon_to_show_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 *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_SHOW_SPLASH,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_SPLASH,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t *client,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_DEACTIVATE,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
assert (client != NULL);
|
|
|
|
|
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_REACTIVATE,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -725,7 +749,8 @@ ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client,
|
|
|
|
|
bool retain_splash,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
char arg[2] = "";
|
|
|
|
|
|
|
|
|
@ -733,47 +758,51 @@ ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client,
|
|
|
|
|
|
|
|
|
|
arg[0] = (char) (retain_splash != false);
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT,
|
|
|
|
|
arg, handler, failed_handler, user_data);
|
|
|
|
|
arg, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PROGRESS_PAUSE,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ply_boot_client_tell_daemon_to_progress_unpause (ply_boot_client_t *client,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PROGRESS_UNPAUSE,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ply_boot_client_ask_daemon_has_active_vt (ply_boot_client_t *client,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HAS_ACTIVE_VT,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ply_boot_client_tell_daemon_about_error (ply_boot_client_t *client,
|
|
|
|
|
ply_boot_client_response_handler_t handler,
|
|
|
|
|
ply_boot_client_response_handler_t failed_handler,
|
|
|
|
|
void *user_data)
|
|
|
|
|
void *user_data,
|
|
|
|
|
bool nowait)
|
|
|
|
|
{
|
|
|
|
|
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_ERROR,
|
|
|
|
|
NULL, handler, failed_handler, user_data);
|
|
|
|
|
NULL, handler, failed_handler, user_data, nowait);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|