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.
21
#include <glib-object.h>
23
#include "core-types.h"
25
#include "config/gimpconfig.h"
26
#include "config/gimpconfig-utils.h"
29
#include "gimpbuffer.h"
30
#include "gimpimage.h"
31
#include "gimpimage-new.h"
32
#include "gimptemplate.h"
34
#include "gimp-intl.h"
38
gimp_image_new_get_last_template (Gimp *gimp,
41
GimpTemplate *template;
43
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
44
g_return_val_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage), NULL);
46
template = gimp_template_new ("image new values");
49
gimp_template_set_from_image (template, gimage);
51
gimp_config_sync (GIMP_CONFIG (gimp->image_new_last_template),
52
GIMP_CONFIG (template), 0);
54
if (gimp->global_buffer && gimp->have_current_cut_buffer)
56
g_object_set (template,
57
"width", gimp_buffer_get_width (gimp->global_buffer),
58
"height", gimp_buffer_get_height (gimp->global_buffer),
66
gimp_image_new_set_last_template (Gimp *gimp,
67
GimpTemplate *template)
69
g_return_if_fail (GIMP_IS_GIMP (gimp));
70
g_return_if_fail (GIMP_IS_TEMPLATE (template));
72
gimp_config_sync (GIMP_CONFIG (template),
73
GIMP_CONFIG (gimp->image_new_last_template), 0);
75
gimp->have_current_cut_buffer = FALSE;