renamed gimp_temp_PDB_name() to gimp_procedurab_db_temp_name()

2003-12-19  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/plug_in.pdb: renamed gimp_temp_PDB_name()
	* tools/pdbgen/pdb/procedural_db.pdb: to gimp_procedurab_db_temp_name()

	* app/pdb/procedural_db.c
	* libgimp/gimpcompat.h: added compat cruft.

	* app/pdb/internal_procs.c
	* app/pdb/plug_in_cmds.c
	* app/pdb/procedural_db_cmds.c
	* libgimp/gimpplugin_pdb.[ch]
	* libgimp/gimpproceduraldb_pdb.[ch]: regenerated.

	* libgimp/gimpbrushselect.c
	* libgimp/gimpfontselect.c
	* libgimp/gimpgradientselect.c
	* libgimp/gimppatternselect.c: changed accordingly.
This commit is contained in:
Michael Natterer 2003-12-19 00:00:49 +00:00 committed by Michael Natterer
parent eb496dec99
commit 14c75713a6
19 changed files with 139 additions and 124 deletions

View File

@ -1,3 +1,22 @@
2003-12-19 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/plug_in.pdb: renamed gimp_temp_PDB_name()
* tools/pdbgen/pdb/procedural_db.pdb: to gimp_procedurab_db_temp_name()
* app/pdb/procedural_db.c
* libgimp/gimpcompat.h: added compat cruft.
* app/pdb/internal_procs.c
* app/pdb/plug_in_cmds.c
* app/pdb/procedural_db_cmds.c
* libgimp/gimpplugin_pdb.[ch]
* libgimp/gimpproceduraldb_pdb.[ch]: regenerated.
* libgimp/gimpbrushselect.c
* libgimp/gimpfontselect.c
* libgimp/gimpgradientselect.c
* libgimp/gimppatternselect.c: changed accordingly.
2003-12-19 Michael Natterer <mitch@gimp.org>
* libgimp/gimpcompat.h: added some missing #defines.

View File

@ -148,6 +148,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_layer_set_visible", "gimp_drawable_set_visible" },
{ "gimp_palette_refresh", "gimp_palettes_refresh" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};

View File

@ -148,6 +148,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_layer_set_visible", "gimp_drawable_set_visible" },
{ "gimp_palette_refresh", "gimp_palettes_refresh" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};

View File

@ -148,6 +148,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_layer_set_visible", "gimp_drawable_set_visible" },
{ "gimp_palette_refresh", "gimp_palettes_refresh" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};

View File

@ -171,7 +171,7 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Plug-in"), 0.81);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.827);
(* status_callback) (NULL, _("Procedural database"), 0.824);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.85);

View File

@ -48,7 +48,6 @@
static ProcRecord progress_init_proc;
static ProcRecord progress_update_proc;
static ProcRecord temp_PDB_name_proc;
static ProcRecord plugins_query_proc;
static ProcRecord plugin_domain_register_proc;
static ProcRecord plugin_help_register_proc;
@ -58,7 +57,6 @@ register_plug_in_procs (Gimp *gimp)
{
procedural_db_register (gimp, &progress_init_proc);
procedural_db_register (gimp, &progress_update_proc);
procedural_db_register (gimp, &temp_PDB_name_proc);
procedural_db_register (gimp, &plugins_query_proc);
procedural_db_register (gimp, &plugin_domain_register_proc);
procedural_db_register (gimp, &plugin_help_register_proc);
@ -174,47 +172,6 @@ static ProcRecord progress_update_proc =
{ { progress_update_invoker } }
};
static Argument *
temp_PDB_name_invoker (Gimp *gimp,
Argument *args)
{
Argument *return_args;
gchar *temp_name;
static gint proc_number = 0;
temp_name = g_strdup_printf ("temp_plugin_number_%d", proc_number++);
return_args = procedural_db_return_args (&temp_PDB_name_proc, TRUE);
return_args[1].value.pdb_pointer = temp_name;
return return_args;
}
static ProcArg temp_PDB_name_outargs[] =
{
{
GIMP_PDB_STRING,
"temp_name",
"A unique temporary name for a temporary PDB entry"
}
};
static ProcRecord temp_PDB_name_proc =
{
"gimp_temp_PDB_name",
"Generates a unique temporary PDB name.",
"This procedure generates a temporary PDB entry name that is guaranteed to be unique. It is many used by the interactive popup dialogs to generate a PDB entry name.",
"Andy Thomas",
"Andy Thomas",
"1998",
GIMP_INTERNAL,
0,
NULL,
1,
temp_PDB_name_outargs,
{ { temp_PDB_name_invoker } }
};
static Argument *
plugins_query_invoker (Gimp *gimp,
Argument *args)

View File

