]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
pass keyboard input on to plugins
authorRay Strode <rstrode@redhat.com>
Mon, 19 May 2008 02:57:15 +0000 (22:57 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 19 May 2008 02:57:15 +0000 (22:57 -0400)
src/ply-boot-splash-plugin.h
src/ply-boot-splash.c
src/splash-plugins/fedora-fade-in/fedora-fade-in.c
src/splash-plugins/text/text.c

index 789c4781962c81345ea1d36f5fda5a241c19741a..78fb3c56166fadd6b40d7c55fbac5af2fb1e0ed4 100644 (file)
@@ -46,6 +46,8 @@ typedef struct
                                  ply_event_loop_t         *loop);
 
   char * (* ask_for_password) (ply_boot_splash_plugin_t *plugin);
+  void (* on_keyboard_input) (ply_boot_splash_plugin_t *plugin,
+                              const char               *keyboard_input);
 
 } ply_boot_splash_plugin_interface_t;
 
index 9cc9ba5d56dcd54160e704115056c7ab793747e4..e17f204d870babfda72043871e0f53e090e5a766 100644 (file)
@@ -143,11 +143,20 @@ ply_boot_splash_unload_plugin (ply_boot_splash_t *splash)
   splash->module_handle = NULL;
 }
 
+static void
+on_keyboard_input (ply_boot_splash_t *splash,
+                   const char        *key)
+{
+  if (splash->plugin_interface->on_keyboard_input != NULL)
+    splash->plugin_interface->on_keyboard_input (splash->plugin, key);
+}
+
 static bool
 ply_boot_splash_create_window (ply_boot_splash_t *splash)
 {
   splash->window = ply_window_new ("/dev/tty1",
-                                   NULL, NULL);
+                                   (ply_window_keyboard_input_handler_t)
+                                   on_keyboard_input, splash);
 
   if (!ply_window_open (splash->window))
     {
index 4ca1859ecb07e9aa04ab66846e5021ba34a64f8f..7d457006598272be8df5761d98bd3986fa776abe 100644 (file)
@@ -462,6 +462,12 @@ attach_to_event_loop (ply_boot_splash_plugin_t *plugin,
                                  plugin); 
 }
 
+void
+on_keyboard_input (ply_boot_splash_plugin_t *plugin,
+                   const char               *keyboard_input)
+{
+}
+
 ply_boot_splash_plugin_interface_t *
 ply_boot_splash_plugin_get_interface (void)
 {
@@ -472,7 +478,8 @@ ply_boot_splash_plugin_get_interface (void)
       .show_splash_screen = show_splash_screen,
       .update_status = update_status,
       .hide_splash_screen = hide_splash_screen,
-      .attach_to_event_loop = attach_to_event_loop
+      .attach_to_event_loop = attach_to_event_loop,
+      .on_keyboard_input = on_keyboard_input
     };
 
   return &plugin_interface;
index c934c1b6e897806060613766571dd4cb8ea9577d..ad00bfa5d2167ff0bd0db59858dc6f605069042e 100644 (file)
@@ -180,6 +180,12 @@ ask_for_password (ply_boot_splash_plugin_t *plugin)
   return strdup (answer);
 }
 
+void
+on_keyboard_input (ply_boot_splash_plugin_t *plugin,
+                   const char               *keyboard_input)
+{
+}
+
 ply_boot_splash_plugin_interface_t *
 ply_boot_splash_plugin_get_interface (void)
 {
@@ -192,6 +198,7 @@ ply_boot_splash_plugin_get_interface (void)
       .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
     };
 
   return &plugin_interface;