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 "libgimpconfig/gimpconfig.h"
25
#include "paint-types.h"
27
#include "gimpsourceoptions.h"
38
static void gimp_source_options_set_property (GObject *object,
42
static void gimp_source_options_get_property (GObject *object,
48
G_DEFINE_TYPE (GimpSourceOptions, gimp_source_options, GIMP_TYPE_PAINT_OPTIONS)
52
gimp_source_options_class_init (GimpSourceOptionsClass *klass)
54
GObjectClass *object_class = G_OBJECT_CLASS (klass);
56
object_class->set_property = gimp_source_options_set_property;
57
object_class->get_property = gimp_source_options_get_property;
59
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_ALIGN_MODE,
61
GIMP_TYPE_SOURCE_ALIGN_MODE,
63
GIMP_PARAM_STATIC_STRINGS);
65
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_MERGED,
66
"sample-merged", NULL,
68
GIMP_PARAM_STATIC_STRINGS);
72
gimp_source_options_init (GimpSourceOptions *options)
74
options->use_source = TRUE;
78
gimp_source_options_set_property (GObject *object,
83
GimpSourceOptions *options = GIMP_SOURCE_OPTIONS (object);
88
options->align_mode = g_value_get_enum (value);
90
case PROP_SAMPLE_MERGED:
91
options->sample_merged = g_value_get_boolean (value);
94
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
100
gimp_source_options_get_property (GObject *object,
105
GimpSourceOptions *options = GIMP_SOURCE_OPTIONS (object);
109
case PROP_ALIGN_MODE:
110
g_value_set_enum (value, options->align_mode);
112
case PROP_SAMPLE_MERGED:
113
g_value_set_boolean (value, options->sample_merged);
116
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);