reset object properties only if they are GIMP_PARAM_SERIALIZABLE.

2003-04-05  Michael Natterer  <mitch@gimp.org>

	* app/config/gimpconfig-utils.c (gimp_config_reset_properties):
	reset object properties only if they are GIMP_PARAM_SERIALIZABLE.

	* app/core/gimpcontext.[ch]: added a GimpTemplate property.

	* app/gui/dialogs-constructors.[ch]
	* app/gui/dialogs.c: added a template dialog.

	* app/gui/dialogs-menu.c
	* app/gui/image-menu.c
	* app/gui/toolbox-menu.c: and menu entries to open it.

	* app/widgets/gimpdnd.[ch]: added DND for GimpTemplates.
This commit is contained in:
Michael Natterer 2003-04-05 19:56:38 +00:00 committed by Michael Natterer
parent a1a7db7920
commit e7fbd8106f
18 changed files with 394 additions and 14 deletions

View File

@ -1,3 +1,19 @@
2003-04-05 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-utils.c (gimp_config_reset_properties):
reset object properties only if they are GIMP_PARAM_SERIALIZABLE.
* app/core/gimpcontext.[ch]: added a GimpTemplate property.
* app/gui/dialogs-constructors.[ch]
* app/gui/dialogs.c: added a template dialog.
* app/gui/dialogs-menu.c
* app/gui/image-menu.c
* app/gui/toolbox-menu.c: and menu entries to open it.
* app/widgets/gimpdnd.[ch]: added DND for GimpTemplates.
2003-04-05 Manish Singh <yosh@gimp.org>
* themes/Default/gtkrc: remove gtk-can-change-accels setting, since

View File

