]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Replace ply-answer with a ply-trigger
authorRay Strode <rstrode@redhat.com>
Thu, 25 Sep 2008 04:03:53 +0000 (00:03 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 29 Sep 2008 03:40:27 +0000 (23:40 -0400)
They were basically the same thing, so no reason
to have duplicated code.

13 files changed:
src/libplybootsplash/Makefile.am
src/libplybootsplash/ply-answer.c [deleted file]
src/libplybootsplash/ply-answer.h [deleted file]
src/libplybootsplash/ply-boot-splash-plugin.h
src/main.c
src/plugins/splash/details/plugin.c
src/plugins/splash/fade-in/plugin.c
src/plugins/splash/spinfinity/plugin.c
src/plugins/splash/text/plugin.c
src/ply-boot-server.c
src/ply-boot-server.h
src/ply-boot-splash.c
src/ply-boot-splash.h

index 59412273f503fac77334dee07047693b3645fd63..44d06e029b55273f3c6edadbbe8edacb427d4259 100644 (file)
@@ -6,7 +6,7 @@ INCLUDES = -I$(top_srcdir)                                                    \
 lib_LTLIBRARIES = libplybootsplash.la
 
 libplybootsplashdir = $(includedir)/plymouth-1/plybootsplash
-libplybootsplash_HEADERS = ply-answer.h ply-entry.h ply-progress-bar.h ply-text-pulser.h ply-throbber.h ply-window.h ply-label.h ply-boot-splash-plugin.h ply-label-plugin.h
+libplybootsplash_HEADERS = ply-entry.h ply-progress-bar.h ply-text-pulser.h ply-throbber.h ply-window.h ply-label.h ply-boot-splash-plugin.h ply-label-plugin.h
 
 libplybootsplash_la_CFLAGS = $(PLYMOUTH_CFLAGS)                               \
                              -DPLYMOUTH_BACKGROUND_COLOR=$(background_color)   \
@@ -19,7 +19,6 @@ libplybootsplash_la_LDFLAGS = -export-symbols-regex '^[^_].*' \
                    -no-undefined
 libplybootsplash_la_SOURCES = \
                    $(libplybootsplash_HEADERS)                              \
-                   ply-answer.c                                             \
                    ply-entry.c                                              \
                    ply-label.c                                              \
                    ply-progress-bar.c                                       \
diff --git a/src/libplybootsplash/ply-answer.c b/src/libplybootsplash/ply-answer.c
deleted file mode 100644 (file)
index 1cd9022..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/* ply-answer.h - Object that takes a string and triggers a closure
- *                to use the string
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * Written by: Ray Strode <rstrode@redhat.com>
- */
-#include "config.h"
-#include "ply-answer.h"
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "ply-logger.h"
-#include "ply-utils.h"
-
-struct _ply_answer
-{
-  ply_answer_handler_t  handler;
-  void                 *user_data;
-  char                 *string;
-};
-
-ply_answer_t *
-ply_answer_new (ply_answer_handler_t  handler,
-                void                 *user_data)
-{
-  ply_answer_t *answer;
-
-  answer = calloc (1, sizeof (ply_answer_t));
-  answer->handler = handler;
-  answer->user_data = user_data;
-
-  return answer;
-}
-
-void
-ply_answer_free (ply_answer_t *answer)
-{
-  if (answer == NULL)
-    return;
-
-  free (answer->string);
-  free (answer);
-}
-
-void
-ply_answer_with_string (ply_answer_t *answer,
-                        const char   *string)
-{
-  assert (answer != NULL);
-
-  answer->string = strdup (string);
-
-  if (answer->handler != NULL)
-    answer->handler (answer->user_data, string, answer);
-}
-
-char *
-ply_answer_get_string (ply_answer_t *answer)
-{
-  return strdup (answer->string);
-}
-
-void
-ply_answer_unknown (ply_answer_t *answer)
-{
-  assert (answer != NULL);
-
-  if (answer->handler != NULL)
-    answer->handler (answer->user_data, NULL, answer);
-}
-
-#ifdef PLY_ANSWER_ENABLE_TEST
-
-#include <stdio.h>
-
-#include "ply-event-loop.h"
-#include "ply-answer.h"
-
-static void
-on_timeout (ply_answer_t     *answer,
-            ply_event_loop_t *loop)
-{
-  ply_event_loop_exit (loop, 0);
-}
-
-static void
-on_keypress (ply_answer_t *answer,
-             const char   *keyboard_input)
-{
-  printf ("key '%c' (0x%x) was pressed\n",
-          keyboard_input[0], (unsigned int) keyboard_input[0]);
-}
-
-int
-main (int    argc,
-      char **argv)
-{
-  ply_event_loop_t *loop;
-  ply_answer_t *answer;
-  int exit_code;
-  const char *tty_name;
-
-  exit_code = 0;
-
-  loop = ply_event_loop_new ();
-
-  if (argc > 1)
-    tty_name = argv[1];
-  else
-    tty_name = "/dev/tty1";
-
-  answer = ply_answer_new (tty_name);
-  ply_answer_attach_to_event_loop (answer, loop);
-  ply_answer_set_keyboard_input_handler (answer,
-                                         (ply_answer_keyboard_input_handler_t)
-                                         on_keypress, answer);
-
-  if (!ply_answer_open (answer))
-    {
-      ply_save_errno ();
-      perror ("could not open answer");
-      ply_restore_errno ();
-      return errno;
-    }
-
-  if (!ply_answer_set_mode (answer, PLY_ANSWER_MODE_TEXT))
-    {
-      ply_save_errno ();
-      perror ("could not set answer for graphics mode");
-      ply_restore_errno ();
-    }
-
-  ply_event_loop_watch_for_timeout (loop,
-                                    15.0,
-                                   (ply_event_loop_timeout_handler_t)
-                                   on_timeout,
-                                   answer);
-  exit_code = ply_event_loop_run (loop);
-
-  ply_answer_close (answer);
-  ply_answer_free (answer);
-
-  return exit_code;
-}
-
-#endif /* PLY_ANSWER_ENABLE_TEST */
-/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
diff --git a/src/libplybootsplash/ply-answer.h b/src/libplybootsplash/ply-answer.h
deleted file mode 100644 (file)
index cc25651..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ply-answer.h - Object that takes a string and triggers a closure
- *                to use the string
- *
- * Copyright (C) 2008 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * Written By: Ray Strode <rstrode@redhat.com>
- */
-#ifndef PLY_ANSWER_H
-#define PLY_ANSWER_H
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <unistd.h>
-
-#include "ply-buffer.h"
-#include "ply-event-loop.h"
-#include "ply-frame-buffer.h"
-
-typedef struct _ply_answer ply_answer_t;
-
-typedef void (* ply_answer_handler_t) (void         *user_data,
-                                       const char   *string,
-                                       ply_answer_t *answer);
-
-#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_answer_t *ply_answer_new (ply_answer_handler_t  handler,
-                              void                 *user_data);
-void ply_answer_free (ply_answer_t *answer);
-
-void ply_answer_with_string (ply_answer_t *answer,
-                             const char   *string);
-
-void ply_answer_unknown (ply_answer_t *answer);
-char *ply_answer_get_string (ply_answer_t *answer);
-#endif
-
-#endif /* PLY_ANSWER_H */
-/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
index c5f3554786edaa53e8b563b30cfd1d43b9a9ae56..458cfc9de4f5a38f2cddc23fd7b3e3406b4c65a7 100644 (file)
@@ -26,7 +26,6 @@
 #include <stdint.h>
 #include <unistd.h>
 
