diff options
| author | Ray Strode <rstrode@redhat.com> | 2008-05-18 22:57:15 -0400 |
|---|---|---|
| committer | Ray Strode <rstrode@redhat.com> | 2008-05-18 22:57:15 -0400 |
| commit | ea56f6e68cfc42ca165d1964e4410739b519879b (patch) | |
| tree | 10246c7fc63ca3be2fce8ed121005ca4ab58760d /src | |
| parent | 6b0f2e44af979924711786e6966cbb974409e799 (diff) | |
| download | plymouth-ea56f6e68cfc42ca165d1964e4410739b519879b.tar.gz plymouth-ea56f6e68cfc42ca165d1964e4410739b519879b.tar.xz plymouth-ea56f6e68cfc42ca165d1964e4410739b519879b.zip | |
pass keyboard input on to plugins
Diffstat (limited to 'src')
| -rw-r--r-- | src/ply-boot-splash-plugin.h | 2 | ||||
| -rw-r--r-- | src/ply-boot-splash.c | 11 | ||||
| -rw-r--r-- | src/splash-plugins/fedora-fade-in/fedora-fade-in.c | 9 | ||||
| -rw-r--r-- | src/splash-plugins/text/text.c | 7 |
4 files changed, 27 insertions, 2 deletions
diff --git a/src/ply-boot-splash-plugin.h b/src/ply-boot-splash-plugin.h index 789c478..78fb3c5 100644 --- a/src/ply-boot-splash-plugin.h +++ b/src/ply-boot-splash-plugin.h @@ -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; diff --git a/src/ply-boot-splash.c b/src/ply-boot-splash.c index 9cc9ba5..e17f204 100644 --- a/src/ply-boot-splash.c +++ b/src/ply-boot-splash.c @@ -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)) { diff --git a/src/splash-plugins/fedora-fade-in/fedora-fade-in.c b/src/splash-plugins/fedora-fade-in/fedora-fade-in.c index 4ca1859..7d45700 100644 --- a/src/splash-plugins/fedora-fade-in/fedora-fade-in.c +++ b/src/splash-plugins/fedora-fade-in/fedora-fade-in.c @@ -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; diff --git a/src/splash-plugins/text/text.c b/src/splash-plugins/text/text.c index c934c1b..ad00bfa 100644 --- a/src/splash-plugins/text/text.c +++ b/src/splash-plugins/text/text.c @@ -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; |