@ -25,11 +25,12 @@
#include <glib-object.h>
#include "libgimpbase/gimpenv.h"
#include "libgimpbase/gimpbase.h"
#include "config-types.h"
#include "gimpconfig.h"
#include "gimpconfig-params.h"
#include "gimpconfig-utils.h"
@ -235,7 +236,8 @@ gimp_config_reset_properties (GObject *object)
if (G_IS_PARAM_SPEC_OBJECT (prop_spec))
{
if (g_type_interface_peek (g_type_class_peek (prop_spec->value_type),
if ((prop_spec->flags & GIMP_PARAM_SERIALIZE) &&
g_type_interface_peek (g_type_class_peek (prop_spec->value_type),
GIMP_TYPE_CONFIG_INTERFACE))
{
g_value_init (&value, prop_spec->value_type);

View File

@ -46,6 +46,7 @@
#include "gimpmarshal.h"
#include "gimppalette.h"
#include "gimppattern.h"
#include "gimptemplate.h"
#include "gimptoolinfo.h"
#include "text/gimpfont.h"
@ -222,6 +223,17 @@ static void gimp_context_imagefile_list_thaw (GimpContainer *container,
static void gimp_context_real_set_imagefile (GimpContext *context,
GimpImagefile *imagefile);
/* template */
static void gimp_context_template_dirty (GimpTemplate *template,
GimpContext *context);
static void gimp_context_template_removed (GimpContainer *container,
GimpTemplate *template,
GimpContext *context);
static void gimp_context_template_list_thaw (GimpContainer *container,
GimpContext *context);
static void gimp_context_real_set_template (GimpContext *context,
GimpTemplate *template);
/* properties & signals */
@ -251,6 +263,7 @@ enum
FONT_CHANGED,
BUFFER_CHANGED,
IMAGEFILE_CHANGED,
TEMPLATE_CHANGED,
LAST_SIGNAL
};
@ -271,7 +284,8 @@ static gchar *gimp_context_prop_names[] =
"palette",
"font",
"buffer",
"imagefile"
"imagefile",
"template"
};
static GType gimp_context_prop_types[] =
@ -291,6 +305,7 @@ static GType gimp_context_prop_types[] =
0,
0,
0,
0,
0
};
@ -501,6 +516,16 @@ gimp_context_class_init (GimpContextClass *klass)
G_TYPE_NONE, 1,
GIMP_TYPE_IMAGEFILE);
gimp_context_signals[TEMPLATE_CHANGED] =
g_signal_new ("template_changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpContextClass, template_changed),
NULL, NULL,
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_TEMPLATE);
object_class->constructor = gimp_context_constructor;
object_class->set_property = gimp_context_set_property;
object_class->get_property = gimp_context_get_property;
@ -523,6 +548,7 @@ gimp_context_class_init (GimpContextClass *klass)
klass->font_changed = NULL;
klass->buffer_changed = NULL;
klass->imagefile_changed = NULL;
klass->template_changed = NULL;
gimp_context_prop_types[GIMP_CONTEXT_PROP_IMAGE] = GIMP_TYPE_IMAGE;
gimp_context_prop_types[GIMP_CONTEXT_PROP_TOOL] = GIMP_TYPE_TOOL_INFO;
@ -533,6 +559,7 @@ gimp_context_class_init (GimpContextClass *klass)
gimp_context_prop_types[GIMP_CONTEXT_PROP_FONT] = GIMP_TYPE_FONT;
gimp_context_prop_types[GIMP_CONTEXT_PROP_BUFFER] = GIMP_TYPE_BUFFER;
gimp_context_prop_types[GIMP_CONTEXT_PROP_IMAGEFILE] = GIMP_TYPE_IMAGEFILE;
gimp_context_prop_types[GIMP_CONTEXT_PROP_TEMPLATE] = GIMP_TYPE_TEMPLATE;
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_GIMP,
g_param_spec_object ("gimp",
@ -626,6 +653,12 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
GIMP_TYPE_IMAGEFILE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_TEMPLATE,
g_param_spec_object (gimp_context_prop_names[GIMP_CONTEXT_PROP_TEMPLATE],
NULL, NULL,
GIMP_TYPE_TEMPLATE,
G_PARAM_READWRITE));
}
static void
@ -660,6 +693,7 @@ gimp_context_init (GimpContext *context)
context->buffer = NULL;
context->imagefile = NULL;
context->template = NULL;
}
static void
@ -766,6 +800,15 @@ gimp_context_constructor (GType type,
object,
0);
g_signal_connect_object (gimp->templates, "remove",
G_CALLBACK (gimp_context_template_removed),
object,
0);
g_signal_connect_object (gimp->templates, "thaw",
G_CALLBACK (gimp_context_template_list_thaw),
object,
0);
return object;
}
@ -877,6 +920,12 @@ gimp_context_finalize (GObject *object)
context->imagefile = NULL;
}
if (context->template)
{
g_object_unref (context->template);
context->template = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@ -939,6 +988,9 @@ gimp_context_set_property (GObject *object,
case GIMP_CONTEXT_PROP_IMAGEFILE:
gimp_context_set_imagefile (context, g_value_get_object (value));
break;
case GIMP_CONTEXT_PROP_TEMPLATE:
gimp_context_set_template (context, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -1012,6 +1064,9 @@ gimp_context_get_property (GObject *object,
case GIMP_CONTEXT_PROP_IMAGEFILE:
g_value_set_object (value, gimp_context_get_imagefile (context));
break;
case GIMP_CONTEXT_PROP_TEMPLATE:
g_value_set_object (value, gimp_context_get_template (context));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -1456,6 +1511,10 @@ gimp_context_copy_property (GimpContext *src,
gimp_context_real_set_imagefile (dest, src->imagefile);
break;
case GIMP_CONTEXT_PROP_TEMPLATE:
gimp_context_real_set_template (dest, src->template);
break;
default:
break;
}
@ -3111,3 +3170,162 @@ gimp_context_real_set_imagefile (GimpContext *context,
g_object_notify (G_OBJECT (context), "imagefile");
gimp_context_imagefile_changed (context);
}
/*****************************************************************************/
/* template ***************************************************************/
/*
static GimpTemplate *standard_template = NULL;
*/
GimpTemplate *
gimp_context_get_template (GimpContext *context)
{
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
return context->template;
}
void
gimp_context_set_template (GimpContext *context,
GimpTemplate *template)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
context_find_defined (context, GIMP_CONTEXT_PROP_TEMPLATE);
gimp_context_real_set_template (context, template);
}
void
gimp_context_template_changed (GimpContext *context)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_signal_emit (context,
gimp_context_signals[TEMPLATE_CHANGED], 0,
context->template);
}
/* the active template was modified */
static void
gimp_context_template_dirty (GimpTemplate *template,
GimpContext *context)
{
/*
g_free (context->template_name);
context->template_name = g_strdup (GIMP_OBJECT (template)->name);
*/
g_object_notify (G_OBJECT (context), "template");
gimp_context_template_changed (context);
}
/* the global gradient list is there again after refresh */
static void
gimp_context_template_list_thaw (GimpContainer *container,
GimpContext *context)
{
/*
GimpBuffer *template;
if (! context->template_name)
context->template_name = g_strdup (context->gimp->config->default_template);
if ((template = (GimpTemplate *)
gimp_container_get_child_by_name (container,
context->template_name)))
{
gimp_context_real_set_template (context, template);
return;
}
*/
if (gimp_container_num_children (container))
{
gimp_context_real_set_template
(context,
GIMP_TEMPLATE (gimp_container_get_child_by_index (container, 0)));
}
else
{
g_object_notify (G_OBJECT (context), "template");
gimp_context_template_changed (context);
}
/*
else
gimp_context_real_set_template (context,
GIMP_TEMPLATE (gimp_template_get_standard ()));
*/
}
/* the active template disappeared */
static void
gimp_context_template_removed (GimpContainer *container,
GimpTemplate *template,
GimpContext *context)
{
if (template == context->template)
{
context->template = NULL;
g_signal_handlers_disconnect_by_func (template,
gimp_context_template_dirty,
context);
g_object_unref (template);
if (! gimp_container_frozen (container))
gimp_context_template_list_thaw (container, context);
}
}
static void
gimp_context_real_set_template (GimpContext *context,
GimpTemplate *template)
{
/*
if (! standard_template)
standard_template = GIMP_TEMPLATE (gimp_template_get_standard ());
*/
if (context->template == template)
return;
/*
if (context->template_name && template != standard_template)
{
g_free (context->template_name);
context->template_name = NULL;
}
*/
/* disconnect from the old template's signals */
if (context->template)
{
g_signal_handlers_disconnect_by_func (context->template,
gimp_context_template_dirty,
context);
g_object_unref (context->template);
}
context->template = template;
if (template)
{
g_object_ref (template);
g_signal_connect_object (template, "name_changed",
G_CALLBACK (gimp_context_template_dirty),
context,
0);
/*
if (template != standard_template)
context->template_name = g_strdup (GIMP_OBJECT (template)->name);
*/
}
g_object_notify (G_OBJECT (context), "template");
gimp_context_template_changed (context);
}

View File

@ -44,8 +44,9 @@ typedef enum
GIMP_CONTEXT_PROP_FONT = 13,
GIMP_CONTEXT_PROP_BUFFER = 14,
GIMP_CONTEXT_PROP_IMAGEFILE = 15,
GIMP_CONTEXT_PROP_TEMPLATE = 16,
GIMP_CONTEXT_LAST_PROP = GIMP_CONTEXT_PROP_IMAGEFILE
GIMP_CONTEXT_LAST_PROP = GIMP_CONTEXT_PROP_TEMPLATE
} GimpContextPropType;
typedef enum
@ -64,6 +65,7 @@ typedef enum
GIMP_CONTEXT_FONT_MASK = 1 << 13,
GIMP_CONTEXT_BUFFER_MASK = 1 << 14,
GIMP_CONTEXT_IMAGEFILE_MASK = 1 << 15,
GIMP_CONTEXT_TEMPLATE_MASK = 1 << 16,
/* aliases */
GIMP_CONTEXT_PAINT_PROPS_MASK = (GIMP_CONTEXT_FOREGROUND_MASK |
@ -80,6 +82,7 @@ typedef enum
GIMP_CONTEXT_FONT_MASK |
GIMP_CONTEXT_BUFFER_MASK |
GIMP_CONTEXT_IMAGEFILE_MASK |
GIMP_CONTEXT_TEMPLATE_MASK |
GIMP_CONTEXT_PAINT_PROPS_MASK)
} GimpContextPropMask;
@ -133,6 +136,7 @@ struct _GimpContext
GimpBuffer *buffer;
GimpImagefile *imagefile;
GimpTemplate *template;
};
struct _GimpContextClass
@ -169,6 +173,8 @@ struct _GimpContextClass
GimpBuffer *buffer);
void (* imagefile_changed) (GimpContext *context,
GimpImagefile *imagefile);
void (* template_changed) (GimpContext *context,
GimpTemplate *template);
};
@ -331,4 +337,11 @@ void gimp_context_set_imagefile (GimpContext *context,
void gimp_context_imagefile_changed (GimpContext *context);
/* template */
GimpTemplate * gimp_context_get_template (GimpContext *context);
void gimp_context_set_template (GimpContext *context,
GimpTemplate *template);
void gimp_context_template_changed (GimpContext *context);
#endif /* __GIMP_CONTEXT_H__ */

View File

@ -901,6 +901,26 @@ dialogs_document_grid_new (GimpDialogFactory *factory,
dialogs_set_editor_context_func);
}
GtkWidget *
dialogs_template_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
view = gimp_container_tree_view_new (context->gimp->templates,
context,
preview_size,
TRUE,
5, 3);
return dialogs_dockable_new (view,
_("List of Templates"), _("Templates"),
GIMP_STOCK_TEMPLATE,
dialogs_stock_text_tab_func,
dialogs_set_view_context_func);
}
/***** editors *****/

