gimp/pdb/groups/image_grid.pdb

373 lines
8.3 KiB
Plaintext
Raw Normal View History

# 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
# along with this program. If not, see <https://www.gnu.org/licenses/>.
sub image_grid_get_spacing {
$blurb = "Gets the spacing of an image's grid.";
$help = <<HELP;
This procedure retrieves the horizontal and vertical spacing of an image's grid.
It takes the image as parameter.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'xspacing', type => 'float', void_ret => 1,
desc => "The image's grid horizontal spacing" },
{ name => 'yspacing', type => 'float', void_ret => 1,
desc => "The image's grid vertical spacing" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_get (grid,
"xspacing", &xspacing,
"yspacing", &yspacing,
NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_spacing {
$blurb = "Sets the spacing of an image's grid.";
$help = <<HELP;
This procedure sets the horizontal and vertical spacing of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'xspacing', type => 'float',
desc => "The image's grid horizontal spacing" },
{ name => 'yspacing', type => 'float',
desc => "The image's grid vertical spacing" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid,
"xspacing", xspacing,
"yspacing", yspacing,
NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_get_offset {
$blurb = "Gets the offset of an image's grid.";
$help = <<HELP;
This procedure retrieves the horizontal and vertical offset of an image's grid.
It takes the image as parameter.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'xoffset', type => 'float', void_ret => 1,
desc => "The image's grid horizontal offset" },
{ name => 'yoffset', type => 'float', void_ret => 1,
desc => "The image's grid vertical offset" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_get (grid,
"xoffset", &xoffset,
"yoffset", &yoffset,
NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_offset {
$blurb = "Sets the offset of an image's grid.";
$help = <<HELP;
This procedure sets the horizontal and vertical offset of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'xoffset', type => 'float',
desc => "The image's grid horizontal offset" },
{ name => 'yoffset', type => 'float',
desc => "The image's grid vertical offset" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid,
"xoffset", xoffset,
"yoffset", yoffset,
NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_get_foreground_color {
$blurb = "Sets the foreground color of an image's grid.";
$help = <<HELP;
This procedure gets the foreground color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct 2006-04-27 Sven Neumann <sven@gimp.org> * libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct public. When validating a color, only look at the alpha channel if has_alpha is set. * libgimpconfig/gimpconfig-params.h: added "has_alpha" to GIMP_CONFIG_INSTALL_PROP_RGB macro definition. * libgimpconfig/gimpconfig-serialize.c: serialize color values as "(rgb r g b)" if the param-spec indicates that the alpha channel is meaningless. * app/config/gimpconfig-dump.c: take "has_alpha" into account when documenting color properties. * app/core/gimpcontext.c * app/core/gimpgrid.c * app/display/gimpdisplayoptions.c * app/text/gimptext.c * app/widgets/gimpaction.c * app/widgets/gimpcolorbar.c * libgimpwidgets/gimpcolorarea.c * libgimpwidgets/gimpcolorbutton.c: specify whether color properties have an alpha channel. * tools/pdbgen/app.pl: handle "has_alpha" for color paramaters. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/grid.pdb * tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where appropriate. * app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set "has_alpha" to TRUE for GIMP_PDB_COLOR. * app/pdb/channel_cmds.c * app/pdb/context_cmds.c * app/pdb/gradient_cmds.c * app/pdb/grid_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/selection_tools_cmds.c: regenerated. * app/config/gimpdisplayconfig.c (gimp_display_config_class_init): removed unused code.
2006-04-27 23:19:59 +08:00
{ name => 'fgcolor', type => 'color', has_alpha => 1, void_ret => 1,
desc => "The image's grid foreground color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
fgcolor = grid->fgcolor;
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_foreground_color {
$blurb = "Gets the foreground color of an image's grid.";
$help = <<HELP;
This procedure sets the foreground color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct 2006-04-27 Sven Neumann <sven@gimp.org> * libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct public. When validating a color, only look at the alpha channel if has_alpha is set. * libgimpconfig/gimpconfig-params.h: added "has_alpha" to GIMP_CONFIG_INSTALL_PROP_RGB macro definition. * libgimpconfig/gimpconfig-serialize.c: serialize color values as "(rgb r g b)" if the param-spec indicates that the alpha channel is meaningless. * app/config/gimpconfig-dump.c: take "has_alpha" into account when documenting color properties. * app/core/gimpcontext.c * app/core/gimpgrid.c * app/display/gimpdisplayoptions.c * app/text/gimptext.c * app/widgets/gimpaction.c * app/widgets/gimpcolorbar.c * libgimpwidgets/gimpcolorarea.c * libgimpwidgets/gimpcolorbutton.c: specify whether color properties have an alpha channel. * tools/pdbgen/app.pl: handle "has_alpha" for color paramaters. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/grid.pdb * tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where appropriate. * app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set "has_alpha" to TRUE for GIMP_PDB_COLOR. * app/pdb/channel_cmds.c * app/pdb/context_cmds.c * app/pdb/gradient_cmds.c * app/pdb/grid_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/selection_tools_cmds.c: regenerated. * app/config/gimpdisplayconfig.c (gimp_display_config_class_init): removed unused code.
2006-04-27 23:19:59 +08:00
{ name => 'fgcolor', type => 'color', has_alpha => 1,
desc => "The new foreground color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid, "fgcolor", &fgcolor, NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_get_background_color {
$blurb = "Sets the background color of an image's grid.";
$help = <<HELP;
This procedure gets the background color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct 2006-04-27 Sven Neumann <sven@gimp.org> * libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct public. When validating a color, only look at the alpha channel if has_alpha is set. * libgimpconfig/gimpconfig-params.h: added "has_alpha" to GIMP_CONFIG_INSTALL_PROP_RGB macro definition. * libgimpconfig/gimpconfig-serialize.c: serialize color values as "(rgb r g b)" if the param-spec indicates that the alpha channel is meaningless. * app/config/gimpconfig-dump.c: take "has_alpha" into account when documenting color properties. * app/core/gimpcontext.c * app/core/gimpgrid.c * app/display/gimpdisplayoptions.c * app/text/gimptext.c * app/widgets/gimpaction.c * app/widgets/gimpcolorbar.c * libgimpwidgets/gimpcolorarea.c * libgimpwidgets/gimpcolorbutton.c: specify whether color properties have an alpha channel. * tools/pdbgen/app.pl: handle "has_alpha" for color paramaters. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/grid.pdb * tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where appropriate. * app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set "has_alpha" to TRUE for GIMP_PDB_COLOR. * app/pdb/channel_cmds.c * app/pdb/context_cmds.c * app/pdb/gradient_cmds.c * app/pdb/grid_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/selection_tools_cmds.c: regenerated. * app/config/gimpdisplayconfig.c (gimp_display_config_class_init): removed unused code.
2006-04-27 23:19:59 +08:00
{ name => 'bgcolor', type => 'color', has_alpha => 1, void_ret => 1,
desc => "The image's grid background color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
bgcolor = grid->bgcolor;
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_background_color {
$blurb = "Gets the background color of an image's grid.";
$help = <<HELP;
This procedure sets the background color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct 2006-04-27 Sven Neumann <sven@gimp.org> * libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct public. When validating a color, only look at the alpha channel if has_alpha is set. * libgimpconfig/gimpconfig-params.h: added "has_alpha" to GIMP_CONFIG_INSTALL_PROP_RGB macro definition. * libgimpconfig/gimpconfig-serialize.c: serialize color values as "(rgb r g b)" if the param-spec indicates that the alpha channel is meaningless. * app/config/gimpconfig-dump.c: take "has_alpha" into account when documenting color properties. * app/core/gimpcontext.c * app/core/gimpgrid.c * app/display/gimpdisplayoptions.c * app/text/gimptext.c * app/widgets/gimpaction.c * app/widgets/gimpcolorbar.c * libgimpwidgets/gimpcolorarea.c * libgimpwidgets/gimpcolorbutton.c: specify whether color properties have an alpha channel. * tools/pdbgen/app.pl: handle "has_alpha" for color paramaters. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/grid.pdb * tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where appropriate. * app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set "has_alpha" to TRUE for GIMP_PDB_COLOR. * app/pdb/channel_cmds.c * app/pdb/context_cmds.c * app/pdb/gradient_cmds.c * app/pdb/grid_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/selection_tools_cmds.c: regenerated. * app/config/gimpdisplayconfig.c (gimp_display_config_class_init): removed unused code.
2006-04-27 23:19:59 +08:00
{ name => 'bgcolor', type => 'color', has_alpha => 1,
desc => "The new background color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid, "bgcolor", &bgcolor, NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_get_style {
$blurb = "Gets the style of an image's grid.";
$help = <<HELP;
This procedure retrieves the style of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'style', type => 'enum GimpGridStyle',
desc => "The image's grid style" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_get (grid, "style", &style, NULL);
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_style {
$blurb = "Sets the style unit of an image's grid.";
$help = <<HELP;
This procedure sets the style of an image's grid.
It takes the image and the new style as parameters.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'style', type => 'enum GimpGridStyle',
desc => "The image's grid style" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid, "style", style, NULL);
else
success = FALSE;
}
CODE
);
}
@headers = qw("core/gimpimage-grid.h" "core/gimpgrid.h"
"libgimpbase/gimpbaseenums.h");
@procs = qw(image_grid_get_spacing image_grid_set_spacing
image_grid_get_offset image_grid_set_offset
image_grid_get_foreground_color image_grid_set_foreground_color
image_grid_get_background_color image_grid_set_background_color
image_grid_get_style image_grid_set_style);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Image grid procedures';
$doc_title = 'gimpimagegrid';
$doc_short_desc = "Functions manuipulating an image's grid.";
$doc_long_desc = "Functions manuipulating an image's grid.";
1;