#include <unistd.h>
#include "ply-answer.h"
+#include "ply-buffer.h"
#include "ply-event-loop.h"
+#include "ply-trigger.h"
#include "ply-window.h"
-#include "ply-buffer.h"
typedef struct _ply_boot_splash_plugin ply_boot_splash_plugin_t;
void (* ask_for_password) (ply_boot_splash_plugin_t *plugin,
const char *prompt,
ply_answer_t *answer);
+ void (* become_idle) (ply_boot_splash_plugin_t *plugin,
+ ply_trigger_t *idle_trigger);
} ply_boot_splash_plugin_interface_t;
#endif /* PLY_BOOT_SPLASH_PLUGIN_H */
#include "ply-event-loop.h"
#include "ply-list.h"
#include "ply-logger.h"
+#include "ply-trigger.h"
#include "ply-utils.h"
struct _ply_boot_splash
ply_boot_splash_plugin_t *plugin;
ply_window_t *window;
ply_buffer_t *boot_buffer;
+ ply_trigger_t *idle_trigger;
char *module_name;
char *status;
splash);
}
+void
+ply_boot_splash_become_idle (ply_boot_splash_t *splash,
+ ply_boot_splash_on_idle_handler_t idle_handler,
+ void *user_data)
+{
+ assert (splash->idle_trigger == NULL);
+
+ if (splash->plugin_interface->become_idle == NULL)
+ {
+ idle_handler (user_data);
+ return;
+ }
+
+ splash->idle_trigger = ply_trigger_new ((ply_trigger_handler_t) idle_handler, user_data, &splash->idle_trigger);
+
+ splash->plugin_interface->become_idle (splash->plugin, splash->idle_trigger);
+}
+
#ifdef PLY_BOOT_SPLASH_ENABLE_TEST
#include <stdio.h>
typedef struct _ply_boot_splash ply_boot_splash_t;
+typedef void (* ply_boot_splash_on_idle_handler_t) (void *user_data);
+
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
ply_boot_splash_t *ply_boot_splash_new (const char *module_name,
ply_window_t *window,
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);
+void ply_boot_splash_become_idle (ply_boot_splash_t *splash,
+ ply_boot_splash_on_idle_handler_t idle_handler,
+ void *user_data);
+
#endif