~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/core/gimpitemundo.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20070502163303-6wchheivjxgjtlna
Tags: upstream-2.3.16
ImportĀ upstreamĀ versionĀ 2.3.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
34
34
};
35
35
 
36
36
 
37
 
static void      gimp_item_undo_class_init   (GimpItemUndoClass     *klass);
38
 
 
39
37
static GObject * gimp_item_undo_constructor  (GType                  type,
40
38
                                              guint                  n_params,
41
39
                                              GObjectConstructParam *params);
52
50
                                              GimpUndoMode           undo_mode);
53
51
 
54
52
 
55
 
static GimpUndoClass *parent_class = NULL;
56
 
 
57
 
 
58
 
GType
59
 
gimp_item_undo_get_type (void)
60
 
{
61
 
  static GType undo_type = 0;
62
 
 
63
 
  if (! undo_type)
64
 
    {
65
 
      static const GTypeInfo undo_info =
66
 
      {
67
 
        sizeof (GimpItemUndoClass),
68
 
        (GBaseInitFunc) NULL,
69
 
        (GBaseFinalizeFunc) NULL,
70
 
        (GClassInitFunc) gimp_item_undo_class_init,
71
 
        NULL,           /* class_finalize */
72
 
        NULL,           /* class_data     */
73
 
        sizeof (GimpItemUndo),
74
 
        0,              /* n_preallocs    */
75
 
        NULL            /* instance_init  */
76
 
      };
77
 
 
78
 
      undo_type = g_type_register_static (GIMP_TYPE_UNDO,
79
 
                                          "GimpItemUndo",
80
 
                                          &undo_info, 0);
81
 
  }
82
 
 
83
 
  return undo_type;
84
 
}
 
53
G_DEFINE_TYPE (GimpItemUndo, gimp_item_undo, GIMP_TYPE_UNDO)
 
54
 
 
55
#define parent_class gimp_item_undo_parent_class
 
56
 
85
57
 
86
58
static void
87
59
gimp_item_undo_class_init (GimpItemUndoClass *klass)
89
61
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
90
62
  GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);
91
63
 
92
 
  parent_class = g_type_class_peek_parent (klass);
93
 
 
94
64
  object_class->constructor  = gimp_item_undo_constructor;
95
65
  object_class->set_property = gimp_item_undo_set_property;
96
66
  object_class->get_property = gimp_item_undo_get_property;
100
70
  g_object_class_install_property (object_class, PROP_ITEM,
101
71
                                   g_param_spec_object ("item", NULL, NULL,
102
72
                                                        GIMP_TYPE_ITEM,
103
 
                                                        G_PARAM_READWRITE |
 
73
                                                        GIMP_PARAM_READWRITE |
104
74
                                                        G_PARAM_CONSTRUCT_ONLY));
105
75
}
106
76
 
 
77
static void
 
78
gimp_item_undo_init (GimpItemUndo *undo)
 
79
{
 
80
}
 
81
 
107
82
static GObject *
108
83
gimp_item_undo_constructor (GType                  type,
109
84
                            guint                  n_params,
165
140
{
166
141
  GimpItemUndo *item_undo = GIMP_ITEM_UNDO (undo);
167
142
 
168
 
  GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);
169
 
 
170
143
  if (item_undo->item)
171
144
    {
172
145
      g_object_unref (item_undo->item);
173
146
      item_undo->item = NULL;
174
147
    }
 
148
 
 
149
  GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);
175
150
}