Commit 950e35d5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

renamed the "resize" signal to "size_changed".

2001-05-06  Michael Natterer  <mitch@gimp.org>

	* app/gimpimage.[ch]: renamed the "resize" signal to "size_changed".

	* app/gimage.c: changed accordingly.

	* app/undo.c: renamed the "shrink_wrap" to "size_changed", call
	gimp_image_size_changed() and let the handlers do the work.

	* app/widgets/gimplistitem.[ch]: added a virtual set_preview_size()
	method and a default implementation.

	* app/widgets/gimplayerlistitem.c: added an inplementation of
	set_preview_size() which set's the size of the mask preview.

	* app/widgets/gimpchannellistview.c: implement set_preview_size()
	and set the size of the component previews.

	* app/widgets/gimpcontainerlistview.c: call
	gimp_list_item_set_preview_size() instead of resizing the preview
	manually.

	* app/widgets/gimpcontainerview.c: emit "set_preview_size" even if
	the size has not changed so we can use it to re-calculate the
	preview size on image size change.

	* app/widgets/gimpdrawablelistview.c: connect to the image's
	"size_changed" signal and trigger preview size re-calculation in
	the callback.
parent 59b06707
2001-05-06 Michael Natterer <mitch@gimp.org>
* app/gimpimage.[ch]: renamed the "resize" signal to "size_changed".
* app/gimage.c: changed accordingly.
* app/undo.c: renamed the "shrink_wrap" to "size_changed", call
gimp_image_size_changed() and let the handlers do the work.
* app/widgets/gimplistitem.[ch]: added a virtual set_preview_size()
method and a default implementation.
* app/widgets/gimplayerlistitem.c: added an inplementation of
set_preview_size() which set's the size of the mask preview.
* app/widgets/gimpchannellistview.c: implement set_preview_size()
and set the size of the component previews.
* app/widgets/gimpcontainerlistview.c: call
gimp_list_item_set_preview_size() instead of resizing the preview
manually.
* app/widgets/gimpcontainerview.c: emit "set_preview_size" even if
the size has not changed so we can use it to re-calculate the
preview size on image size change.
* app/widgets/gimpdrawablelistview.c: connect to the image's
"size_changed" signal and trigger preview size re-calculation in
the callback.
2001-05-06 Michael Natterer <mitch@gimp.org>
* app/appenums.h: added GimpDropMode...
......
......@@ -156,6 +156,7 @@ guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
enum
{
MODE_CHANGED,
SIZE_CHANGED,
ACTIVE_LAYER_CHANGED,
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
......@@ -163,7 +164,6 @@ enum
CLEAN,
DIRTY,
REPAINT,
RESIZE,
RESTRUCTURE,
COLORMAP_CHANGED,
UNDO_EVENT,
......@@ -225,6 +225,15 @@ gimp_image_class_init (GimpImageClass *klass)
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[SIZE_CHANGED] =
gtk_signal_new ("size_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
size_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[ACTIVE_LAYER_CHANGED] =
gtk_signal_new ("active_layer_changed",
GTK_RUN_FIRST,
......@@ -294,15 +303,6 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RESIZE] =
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
......@@ -342,14 +342,16 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->get_preview = gimp_image_get_preview;
viewable_class->get_new_preview = gimp_image_get_new_preview;
klass->mode_changed = NULL;
klass->size_changed = NULL;
klass->active_layer_changed = NULL;
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
klass->repaint = NULL;
klass->resize = NULL;
klass->restructure = NULL;
klass->colormap_changed = NULL;
klass->undo_event = NULL;
......@@ -798,7 +800,9 @@ gimp_image_resize (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -925,7 +929,9 @@ gimp_image_scale (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -1631,6 +1637,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_size_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[SIZE_CHANGED]);
}
/************************************************************/
/* Projection functions */
/************************************************************/
......
......@@ -149,12 +149,14 @@ struct _GimpImageClass
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* size_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* repaint) (GimpImage *gimage,
......@@ -162,7 +164,6 @@ struct _GimpImageClass
gint y1,
gint x2,
gint y2);
void (* resize) (GimpImage *gimage);
void (* restructure) (GimpImage *gimage);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
......@@ -307,6 +308,7 @@ void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
/* layer/channel functions */
......
......@@ -156,6 +156,7 @@ guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
enum
{
MODE_CHANGED,
SIZE_CHANGED,
ACTIVE_LAYER_CHANGED,
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
......@@ -163,7 +164,6 @@ enum
CLEAN,
DIRTY,
REPAINT,
RESIZE,
RESTRUCTURE,
COLORMAP_CHANGED,
UNDO_EVENT,
......@@ -225,6 +225,15 @@ gimp_image_class_init (GimpImageClass *klass)
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[SIZE_CHANGED] =
gtk_signal_new ("size_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
size_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[ACTIVE_LAYER_CHANGED] =
gtk_signal_new ("active_layer_changed",
GTK_RUN_FIRST,
......@@ -294,15 +303,6 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RESIZE] =
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
......@@ -342,14 +342,16 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->get_preview = gimp_image_get_preview;
viewable_class->get_new_preview = gimp_image_get_new_preview;
klass->mode_changed = NULL;
klass->size_changed = NULL;
klass->active_layer_changed = NULL;
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
klass->repaint = NULL;
klass->resize = NULL;
klass->restructure = NULL;
klass->colormap_changed = NULL;
klass->undo_event = NULL;
......@@ -798,7 +800,9 @@ gimp_image_resize (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -925,7 +929,9 @@ gimp_image_scale (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -1631,6 +1637,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_size_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[SIZE_CHANGED]);
}
/************************************************************/
/* Projection functions */
/************************************************************/
......
......@@ -149,12 +149,14 @@ struct _GimpImageClass
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* size_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* repaint) (GimpImage *gimage,
......@@ -162,7 +164,6 @@ struct _GimpImageClass
gint y1,
gint x2,
gint y2);
void (* resize) (GimpImage *gimage);
void (* restructure) (GimpImage *gimage);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
......@@ -307,6 +308,7 @@ void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
/* layer/channel functions */
......
......@@ -156,6 +156,7 @@ guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
enum
{
MODE_CHANGED,
SIZE_CHANGED,
ACTIVE_LAYER_CHANGED,
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
......@@ -163,7 +164,6 @@ enum
CLEAN,
DIRTY,
REPAINT,
RESIZE,
RESTRUCTURE,
COLORMAP_CHANGED,
UNDO_EVENT,
......@@ -225,6 +225,15 @@ gimp_image_class_init (GimpImageClass *klass)
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[SIZE_CHANGED] =
gtk_signal_new ("size_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
size_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[ACTIVE_LAYER_CHANGED] =
gtk_signal_new ("active_layer_changed",
GTK_RUN_FIRST,
......@@ -294,15 +303,6 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RESIZE] =
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
......@@ -342,14 +342,16 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->get_preview = gimp_image_get_preview;
viewable_class->get_new_preview = gimp_image_get_new_preview;
klass->mode_changed = NULL;
klass->size_changed = NULL;
klass->active_layer_changed = NULL;
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
klass->repaint = NULL;
klass->resize = NULL;
klass->restructure = NULL;
klass->colormap_changed = NULL;
klass->undo_event = NULL;
......@@ -798,7 +800,9 @@ gimp_image_resize (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -925,7 +929,9 @@ gimp_image_scale (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -1631,6 +1637,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_size_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[SIZE_CHANGED]);
}
/************************************************************/
/* Projection functions */
/************************************************************/
......
......@@ -149,12 +149,14 @@ struct _GimpImageClass
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* size_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* repaint) (GimpImage *gimage,
......@@ -162,7 +164,6 @@ struct _GimpImageClass
gint y1,
gint x2,
gint y2);
void (* resize) (GimpImage *gimage);
void (* restructure) (GimpImage *gimage);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
......@@ -307,6 +308,7 @@ void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
/* layer/channel functions */
......
......@@ -156,6 +156,7 @@ guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
enum
{
MODE_CHANGED,
SIZE_CHANGED,
ACTIVE_LAYER_CHANGED,
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
......@@ -163,7 +164,6 @@ enum
CLEAN,
DIRTY,
REPAINT,
RESIZE,
RESTRUCTURE,
COLORMAP_CHANGED,
UNDO_EVENT,
......@@ -225,6 +225,15 @@ gimp_image_class_init (GimpImageClass *klass)
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[SIZE_CHANGED] =
gtk_signal_new ("size_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
size_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[ACTIVE_LAYER_CHANGED] =
gtk_signal_new ("active_layer_changed",
GTK_RUN_FIRST,
......@@ -294,15 +303,6 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RESIZE] =
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
......@@ -342,14 +342,16 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->get_preview = gimp_image_get_preview;
viewable_class->get_new_preview = gimp_image_get_new_preview;
klass->mode_changed = NULL;
klass->size_changed = NULL;
klass->active_layer_changed = NULL;
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
klass->repaint = NULL;
klass->resize = NULL;
klass->restructure = NULL;
klass->colormap_changed = NULL;
klass->undo_event = NULL;
......@@ -798,7 +800,9 @@ gimp_image_resize (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -925,7 +929,9 @@ gimp_image_scale (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
}
......@@ -1631,6 +1637,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_size_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[SIZE_CHANGED]);
}
/************************************************************/
/* Projection functions */
/************************************************************/
......
......@@ -149,12 +149,14 @@ struct _GimpImageClass
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* size_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* repaint) (GimpImage *gimage,
......@@ -162,7 +164,6 @@ struct _GimpImageClass
gint y1,
gint x2,
gint y2);
void (* resize) (GimpImage *gimage);
void (* restructure) (GimpImage *gimage);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
......@@ -307,6 +308,7 @@ void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
/* layer/channel functions */
......
......@@ -156,6 +156,7 @@ guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
enum
{
MODE_CHANGED,
SIZE_CHANGED,
ACTIVE_LAYER_CHANGED,
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
......@@ -163,7 +164,6 @@ enum
CLEAN,
DIRTY,
REPAINT,
RESIZE,
RESTRUCTURE,
COLORMAP_CHANGED,
UNDO_EVENT,
......@@ -225,6 +225,15 @@ gimp_image_class_init (GimpImageClass *klass)
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[SIZE_CHANGED] =
gtk_signal_new ("size_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
size_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[ACTIVE_LAYER_CHANGED] =
gtk_signal_new ("active_layer_changed",
GTK_RUN_FIRST,
......@@ -294,15 +303,6 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_INT,
GTK_TYPE_INT);
gimp_image_signals[RESIZE] =
gtk_signal_new ("resize",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
resize),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[RESTRUCTURE] =
gtk_signal_new ("restructure",
GTK_RUN_FIRST,
......@@ -342,14 +342,16 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->get_preview = gimp_image_get_preview;
viewable_class->get_new_preview = gimp_image_get_new_preview;
klass->mode_changed = NULL;
klass->size_changed = NULL;
klass->active_layer_changed = NULL;
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
klass->repaint = NULL;
klass->resize = NULL;
klass->restructure = NULL;
klass->colormap_changed = NULL;
klass->undo_event = NULL;
......@@ -798,7 +800,9 @@ gimp_image_resize (GimpImage *gimage,
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESIZE]);
undo_push_group_end (gimage);