ply_boot_splash_plugin_t * (* create_plugin) (void);
void (* destroy_plugin) (ply_boot_splash_plugin_t *plugin);
+ void (* add_window) (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window);
+
+ void (* remove_window) (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window);
bool (* show_splash_screen) (ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop,
- ply_window_t *window,
ply_buffer_t *boot_buffer);
void (* update_status) (ply_boot_splash_plugin_t *plugin,
const char *status);
size_t size);
void (* on_root_mounted) (ply_boot_splash_plugin_t *plugin);
void (* hide_splash_screen) (ply_boot_splash_plugin_t *plugin,
- ply_event_loop_t *loop,
- ply_window_t *window);
+ ply_event_loop_t *loop);
void (* ask_for_password) (ply_boot_splash_plugin_t *plugin,
const char *prompt,
}
}
+void
+add_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = window;
+}
+
+void
+remove_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = NULL;
+}
+
bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop,
- ply_window_t *window,
ply_buffer_t *boot_buffer)
{
size_t size;
assert (plugin != NULL);
- if (window != NULL)
+ if (plugin->window != NULL)
{
ply_boot_splash_plugin_interface_t *interface;
- ply_window_set_mode (window, PLY_WINDOW_MODE_TEXT);
+ ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_TEXT);
- ply_window_set_keyboard_input_handler (window,
+ ply_window_set_keyboard_input_handler (plugin->window,
(ply_window_keyboard_input_handler_t)
on_keyboard_input, plugin);
- ply_window_set_backspace_handler (window,
+ ply_window_set_backspace_handler (plugin->window,
(ply_window_backspace_handler_t)
on_backspace, plugin);
- ply_window_set_enter_handler (window,
+ ply_window_set_enter_handler (plugin->window,
(ply_window_enter_handler_t)
on_enter, plugin);
interface = ply_boot_splash_plugin_get_interface ();
interface->ask_for_password = ask_for_password;
-
- plugin->window = window;
}
plugin->loop = loop;
void
hide_splash_screen (ply_boot_splash_plugin_t *plugin,
- ply_event_loop_t *loop,
- ply_window_t *window)
+ ply_event_loop_t *loop)
{
assert (plugin != NULL);
plugin->keyboard_input_is_hidden = false;
}
- ply_window_set_keyboard_input_handler (window, NULL, NULL);
- ply_window_set_backspace_handler (window, NULL, NULL);
- ply_window_set_enter_handler (window, NULL, NULL);
+ ply_window_set_keyboard_input_handler (plugin->window, NULL, NULL);
+ ply_window_set_backspace_handler (plugin->window, NULL, NULL);
+ ply_window_set_enter_handler (plugin->window, NULL, NULL);
ply_event_loop_stop_watching_for_exit (plugin->loop,
(ply_event_loop_exit_handler_t)
detach_from_event_loop,
plugin);
detach_from_event_loop (plugin);
- plugin->window = NULL;
}
void
{
.create_plugin = create_plugin,
.destroy_plugin = destroy_plugin,
+ .add_window = add_window,
+ .remove_window = remove_window,
.show_splash_screen = show_splash_screen,
.update_status = update_status,
.on_boot_output = on_boot_output,
0x807c71, 0x3a362f);
}
+void
+add_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = window;
+}
+
+void
+remove_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = NULL;
+}
+
bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop,
- ply_window_t *window,
ply_buffer_t *boot_buffer)
{
assert (plugin != NULL);
assert (plugin->logo_image != NULL);
- ply_window_set_keyboard_input_handler (window,
+ ply_window_set_keyboard_input_handler (plugin->window,
(ply_window_keyboard_input_handler_t)
on_keyboard_input, plugin);
- ply_window_set_backspace_handler (window,
+ ply_window_set_backspace_handler (plugin->window,
(ply_window_backspace_handler_t)
on_backspace, plugin);
- ply_window_set_enter_handler (window,
+ ply_window_set_enter_handler (plugin->window,
(ply_window_enter_handler_t)
on_enter, plugin);
- ply_window_set_draw_handler (window,
+ ply_window_set_draw_handler (plugin->window,
(ply_window_draw_handler_t)
on_draw, plugin);
- ply_window_set_erase_handler (window,
+ ply_window_set_erase_handler (plugin->window,
(ply_window_erase_handler_t)
on_erase, plugin);
if (!ply_entry_load (plugin->entry))
return false;
- plugin->window = window;
-
ply_trace ("setting graphics mode");
if (!ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_GRAPHICS))
return false;
void
hide_splash_screen (ply_boot_splash_plugin_t *plugin,
- ply_event_loop_t *loop,
- ply_window_t *window)
+ ply_event_loop_t *loop)
{
assert (plugin != NULL);
plugin->pending_password_answer = NULL;
}
- ply_window_set_keyboard_input_handler (window, NULL, NULL);
- ply_window_set_backspace_handler (window, NULL, NULL);
- ply_window_set_enter_handler (window, NULL, NULL);
+ ply_window_set_keyboard_input_handler (plugin->window, NULL, NULL);
+ ply_window_set_backspace_handler (plugin->window, NULL, NULL);
+ ply_window_set_enter_handler (plugin->window, NULL, NULL);
if (plugin->loop != NULL)
{
plugin->frame_buffer = NULL;
ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_TEXT);
- plugin->window = NULL;
}
static void
{
.create_plugin = create_plugin,
.destroy_plugin = destroy_plugin,
+ .add_window = add_window,
+ .remove_window = remove_window,
.show_splash_screen = show_splash_screen,
.update_status = update_status,
.hide_splash_screen = hide_splash_screen,
ply_entry_free (plugin->entry);
ply_throbber_free (plugin->throbber);
ply_label_free (plugin->label);
+
+
free (plugin);
}
PLYMOUTH_BACKGROUND_END_COLOR);
}
+void
+add_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = window;
+}
+
+void
+remove_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = NULL;
+}
+
bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop,
- ply_window_t *window,
ply_buffer_t *boot_buffer)
{
assert (plugin != NULL);
assert (plugin->logo_image != NULL);
- ply_window_set_keyboard_input_handler (window,
+ ply_window_set_keyboard_input_handler (plugin->window,
(ply_window_keyboard_input_handler_t)
on_keyboard_input, plugin);
- ply_window_set_backspace_handler (window,
+ ply_window_set_backspace_handler (plugin->window,
(ply_window_backspace_handler_t)
on_backspace, plugin);
- ply_window_set_enter_handler (window,
+ ply_window_set_enter_handler (plugin->window,
(ply_window_enter_handler_t)
on_enter, plugin);
- ply_window_set_draw_handler (window,
+ ply_window_set_draw_handler (plugin->window,
(ply_window_draw_handler_t)
on_draw, plugin);
- ply_window_set_erase_handler (window,
+ ply_window_set_erase_handler (plugin->window,
(ply_window_erase_handler_t)
on_erase, plugin);
if (!ply_throbber_load (plugin->throbber))
return false;
- plugin->window = window;
-
ply_trace ("setting graphics mode");
if (!ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_GRAPHICS))
return false;
void
hide_splash_screen (ply_boot_splash_plugin_t *plugin,
- ply_event_loop_t *loop,
- ply_window_t *window)
+ ply_event_loop_t *loop)
{
assert (plugin != NULL);
plugin->pending_password_answer = NULL;
}
- ply_window_set_keyboard_input_handler (window, NULL, NULL);
- ply_window_set_backspace_handler (window, NULL, NULL);
- ply_window_set_enter_handler (window, NULL, NULL);
- ply_window_set_draw_handler (window, NULL, NULL);
- ply_window_set_erase_handler (window, NULL, NULL);
+ ply_window_set_keyboard_input_handler (plugin->window, NULL, NULL);
+ ply_window_set_backspace_handler (plugin->window, NULL, NULL);
+ ply_window_set_enter_handler (plugin->window, NULL, NULL);
+ ply_window_set_draw_handler (plugin->window, NULL, NULL);
+ ply_window_set_erase_handler (plugin->window, NULL, NULL);
if (plugin->loop != NULL)
{
}
plugin->frame_buffer = NULL;
-
- plugin->window = NULL;
}
static void
{
.create_plugin = create_plugin,
.destroy_plugin = destroy_plugin,
+ .add_window = add_window,
+ .remove_window = remove_window,
.show_splash_screen = show_splash_screen,
.update_status = update_status,
.hide_splash_screen = hide_splash_screen,
ply_window_clear_screen (plugin->window);
}
+void
+add_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = window;
+}
+
+void
+remove_window (ply_boot_splash_plugin_t *plugin,
+ ply_window_t *window)
+{
+ plugin->window = NULL;
+}
+
bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop,
- ply_window_t *window,
ply_buffer_t *boot_buffer)
{
assert (plugin != NULL);
- ply_window_set_keyboard_input_handler (window,
+ ply_window_set_keyboard_input_handler (plugin->window,
(ply_window_keyboard_input_handler_t)
on_keyboard_input, plugin);
- ply_window_set_backspace_handler (window,
+ ply_window_set_backspace_handler (plugin->window,
(ply_window_backspace_handler_t)
on_backspace, plugin);
- ply_window_set_enter_handler (window,
+ ply_window_set_enter_handler (plugin->window,
(ply_window_enter_handler_t)
on_enter, plugin);
- ply_window_set_draw_handler (window,
+ ply_window_set_draw_handler (plugin->window,
(ply_window_draw_handler_t)
on_draw, plugin);
- ply_window_set_erase_handler (window,
+ ply_window_set_erase_handler (plugin->window,
(ply_window_erase_handler_t)
on_erase, plugin);
detach_from_event_loop,
plugin);
- plugin->window = window;
-
start_animation (plugin);
return true;
void
hide_splash_screen (ply_boot_splash_plugin_t *plugin,
- ply_event_loop_t *loop,
- ply_window_t *window)
+ ply_event_loop_t *loop)
{
assert (plugin != NULL);
plugin->pending_password_answer = NULL;
}
- ply_window_set_keyboard_input_handler (window, NULL, NULL);
- ply_window_set_backspace_handler (window, NULL, NULL);
- ply_window_set_enter_handler (window, NULL, NULL);
- ply_window_set_draw_handler (window, NULL, NULL);
- ply_window_set_erase_handler (window, NULL, NULL);
+ ply_window_set_keyboard_input_handler (plugin->window, NULL, NULL);
+ ply_window_set_backspace_handler (plugin->window, NULL, NULL);
+ ply_window_set_enter_handler (plugin->window, NULL, NULL);
+ ply_window_set_draw_handler (plugin->window, NULL, NULL);
+ ply_window_set_erase_handler (plugin->window, NULL, NULL);
if (plugin->loop != NULL)
{
ply_window_clear_screen (plugin->window);
ply_window_show_text_cursor (plugin->window);
ply_window_reset_colors (plugin->window);
-
- plugin->window = NULL;
}
void
{
.create_plugin = create_plugin,
.destroy_plugin = destroy_plugin,
+ .add_window = add_window,
+ .remove_window = remove_window,
.show_splash_screen = show_splash_screen,
.update_status = update_status,
.hide_splash_screen = hide_splash_screen,
assert (splash->plugin != NULL);
assert (splash->plugin_interface->show_splash_screen != NULL);
+ splash->plugin_interface->add_window (splash->plugin, splash->window);
+
ply_trace ("showing splash screen\n");
if (!splash->plugin_interface->show_splash_screen (splash->plugin,
splash->loop,
- splash->window,
splash->boot_buffer))
{
assert (splash->plugin_interface->hide_splash_screen != NULL);
splash->plugin_interface->hide_splash_screen (splash->plugin,
- splash->loop,
- splash->window);
+ splash->loop);
+
+ splash->plugin_interface->remove_window (splash->plugin, splash->window);
splash->is_shown = false;