-#include "ply-answer.h"
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
 #include "ply-trigger.h"
@@ -60,7 +59,7 @@ typedef struct
 
   void (* ask_for_password) (ply_boot_splash_plugin_t *plugin,
                              const char               *prompt,
-                             ply_answer_t             *answer);
+                             ply_trigger_t            *answer);
   void (* become_idle) (ply_boot_splash_plugin_t       *plugin,
                         ply_trigger_t                  *idle_trigger);
 } ply_boot_splash_plugin_interface_t;
index 0cbf3d3204a01a110dcd6a3e30213549efbaed42..7c782c81351d1bfd185fc67207f3102d2122065b 100644 (file)
 
 #include <linux/kd.h>
 
-#include "ply-answer.h"
 #include "ply-boot-server.h"
 #include "ply-boot-splash.h"
 #include "ply-event-loop.h"
 #include "ply-logger.h"
 #include "ply-terminal-session.h"
+#include "ply-trigger.h"
 #include "ply-utils.h"
 
 #ifndef PLY_MAX_COMMAND_LINE_SIZE
@@ -137,13 +137,13 @@ show_default_splash (state_t *state)
 static void
 on_ask_for_password (state_t      *state,
                      const char   *prompt,
-                     ply_answer_t *answer)
+                     ply_trigger_t *answer)
 {
   if (state->boot_splash == NULL)
     {
       show_detailed_splash (state);
       if (state->boot_splash == NULL)
-        ply_answer_with_string (answer, "");
+        ply_trigger_pull (answer, "");
       return;
     }
 
index 4e3292ba6a7a6590920f845c6f2bbd10dd2525b3..7ae8253090208066b53dee8b24233883562e4b55 100644 (file)
@@ -40,7 +40,6 @@
 #include <wchar.h>
 #include <values.h>
 
-#include "ply-answer.h"
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
@@ -48,6 +47,7 @@
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
 #include "ply-image.h"
+#include "ply-trigger.h"
 #include "ply-utils.h"
 #include "ply-window.h"
 
 
 void ask_for_password (ply_boot_splash_plugin_t *plugin,
                        const char               *prompt,
-                       ply_answer_t             *answer);
+                       ply_trigger_t            *answer);
 
 ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void);
 struct _ply_boot_splash_plugin
 {
   ply_event_loop_t *loop;
 
-  ply_answer_t *pending_password_answer;
+  ply_trigger_t *pending_password_answer;
   ply_window_t *window;
 
   uint32_t keyboard_input_is_hidden : 1;
@@ -125,7 +125,7 @@ on_enter (ply_boot_splash_plugin_t *plugin,
 {
   if (plugin->pending_password_answer != NULL)
     {
-      ply_answer_with_string (plugin->pending_password_answer, line);
+      ply_trigger_pull (plugin->pending_password_answer, line);
       plugin->keyboard_input_is_hidden = false;
       plugin->pending_password_answer = NULL;
       write (STDOUT_FILENO, CLEAR_LINE_SEQUENCE, strlen (CLEAR_LINE_SEQUENCE));
@@ -220,7 +220,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
 
   if (plugin->pending_password_answer != NULL)
     {
-      ply_answer_with_string (plugin->pending_password_answer, "");
+      ply_trigger_pull (plugin->pending_password_answer, "");
       plugin->pending_password_answer = NULL;
       plugin->keyboard_input_is_hidden = false;
     }
@@ -239,7 +239,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
 void
 ask_for_password (ply_boot_splash_plugin_t *plugin,
                   const char               *prompt,
-                  ply_answer_t             *answer)
+                  ply_trigger_t            *answer)
 {
   plugin->pending_password_answer = answer;
 
index e91dc3bd7042677a61fc46d38f3e97ae8433f1f6..3dda09f805ecbd8d85efeeb711dd673e6fb88c5f 100644 (file)
@@ -39,7 +39,6 @@
 #include <unistd.h>
 #include <wchar.h>
 
-#include "ply-answer.h"
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-entry.h"
@@ -48,6 +47,7 @@
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
 #include "ply-image.h"
+#include "ply-trigger.h"
 #include "ply-utils.h"
 #include "ply-window.h"
 
@@ -77,7 +77,7 @@ struct _ply_boot_splash_plugin
 
   ply_entry_t *entry;
 
-  ply_answer_t *pending_password_answer;
+  ply_trigger_t *pending_password_answer;
 
   double start_time;
   double now;
@@ -387,7 +387,7 @@ on_enter (ply_boot_splash_plugin_t *plugin,
   if (plugin->pending_password_answer == NULL)
     return;
 
-  ply_answer_with_string (plugin->pending_password_answer, text);
+  ply_trigger_pull (plugin->pending_password_answer, text);
   plugin->pending_password_answer = NULL;
 
   ply_entry_hide (plugin->entry);
@@ -598,7 +598,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
 
   if (plugin->pending_password_answer != NULL)
     {
-      ply_answer_with_string (plugin->pending_password_answer, "");
+      ply_trigger_pull (plugin->pending_password_answer, "");
       plugin->pending_password_answer = NULL;
     }
 
@@ -651,7 +651,7 @@ show_password_entry (ply_boot_splash_plugin_t *plugin)
 void
 ask_for_password (ply_boot_splash_plugin_t *plugin,
                   const char               *prompt,
-                  ply_answer_t             *answer)
+                  ply_trigger_t            *answer)
 {
   plugin->pending_password_answer = answer;
 
index ad05d068678afcd7f3ee004ff78887dcb813d434..02acb68baddd5f488c94625d698b439467570234 100644 (file)
@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <wchar.h>
 
-#include "ply-answer.h"
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-entry.h"
@@ -51,6 +50,7 @@
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
 #include "ply-image.h"
+#include "ply-trigger.h"
 #include "ply-utils.h"
 #include "ply-window.h"
 
@@ -91,7 +91,7 @@ struct _ply_boot_splash_plugin
   double start_time;
   double wait_time;
 
-  ply_answer_t *pending_password_answer;
+  ply_trigger_t *pending_password_answer;
   ply_trigger_t *idle_trigger;
 
   uint32_t root_is_mounted : 1;
@@ -348,7 +348,7 @@ on_enter (ply_boot_splash_plugin_t *plugin,
   if (plugin->pending_password_answer == NULL)
     return;
 
-  ply_answer_with_string (plugin->pending_password_answer, text);
+  ply_trigger_pull (plugin->pending_password_answer, text);
   plugin->pending_password_answer = NULL;
 
   ply_entry_hide (plugin->entry);
@@ -506,7 +506,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
 
   if (plugin->pending_password_answer != NULL)
     {
-      ply_answer_with_string (plugin->pending_password_answer, "");
+      ply_trigger_pull (plugin->pending_password_answer, "");
       plugin->pending_password_answer = NULL;
     }
 
@@ -595,7 +595,7 @@ show_password_prompt (ply_boot_splash_plugin_t *plugin,
 void
 ask_for_password (ply_boot_splash_plugin_t *plugin,
                   const char               *prompt,
-                  ply_answer_t             *answer)
+                  ply_trigger_t            *answer)
 {
   plugin->pending_password_answer = answer;
   plugin->wait_time = ply_get_timestamp ();
index 23bcc1f654a0c3c7c06fa12db33afb3480c93b20..d46ef349df3cb551245f99e49cfd474d0610a64b 100644 (file)
@@ -40,7 +40,7 @@
 #include <values.h>
 #include <wchar.h>
 
-#include "ply-answer.h"
+#include "ply-trigger.h"
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
@@ -61,7 +61,7 @@ struct _ply_boot_splash_plugin
 {
   ply_event_loop_t *loop;
 
-  ply_answer_t *pending_password_answer;
+  ply_trigger_t *pending_password_answer;
   ply_window_t *window;
 
   ply_text_pulser_t *pulser;
@@ -176,7 +176,7 @@ on_enter (ply_boot_splash_plugin_t *plugin,
 {
   if (plugin->pending_password_answer != NULL)
     {
-      ply_answer_with_string (plugin->pending_password_answer, line);
+      ply_trigger_pull (plugin->pending_password_answer, line);
       plugin->keyboard_input_is_hidden = false;
       plugin->pending_password_answer = NULL;
 
@@ -272,7 +272,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
 
   if (plugin->pending_password_answer != NULL)
     {
-      ply_answer_with_string (plugin->pending_password_answer, "");
+      ply_trigger_pull (plugin->pending_password_answer, "");
       plugin->pending_password_answer = NULL;
     }
 
@@ -305,7 +305,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
 void
 ask_for_password (ply_boot_splash_plugin_t *plugin,
                   const char               *prompt,
-                  ply_answer_t             *answer)
+                  ply_trigger_t            *answer)
 {
   int window_width, window_height;
 
index eafdce816fa914ea9c386bb31eb0cc55a76153b9..ff6ef29e765bcaabd2e7c83360e35c720ade608e 100644 (file)
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "ply-buffer.h"
 #include "ply-event-loop.h"
 #include "ply-list.h"
 #include "ply-logger.h"
+#include "ply-trigger.h"
 #include "ply-utils.h"
 
 typedef struct 
@@ -47,7 +49,7 @@ struct _ply_boot_server
 {
   ply_event_loop_t *loop;
   ply_list_t *connections;
-  ply_list_t *cached_answers;
+  ply_list_t *cached_passwords;
   int socket_fd;
 
   ply_boot_server_update_handler_t update_handler;
@@ -78,7 +80,7 @@ ply_boot_server_new (ply_boot_server_update_handler_t  update_handler,
 
   server = calloc (1, sizeof (ply_boot_server_t));
   server->connections = ply_list_new ();
-  server->cached_answers = ply_list_new ();
+  server->cached_passwords = ply_list_new ();
   server->loop = NULL;
   server->is_listening = false;
   server->update_handler = update_handler;
@@ -108,7 +110,7 @@ ply_boot_server_free (ply_boot_server_t *server)
       ply_boot_connection_on_hangup (connection);
     }
   ply_list_free (server->connections);
-  ply_list_free (server->cached_answers);
+  ply_list_free (server->cached_passwords);
   free (server);
 }
 
@@ -207,8 +209,7 @@ ply_boot_connection_is_from_root (ply_boot_connection_t *connection)
 
 static void
 ply_boot_connection_on_password_answer (ply_boot_connection_t *connection,
-                                        const char            *password,
-                                        ply_answer_t          *answer)
+                                        const char            *password)
 {
 
   uint8_t size;
@@ -240,9 +241,11 @@ ply_boot_connection_on_password_answer (ply_boot_connection_t *connection,
           !ply_write (connection->fd,
                       password, size))
           ply_error ("could not write bytes: %m");
+
+      ply_list_append_data (connection->server->cached_passwords,
+                            strdup (password));
     }
 
-  ply_list_append_data (connection->server->cached_answers, answer);
 }
 
 static void
@@ -312,9 +315,11 @@ ply_boot_connection_on_request (ply_boot_connection_t *connection)
     }
   else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD) == 0)
     {
-      ply_answer_t *answer;
+      ply_trigger_t *answer;
 
-      answer = ply_answer_new ((ply_answer_handler_t)
+      answer = ply_trigger_new (NULL);
+      ply_trigger_add_handler (answer,
+                               (ply_trigger_handler_t)
                                ply_boot_connection_on_password_answer,
                                connection);
 
@@ -337,7 +342,7 @@ ply_boot_connection_on_request (ply_boot_connection_t *connection)
 
       buffer = ply_buffer_new ();
 
-      node = ply_list_get_first_node (server->cached_answers);
+      node = ply_list_get_first_node (server->cached_passwords);
 
       /* Add each answer separated by their NUL terminators into
        * a buffer that we write out to the client
@@ -345,17 +350,14 @@ ply_boot_connection_on_request (ply_boot_connection_t *connection)
       while (node != NULL)
         {
           ply_list_node_t *next_node;
-          ply_answer_t *answer;
-          char *answer_string;
+          const char *password;
 
-          next_node = ply_list_get_next_node (server->cached_answers, node);
-          answer = ply_list_node_get_data (node);
-          answer_string = ply_answer_get_string (answer);
-          ply_buffer_append_bytes (buffer,
-                                   answer_string,
-                                   strlen (answer_string) + 1);
-          free (answer_string);
+          next_node = ply_list_get_next_node (server->cached_passwords, node);
+          password = (const char *) ply_list_node_get_data (node);
 
+          ply_buffer_append_bytes (buffer,
+                                   password,
+                                   strlen (password) + 1);
           node = next_node;
         }
 
index d9cf7224e3ad129c78eebdcbf1e38769b4e51de1..e685ad913290cafaf334fd72f8ac078b4d8df819 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdint.h>
 #include <unistd.h>
 
-#include "ply-answer.h"
+#include "ply-trigger.h"
 #include "ply-boot-protocol.h"
 #include "ply-event-loop.h"
 
@@ -51,7 +51,7 @@ typedef void (* ply_boot_server_password_answer_handler_t) (void              *a
                                                             ply_boot_server_t *server);
 typedef void (* ply_boot_server_ask_for_password_handler_t) (void              *user_data,
                                                              const char        *prompt,
-                                                             ply_answer_t      *answer,
+                                                             ply_trigger_t     *answer,
                                                              ply_boot_server_t *server);
 
 typedef void (* ply_boot_server_system_initialized_handler_t) (void              *user_data,
index 46bd21ab19eee8fb9629e0ccaf5abf96532ca37b..832491e6a1ed031df542c3e4a1ac49920c8b08a4 100644 (file)
@@ -231,7 +231,7 @@ ply_boot_splash_root_mounted (ply_boot_splash_t *splash)
 void
 ply_boot_splash_ask_for_password (ply_boot_splash_t *splash,
                                   const char        *prompt,
-                                  ply_answer_t      *answer)
+                                  ply_trigger_t     *trigger)
 {
 
   assert (splash != NULL);
@@ -241,13 +241,13 @@ ply_boot_splash_ask_for_password (ply_boot_splash_t *splash,
 
   if (splash->plugin_interface->ask_for_password == NULL)
     {
-      ply_answer_unknown (answer);
+      ply_trigger_pull (trigger, NULL);
       return;
     }
 
   splash->plugin_interface->ask_for_password (splash->plugin,
                                               prompt,
-                                              answer);
+                                              trigger);
 }
 
 static void
index 5efa6785de31ec64b36210e439f264226fd763bc..057e626d5e1efada8bb56b3d5c8349801340dae0 100644 (file)
@@ -26,7 +26,6 @@
 #include <stdint.h>
 #include <unistd.h>
 
-#include "ply-answer.h"
 #include "ply-event-loop.h"
 #include "ply-window.h"
 #include "ply-buffer.h"
@@ -51,7 +50,7 @@ void ply_boot_splash_root_mounted (ply_boot_splash_t *splash);
 
 void ply_boot_splash_ask_for_password (ply_boot_splash_t *splash,
                                        const char        *prompt,
-                                       ply_answer_t      *answer);
+                                       ply_trigger_t     *answer);
 void ply_boot_splash_hide (ply_boot_splash_t *splash);
 void ply_boot_splash_attach_to_event_loop (ply_boot_splash_t *splash,
                                            ply_event_loop_t  *loop);