1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
5
* Copyright (C) 1999 Sven Neumann <sven@gimp.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
#include "libgimpwidgets/gimpwidgets.h"
28
#include "tools-types.h"
30
#include "config/gimpconfig-params.h"
32
#include "core/gimptoolinfo.h"
34
#include "widgets/gimppropwidgets.h"
36
#include "gimpmeasureoptions.h"
37
#include "gimptooloptions-gui.h"
39
#include "gimp-intl.h"
49
static void gimp_measure_options_class_init (GimpMeasureOptionsClass *klass);
51
static void gimp_measure_options_set_property (GObject *object,
55
static void gimp_measure_options_get_property (GObject *object,
61
static GimpToolOptionsClass *parent_class = NULL;
65
gimp_measure_options_get_type (void)
67
static GType type = 0;
71
static const GTypeInfo info =
73
sizeof (GimpMeasureOptionsClass),
75
(GBaseFinalizeFunc) NULL,
76
(GClassInitFunc) gimp_measure_options_class_init,
77
NULL, /* class_finalize */
78
NULL, /* class_data */
79
sizeof (GimpMeasureOptions),
81
(GInstanceInitFunc) NULL
84
type = g_type_register_static (GIMP_TYPE_TOOL_OPTIONS,
93
gimp_measure_options_class_init (GimpMeasureOptionsClass *klass)
95
GObjectClass *object_class = G_OBJECT_CLASS (klass);
97
parent_class = g_type_class_peek_parent (klass);
99
object_class->set_property = gimp_measure_options_set_property;
100
object_class->get_property = gimp_measure_options_get_property;
102
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_INFO_WINDOW,
103
"use-info-window", NULL,
109
gimp_measure_options_set_property (GObject *object,
114
GimpMeasureOptions *options = GIMP_MEASURE_OPTIONS (object);
118
case PROP_USE_INFO_WINDOW:
119
options->use_info_window = g_value_get_boolean (value);
122
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
128
gimp_measure_options_get_property (GObject *object,
133
GimpMeasureOptions *options = GIMP_MEASURE_OPTIONS (object);
137
case PROP_USE_INFO_WINDOW:
138
g_value_set_boolean (value, options->use_info_window);
141
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
147
gimp_measure_options_gui (GimpToolOptions *tool_options)
149
GObject *config = G_OBJECT (tool_options);
153
vbox = gimp_tool_options_gui (tool_options);
155
/* the use_info_window toggle button */
156
button = gimp_prop_check_button_new (config, "use-info-window",
157
_("Use info window"));
158
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
159
gtk_widget_show (button);