const char *entry_text);
void (*become_idle)(ply_boot_splash_plugin_t *plugin,
ply_trigger_t *idle_trigger);
+ void (*display_prompt)(ply_boot_splash_plugin_t *plugin,
+ const char *prompt,
+ const char *entry_text,
+ bool is_secret);
} ply_boot_splash_plugin_interface_t;
#endif /* PLY_BOOT_SPLASH_PLUGIN_H */
splash->plugin_interface->display_question (splash->plugin, prompt, entry_text);
}
+void ply_boot_splash_display_prompt (ply_boot_splash_t *splash,
+ const char *prompt,
+ const char *entry_text,
+ bool is_secret)
+{
+ assert (splash != NULL);
+ assert (splash->plugin_interface != NULL);
+ assert (splash->plugin != NULL);
+ if (splash->plugin_interface->display_prompt != NULL)
+ splash->plugin_interface->display_prompt (splash->plugin, prompt, entry_text, is_secret);
+}
+
void
void ply_boot_splash_display_question (ply_boot_splash_t *splash,
const char *prompt,
const char *entry_text);
+void ply_boot_splash_display_prompt (ply_boot_splash_t *splash,
+ const char *prompt,
+ const char *entry_text,
+ bool is_secret);
void ply_boot_splash_attach_to_event_loop (ply_boot_splash_t *splash,
ply_event_loop_t *loop);
void ply_boot_splash_attach_progress (ply_boot_splash_t *splash,
ply_boot_splash_display_password (state->boot_splash,
entry_trigger->prompt,
bullets);
+ ply_boot_splash_display_prompt (state->boot_splash,
+ entry_trigger->prompt,
+ ply_buffer_get_bytes (state->entry_buffer),
+ true);
} else if (entry_trigger->type == PLY_ENTRY_TRIGGER_TYPE_QUESTION) {
ply_boot_splash_display_question (state->boot_splash,
entry_trigger->prompt,
ply_buffer_get_bytes (state->entry_buffer));
+ ply_boot_splash_display_prompt (state->boot_splash,
+ entry_trigger->prompt,
+ ply_buffer_get_bytes (state->entry_buffer),
+ false);
} else {
ply_trace ("unkown entry type");
}
unpause_displays (plugin);
}
+static void
+display_prompt (ply_boot_splash_plugin_t *plugin,
+ const char *prompt,
+ const char *entry_text,
+ bool is_secret)
+{
+ pause_displays (plugin);
+ script_lib_plymouth_on_display_prompt (plugin->script_state,
+ plugin->script_plymouth_lib,
+ prompt,
+ entry_text,
+ is_secret);
+ unpause_displays (plugin);
+}
+
static void
display_message (ply_boot_splash_plugin_t *plugin,
const char *message)
.display_normal = display_normal,
.display_password = display_password,
.display_question = display_question,
+ .display_prompt = display_prompt,
.display_message = display_message,
.hide_message = hide_message,
};
data->script_display_normal_func = script_obj_new_null ();
data->script_display_password_func = script_obj_new_null ();
data->script_display_question_func = script_obj_new_null ();
+ data->script_display_prompt_func = script_obj_new_null ();
data->script_display_message_func = script_obj_new_null ();
data->script_hide_message_func = script_obj_new_null ();
data->script_quit_func = script_obj_new_null ();
&data->script_display_question_func,
"function",
NULL);
+ script_add_native_function (plymouth_hash,
+ "SetDisplayPromptFunction",
+ plymouth_set_function,
+ &data->script_display_prompt_func,
+ "function",
+ NULL);
script_add_native_function (plymouth_hash,
"SetDisplayMessageFunction",
plymouth_set_function,
script_obj_unref (data->script_display_normal_func);
script_obj_unref (data->script_display_password_func);
script_obj_unref (data->script_display_question_func);
+ script_obj_unref (data->script_display_prompt_func);
script_obj_unref (data->script_display_message_func);
script_obj_unref (data->script_hide_message_func);
script_obj_unref (data->script_quit_func);
script_obj_unref (ret.object);
}
+void script_lib_plymouth_on_display_prompt (script_state_t *state,
+ script_lib_plymouth_data_t *data,
+ const char *prompt,
+ const char *entry_text,
+ bool is_secret)
+{
+ script_obj_t *prompt_obj = script_obj_new_string (prompt);
+ script_obj_t *entry_text_obj = script_obj_new_string (entry_text);
+ script_obj_t *is_secret_obj = script_obj_new_number (is_secret);
+ script_return_t ret = script_execute_object (state,
+ data->script_display_prompt_func,
+ NULL,
+ prompt_obj,
+ entry_text_obj,
+ is_secret_obj,
+ NULL);
+
+ script_obj_unref (prompt_obj);
+ script_obj_unref (entry_text_obj);
+ script_obj_unref (is_secret_obj);
+ script_obj_unref (ret.object);
+}
+
void script_lib_plymouth_on_display_message (script_state_t *state,
script_lib_plymouth_data_t *data,
const char *message)
script_obj_t *script_display_normal_func;
script_obj_t *script_display_password_func;
script_obj_t *script_display_question_func;
+ script_obj_t *script_display_prompt_func;
script_obj_t *script_display_message_func;
script_obj_t *script_hide_message_func;
script_obj_t *script_quit_func;
script_lib_plymouth_data_t *data,
const char *prompt,
const char *entry_text);
+void script_lib_plymouth_on_display_prompt (script_state_t *state,
+ script_lib_plymouth_data_t *data,
+ const char *prompt,
+ const char *entry_text,
+ bool is_secret);
void script_lib_plymouth_on_display_message (script_state_t *state,
script_lib_plymouth_data_t *data,
const char *new_message);