View File

@ -143,7 +143,8 @@ GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_tree_new (GimpDialogFactory *factory,
GtkWidget * dialogs_template_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);

View File

@ -118,6 +118,9 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp-document-grid", dialogs_document_grid_new,
GIMP_PREVIEW_SIZE_LARGE, FALSE, FALSE, FALSE, TRUE },
{ "gimp-template-list", dialogs_template_list_new,
GIMP_PREVIEW_SIZE_SMALL, FALSE, FALSE, FALSE, TRUE },
{ "gimp-brush-editor", dialogs_brush_editor_get,
0, TRUE, FALSE, FALSE, TRUE },
{ "gimp-gradient-editor", dialogs_gradient_editor_get,

View File

@ -901,6 +901,26 @@ dialogs_document_grid_new (GimpDialogFactory *factory,
dialogs_set_editor_context_func);
}
GtkWidget *
dialogs_template_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
view = gimp_container_tree_view_new (context->gimp->templates,
context,
preview_size,
TRUE,
5, 3);
return dialogs_dockable_new (view,
_("List of Templates"), _("Templates"),
GIMP_STOCK_TEMPLATE,
dialogs_stock_text_tab_func,
dialogs_set_view_context_func);
}
/***** editors *****/

View File

@ -143,7 +143,8 @@ GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_tree_new (GimpDialogFactory *factory,
GtkWidget * dialogs_template_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);

