Example #1
0
static void
gimp_undo_stack_finalize (GObject *object)
{
  GimpUndoStack *stack = GIMP_UNDO_STACK (object);

  g_clear_object (&stack->undos);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #2
0
static gint64
gimp_undo_stack_get_memsize (GimpObject *object,
                             gint64     *gui_size)
{
  GimpUndoStack *stack   = GIMP_UNDO_STACK (object);
  gint64         memsize = 0;

  memsize += gimp_object_get_memsize (GIMP_OBJECT (stack->undos), gui_size);

  return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                  gui_size);
}
Example #3
0
static void
gimp_undo_stack_finalize (GObject *object)
{
  GimpUndoStack *stack = GIMP_UNDO_STACK (object);

  if (stack->undos)
    {
      g_object_unref (stack->undos);
      stack->undos = NULL;
    }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #4
0
static void
gimp_undo_stack_pop (GimpUndo            *undo,
                     GimpUndoMode         undo_mode,
                     GimpUndoAccumulator *accum)
{
  GimpUndoStack *stack = GIMP_UNDO_STACK (undo);
  GList         *list;

  for (list = GIMP_LIST (stack->undos)->list;
       list;
       list = g_list_next (list))
    {
      GimpUndo *child = list->data;

      gimp_undo_pop (child, undo_mode, accum);
    }
}
Example #5
0
static void
gimp_undo_stack_free (GimpUndo     *undo,
                      GimpUndoMode  undo_mode)
{
  GimpUndoStack *stack = GIMP_UNDO_STACK (undo);
  GList         *list;

  for (list = GIMP_LIST (stack->undos)->queue->head;
       list;
       list = g_list_next (list))
    {
      GimpUndo *child = list->data;

      gimp_undo_free (child, undo_mode);
      g_object_unref (child);
    }

  gimp_container_clear (stack->undos);
}
Example #6
0
static void
gimp_undo_stack_free (GimpUndo     *undo,
                      GimpUndoMode  undo_mode)
{
  GimpUndoStack *stack = GIMP_UNDO_STACK (undo);
  GList         *list;

  for (list = GIMP_LIST (stack->undos)->list;
       list;
       list = g_list_next (list))
    {
      GimpUndo *child = list->data;

      gimp_undo_free (child, undo_mode);
      g_object_unref (child);
    }

  while (GIMP_LIST (stack->undos)->list)
    gimp_container_remove (GIMP_CONTAINER (stack->undos),
                           GIMP_LIST (stack->undos)->list->data);
}