plug-ins/common/compose.c generate PDB docs from the same source as the

2007-10-24  Manish Singh  <yosh@gimp.org>

        * plug-ins/common/compose.c
        * plug-ins/common/decompose.c: generate PDB docs from the same
        source as the UI.

svn path=/trunk/; revision=23940
This commit is contained in:
Manish Singh 2007-10-25 03:32:18 +00:00 committed by Manish Singh
parent af6766cd47
commit af49ba3737
3 changed files with 53 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2007-10-24 Manish Singh <yosh@gimp.org>
* plug-ins/common/compose.c
* plug-ins/common/decompose.c: generate PDB docs from the same
source as the UI.
2007-10-24 Kevin Cozens <kcozens@cvs.gnome.org>
* Makefile.am: Applied patch from Stanislav Brabec which adds

View File

@ -342,7 +342,7 @@ MAIN ()
static void
query (void)
{
static const GimpParamDef args[] =
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image1", "First input image" },
@ -350,7 +350,7 @@ query (void)
{ GIMP_PDB_IMAGE, "image2", "Second input image" },
{ GIMP_PDB_IMAGE, "image3", "Third input image" },
{ GIMP_PDB_IMAGE, "image4", "Fourth input image" },
{ GIMP_PDB_STRING, "compose-type", "What to compose: RGB, RGBA, HSV, HSL, CMY, CMYK" }
{ GIMP_PDB_STRING, "compose-type", NULL }
};
static const GimpParamDef return_vals[] =
@ -358,7 +358,7 @@ query (void)
{ GIMP_PDB_IMAGE, "new_image", "Output image" }
};
static const GimpParamDef drw_args[] =
static GimpParamDef drw_args[] =
{
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image1", "First input image (not used)" },
@ -366,7 +366,7 @@ query (void)
{ GIMP_PDB_DRAWABLE, "drawable2", "Second input drawable" },
{ GIMP_PDB_DRAWABLE, "drawable3", "Third input drawable" },
{ GIMP_PDB_DRAWABLE, "drawable4", "Fourth input drawable" },
{ GIMP_PDB_STRING, "compose-type", "What to compose: RGB, RGBA, HSV, HSL, CMY, CMYK" }
{ GIMP_PDB_STRING, "compose-type", NULL }
};
static const GimpParamDef drw_return_vals[] =
@ -381,6 +381,25 @@ query (void)
{ GIMP_PDB_DRAWABLE, "drawable", "Not used" },
};
GString *type_desc;
int i;
type_desc = g_string_new ("What to compose: ");
g_string_append_c (type_desc, '"');
g_string_append (type_desc, compose_dsc[0].compose_type);
g_string_append_c (type_desc, '"');
for (i = 1; i < G_N_ELEMENTS (compose_dsc); i++)
{
g_string_append (type_desc, ", ");
g_string_append_c (type_desc, '"');
g_string_append (type_desc, compose_dsc[i].compose_type);
g_string_append_c (type_desc, '"');
}
args[6].description = type_desc->str;
drw_args[6].description = type_desc->str;
gimp_install_procedure (COMPOSE_PROC,
N_("Create an image using multiple gray images as color channels"),
"This function creates a new image from "
@ -427,6 +446,8 @@ query (void)
recompose_args, NULL);
gimp_plugin_menu_register (RECOMPOSE_PROC, "<Image>/Colors/Components");
g_string_free (type_desc, TRUE);
}

View File

@ -274,12 +274,12 @@ MAIN ()
static void
query (void)
{
static const GimpParamDef args[] =
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_STRING, "decompose-type", "What to decompose: RGB, Red, Green, Blue, RGBA, Red, Green, Blue, Alpha, HSV, Hue, Saturation, Value, CMY, Cyan, Magenta, Yellow, CMYK, Cyan_K, Magenta_K, Yellow_K, Alpha, LAB" },
{ GIMP_PDB_STRING, "decompose-type", NULL },
{ GIMP_PDB_INT32, "layers-mode", "Create channels as layers in a single image" }
};
static const GimpParamDef return_vals[] =
@ -290,6 +290,24 @@ query (void)
{ GIMP_PDB_IMAGE, "new-image", "Output gray image (N/A for single channel extract)" }
};
GString *type_desc;
int i;
type_desc = g_string_new ("What to decompose: ");
g_string_append_c (type_desc, '"');
g_string_append (type_desc, extract[0].type);
g_string_append_c (type_desc, '"');
for (i = 1; i < G_N_ELEMENTS (extract); i++)
{
g_string_append (type_desc, ", ");
g_string_append_c (type_desc, '"');
g_string_append (type_desc, extract[i].type);
g_string_append_c (type_desc, '"');
}
args[3].description = type_desc->str;
gimp_install_procedure (PLUG_IN_PROC,
N_("Decompose an image into separate colorspace components"),
"This function creates new gray images with "
@ -323,6 +341,8 @@ query (void)
args, return_vals);
gimp_plugin_menu_register (PLUG_IN_PROC_REG, "<Image>/Colors/Components");
g_string_free (type_desc, TRUE);
}
static void