mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
added get_number_of_built_in_units
* tools/pdbgen/pdb/unit.pdb: added get_number_of_built_in_units * tools/pdbgen/Makefile.am: gen files in $top_srcdir/libgimp * tools/pdbgen/lib.pl * tools/pdbgen/pdb/procedural_db.pdb: libgimp pdbgen munging, final landing -Yosh
This commit is contained in:
parent
4bfdd765fe
commit
5828759fb8
15 changed files with 307 additions and 232 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Mon Aug 21 14:09:55 PDT 2000 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
* tools/pdbgen/pdb/unit.pdb: added get_number_of_built_in_units
|
||||||
|
|
||||||
|
* tools/pdbgen/Makefile.am: gen files in $top_srcdir/libgimp
|
||||||
|
|
||||||
|
* tools/pdbgen/lib.pl
|
||||||
|
* tools/pdbgen/pdb/procedural_db.pdb: libgimp pdbgen munging, final
|
||||||
|
landing
|
||||||
|
|
||||||
Mon Aug 21 11:57:48 PDT 2000 Manish Singh <yosh@gimp.org>
|
Mon Aug 21 11:57:48 PDT 2000 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* tools/pdbgen/lib.pl
|
* tools/pdbgen/lib.pl
|
||||||
|
|
|
@ -60,7 +60,7 @@ void register_tools_procs (void);
|
||||||
void register_undo_procs (void);
|
void register_undo_procs (void);
|
||||||
void register_unit_procs (void);
|
void register_unit_procs (void);
|
||||||
|
|
||||||
/* 322 procedures registered total */
|
/* 323 procedures registered total */
|
||||||
|
|
||||||
void
|
void
|
||||||
internal_procs_init (void)
|
internal_procs_init (void)
|
||||||
|
@ -80,10 +80,10 @@ internal_procs_init (void)
|
||||||
app_init_update_status (NULL, _("Color"), 0.096);
|
app_init_update_status (NULL, _("Color"), 0.096);
|
||||||
register_color_procs ();
|
register_color_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Convert"), 0.134);
|
app_init_update_status (NULL, _("Convert"), 0.133);
|
||||||
register_convert_procs ();
|
register_convert_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("GDisplay procedures"), 0.143);
|
app_init_update_status (NULL, _("GDisplay procedures"), 0.142);
|
||||||
register_display_procs ();
|
register_display_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Drawable procedures"), 0.152);
|
app_init_update_status (NULL, _("Drawable procedures"), 0.152);
|
||||||
|
@ -92,72 +92,72 @@ internal_procs_init (void)
|
||||||
app_init_update_status (NULL, _("Edit procedures"), 0.22);
|
app_init_update_status (NULL, _("Edit procedures"), 0.22);
|
||||||
register_edit_procs ();
|
register_edit_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("File Operations"), 0.239);
|
app_init_update_status (NULL, _("File Operations"), 0.238);
|
||||||
register_fileops_procs ();
|
register_fileops_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Floating selections"), 0.264);
|
app_init_update_status (NULL, _("Floating selections"), 0.263);
|
||||||
register_floating_sel_procs ();
|
register_floating_sel_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Gimprc procedures"), 0.283);
|
app_init_update_status (NULL, _("Gimprc procedures"), 0.282);
|
||||||
register_gimprc_procs ();
|
register_gimprc_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Gradients"), 0.292);
|
app_init_update_status (NULL, _("Gradients"), 0.291);
|
||||||
register_gradients_procs ();
|
register_gradients_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Gradient UI"), 0.307);
|
app_init_update_status (NULL, _("Gradient UI"), 0.307);
|
||||||
register_gradient_select_procs ();
|
register_gradient_select_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Guide procedures"), 0.32);
|
app_init_update_status (NULL, _("Guide procedures"), 0.319);
|
||||||
register_guides_procs ();
|
register_guides_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Help procedures"), 0.339);
|
app_init_update_status (NULL, _("Help procedures"), 0.337);
|
||||||
register_help_procs ();
|
register_help_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Image"), 0.342);
|
app_init_update_status (NULL, _("Image"), 0.341);
|
||||||
register_image_procs ();
|
register_image_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Layer"), 0.525);
|
app_init_update_status (NULL, _("Layer"), 0.523);
|
||||||
register_layer_procs ();
|
register_layer_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Interface"), 0.621);
|
app_init_update_status (NULL, _("Interface"), 0.619);
|
||||||
register_message_procs ();
|
register_message_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Miscellaneous"), 0.63);
|
app_init_update_status (NULL, _("Miscellaneous"), 0.628);
|
||||||
register_misc_procs ();
|
register_misc_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Palette"), 0.637);
|
app_init_update_status (NULL, _("Palette"), 0.635);
|
||||||
register_palette_procs ();
|
register_palette_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Parasite procedures"), 0.658);
|
app_init_update_status (NULL, _("Parasite procedures"), 0.656);
|
||||||
register_parasite_procs ();
|
register_parasite_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Paths"), 0.696);
|
app_init_update_status (NULL, _("Paths"), 0.693);
|
||||||
register_paths_procs ();
|
register_paths_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Pattern UI"), 0.736);
|
app_init_update_status (NULL, _("Pattern UI"), 0.734);
|
||||||
register_pattern_select_procs ();
|
register_pattern_select_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Patterns"), 0.745);
|
app_init_update_status (NULL, _("Patterns"), 0.743);
|
||||||
register_patterns_procs ();
|
register_patterns_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Plug-in"), 0.758);
|
app_init_update_status (NULL, _("Plug-in"), 0.755);
|
||||||
register_plug_in_procs ();
|
register_plug_in_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Procedural database"), 0.776);
|
app_init_update_status (NULL, _("Procedural database"), 0.774);
|
||||||
register_procedural_db_procs ();
|
register_procedural_db_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Image mask"), 0.801);
|
app_init_update_status (NULL, _("Image mask"), 0.799);
|
||||||
register_selection_procs ();
|
register_selection_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Text procedures"), 0.854);
|
app_init_update_status (NULL, _("Text procedures"), 0.851);
|
||||||
register_text_tool_procs ();
|
register_text_tool_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Tool procedures"), 0.866);
|
app_init_update_status (NULL, _("Tool procedures"), 0.864);
|
||||||
register_tools_procs ();
|
register_tools_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Undo"), 0.96);
|
app_init_update_status (NULL, _("Undo"), 0.957);
|
||||||
register_undo_procs ();
|
register_undo_procs ();
|
||||||
|
|
||||||
app_init_update_status (NULL, _("Units"), 0.966);
|
app_init_update_status (NULL, _("Units"), 0.963);
|
||||||
register_unit_procs ();
|
register_unit_procs ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "libgimp/gimpunit.h"
|
#include "libgimp/gimpunit.h"
|
||||||
|
|
||||||
static ProcRecord unit_get_number_of_units_proc;
|
static ProcRecord unit_get_number_of_units_proc;
|
||||||
|
static ProcRecord unit_get_number_of_built_in_units_proc;
|
||||||
static ProcRecord unit_new_proc;
|
static ProcRecord unit_new_proc;
|
||||||
static ProcRecord unit_get_deletion_flag_proc;
|
static ProcRecord unit_get_deletion_flag_proc;
|
||||||
static ProcRecord unit_set_deletion_flag_proc;
|
static ProcRecord unit_set_deletion_flag_proc;
|
||||||
|
@ -38,6 +39,7 @@ void
|
||||||
register_unit_procs (void)
|
register_unit_procs (void)
|
||||||
{
|
{
|
||||||
procedural_db_register (&unit_get_number_of_units_proc);
|
procedural_db_register (&unit_get_number_of_units_proc);
|
||||||
|
procedural_db_register (&unit_get_number_of_built_in_units_proc);
|
||||||
procedural_db_register (&unit_new_proc);
|
procedural_db_register (&unit_new_proc);
|
||||||
procedural_db_register (&unit_get_deletion_flag_proc);
|
procedural_db_register (&unit_get_deletion_flag_proc);
|
||||||
procedural_db_register (&unit_set_deletion_flag_proc);
|
procedural_db_register (&unit_set_deletion_flag_proc);
|
||||||
|
@ -86,6 +88,42 @@ static ProcRecord unit_get_number_of_units_proc =
|
||||||
{ { unit_get_number_of_units_invoker } }
|
{ { unit_get_number_of_units_invoker } }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static Argument *
|
||||||
|
unit_get_number_of_built_in_units_invoker (Argument *args)
|
||||||
|
{
|
||||||
|
Argument *return_args;
|
||||||
|
|
||||||
|
return_args = procedural_db_return_args (&unit_get_number_of_built_in_units_proc, TRUE);
|
||||||
|
return_args[1].value.pdb_int = gimp_unit_get_number_of_units ();
|
||||||
|
|
||||||
|
return return_args;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ProcArg unit_get_number_of_built_in_units_outargs[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
PDB_INT32,
|
||||||
|
"num_units",
|
||||||
|
"The number of built-in units"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static ProcRecord unit_get_number_of_built_in_units_proc =
|
||||||
|
{
|
||||||
|
"gimp_unit_get_number_of_built_in_units",
|
||||||
|
"Returns the number of built-in units.",
|
||||||
|
"This procedure returns the number of defined units built-in to the GIMP.",
|
||||||
|
"Michael Natterer",
|
||||||
|
"Michael Natterer",
|
||||||
|
"1999",
|
||||||
|
PDB_INTERNAL,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
1,
|
||||||
|
unit_get_number_of_built_in_units_outargs,
|
||||||
|
{ { unit_get_number_of_built_in_units_invoker } }
|
||||||
|
};
|
||||||
|
|
||||||
static Argument *
|
static Argument *
|
||||||
unit_new_invoker (Argument *args)
|
unit_new_invoker (Argument *args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,8 +72,8 @@ gimp_parasite_detach (gchar *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_parasite_list (gint *num_parasites,
|
gimp_parasite_list (gint *num_parasites,
|
||||||
gchar **parasites)
|
gchar ***parasites)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -85,12 +85,13 @@ gimp_parasite_list (gint *num_parasites,
|
||||||
|
|
||||||
*num_parasites = 0;
|
*num_parasites = 0;
|
||||||
*parasites = NULL;
|
*parasites = NULL;
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
*num_parasites = return_vals[1].data.d_int32;
|
*num_parasites = return_vals[1].data.d_int32;
|
||||||
parasites = g_new (gchar *, *num_parasites);
|
*parasites = g_new (gchar *, *num_parasites);
|
||||||
for (i = 0; i < *num_parasites; i++)
|
for (i = 0; i < *num_parasites; i++)
|
||||||
parasites[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
@ -151,10 +152,9 @@ gimp_drawable_parasite_detach (gint32 drawable_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_parasite_list (gint32 drawable_ID,
|
gimp_drawable_parasite_list (gint32 drawable_ID,
|
||||||
gint *num_parasites,
|
gint *num_parasites,
|
||||||
gchar **parasites)
|
gchar ***parasites)
|
||||||
|
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -167,12 +167,13 @@ gimp_drawable_parasite_list (gint32 drawable_ID,
|
||||||
|
|
||||||
*num_parasites = 0;
|
*num_parasites = 0;
|
||||||
*parasites = NULL;
|
*parasites = NULL;
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
*num_parasites = return_vals[1].data.d_int32;
|
*num_parasites = return_vals[1].data.d_int32;
|
||||||
parasites = g_new (gchar *, *num_parasites);
|
*parasites = g_new (gchar *, *num_parasites);
|
||||||
for (i = 0; i < *num_parasites; i++)
|
for (i = 0; i < *num_parasites; i++)
|
||||||
parasites[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
@ -233,9 +234,9 @@ gimp_image_parasite_detach (gint32 image_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_image_parasite_list (gint32 image_ID,
|
gimp_image_parasite_list (gint32 image_ID,
|
||||||
gint *num_parasites,
|
gint *num_parasites,
|
||||||
gchar **parasites)
|
gchar ***parasites)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -248,12 +249,13 @@ gimp_image_parasite_list (gint32 image_ID,
|
||||||
|
|
||||||
*num_parasites = 0;
|
*num_parasites = 0;
|
||||||
*parasites = NULL;
|
*parasites = NULL;
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
*num_parasites = return_vals[1].data.d_int32;
|
*num_parasites = return_vals[1].data.d_int32;
|
||||||
parasites = g_new (gchar *, *num_parasites);
|
*parasites = g_new (gchar *, *num_parasites);
|
||||||
for (i = 0; i < *num_parasites; i++)
|
for (i = 0; i < *num_parasites; i++)
|
||||||
parasites[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
|
@ -31,29 +31,29 @@ extern "C" {
|
||||||
/* For information look into the C source or the html documentation */
|
/* For information look into the C source or the html documentation */
|
||||||
|
|
||||||
|
|
||||||
GimpParasite* gimp_parasite_find (gchar *name);
|
GimpParasite* gimp_parasite_find (gchar *name);
|
||||||
void gimp_parasite_attach (GimpParasite *parasite);
|
void gimp_parasite_attach (GimpParasite *parasite);
|
||||||
void gimp_parasite_detach (gchar *name);
|
void gimp_parasite_detach (gchar *name);
|
||||||
void gimp_parasite_list (gint *num_parasites,
|
void gimp_parasite_list (gint *num_parasites,
|
||||||
gchar** parasites);
|
gchar ***parasites);
|
||||||
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
|
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
|
||||||
gchar *name);
|
gchar *name);
|
||||||
void gimp_drawable_parasite_attach (gint32 drawable_ID,
|
void gimp_drawable_parasite_attach (gint32 drawable_ID,
|
||||||
GimpParasite *parasite);
|
GimpParasite *parasite);
|
||||||
void gimp_drawable_parasite_detach (gint32 drawable_ID,
|
void gimp_drawable_parasite_detach (gint32 drawable_ID,
|
||||||
gchar *name);
|
gchar *name);
|
||||||
void gimp_drawable_parasite_list (gint32 drawable_ID,
|
void gimp_drawable_parasite_list (gint32 drawable_ID,
|
||||||
gint *num_parasites,
|
gint *num_parasites,
|
||||||
gchar** parasites);
|
gchar ***parasites);
|
||||||
GimpParasite* gimp_image_parasite_find (gint32 image_ID,
|
GimpParasite* gimp_image_parasite_find (gint32 image_ID,
|
||||||
gchar *name);
|
gchar *name);
|
||||||
void gimp_image_parasite_attach (gint32 image_ID,
|
void gimp_image_parasite_attach (gint32 image_ID,
|
||||||
GimpParasite *parasite);
|
GimpParasite *parasite);
|
||||||
void gimp_image_parasite_detach (gint32 image_ID,
|
void gimp_image_parasite_detach (gint32 image_ID,
|
||||||
gchar *name);
|
gchar *name);
|
||||||
void gimp_image_parasite_list (gint32 image_ID,
|
void gimp_image_parasite_list (gint32 image_ID,
|
||||||
gint *num_parasites,
|
gint *num_parasites,
|
||||||
gchar** parasites);
|
gchar ***parasites);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -21,6 +21,38 @@
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gimp_procedural_db_proc_arg (gchar *procedure,
|
||||||
|
gint arg_num,
|
||||||
|
GimpPDBArgType *arg_type,
|
||||||
|
gchar **arg_name,
|
||||||
|
gchar **arg_desc)
|
||||||
|
{
|
||||||
|
_gimp_procedural_db_proc_arg (procedure,
|
||||||
|
arg_num,
|
||||||
|
arg_type,
|
||||||
|
arg_name,
|
||||||
|
arg_desc);
|
||||||
|
|
||||||
|
return (*arg_name != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gimp_procedural_db_proc_val (gchar *procedure,
|
||||||
|
gint val_num,
|
||||||
|
GimpPDBArgType *val_type,
|
||||||
|
gchar **val_name,
|
||||||
|
gchar **val_desc)
|
||||||
|
{
|
||||||
|
_gimp_procedural_db_proc_val (procedure,
|
||||||
|
val_num,
|
||||||
|
val_type,
|
||||||
|
val_name,
|
||||||
|
val_desc);
|
||||||
|
|
||||||
|
return (*val_name != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gimp_procedural_db_proc_info (gchar *procedure,
|
gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
gchar **blurb,
|
gchar **blurb,
|
||||||
|
@ -37,15 +69,17 @@ gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
gint i;
|
gint i;
|
||||||
gboolean success = TRUE;
|
gboolean success = TRUE;
|
||||||
|
|
||||||
success = _gimp_procedural_db_proc_info (procedure,
|
_gimp_procedural_db_proc_info (procedure,
|
||||||
blurb,
|
blurb,
|
||||||
help,
|
help,
|
||||||
author,
|
author,
|
||||||
copyright,
|
copyright,
|
||||||
date,
|
date,
|
||||||
proc_type,
|
proc_type,
|
||||||
num_args,
|
num_args,
|
||||||
num_values);
|
num_values);
|
||||||
|
|
||||||
|
success = (*blurb != NULL);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,16 @@ extern "C" {
|
||||||
|
|
||||||
/* For information look into the C source or the html documentation */
|
/* For information look into the C source or the html documentation */
|
||||||
|
|
||||||
|
gboolean gimp_procedural_db_proc_arg (gchar *procedure,
|
||||||
|
gint arg_num,
|
||||||
|
GimpPDBArgType *arg_type,
|
||||||
|
gchar **arg_name,
|
||||||
|
gchar **arg_desc);
|
||||||
|
gboolean gimp_procedural_db_proc_val (gchar *procedure,
|
||||||
|
gint val_num,
|
||||||
|
GimpPDBArgType *val_type,
|
||||||
|
gchar **val_name,
|
||||||
|
gchar **val_desc);
|
||||||
gboolean gimp_procedural_db_proc_info (gchar *procedure,
|
gboolean gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
gchar **blurb,
|
gchar **blurb,
|
||||||
gchar **help,
|
gchar **help,
|
||||||
|
|
|
@ -46,7 +46,7 @@ gimp_procedural_db_query (gchar *name,
|
||||||
gchar *date,
|
gchar *date,
|
||||||
gchar *proc_type,
|
gchar *proc_type,
|
||||||
gint *num_matches,
|
gint *num_matches,
|
||||||
gchar ***proc_names)
|
gchar ***procedure_names)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -64,19 +64,20 @@ gimp_procedural_db_query (gchar *name,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
*num_matches = 0;
|
*num_matches = 0;
|
||||||
*proc_names = NULL;
|
*procedure_names = NULL;
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
*num_matches = return_vals[1].data.d_int32;
|
*num_matches = return_vals[1].data.d_int32;
|
||||||
*proc_names = g_new (gchar *, *num_matches);
|
*procedure_names = g_new (gchar *, *num_matches);
|
||||||
for (i = 0; i < *num_matches; i++)
|
for (i = 0; i < *num_matches; i++)
|
||||||
(*proc_names)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
(*procedure_names)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
void
|
||||||
_gimp_procedural_db_proc_info (gchar *procedure,
|
_gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
gchar **blurb,
|
gchar **blurb,
|
||||||
gchar **help,
|
gchar **help,
|
||||||
|
@ -89,16 +90,22 @@ _gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gboolean success = FALSE;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_info",
|
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_info",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_STRING, procedure,
|
GIMP_PDB_STRING, procedure,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
success = (return_vals[0].data.d_status == GIMP_PDB_SUCCESS);
|
*blurb = NULL;
|
||||||
|
*help = NULL;
|
||||||
|
*author = NULL;
|
||||||
|
*copyright = NULL;
|
||||||
|
*date = NULL;
|
||||||
|
*proc_type = 0;
|
||||||
|
*num_args = 0;
|
||||||
|
*num_values = 0;
|
||||||
|
|
||||||
if (success)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
*blurb = g_strdup (return_vals[1].data.d_string);
|
*blurb = g_strdup (return_vals[1].data.d_string);
|
||||||
*help = g_strdup (return_vals[2].data.d_string);
|
*help = g_strdup (return_vals[2].data.d_string);
|
||||||
|
@ -111,20 +118,17 @@ _gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
void
|
||||||
gimp_procedural_db_proc_arg (gchar *procedure,
|
_gimp_procedural_db_proc_arg (gchar *procedure,
|
||||||
gint arg_num,
|
gint arg_num,
|
||||||
GimpPDBArgType *arg_type,
|
GimpPDBArgType *arg_type,
|
||||||
gchar **arg_name,
|
gchar **arg_name,
|
||||||
gchar **arg_desc)
|
gchar **arg_desc)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gboolean success = FALSE;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_arg",
|
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_arg",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
|
@ -136,9 +140,7 @@ gimp_procedural_db_proc_arg (gchar *procedure,
|
||||||
*arg_name = NULL;
|
*arg_name = NULL;
|
||||||
*arg_desc = NULL;
|
*arg_desc = NULL;
|
||||||
|
|
||||||
success = (return_vals[0].data.d_status == GIMP_PDB_SUCCESS);
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
{
|
||||||
*arg_type = return_vals[1].data.d_int32;
|
*arg_type = return_vals[1].data.d_int32;
|
||||||
*arg_name = g_strdup (return_vals[2].data.d_string);
|
*arg_name = g_strdup (return_vals[2].data.d_string);
|
||||||
|
@ -146,20 +148,17 @@ gimp_procedural_db_proc_arg (gchar *procedure,
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
void
|
||||||
gimp_procedural_db_proc_val (gchar *procedure,
|
_gimp_procedural_db_proc_val (gchar *procedure,
|
||||||
gint val_num,
|
gint val_num,
|
||||||
GimpPDBArgType *val_type,
|
GimpPDBArgType *val_type,
|
||||||
gchar **val_name,
|
gchar **val_name,
|
||||||
gchar **val_desc)
|
gchar **val_desc)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gboolean success = FALSE;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_val",
|
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_val",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
|
@ -171,9 +170,7 @@ gimp_procedural_db_proc_val (gchar *procedure,
|
||||||
*val_name = NULL;
|
*val_name = NULL;
|
||||||
*val_desc = NULL;
|
*val_desc = NULL;
|
||||||
|
|
||||||
success = (return_vals[0].data.d_status == GIMP_PDB_SUCCESS);
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
{
|
||||||
*val_type = return_vals[1].data.d_int32;
|
*val_type = return_vals[1].data.d_int32;
|
||||||
*val_name = g_strdup (return_vals[2].data.d_string);
|
*val_name = g_strdup (return_vals[2].data.d_string);
|
||||||
|
@ -181,8 +178,6 @@ gimp_procedural_db_proc_val (gchar *procedure,
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -200,6 +195,7 @@ _gimp_procedural_db_get_data (gchar *identifier,
|
||||||
|
|
||||||
*bytes = 0;
|
*bytes = 0;
|
||||||
*data = NULL;
|
*data = NULL;
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
*bytes = return_vals[1].data.d_int32;
|
*bytes = return_vals[1].data.d_int32;
|
||||||
|
|
|
@ -31,42 +31,42 @@ extern "C" {
|
||||||
/* For information look into the C source or the html documentation */
|
/* For information look into the C source or the html documentation */
|
||||||
|
|
||||||
|
|
||||||
void gimp_procedural_db_dump (gchar *filename);
|
void gimp_procedural_db_dump (gchar *filename);
|
||||||
void gimp_procedural_db_query (gchar *name,
|
void gimp_procedural_db_query (gchar *name,
|
||||||
gchar *blurb,
|
gchar *blurb,
|
||||||
gchar *help,
|
gchar *help,
|
||||||
gchar *author,
|
gchar *author,
|
||||||
gchar *copyright,
|
gchar *copyright,
|
||||||
gchar *date,
|
gchar *date,
|
||||||
gchar *proc_type,
|
gchar *proc_type,
|
||||||
gint *num_matches,
|
gint *num_matches,
|
||||||
gchar ***proc_names);
|
gchar ***procedure_names);
|
||||||
gboolean _gimp_procedural_db_proc_info (gchar *procedure,
|
void _gimp_procedural_db_proc_info (gchar *procedure,
|
||||||
gchar **blurb,
|
gchar **blurb,
|
||||||
gchar **help,
|
gchar **help,
|
||||||
gchar **author,
|
gchar **author,
|
||||||
gchar **copyright,
|
gchar **copyright,
|
||||||
gchar **date,
|
gchar **date,
|
||||||
GimpPDBProcType *proc_type,
|
GimpPDBProcType *proc_type,
|
||||||
gint *num_args,
|
gint *num_args,
|
||||||
gint *num_values);
|
gint *num_values);
|
||||||
gboolean gimp_procedural_db_proc_arg (gchar *procedure,
|
void _gimp_procedural_db_proc_arg (gchar *procedure,
|
||||||
gint arg_num,
|
gint arg_num,
|
||||||
GimpPDBArgType *arg_type,
|
GimpPDBArgType *arg_type,
|
||||||
gchar **arg_name,
|
gchar **arg_name,
|
||||||
gchar **arg_desc);
|
gchar **arg_desc);
|
||||||
gboolean gimp_procedural_db_proc_val (gchar *procedure,
|
void _gimp_procedural_db_proc_val (gchar *procedure,
|
||||||
gint val_num,
|
gint val_num,
|
||||||
GimpPDBArgType *val_type,
|
GimpPDBArgType *val_type,
|
||||||
gchar **val_name,
|
gchar **val_name,
|
||||||
gchar **val_desc);
|
gchar **val_desc);
|
||||||
void _gimp_procedural_db_get_data (gchar *identifier,
|
void _gimp_procedural_db_get_data (gchar *identifier,
|
||||||
gint *bytes,
|
gint *bytes,
|
||||||
guint8 **data);
|
guint8 **data);
|
||||||
gint gimp_procedural_db_get_data_size (gchar *identifier);
|
gint gimp_procedural_db_get_data_size (gchar *identifier);
|
||||||
void _gimp_procedural_db_set_data (gchar *identifier,
|
void _gimp_procedural_db_set_data (gchar *identifier,
|
||||||
gint bytes,
|
gint bytes,
|
||||||
guint8 *data);
|
guint8 *data);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
|
|
||||||
|
|
||||||
gint
|
gint
|
||||||
_gimp_unit_get_number_of_units (void)
|
_gimp_unit_get_number_of_units (void)
|
||||||
{
|
{
|
||||||
|
@ -51,8 +50,8 @@ _gimp_unit_get_number_of_built_in_units (void)
|
||||||
gint num_units = GIMP_UNIT_END;
|
gint num_units = GIMP_UNIT_END;
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_number_of_built_in_units",
|
return_vals = gimp_run_procedure ("gimp_unit_get_number_of_built_in_units",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
num_units = return_vals[1].data.d_int32;
|
num_units = return_vals[1].data.d_int32;
|
||||||
|
@ -73,7 +72,7 @@ _gimp_unit_new (gchar *identifier,
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
GimpUnit unit_ID = GIMP_UNIT_INCH;
|
GimpUnit unit_id = GIMP_UNIT_INCH;
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_new",
|
return_vals = gimp_run_procedure ("gimp_unit_new",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
|
@ -87,23 +86,23 @@ _gimp_unit_new (gchar *identifier,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
unit_ID = return_vals[1].data.d_unit;
|
unit_id = return_vals[1].data.d_unit;
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
return unit_ID;
|
return unit_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_unit_get_deletion_flag (GimpUnit unit_ID)
|
_gimp_unit_get_deletion_flag (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gboolean deletion_flag = TRUE;
|
gboolean deletion_flag = FALSE;
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_deletion_flag",
|
return_vals = gimp_run_procedure ("gimp_unit_get_deletion_flag",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -115,7 +114,7 @@ _gimp_unit_get_deletion_flag (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
_gimp_unit_set_deletion_flag (GimpUnit unit_id,
|
||||||
gboolean deletion_flag)
|
gboolean deletion_flag)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
|
@ -123,7 +122,7 @@ _gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_set_deletion_flag",
|
return_vals = gimp_run_procedure ("gimp_unit_set_deletion_flag",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_INT32, deletion_flag,
|
GIMP_PDB_INT32, deletion_flag,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
@ -131,7 +130,7 @@ _gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_unit_get_identifier (GimpUnit unit_ID)
|
_gimp_unit_get_identifier (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -139,7 +138,7 @@ _gimp_unit_get_identifier (GimpUnit unit_ID)
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_identifier",
|
return_vals = gimp_run_procedure ("gimp_unit_get_identifier",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -151,15 +150,15 @@ _gimp_unit_get_identifier (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gdouble
|
gdouble
|
||||||
_gimp_unit_get_factor (GimpUnit unit_ID)
|
_gimp_unit_get_factor (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gdouble factor = 1.0;
|
gdouble factor = 0;
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_factor",
|
return_vals = gimp_run_procedure ("gimp_unit_get_factor",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -171,15 +170,15 @@ _gimp_unit_get_factor (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
_gimp_unit_get_digits (GimpUnit unit_ID)
|
_gimp_unit_get_digits (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gint digits = 2;
|
gint digits = 0;
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_digits",
|
return_vals = gimp_run_procedure ("gimp_unit_get_digits",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -191,7 +190,7 @@ _gimp_unit_get_digits (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_unit_get_symbol (GimpUnit unit_ID)
|
_gimp_unit_get_symbol (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -199,7 +198,7 @@ _gimp_unit_get_symbol (GimpUnit unit_ID)
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_symbol",
|
return_vals = gimp_run_procedure ("gimp_unit_get_symbol",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -211,7 +210,7 @@ _gimp_unit_get_symbol (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_unit_get_abbreviation (GimpUnit unit_ID)
|
_gimp_unit_get_abbreviation (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -219,7 +218,7 @@ _gimp_unit_get_abbreviation (GimpUnit unit_ID)
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_abbreviation",
|
return_vals = gimp_run_procedure ("gimp_unit_get_abbreviation",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -231,7 +230,7 @@ _gimp_unit_get_abbreviation (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_unit_get_singular (GimpUnit unit_ID)
|
_gimp_unit_get_singular (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -239,7 +238,7 @@ _gimp_unit_get_singular (GimpUnit unit_ID)
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_singular",
|
return_vals = gimp_run_procedure ("gimp_unit_get_singular",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
@ -251,7 +250,7 @@ _gimp_unit_get_singular (GimpUnit unit_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_unit_get_plural (GimpUnit unit_ID)
|
_gimp_unit_get_plural (GimpUnit unit_id)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
|
@ -259,7 +258,7 @@ _gimp_unit_get_plural (GimpUnit unit_ID)
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp_unit_get_plural",
|
return_vals = gimp_run_procedure ("gimp_unit_get_plural",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_INT32, unit_ID,
|
GIMP_PDB_INT32, unit_id,
|
||||||
GIMP_PDB_END);
|
GIMP_PDB_END);
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
|
|
@ -40,16 +40,16 @@ GimpUnit _gimp_unit_new (gchar *identifier,
|
||||||
gchar *abbreviation,
|
gchar *abbreviation,
|
||||||
gchar *singular,
|
gchar *singular,
|
||||||
gchar *plural);
|
gchar *plural);
|
||||||
gboolean _gimp_unit_get_deletion_flag (GimpUnit unit_ID);
|
gboolean _gimp_unit_get_deletion_flag (GimpUnit unit_id);
|
||||||
void _gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
void _gimp_unit_set_deletion_flag (GimpUnit unit_id,
|
||||||
gboolean deletion_flag);
|
gboolean deletion_flag);
|
||||||
gchar* _gimp_unit_get_identifier (GimpUnit unit_ID);
|
gchar* _gimp_unit_get_identifier (GimpUnit unit_id);
|
||||||
gdouble _gimp_unit_get_factor (GimpUnit unit_ID);
|
gdouble _gimp_unit_get_factor (GimpUnit unit_id);
|
||||||
gint _gimp_unit_get_digits (GimpUnit unit_ID);
|
gint _gimp_unit_get_digits (GimpUnit unit_id);
|
||||||
gchar* _gimp_unit_get_symbol (GimpUnit unit_ID);
|
gchar* _gimp_unit_get_symbol (GimpUnit unit_id);
|
||||||
gchar* _gimp_unit_get_abbreviation (GimpUnit unit_ID);
|
gchar* _gimp_unit_get_abbreviation (GimpUnit unit_id);
|
||||||
gchar* _gimp_unit_get_singular (GimpUnit unit_ID);
|
gchar* _gimp_unit_get_singular (GimpUnit unit_id);
|
||||||
gchar* _gimp_unit_get_plural (GimpUnit unit_ID);
|
gchar* _gimp_unit_get_plural (GimpUnit unit_id);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -114,6 +114,14 @@ stamp-app: $(srcdir)/app.pl $(pdb_scripts) $(pdb_sources)
|
||||||
$(PERL) pdbgen.pl app \
|
$(PERL) pdbgen.pl app \
|
||||||
&& echo timestamp > $$rootme/stamp-app
|
&& echo timestamp > $$rootme/stamp-app
|
||||||
|
|
||||||
|
stamp-lib: $(srcdir)/lib.pl $(pdb_scripts) $(pdb_sources)
|
||||||
|
rootme=`pwd`; \
|
||||||
|
destdir=`cd $(top_srcdir) && pwd`; export destdir; \
|
||||||
|
cd $(srcdir) && \
|
||||||
|
PDBGEN_BACKUP=$(PDBGEN_BACKUP) PDBGEN_GROUPS=$(PDBGEN_GROUPS) \
|
||||||
|
$(PERL) pdbgen.pl lib \
|
||||||
|
&& echo timestamp > $$rootme/stamp-lib
|
||||||
|
|
||||||
stamp-enum-code: $(srcdir)/enumcode.pl enums.pl util.pl
|
stamp-enum-code: $(srcdir)/enumcode.pl enums.pl util.pl
|
||||||
rootme=`pwd`; \
|
rootme=`pwd`; \
|
||||||
destdir=`cd $(top_srcdir) && pwd`; export destdir; \
|
destdir=`cd $(top_srcdir) && pwd`; export destdir; \
|
||||||
|
@ -122,4 +130,4 @@ stamp-enum-code: $(srcdir)/enumcode.pl enums.pl util.pl
|
||||||
$(PERL) enumcode.pl \
|
$(PERL) enumcode.pl \
|
||||||
&& echo timestamp > $$rootme/stamp-enum-code
|
&& echo timestamp > $$rootme/stamp-enum-code
|
||||||
|
|
||||||
all-local: stamp-app stamp-enum-code
|
all-local: stamp-app stamp-lib stamp-enum-code
|
||||||
|
|
|
@ -275,7 +275,12 @@ CODE
|
||||||
my $var = $_->{libname}; my $dh = ""; my $df = "";
|
my $var = $_->{libname}; my $dh = ""; my $df = "";
|
||||||
unless (exists $_->{retval}) {
|
unless (exists $_->{retval}) {
|
||||||
$var = "*$var"; $dh = "(*"; $df = ")";
|
$var = "*$var"; $dh = "(*"; $df = ")";
|
||||||
$arglist .= "$datatype **$_->{libname}";
|
if ($type eq 'stringarray') {
|
||||||
|
$arglist .= "$datatype**$_->{libname}";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$arglist .= "$datatype **$_->{libname}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ch || $cf) {
|
if ($ch || $cf) {
|
||||||
|
|
|
@ -69,8 +69,8 @@ HELP
|
||||||
|
|
||||||
@outargs = (
|
@outargs = (
|
||||||
{ name => "${type}_type", type => 'enum PDBArgType (no PDB_END)',
|
{ name => "${type}_type", type => 'enum PDBArgType (no PDB_END)',
|
||||||
desc => "The type of $long_type { %%desc%% }", wrap => 1,
|
desc => "The type of $long_type { %%desc%% }", void_ret => 1,
|
||||||
alias => "${type}->arg_type", no_declare => 1 },
|
alias => "${type}->arg_type", no_declare => 1, wrap => 1 },
|
||||||
{ name => "${type}_name", type => 'string',
|
{ name => "${type}_name", type => 'string',
|
||||||
desc => "The name of the $long_type",
|
desc => "The name of the $long_type",
|
||||||
alias => "g_strdup (${type}->name)", no_declare => 1 },
|
alias => "g_strdup (${type}->name)", no_declare => 1 },
|
||||||
|
@ -276,6 +276,7 @@ HELP
|
||||||
$outargs[0]->{alias} = 'data_copy';
|
$outargs[0]->{alias} = 'data_copy';
|
||||||
$outargs[0]->{init} = 1;
|
$outargs[0]->{init} = 1;
|
||||||
$outargs[0]->{wrap} = 1;
|
$outargs[0]->{wrap} = 1;
|
||||||
|
$outargs[0]->{void_ret} = 1;
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
vars => [ 'PDBData *data = NULL', 'GList *list' ],
|
vars => [ 'PDBData *data = NULL', 'GList *list' ],
|
||||||
|
|
|
@ -66,6 +66,23 @@ sub unit_get_number_of_units {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub unit_get_number_of_built_in_units {
|
||||||
|
$blurb = 'Returns the number of built-in units.';
|
||||||
|
|
||||||
|
$help = <<'HELP';
|
||||||
|
This procedure returns the number of defined units built-in to the GIMP.
|
||||||
|
HELP
|
||||||
|
|
||||||
|
&pdb_misc;
|
||||||
|
|
||||||
|
@outargs = (
|
||||||
|
{ name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END',
|
||||||
|
desc => 'The number of built-in units', wrap => 1,
|
||||||
|
alias => 'gimp_unit_get_number_of_units ()', no_declare => 1 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub unit_new {
|
sub unit_new {
|
||||||
$blurb = "Creates a new unit and returns it's integer ID.";
|
$blurb = "Creates a new unit and returns it's integer ID.";
|
||||||
|
|
||||||
|
@ -199,55 +216,11 @@ HELP
|
||||||
|
|
||||||
@headers = qw("libgimp/gimpunit.h");
|
@headers = qw("libgimp/gimpunit.h");
|
||||||
|
|
||||||
$extra{lib}->{protos} = <<'CODE';
|
@procs = qw(unit_get_number_of_units unit_get_number_of_built_in_units
|
||||||
GimpUnit gimp_unit_get_number_of_built_in_units (void);
|
unit_new unit_get_deletion_flag unit_set_deletion_flag
|
||||||
CODE
|
unit_get_identifier unit_get_factor unit_get_digits
|
||||||
|
unit_get_symbol unit_get_abbreviation unit_get_singular
|
||||||
$extra{lib}->{code} = <<'CODE';
|
unit_get_plural);
|
||||||
/* internal structures */
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
guint delete_on_exit;
|
|
||||||
gdouble factor;
|
|
||||||
gint digits;
|
|
||||||
gchar *identifier;
|
|
||||||
gchar *symbol;
|
|
||||||
gchar *abbreviation;
|
|
||||||
gchar *singular;
|
|
||||||
gchar *plural;
|
|
||||||
} GimpUnitDef;
|
|
||||||
|
|
||||||
static GimpUnitDef gimp_unit_defs[GIMP_UNIT_END] =
|
|
||||||
{
|
|
||||||
/* pseudo unit */
|
|
||||||
{ FALSE, 0.0, 0, "pixels", "px", "px", N_("pixel"), N_("pixels") },
|
|
||||||
|
|
||||||
/* standard units */
|
|
||||||
{ FALSE, 1.0, 2, "inches", "''", "in", N_("inch"), N_("inches") },
|
|
||||||
{ FALSE, 25.4, 1, "millimeters", "mm", "mm", N_("millimeter"), N_("millimeters") },
|
|
||||||
|
|
||||||
/* professional units */
|
|
||||||
{ FALSE, 72.0, 0, "points", "pt", "pt", N_("point"), N_("points") },
|
|
||||||
{ FALSE, 6.0, 1, "picas", "pc", "pc", N_("pica"), N_("picas") },
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Not a unit at all but kept here to have the strings in one place */
|
|
||||||
static GimpUnitDef gimp_unit_percent =
|
|
||||||
{
|
|
||||||
FALSE, 0.0, 0, "percent", "%", "%", N_("percent"), N_("percent")
|
|
||||||
};
|
|
||||||
|
|
||||||
GimpUnit
|
|
||||||
gimp_unit_get_number_of_built_in_units (void)
|
|
||||||
{
|
|
||||||
return GIMP_UNIT_END;
|
|
||||||
}
|
|
||||||
CODE
|
|
||||||
|
|
||||||
@procs = qw(unit_get_number_of_units unit_new unit_get_deletion_flag
|
|
||||||
unit_set_deletion_flag unit_get_identifier unit_get_factor
|
|
||||||
unit_get_digits unit_get_symbol unit_get_abbreviation
|
|
||||||
unit_get_singular unit_get_plural);
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
||||||
$desc = 'Units';
|
$desc = 'Units';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue