GimpParamDef pdb_proc_get_param_info(gchar* proc_name, gint arg_num) { GimpParamDef param_info; GimpPDBArgType type; gchar *name; gchar *desc; gimp_procedural_db_proc_arg ( proc_name, arg_num, &type, &name, &desc ); param_info.type = type; param_info.name = g_strdup(name); param_info.description = g_strdup(desc); return param_info; }
/** * gimp_procedural_db_proc_info: * @procedure: The procedure name. * @blurb: A short blurb. * @help: Detailed procedure help. * @author: Author(s) of the procedure. * @copyright: The copyright. * @date: Copyright date. * @proc_type: The procedure type. * @num_args: The number of input arguments. * @num_values: The number of return values. * @args: The input arguments. * @return_vals: The return values. * * Queries the procedural database for information on the specified * procedure. * * This procedure returns information on the specified procedure. A * short blurb, detailed help, author(s), copyright information, * procedure type, number of input, and number of return values are * returned. Additionally this function returns specific information * about each input argument and return value. * * Returns: TRUE on success. */ gboolean gimp_procedural_db_proc_info (const gchar *procedure, gchar **blurb, gchar **help, gchar **author, gchar **copyright, gchar **date, GimpPDBProcType *proc_type, gint *num_args, gint *num_values, GimpParamDef **args, GimpParamDef **return_vals) { gint i; gboolean success = TRUE; success = _gimp_procedural_db_proc_info (procedure, blurb, help, author, copyright, date, proc_type, num_args, num_values); if (success) { *args = g_new (GimpParamDef, *num_args); *return_vals = g_new (GimpParamDef, *num_values); for (i = 0; i < *num_args; i++) { if (! gimp_procedural_db_proc_arg (procedure, i, &(*args)[i].type, &(*args)[i].name, &(*args)[i].description)) { g_free (*args); g_free (*return_vals); return FALSE; } } for (i = 0; i < *num_values; i++) { if (! gimp_procedural_db_proc_val (procedure, i, &(*return_vals)[i].type, &(*return_vals)[i].name, &(*return_vals)[i].description)) { g_free (*args); g_free (*return_vals); return FALSE; } } } return success; }