Invalidate the image preview after the projection is completely
2007-06-26 Michael Natterer <mitch@gimp.org> Invalidate the image preview after the projection is completely constructed. Fixes bug #449141. * app/core/gimpmarshal.list: add VOID:BOOLEAN * app/core/gimpimage.[ch]: add boolean parameter invalidate_preview to the "flush" signal. * app/core/gimpprojection.[ch]: add boolean member invalidate_preview to the GimpProjection struct. Set it to TRUE if it was TRUE in the image's "flush" signal. When the projection is completely constructed after a flush, invalidate the image's preview. * app/display/gimpdisplay-handlers.c * app/widgets/gimpitemtreeview.c * app/widgets/gimpimagedock.c * app/widgets/gimpimageeditor.c: changed callback signatures accordingly. svn path=/trunk/; revision=22840
This commit is contained in:

committed by
Michael Natterer

parent
48738dbbdd
commit
d8c632cb93
22
ChangeLog
22
ChangeLog
@ -1,3 +1,25 @@
|
|||||||
|
2007-06-26 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
Invalidate the image preview after the projection is
|
||||||
|
completely constructed. Fixes bug #449141.
|
||||||
|
|
||||||
|
* app/core/gimpmarshal.list: add VOID:BOOLEAN
|
||||||
|
|
||||||
|
* app/core/gimpimage.[ch]: add boolean parameter
|
||||||
|
invalidate_preview to the "flush" signal.
|
||||||
|
|
||||||
|
* app/core/gimpprojection.[ch]: add boolean member
|
||||||
|
invalidate_preview to the GimpProjection struct. Set it to TRUE if
|
||||||
|
it was TRUE in the image's "flush" signal. When the projection is
|
||||||
|
completely constructed after a flush, invalidate the image's
|
||||||
|
preview.
|
||||||
|
|
||||||
|
* app/display/gimpdisplay-handlers.c
|
||||||
|
* app/widgets/gimpitemtreeview.c
|
||||||
|
* app/widgets/gimpimagedock.c
|
||||||
|
* app/widgets/gimpimageeditor.c: changed callback signatures
|
||||||
|
accordingly.
|
||||||
|
|
||||||
2007-06-26 Sven Neumann <sven@gimp.org>
|
2007-06-26 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/widgets/gimpimageprofileview.c (gimp_image_profile_view_query):
|
* app/widgets/gimpimageprofileview.c (gimp_image_profile_view_query):
|
||||||
|
@ -150,7 +150,8 @@ static gchar * gimp_image_get_description (GimpViewable *viewable,
|
|||||||
gchar **tooltip);
|
gchar **tooltip);
|
||||||
static void gimp_image_real_colormap_changed (GimpImage *image,
|
static void gimp_image_real_colormap_changed (GimpImage *image,
|
||||||
gint color_index);
|
gint color_index);
|
||||||
static void gimp_image_real_flush (GimpImage *image);
|
static void gimp_image_real_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview);
|
||||||
|
|
||||||
static void gimp_image_mask_update (GimpDrawable *drawable,
|
static void gimp_image_mask_update (GimpDrawable *drawable,
|
||||||
gint x,
|
gint x,
|
||||||
@ -472,8 +473,9 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (GimpImageClass, flush),
|
G_STRUCT_OFFSET (GimpImageClass, flush),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
gimp_marshal_VOID__VOID,
|
gimp_marshal_VOID__BOOLEAN,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 1,
|
||||||
|
G_TYPE_BOOLEAN);
|
||||||
|
|
||||||
object_class->constructor = gimp_image_constructor;
|
object_class->constructor = gimp_image_constructor;
|
||||||
object_class->set_property = gimp_image_set_property;
|
object_class->set_property = gimp_image_set_property;
|
||||||
@ -1123,7 +1125,8 @@ gimp_image_real_colormap_changed (GimpImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_real_flush (GimpImage *image)
|
gimp_image_real_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview)
|
||||||
{
|
{
|
||||||
if (image->flush_accum.alpha_changed)
|
if (image->flush_accum.alpha_changed)
|
||||||
{
|
{
|
||||||
@ -1139,7 +1142,9 @@ gimp_image_real_flush (GimpImage *image)
|
|||||||
|
|
||||||
if (image->flush_accum.preview_invalidated)
|
if (image->flush_accum.preview_invalidated)
|
||||||
{
|
{
|
||||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image));
|
/* don't invalidate the preview here, the projection does this when
|
||||||
|
* it is completely constructed.
|
||||||
|
*/
|
||||||
image->flush_accum.preview_invalidated = FALSE;
|
image->flush_accum.preview_invalidated = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1977,7 +1982,8 @@ gimp_image_flush (GimpImage *image)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||||
|
|
||||||
g_signal_emit (image, gimp_image_signals[FLUSH], 0);
|
g_signal_emit (image, gimp_image_signals[FLUSH], 0,
|
||||||
|
image->flush_accum.preview_invalidated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,7 +227,8 @@ struct _GimpImageClass
|
|||||||
GimpUndoEvent event,
|
GimpUndoEvent event,
|
||||||
GimpUndo *undo);
|
GimpUndo *undo);
|
||||||
|
|
||||||
void (* flush) (GimpImage *image);
|
void (* flush) (GimpImage *image,
|
||||||
|
gboolean invalidate_preview);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ BOOLEAN: ENUM, INT
|
|||||||
BOOLEAN: OBJECT, POINTER
|
BOOLEAN: OBJECT, POINTER
|
||||||
BOOLEAN: OBJECT, POINTER, STRING
|
BOOLEAN: OBJECT, POINTER, STRING
|
||||||
|
|
||||||
|
VOID: BOOLEAN
|
||||||
VOID: BOOLEAN, INT, INT, INT, INT
|
VOID: BOOLEAN, INT, INT, INT, INT
|
||||||
VOID: BOXED
|
VOID: BOXED
|
||||||
VOID: BOXED, ENUM
|
VOID: BOXED, ENUM
|
||||||
|
@ -95,6 +95,7 @@ static void gimp_projection_image_size_changed (GimpImage *image,
|
|||||||
static void gimp_projection_image_mode_changed (GimpImage *image,
|
static void gimp_projection_image_mode_changed (GimpImage *image,
|
||||||
GimpProjection *proj);
|
GimpProjection *proj);
|
||||||
static void gimp_projection_image_flush (GimpImage *image,
|
static void gimp_projection_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpProjection *proj);
|
GimpProjection *proj);
|
||||||
|
|
||||||
|
|
||||||
@ -474,6 +475,15 @@ gimp_projection_flush_whenever (GimpProjection *proj,
|
|||||||
gimp_area_list_free (proj->update_areas);
|
gimp_area_list_free (proj->update_areas);
|
||||||
proj->update_areas = NULL;
|
proj->update_areas = NULL;
|
||||||
}
|
}
|
||||||
|
else if (! now && proj->invalidate_preview)
|
||||||
|
{
|
||||||
|
/* invalidate the preview here since it is constructed from
|
||||||
|
* the projection
|
||||||
|
*/
|
||||||
|
proj->invalidate_preview = FALSE;
|
||||||
|
|
||||||
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (proj->image));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -582,6 +592,16 @@ gimp_projection_idle_render_callback (gpointer data)
|
|||||||
/* FINISHED */
|
/* FINISHED */
|
||||||
proj->idle_render.idle_id = 0;
|
proj->idle_render.idle_id = 0;
|
||||||
|
|
||||||
|
if (proj->invalidate_preview)
|
||||||
|
{
|
||||||
|
/* invalidate the preview here since it is constructed from
|
||||||
|
* the projection
|
||||||
|
*/
|
||||||
|
proj->invalidate_preview = FALSE;
|
||||||
|
|
||||||
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (proj->image));
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -701,7 +721,11 @@ gimp_projection_image_mode_changed (GimpImage *image,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_projection_image_flush (GimpImage *image,
|
gimp_projection_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpProjection *proj)
|
GimpProjection *proj)
|
||||||
{
|
{
|
||||||
|
if (invalidate_preview)
|
||||||
|
proj->invalidate_preview = TRUE;
|
||||||
|
|
||||||
gimp_projection_flush (proj);
|
gimp_projection_flush (proj);
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ struct _GimpProjection
|
|||||||
GimpProjectionIdleRender idle_render;
|
GimpProjectionIdleRender idle_render;
|
||||||
|
|
||||||
gboolean construct_flag;
|
gboolean construct_flag;
|
||||||
|
gboolean invalidate_preview;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpProjectionClass
|
struct _GimpProjectionClass
|
||||||
|
@ -45,6 +45,7 @@ static void gimp_display_update_handler (GimpProjection *projection,
|
|||||||
gint h,
|
gint h,
|
||||||
GimpDisplay *display);
|
GimpDisplay *display);
|
||||||
static void gimp_display_flush_handler (GimpImage *image,
|
static void gimp_display_flush_handler (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpDisplay *display);
|
GimpDisplay *display);
|
||||||
static void gimp_display_saved_handler (GimpImage *image,
|
static void gimp_display_saved_handler (GimpImage *image,
|
||||||
const gchar *uri,
|
const gchar *uri,
|
||||||
@ -137,6 +138,7 @@ gimp_display_update_handler (GimpProjection *projection,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_flush_handler (GimpImage *image,
|
gimp_display_flush_handler (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpDisplay *display)
|
GimpDisplay *display)
|
||||||
{
|
{
|
||||||
gimp_display_flush (display);
|
gimp_display_flush (display);
|
||||||
|
@ -47,6 +47,7 @@ static void gimp_image_dock_display_changed (GimpContext *context,
|
|||||||
GimpObject *display,
|
GimpObject *display,
|
||||||
GimpImageDock *dock);
|
GimpImageDock *dock);
|
||||||
static void gimp_image_dock_image_flush (GimpImage *image,
|
static void gimp_image_dock_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpImageDock *dock);
|
GimpImageDock *dock);
|
||||||
|
|
||||||
static void gimp_image_dock_notify_transient (GimpConfig *config,
|
static void gimp_image_dock_notify_transient (GimpConfig *config,
|
||||||
@ -167,6 +168,7 @@ gimp_image_dock_display_changed (GimpContext *context,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_dock_image_flush (GimpImage *image,
|
gimp_image_dock_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpImageDock *dock)
|
GimpImageDock *dock)
|
||||||
{
|
{
|
||||||
if (image == gimp_context_get_image (GIMP_DOCK (dock)->context))
|
if (image == gimp_context_get_image (GIMP_DOCK (dock)->context))
|
||||||
|
@ -38,6 +38,7 @@ static void gimp_image_editor_destroy (GtkObject *object);
|
|||||||
static void gimp_image_editor_real_set_image (GimpImageEditor *editor,
|
static void gimp_image_editor_real_set_image (GimpImageEditor *editor,
|
||||||
GimpImage *image);
|
GimpImage *image);
|
||||||
static void gimp_image_editor_image_flush (GimpImage *image,
|
static void gimp_image_editor_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpImageEditor *editor);
|
GimpImageEditor *editor);
|
||||||
|
|
||||||
|
|
||||||
@ -161,6 +162,7 @@ gimp_image_editor_get_image (GimpImageEditor *editor)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_editor_image_flush (GimpImage *image,
|
gimp_image_editor_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpImageEditor *editor)
|
GimpImageEditor *editor)
|
||||||
{
|
{
|
||||||
if (GIMP_EDITOR (editor)->ui_manager)
|
if (GIMP_EDITOR (editor)->ui_manager)
|
||||||
|
@ -75,6 +75,7 @@ static void gimp_item_tree_view_real_set_image (GimpItemTreeView *view,
|
|||||||
GimpImage *image);
|
GimpImage *image);
|
||||||
|
|
||||||
static void gimp_item_tree_view_image_flush (GimpImage *image,
|
static void gimp_item_tree_view_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpItemTreeView *view);
|
GimpItemTreeView *view);
|
||||||
|
|
||||||
static void gimp_item_tree_view_set_container (GimpContainerView *view,
|
static void gimp_item_tree_view_set_container (GimpContainerView *view,
|
||||||
@ -505,6 +506,7 @@ gimp_item_tree_view_real_set_image (GimpItemTreeView *view,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_item_tree_view_image_flush (GimpImage *image,
|
gimp_item_tree_view_image_flush (GimpImage *image,
|
||||||
|
gboolean invalidate_preview,
|
||||||
GimpItemTreeView *view)
|
GimpItemTreeView *view)
|
||||||
{
|
{
|
||||||
gimp_ui_manager_update (GIMP_EDITOR (view)->ui_manager, view);
|
gimp_ui_manager_update (GIMP_EDITOR (view)->ui_manager, view);
|
||||||
|
Reference in New Issue
Block a user