app: add GimpTileHandlerValidate::invalidated signal
Add a new GimpTileHandlerValidate::invalidated signal, which is emitted when a region of the buffer is invalidated. This would allow us to properly invalidate the graph in response; this normally happens in response to GeglBuffer::changed, but this signal is not emitted when a region is merely invalidated.
This commit is contained in:
@ -25,11 +25,19 @@
|
||||
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "core/gimpmarshal.h"
|
||||
|
||||
#include "gimp-gegl-loops.h"
|
||||
#include "gimp-gegl-utils.h"
|
||||
#include "gimptilehandlervalidate.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
INVALIDATED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@ -74,12 +82,24 @@ G_DEFINE_TYPE (GimpTileHandlerValidate, gimp_tile_handler_validate,
|
||||
|
||||
#define parent_class gimp_tile_handler_validate_parent_class
|
||||
|
||||
static guint gimp_tile_handler_validate_signals[LAST_SIGNAL];
|
||||
|
||||
|
||||
static void
|
||||
gimp_tile_handler_validate_class_init (GimpTileHandlerValidateClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gimp_tile_handler_validate_signals[INVALIDATED] =
|
||||
g_signal_new ("invalidated",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GimpTileHandlerValidateClass, invalidated),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1,
|
||||
GEGL_TYPE_RECTANGLE);
|
||||
|
||||
object_class->finalize = gimp_tile_handler_validate_finalize;
|
||||
object_class->set_property = gimp_tile_handler_validate_set_property;
|
||||
object_class->get_property = gimp_tile_handler_validate_get_property;
|
||||
@ -465,6 +485,9 @@ gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
|
||||
(cairo_rectangle_int_t *) rect);
|
||||
|
||||
gegl_tile_handler_damage_rect (GEGL_TILE_HANDLER (validate), rect);
|
||||
|
||||
g_signal_emit (validate, gimp_tile_handler_validate_signals[INVALIDATED],
|
||||
0, rect, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -56,6 +56,11 @@ struct _GimpTileHandlerValidateClass
|
||||
{
|
||||
GeglTileHandlerClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (* invalidated) (GimpTileHandlerValidate *validate,
|
||||
const GeglRectangle *rect);
|
||||
|
||||
/* virtual functions */
|
||||
void (* begin_validate) (GimpTileHandlerValidate *validate);
|
||||
void (* end_validate) (GimpTileHandlerValidate *validate);
|
||||
void (* validate) (GimpTileHandlerValidate *validate,
|
||||
|
Reference in New Issue
Block a user