@ -148,6 +148,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_layer_set_visible", "gimp_drawable_set_visible" },
{ "gimp_palette_refresh", "gimp_palettes_refresh" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};

View File

@ -113,6 +113,7 @@ static const gchar * const type_str[] =
"GIMP_PDB_END"
};
static ProcRecord procedural_db_temp_name_proc;
static ProcRecord procedural_db_dump_proc;
static ProcRecord procedural_db_query_proc;
static ProcRecord procedural_db_proc_info_proc;
@ -125,6 +126,7 @@ static ProcRecord procedural_db_set_data_proc;
void
register_procedural_db_procs (Gimp *gimp)
{
procedural_db_register (gimp, &procedural_db_temp_name_proc);
procedural_db_register (gimp, &procedural_db_dump_proc);
procedural_db_register (gimp, &procedural_db_query_proc);
procedural_db_register (gimp, &procedural_db_proc_info_proc);
@ -333,6 +335,47 @@ pdb_type_name (gint type)
*/
}
static Argument *
procedural_db_temp_name_invoker (Gimp *gimp,
Argument *args)
{
Argument *return_args;
gchar *temp_name;
static gint proc_number = 0;
temp_name = g_strdup_printf ("temp_procedure_number_%d", proc_number++);
return_args = procedural_db_return_args (&procedural_db_temp_name_proc, TRUE);
return_args[1].value.pdb_pointer = temp_name;
return return_args;
}
static ProcArg procedural_db_temp_name_outargs[] =
{
{
GIMP_PDB_STRING,
"temp_name",
"A unique temporary name for a temporary PDB entry"
}
};
static ProcRecord procedural_db_temp_name_proc =
{
"gimp_procedural_db_temp_name",
"Generates a unique temporary PDB name.",
"This procedure generates a temporary PDB entry name that is guaranteed to be unique. It is many used by the interactive popup dialogs to generate a PDB entry name.",
"Andy Thomas",
"Andy Thomas",
"1998",
GIMP_INTERNAL,
0,
NULL,
1,
procedural_db_temp_name_outargs,
{ { procedural_db_temp_name_invoker } }
};
static Argument *
procedural_db_dump_invoker (Gimp *gimp,
Argument *args)

View File

