2005-10-01 00:35:04 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpgrid_pdb.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2005-10-01 00:35:04 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2005-10-01 00:35:04 +08:00
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://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"
|
|
|
|
|
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION: gimpgrid
|
|
|
|
* @title: gimpgrid
|
|
|
|
* @short_description: Functions manuipulating an image's grid.
|
|
|
|
*
|
|
|
|
* Functions manuipulating an image's grid.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2005-10-01 00:35:04 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_grid_get_spacing:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @xspacing: The image's grid horizontal spacing.
|
|
|
|
* @yspacing: The image's grid vertical spacing.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_get_spacing (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble *xspacing,
|
|
|
|
gdouble *yspacing)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-get-spacing",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
*xspacing = 0.0;
|
|
|
|
*yspacing = 0.0;
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
|
|
|
*xspacing = return_vals[1].data.d_float;
|
|
|
|
*yspacing = return_vals[2].data.d_float;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_set_spacing:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @xspacing: The image's grid horizontal spacing.
|
|
|
|
* @yspacing: The image's grid vertical spacing.
|
|
|
|
*
|
|
|
|
* Sets the spacing of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure sets the horizontal and vertical spacing of an
|
|
|
|
* image's grid.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_set_spacing (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble xspacing,
|
|
|
|
gdouble yspacing)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-set-spacing",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_FLOAT, xspacing,
|
|
|
|
GIMP_PDB_FLOAT, yspacing,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_get_offset:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @xoffset: The image's grid horizontal offset.
|
|
|
|
* @yoffset: The image's grid vertical offset.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_get_offset (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble *xoffset,
|
|
|
|
gdouble *yoffset)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-get-offset",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
*xoffset = 0.0;
|
|
|
|
*yoffset = 0.0;
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
|
|
|
*xoffset = return_vals[1].data.d_float;
|
|
|
|
*yoffset = return_vals[2].data.d_float;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_set_offset:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @xoffset: The image's grid horizontal offset.
|
|
|
|
* @yoffset: The image's grid vertical offset.
|
|
|
|
*
|
|
|
|
* Sets the offset of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure sets the horizontal and vertical offset of an image's
|
|
|
|
* grid.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_set_offset (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble xoffset,
|
|
|
|
gdouble yoffset)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-set-offset",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_FLOAT, xoffset,
|
|
|
|
GIMP_PDB_FLOAT, yoffset,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_get_foreground_color:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @fgcolor: The image's grid foreground color.
|
|
|
|
*
|
|
|
|
* Sets the foreground color of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure gets the foreground color of an image's grid.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_get_foreground_color (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpRGB *fgcolor)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-get-foreground-color",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
*fgcolor = return_vals[1].data.d_color;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_set_foreground_color:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @fgcolor: The new foreground color.
|
|
|
|
*
|
|
|
|
* Gets the foreground color of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure sets the foreground color of an image's grid.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_set_foreground_color (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const GimpRGB *fgcolor)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-set-foreground-color",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_COLOR, fgcolor,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_get_background_color:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @bgcolor: The image's grid background color.
|
|
|
|
*
|
|
|
|
* Sets the background color of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure gets the background color of an image's grid.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_get_background_color (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpRGB *bgcolor)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-get-background-color",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
*bgcolor = return_vals[1].data.d_color;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_set_background_color:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @bgcolor: The new background color.
|
|
|
|
*
|
|
|
|
* Gets the background color of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure sets the background color of an image's grid.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_set_background_color (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const GimpRGB *bgcolor)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-set-background-color",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_COLOR, bgcolor,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_get_style:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Gets the style of an image's grid.
|
|
|
|
*
|
|
|
|
* This procedure retrieves the style of an image's grid.
|
|
|
|
*
|
|
|
|
* Returns: The image's grid style.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
GimpGridStyle
|
|
|
|
gimp_image_grid_get_style (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
GimpGridStyle style = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-get-style",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
style = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return style;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_grid_set_style:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @style: The image's grid style.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-10-01 00:35:04 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_grid_set_style (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpGridStyle style)
|
2005-10-01 00:35:04 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-grid-set-style",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, style,
|
|
|
|
GIMP_PDB_END);
|
2005-10-01 00:35:04 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|