Commit f6b37095 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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.
parent 2931a990
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 \
......
/* 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;
}