From af49ba3737551cfc9861f757f15b308c20f89ed8 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Thu, 25 Oct 2007 03:32:18 +0000 Subject: [PATCH] plug-ins/common/compose.c generate PDB docs from the same source as the 2007-10-24 Manish Singh * 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 --- ChangeLog | 6 ++++++ plug-ins/common/compose.c | 29 +++++++++++++++++++++++++---- plug-ins/common/decompose.c | 24 ++++++++++++++++++++++-- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58bd4d19c8..7a48cae855 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-24 Manish Singh + + * 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 * Makefile.am: Applied patch from Stanislav Brabec which adds diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c index 98c5b7e6bc..a034d68bba 100644 --- a/plug-ins/common/compose.c +++ b/plug-ins/common/compose.c @@ -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, "/Colors/Components"); + + g_string_free (type_desc, TRUE); } diff --git a/plug-ins/common/decompose.c b/plug-ins/common/decompose.c index 786bf2f20e..940d42241d 100644 --- a/plug-ins/common/decompose.c +++ b/plug-ins/common/decompose.c @@ -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, "/Colors/Components"); + + g_string_free (type_desc, TRUE); } static void