@ -83,7 +83,7 @@ gimp_brush_select_new (const gchar *title,
"[0 = No, 1 = Yes]" },
};
gchar *brush_callback = gimp_temp_PDB_name ();
gchar *brush_callback = gimp_procedural_db_temp_name ();
gimp_install_temp_proc (brush_callback,
"Temporary brush popup callback procedure",

View File

@ -92,6 +92,8 @@ G_BEGIN_DECLS
#define gimp_palette_refresh gimp_palettes_refresh
#define gimp_temp_PDB_name gimp_procedural_db_temp_name
#define gimp_undo_push_group_start gimp_image_undo_group_start
#define gimp_undo_push_group_end gimp_image_undo_group_end

View File

@ -67,7 +67,7 @@ gimp_font_select_new (const gchar *title,
"[0 = No, 1 = Yes]" },
};
gchar *font_callback = gimp_temp_PDB_name ();
gchar *font_callback = gimp_procedural_db_temp_name ();
gimp_install_temp_proc (font_callback,
"Temporary font popup callback procedure",

View File

@ -72,7 +72,7 @@ gimp_gradient_select_new (const gchar *title,
"[0 = No, 1 = Yes]" },
};
gchar *gradient_callback = gimp_temp_PDB_name ();
gchar *gradient_callback = gimp_procedural_db_temp_name ();
gimp_install_temp_proc (gradient_callback,
"Temporary gradient popup callback procedure",

View File

@ -76,7 +76,7 @@ gimp_pattern_select_new (const gchar *title,
"[0 = No, 1 = Yes]" },
};
gchar *pattern_callback = gimp_temp_PDB_name ();
gchar *pattern_callback = gimp_procedural_db_temp_name ();
gimp_install_temp_proc (pattern_callback,
"Temporary pattern popup callback procedure",

View File

@ -87,36 +87,6 @@ gimp_progress_update (gdouble percentage)
return success;
}
/**
* gimp_temp_PDB_name:
*
* Generates a unique temporary PDB name.
*
* This procedure generates a temporary PDB entry name that is
* guaranteed to be unique. It is many used by the interactive popup
* dialogs to generate a PDB entry name.
*
* Returns: A unique temporary name for a temporary PDB entry.
*/
gchar *
gimp_temp_PDB_name (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *temp_name = NULL;
return_vals = gimp_run_procedure ("gimp_temp_PDB_name",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
temp_name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return temp_name;
}
/**
* gimp_plugin_domain_register:
* @domain_name: The name of the textdomain (must be unique).

View File

@ -31,7 +31,6 @@ G_BEGIN_DECLS
gboolean gimp_progress_init (const gchar *message);
gboolean gimp_progress_update (gdouble percentage);
gchar* gimp_temp_PDB_name (void);
gboolean gimp_plugin_domain_register (const gchar *domain_name,
const gchar *domain_path);
gboolean gimp_plugin_help_register (const gchar *domain_name,

View File

@ -27,6 +27,36 @@
#include "gimp.h"
/**
* gimp_procedural_db_temp_name:
*
* Generates a unique temporary PDB name.
*
* This procedure generates a temporary PDB entry name that is
* guaranteed to be unique. It is many used by the interactive popup
* dialogs to generate a PDB entry name.
*
* Returns: A unique temporary name for a temporary PDB entry.
*/
gchar *
gimp_procedural_db_temp_name (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *temp_name = NULL;
return_vals = gimp_run_procedure ("gimp_procedural_db_temp_name",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
temp_name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return temp_name;
}
/**
* gimp_procedural_db_dump:
* @filename: The dump filename.

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gchar* gimp_procedural_db_temp_name (void);
gboolean gimp_procedural_db_dump (const gchar *filename);
gboolean gimp_procedural_db_query (const gchar *name,
const gchar *blurb,

View File

@ -17,21 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub andy_pdb_misc {
$author = $copyright = 'Andy Thomas';
$date = '1998';
}
sub mitch_misc {
$author = $copyright = 'Michael Natterer <mitch@gimp.org>';
$date = '2000';
}
sub neo_pdb_misc {
$author = $copyright = 'Sven Neumann';
$date = '2000';
}
# The defs
sub progress_init {
@ -99,36 +84,13 @@ CODE
);
}
sub temp_PDB_name {
$blurb = 'Generates a unique temporary PDB name.';
$help = <<'HELP';
This procedure generates a temporary PDB entry name that is guaranteed to be
unique. It is many used by the interactive popup dialogs to generate a PDB
entry name.
HELP
&andy_pdb_misc;
@outargs = (
{ name => 'temp_name', type => 'string',
desc => 'A unique temporary name for a temporary PDB entry' }
);
%invoke = (
vars => [ 'static gint proc_number = 0' ],
code => <<'CODE'
temp_name = g_strdup_printf ("temp_plugin_number_%d", proc_number++);
CODE
);
}
sub plugins_query {
$blurb = 'Queries the plugin database for its contents.';
$help = 'This procedure queries the contents of the plugin database.';
&andy_pdb_misc;
$author = $copyright = 'Andy Thomas';
$date = '1998';
@inargs = (
{ name => 'search_string', type => 'string',
@ -261,7 +223,8 @@ in the query function of a plug-in and it has to be called before any
procedure is installed.
HELP
&neo_pdb_misc;
$author = $copyright = 'Sven Neumann';
$date = '2000';
@inargs = (
{ name => 'domain_name', type => 'string',
@ -297,7 +260,8 @@ subsequent calls of gimp_help from this plug-in will be interpreted relative
to this rootdir.
HELP
&mitch_misc;
$author = $copyright = 'Michael Natterer <mitch@gimp.org>';
$date = '2000';
@inargs = (
{ name => 'domain_name', type => 'string',
@ -337,9 +301,9 @@ CODE
"plug-in/plug-in-def.h" "plug-in/plug-in-proc.h"
"plug-in/plug-in-progress.h");
@procs = qw(progress_init progress_update temp_PDB_name plugins_query
@procs = qw(progress_init progress_update plugins_query
plugin_domain_register plugin_help_register);
%exports = (app => [@procs], lib => [@procs[0..2,4,5]]);
%exports = (app => [@procs], lib => [@procs[0,1,3,4]]);
$desc = 'Plug-in';

View File

@ -104,6 +104,31 @@ CODE
# The defs
sub procedural_db_temp_name {
$blurb = 'Generates a unique temporary PDB name.';
$help = <<'HELP';
This procedure generates a temporary PDB entry name that is guaranteed to be
unique. It is many used by the interactive popup dialogs to generate a PDB
entry name.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1998';
@outargs = (
{ name => 'temp_name', type => 'string',
desc => 'A unique temporary name for a temporary PDB entry' }
);
%invoke = (
vars => [ 'static gint proc_number = 0' ],
code => <<'CODE'
temp_name = g_strdup_printf ("temp_procedure_number_%d", proc_number++);
CODE
);
}
sub procedural_db_dump {
$blurb = 'Dumps the current contents of the procedural database';
@ -645,7 +670,8 @@ pdb_type_name (gint type)
}
CODE
@procs = qw(procedural_db_dump procedural_db_query procedural_db_proc_info
@procs = qw(procedural_db_temp_name procedural_db_dump
procedural_db_query procedural_db_proc_info
procedural_db_proc_arg procedural_db_proc_val
procedural_db_get_data procedural_db_get_data_size
procedural_db_set_data);