Пример #1
0
void
ply_terminal_free (ply_terminal_t *terminal)
{
    if (terminal == NULL)
        return;

    if (terminal->loop != NULL) {
        ply_event_loop_stop_watching_for_exit (terminal->loop,
                                               (ply_event_loop_exit_handler_t)
                                               ply_terminal_detach_from_event_loop,
                                               terminal);

        if (terminal->number_of_reopen_tries > 0) {
            ply_event_loop_stop_watching_for_timeout (terminal->loop,
                    (ply_event_loop_timeout_handler_t)
                    ply_terminal_reopen_device, terminal);
        }
    }

    if (terminal->is_open)
        ply_terminal_close (terminal);

    free_vt_change_closures (terminal);
    free_input_closures (terminal);
    free (terminal->name);
    free (terminal);
}
Пример #2
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);
}
Пример #3
0
static void
stop_script_animation (ply_boot_splash_plugin_t *plugin)
{
  script_lib_plymouth_on_quit (plugin->script_state,
                               plugin->script_plymouth_lib);
  script_lib_sprite_refresh (plugin->script_sprite_lib);

  if (plugin->loop != NULL)
    ply_event_loop_stop_watching_for_timeout (plugin->loop,
                                              (ply_event_loop_timeout_handler_t)
                                              on_timeout, plugin);

  if (plugin->keyboard != NULL)
    {
      ply_keyboard_remove_input_handler (plugin->keyboard,
                                         (ply_keyboard_input_handler_t)
                                         on_keyboard_input);
      plugin->keyboard = NULL;
    }

  script_state_destroy (plugin->script_state);
  script_lib_sprite_destroy (plugin->script_sprite_lib);
  script_lib_image_destroy (plugin->script_image_lib);
  script_lib_plymouth_destroy (plugin->script_plymouth_lib);
  script_lib_math_destroy (plugin->script_math_lib);
  script_lib_string_destroy (plugin->script_string_lib);
}
Пример #4
0
static void
ply_animation_stop_now (ply_animation_t *animation)
{
  animation->is_stopped = true;

  if (animation->loop != NULL)
    {
      ply_event_loop_stop_watching_for_timeout (animation->loop,
                                                (ply_event_loop_timeout_handler_t)
                                                on_timeout, animation);
      animation->loop = NULL;
    }

  animation->display = NULL;
}
Пример #5
0
static void
stop_animation (ply_boot_splash_plugin_t *plugin)
{
        assert (plugin != NULL);
        assert (plugin->loop != NULL);

        if (!plugin->is_animating)
                return;

        plugin->is_animating = false;

        if (plugin->loop != NULL) {
                ply_event_loop_stop_watching_for_timeout (plugin->loop,
                                                          (ply_event_loop_timeout_handler_t)
                                                          on_timeout, plugin);
        }
        redraw_views (plugin);
}
Пример #6
0
static void
ply_throbber_stop_now (ply_throbber_t *throbber)
{
        throbber->is_stopped = true;

        ply_pixel_display_draw_area (throbber->display,
                                     throbber->x,
                                     throbber->y,
                                     throbber->frame_area.width,
                                     throbber->frame_area.height);
        if (throbber->loop != NULL) {
                ply_event_loop_stop_watching_for_timeout (throbber->loop,
                                                          (ply_event_loop_timeout_handler_t)
                                                          on_timeout, throbber);
                throbber->loop = NULL;
        }
        throbber->display = NULL;
}