mirror of https://github.com/GNOME/gimp.git
app/core/core-enums.[ch] moved GimpGridStyle enum to libgimpbase.
2005-09-30 Sven Neumann <sven@gimp.org> * app/core/core-enums.[ch] * libgimpbase/gimpbaseenums.[ch]: moved GimpGridStyle enum to libgimpbase. * app/core/gimpimage-grid.h: indentation. * app/pdb/Makefile.am * libgimp/Makefile.am * tools/pdbgen/Makefile.am * tools/pdbgen/pdb/grid.pdb: applied slightly modified patch by Sylvain FORET that adds a PDB API for the image grid. * app/pdb/grid_cmds.c * app/pdb/internal_procs.c * libgimp/gimp_pdb.h * libgimp/gimpenums.c.tail * libgimp/gimpgrid_pdb.[ch] * tools/pdbgen/enums.pl * tools/pdbgen/groups.pl: (re)generated. * libgimp/gimp.def * libgimpbase/gimpbase.def: updated.
This commit is contained in:
parent
2931a99023
commit
f6b370952c
25
ChangeLog
25
ChangeLog
|
@ -1,3 +1,28 @@
|
|||
2005-09-30 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/core-enums.[ch]
|
||||
* libgimpbase/gimpbaseenums.[ch]: moved GimpGridStyle enum to
|
||||
libgimpbase.
|
||||
|
||||
* app/core/gimpimage-grid.h: indentation.
|
||||
|
||||
* app/pdb/Makefile.am
|
||||
* libgimp/Makefile.am
|
||||
* tools/pdbgen/Makefile.am
|
||||
* tools/pdbgen/pdb/grid.pdb: applied slightly modified patch by
|
||||
Sylvain FORET that adds a PDB API for the image grid.
|
||||
|
||||
* app/pdb/grid_cmds.c
|
||||
* app/pdb/internal_procs.c
|
||||
* libgimp/gimp_pdb.h
|
||||
* libgimp/gimpenums.c.tail
|
||||
* libgimp/gimpgrid_pdb.[ch]
|
||||
* tools/pdbgen/enums.pl
|
||||
* tools/pdbgen/groups.pl: (re)generated.
|
||||
|
||||
* libgimp/gimp.def
|
||||
* libgimpbase/gimpbase.def: updated.
|
||||
|
||||
2005-09-30 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/common/gbr.c (save_image): handle RGB drawables and
|
||||
|
|
|
@ -216,40 +216,6 @@ gimp_fill_type_get_type (void)
|
|||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_grid_style_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_GRID_DOTS, "GIMP_GRID_DOTS", "dots" },
|
||||
{ GIMP_GRID_INTERSECTIONS, "GIMP_GRID_INTERSECTIONS", "intersections" },
|
||||
{ GIMP_GRID_ON_OFF_DASH, "GIMP_GRID_ON_OFF_DASH", "on-off-dash" },
|
||||
{ GIMP_GRID_DOUBLE_DASH, "GIMP_GRID_DOUBLE_DASH", "double-dash" },
|
||||
{ GIMP_GRID_SOLID, "GIMP_GRID_SOLID", "solid" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_GRID_DOTS, N_("Intersections (dots)"), NULL },
|
||||
{ GIMP_GRID_INTERSECTIONS, N_("Intersections (crosshairs)"), NULL },
|
||||
{ GIMP_GRID_ON_OFF_DASH, N_("Dashed"), NULL },
|
||||
{ GIMP_GRID_DOUBLE_DASH, N_("Double dashed"), NULL },
|
||||
{ GIMP_GRID_SOLID, N_("Solid"), NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
type = g_enum_register_static ("GimpGridStyle", values);
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_stroke_method_get_type (void)
|
||||
{
|
||||
|
|
|
@ -125,20 +125,6 @@ typedef enum
|
|||
} GimpFillType;
|
||||
|
||||
|
||||
#define GIMP_TYPE_GRID_STYLE (gimp_grid_style_get_type ())
|
||||
|
||||
GType gimp_grid_style_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum /*< pdb-skip >*/
|
||||
{
|
||||
GIMP_GRID_DOTS, /*< desc="Intersections (dots)" >*/
|
||||
GIMP_GRID_INTERSECTIONS, /*< desc="Intersections (crosshairs)" >*/
|
||||
GIMP_GRID_ON_OFF_DASH, /*< desc="Dashed" >*/
|
||||
GIMP_GRID_DOUBLE_DASH, /*< desc="Double dashed" >*/
|
||||
GIMP_GRID_SOLID /*< desc="Solid" >*/
|
||||
} GimpGridStyle;
|
||||
|
||||
|
||||
#define GIMP_TYPE_STROKE_METHOD (gimp_stroke_method_get_type ())
|
||||
|
||||
GType gimp_stroke_method_get_type (void) G_GNUC_CONST;
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
#define __GIMP_IMAGE_GRID_H__
|
||||
|
||||
|
||||
GimpGrid * gimp_image_get_grid (GimpImage *gimage);
|
||||
void gimp_image_set_grid (GimpImage *gimage,
|
||||
GimpGrid *grid,
|
||||
gboolean push_undo);
|
||||
GimpGrid * gimp_image_get_grid (GimpImage *gimage);
|
||||
void gimp_image_set_grid (GimpImage *gimage,
|
||||
GimpGrid *grid,
|
||||
gboolean push_undo);
|
||||
|
||||
|
||||
#endif /* __GIMP_IMAGE_GRID_H__ */
|
||||
|
|
|
@ -32,6 +32,7 @@ libapppdb_a_SOURCES = \
|
|||
gradient_cmds.c \
|
||||
gradient_select_cmds.c \
|
||||
gradients_cmds.c \
|
||||
grid_cmds.c \
|
||||
guides_cmds.c \
|
||||
help_cmds.c \
|
||||
image_cmds.c \
|
||||
|
|
|
@ -0,0 +1,774 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995-2003 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 2 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "libgimpbase/gimpbaseenums.h"
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "pdb-types.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "core/gimpgrid.h"
|
||||
#include "core/gimpimage-grid.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
static ProcRecord image_grid_get_spacing_proc;
|
||||
static ProcRecord image_grid_set_spacing_proc;
|
||||
static ProcRecord image_grid_get_offset_proc;
|
||||
static ProcRecord image_grid_set_offset_proc;
|
||||
static ProcRecord image_grid_get_foreground_color_proc;
|
||||
static ProcRecord image_grid_set_foreground_color_proc;
|
||||
static ProcRecord image_grid_get_background_color_proc;
|
||||
static ProcRecord image_grid_set_background_color_proc;
|
||||
static ProcRecord image_grid_get_style_proc;
|
||||
static ProcRecord image_grid_set_style_proc;
|
||||
|
||||
void
|
||||
register_grid_procs (Gimp *gimp)
|
||||
{
|
||||
procedural_db_register (gimp, &image_grid_get_spacing_proc);
|
||||
procedural_db_register (gimp, &image_grid_set_spacing_proc);
|
||||
procedural_db_register (gimp, &image_grid_get_offset_proc);
|
||||
procedural_db_register (gimp, &image_grid_set_offset_proc);
|
||||
procedural_db_register (gimp, &image_grid_get_foreground_color_proc);
|
||||
procedural_db_register (gimp, &image_grid_set_foreground_color_proc);
|
||||
procedural_db_register (gimp, &image_grid_get_background_color_proc);
|
||||
procedural_db_register (gimp, &image_grid_set_background_color_proc);
|
||||
procedural_db_register (gimp, &image_grid_get_style_proc);
|
||||
procedural_db_register (gimp, &image_grid_set_style_proc);
|
||||
}
|
||||
|
||||
static Argument *
|
||||
image_grid_get_spacing_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Argument *return_args;
|
||||
GimpImage *gimage;
|
||||
gdouble xspacing;
|
||||
gdouble yspacing;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
xspacing = grid->xspacing;
|
||||
yspacing = grid->yspacing;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_args = procedural_db_return_args (&image_grid_get_spacing_proc, success);
|
||||
|
||||
if (success)
|
||||
{
|
||||
return_args[1].value.pdb_float = xspacing;
|
||||
return_args[2].value.pdb_float = yspacing;
|
||||
}
|
||||
|
||||
return return_args;
|
||||
}
|
||||
|
||||
static ProcArg image_grid_get_spacing_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcArg image_grid_get_spacing_outargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"xspacing",
|
||||
"The image's grid horizontal spacing"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"yspacing",
|
||||
"The image's grid vertical spacing"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_get_spacing_proc =
|
||||
{
|
||||
"gimp-image-grid-get-spacing",
|
||||
"gimp-image-grid-get-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.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
1,
|
||||
image_grid_get_spacing_inargs,
|
||||
2,
|
||||
image_grid_get_spacing_outargs,
|
||||
{ { image_grid_get_spacing_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_set_spacing_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *gimage;
|
||||
gdouble xspacing;
|
||||
gdouble yspacing;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
xspacing = args[1].value.pdb_float;
|
||||
|
||||
yspacing = args[2].value.pdb_float;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
g_object_set (grid,
|
||||
"xspacing", xspacing,
|
||||
"yspacing", yspacing,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&image_grid_set_spacing_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg image_grid_set_spacing_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"xspacing",
|
||||
"The image's grid horizontal spacing"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"yspacing",
|
||||
"The image's grid vertical spacing"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_set_spacing_proc =
|
||||
{
|
||||
"gimp-image-grid-set-spacing",
|
||||
"gimp-image-grid-set-spacing",
|
||||
"Sets the spacing of an image's grid.",
|
||||
"This procedure sets the horizontal and vertical spacing of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
3,
|
||||
image_grid_set_spacing_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { image_grid_set_spacing_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_get_offset_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Argument *return_args;
|
||||
GimpImage *gimage;
|
||||
gdouble xoffset;
|
||||
gdouble yoffset;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
xoffset = grid->xoffset;
|
||||
yoffset = grid->yoffset;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_args = procedural_db_return_args (&image_grid_get_offset_proc, success);
|
||||
|
||||
if (success)
|
||||
{
|
||||
return_args[1].value.pdb_float = xoffset;
|
||||
return_args[2].value.pdb_float = yoffset;
|
||||
}
|
||||
|
||||
return return_args;
|
||||
}
|
||||
|
||||
static ProcArg image_grid_get_offset_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcArg image_grid_get_offset_outargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"xoffset",
|
||||
"The image's grid horizontal offset"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"yoffset",
|
||||
"The image's grid vertical offset"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_get_offset_proc =
|
||||
{
|
||||
"gimp-image-grid-get-offset",
|
||||
"gimp-image-grid-get-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.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
1,
|
||||
image_grid_get_offset_inargs,
|
||||
2,
|
||||
image_grid_get_offset_outargs,
|
||||
{ { image_grid_get_offset_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_set_offset_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *gimage;
|
||||
gdouble xoffset;
|
||||
gdouble yoffset;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
xoffset = args[1].value.pdb_float;
|
||||
|
||||
yoffset = args[2].value.pdb_float;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
g_object_set (grid,
|
||||
"xoffset", xoffset,
|
||||
"yoffset", yoffset,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&image_grid_set_offset_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg image_grid_set_offset_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"xoffset",
|
||||
"The image's grid horizontal offset"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_FLOAT,
|
||||
"yoffset",
|
||||
"The image's grid vertical offset"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_set_offset_proc =
|
||||
{
|
||||
"gimp-image-grid-set-offset",
|
||||
"gimp-image-grid-set-offset",
|
||||
"Sets the offset of an image's grid.",
|
||||
"This procedure sets the horizontal and vertical offset of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
3,
|
||||
image_grid_set_offset_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { image_grid_set_offset_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_get_foreground_color_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Argument *return_args;
|
||||
GimpImage *gimage;
|
||||
GimpRGB fgcolor;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
fgcolor = grid->fgcolor;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_args = procedural_db_return_args (&image_grid_get_foreground_color_proc, success);
|
||||
|
||||
if (success)
|
||||
return_args[1].value.pdb_color = fgcolor;
|
||||
|
||||
return return_args;
|
||||
}
|
||||
|
||||
static ProcArg image_grid_get_foreground_color_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcArg image_grid_get_foreground_color_outargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_COLOR,
|
||||
"fgcolor",
|
||||
"The image's grid foreground color"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_get_foreground_color_proc =
|
||||
{
|
||||
"gimp-image-grid-get-foreground-color",
|
||||
"gimp-image-grid-get-foreground-color",
|
||||
"Sets the foreground color of an image's grid.",
|
||||
"This procedure gets the foreground color of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
1,
|
||||
image_grid_get_foreground_color_inargs,
|
||||
1,
|
||||
image_grid_get_foreground_color_outargs,
|
||||
{ { image_grid_get_foreground_color_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_set_foreground_color_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *gimage;
|
||||
GimpRGB fgcolor;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
fgcolor = args[1].value.pdb_color;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
g_object_set (grid,
|
||||
"fgcolor", &fgcolor,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&image_grid_set_foreground_color_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg image_grid_set_foreground_color_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_COLOR,
|
||||
"fgcolor",
|
||||
"The new foreground color"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_set_foreground_color_proc =
|
||||
{
|
||||
"gimp-image-grid-set-foreground-color",
|
||||
"gimp-image-grid-set-foreground-color",
|
||||
"Gets the foreground color of an image's grid.",
|
||||
"This procedure sets the foreground color of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
2,
|
||||
image_grid_set_foreground_color_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { image_grid_set_foreground_color_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_get_background_color_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Argument *return_args;
|
||||
GimpImage *gimage;
|
||||
GimpRGB bgcolor;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
bgcolor = grid->bgcolor;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_args = procedural_db_return_args (&image_grid_get_background_color_proc, success);
|
||||
|
||||
if (success)
|
||||
return_args[1].value.pdb_color = bgcolor;
|
||||
|
||||
return return_args;
|
||||
}
|
||||
|
||||
static ProcArg image_grid_get_background_color_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcArg image_grid_get_background_color_outargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_COLOR,
|
||||
"bgcolor",
|
||||
"The image's grid background color"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_get_background_color_proc =
|
||||
{
|
||||
"gimp-image-grid-get-background-color",
|
||||
"gimp-image-grid-get-background-color",
|
||||
"Sets the background color of an image's grid.",
|
||||
"This procedure gets the background color of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
1,
|
||||
image_grid_get_background_color_inargs,
|
||||
1,
|
||||
image_grid_get_background_color_outargs,
|
||||
{ { image_grid_get_background_color_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_set_background_color_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *gimage;
|
||||
GimpRGB bgcolor;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
bgcolor = args[1].value.pdb_color;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
g_object_set (grid,
|
||||
"bgcolor", &bgcolor,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&image_grid_set_background_color_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg image_grid_set_background_color_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_COLOR,
|
||||
"bgcolor",
|
||||
"The new background color"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_set_background_color_proc =
|
||||
{
|
||||
"gimp-image-grid-set-background-color",
|
||||
"gimp-image-grid-set-background-color",
|
||||
"Gets the background color of an image's grid.",
|
||||
"This procedure sets the background color of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
2,
|
||||
image_grid_set_background_color_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { image_grid_set_background_color_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_get_style_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Argument *return_args;
|
||||
GimpImage *gimage;
|
||||
gint32 style;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
style = grid->style;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_args = procedural_db_return_args (&image_grid_get_style_proc, success);
|
||||
|
||||
if (success)
|
||||
return_args[1].value.pdb_int = style;
|
||||
|
||||
return return_args;
|
||||
}
|
||||
|
||||
static ProcArg image_grid_get_style_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcArg image_grid_get_style_outargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_INT32,
|
||||
"style",
|
||||
"The image's grid style"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_get_style_proc =
|
||||
{
|
||||
"gimp-image-grid-get-style",
|
||||
"gimp-image-grid-get-style",
|
||||
"Gets the style of an image's grid.",
|
||||
"This procedure retrieves the style of an image's grid.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
1,
|
||||
image_grid_get_style_inargs,
|
||||
1,
|
||||
image_grid_get_style_outargs,
|
||||
{ { image_grid_get_style_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_grid_set_style_invoker (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *gimage;
|
||||
gint32 style;
|
||||
GimpGrid *grid;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
style = args[1].value.pdb_int;
|
||||
if (style < GIMP_GRID_DOTS || style > GIMP_GRID_SOLID)
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
g_object_set (grid,
|
||||
"style", style,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&image_grid_set_style_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg image_grid_set_style_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_INT32,
|
||||
"style",
|
||||
"The image's grid style"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_grid_set_style_proc =
|
||||
{
|
||||
"gimp-image-grid-set-style",
|
||||
"gimp-image-grid-set-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.",
|
||||
"Sylvain FORET",
|
||||
"Sylvain FORET",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
2,
|
||||
image_grid_set_style_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { image_grid_set_style_invoker } }
|
||||
};
|
|
@ -50,6 +50,7 @@ void register_gimprc_procs (Gimp *gimp);
|
|||
void register_gradient_procs (Gimp *gimp);
|
||||
void register_gradient_select_procs (Gimp *gimp);
|
||||
void register_gradients_procs (Gimp *gimp);
|
||||
void register_grid_procs (Gimp *gimp);
|
||||
void register_guides_procs (Gimp *gimp);
|
||||
void register_help_procs (Gimp *gimp);
|
||||
void register_image_procs (Gimp *gimp);
|
||||
|
@ -76,7 +77,7 @@ void register_undo_procs (Gimp *gimp);
|
|||
void register_unit_procs (Gimp *gimp);
|
||||
void register_vectors_procs (Gimp *gimp);
|
||||
|
||||
/* 480 procedures registered total */
|
||||
/* 490 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (Gimp *gimp,
|
||||
|
@ -88,130 +89,133 @@ internal_procs_init (Gimp *gimp,
|
|||
(* status_callback) (_("Internal Procedures"), _("Brush"), 0.0);
|
||||
register_brush_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Brush UI"), 0.046);
|
||||
(* status_callback) (NULL, _("Brush UI"), 0.045);
|
||||
register_brush_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Brushes"), 0.052);
|
||||
(* status_callback) (NULL, _("Brushes"), 0.051);
|
||||
register_brushes_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Buffer procedures"), 0.065);
|
||||
(* status_callback) (NULL, _("Buffer procedures"), 0.063);
|
||||
register_buffer_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Channel"), 0.079);
|
||||
(* status_callback) (NULL, _("Channel"), 0.078);
|
||||
register_channel_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Color"), 0.1);
|
||||
(* status_callback) (NULL, _("Color"), 0.098);
|
||||
register_color_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Context"), 0.133);
|
||||
(* status_callback) (NULL, _("Context"), 0.131);
|
||||
register_context_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Convert"), 0.179);
|
||||
(* status_callback) (NULL, _("Convert"), 0.176);
|
||||
register_convert_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Display procedures"), 0.185);
|
||||
(* status_callback) (NULL, _("Display procedures"), 0.182);
|
||||
register_display_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Drawable procedures"), 0.196);
|
||||
(* status_callback) (NULL, _("Drawable procedures"), 0.192);
|
||||
register_drawable_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Transformation procedures"), 0.269);
|
||||
(* status_callback) (NULL, _("Transformation procedures"), 0.263);
|
||||
register_drawable_transform_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Edit procedures"), 0.302);
|
||||
(* status_callback) (NULL, _("Edit procedures"), 0.296);
|
||||
register_edit_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("File Operations"), 0.333);
|
||||
(* status_callback) (NULL, _("File Operations"), 0.327);
|
||||
register_fileops_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Floating selections"), 0.354);
|
||||
(* status_callback) (NULL, _("Floating selections"), 0.347);
|
||||
register_floating_sel_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Font UI"), 0.367);
|
||||
(* status_callback) (NULL, _("Font UI"), 0.359);
|
||||
register_font_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Fonts"), 0.373);
|
||||
(* status_callback) (NULL, _("Fonts"), 0.365);
|
||||
register_fonts_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gimprc procedures"), 0.377);
|
||||
(* status_callback) (NULL, _("Gimprc procedures"), 0.369);
|
||||
register_gimprc_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gradient"), 0.392);
|
||||
(* status_callback) (NULL, _("Gradient"), 0.384);
|
||||
register_gradient_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gradient UI"), 0.454);
|
||||
(* status_callback) (NULL, _("Gradient UI"), 0.445);
|
||||
register_gradient_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gradients"), 0.46);
|
||||
(* status_callback) (NULL, _("Gradients"), 0.451);
|
||||
register_gradients_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Guide procedures"), 0.471);
|
||||
(* status_callback) (NULL, _("Image grid procedures"), 0.461);
|
||||
register_grid_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Guide procedures"), 0.482);
|
||||
register_guides_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Help procedures"), 0.483);
|
||||
(* status_callback) (NULL, _("Help procedures"), 0.494);
|
||||
register_help_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Image"), 0.485);
|
||||
(* status_callback) (NULL, _("Image"), 0.496);
|
||||
register_image_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Layer"), 0.617);
|
||||
(* status_callback) (NULL, _("Layer"), 0.624);
|
||||
register_layer_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Message procedures"), 0.673);
|
||||
(* status_callback) (NULL, _("Message procedures"), 0.68);
|
||||
register_message_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Miscellaneous"), 0.679);
|
||||
(* status_callback) (NULL, _("Miscellaneous"), 0.686);
|
||||
register_misc_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Paint Tool procedures"), 0.685);
|
||||
(* status_callback) (NULL, _("Paint Tool procedures"), 0.692);
|
||||
register_paint_tools_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Palette"), 0.717);
|
||||
(* status_callback) (NULL, _("Palette"), 0.722);
|
||||
register_palette_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Palette UI"), 0.746);
|
||||
(* status_callback) (NULL, _("Palette UI"), 0.751);
|
||||
register_palette_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Palettes"), 0.752);
|
||||
(* status_callback) (NULL, _("Palettes"), 0.757);
|
||||
register_palettes_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Parasite procedures"), 0.76);
|
||||
(* status_callback) (NULL, _("Parasite procedures"), 0.765);
|
||||
register_parasite_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Paths"), 0.785);
|
||||
(* status_callback) (NULL, _("Paths"), 0.79);
|
||||
register_paths_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Pattern"), 0.819);
|
||||
(* status_callback) (NULL, _("Pattern"), 0.822);
|
||||
register_pattern_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Pattern UI"), 0.823);
|
||||
(* status_callback) (NULL, _("Pattern UI"), 0.827);
|
||||
register_pattern_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Patterns"), 0.829);
|
||||
(* status_callback) (NULL, _("Patterns"), 0.833);
|
||||
register_patterns_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Plug-in"), 0.838);
|
||||
(* status_callback) (NULL, _("Plug-in"), 0.841);
|
||||
register_plug_in_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Procedural database"), 0.85);
|
||||
(* status_callback) (NULL, _("Procedural database"), 0.853);
|
||||
register_procedural_db_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Progress"), 0.869);
|
||||
(* status_callback) (NULL, _("Progress"), 0.871);
|
||||
register_progress_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Image mask"), 0.885);
|
||||
(* status_callback) (NULL, _("Image mask"), 0.888);
|
||||
register_selection_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Selection Tool procedures"), 0.921);
|
||||
(* status_callback) (NULL, _("Selection Tool procedures"), 0.922);
|
||||
register_selection_tools_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Text procedures"), 0.931);
|
||||
(* status_callback) (NULL, _("Text procedures"), 0.933);
|
||||
register_text_tool_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Transform Tool procedures"), 0.94);
|
||||
(* status_callback) (NULL, _("Transform Tool procedures"), 0.941);
|
||||
register_transform_tools_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Undo"), 0.952);
|
||||
(* status_callback) (NULL, _("Undo"), 0.953);
|
||||
register_undo_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Units"), 0.967);
|
||||
|
|
|
@ -90,6 +90,7 @@ PDB_WRAPPERS_C = \
|
|||
gimpgradients_pdb.c \
|
||||
gimpgradientselect_pdb.c \
|
||||
gimpguides_pdb.c \
|
||||
gimpgrid_pdb.c \
|
||||
gimphelp_pdb.c \
|
||||
gimpimage_pdb.c \
|
||||
gimplayer_pdb.c \
|
||||
|
@ -137,6 +138,7 @@ PDB_WRAPPERS_H = \
|
|||
gimpgradient_pdb.h \
|
||||
gimpgradients_pdb.h \
|
||||
gimpgradientselect_pdb.h \
|
||||
gimpgrid_pdb.h \
|
||||
gimpguides_pdb.h \
|
||||
gimphelp_pdb.h \
|
||||
gimpimage_pdb.h \
|
||||
|
|
|
@ -313,6 +313,14 @@ EXPORTS
|
|||
gimp_image_get_tattoo_state
|
||||
gimp_image_get_thumbnail_data
|
||||
gimp_image_get_unit
|
||||
gimp_image_grid_get_background_color
|
||||
gimp_image_grid_get_foreground_color
|
||||
gimp_image_grid_get_offset
|
||||
gimp_image_grid_get_spacing
|
||||
gimp_image_grid_set_background_color
|
||||
gimp_image_grid_set_foreground_color
|
||||
gimp_image_grid_set_offset
|
||||
gimp_image_grid_set_spacing
|
||||
gimp_image_height
|
||||
gimp_image_is_dirty
|
||||
gimp_image_list
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include <libgimp/gimpgradient_pdb.h>
|
||||
#include <libgimp/gimpgradients_pdb.h>
|
||||
#include <libgimp/gimpgradientselect_pdb.h>
|
||||
#include <libgimp/gimpgrid_pdb.h>
|
||||
#include <libgimp/gimpguides_pdb.h>
|
||||
#include <libgimp/gimphelp_pdb.h>
|
||||
#include <libgimp/gimpimage_pdb.h>
|
||||
|
|
|
@ -21,6 +21,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
|
|||
gimp_gradient_segment_color_get_type,
|
||||
gimp_gradient_segment_type_get_type,
|
||||
gimp_gradient_type_get_type,
|
||||
gimp_grid_style_get_type,
|
||||
gimp_histogram_channel_get_type,
|
||||
gimp_hue_range_get_type,
|
||||
gimp_icon_type_get_type,
|
||||
|
@ -67,6 +68,7 @@ static const gchar *type_names[] =
|
|||
"GimpGradientSegmentColor",
|
||||
"GimpGradientSegmentType",
|
||||
"GimpGradientType",
|
||||
"GimpGridStyle",
|
||||
"GimpHistogramChannel",
|
||||
"GimpHueRange",
|
||||
"GimpIconType",
|
||||
|
|
|
@ -0,0 +1,399 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpgrid_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_get_spacing (gint32 image_ID,
|
||||
gdouble *xspacing,
|
||||
gdouble *yspacing)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-get-spacing",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_set_spacing (gint32 image_ID,
|
||||
gdouble xspacing,
|
||||
gdouble yspacing)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-set-spacing",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_FLOAT, xspacing,
|
||||
GIMP_PDB_FLOAT, yspacing,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_get_offset (gint32 image_ID,
|
||||
gdouble *xoffset,
|
||||
gdouble *yoffset)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-get-offset",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_set_offset (gint32 image_ID,
|
||||
gdouble xoffset,
|
||||
gdouble yoffset)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-set-offset",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_FLOAT, xoffset,
|
||||
GIMP_PDB_FLOAT, yoffset,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_get_foreground_color (gint32 image_ID,
|
||||
GimpRGB *fgcolor)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-get-foreground-color",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_set_foreground_color (gint32 image_ID,
|
||||
const GimpRGB *fgcolor)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-set-foreground-color",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_COLOR, fgcolor,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_get_background_color (gint32 image_ID,
|
||||
GimpRGB *bgcolor)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-get-background-color",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_set_background_color (gint32 image_ID,
|
||||
const GimpRGB *bgcolor)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-set-background-color",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_COLOR, bgcolor,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
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",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
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
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_grid_set_style (gint32 image_ID,
|
||||
GimpGridStyle style)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-grid-set-style",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_INT32, style,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpgrid_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl */
|
||||
|
||||
#ifndef __GIMP_GRID_PDB_H__
|
||||
#define __GIMP_GRID_PDB_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_image_grid_get_spacing (gint32 image_ID,
|
||||
gdouble *xspacing,
|
||||
gdouble *yspacing);
|
||||
gboolean gimp_image_grid_set_spacing (gint32 image_ID,
|
||||
gdouble xspacing,
|
||||
gdouble yspacing);
|
||||
gboolean gimp_image_grid_get_offset (gint32 image_ID,
|
||||
gdouble *xoffset,
|
||||
gdouble *yoffset);
|
||||
gboolean gimp_image_grid_set_offset (gint32 image_ID,
|
||||
gdouble xoffset,
|
||||
gdouble yoffset);
|
||||
gboolean gimp_image_grid_get_foreground_color (gint32 image_ID,
|
||||
GimpRGB *fgcolor);
|
||||
gboolean gimp_image_grid_set_foreground_color (gint32 image_ID,
|
||||
const GimpRGB *fgcolor);
|
||||
gboolean gimp_image_grid_get_background_color (gint32 image_ID,
|
||||
GimpRGB *bgcolor);
|
||||
gboolean gimp_image_grid_set_background_color (gint32 image_ID,
|
||||
const GimpRGB *bgcolor);
|
||||
GimpGridStyle gimp_image_grid_get_style (gint32 image_ID);
|
||||
gboolean gimp_image_grid_set_style (gint32 image_ID,
|
||||
GimpGridStyle style);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_GRID_PDB_H__ */
|
|
@ -34,6 +34,7 @@ EXPORTS
|
|||
gimp_flags_value_get_help
|
||||
gimp_foreground_extract_mode_get_type
|
||||
gimp_gradient_type_get_type
|
||||
gimp_grid_style_get_type
|
||||
gimp_gtkrc
|
||||
gimp_icon_type_get_type
|
||||
gimp_image_base_type_get_type
|
||||
|
|
|
@ -409,6 +409,41 @@ gimp_gradient_type_get_type (void)
|
|||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_grid_style_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_GRID_DOTS, "GIMP_GRID_DOTS", "dots" },
|
||||
{ GIMP_GRID_INTERSECTIONS, "GIMP_GRID_INTERSECTIONS", "intersections" },
|
||||
{ GIMP_GRID_ON_OFF_DASH, "GIMP_GRID_ON_OFF_DASH", "on-off-dash" },
|
||||
{ GIMP_GRID_DOUBLE_DASH, "GIMP_GRID_DOUBLE_DASH", "double-dash" },
|
||||
{ GIMP_GRID_SOLID, "GIMP_GRID_SOLID", "solid" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_GRID_DOTS, N_("Intersections (dots)"), NULL },
|
||||
{ GIMP_GRID_INTERSECTIONS, N_("Intersections (crosshairs)"), NULL },
|
||||
{ GIMP_GRID_ON_OFF_DASH, N_("Dashed"), NULL },
|
||||
{ GIMP_GRID_DOUBLE_DASH, N_("Double dashed"), NULL },
|
||||
{ GIMP_GRID_SOLID, N_("Solid"), NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
type = g_enum_register_static ("GimpGridStyle", values);
|
||||
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_icon_type_get_type (void)
|
||||
{
|
||||
|
|
|
@ -185,6 +185,20 @@ typedef enum
|
|||
} GimpGradientType;
|
||||
|
||||
|
||||
#define GIMP_TYPE_GRID_STYLE (gimp_grid_style_get_type ())
|
||||
|
||||
GType gimp_grid_style_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_GRID_DOTS, /*< desc="Intersections (dots)" >*/
|
||||
GIMP_GRID_INTERSECTIONS, /*< desc="Intersections (crosshairs)" >*/
|
||||
GIMP_GRID_ON_OFF_DASH, /*< desc="Dashed" >*/
|
||||
GIMP_GRID_DOUBLE_DASH, /*< desc="Double dashed" >*/
|
||||
GIMP_GRID_SOLID /*< desc="Solid" >*/
|
||||
} GimpGridStyle;
|
||||
|
||||
|
||||
#define GIMP_TYPE_ICON_TYPE (gimp_icon_type_get_type ())
|
||||
|
||||
GType gimp_icon_type_get_type (void) G_GNUC_CONST;
|
||||
|
|
|
@ -22,6 +22,7 @@ pdb_sources = \
|
|||
pdb/gradient.pdb \
|
||||
pdb/gradient_select.pdb \
|
||||
pdb/gradients.pdb \
|
||||
pdb/grid.pdb \
|
||||
pdb/guides.pdb \
|
||||
pdb/help.pdb \
|
||||
pdb/image.pdb \
|
||||
|
|
|
@ -128,6 +128,18 @@ package Gimp::CodeGen::enums;
|
|||
GIMP_GRADIENT_SPIRAL_CLOCKWISE => '9',
|
||||
GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE => '10' }
|
||||
},
|
||||
GimpGridStyle =>
|
||||
{ contig => 1,
|
||||
header => 'libgimpbase/gimpbaseenums.h',
|
||||
symbols => [ qw(GIMP_GRID_DOTS GIMP_GRID_INTERSECTIONS
|
||||
GIMP_GRID_ON_OFF_DASH GIMP_GRID_DOUBLE_DASH
|
||||
GIMP_GRID_SOLID) ],
|
||||
mapping => { GIMP_GRID_DOTS => '0',
|
||||
GIMP_GRID_INTERSECTIONS => '1',
|
||||
GIMP_GRID_ON_OFF_DASH => '2',
|
||||
GIMP_GRID_DOUBLE_DASH => '3',
|
||||
GIMP_GRID_SOLID => '4' }
|
||||
},
|
||||
GimpIconType =>
|
||||
{ contig => 1,
|
||||
header => 'libgimpbase/gimpbaseenums.h',
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
gradient
|
||||
gradient_select
|
||||
gradients
|
||||
grid
|
||||
guides
|
||||
help
|
||||
image
|
||||
|
|
|
@ -0,0 +1,318 @@
|
|||
# The GIMP -- an 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 2 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
sub pdb_misc {
|
||||
$author = $copyright = 'Sylvain FORET';
|
||||
$date = '2005';
|
||||
$since = '2.4';
|
||||
}
|
||||
|
||||
sub image_grid_get_dimensions {
|
||||
my ($type) = @_;
|
||||
|
||||
$blurb = "Gets the ${type} of an image's grid.";
|
||||
|
||||
$help = <<HELP;
|
||||
This procedure retrieves the horizontal and vertical ${type} of an image's grid.
|
||||
It takes the image as parameter.
|
||||
HELP
|
||||
|
||||
&pdb_misc;
|
||||
|
||||
my $bounded_type = 'float';
|
||||
#my $bounded_type = ($type eq 'spacing') ? 1 : '-GIMP_MAX_IMAGE_SIZE';
|
||||
#$bounded_type .= " <= float <= GIMP_MAX_IMAGE_SIZE";
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => "x$type",
|
||||
type => $bounded_type,
|
||||
void_ret => 1,
|
||||
desc => "The image's grid horizontal $type" },
|
||||
{ name => "y$type",
|
||||
type => $bounded_type,
|
||||
void_ret => 1,
|
||||
desc => "The image's grid vertical $type" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpGrid *grid' ],
|
||||
code => <<CODE
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
x$type = grid->x$type;
|
||||
y$type = grid->y$type;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_grid_set_dimensions {
|
||||
my ($type) = @_;
|
||||
|
||||
$blurb = "Sets the ${type} of an image's grid.";
|
||||
|
||||
$help = <<HELP;
|
||||
This procedure sets the horizontal and vertical ${type} of an image's grid.
|
||||
HELP
|
||||
|
||||
&pdb_misc;
|
||||
|
||||
my $bounded_type = 'float';
|
||||
#my $bounded_type = ($type eq 'spacing') ? 1 : '-GIMP_MAX_IMAGE_SIZE';
|
||||
#$bounded_type .= " <= float <= GIMP_MAX_IMAGE_SIZE";
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg,
|
||||
{ name => "x$type",
|
||||
type => $bounded_type,
|
||||
desc => "The image's grid horizontal $type" },
|
||||
{ name => "y$type",
|
||||
type => $bounded_type,
|
||||
desc => "The image's grid vertical $type" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpGrid *grid' ],
|
||||
code => <<CODE
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
g_object_set (grid,
|
||||
"x$type", x$type,
|
||||
"y$type", y$type,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_grid_get_color {
|
||||
my ($desc, $type) = @_;
|
||||
my $arg = "${type}color";
|
||||
|
||||
$blurb = "Sets the $desc color of an image's grid.";
|
||||
|
||||
$help = <<HELP;
|
||||
This procedure gets the $desc color of an image's grid.
|
||||
HELP
|
||||
|
||||
&pdb_misc;
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg,
|
||||
);
|
||||
@outargs = (
|
||||
{ name => "$arg",
|
||||
type => 'color',
|
||||
void_ret => 1,
|
||||
desc => "The image's grid $desc color" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpGrid *grid' ],
|
||||
code => <<CODE
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
$arg = grid->$arg;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_grid_set_color {
|
||||
my ($desc, $type) = @_;
|
||||
my $arg = "${type}color";
|
||||
|
||||
$blurb = "Gets the $desc color of an image's grid.";
|
||||
|
||||
$help = <<HELP;
|
||||
This procedure sets the $desc color of an image's grid.
|
||||
HELP
|
||||
|
||||
&pdb_misc;
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg,
|
||||
{ name => "$arg",
|
||||
type => 'color',
|
||||
desc => "The new $desc color" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpGrid *grid' ],
|
||||
code => <<CODE
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
g_object_set (grid,
|
||||
"$arg", &$arg,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
# The defs
|
||||
|
||||
sub image_grid_get_spacing {
|
||||
&image_grid_get_dimensions ('spacing');
|
||||
}
|
||||
|
||||
sub image_grid_set_spacing {
|
||||
&image_grid_set_dimensions ('spacing');
|
||||
}
|
||||
|
||||
sub image_grid_get_offset {
|
||||
&image_grid_get_dimensions ('offset');
|
||||
}
|
||||
|
||||
sub image_grid_set_offset {
|
||||
&image_grid_set_dimensions ('offset');
|
||||
}
|
||||
|
||||
sub image_grid_get_foreground_color {
|
||||
&image_grid_get_color ('foreground', 'fg');
|
||||
}
|
||||
|
||||
sub image_grid_set_foreground_color {
|
||||
&image_grid_set_color ('foreground', 'fg');
|
||||
}
|
||||
|
||||
sub image_grid_get_background_color {
|
||||
&image_grid_get_color ('background', 'bg');
|
||||
}
|
||||
|
||||
sub image_grid_set_background_color {
|
||||
&image_grid_set_color ('background', 'bg');
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
&pdb_misc;
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'style',
|
||||
type => 'enum GimpGridStyle',
|
||||
desc => "The image's grid style" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpGrid *grid' ],
|
||||
code => <<CODE
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
{
|
||||
style = grid->style;
|
||||
}
|
||||
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
|
||||
|
||||
&pdb_misc;
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg,
|
||||
{ name => 'style',
|
||||
type => 'enum GimpGridStyle',
|
||||
desc => "The image's grid style" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpGrid *grid' ],
|
||||
code => <<CODE
|
||||
{
|
||||
grid = gimp_image_get_grid (gimage);
|
||||
if (grid)
|
||||
g_object_set (grid,
|
||||
"style", style,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
# Required headers
|
||||
|
||||
@headers = qw("core/gimpimage-grid.h"
|
||||
"core/gimpgrid.h"
|
||||
"libgimpbase/gimpbaseenums.h"
|
||||
);
|
||||
|
||||
# Exported procedures
|
||||
|
||||
@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';
|
||||
|
||||
1;
|
Loading…
Reference in New Issue