mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
app: move filter stack init/finalize to gimpdrawable-filters.c so we
can connect to signals and do other things right here for the entire lifecycle of the drawable.
This commit is contained in:
parent
bf877a8aa3
commit
5805b96095
4 changed files with 34 additions and 10 deletions
|
@ -49,6 +49,19 @@
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
_gimp_drawable_filters_init (GimpDrawable *drawable)
|
||||||
|
{
|
||||||
|
drawable->private->filter_stack = gimp_filter_stack_new (GIMP_TYPE_FILTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_gimp_drawable_filters_finalize (GimpDrawable *drawable)
|
||||||
|
{
|
||||||
|
g_clear_object (&drawable->private->filter_stack);
|
||||||
|
}
|
||||||
|
|
||||||
GimpContainer *
|
GimpContainer *
|
||||||
gimp_drawable_get_filters (GimpDrawable *drawable)
|
gimp_drawable_get_filters (GimpDrawable *drawable)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,6 +21,14 @@
|
||||||
#define __GIMP_DRAWABLE_FILTERS_H__
|
#define __GIMP_DRAWABLE_FILTERS_H__
|
||||||
|
|
||||||
|
|
||||||
|
/* internal functions */
|
||||||
|
|
||||||
|
void _gimp_drawable_filters_init (GimpDrawable *drawable);
|
||||||
|
void _gimp_drawable_filters_finalize (GimpDrawable *drawable);
|
||||||
|
|
||||||
|
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
GimpContainer * gimp_drawable_get_filters (GimpDrawable *drawable);
|
GimpContainer * gimp_drawable_get_filters (GimpDrawable *drawable);
|
||||||
|
|
||||||
gboolean gimp_drawable_has_visible_filters (GimpDrawable *drawable);
|
gboolean gimp_drawable_has_visible_filters (GimpDrawable *drawable);
|
||||||
|
|
|
@ -336,7 +336,7 @@ gimp_drawable_init (GimpDrawable *drawable)
|
||||||
{
|
{
|
||||||
drawable->private = gimp_drawable_get_instance_private (drawable);
|
drawable->private = gimp_drawable_get_instance_private (drawable);
|
||||||
|
|
||||||
drawable->private->filter_stack = gimp_filter_stack_new (GIMP_TYPE_FILTER);
|
_gimp_drawable_filters_init (drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sorry for the evil casts */
|
/* sorry for the evil casts */
|
||||||
|
@ -387,7 +387,8 @@ gimp_drawable_finalize (GObject *object)
|
||||||
|
|
||||||
g_clear_object (&drawable->private->source_node);
|
g_clear_object (&drawable->private->source_node);
|
||||||
g_clear_object (&drawable->private->buffer_source_node);
|
g_clear_object (&drawable->private->buffer_source_node);
|
||||||
g_clear_object (&drawable->private->filter_stack);
|
|
||||||
|
_gimp_drawable_filters_finalize (drawable);
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
@ -1273,6 +1274,14 @@ gimp_drawable_update_all (GimpDrawable *drawable)
|
||||||
GIMP_DRAWABLE_GET_CLASS (drawable)->update_all (drawable);
|
GIMP_DRAWABLE_GET_CLASS (drawable)->update_all (drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_drawable_filters_changed (GimpDrawable *drawable)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||||
|
|
||||||
|
g_signal_emit (drawable, gimp_drawable_signals[FILTERS_CHANGED], 0);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_invalidate_boundary (GimpDrawable *drawable)
|
gimp_drawable_invalidate_boundary (GimpDrawable *drawable)
|
||||||
{
|
{
|
||||||
|
@ -2172,9 +2181,3 @@ gimp_drawable_is_painting (GimpDrawable *drawable)
|
||||||
|
|
||||||
return drawable->private->paint_count > 0;
|
return drawable->private->paint_count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_filters_changed (GimpDrawable *drawable)
|
|
||||||
{
|
|
||||||
g_signal_emit (drawable, gimp_drawable_signals[FILTERS_CHANGED], 0);
|
|
||||||
}
|
|
||||||
|
|
|
@ -134,6 +134,8 @@ void gimp_drawable_update (GimpDrawable *drawa
|
||||||
gint height);
|
gint height);
|
||||||
void gimp_drawable_update_all (GimpDrawable *drawable);
|
void gimp_drawable_update_all (GimpDrawable *drawable);
|
||||||
|
|
||||||
|
void gimp_drawable_filters_changed (GimpDrawable *drawable);
|
||||||
|
|
||||||
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
|
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
|
||||||
void gimp_drawable_get_active_components (GimpDrawable *drawable,
|
void gimp_drawable_get_active_components (GimpDrawable *drawable,
|
||||||
gboolean *active);
|
gboolean *active);
|
||||||
|
@ -235,7 +237,5 @@ gboolean gimp_drawable_end_paint (GimpDrawable *drawable)
|
||||||
gboolean gimp_drawable_flush_paint (GimpDrawable *drawable);
|
gboolean gimp_drawable_flush_paint (GimpDrawable *drawable);
|
||||||
gboolean gimp_drawable_is_painting (GimpDrawable *drawable);
|
gboolean gimp_drawable_is_painting (GimpDrawable *drawable);
|
||||||
|
|
||||||
void gimp_drawable_filters_changed (GimpDrawable *drawable);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DRAWABLE_H__ */
|
#endif /* __GIMP_DRAWABLE_H__ */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue