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>
|
||||
|
||||
* tools/pdbgen/lib.pl
|
||||
|
|
|
@ -60,7 +60,7 @@ void register_tools_procs (void);
|
|||
void register_undo_procs (void);
|
||||
void register_unit_procs (void);
|
||||
|
||||
/* 322 procedures registered total */
|
||||
/* 323 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (void)
|
||||
|
@ -80,10 +80,10 @@ internal_procs_init (void)
|
|||
app_init_update_status (NULL, _("Color"), 0.096);
|
||||
register_color_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Convert"), 0.134);
|
||||
app_init_update_status (NULL, _("Convert"), 0.133);
|
||||
register_convert_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("GDisplay procedures"), 0.143);
|
||||
app_init_update_status (NULL, _("GDisplay procedures"), 0.142);
|
||||
register_display_procs ();
|
||||
|
||||
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);
|
||||
register_edit_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("File Operations"), 0.239);
|
||||
app_init_update_status (NULL, _("File Operations"), 0.238);
|
||||
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 ();
|
||||
|
||||
app_init_update_status (NULL, _("Gimprc procedures"), 0.283);
|
||||
app_init_update_status (NULL, _("Gimprc procedures"), 0.282);
|
||||
register_gimprc_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Gradients"), 0.292);
|
||||
app_init_update_status (NULL, _("Gradients"), 0.291);
|
||||
register_gradients_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Gradient UI"), 0.307);
|
||||
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 ();
|
||||
|
||||
app_init_update_status (NULL, _("Help procedures"), 0.339);
|
||||
app_init_update_status (NULL, _("Help procedures"), 0.337);
|
||||
register_help_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Image"), 0.342);
|
||||
app_init_update_status (NULL, _("Image"), 0.341);
|
||||
register_image_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Layer"), 0.525);
|
||||
app_init_update_status (NULL, _("Layer"), 0.523);
|
||||
register_layer_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Interface"), 0.621);
|
||||
app_init_update_status (NULL, _("Interface"), 0.619);
|
||||
register_message_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Miscellaneous"), 0.63);
|
||||
app_init_update_status (NULL, _("Miscellaneous"), 0.628);
|
||||
register_misc_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Palette"), 0.637);
|
||||
app_init_update_status (NULL, _("Palette"), 0.635);
|
||||
register_palette_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Parasite procedures"), 0.658);
|
||||
app_init_update_status (NULL, _("Parasite procedures"), 0.656);
|
||||
register_parasite_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Paths"), 0.696);
|
||||
app_init_update_status (NULL, _("Paths"), 0.693);
|
||||
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 ();
|
||||
|
||||
app_init_update_status (NULL, _("Patterns"), 0.745);
|
||||
app_init_update_status (NULL, _("Patterns"), 0.743);
|
||||
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 ();
|
||||
|
||||
app_init_update_status (NULL, _("Procedural database"), 0.776);
|
||||
app_init_update_status (NULL, _("Procedural database"), 0.774);
|
||||
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 ();
|
||||
|
||||
app_init_update_status (NULL, _("Text procedures"), 0.854);
|
||||
app_init_update_status (NULL, _("Text procedures"), 0.851);
|
||||
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 ();
|
||||
|
||||
app_init_update_status (NULL, _("Undo"), 0.96);
|
||||
app_init_update_status (NULL, _("Undo"), 0.957);
|
||||
register_undo_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Units"), 0.966);
|
||||
app_init_update_status (NULL, _("Units"), 0.963);
|
||||
register_unit_procs ();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "libgimp/gimpunit.h"
|
||||
|
||||
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_get_deletion_flag_proc;
|
||||
static ProcRecord unit_set_deletion_flag_proc;
|
||||
|
@ -38,6 +39,7 @@ void
|
|||
register_unit_procs (void)
|
||||
{
|
||||
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_get_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 } }
|
||||
};
|
||||
|
||||
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 *
|
||||
unit_new_invoker (Argument *args)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ gimp_parasite_detach (gchar *name)
|
|||
|
||||
void
|
||||
gimp_parasite_list (gint *num_parasites,
|
||||
gchar **parasites)
|
||||
gchar ***parasites)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -85,12 +85,13 @@ gimp_parasite_list (gint *num_parasites,
|
|||
|
||||
*num_parasites = 0;
|
||||
*parasites = NULL;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*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++)
|
||||
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);
|
||||
|
@ -153,8 +154,7 @@ gimp_drawable_parasite_detach (gint32 drawable_ID,
|
|||
void
|
||||
gimp_drawable_parasite_list (gint32 drawable_ID,
|
||||
gint *num_parasites,
|
||||
gchar **parasites)
|
||||
|
||||
gchar ***parasites)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -167,12 +167,13 @@ gimp_drawable_parasite_list (gint32 drawable_ID,
|
|||
|
||||
*num_parasites = 0;
|
||||
*parasites = NULL;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*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++)
|
||||
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);
|
||||
|
@ -235,7 +236,7 @@ gimp_image_parasite_detach (gint32 image_ID,
|
|||
void
|
||||
gimp_image_parasite_list (gint32 image_ID,
|
||||
gint *num_parasites,
|
||||
gchar **parasites)
|
||||
gchar ***parasites)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -248,12 +249,13 @@ gimp_image_parasite_list (gint32 image_ID,
|
|||
|
||||
*num_parasites = 0;
|
||||
*parasites = NULL;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*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++)
|
||||
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);
|
||||
|
|
|
@ -35,7 +35,7 @@ GimpParasite* gimp_parasite_find (gchar *name);
|
|||
void gimp_parasite_attach (GimpParasite *parasite);
|
||||
void gimp_parasite_detach (gchar *name);
|
||||
void gimp_parasite_list (gint *num_parasites,
|
||||
gchar** parasites);
|
||||
gchar ***parasites);
|
||||
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
|
||||
gchar *name);
|
||||
void gimp_drawable_parasite_attach (gint32 drawable_ID,
|
||||
|
@ -44,7 +44,7 @@ void gimp_drawable_parasite_detach (gint32 drawable_ID,
|
|||
gchar *name);
|
||||
void gimp_drawable_parasite_list (gint32 drawable_ID,
|
||||
gint *num_parasites,
|
||||
gchar** parasites);
|
||||
gchar ***parasites);
|
||||
GimpParasite* gimp_image_parasite_find (gint32 image_ID,
|
||||
gchar *name);
|
||||
void gimp_image_parasite_attach (gint32 image_ID,
|
||||
|
@ -53,7 +53,7 @@ void gimp_image_parasite_detach (gint32 image_ID,
|
|||
gchar *name);
|
||||
void gimp_image_parasite_list (gint32 image_ID,
|
||||
gint *num_parasites,
|
||||
gchar** parasites);
|
||||
gchar ***parasites);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -21,6 +21,38 @@
|
|||
|
||||
#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
|
||||
gimp_procedural_db_proc_info (gchar *procedure,
|
||||
gchar **blurb,
|
||||
|
@ -37,7 +69,7 @@ gimp_procedural_db_proc_info (gchar *procedure,
|
|||
gint i;
|
||||
gboolean success = TRUE;
|
||||
|
||||
success = _gimp_procedural_db_proc_info (procedure,
|
||||
_gimp_procedural_db_proc_info (procedure,
|
||||
blurb,
|
||||
help,
|
||||
author,
|
||||
|
@ -47,6 +79,8 @@ gimp_procedural_db_proc_info (gchar *procedure,
|
|||
num_args,
|
||||
num_values);
|
||||
|
||||
success = (*blurb != NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
*args = g_new (GimpParamDef, *num_args);
|
||||
|
|
|
@ -28,7 +28,16 @@ extern "C" {
|
|||
|
||||
/* 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,
|
||||
gchar **blurb,
|
||||
gchar **help,
|
||||
|
|
|
@ -46,7 +46,7 @@ gimp_procedural_db_query (gchar *name,
|
|||
gchar *date,
|
||||
gchar *proc_type,
|
||||
gint *num_matches,
|
||||
gchar ***proc_names)
|
||||
gchar ***procedure_names)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -64,19 +64,20 @@ gimp_procedural_db_query (gchar *name,
|
|||
GIMP_PDB_END);
|
||||
|
||||
*num_matches = 0;
|
||||
*proc_names = NULL;
|
||||
*procedure_names = NULL;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*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++)
|
||||
(*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);
|
||||
}
|
||||
|
||||
gboolean
|
||||
void
|
||||
_gimp_procedural_db_proc_info (gchar *procedure,
|
||||
gchar **blurb,
|
||||
gchar **help,
|
||||
|
@ -89,16 +90,22 @@ _gimp_procedural_db_proc_info (gchar *procedure,
|
|||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_info",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_STRING, procedure,
|
||||
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);
|
||||
*help = g_strdup (return_vals[2].data.d_string);
|
||||
|
@ -111,12 +118,10 @@ _gimp_procedural_db_proc_info (gchar *procedure,
|
|||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_procedural_db_proc_arg (gchar *procedure,
|
||||
void
|
||||
_gimp_procedural_db_proc_arg (gchar *procedure,
|
||||
gint arg_num,
|
||||
GimpPDBArgType *arg_type,
|
||||
gchar **arg_name,
|
||||
|
@ -124,7 +129,6 @@ gimp_procedural_db_proc_arg (gchar *procedure,
|
|||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_arg",
|
||||
&nreturn_vals,
|
||||
|
@ -136,9 +140,7 @@ gimp_procedural_db_proc_arg (gchar *procedure,
|
|||
*arg_name = NULL;
|
||||
*arg_desc = NULL;
|
||||
|
||||
success = (return_vals[0].data.d_status == GIMP_PDB_SUCCESS);
|
||||
|
||||
if (success)
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*arg_type = return_vals[1].data.d_int32;
|
||||
*arg_name = g_strdup (return_vals[2].data.d_string);
|
||||
|
@ -146,12 +148,10 @@ gimp_procedural_db_proc_arg (gchar *procedure,
|
|||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_procedural_db_proc_val (gchar *procedure,
|
||||
void
|
||||
_gimp_procedural_db_proc_val (gchar *procedure,
|
||||
gint val_num,
|
||||
GimpPDBArgType *val_type,
|
||||
gchar **val_name,
|
||||
|
@ -159,7 +159,6 @@ gimp_procedural_db_proc_val (gchar *procedure,
|
|||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_val",
|
||||
&nreturn_vals,
|
||||
|
@ -171,9 +170,7 @@ gimp_procedural_db_proc_val (gchar *procedure,
|
|||
*val_name = NULL;
|
||||
*val_desc = NULL;
|
||||
|
||||
success = (return_vals[0].data.d_status == GIMP_PDB_SUCCESS);
|
||||
|
||||
if (success)
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*val_type = return_vals[1].data.d_int32;
|
||||
*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);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -200,6 +195,7 @@ _gimp_procedural_db_get_data (gchar *identifier,
|
|||
|
||||
*bytes = 0;
|
||||
*data = NULL;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*bytes = return_vals[1].data.d_int32;
|
||||
|
|
|
@ -40,8 +40,8 @@ void gimp_procedural_db_query (gchar *name,
|
|||
gchar *date,
|
||||
gchar *proc_type,
|
||||
gint *num_matches,
|
||||
gchar ***proc_names);
|
||||
gboolean _gimp_procedural_db_proc_info (gchar *procedure,
|
||||
gchar ***procedure_names);
|
||||
void _gimp_procedural_db_proc_info (gchar *procedure,
|
||||
gchar **blurb,
|
||||
gchar **help,
|
||||
gchar **author,
|
||||
|
@ -50,12 +50,12 @@ gboolean _gimp_procedural_db_proc_info (gchar *procedure,
|
|||
GimpPDBProcType *proc_type,
|
||||
gint *num_args,
|
||||
gint *num_values);
|
||||
gboolean gimp_procedural_db_proc_arg (gchar *procedure,
|
||||
void _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,
|
||||
void _gimp_procedural_db_proc_val (gchar *procedure,
|
||||
gint val_num,
|
||||
GimpPDBArgType *val_type,
|
||||
gchar **val_name,
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
gint
|
||||
_gimp_unit_get_number_of_units (void)
|
||||
{
|
||||
|
@ -73,7 +72,7 @@ _gimp_unit_new (gchar *identifier,
|
|||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
GimpUnit unit_ID = GIMP_UNIT_INCH;
|
||||
GimpUnit unit_id = GIMP_UNIT_INCH;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_new",
|
||||
&nreturn_vals,
|
||||
|
@ -87,23 +86,23 @@ _gimp_unit_new (gchar *identifier,
|
|||
GIMP_PDB_END);
|
||||
|
||||
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);
|
||||
|
||||
return unit_ID;
|
||||
return unit_id;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gimp_unit_get_deletion_flag (GimpUnit unit_ID)
|
||||
_gimp_unit_get_deletion_flag (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean deletion_flag = TRUE;
|
||||
gboolean deletion_flag = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_deletion_flag",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -115,7 +114,7 @@ _gimp_unit_get_deletion_flag (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
void
|
||||
_gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
||||
_gimp_unit_set_deletion_flag (GimpUnit unit_id,
|
||||
gboolean deletion_flag)
|
||||
{
|
||||
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",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_INT32, deletion_flag,
|
||||
GIMP_PDB_END);
|
||||
|
||||
|
@ -131,7 +130,7 @@ _gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
|||
}
|
||||
|
||||
gchar *
|
||||
_gimp_unit_get_identifier (GimpUnit unit_ID)
|
||||
_gimp_unit_get_identifier (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -139,7 +138,7 @@ _gimp_unit_get_identifier (GimpUnit unit_ID)
|
|||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_identifier",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -151,15 +150,15 @@ _gimp_unit_get_identifier (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
gdouble
|
||||
_gimp_unit_get_factor (GimpUnit unit_ID)
|
||||
_gimp_unit_get_factor (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble factor = 1.0;
|
||||
gdouble factor = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_factor",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -171,15 +170,15 @@ _gimp_unit_get_factor (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
gint
|
||||
_gimp_unit_get_digits (GimpUnit unit_ID)
|
||||
_gimp_unit_get_digits (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint digits = 2;
|
||||
gint digits = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_digits",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -191,7 +190,7 @@ _gimp_unit_get_digits (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
gchar *
|
||||
_gimp_unit_get_symbol (GimpUnit unit_ID)
|
||||
_gimp_unit_get_symbol (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -199,7 +198,7 @@ _gimp_unit_get_symbol (GimpUnit unit_ID)
|
|||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_symbol",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -211,7 +210,7 @@ _gimp_unit_get_symbol (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
gchar *
|
||||
_gimp_unit_get_abbreviation (GimpUnit unit_ID)
|
||||
_gimp_unit_get_abbreviation (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -219,7 +218,7 @@ _gimp_unit_get_abbreviation (GimpUnit unit_ID)
|
|||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_abbreviation",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -231,7 +230,7 @@ _gimp_unit_get_abbreviation (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
gchar *
|
||||
_gimp_unit_get_singular (GimpUnit unit_ID)
|
||||
_gimp_unit_get_singular (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -239,7 +238,7 @@ _gimp_unit_get_singular (GimpUnit unit_ID)
|
|||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_singular",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
@ -251,7 +250,7 @@ _gimp_unit_get_singular (GimpUnit unit_ID)
|
|||
}
|
||||
|
||||
gchar *
|
||||
_gimp_unit_get_plural (GimpUnit unit_ID)
|
||||
_gimp_unit_get_plural (GimpUnit unit_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
@ -259,7 +258,7 @@ _gimp_unit_get_plural (GimpUnit unit_ID)
|
|||
|
||||
return_vals = gimp_run_procedure ("gimp_unit_get_plural",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, unit_ID,
|
||||
GIMP_PDB_INT32, unit_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
|
|
|
@ -40,16 +40,16 @@ GimpUnit _gimp_unit_new (gchar *identifier,
|
|||
gchar *abbreviation,
|
||||
gchar *singular,
|
||||
gchar *plural);
|
||||
gboolean _gimp_unit_get_deletion_flag (GimpUnit unit_ID);
|
||||
void _gimp_unit_set_deletion_flag (GimpUnit unit_ID,
|
||||
gboolean _gimp_unit_get_deletion_flag (GimpUnit unit_id);
|
||||
void _gimp_unit_set_deletion_flag (GimpUnit unit_id,
|
||||
gboolean deletion_flag);
|
||||
gchar* _gimp_unit_get_identifier (GimpUnit unit_ID);
|
||||
gdouble _gimp_unit_get_factor (GimpUnit unit_ID);
|
||||
gint _gimp_unit_get_digits (GimpUnit unit_ID);
|
||||
gchar* _gimp_unit_get_symbol (GimpUnit unit_ID);
|
||||
gchar* _gimp_unit_get_abbreviation (GimpUnit unit_ID);
|
||||
gchar* _gimp_unit_get_singular (GimpUnit unit_ID);
|
||||
gchar* _gimp_unit_get_plural (GimpUnit unit_ID);
|
||||
gchar* _gimp_unit_get_identifier (GimpUnit unit_id);
|
||||
gdouble _gimp_unit_get_factor (GimpUnit unit_id);
|
||||
gint _gimp_unit_get_digits (GimpUnit unit_id);
|
||||
gchar* _gimp_unit_get_symbol (GimpUnit unit_id);
|
||||
gchar* _gimp_unit_get_abbreviation (GimpUnit unit_id);
|
||||
gchar* _gimp_unit_get_singular (GimpUnit unit_id);
|
||||
gchar* _gimp_unit_get_plural (GimpUnit unit_id);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -114,6 +114,14 @@ stamp-app: $(srcdir)/app.pl $(pdb_scripts) $(pdb_sources)
|
|||
$(PERL) pdbgen.pl 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
|
||||
rootme=`pwd`; \
|
||||
destdir=`cd $(top_srcdir) && pwd`; export destdir; \
|
||||
|
@ -122,4 +130,4 @@ stamp-enum-code: $(srcdir)/enumcode.pl enums.pl util.pl
|
|||
$(PERL) enumcode.pl \
|
||||
&& echo timestamp > $$rootme/stamp-enum-code
|
||||
|
||||
all-local: stamp-app stamp-enum-code
|
||||
all-local: stamp-app stamp-lib stamp-enum-code
|
||||
|
|
|
@ -275,8 +275,13 @@ CODE
|
|||
my $var = $_->{libname}; my $dh = ""; my $df = "";
|
||||
unless (exists $_->{retval}) {
|
||||
$var = "*$var"; $dh = "(*"; $df = ")";
|
||||
if ($type eq 'stringarray') {
|
||||
$arglist .= "$datatype**$_->{libname}";
|
||||
}
|
||||
else {
|
||||
$arglist .= "$datatype **$_->{libname}";
|
||||
}
|
||||
}
|
||||
|
||||
if ($ch || $cf) {
|
||||
$return_args .= "\n" . ' ' x 2 . "gint i;";
|
||||
|
|
|
@ -69,8 +69,8 @@ HELP
|
|||
|
||||
@outargs = (
|
||||
{ name => "${type}_type", type => 'enum PDBArgType (no PDB_END)',
|
||||
desc => "The type of $long_type { %%desc%% }", wrap => 1,
|
||||
alias => "${type}->arg_type", no_declare => 1 },
|
||||
desc => "The type of $long_type { %%desc%% }", void_ret => 1,
|
||||
alias => "${type}->arg_type", no_declare => 1, wrap => 1 },
|
||||
{ name => "${type}_name", type => 'string',
|
||||
desc => "The name of the $long_type",
|
||||
alias => "g_strdup (${type}->name)", no_declare => 1 },
|
||||
|
@ -276,6 +276,7 @@ HELP
|
|||
$outargs[0]->{alias} = 'data_copy';
|
||||
$outargs[0]->{init} = 1;
|
||||
$outargs[0]->{wrap} = 1;
|
||||
$outargs[0]->{void_ret} = 1;
|
||||
|
||||
%invoke = (
|
||||
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 {
|
||||
$blurb = "Creates a new unit and returns it's integer ID.";
|
||||
|
||||
|
@ -199,55 +216,11 @@ HELP
|
|||
|
||||
@headers = qw("libgimp/gimpunit.h");
|
||||
|
||||
$extra{lib}->{protos} = <<'CODE';
|
||||
GimpUnit gimp_unit_get_number_of_built_in_units (void);
|
||||
CODE
|
||||
|
||||
$extra{lib}->{code} = <<'CODE';
|
||||
/* 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);
|
||||
@procs = qw(unit_get_number_of_units unit_get_number_of_built_in_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]);
|
||||
|
||||
$desc = 'Units';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue