2017-04-22 14:13:07 -04:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2017-04-22 14:13:07 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gegl.h>
|
|
|
|
#include <cairo.h>
|
|
|
|
|
|
|
|
#include "core-types.h"
|
|
|
|
|
|
|
|
#include "gimpprojectable.h"
|
|
|
|
|
|
|
|
#include "gimptilehandlerprojectable.h"
|
|
|
|
|
|
|
|
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
static void gimp_tile_handler_projectable_begin_validate (GimpTileHandlerValidate *validate);
|
|
|
|
static void gimp_tile_handler_projectable_end_validate (GimpTileHandlerValidate *validate);
|
2017-04-22 14:13:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GimpTileHandlerProjectable, gimp_tile_handler_projectable,
|
|
|
|
GIMP_TYPE_TILE_HANDLER_VALIDATE)
|
|
|
|
|
|
|
|
#define parent_class gimp_tile_handler_projectable_parent_class
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_tile_handler_projectable_class_init (GimpTileHandlerProjectableClass *klass)
|
|
|
|
{
|
|
|
|
GimpTileHandlerValidateClass *validate_class;
|
|
|
|
|
|
|
|
validate_class = GIMP_TILE_HANDLER_VALIDATE_CLASS (klass);
|
|
|
|
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
validate_class->begin_validate = gimp_tile_handler_projectable_begin_validate;
|
|
|
|
validate_class->end_validate = gimp_tile_handler_projectable_end_validate;
|
2017-04-22 14:13:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_tile_handler_projectable_init (GimpTileHandlerProjectable *projectable)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
gimp_tile_handler_projectable_begin_validate (GimpTileHandlerValidate *validate)
|
2017-04-22 14:13:07 -04:00
|
|
|
{
|
|
|
|
GimpTileHandlerProjectable *handler = GIMP_TILE_HANDLER_PROJECTABLE (validate);
|
|
|
|
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
GIMP_TILE_HANDLER_VALIDATE_CLASS (parent_class)->begin_validate (validate);
|
2017-04-22 14:13:07 -04:00
|
|
|
|
|
|
|
gimp_projectable_begin_render (handler->projectable);
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
}
|
2017-04-22 14:13:07 -04:00
|
|
|
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
static void
|
|
|
|
gimp_tile_handler_projectable_end_validate (GimpTileHandlerValidate *validate)
|
|
|
|
{
|
|
|
|
GimpTileHandlerProjectable *handler = GIMP_TILE_HANDLER_PROJECTABLE (validate);
|
2017-04-22 14:13:07 -04:00
|
|
|
|
|
|
|
gimp_projectable_end_render (handler->projectable);
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
|
|
|
|
GIMP_TILE_HANDLER_VALIDATE_CLASS (parent_class)->end_validate (validate);
|
2017-04-22 14:13:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
GeglTileHandler *
|
|
|
|
gimp_tile_handler_projectable_new (GimpProjectable *projectable)
|
|
|
|
{
|
|
|
|
GimpTileHandlerProjectable *handler;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_PROJECTABLE (projectable), NULL);
|
|
|
|
|
|
|
|
handler = g_object_new (GIMP_TYPE_TILE_HANDLER_PROJECTABLE, NULL);
|
|
|
|
|
app: add GimpTileHandlerValidate::{begin,end}_validate() vfuncs
Add begin_validate() and end_validate() virtual functions, and
corresponding free functions, to GimpTileHandlerValidate. These
functions are called before/after validation happens, and should
perform any necessary steps to prepare for validation. The default
implementation suspends validation on tile access, so that the
assigned buffer may be accessed without causing validation.
Implement the new functions in GimpTileHandlerProjectable, by
calling gimp_projectable_begin_render() and
gimp_projectable_end_render(), respectively, instead of calling
these functions in the ::validate() implementation (which, in turn,
allows us to use the default ::validate() implementation.)
In GimpProjection, use the new functions in place of
gimp_projectable_{begin,end}_render().
2018-11-27 13:32:55 -05:00
|
|
|
GIMP_TILE_HANDLER_VALIDATE (handler)->graph =
|
|
|
|
g_object_ref (gimp_projectable_get_graph (projectable));
|
|
|
|
|
2017-04-22 14:13:07 -04:00
|
|
|
handler->projectable = projectable;
|
|
|
|
|
|
|
|
return GEGL_TILE_HANDLER (handler);
|
|
|
|
}
|