summaryrefslogtreecommitdiffstats
path: root/src/splash-plugins/details
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-05-21 08:57:59 -0400
committerRay Strode <rstrode@redhat.com>2008-05-21 08:57:59 -0400
commit4cf3e3ae2d9062f727dca72c9dd510fca742c36a (patch)
tree46221818351c8e6c0a1c467709ca81b815e6af9f /src/splash-plugins/details
parenta0092f35c5560ab26dbab5e0fbd8a4de51b27528 (diff)
downloadplymouth-4cf3e3ae2d9062f727dca72c9dd510fca742c36a.tar.gz
plymouth-4cf3e3ae2d9062f727dca72c9dd510fca742c36a.tar.xz
plymouth-4cf3e3ae2d9062f727dca72c9dd510fca742c36a.zip
Simplify plugin interface by dropping attach_to_event_loop
Now we just pass the loop in directly to show and hide, which makes its lifecycle more clear.
Diffstat (limited to 'src/splash-plugins/details')
-rw-r--r--src/splash-plugins/details/details.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/splash-plugins/details/details.c b/src/splash-plugins/details/details.c
index 6eca872..30c9bf9 100644
--- a/src/splash-plugins/details/details.c
+++ b/src/splash-plugins/details/details.c
@@ -78,8 +78,17 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
free (plugin);
}
+static void
+detach_from_event_loop (ply_boot_splash_plugin_t *plugin)
+{
+ plugin->loop = NULL;
+
+ ply_trace ("detaching from event loop");
+}
+
bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
+ ply_event_loop_t *loop,
ply_window_t *window,
ply_buffer_t *boot_buffer)
{
@@ -87,6 +96,12 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
assert (plugin != NULL);
+ plugin->loop = loop;
+
+ ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
+ detach_from_event_loop,
+ plugin);
+
size = ply_buffer_get_size (boot_buffer);
if (size > 0)
@@ -115,16 +130,9 @@ on_boot_output (ply_boot_splash_plugin_t *plugin,
write (STDOUT_FILENO, output, size);
}
-static void
-detach_from_event_loop (ply_boot_splash_plugin_t *plugin)
-{
- plugin->loop = NULL;
-
- ply_trace ("detaching from event loop");
-}
-
void
hide_splash_screen (ply_boot_splash_plugin_t *plugin,
+ ply_event_loop_t *loop,
ply_window_t *window)
{
assert (plugin != NULL);
@@ -138,19 +146,6 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
detach_from_event_loop (plugin);
}
-void
-attach_to_event_loop (ply_boot_splash_plugin_t *plugin,
- ply_event_loop_t *loop)
-{
- ply_trace ("attaching to event loop");
-
- plugin->loop = loop;
-
- ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
- detach_from_event_loop,
- plugin);
-}
-
char *
ask_for_password (ply_boot_splash_plugin_t *plugin)
{
@@ -196,7 +191,6 @@ ply_boot_splash_plugin_get_interface (void)
.update_status = update_status,
.on_boot_output = on_boot_output,
.hide_splash_screen = hide_splash_screen,
- .attach_to_event_loop = attach_to_event_loop,
.ask_for_password = ask_for_password,
.on_keyboard_input = on_keyboard_input
};