Esempio n. 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);
}
Esempio n. 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;

        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,
                                                        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,
                                                        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);
        }
        ply_label_draw_area (view->message_label,
                             pixel_buffer,
                             x, y, width, height);
}
Esempio n. 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;

        plugin = view->plugin;

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

        if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
                draw_normal_view (view, pixel_buffer, x, y, width, height);
        else
                draw_prompt_view (view, pixel_buffer, x, y, width, height);

        ply_label_draw_area (view->message_label,
                             pixel_buffer,
                             x, y, width, height);
}
Esempio n. 4
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);

}
Esempio n. 5
0
void
ply_entry_draw_area (ply_entry_t        *entry,
                     ply_pixel_buffer_t *pixel_buffer,
                     long                x,
                     long                y,
                     unsigned long       width,
                     unsigned long       height)
{
  ply_rectangle_t     bullet_area;
  uint32_t *text_field_data, *bullet_data;
  int i, number_of_visible_bullets;

  if (entry->is_hidden)
    return;

  text_field_data = ply_image_get_data (entry->text_field_image);

  ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                          &entry->area, 0, 0,
                                          text_field_data);

  if (entry->is_password)
    {
      bullet_data = ply_image_get_data (entry->bullet_image);
      bullet_area.width = ply_image_get_width (entry->bullet_image);
      bullet_area.height = ply_image_get_height (entry->bullet_image);

      if (entry->number_of_bullets < entry->max_number_of_visible_bullets)
        number_of_visible_bullets = entry->number_of_bullets;
      else
        {
          number_of_visible_bullets = entry->max_number_of_visible_bullets;

          /* We've got more bullets than we can show in the available space, so
           * draw a little half bullet to indicate some bullets are offscreen
           */
          bullet_area.x = entry->area.x;
          bullet_area.y = entry->area.y + entry->area.height / 2.0 - bullet_area.height / 2.0;

          ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                                  &bullet_area, bullet_area.width / 2.0, 0,
                                                  bullet_data);
        }

      for (i = 0; i < number_of_visible_bullets; i++)
        {
          bullet_area.x = entry->area.x + i * bullet_area.width + bullet_area.width / 2.0;
          bullet_area.y = entry->area.y + entry->area.height / 2.0 - bullet_area.height / 2.0;

          ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
                                                  &bullet_area, 0, 0,
                                                  bullet_data);
        }
    }
  else
    {
      ply_label_set_text (entry->label, entry->text);
      ply_label_draw_area (entry->label, pixel_buffer,
                           entry->area.x, entry->area.y,
                           entry->area.width, entry->area.height);
    }
}
Esempio n. 6
0
void
ply_entry_draw_area (ply_entry_t        *entry,
                     ply_pixel_buffer_t *pixel_buffer,
                     long                x,
                     long                y,
                     unsigned long       width,
                     unsigned long       height)
{
        ply_rectangle_t bullet_area;
        ply_rectangle_t clip_area;
        ply_pixel_buffer_t *bullet_buffer, *text_field_buffer;
        int i, number_of_visible_bullets;

        if (entry->is_hidden)
                return;

        text_field_buffer = ply_image_get_buffer (entry->text_field_image);

        ply_pixel_buffer_fill_with_buffer (pixel_buffer,
                                           text_field_buffer,
                                           entry->area.x,
                                           entry->area.y);

        if (entry->is_password) {
                bullet_buffer = ply_image_get_buffer (entry->bullet_image);
                ply_pixel_buffer_get_size (bullet_buffer, &bullet_area);

                if (entry->number_of_bullets <= entry->max_number_of_visible_bullets) {
                        number_of_visible_bullets = entry->number_of_bullets;
                } else {
                        number_of_visible_bullets = entry->max_number_of_visible_bullets;

                        /* We've got more bullets than we can show in the available space, so
                         * draw a little half bullet to indicate some bullets are offscreen
                         */
                        bullet_area.x = entry->area.x - bullet_area.width / 2.0;
                        bullet_area.y = entry->area.y + entry->area.height / 2.0 - bullet_area.height / 2.0;
                        clip_area = bullet_area;
                        clip_area.x = entry->area.x;

                        ply_pixel_buffer_fill_with_buffer_with_clip (pixel_buffer,
                                                                     bullet_buffer,
                                                                     bullet_area.x,
                                                                     bullet_area.y,
                                                                     &clip_area);
                }

                for (i = 0; i < number_of_visible_bullets; i++) {
                        bullet_area.x = entry->area.x + i * bullet_area.width + bullet_area.width / 2.0;
                        bullet_area.y = entry->area.y + entry->area.height / 2.0 - bullet_area.height / 2.0;

                        ply_pixel_buffer_fill_with_buffer (pixel_buffer,
                                                           bullet_buffer,
                                                           bullet_area.x,
                                                           bullet_area.y);
                }
        } else {
                ply_label_set_text (entry->label, entry->text);
                ply_label_show (entry->label,
                                NULL,
                                entry->area.x,
                                entry->area.y + entry->area.height / 2
                                - ply_label_get_height (entry->label) / 2);
                ply_label_draw_area (entry->label, pixel_buffer,
                                     entry->area.x, entry->area.y,
                                     entry->area.width, entry->area.height);
        }
}