Exemplo n.º 1
0
static bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
                    ply_event_loop_t         *loop,
                    ply_buffer_t             *boot_buffer,
                    ply_boot_splash_mode_t    mode)
{
  assert (plugin != NULL);

  plugin->loop = loop;
  plugin->mode = mode;

  ply_trace ("loading lock image");
  if (!ply_image_load (plugin->lock_image))
    return false;

  ply_trace ("loading box image");
  if (!ply_image_load (plugin->box_image))
    return false;

  if (plugin->corner_image != NULL)
    {
      ply_trace ("loading corner image");

      if (!ply_image_load (plugin->corner_image))
        {
          ply_image_free (plugin->corner_image);
          plugin->corner_image = NULL;
        }
    }

  if (!load_views (plugin))
    {
      ply_trace ("couldn't load views");
      return false;
    }

  ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
                                 detach_from_event_loop,
                                 plugin);

  ply_event_loop_watch_signal (plugin->loop,
                               SIGINT,
                               (ply_event_handler_t)
                               on_interrupt, plugin);

  ply_trace ("starting boot animation");
  start_progress_animation (plugin);

  plugin->is_visible = true;

  return true;
}
Exemplo n.º 2
0
bool
ply_entry_load (ply_entry_t *entry)
{
        if (!ply_image_load (entry->text_field_image))
                return false;

        if (!ply_image_load (entry->bullet_image))
                return false;

        entry->area.width = ply_image_get_width (entry->text_field_image);
        entry->area.height = ply_image_get_height (entry->text_field_image);

        entry->max_number_of_visible_bullets = get_max_number_of_visible_bullets (entry);

        return true;
}
Exemplo n.º 3
0
static bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
                    ply_event_loop_t         *loop,
                    ply_buffer_t             *boot_buffer,
                    ply_boot_splash_mode_t    mode)
{
        assert (plugin != NULL);
        assert (plugin->logo_image != NULL);

        plugin->loop = loop;
        plugin->mode = mode;

        ply_trace ("loading logo image");
        if (!ply_image_load (plugin->logo_image))
                return false;

        ply_trace ("loading star image");
        if (!ply_image_load (plugin->star_image))
                return false;

        ply_trace ("loading lock image");
        if (!ply_image_load (plugin->lock_image))
                return false;

        ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
                                       detach_from_event_loop,
                                       plugin);

        if (!load_views (plugin)) {
                ply_trace ("couldn't load views");
                return false;
        }

        ply_trace ("starting boot animation");
        start_animation (plugin);

        return true;
}
Exemplo n.º 4
0
static bool
ply_progress_animation_add_frame (ply_progress_animation_t *progress_animation,
                                  const char               *filename)
{
        ply_image_t *image;

        image = ply_image_new (filename);

        if (!ply_image_load (image)) {
                ply_image_free (image);
                return false;
        }

        ply_array_add_pointer_element (progress_animation->frames, image);

        progress_animation->area.width = MAX (progress_animation->area.width, (size_t) ply_image_get_width (image));
        progress_animation->area.height = MAX (progress_animation->area.height, (size_t) ply_image_get_height (image));

        return true;
}
Exemplo n.º 5
0
static bool
ply_throbber_add_frame (ply_throbber_t *throbber,
                    const char *filename)
{
  ply_image_t *image;

  image = ply_image_new (filename);

  if (!ply_image_load (image))
    {
      ply_image_free (image);
      return false;
    }

  ply_array_add_element (throbber->frames, image);

  throbber->width = MAX (throbber->width, ply_image_get_width (image));
  throbber->height = MAX (throbber->height, ply_image_get_height (image));

  return true;
}
Exemplo n.º 6
0
static bool
ply_animation_add_frame (ply_animation_t *animation,
                         const char      *filename)
{
  ply_image_t *image;

  image = ply_image_new (filename);

  if (!ply_image_load (image))
    {
      ply_image_free (image);
      return false;
    }

  ply_array_add_element (animation->frames, image);

  animation->width = MAX (animation->width, ply_image_get_width (image));
  animation->height = MAX (animation->height, ply_image_get_height (image));

  return true;
}
Exemplo n.º 7
0
static bool
ply_throbber_add_frame (ply_throbber_t *throbber,
                        const char     *filename)
{
        ply_image_t *image;
        ply_pixel_buffer_t *frame;

        image = ply_image_new (filename);

        if (!ply_image_load (image)) {
                ply_image_free (image);
                return false;
        }

        frame = ply_image_convert_to_pixel_buffer (image);

        ply_array_add_pointer_element (throbber->frames, frame);

        throbber->width = MAX (throbber->width, (long) ply_pixel_buffer_get_width (frame));
        throbber->height = MAX (throbber->height, (long) ply_pixel_buffer_get_height (frame));

        return true;
}