Пример #1
0
void
ply_progress_free (ply_progress_t* progress)
{
  ply_list_node_t *node;
  node = ply_list_get_first_node (progress->current_message_list);

  while (node)
   {
      ply_list_node_t *next_node;
      ply_progress_message_t *message = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (progress->current_message_list, node);

      free (message->string);
      free (message);
      node = next_node;
    }
  ply_list_free (progress->current_message_list);

  node = ply_list_get_first_node (progress->previous_message_list);

  while (node)
   {
      ply_list_node_t *next_node;
      ply_progress_message_t *message = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (progress->previous_message_list, node);

      free (message->string);
      free (message);
      node = next_node;
    }
  ply_list_free (progress->previous_message_list);
  free(progress);
  return;
}
Пример #2
0
static void
destroy_plugin (ply_boot_splash_plugin_t *plugin)
{
  ply_list_node_t *node;
  script_env_var_t *env_var;

  if (plugin == NULL)
    return;

  if (plugin->loop != NULL)
    {
      stop_animation (plugin);
      ply_event_loop_stop_watching_for_exit (plugin->loop,
                                             (ply_event_loop_exit_handler_t)
                                             detach_from_event_loop,
                                             plugin);
      detach_from_event_loop (plugin);
    }

  for (node = ply_list_get_first_node (plugin->script_env_vars);
       node != NULL;
       node = ply_list_get_next_node (plugin->script_env_vars, node))
    {
      env_var = ply_list_node_get_data (node);
      free (env_var->key);
      free (env_var->value);
      free (env_var);
    }
  ply_list_free (plugin->script_env_vars);
  free (plugin->script_filename);
  free (plugin->image_dir);
  free (plugin);
}
Пример #3
0
static void
add_pixel_displays (ply_seat_t *seat)
{
        ply_list_t *heads;
        ply_list_node_t *node;

        heads = ply_renderer_get_heads (seat->renderer);

        ply_trace ("Adding displays for %d heads",
                   ply_list_get_length (heads));

        node = ply_list_get_first_node (heads);
        while (node != NULL) {
                ply_list_node_t *next_node;
                ply_renderer_head_t *head;
                ply_pixel_display_t *display;

                head = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (heads, node);

                display = ply_pixel_display_new (seat->renderer, head);

                ply_list_append_data (seat->pixel_displays, display);

                node = next_node;
        }
}
Пример #4
0
void
ply_trigger_free (ply_trigger_t *trigger)
{
  ply_list_node_t *node;

  if (trigger == NULL)
    return;

  node = ply_list_get_first_node (trigger->closures);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_trigger_closure_t *closure;

      closure = (ply_trigger_closure_t *) ply_list_node_get_data (node);

      next_node = ply_list_get_next_node (trigger->closures, node);

      free (closure);
      ply_list_remove_node (trigger->closures, node);

      node = next_node;
    }
  ply_list_free (trigger->closures);

  if (trigger->free_address != NULL)
    *trigger->free_address = NULL;

  if (trigger->free_address != NULL)
    *trigger->free_address = NULL;

  free (trigger);
}
Пример #5
0
static void
show_password_prompt (ply_boot_splash_plugin_t *plugin,
                      const char               *prompt,
                      int                       bullets)
{
        ply_list_node_t *node;
        int i;
        char *entered_text;

        entered_text = calloc (bullets + 1, sizeof(char));

        for (i = 0; i < bullets; i++) {
                entered_text[i] = '*';
        }

        node = ply_list_get_first_node (plugin->views);
        while (node != NULL) {
                ply_list_node_t *next_node;
                view_t *view;

                view = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (plugin->views, node);

                view_show_prompt (view, prompt, entered_text);

                node = next_node;
        }
        free (entered_text);
}
Пример #6
0
static void
on_boot_progress (ply_boot_splash_plugin_t *plugin,
                  double                    duration,
                  double                    percent_done)
{
  ply_list_node_t *node;
  double total_duration;

  total_duration = duration / percent_done;

  /* Fun made-up smoothing function to make the growth asymptotic:
   * fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
  percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);

  node = ply_list_get_first_node (plugin->views);

  while (node != NULL)
    {
      ply_list_node_t *next_node;
      view_t *view;

      view = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (plugin->views, node);

      ply_progress_bar_set_percent_done (view->progress_bar, percent_done);
      ply_progress_bar_draw (view->progress_bar);

      node = next_node;
    }
}
Пример #7
0
static bool
load_views (ply_boot_splash_plugin_t *plugin)
{
  ply_list_node_t *node;
  bool view_loaded;

  view_loaded = false;
  node = ply_list_get_first_node (plugin->views);

  while (node != NULL)
    {
      ply_list_node_t *next_node;
      view_t *view;

      view = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (plugin->views, node);

      if (view_load (view))
        view_loaded = true;

      node = next_node;
    }

  return view_loaded;
}
Пример #8
0
void
ply_terminal_stop_watching_for_active_vt_change (ply_terminal_t                          *terminal,
        ply_terminal_active_vt_changed_handler_t active_vt_changed_handler,
        void                                    *user_data)
{
    ply_list_node_t *node;

    if (!ply_terminal_is_vt (terminal))
        return;

    node = ply_list_get_first_node (terminal->vt_change_closures);
    while (node != NULL) {
        ply_terminal_active_vt_changed_closure_t *closure;
        ply_list_node_t *next_node;

        closure = ply_list_node_get_data (node);
        next_node = ply_list_get_next_node (terminal->vt_change_closures, node);

        if (closure->handler == active_vt_changed_handler &&
                closure->user_data == user_data) {
            free (closure);
            ply_list_remove_node (terminal->vt_change_closures, node);
        }

        node = next_node;
    }
}
Пример #9
0
static void
stop_animation (ply_boot_splash_plugin_t *plugin,
                ply_trigger_t            *trigger)
{
  ply_list_node_t *node;

  assert (plugin != NULL);
  assert (plugin->loop != NULL);

  if (!plugin->is_animating)
     return;

  plugin->is_animating = false;

  node = ply_list_get_first_node (plugin->views);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      view_t *view;

      view = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (plugin->views, node);

      ply_progress_bar_hide (view->progress_bar);
      if (trigger != NULL)
        ply_trigger_ignore_next_pull (trigger);
      ply_throbber_stop (view->throbber, trigger);

      node = next_node;
    }

  if (trigger != NULL)
    ply_trigger_pull (trigger, NULL);
}
Пример #10
0
static void
stop_animation (ply_boot_splash_plugin_t *plugin)
{
  ply_list_node_t *node;

  assert (plugin != NULL);
  assert (plugin->loop != NULL);

  if (!plugin->is_animating)
     return;

  plugin->is_animating = false;

  node = ply_list_get_first_node (plugin->views);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      view_t *view;

      view = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (plugin->views, node);

      node = next_node;
    }

  ply_event_loop_stop_watching_for_timeout (plugin->loop,
                                            (ply_event_loop_timeout_handler_t)
                                            on_timeout, plugin);

  redraw_views (plugin);
}
Пример #11
0
void
ply_trigger_pull (ply_trigger_t *trigger,
                  const void    *data)
{
  ply_list_node_t *node;

  assert (trigger != NULL);
  assert (trigger->ignore_count >= 0);

  if (trigger->ignore_count > 0)
    {
      trigger->ignore_count--;
      return;
    }

  node = ply_list_get_first_node (trigger->closures);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_trigger_closure_t *closure;

      closure = (ply_trigger_closure_t *) ply_list_node_get_data (node);

      next_node = ply_list_get_next_node (trigger->closures, node);

      closure->handler (closure->user_data, data, trigger);

      node = next_node;
    }

  if (trigger->free_address != NULL)
    ply_trigger_free (trigger);
}
Пример #12
0
static void
ply_boot_client_cancel_unsent_requests (ply_boot_client_t *client)
{
  ply_list_node_t *node;

  if (ply_list_get_length (client->requests_to_send) == 0)
      return;

  node = ply_list_get_first_node (client->requests_to_send);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_boot_client_request_t *request;

      request = (ply_boot_client_request_t *) ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (client->requests_to_send, node);

      ply_boot_client_cancel_request (client, request);
      ply_list_remove_node (client->requests_to_send, node);

      node = next_node;
    }

  if (client->daemon_can_take_request_watch != NULL)
    {
      assert (client->loop != NULL);

      ply_event_loop_stop_watching_fd (client->loop, 
                                       client->daemon_can_take_request_watch);
      client->daemon_can_take_request_watch = NULL;
    }
}
Пример #13
0
static void
start_animation (ply_boot_splash_plugin_t *plugin)
{
        ply_list_node_t *node;

        assert (plugin != NULL);
        assert (plugin->loop != NULL);

        redraw_views (plugin);

        if (plugin->message != NULL)
                show_message (plugin);

        if (plugin->is_animating)
                return;

        node = ply_list_get_first_node (plugin->views);
        while (node != NULL) {
                ply_list_node_t *next_node;
                view_t *view;

                view = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (plugin->views, node);

                view_start_animation (view);

                node = next_node;
        }

        plugin->is_animating = true;
}
Пример #14
0
static void
start_animation (ply_boot_splash_plugin_t *plugin)
{
        ply_list_node_t *node;

        if (plugin->is_animating)
                return;

        node = ply_list_get_first_node (plugin->views);
        while (node != NULL) {
                ply_list_node_t *next_node;
                view_t *view;

                view = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (plugin->views, node);

                view_start_animation (view);

                node = next_node;
        }

        plugin->is_animating = true;

        plugin->start_time = ply_get_timestamp ();
        animate_at_time (plugin, plugin->start_time);

        if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
                return;

        ply_event_loop_watch_for_timeout (plugin->loop,
                                          1.0 / FRAMES_PER_SECOND,
                                          (ply_event_loop_timeout_handler_t)
                                          on_timeout, plugin);
}
Пример #15
0
static void
activate (ply_renderer_backend_t *backend)
{
  ply_list_node_t *node;

  ply_trace ("taking master and scanning out");
  backend->is_active = true;

  drmSetMaster (backend->device_fd);
  node = ply_list_get_first_node (backend->heads);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_renderer_head_t *head;

      head = (ply_renderer_head_t *) ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (backend->heads, node);

      if (head->scan_out_buffer_id != 0)
        {
          /* Flush out any pending drawing to the buffer
           */
          flush_head (backend, head);

          /* Then send the buffer to the monitor
           */
          ply_renderer_head_set_scan_out_buffer (backend, head,
                                                 head->scan_out_buffer_id);
        }

      node = next_node;
    }
}
Пример #16
0
static bool
map_to_device (ply_renderer_backend_t *backend)
{
  ply_list_node_t *node;
  bool head_mapped;

  head_mapped = false;
  node = ply_list_get_first_node (backend->heads);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_renderer_head_t *head;

      head = (ply_renderer_head_t *) ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (backend->heads, node);

      if (ply_renderer_head_map (backend, head))
        head_mapped = true;

      node = next_node;
    }

  if (ply_terminal_is_active (backend->terminal))
    activate (backend);
  else
    ply_terminal_activate_vt (backend->terminal);

  return head_mapped;
}
Пример #17
0
static void
remove_pixel_display (ply_boot_splash_plugin_t *plugin,
                      ply_pixel_display_t      *display)
{
  ply_list_node_t *node;

  node = ply_list_get_first_node (plugin->views);
  while (node != NULL)
    {
      view_t *view;
      ply_list_node_t *next_node;

      view = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (plugin->views, node);

      if (view->display == display)
        {

          ply_pixel_display_set_draw_handler (view->display, NULL, NULL);
          view_free (view);
          ply_list_remove_node (plugin->views, node);
          return;
        }

      node = next_node;
    }
}
Пример #18
0
static void
unmap_from_device (ply_renderer_backend_t *backend)
{
  ply_list_node_t *node;
  bool should_set_to_black;

  /* We only copy what's on screen back to the fb console
   * if there's one head (since in multihead set ups the fb console
   * is cloned).
   */
  should_set_to_black = ply_list_get_length (backend->heads) > 1;

  node = ply_list_get_first_node (backend->heads);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_renderer_head_t *head;

      head = (ply_renderer_head_t *) ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (backend->heads, node);

      if (backend->is_active)
        {
          ply_trace ("scanning out %s directly to console",
                     should_set_to_black? "black" : "splash");
          ply_renderer_head_set_scan_out_buffer_to_console (backend, head,
                                                            should_set_to_black);
        }

      ply_renderer_head_unmap (backend, head);

      node = next_node;
    }
}
Пример #19
0
static void
activate (ply_renderer_backend_t *backend)
{
  ply_list_node_t *node;

  ply_trace ("taking master and scanning out");
  backend->is_active = true;

  drmSetMaster (backend->device_fd);
  node = ply_list_get_first_node (backend->heads);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_renderer_head_t *head;

      head = (ply_renderer_head_t *) ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (backend->heads, node);

      if (head->scan_out_buffer_id != 0)
        ply_renderer_head_set_scan_out_buffer (backend, head,
                                               head->scan_out_buffer_id);

      node = next_node;
    }
}
Пример #20
0
static void
start_animation (ply_boot_splash_plugin_t *plugin)
{
        ply_list_node_t *node;

        if (plugin->is_animating)
                return;

        ply_trace ("starting animation");

        node = ply_list_get_first_node (plugin->views);
        while (node != NULL) {
                ply_list_node_t *next_node;
                view_t *view;

                view = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (plugin->views, node);

                view_start_animation (view);

                node = next_node;
        }

        plugin->is_animating = true;

        if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
                plugin->is_idle = true;
}
Пример #21
0
static void
stop_animation (ply_boot_splash_plugin_t *plugin)
{
        ply_list_node_t *node;

        assert (plugin != NULL);
        assert (plugin->loop != NULL);

        if (!plugin->is_animating)
                return;

        plugin->is_animating = false;

        node = ply_list_get_first_node (plugin->views);
        while (node != NULL) {
                ply_list_node_t *next_node;
                view_t *view;

                view = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (plugin->views, node);

                ply_text_progress_bar_hide (view->progress_bar);

                node = next_node;
        }
        redraw_views (plugin);
}
Пример #22
0
void
ply_trigger_remove_handler (ply_trigger_t         *trigger,
                            ply_trigger_handler_t  handler,
                            void                  *user_data)
{
  ply_list_node_t *node;

  node = ply_list_get_first_node (trigger->closures);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_trigger_closure_t *closure;

      closure = (ply_trigger_closure_t *) ply_list_node_get_data (node);

      next_node = ply_list_get_next_node (trigger->closures, node);

      if (closure->handler == handler && closure->user_data == user_data)
        {
          free (closure);
          ply_list_remove_node (trigger->closures, node);
          break;
        }

      node = next_node;
    }
}
Пример #23
0
static void
view_animate_at_time (view_t *view,
                      double  time)
{
        ply_boot_splash_plugin_t *plugin;
        ply_list_node_t *node;
        double logo_opacity;
        long logo_x, logo_y;
        long logo_width, logo_height;
        unsigned long screen_width, screen_height;
        unsigned long star_width, star_height;

        plugin = view->plugin;

        logo_width = ply_image_get_width (plugin->logo_image);
        logo_height = ply_image_get_height (plugin->logo_image);

        screen_width = ply_pixel_display_get_width (view->display);
        screen_height = ply_pixel_display_get_height (view->display);

        logo_x = (screen_width / 2) - (logo_width / 2);
        logo_y = (screen_height / 2) - (logo_height / 2);

        star_width = ply_image_get_width (plugin->star_image);
        star_height = ply_image_get_height (plugin->star_image);

        node = ply_list_get_first_node (view->stars);
        while (node != NULL) {
                ply_list_node_t *next_node;
                star_t *star;

                star = (star_t *) ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (view->stars, node);

                star->opacity = .5 * sin (((plugin->now - star->start_time) / star->speed) * (2 * M_PI)) + .5;
                star->opacity = CLAMP (star->opacity, 0, 1.0);

                ply_pixel_display_draw_area (view->display,
                                             star->x, star->y,
                                             star_width, star_height);
                node = next_node;
        }

        logo_opacity = .5 * sin ((time / 5) * (2 * M_PI)) + .8;
        logo_opacity = CLAMP (logo_opacity, 0, 1.0);

        if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
                logo_opacity = 1.0;

        if (fabs (logo_opacity - view->logo_opacity) <= DBL_MIN)
                return;

        view->logo_opacity = logo_opacity;

        ply_pixel_display_draw_area (view->display,
                                     logo_x, logo_y,
                                     logo_width, logo_height);
}
Пример #24
0
static void
animate_frame (ply_boot_splash_plugin_t *plugin,
               int                       frame)
{
  ply_list_node_t *node;

  node = ply_list_get_first_node (plugin->views);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      view_t *view;
      int display_width, display_height;

      view = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (plugin->views, node);

      display_width = ply_text_display_get_number_of_columns (view->display);
      display_height = ply_text_display_get_number_of_rows (view->display);

      ply_text_display_set_cursor_position (view->display,
                                            (display_width - 12) / 2,
                                            display_height / 2);

      ply_text_display_set_background_color (view->display, PLY_TERMINAL_COLOR_BLACK);
      ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_WHITE);
      ply_text_display_write (view->display, "Ubuntu 10.04");

      ply_text_display_set_cursor_position (view->display,
                                            (display_width - 10) / 2,
                                            (display_height / 2) + 2);

      if ((frame < 1) || (frame > 4))
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_WHITE);
      else
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_BROWN);
      ply_text_display_write (view->display, ".  ");

      if ((frame < 2) || (frame > 5))
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_WHITE);
      else
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_BROWN);
      ply_text_display_write (view->display, ".  ");

      if ((frame < 3) || (frame > 6))
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_WHITE);
      else
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_BROWN);
      ply_text_display_write (view->display, ".  ");

      if (frame < 4)
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_WHITE);
      else
        ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_BROWN);
      ply_text_display_write (view->display, ".");

      node = next_node;
    }
}
Пример #25
0
static void
draw_normal_view (view_t             *view,
                  ply_pixel_buffer_t *pixel_buffer,
                  int                 x,
                  int                 y,
                  int                 width,
                  int                 height)
{
        ply_boot_splash_plugin_t *plugin;
        ply_list_node_t *node;
        ply_rectangle_t logo_area;
        ply_rectangle_t star_area;
        uint32_t *logo_data, *star_data;
        unsigned long screen_width, screen_height;

        plugin = view->plugin;

        if (!plugin->is_animating)
                return;

        logo_area.width = ply_image_get_width (plugin->logo_image);
        logo_area.height = ply_image_get_height (plugin->logo_image);
        logo_data = ply_image_get_data (plugin->logo_image);

        screen_width = ply_pixel_display_get_width (view->display);
        screen_height = ply_pixel_display_get_height (view->display);

        logo_area.x = (screen_width / 2) - (logo_area.width / 2);
        logo_area.y = (screen_height / 2) - (logo_area.height / 2);

        star_data = ply_image_get_data (plugin->star_image);
        star_area.width = ply_image_get_width (plugin->star_image);
        star_area.height = ply_image_get_height (plugin->star_image);

        node = ply_list_get_first_node (view->stars);
        while (node != NULL) {
                ply_list_node_t *next_node;
                star_t *star;

                star = (star_t *) ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (view->stars, node);

                star_area.x = star->x;
                star_area.y = star->y;
                ply_pixel_buffer_fill_with_argb32_data_at_opacity (pixel_buffer,
                                                                   &star_area,
                                                                   star_data,
                                                                   star->opacity);
                node = next_node;
        }

        ply_pixel_buffer_fill_with_argb32_data_at_opacity (pixel_buffer,
                                                           &logo_area,
                                                           logo_data,
                                                           view->logo_opacity);
}
Пример #26
0
void
ply_seat_refresh_displays (ply_seat_t *seat)
{
        ply_list_node_t *node;

        node = ply_list_get_first_node (seat->pixel_displays);
        while (node != NULL) {
                ply_pixel_display_t *display;
                ply_list_node_t *next_node;
                unsigned long width, height;

                display = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (seat->pixel_displays, node);

                width = ply_pixel_display_get_width (display);
                height = ply_pixel_display_get_height (display);

                ply_pixel_display_draw_area (display, 0, 0, width, height);
                node = next_node;
        }

        node = ply_list_get_first_node (seat->text_displays);
        while (node != NULL) {
                ply_text_display_t *display;
                ply_list_node_t *next_node;
                int number_of_columns, number_of_rows;

                display = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (seat->text_displays, node);

                number_of_columns = ply_text_display_get_number_of_columns (display);
                number_of_rows = ply_text_display_get_number_of_rows (display);

                ply_text_display_draw_area (display, 0, 0,
                                            number_of_columns,
                                            number_of_rows);
                node = next_node;
        }
}
Пример #27
0
static void script_parse_op_list_free (ply_list_t *op_list)
{
  ply_list_node_t *node;

  for (node = ply_list_get_first_node (op_list);
       node;
       node = ply_list_get_next_node (op_list, node))
    {
      script_op_t *op = ply_list_node_get_data (node);
      script_parse_op_free (op);
    }
  ply_list_free (op_list);
  return;
}
Пример #28
0
static void
flush_head (ply_renderer_backend_t *backend,
            ply_renderer_head_t    *head)
{
  ply_region_t *updated_region;
  ply_list_t *areas_to_flush;
  ply_list_node_t *node;
  ply_pixel_buffer_t *pixel_buffer;
  char *map_address;

  assert (backend != NULL);

  if (!backend->is_active)
    return;

  ply_terminal_set_mode (backend->terminal, PLY_TERMINAL_MODE_GRAPHICS);
  ply_terminal_set_unbuffered_input (backend->terminal);
  pixel_buffer = head->pixel_buffer;
  updated_region = ply_pixel_buffer_get_updated_areas (pixel_buffer);
  areas_to_flush = ply_region_get_sorted_rectangle_list (updated_region);

  map_address =
    backend->driver_interface->begin_flush (backend->driver,
                                            head->scan_out_buffer_id);

  node = ply_list_get_first_node (areas_to_flush);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_rectangle_t *area_to_flush;

      area_to_flush = (ply_rectangle_t *) ply_list_node_get_data (node);

      next_node = ply_list_get_next_node (areas_to_flush, node);

      if (reset_scan_out_buffer_if_needed (backend, head))
        ply_trace ("Needed to reset scan out buffer on %ldx%ld renderer head",
                   head->area.width, head->area.height);

      ply_renderer_head_flush_area (head, area_to_flush, map_address);

      node = next_node;
    }

  backend->driver_interface->end_flush (backend->driver,
                                        head->scan_out_buffer_id);

  ply_region_clear (updated_region);
}
Пример #29
0
static ply_progress_message_t*
ply_progress_message_search_next (ply_list_t *message_list, double time)
{
  ply_list_node_t *node;
  node = ply_list_get_first_node (message_list);
  ply_progress_message_t *best=NULL;
  while (node)
    {
      ply_progress_message_t *message = ply_list_node_get_data (node);
      if (message->time > time && (!best || message->time < best->time))
          best = message;
      node = ply_list_get_next_node (message_list, node);
    }
  return best;
}
Пример #30
0
static ply_progress_message_t*
ply_progress_message_search (ply_list_t *message_list, const char* string)
{
  ply_list_node_t *node;
  node = ply_list_get_first_node (message_list);

  while (node)
    {
      ply_progress_message_t *message = ply_list_node_get_data (node);
      if (strcmp(string, message->string)==0)
          return message;
      node = ply_list_get_next_node (message_list, node);
    }
  return NULL;
}