Beispiel #1
0
static void
boot_output (ply_boot_splash_plugin_t *plugin,
                const char *msg, size_t size)
{
  const char * p = msg;
  char buf[1024];
  size_t buf_len = 0;

  pause_displays (plugin);
  while((p - msg) < size) {
    if(*p != '\r' && *p != '\n') {
      /* append to buffer if has enough size */
      if(buffer_index < sizeof(buffer) - 1) {
        buffer[buffer_index] = *p;
        buffer_index ++;
      }
    } else {
      if(buffer_index != 0) {
        buffer[buffer_index] = 0;
        buf_len = clear_escape(buffer, buffer_index, buf, sizeof(buf) - 1);
        buf[buf_len] = 0;
        if(buf_len > 0) {
          script_lib_plymouth_on_display_boot_message (plugin->script_state,
                                               plugin->script_plymouth_lib,
                                               buf);
        }
        buffer_index = 0;
      }
    }
    p ++;
  }
  unpause_displays (plugin);
}
Beispiel #2
0
static void
display_normal (ply_boot_splash_plugin_t *plugin)
{
  pause_displays (plugin);
  script_lib_plymouth_on_display_normal (plugin->script_state,
                                         plugin->script_plymouth_lib);
  unpause_displays (plugin);
}
Beispiel #3
0
static void
display_message (ply_boot_splash_plugin_t *plugin,
                 const char               *message)
{
  pause_displays (plugin);
  script_lib_plymouth_on_message (plugin->script_state,
                                  plugin->script_plymouth_lib,
                                  message);
  unpause_displays (plugin);
}
Beispiel #4
0
static void
display_question (ply_boot_splash_plugin_t *plugin,
                  const char               *prompt,
                  const char               *entry_text)
{
  pause_displays (plugin);
  script_lib_plymouth_on_display_question (plugin->script_state,
                                           plugin->script_plymouth_lib,
                                           prompt,
                                           entry_text);
  unpause_displays (plugin);
}
Beispiel #5
0
static void
display_password (ply_boot_splash_plugin_t *plugin,
                  const char               *prompt,
                  int                       bullets)
{
  pause_displays (plugin);
  script_lib_plymouth_on_display_password (plugin->script_state,
                                           plugin->script_plymouth_lib,
                                           prompt,
                                           bullets);
  unpause_displays (plugin);
}
Beispiel #6
0
static void
on_timeout (ply_boot_splash_plugin_t *plugin)
{
  double sleep_time;

  sleep_time = 1.0 / FRAMES_PER_SECOND;
  ply_event_loop_watch_for_timeout (plugin->loop,
                                    sleep_time,
                                    (ply_event_loop_timeout_handler_t)
                                    on_timeout, plugin);

  script_lib_plymouth_on_refresh (plugin->script_state,
                                  plugin->script_plymouth_lib);
                                  
  pause_displays (plugin);
  script_lib_sprite_refresh (plugin->script_sprite_lib);
  unpause_displays (plugin);

}