Commit bdc91d6c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Remove support for the old undo pop and free cruft:

2007-02-03  Michael Natterer  <mitch@gimp.org>

	Remove support for the old undo pop and free cruft:

	* app/core/core-types.h: remove typedefs GimpUndoPopFunc and
	GimpUndoFreeFunc.

	* app/core/gimpundo.[ch]: remove members and properties size,
	data, pop_func and free_func.

	* app/core/gimpimage-undo.[ch] (gimp_image_undo_push): remove
	parameters size, struct_size, pop_func and free_func.

	* app/core/gimpimage-undo-push.c
	* app/tools/gimptransformtool.c
	* app/paint/gimpink.c
	* app/paint/gimppaintcore.c: change calls to above function
	accordingly.


svn path=/trunk/; revision=21845
parent a95bbc5d
2007-02-03 Michael Natterer <mitch@gimp.org>
Remove support for the old undo pop and free cruft:
* app/core/core-types.h: remove typedefs GimpUndoPopFunc and
GimpUndoFreeFunc.
* app/core/gimpundo.[ch]: remove members and properties size,
data, pop_func and free_func.
* app/core/gimpimage-undo.[ch] (gimp_image_undo_push): remove
parameters size, struct_size, pop_func and free_func.
* app/core/gimpimage-undo-push.c
* app/tools/gimptransformtool.c
* app/paint/gimpink.c
* app/paint/gimppaintcore.c: change calls to above function
accordingly.
2007-02-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpfloatingselundo.[ch]: implement GIMP_UNDO_FS_TO_LAYER.
......@@ -165,18 +165,12 @@ typedef struct _GimpScanConvert GimpScanConvert;
/* functions */
typedef void (* GimpInitStatusFunc) (const gchar *text1,
const gchar *text2,
gdouble percentage);
typedef gboolean (* GimpObjectFilterFunc) (const GimpObject *object,
gpointer user_data);
typedef gboolean (* GimpUndoPopFunc) (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
typedef void (* GimpUndoFreeFunc) (GimpUndo *undo,
GimpUndoMode undo_mode);
typedef void (* GimpInitStatusFunc) (const gchar *text1,
const gchar *text2,
gdouble percentage);
typedef gboolean (* GimpObjectFilterFunc) (const GimpObject *object,
gpointer user_data);
/* structs */
......
This diff is collapsed.
......@@ -248,20 +248,15 @@ gimp_image_undo_group_end (GimpImage *image)
GimpUndo *
gimp_image_undo_push (GimpImage *image,
GType object_type,
gint64 size,
gsize struct_size,
GimpUndoType undo_type,
const gchar *name,
GimpDirtyMask dirty_mask,
GimpUndoPopFunc pop_func,
GimpUndoFreeFunc free_func,
...)
{
GParameter *params = NULL;
gint n_params = 0;
va_list args;
GimpUndo *undo;
gpointer undo_struct = NULL;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (g_type_is_a (object_type, GIMP_TYPE_UNDO), NULL);
......@@ -279,21 +274,14 @@ gimp_image_undo_push (GimpImage *image,
if (! name)
name = gimp_undo_type_to_name (undo_type);
if (struct_size > 0)
undo_struct = g_malloc0 (struct_size);
params = gimp_parameters_append (object_type, params, &n_params,
"name", name,
"image", image,
"undo-type", undo_type,
"dirty-mask", dirty_mask,
"data", undo_struct,
"size", size,
"pop-func", pop_func,
"free-func", free_func,
NULL);
va_start (args, free_func);
va_start (args, dirty_mask);
params = gimp_parameters_append_valist (object_type, params, &n_params, args);
va_end (args);
......
......@@ -35,13 +35,9 @@ gboolean gimp_image_undo_group_end (GimpImage *image);
GimpUndo * gimp_image_undo_push (GimpImage *image,
GType object_type,
gint64 size,
gsize struct_size,
GimpUndoType undo_type,
const gchar *name,
GimpDirtyMask dirty_mask,
GimpUndoPopFunc pop_func,
GimpUndoFreeFunc free_func,
...) G_GNUC_NULL_TERMINATED;
GimpUndo * gimp_image_undo_can_compress (GimpImage *image,
......
......@@ -52,11 +52,7 @@ enum
PROP_0,
PROP_IMAGE,
PROP_UNDO_TYPE,
PROP_DIRTY_MASK,
PROP_DATA,
PROP_SIZE,
PROP_POP_FUNC,
PROP_FREE_FUNC
PROP_DIRTY_MASK
};
......@@ -167,27 +163,6 @@ gimp_undo_class_init (GimpUndoClass *klass)
GIMP_DIRTY_NONE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_DATA,
g_param_spec_pointer ("data", NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_SIZE,
g_param_spec_int64 ("size", NULL, NULL,
0, G_MAXINT64, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_POP_FUNC,
g_param_spec_pointer ("pop-func", NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_FREE_FUNC,
g_param_spec_pointer ("free-func", NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
......@@ -253,18 +228,7 @@ gimp_undo_set_property (GObject *object,
case PROP_DIRTY_MASK:
undo->dirty_mask = g_value_get_flags (value);
break;
case PROP_DATA:
undo->data = g_value_get_pointer (value);
break;
case PROP_SIZE:
undo->size = g_value_get_int64 (value);
break;
case PROP_POP_FUNC:
undo->pop_func = g_value_get_pointer (value);
break;
case PROP_FREE_FUNC:
undo->free_func = g_value_get_pointer (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -290,18 +254,7 @@ gimp_undo_get_property (GObject *object,
case PROP_DIRTY_MASK:
g_value_set_flags (value, undo->dirty_mask);
break;
case PROP_DATA:
g_value_set_pointer (value, undo->data);
break;
case PROP_SIZE:
g_value_set_int64 (value, undo->size);
break;
case PROP_POP_FUNC:
g_value_set_pointer (value, undo->pop_func);
break;
case PROP_FREE_FUNC:
g_value_set_pointer (value, undo->free_func);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -313,7 +266,7 @@ gimp_undo_get_memsize (GimpObject *object,
gint64 *gui_size)
{
GimpUndo *undo = GIMP_UNDO (object);
gint64 memsize = undo->size;
gint64 memsize = 0;
if (undo->preview)
*gui_size += temp_buf_get_memsize (undo->preview);
......@@ -383,16 +336,12 @@ gimp_undo_real_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
if (undo->pop_func)
undo->pop_func (undo, undo_mode, accum);
}
static void
gimp_undo_real_free (GimpUndo *undo,
GimpUndoMode undo_mode)
{
if (undo->free_func)
undo->free_func (undo, undo_mode);
}
void
......
......@@ -52,13 +52,8 @@ struct _GimpUndo
guint time; /* time of undo step construction */
GimpUndoType undo_type; /* undo type */
gpointer data; /* data to implement the undo */
gint64 size; /* size of undo item */
GimpDirtyMask dirty_mask; /* affected parts of the image */
GimpUndoPopFunc pop_func; /* function pointer to undo pop proc */
GimpUndoFreeFunc free_func; /* function pointer to free undo data */
TempBuf *preview;
guint preview_idle_id;
};
......
......@@ -236,10 +236,8 @@ gimp_ink_push_undo (GimpPaintCore *core,
const gchar *undo_desc)
{
return gimp_image_undo_push (image, GIMP_TYPE_INK_UNDO,
0, 0,
GIMP_UNDO_INK, undo_desc,
0,
NULL, NULL,
"paint-core", core,
NULL);
}
......
......@@ -280,10 +280,8 @@ gimp_paint_core_real_push_undo (GimpPaintCore *core,
const gchar *undo_desc)
{
return gimp_image_undo_push (image, GIMP_TYPE_PAINT_CORE_UNDO,
0, 0,
GIMP_UNDO_PAINT, undo_desc,
0,
NULL, NULL,
"paint-core", core,
NULL);
}
......
......@@ -1281,10 +1281,8 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool,
tool->drawable = gimp_image_active_drawable (display->image);
gimp_image_undo_push (display->image, GIMP_TYPE_TRANSFORM_TOOL_UNDO,
0, 0,
GIMP_UNDO_TRANSFORM, NULL,
0,
NULL, NULL,
"transform-tool", tr_tool,
NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment