1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#include <glib-object.h>
23
#include "core-types.h"
25
#include "gimpsamplepoint.h"
29
gimp_sample_point_get_type (void)
31
static GType type = 0;
34
type = g_boxed_type_register_static ("GimpSamplePoint",
35
(GBoxedCopyFunc) gimp_sample_point_ref,
36
(GBoxedFreeFunc) gimp_sample_point_unref);
42
gimp_sample_point_new (guint32 sample_point_ID)
44
GimpSamplePoint *sample_point;
46
sample_point = g_new0 (GimpSamplePoint, 1);
48
sample_point->ref_count = 1;
49
sample_point->sample_point_ID = sample_point_ID;
57
gimp_sample_point_ref (GimpSamplePoint *sample_point)
59
g_return_val_if_fail (sample_point != NULL, NULL);
61
sample_point->ref_count++;
67
gimp_sample_point_unref (GimpSamplePoint *sample_point)
69
g_return_if_fail (sample_point != NULL);
71
sample_point->ref_count--;
73
if (sample_point->ref_count < 1)
74
g_free (sample_point);