2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2005-10-01 00:35:04 +08:00
|
|
|
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2005-10-01 00:35:04 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2005-10-01 00:35:04 +08:00
|
|
|
* (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-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2005-10-01 00:35:04 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl. */
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2022-03-28 21:13:17 +08:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2012-05-03 09:36:22 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
#include "libgimpbase/gimpbaseenums.h"
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
#include "pdb-types.h"
|
|
|
|
|
|
|
|
#include "core/gimpgrid.h"
|
|
|
|
#include "core/gimpimage-grid.h"
|
|
|
|
#include "core/gimpimage.h"
|
2008-02-08 01:08:54 +08:00
|
|
|
#include "core/gimpparamspecs.h"
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2008-02-08 01:08:54 +08:00
|
|
|
#include "gimppdb.h"
|
|
|
|
#include "gimpprocedure.h"
|
2008-04-04 19:15:55 +08:00
|
|
|
#include "internal-procs.h"
|
2006-11-01 03:02:56 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_get_spacing_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2012-05-04 06:50:23 +08:00
|
|
|
GimpValueArray *return_vals;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2006-03-15 23:32:39 +08:00
|
|
|
gdouble xspacing = 0.0;
|
|
|
|
gdouble yspacing = 0.0;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2006-03-24 05:17:16 +08:00
|
|
|
g_object_get (grid,
|
|
|
|
"xspacing", &xspacing,
|
|
|
|
"yspacing", &yspacing,
|
|
|
|
NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2012-05-04 06:50:23 +08:00
|
|
|
g_value_set_double (gimp_value_array_index (return_vals, 1), xspacing);
|
|
|
|
g_value_set_double (gimp_value_array_index (return_vals, 2), yspacing);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_set_spacing_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2005-10-01 00:35:04 +08:00
|
|
|
gdouble xspacing;
|
|
|
|
gdouble yspacing;
|
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2012-05-04 06:50:23 +08:00
|
|
|
xspacing = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
yspacing = g_value_get_double (gimp_value_array_index (args, 2));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2005-10-08 03:33:37 +08:00
|
|
|
g_object_set (grid,
|
|
|
|
"xspacing", xspacing,
|
|
|
|
"yspacing", yspacing,
|
|
|
|
NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_get_offset_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2012-05-04 06:50:23 +08:00
|
|
|
GimpValueArray *return_vals;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2006-03-15 23:32:39 +08:00
|
|
|
gdouble xoffset = 0.0;
|
|
|
|
gdouble yoffset = 0.0;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2006-03-24 05:17:16 +08:00
|
|
|
g_object_get (grid,
|
|
|
|
"xoffset", &xoffset,
|
|
|
|
"yoffset", &yoffset,
|
|
|
|
NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2012-05-04 06:50:23 +08:00
|
|
|
g_value_set_double (gimp_value_array_index (return_vals, 1), xoffset);
|
|
|
|
g_value_set_double (gimp_value_array_index (return_vals, 2), yoffset);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_set_offset_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2005-10-01 00:35:04 +08:00
|
|
|
gdouble xoffset;
|
|
|
|
gdouble yoffset;
|
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2012-05-04 06:50:23 +08:00
|
|
|
xoffset = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
yoffset = g_value_get_double (gimp_value_array_index (args, 2));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2005-10-08 03:33:37 +08:00
|
|
|
g_object_set (grid,
|
|
|
|
"xoffset", xoffset,
|
|
|
|
"yoffset", yoffset,
|
|
|
|
NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_get_foreground_color_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2012-05-04 06:50:23 +08:00
|
|
|
GimpValueArray *return_vals;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2023-12-21 14:46:15 +08:00
|
|
|
GeglColor *fgcolor = NULL;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2023-12-21 14:46:15 +08:00
|
|
|
fgcolor = gegl_color_duplicate (grid->fgcolor);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
2023-12-21 14:46:15 +08:00
|
|
|
g_value_take_object (gimp_value_array_index (return_vals, 1), fgcolor);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_set_foreground_color_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2023-12-21 14:46:15 +08:00
|
|
|
GeglColor *fgcolor;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2023-12-21 14:46:15 +08:00
|
|
|
fgcolor = g_value_get_object (gimp_value_array_index (args, 1));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2023-12-21 14:46:15 +08:00
|
|
|
g_object_set (grid, "fgcolor", fgcolor, NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_get_background_color_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2012-05-04 06:50:23 +08:00
|
|
|
GimpValueArray *return_vals;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2023-12-21 14:46:15 +08:00
|
|
|
GeglColor *bgcolor = NULL;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2023-12-21 14:46:15 +08:00
|
|
|
bgcolor = gegl_color_duplicate (grid->bgcolor);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
2023-12-21 14:46:15 +08:00
|
|
|
g_value_take_object (gimp_value_array_index (return_vals, 1), bgcolor);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_set_background_color_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2023-12-21 14:46:15 +08:00
|
|
|
GeglColor *bgcolor;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2023-12-21 14:46:15 +08:00
|
|
|
bgcolor = g_value_get_object (gimp_value_array_index (args, 1));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2023-12-21 14:46:15 +08:00
|
|
|
g_object_set (grid, "bgcolor", bgcolor, NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_get_style_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2012-05-04 06:50:23 +08:00
|
|
|
GimpValueArray *return_vals;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2019-08-15 20:04:56 +08:00
|
|
|
gint style = 0;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2006-03-24 05:17:16 +08:00
|
|
|
g_object_get (grid, "style", &style, NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
2012-05-04 06:50:23 +08:00
|
|
|
g_value_set_enum (gimp_value_array_index (return_vals, 1), style);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2012-05-29 01:55:28 +08:00
|
|
|
image_grid_set_style_invoker (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
GError **error)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpImage *image;
|
2019-08-15 20:04:56 +08:00
|
|
|
gint style;
|
2005-10-01 00:35:04 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
2012-05-04 06:50:23 +08:00
|
|
|
style = g_value_get_enum (gimp_value_array_index (args, 1));
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-24 05:17:16 +08:00
|
|
|
GimpGrid *grid = gimp_image_get_grid (image);
|
2005-10-08 03:33:37 +08:00
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
if (grid)
|
2006-03-24 05:17:16 +08:00
|
|
|
g_object_set (grid, "style", style, NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-10-01 00:35:04 +08:00
|
|
|
}
|
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
void
|
2015-05-30 21:19:11 +08:00
|
|
|
register_image_grid_procs (GimpPDB *pdb)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
2006-04-05 05:11:45 +08:00
|
|
|
GimpProcedure *procedure;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-get-spacing
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_get_spacing_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-get-spacing");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Gets the spacing of an image's grid.",
|
|
|
|
"This procedure retrieves the horizontal and vertical spacing of an image's grid. It takes the image as parameter.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
g_param_spec_double ("xspacing",
|
|
|
|
"xspacing",
|
|
|
|
"The image's grid horizontal spacing",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
g_param_spec_double ("yspacing",
|
|
|
|
"yspacing",
|
|
|
|
"The image's grid vertical spacing",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-set-spacing
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_set_spacing_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-set-spacing");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Sets the spacing of an image's grid.",
|
|
|
|
"This procedure sets the horizontal and vertical spacing of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_double ("xspacing",
|
|
|
|
"xspacing",
|
|
|
|
"The image's grid horizontal spacing",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_double ("yspacing",
|
|
|
|
"yspacing",
|
|
|
|
"The image's grid vertical spacing",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-get-offset
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_get_offset_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-get-offset");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Gets the offset of an image's grid.",
|
|
|
|
"This procedure retrieves the horizontal and vertical offset of an image's grid. It takes the image as parameter.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
g_param_spec_double ("xoffset",
|
|
|
|
"xoffset",
|
|
|
|
"The image's grid horizontal offset",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
g_param_spec_double ("yoffset",
|
|
|
|
"yoffset",
|
|
|
|
"The image's grid vertical offset",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-set-offset
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_set_offset_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-set-offset");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Sets the offset of an image's grid.",
|
|
|
|
"This procedure sets the horizontal and vertical offset of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_double ("xoffset",
|
|
|
|
"xoffset",
|
|
|
|
"The image's grid horizontal offset",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_double ("yoffset",
|
|
|
|
"yoffset",
|
|
|
|
"The image's grid vertical offset",
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-get-foreground-color
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_get_foreground_color_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-get-foreground-color");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Sets the foreground color of an image's grid.",
|
|
|
|
"This procedure gets the foreground color of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_return_value (procedure,
|
2023-12-21 14:46:15 +08:00
|
|
|
gegl_param_spec_color ("fgcolor",
|
|
|
|
"fgcolor",
|
|
|
|
"The image's grid foreground color",
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-set-foreground-color
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_set_foreground_color_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-set-foreground-color");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Gets the foreground color of an image's grid.",
|
|
|
|
"This procedure sets the foreground color of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2023-12-21 14:46:15 +08:00
|
|
|
gegl_param_spec_color ("fgcolor",
|
|
|
|
"fgcolor",
|
|
|
|
"The new foreground color",
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-get-background-color
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_get_background_color_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-get-background-color");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Sets the background color of an image's grid.",
|
|
|
|
"This procedure gets the background color of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_return_value (procedure,
|
2023-12-21 14:46:15 +08:00
|
|
|
gegl_param_spec_color ("bgcolor",
|
|
|
|
"bgcolor",
|
|
|
|
"The image's grid background color",
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-set-background-color
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_set_background_color_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-set-background-color");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Gets the background color of an image's grid.",
|
|
|
|
"This procedure sets the background color of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2023-12-21 14:46:15 +08:00
|
|
|
gegl_param_spec_color ("bgcolor",
|
|
|
|
"bgcolor",
|
|
|
|
"The new background color",
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-get-style
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_get_style_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-get-style");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Gets the style of an image's grid.",
|
|
|
|
"This procedure retrieves the style of an image's grid.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
g_param_spec_enum ("style",
|
|
|
|
"style",
|
2006-05-19 01:25:15 +08:00
|
|
|
"The image's grid style",
|
2006-04-05 05:11:45 +08:00
|
|
|
GIMP_TYPE_GRID_STYLE,
|
|
|
|
GIMP_GRID_DOTS,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-image-grid-set-style
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (image_grid_set_style_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-image-grid-set-style");
|
2019-09-09 05:40:34 +08:00
|
|
|
gimp_procedure_set_static_help (procedure,
|
|
|
|
"Sets the style unit of an image's grid.",
|
|
|
|
"This procedure sets the style of an image's grid. It takes the image and the new style as parameters.",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_static_attribution (procedure,
|
|
|
|
"Sylvain Foret",
|
|
|
|
"Sylvain Foret",
|
|
|
|
"2005");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_param_spec_image ("image",
|
|
|
|
"image",
|
|
|
|
"The image",
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_enum ("style",
|
|
|
|
"style",
|
2006-05-19 01:25:15 +08:00
|
|
|
"The image's grid style",
|
2006-04-05 05:11:45 +08:00
|
|
|
GIMP_TYPE_GRID_STYLE,
|
|
|
|
GIMP_GRID_DOTS,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
}
|