1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995-1999 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.
25
#include "libgimpmath/gimpmath.h"
26
#include "libgimpbase/gimpbase.h"
27
#include "libgimpwidgets/gimpwidgets.h"
29
#include "widgets-types.h"
31
#include "config/gimpconfig-utils.h"
32
#include "config/gimpconfig.h"
34
#include "core/gimp.h"
35
#include "core/gimplist.h"
36
#include "core/gimpcontext.h"
37
#include "core/gimptemplate.h"
39
#include "gimptemplateeditor.h"
40
#include "gimpenumwidgets.h"
41
#include "gimppropwidgets.h"
42
#include "gimpviewablebutton.h"
44
#include "gimp-intl.h"
48
#define MAX_COMMENT_LENGTH 512 /* arbitrary */
57
static void gimp_template_editor_class_init (GimpTemplateEditorClass *klass);
58
static GObject * gimp_template_editor_constructor (GType type,
60
GObjectConstructParam *params);
61
static void gimp_template_editor_set_property (GObject *object,
65
static void gimp_template_editor_get_property (GObject *object,
70
static void gimp_template_editor_finalize (GObject *object);
71
static void gimp_template_editor_init (GimpTemplateEditor *editor);
73
static void gimp_template_editor_aspect_callback (GtkWidget *widget,
74
GimpTemplateEditor *editor);
75
static void gimp_template_editor_template_notify (GimpTemplate *template,
76
GParamSpec *param_spec,
77
GimpTemplateEditor *editor);
78
static void gimp_template_editor_icon_changed (GimpContext *context,
79
GimpTemplate *template,
80
GimpTemplateEditor *editor);
83
static GtkVBoxClass *parent_class = NULL;
87
gimp_template_editor_get_type (void)
89
static GType view_type = 0;
93
static const GTypeInfo view_info =
95
sizeof (GimpTemplateEditorClass),
97
NULL, /* base_finalize */
98
(GClassInitFunc) gimp_template_editor_class_init,
99
NULL, /* class_finalize */
100
NULL, /* class_data */
101
sizeof (GimpTemplateEditor),
103
(GInstanceInitFunc) gimp_template_editor_init
106
view_type = g_type_register_static (GTK_TYPE_VBOX,
107
"GimpTemplateEditor",
115
gimp_template_editor_class_init (GimpTemplateEditorClass *klass)
117
GObjectClass *object_class;
119
object_class = G_OBJECT_CLASS (klass);
121
parent_class = g_type_class_peek_parent (klass);
123
object_class->constructor = gimp_template_editor_constructor;
124
object_class->set_property = gimp_template_editor_set_property;
125
object_class->get_property = gimp_template_editor_get_property;
126
object_class->finalize = gimp_template_editor_finalize;
128
g_object_class_install_property (object_class, PROP_TEMPLATE,
129
g_param_spec_object ("template", NULL, NULL,
132
G_PARAM_CONSTRUCT_ONLY));
136
gimp_template_editor_init (GimpTemplateEditor *editor)
138
editor->template = NULL;
142
gimp_template_editor_set_property (GObject *object,
147
GimpTemplateEditor *editor = GIMP_TEMPLATE_EDITOR (object);
152
editor->template = GIMP_TEMPLATE (g_value_dup_object (value));
155
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
161
gimp_template_editor_get_property (GObject *object,
166
GimpTemplateEditor *editor = GIMP_TEMPLATE_EDITOR (object);
171
g_value_set_object (value, editor->template);
174
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
180
gimp_template_editor_constructor (GType type,
182
GObjectConstructParam *params)
184
GimpTemplateEditor *editor;
186
GtkWidget *aspect_box;
192
GtkObject *adjustment;
197
GtkWidget *chainbutton;
199
GtkWidget *scrolled_window;
200
GtkWidget *text_view;
201
GtkTextBuffer *text_buffer;
202
GList *focus_chain = NULL;
205
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
207
editor = GIMP_TEMPLATE_EDITOR (object);
209
g_assert (editor->template != NULL);
211
gtk_box_set_spacing (GTK_BOX (editor), 12);
213
/* Image size frame */
214
frame = gimp_frame_new (_("Image Size"));
215
gtk_box_pack_start (GTK_BOX (editor), frame, FALSE, FALSE, 0);
216
gtk_widget_show (frame);
218
table = gtk_table_new (3, 2, FALSE);
219
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 6);
220
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
221
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
222
gtk_container_add (GTK_CONTAINER (frame), table);
223
gtk_widget_show (table);
225
width = gimp_spin_button_new (&adjustment,
228
gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH);
230
height = gimp_spin_button_new (&adjustment,
233
gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH);
235
/* the image size labels */
236
label = gtk_label_new_with_mnemonic (_("_Width:"));
237
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
238
gtk_label_set_mnemonic_widget (GTK_LABEL (label), width);
239
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
240
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
241
gtk_widget_show (label);
243
label = gtk_label_new_with_mnemonic (_("H_eight:"));
244
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
245
gtk_label_set_mnemonic_widget (GTK_LABEL (label), height);
246
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
247
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
248
gtk_widget_show (label);
250
/* create the sizeentry which keeps it all together */
251
hbox = gtk_hbox_new (FALSE, 0);
252
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 0, 2);
253
gtk_widget_show (hbox);
255
editor->size_se = gimp_size_entry_new (0, editor->template->unit,_("%p"),
256
TRUE, FALSE, FALSE, SB_WIDTH,
257
GIMP_SIZE_ENTRY_UPDATE_SIZE);
259
gtk_table_set_row_spacing (GTK_TABLE (editor->size_se), 0, 2);
260
gtk_table_set_col_spacing (GTK_TABLE (editor->size_se), 1, 6);
262
gtk_box_pack_start (GTK_BOX (hbox), editor->size_se, FALSE, FALSE, 0);
263
gtk_widget_show (editor->size_se);
265
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->size_se),
266
GTK_SPIN_BUTTON (height), NULL);
267
gtk_table_attach_defaults (GTK_TABLE (editor->size_se), height, 0, 1, 1, 2);
268
gtk_widget_show (height);
270
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->size_se),
271
GTK_SPIN_BUTTON (width), NULL);
272
gtk_table_attach_defaults (GTK_TABLE (editor->size_se), width, 0, 1, 0, 1);
273
gtk_widget_show (width);
275
gimp_prop_coordinates_connect (G_OBJECT (editor->template),
276
"width", "height", "unit",
277
editor->size_se, NULL,
278
editor->template->xresolution,
279
editor->template->yresolution);
281
hbox = gtk_hbox_new (FALSE, 12);
282
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 3, 2, 3);
283
gtk_widget_show (hbox);
285
vbox = gtk_vbox_new (0, FALSE);
286
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
287
gtk_widget_show (vbox);
289
aspect_box = gimp_enum_stock_box_new (GIMP_TYPE_ASPECT_TYPE,
290
"gimp", GTK_ICON_SIZE_MENU,
291
G_CALLBACK (gimp_template_editor_aspect_callback),
293
&editor->aspect_button);
294
gtk_widget_hide (editor->aspect_button); /* hide "square" */
296
gtk_box_pack_start (GTK_BOX (vbox), aspect_box, FALSE, FALSE, 0);
297
gtk_widget_show (aspect_box);
299
vbox = gtk_vbox_new (2, FALSE);
300
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
301
gtk_widget_show (vbox);
303
editor->pixel_label = gtk_label_new (NULL);
304
gimp_label_set_attributes (GTK_LABEL (editor->pixel_label),
305
PANGO_ATTR_SCALE, PANGO_SCALE_SMALL,
307
gtk_misc_set_alignment (GTK_MISC (editor->pixel_label), 0.0, 0.0);
308
gtk_box_pack_start (GTK_BOX (vbox), editor->pixel_label, FALSE, FALSE, 0);
309
gtk_widget_show (editor->pixel_label);
311
editor->more_label = gtk_label_new (NULL);
312
gimp_label_set_attributes (GTK_LABEL (editor->more_label),
313
PANGO_ATTR_SCALE, PANGO_SCALE_SMALL,
315
gtk_misc_set_alignment (GTK_MISC (editor->more_label), 0.0, 0.0);
316
gtk_box_pack_start (GTK_BOX (vbox), editor->more_label, FALSE, FALSE, 0);
317
gtk_widget_show (editor->more_label);
319
#ifdef ENABLE_MEMSIZE_LABEL
320
editor->memsize_label = gtk_label_new (NULL);
321
gimp_label_set_attributes (GTK_LABEL (editor->memsize_label),
322
PANGO_ATTR_SCALE, PANGO_SCALE_SMALL,
323
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
325
gtk_misc_set_alignment (GTK_MISC (editor->memsize_label), 0.0, 0.0);
326
gtk_box_pack_start (GTK_BOX (vbox), editor->memsize_label, FALSE, FALSE, 0);
327
gtk_widget_show (editor->memsize_label);
330
text = g_strdup_printf ("<b>%s</b>", _("_Advanced Options"));
331
editor->expander = g_object_new (GTK_TYPE_EXPANDER,
334
"use_underline", TRUE,
338
gtk_box_pack_start (GTK_BOX (editor), editor->expander, TRUE, TRUE, 0);
339
gtk_widget_show (editor->expander);
341
frame = gimp_frame_new ("<expander>");
342
gtk_container_add (GTK_CONTAINER (editor->expander), frame);
343
gtk_widget_show (frame);
345
table = gtk_table_new (5, 2, FALSE);
346
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 6);
347
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
348
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
349
gtk_container_add (GTK_CONTAINER (frame), table);
350
gtk_widget_show (table);
352
xres = gimp_spin_button_new (&adjustment,
355
gtk_entry_set_width_chars (GTK_ENTRY (xres), SB_WIDTH);
357
yres = gimp_spin_button_new (&adjustment,
360
gtk_entry_set_width_chars (GTK_ENTRY (yres), SB_WIDTH);
362
/* the resolution labels */
363
label = gtk_label_new_with_mnemonic (_("_X resolution:"));
364
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
365
gtk_label_set_mnemonic_widget (GTK_LABEL (label), xres);
366
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
367
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
368
gtk_widget_show (label);
370
label = gtk_label_new_with_mnemonic (_("_Y resolution:"));
371
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
372
gtk_label_set_mnemonic_widget (GTK_LABEL (label), yres);
373
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
374
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
375
gtk_widget_show (label);
377
/* the resolution sizeentry */
378
hbox = gtk_hbox_new (FALSE, 0);
379
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 0, 2);
380
gtk_widget_show (hbox);
382
editor->resolution_se =
383
gimp_size_entry_new (0, editor->template->resolution_unit, _("pixels/%a"),
384
FALSE, FALSE, FALSE, SB_WIDTH,
385
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
387
gtk_table_set_row_spacing (GTK_TABLE (editor->resolution_se), 0, 2);
388
gtk_table_set_col_spacing (GTK_TABLE (editor->resolution_se), 1, 2);
389
gtk_table_set_col_spacing (GTK_TABLE (editor->resolution_se), 2, 2);
391
gtk_box_pack_start (GTK_BOX (hbox), editor->resolution_se, FALSE, FALSE, 0);
392
gtk_widget_show (editor->resolution_se);
394
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->resolution_se),
395
GTK_SPIN_BUTTON (yres), NULL);
396
gtk_table_attach_defaults (GTK_TABLE (editor->resolution_se), yres,
398
gtk_widget_show (yres);
400
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (editor->resolution_se),
401
GTK_SPIN_BUTTON (xres), NULL);
402
gtk_table_attach_defaults (GTK_TABLE (editor->resolution_se), xres,
404
gtk_widget_show (xres);
406
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 0,
407
editor->template->xresolution, FALSE);
408
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 1,
409
editor->template->yresolution, FALSE);
411
/* the resolution chainbutton */
412
chainbutton = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
413
gtk_table_attach_defaults (GTK_TABLE (editor->resolution_se), chainbutton,
415
gtk_widget_show (chainbutton);
417
gimp_prop_coordinates_connect (G_OBJECT (editor->template),
418
"xresolution", "yresolution",
420
editor->resolution_se, chainbutton,
423
focus_chain = g_list_prepend (focus_chain,
424
GIMP_SIZE_ENTRY (editor->resolution_se)->unitmenu);
425
focus_chain = g_list_prepend (focus_chain, chainbutton);
426
focus_chain = g_list_prepend (focus_chain, yres);
427
focus_chain = g_list_prepend (focus_chain, xres);
429
gtk_container_set_focus_chain (GTK_CONTAINER (editor->resolution_se),
431
g_list_free (focus_chain);
433
combo = gimp_prop_enum_combo_box_new (G_OBJECT (editor->template),
435
GIMP_RGB, GIMP_GRAY);
436
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
437
_("Color_space:"), 0.0, 0.5,
440
combo = gimp_prop_enum_combo_box_new (G_OBJECT (editor->template),
442
GIMP_FOREGROUND_FILL,
443
GIMP_TRANSPARENT_FILL);
444
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
445
_("_Fill with:"), 0.0, 0.5,
448
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
449
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
451
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
452
GTK_POLICY_AUTOMATIC,
453
GTK_POLICY_AUTOMATIC);
454
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
455
_("Comme_nt:"), 0.0, 0.0,
456
scrolled_window, 1, FALSE);
458
text_buffer = gimp_prop_text_buffer_new (G_OBJECT (editor->template),
459
"comment", MAX_COMMENT_LENGTH);
461
text_view = gtk_text_view_new_with_buffer (text_buffer);
462
g_object_unref (text_buffer);
464
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
465
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
466
gtk_widget_show (text_view);
468
g_signal_connect_object (editor->template, "notify",
469
G_CALLBACK (gimp_template_editor_template_notify),
472
/* call the notify callback once to get the labels set initially */
473
gimp_template_editor_template_notify (editor->template, NULL, editor);
479
gimp_template_editor_finalize (GObject *object)
481
GimpTemplateEditor *editor = GIMP_TEMPLATE_EDITOR (object);
483
if (editor->template)
485
g_object_unref (editor->template);
486
editor->template = NULL;
489
if (editor->stock_id_container)
491
g_object_unref (editor->stock_id_container);
492
editor->stock_id_container = NULL;
495
if (editor->stock_id_context)
497
g_object_unref (editor->stock_id_context);
498
editor->stock_id_context = NULL;
501
G_OBJECT_CLASS (parent_class)->finalize (object);
505
gimp_template_editor_new (GimpTemplate *template,
507
gboolean edit_template)
509
GimpTemplateEditor *editor;
511
g_return_val_if_fail (!edit_template || GIMP_IS_GIMP (gimp), NULL);
513
editor = g_object_new (GIMP_TYPE_TEMPLATE_EDITOR,
514
"template", template,
524
const gchar *stock_id;
526
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (editor->template));
528
editor->stock_id_container = gimp_list_new (GIMP_TYPE_TEMPLATE, FALSE);
529
editor->stock_id_context = gimp_context_new (gimp, "foo", NULL);
531
g_signal_connect (editor->stock_id_context, "template_changed",
532
G_CALLBACK (gimp_template_editor_icon_changed),
535
stock_list = gtk_stock_list_ids ();
537
for (list = stock_list; list; list = g_slist_next (list))
539
GimpObject *object = g_object_new (GIMP_TYPE_TEMPLATE,
541
"stock-id", list->data,
544
gimp_container_add (editor->stock_id_container, object);
545
g_object_unref (object);
547
if (strcmp (list->data, stock_id) == 0)
548
gimp_context_set_template (editor->stock_id_context,
549
GIMP_TEMPLATE (object));
552
g_slist_foreach (stock_list, (GFunc) g_free, NULL);
553
g_slist_free (stock_list);
555
table = gtk_table_new (2, 2, FALSE);
556
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
557
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
558
gtk_box_pack_start (GTK_BOX (editor), table, FALSE, FALSE, 0);
559
gtk_box_reorder_child (GTK_BOX (editor), table, 0);
560
gtk_widget_show (table);
562
entry = gimp_prop_entry_new (G_OBJECT (editor->template), "name", 128);
564
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
565
_("_Name:"), 1.0, 0.5,
568
button = gimp_viewable_button_new (editor->stock_id_container,
569
editor->stock_id_context,
570
GIMP_VIEW_SIZE_SMALL, 0,
571
NULL, NULL, NULL, NULL);
572
gimp_viewable_button_set_view_type (GIMP_VIEWABLE_BUTTON (button),
573
GIMP_VIEW_TYPE_GRID);
575
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
576
_("_Icon:"), 1.0, 0.5,
580
return GTK_WIDGET (editor);
584
gimp_template_editor_show_advanced (GimpTemplateEditor *editor,
587
g_return_if_fail (GIMP_IS_TEMPLATE_EDITOR (editor));
589
gtk_expander_set_expanded (GTK_EXPANDER (editor->expander), expanded);
593
/* private functions */
596
gimp_template_editor_aspect_callback (GtkWidget *widget,
597
GimpTemplateEditor *editor)
599
if (! editor->block_aspect && GTK_TOGGLE_BUTTON (widget)->active)
601
GimpTemplate *template = editor->template;
602
gint width = template->width;
603
gint height = template->height;
604
gdouble xresolution = template->xresolution;
605
gdouble yresolution = template->yresolution;
608
if (template->width == template->height)
610
editor->block_aspect = TRUE;
611
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (editor->aspect_button),
613
editor->block_aspect = FALSE;
617
g_signal_handlers_block_by_func (template,
618
gimp_template_editor_template_notify,
621
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 0,
623
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 1,
626
g_object_set (template,
629
"xresolution", yresolution,
630
"yresolution", xresolution,
633
g_signal_handlers_unblock_by_func (template,
634
gimp_template_editor_template_notify,
637
text = g_strdup_printf (_("%d x %d pixels"),
638
template->width, template->height);
639
gtk_label_set_text (GTK_LABEL (editor->pixel_label), text);
645
gimp_template_editor_template_notify (GimpTemplate *template,
646
GParamSpec *param_spec,
647
GimpTemplateEditor *editor)
649
GimpAspectType aspect;
657
if (! strcmp (param_spec->name, "xresolution"))
659
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 0,
660
template->xresolution, FALSE);
662
else if (! strcmp (param_spec->name, "yresolution"))
664
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (editor->size_se), 1,
665
template->yresolution, FALSE);
669
#ifdef ENABLE_MEMSIZE_LABEL
670
text = gimp_memsize_to_string (template->initial_size);
671
gtk_label_set_text (GTK_LABEL (editor->memsize_label), text);
675
text = g_strdup_printf (_("%d x %d pixels"),
676
template->width, template->height);
677
gtk_label_set_text (GTK_LABEL (editor->pixel_label), text);
680
if (template->width > template->height)
681
aspect = GIMP_ASPECT_LANDSCAPE;
682
else if (template->height > template->width)
683
aspect = GIMP_ASPECT_PORTRAIT;
685
aspect = GIMP_ASPECT_SQUARE;
687
editor->block_aspect = TRUE;
688
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (editor->aspect_button),
690
editor->block_aspect = FALSE;
692
gimp_enum_get_value (GIMP_TYPE_IMAGE_BASE_TYPE, template->image_type,
693
NULL, NULL, &desc, NULL);
695
xres = ROUND (template->xresolution);
696
yres = ROUND (template->yresolution);
699
text = g_strdup_printf (_("%d x %d dpi, %s"), xres, yres, desc);
701
text = g_strdup_printf (_("%d dpi, %s"), yres, desc);
703
gtk_label_set_text (GTK_LABEL (editor->more_label), text);
706
if (editor->stock_id_container)
709
const gchar *stock_id;
711
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (template));
713
object = gimp_container_get_child_by_name (editor->stock_id_container,
716
gimp_context_set_template (editor->stock_id_context,
717
(GimpTemplate *) object);
722
gimp_template_editor_icon_changed (GimpContext *context,
723
GimpTemplate *template,
724
GimpTemplateEditor *editor)
726
g_object_set (editor->template,
727
"stock-id", GIMP_OBJECT (template)->name,