Пример #1
0
static void
draw_prompt_view (view_t             *view,
                  ply_pixel_buffer_t *pixel_buffer,
                  int                 x,
                  int                 y,
                  int                 width,
                  int                 height)
{
        ply_boot_splash_plugin_t *plugin;
        uint32_t *lock_data;

        plugin = view->plugin;

        ply_entry_draw_area (view->entry,
                             pixel_buffer,
                             x, y, width, height);
        ply_label_draw_area (view->label,
                             pixel_buffer,
                             x, y, width, height);

        lock_data = ply_image_get_data (plugin->lock_image);
        ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                                &view->lock_area,
                                                lock_data);
}
Пример #2
0
static void
on_draw (view_t                   *view,
         ply_pixel_buffer_t       *pixel_buffer,
         int                       x,
         int                       y,
         int                       width,
         int                       height)
{
  ply_boot_splash_plugin_t *plugin;
  ply_rectangle_t area;

  area.x = x;
  area.y = y;
  area.width = width;
  area.height = height;

  plugin = view->plugin;

  draw_background (view, pixel_buffer, x, y, width, height);

  if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
      plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY  )
    {
      uint32_t *box_data, *lock_data;

      box_data = ply_image_get_data (plugin->box_image);
      ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                              &view->box_area, 0, 0,
                                              box_data);
      ply_entry_draw_area (view->entry, pixel_buffer, x, y, width, height);
      ply_label_draw_area (view->label, pixel_buffer, x, y, width, height);
      lock_data = ply_image_get_data (plugin->lock_image);
      ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                              &view->lock_area, 0, 0,
                                              lock_data);
    }
  else
    {
      draw_logo (view, pixel_buffer);
      ply_throbber_draw_area (view->throbber,
                              pixel_buffer, x, y, width, height);
      ply_progress_bar_draw_area (view->progress_bar,
                                  pixel_buffer, x, y, width, height);
    }
}
Пример #3
0
static void
on_draw (view_t                   *view,
         ply_pixel_buffer_t       *pixel_buffer,
         int                       x,
         int                       y,
         int                       width,
         int                       height)
{
  ply_boot_splash_plugin_t *plugin;
  ply_rectangle_t area;

  area.x = x;
  area.y = y;
  area.width = width;
  area.height = height;

  plugin = view->plugin;

  draw_background (view, pixel_buffer, x, y, width, height);

  if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
      plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY  )
    {
      uint32_t *box_data, *lock_data;

      box_data = ply_image_get_data (plugin->box_image);
      ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                              &view->box_area, 0, 0,
                                              box_data);

      ply_entry_draw_area (view->entry,
                           pixel_buffer,
                           x, y, width, height);
      ply_label_draw_area (view->label,
                           pixel_buffer,
                           x, y, width, height);

      lock_data = ply_image_get_data (plugin->lock_image);
      ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                              &view->lock_area, 0, 0,
                                              lock_data);
    }
  else
    {
      if (!ply_progress_animation_is_hidden (view->progress_animation))
        ply_progress_animation_draw_area (view->progress_animation,
                                          pixel_buffer,
                                          x, y, width, height);
      else if (!ply_animation_is_stopped (view->end_animation))
        ply_animation_draw_area (view->end_animation,
                                 pixel_buffer,
                                 x, y, width, height);

      if (plugin->corner_image != NULL)
        {
          ply_rectangle_t screen_area;
          ply_rectangle_t image_area;

          ply_pixel_buffer_get_size (pixel_buffer, &screen_area);

          image_area.width = ply_image_get_width (plugin->corner_image);
          image_area.height = ply_image_get_height (plugin->corner_image);
          image_area.x = screen_area.width - image_area.width - 20;
          image_area.y = screen_area.height - image_area.height - 20;

          ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &image_area, 0, 0, ply_image_get_data (plugin->corner_image));

        }
    }
  ply_label_draw_area (view->message_label,
                       pixel_buffer,
                       x, y, width, height);

}