View File

@ -96,6 +96,8 @@ GimpItemFactoryEntry dialogs_menu_entries[] =
"<StockItem>", GIMP_STOCK_IMAGES),
ADD_TAB (N_("/Add Tab/Document History..."), "gimp-document-list",
"<StockItem>", GTK_STOCK_OPEN),
ADD_TAB (N_("/Add Tab/Templates..."), "gimp-template-list",
"<StockItem>", GIMP_STOCK_TEMPLATE),
ADD_TAB (N_("/Add Tab/Error Console..."), "gimp-error-console",
"<StockItem>", GIMP_STOCK_WARNING),

View File

@ -118,6 +118,9 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp-document-grid", dialogs_document_grid_new,
GIMP_PREVIEW_SIZE_LARGE, FALSE, FALSE, FALSE, TRUE },
{ "gimp-template-list", dialogs_template_list_new,
GIMP_PREVIEW_SIZE_SMALL, FALSE, FALSE, FALSE, TRUE },
{ "gimp-brush-editor", dialogs_brush_editor_get,
0, TRUE, FALSE, FALSE, TRUE },
{ "gimp-gradient-editor", dialogs_gradient_editor_get,

View File

@ -787,11 +787,16 @@ GimpItemFactoryEntry image_menu_entries[] =
"<StockItem>", GIMP_STOCK_IMAGES },
"gimp-image-list",
NULL, NULL },
{ { N_("/Dialogs/Document History..."), "foo",
{ { N_("/Dialogs/Document History..."), "",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-list",
"dialogs/document_index.html", NULL },
{ { N_("/Dialogs/Templates..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TEMPLATE },
"gimp-template-list",
"dialogs/templates.html", NULL },
{ { N_("/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_WARNING },

View File

@ -187,11 +187,16 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
"<StockItem>", GIMP_STOCK_IMAGES },
"gimp-image-list",
NULL, NULL },
{ { N_("/File/Dialogs/Document History..."), "foo",
{ { N_("/File/Dialogs/Document History..."), "",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-list",
"file/dialogs/document_index.html", NULL },
{ { N_("/File/Dialogs/Templates..."), "",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TEMPLATE },
"gimp-template-list",
"file/dialogs/templates.html", NULL },
{ { N_("/File/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_WARNING },

View File

@ -787,11 +787,16 @@ GimpItemFactoryEntry image_menu_entries[] =
"<StockItem>", GIMP_STOCK_IMAGES },
"gimp-image-list",
NULL, NULL },
{ { N_("/Dialogs/Document History..."), "foo",
{ { N_("/Dialogs/Document History..."), "",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-list",
"dialogs/document_index.html", NULL },
{ { N_("/Dialogs/Templates..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TEMPLATE },
"gimp-template-list",
"dialogs/templates.html", NULL },
{ { N_("/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_WARNING },

View File

@ -187,11 +187,16 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
"<StockItem>", GIMP_STOCK_IMAGES },
"gimp-image-list",
NULL, NULL },
{ { N_("/File/Dialogs/Document History..."), "foo",
{ { N_("/File/Dialogs/Document History..."), "",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-list",
"file/dialogs/document_index.html", NULL },
{ { N_("/File/Dialogs/Templates..."), "",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TEMPLATE },
"gimp-template-list",
"file/dialogs/templates.html", NULL },
{ { N_("/File/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_WARNING },

View File

@ -43,6 +43,7 @@
#include "core/gimplayermask.h"
#include "core/gimppalette.h"
#include "core/gimppattern.h"
#include "core/gimptemplate.h"
#include "core/gimptoolinfo.h"
#include "text/gimpfont.h"
@ -192,6 +193,12 @@ static void gimp_dnd_set_imagefile_data (GtkWidget *widget,
guchar *vals,
gint format,
gint length);
static void gimp_dnd_set_template_data (GtkWidget *widget,
GCallback set_template_func,
gpointer set_template_data,
guchar *vals,
gint format,
gint length);
static void gimp_dnd_set_tool_data (GtkWidget *widget,
GCallback set_tool_func,
gpointer set_tool_data,
@ -401,6 +408,17 @@ static GimpDndDataDef dnd_data_defs[] =
gimp_dnd_set_imagefile_data
},
{
GIMP_TARGET_TEMPLATE,
"gimp_dnd_set_template_func",
"gimp_dnd_set_template_data",
gimp_dnd_get_viewable_icon,
gimp_dnd_get_data_data,
gimp_dnd_set_template_data
},
{
GIMP_TARGET_TOOL,
@ -1179,6 +1197,10 @@ gimp_dnd_data_type_get_by_g_type (GType type)
{
dnd_type = GIMP_DND_TYPE_IMAGEFILE;
}
else if (g_type_is_a (type, GIMP_TYPE_TEMPLATE))
{
dnd_type = GIMP_DND_TYPE_TEMPLATE;
}
else if (g_type_is_a (type, GIMP_TYPE_TOOL_INFO))
{
dnd_type = GIMP_DND_TYPE_TOOL;
@ -1754,6 +1776,39 @@ gimp_dnd_set_imagefile_data (GtkWidget *widget,
}
/*****************************/
/* template dnd functions */
/*****************************/
static void
gimp_dnd_set_template_data (GtkWidget *widget,
GCallback set_template_func,
gpointer set_template_data,
guchar *vals,
gint format,
gint length)
{
GimpTemplate *template;
gchar *name;
if ((format != 8) || (length < 1))
{
g_warning ("Received invalid buffer data\n");
return;
}
name = (gchar *) vals;
template = (GimpTemplate *)
gimp_container_get_child_by_name (the_gimp->templates, name);
if (template)
(* (GimpDndDropViewableFunc) set_template_func) (widget,
GIMP_VIEWABLE (template),
set_template_data);
}
/************************/
/* tool dnd functions */
/************************/

View File

@ -40,8 +40,9 @@ typedef enum
GIMP_DND_TYPE_FONT = 15,
GIMP_DND_TYPE_BUFFER = 16,
GIMP_DND_TYPE_IMAGEFILE = 17,
GIMP_DND_TYPE_TOOL = 18,
GIMP_DND_TYPE_DIALOG = 19,
GIMP_DND_TYPE_TEMPLATE = 18,
GIMP_DND_TYPE_TOOL = 19,
GIMP_DND_TYPE_DIALOG = 20,
GIMP_DND_TYPE_LAST = GIMP_DND_TYPE_DIALOG
} GimpDndType;
@ -98,6 +99,9 @@ typedef enum
#define GIMP_TARGET_IMAGEFILE \
{ "GIMP_IMAGEFILE", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGEFILE }
#define GIMP_TARGET_TEMPLATE \
{ "GIMP_TEMPLATE", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TEMPLATE }
#define GIMP_TARGET_TOOL \
{ "GIMP_TOOL", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TOOL }

View File

@ -25,11 +25,12 @@
#include <glib-object.h>
#include "libgimpbase/gimpenv.h"
#include "libgimpbase/gimpbase.h"
#include "config-types.h"
#include "gimpconfig.h"
#include "gimpconfig-params.h"
#include "gimpconfig-utils.h"
@ -235,7 +236,8 @@ gimp_config_reset_properties (GObject *object)
if (G_IS_PARAM_SPEC_OBJECT (prop_spec))
{
if (g_type_interface_peek (g_type_class_peek (prop_spec->value_type),
if ((prop_spec->flags & GIMP_PARAM_SERIALIZE) &&
g_type_interface_peek (g_type_class_peek (prop_spec->value_type),
GIMP_TYPE_CONFIG_INTERFACE))
{
g_value_init (&value, prop_spec->value_type);