예제 #1
0
static ply_boot_splash_plugin_t *
create_plugin (ply_key_file_t *key_file)
{
  ply_boot_splash_plugin_t *plugin;
  plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
  plugin->image_dir = ply_key_file_get_value (key_file, 
                                              "script",
                                              "ImageDir");
  plugin->script_filename = ply_key_file_get_value (key_file,
                                                    "script",
                                                    "ScriptFile");
  plugin->displays = ply_list_new ();
  return plugin;
}
예제 #2
0
static ply_boot_splash_plugin_t *
create_plugin (ply_key_file_t *key_file)
{
  ply_boot_splash_plugin_t *plugin;
  char *image_dir, *image_path;

  srand ((int) ply_get_timestamp ());
  plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));

  plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
  image_dir = ply_key_file_get_value (key_file, "throbgress", "ImageDir");

  asprintf (&image_path, "%s/lock.png", image_dir);
  plugin->lock_image = ply_image_new (image_path);
  free (image_path);

  asprintf (&image_path, "%s/box.png", image_dir);
  plugin->box_image = ply_image_new (image_path);
  free (image_path);

  plugin->image_dir = image_dir;
  plugin->views = ply_list_new ();

  return plugin;
}
예제 #3
0
파일: plugin.c 프로젝트: magcius/plymouth
static ply_boot_splash_plugin_t *
create_plugin (ply_key_file_t *key_file)
{
        ply_boot_splash_plugin_t *plugin;
        char *image_dir, *image_path;

        srand ((int) ply_get_timestamp ());
        plugin = calloc (1, sizeof(ply_boot_splash_plugin_t));
        plugin->start_time = 0.0;

        plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
        image_dir = ply_key_file_get_value (key_file, "fade-throbber", "ImageDir");

        asprintf (&image_path, "%s/star.png", image_dir);
        plugin->star_image = ply_image_new (image_path);
        free (image_path);

        asprintf (&image_path, "%s/lock.png", image_dir);
        plugin->lock_image = ply_image_new (image_path);
        free (image_path);

        plugin->image_dir = image_dir;

        plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
        plugin->views = ply_list_new ();

        return plugin;
}
예제 #4
0
파일: plugin.c 프로젝트: halfline/plymouth
static ply_boot_splash_plugin_t *
create_plugin (ply_key_file_t *key_file)
{
        ply_boot_splash_plugin_t *plugin;
        char *image_dir, *image_path;
        char *color;

        srand ((int) ply_get_timestamp ());
        plugin = calloc (1, sizeof(ply_boot_splash_plugin_t));

        plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
        image_dir = ply_key_file_get_value (key_file, "throbgress", "ImageDir");

        asprintf (&image_path, "%s/lock.png", image_dir);
        plugin->lock_image = ply_image_new (image_path);
        free (image_path);

        asprintf (&image_path, "%s/box.png", image_dir);
        plugin->box_image = ply_image_new (image_path);
        free (image_path);

        plugin->image_dir = image_dir;
        plugin->views = ply_list_new ();

        color = ply_key_file_get_value (key_file, "throbgress", "BackgroundStartColor");

        if (color != NULL)
                plugin->background_start_color = strtol (color, NULL, 0);
        else
                plugin->background_start_color = PLYMOUTH_BACKGROUND_START_COLOR;

        free (color);

        color = ply_key_file_get_value (key_file, "throbgress", "BackgroundEndColor");

        if (color != NULL)
                plugin->background_end_color = strtol (color, NULL, 0);
        else
                plugin->background_end_color = PLYMOUTH_BACKGROUND_END_COLOR;

        free (color);

        return plugin;
}
예제 #5
0
static ply_boot_splash_plugin_t *
create_plugin (ply_key_file_t *key_file)
{
  char *option;

  ply_boot_splash_plugin_t *plugin;

  ply_trace ("creating plugin");

  plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
  plugin->message = NULL;

  plugin->views = ply_list_new ();

  /* Not a pretty API for setting defaults for your config file... */
  plugin->black = 0x0075bf;/*0x2c001e;*/
  plugin->white = 0xffffff;/*0xffffff;*/
  plugin->brown = 0xa1bbcf;/*0xff4012;*/
  plugin->blue  = 0xa1bbcf;/*0x988592;*/

  option = ply_key_file_get_value (key_file, "ubuntu-text", "black");
  if (option)
    sscanf(option, "0x%x", &plugin->black);
  option = ply_key_file_get_value (key_file, "ubuntu-text", "white");
  if (option)
    sscanf(option, "0x%x", &plugin->white);
  option = ply_key_file_get_value (key_file, "ubuntu-text", "brown");
  if (option)
    sscanf(option, "0x%x", &plugin->brown);
  option = ply_key_file_get_value (key_file, "ubuntu-text", "blue");
  if (option)
    sscanf(option, "0x%x", &plugin->blue);

  plugin->title = ply_key_file_get_value (key_file, "ubuntu-text", "title");

  return plugin;
}
예제 #6
0
static ply_boot_splash_plugin_t *
create_plugin (ply_key_file_t *key_file)
{
  ply_boot_splash_plugin_t *plugin;
  char *image_dir, *image_path;
  char *alignment;
  char *transition;
  char *transition_duration;
  char *color;

  srand ((int) ply_get_timestamp ());
  plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));

  image_dir = ply_key_file_get_value (key_file, "two-step", "ImageDir");

  asprintf (&image_path, "%s/lock.png", image_dir);
  plugin->lock_image = ply_image_new (image_path);
  free (image_path);

  asprintf (&image_path, "%s/box.png", image_dir);
  plugin->box_image = ply_image_new (image_path);
  free (image_path);

  asprintf (&image_path, "%s/corner-image.png", image_dir);
  plugin->corner_image = ply_image_new (image_path);
  free (image_path);

  plugin->animation_dir = image_dir;

  alignment = ply_key_file_get_value (key_file, "two-step", "HorizontalAlignment");
  if (alignment != NULL)
    plugin->animation_horizontal_alignment = strtod (alignment, NULL);
  else
    plugin->animation_horizontal_alignment = .5;
  free (alignment);

  alignment = ply_key_file_get_value (key_file, "two-step", "VerticalAlignment");
  if (alignment != NULL)
    plugin->animation_vertical_alignment = strtod (alignment, NULL);
  else
    plugin->animation_vertical_alignment = .5;
  free (alignment);

  plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_NONE;
  transition = ply_key_file_get_value (key_file, "two-step", "Transition");
  if (transition != NULL)
    {
      if (strcmp (transition, "fade-over") == 0)
        plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_FADE_OVER;
      else if (strcmp (transition, "cross-fade") == 0)
        plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_CROSS_FADE;
      else if (strcmp (transition, "merge-fade") == 0)
        plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_MERGE_FADE;
    }
  free (transition);

  transition_duration = ply_key_file_get_value (key_file, "two-step", "TransitionDuration");
  if (transition_duration != NULL)
    plugin->transition_duration = strtod (transition_duration, NULL);
  else
    plugin->transition_duration = 0.0;
  free (transition_duration);

  color = ply_key_file_get_value (key_file, "two-step", "BackgroundStartColor");

  if (color != NULL)
    plugin->background_start_color = strtol (color, NULL, 0);
  else
    plugin->background_start_color = PLYMOUTH_BACKGROUND_START_COLOR;

  free (color);

  color = ply_key_file_get_value (key_file, "two-step", "BackgroundEndColor");

  if (color != NULL)
    plugin->background_end_color = strtol (color, NULL, 0);
  else
    plugin->background_end_color = PLYMOUTH_BACKGROUND_END_COLOR;

  free (color);

  plugin->views = ply_list_new ();

  return plugin;
}