Commit fe90ae76 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/pdb/pdb-types.h renamed struct ProcRecord to GimpProcedure. Added

2006-03-31  Michael Natterer  <mitch@gimp.org>

	* app/pdb/pdb-types.h
	* app/pdb/gimpprocedure.h: renamed struct ProcRecord to
	GimpProcedure. Added GIMP_IS_PROCEDURE() which checks for != NULL.

	* app/pdb/gimpprocedure.c
	* app/pdb/procedural-db-query.c
	* app/pdb/procedural_db.[ch]
	* app/batch.c
	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* app/file/file-open.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-proc-def.h
	* app/plug-in/plug-in-proc-frame.[ch]
	* app/plug-in/plug-in-progress.c
	* app/plug-in/plug-in-rc.c
	* app/plug-in/plug-in-run.[ch]
	* app/plug-in/plug-in.[ch]
	* app/plug-in/plug-ins-query.c
	* app/plug-in/plug-ins.[ch]
	* app/widgets/gimphelp.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/app.pl: changed accordingly. Renamed 'proc_rec' and
	similarily named variables and parameters to 'procedure'.

	* tools/pdbgen/pdb/procedural_db.pdb: changed 'procedure'
	parameters to 'procedure_name'.

	* app/pdb/*_cmds.c
	* libgimp/gimpproceduraldb_pdb.[ch]: regenerated.
parent 3cb83051
2006-03-31 Michael Natterer <mitch@gimp.org>
* app/pdb/pdb-types.h
* app/pdb/gimpprocedure.h: renamed struct ProcRecord to
GimpProcedure. Added GIMP_IS_PROCEDURE() which checks for != NULL.
* app/pdb/gimpprocedure.c
* app/pdb/procedural-db-query.c
* app/pdb/procedural_db.[ch]
* app/batch.c
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* app/file/file-open.c
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-proc-def.h
* app/plug-in/plug-in-proc-frame.[ch]
* app/plug-in/plug-in-progress.c
* app/plug-in/plug-in-rc.c
* app/plug-in/plug-in-run.[ch]
* app/plug-in/plug-in.[ch]
* app/plug-in/plug-ins-query.c
* app/plug-in/plug-ins.[ch]
* app/widgets/gimphelp.c
* app/xcf/xcf.c
* tools/pdbgen/pdb/fileops.pdb
* tools/pdbgen/app.pl: changed accordingly. Renamed 'proc_rec' and
similarily named variables and parameters to 'procedure'.
* tools/pdbgen/pdb/procedural_db.pdb: changed 'procedure'
parameters to 'procedure_name'.
* app/pdb/*_cmds.c
* libgimp/gimpproceduraldb_pdb.[ch]: regenerated.
2006-03-31 Michael Natterer <mitch@gimp.org>
* app/pdb/gimpprocedure.h (struct ProcRecord): added new member
......
......@@ -67,7 +67,7 @@ plug_in_run_cmd_callback (GtkAction *action,
gpointer data)
{
Gimp *gimp;
ProcRecord *procedure;
GimpProcedure *procedure;
Argument *args;
gint n_args = 0;
GimpDisplay *display = NULL;
......
......@@ -310,10 +310,10 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpImage *image;
ProcRecord *procedure;
Argument *args;
GimpDisplay *display;
GimpImage *image;
GimpProcedure *procedure;
Argument *args;
GimpDisplay *display;
return_if_no_image (image, data);
if (value)
......
......@@ -40,13 +40,13 @@
#define BATCH_DEFAULT_EVAL_PROC "plug-in-script-fu-eval"
static gboolean batch_exit_after_callback (Gimp *gimp,
gboolean kill_it);
static void batch_run_cmd (Gimp *gimp,
const gchar *proc_name,
ProcRecord *proc,
GimpRunMode run_mode,
const gchar *cmd);
static gboolean batch_exit_after_callback (Gimp *gimp,
gboolean kill_it);
static void batch_run_cmd (Gimp *gimp,
const gchar *proc_name,
GimpProcedure *procedure,
GimpRunMode run_mode,
const gchar *cmd);
void
......@@ -76,18 +76,19 @@ batch_run (Gimp *gimp,
if (strcmp (batch_interpreter, "plug-in-script-fu-eval") == 0 &&
strcmp (batch_commands[0], "-") == 0)
{
const gchar *proc_name = "plug-in-script-fu-text-console";
ProcRecord *proc = procedural_db_lookup (gimp, proc_name);
const gchar *proc_name = "plug-in-script-fu-text-console";
GimpProcedure *procedure = procedural_db_lookup (gimp, proc_name);
if (proc)
batch_run_cmd (gimp, proc_name, proc, GIMP_RUN_NONINTERACTIVE, NULL);
if (procedure)
batch_run_cmd (gimp, proc_name, procedure,
GIMP_RUN_NONINTERACTIVE, NULL);
else
g_message (_("The batch interpreter '%s' is not available. "
"Batch mode disabled."), proc_name);
}
else
{
ProcRecord *eval_proc = procedural_db_lookup (gimp, batch_interpreter);
GimpProcedure *eval_proc = procedural_db_lookup (gimp, batch_interpreter);
if (eval_proc)
{
......@@ -123,27 +124,27 @@ batch_exit_after_callback (Gimp *gimp,
}
static void
batch_run_cmd (Gimp *gimp,
const gchar *proc_name,
ProcRecord *proc,
GimpRunMode run_mode,
const gchar *cmd)
batch_run_cmd (Gimp *gimp,
const gchar *proc_name,
GimpProcedure *procedure,
GimpRunMode run_mode,
const gchar *cmd)
{
Argument *args;
Argument *return_vals;
gint n_return_vals;
args = gimp_procedure_get_arguments (proc);
args = gimp_procedure_get_arguments (procedure);
g_value_set_int (&args[0].value, run_mode);
if (proc->num_args > 1)
if (procedure->num_args > 1)
g_value_set_static_string (&args[1].value, cmd);
return_vals = procedural_db_execute (gimp,
gimp_get_user_context (gimp), NULL,
proc_name,
args, proc->num_args,
args, procedure->num_args,
&n_return_vals);
switch (g_value_get_enum (&return_vals[0].value))
......@@ -162,7 +163,7 @@ batch_run_cmd (Gimp *gimp,
}
procedural_db_destroy_args (return_vals, n_return_vals, TRUE);
procedural_db_destroy_args (args, proc->num_args, TRUE);
procedural_db_destroy_args (args, procedure->num_args, TRUE);
return;
}
......@@ -191,8 +191,8 @@ file_open_thumbnail (Gimp *gimp,
gint *image_width,
gint *image_height)
{
PlugInProcDef *file_proc;
const ProcRecord *proc;
PlugInProcDef *file_proc;
GimpProcedure *procedure;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
......@@ -209,9 +209,9 @@ file_open_thumbnail (Gimp *gimp,
if (! file_proc || ! file_proc->thumb_loader)
return NULL;
proc = procedural_db_lookup (gimp, file_proc->thumb_loader);
procedure = procedural_db_lookup (gimp, file_proc->thumb_loader);
if (proc && proc->num_args >= 2 && proc->num_values >= 1)
if (procedure && procedure->num_args >= 2 && procedure->num_values >= 1)
{
GimpPDBStatusType status;
Argument *return_vals;
......@@ -225,7 +225,7 @@ file_open_thumbnail (Gimp *gimp,
filename = g_strdup (uri);
return_vals = procedural_db_run_proc (gimp, context, progress,
proc->name,
procedure->name,
&n_return_vals,
GIMP_PDB_STRING, filename,
GIMP_PDB_INT32, size,
......
This diff is collapsed.
......@@ -31,14 +31,14 @@
#include "core/gimp.h"
#include "core/gimpdatafactory.h"
static ProcRecord brushes_popup_proc;
static ProcRecord brushes_close_popup_proc;
static ProcRecord brushes_set_popup_proc;
static GimpProcedure brushes_popup_proc;
static GimpProcedure brushes_close_popup_proc;
static GimpProcedure brushes_set_popup_proc;
void
register_brush_select_procs (Gimp *gimp)
{
ProcRecord *procedure;
GimpProcedure *procedure;
/*
* brushes_popup
......@@ -153,11 +153,11 @@ register_brush_select_procs (Gimp *gimp)
}
static Argument *
brushes_popup_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gchar *brush_callback;
......@@ -187,10 +187,10 @@ brushes_popup_invoker (ProcRecord *proc_record,
success = FALSE;
}
return gimp_procedure_get_return_values (proc_record, success);
return gimp_procedure_get_return_values (procedure, success);
}
static ProcRecord brushes_popup_proc =
static GimpProcedure brushes_popup_proc =
{
TRUE, TRUE,
"gimp-brushes-popup",
......@@ -207,11 +207,11 @@ static ProcRecord brushes_popup_proc =
};
static Argument *
brushes_close_popup_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_close_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gchar *brush_callback;
......@@ -227,10 +227,10 @@ brushes_close_popup_invoker (ProcRecord *proc_record,
success = FALSE;
}
return gimp_procedure_get_return_values (proc_record, success);
return gimp_procedure_get_return_values (procedure, success);
}
static ProcRecord brushes_close_popup_proc =
static GimpProcedure brushes_close_popup_proc =
{
TRUE, TRUE,
"gimp-brushes-close-popup",
......@@ -247,11 +247,11 @@ static ProcRecord brushes_close_popup_proc =
};
static Argument *
brushes_set_popup_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_set_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gchar *brush_callback;
......@@ -279,10 +279,10 @@ brushes_set_popup_invoker (ProcRecord *proc_record,
success = FALSE;
}
return gimp_procedure_get_return_values (proc_record, success);
return gimp_procedure_get_return_values (procedure, success);
}
static ProcRecord brushes_set_popup_proc =
static GimpProcedure brushes_set_popup_proc =
{
TRUE, TRUE,
"gimp-brushes-set-popup",
......
......@@ -37,17 +37,17 @@
#include "core/gimpdatafactory.h"
#include "core/gimplist.h"
static ProcRecord brushes_refresh_proc;
static ProcRecord brushes_get_list_proc;
static ProcRecord brushes_get_brush_proc;
static ProcRecord brushes_get_spacing_proc;
static ProcRecord brushes_set_spacing_proc;
static ProcRecord brushes_get_brush_data_proc;
static GimpProcedure brushes_refresh_proc;
static GimpProcedure brushes_get_list_proc;
static GimpProcedure brushes_get_brush_proc;
static GimpProcedure brushes_get_spacing_proc;
static GimpProcedure brushes_set_spacing_proc;
static GimpProcedure brushes_get_brush_data_proc;
void
register_brushes_procs (Gimp *gimp)
{
ProcRecord *procedure;
GimpProcedure *procedure;
/*
* brushes_refresh
......@@ -217,17 +217,17 @@ register_brushes_procs (Gimp *gimp)
}
static Argument *
brushes_refresh_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_refresh_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gimp_data_factory_data_refresh (gimp->brush_factory);
return gimp_procedure_get_return_values (proc_record, TRUE);
return gimp_procedure_get_return_values (procedure, TRUE);
}
static ProcRecord brushes_refresh_proc =
static GimpProcedure brushes_refresh_proc =
{
TRUE, TRUE,
"gimp-brushes-refresh",
......@@ -244,11 +244,11 @@ static ProcRecord brushes_refresh_proc =
};
static Argument *
brushes_get_list_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_get_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -264,7 +264,7 @@ brushes_get_list_invoker (ProcRecord *proc_record,
filter, &num_brushes);
}
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
{
......@@ -275,7 +275,7 @@ brushes_get_list_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord brushes_get_list_proc =
static GimpProcedure brushes_get_list_proc =
{
TRUE, TRUE,
"gimp-brushes-get-list",
......@@ -292,11 +292,11 @@ static ProcRecord brushes_get_list_proc =
};
static Argument *
brushes_get_brush_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_get_brush_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -317,7 +317,7 @@ brushes_get_brush_invoker (ProcRecord *proc_record,
else
success = FALSE;
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
{
......@@ -330,7 +330,7 @@ brushes_get_brush_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord brushes_get_brush_proc =
static GimpProcedure brushes_get_brush_proc =
{
TRUE, TRUE,
"gimp-brushes-get-brush",
......@@ -347,11 +347,11 @@ static ProcRecord brushes_get_brush_proc =
};
static Argument *
brushes_get_spacing_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_get_spacing_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -364,7 +364,7 @@ brushes_get_spacing_invoker (ProcRecord *proc_record,
else
success = FALSE;
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_int (&return_vals[1].value, spacing);
......@@ -372,7 +372,7 @@ brushes_get_spacing_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord brushes_get_spacing_proc =
static GimpProcedure brushes_get_spacing_proc =
{
TRUE, TRUE,
"gimp-brushes-get-spacing",
......@@ -389,11 +389,11 @@ static ProcRecord brushes_get_spacing_proc =
};
static Argument *
brushes_set_spacing_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_set_spacing_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gint32 spacing;
......@@ -405,10 +405,10 @@ brushes_set_spacing_invoker (ProcRecord *proc_record,
gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);
}
return gimp_procedure_get_return_values (proc_record, success);
return gimp_procedure_get_return_values (procedure, success);
}
static ProcRecord brushes_set_spacing_proc =
static GimpProcedure brushes_set_spacing_proc =
{
TRUE, TRUE,
"gimp-brushes-set-spacing",
......@@ -425,11 +425,11 @@ static ProcRecord brushes_set_spacing_proc =
};
static Argument *
brushes_get_brush_data_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
brushes_get_brush_data_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -474,7 +474,7 @@ brushes_get_brush_data_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
{
......@@ -491,7 +491,7 @@ brushes_get_brush_data_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord brushes_get_brush_data_proc =
static GimpProcedure brushes_get_brush_data_proc =
{
TRUE, TRUE,
"gimp-brushes-get-brush-data",
......
......@@ -35,18 +35,18 @@
#include "core/gimpcontainer.h"
#include "gimp-intl.h"
static ProcRecord buffers_get_list_proc;
static ProcRecord buffer_rename_proc;
static ProcRecord buffer_delete_proc;
static ProcRecord buffer_get_width_proc;
static ProcRecord buffer_get_height_proc;
static ProcRecord buffer_get_bytes_proc;
static ProcRecord buffer_get_image_type_proc;
static GimpProcedure buffers_get_list_proc;
static GimpProcedure buffer_rename_proc;
static GimpProcedure buffer_delete_proc;
static GimpProcedure buffer_get_width_proc;
static GimpProcedure buffer_get_height_proc;
static GimpProcedure buffer_get_bytes_proc;
static GimpProcedure buffer_get_image_type_proc;
void
register_buffer_procs (Gimp *gimp)
{
ProcRecord *procedure;
GimpProcedure *procedure;
/*
* buffers_get_list
......@@ -207,11 +207,11 @@ register_buffer_procs (Gimp *gimp)
}
static Argument *
buffers_get_list_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
buffers_get_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -227,7 +227,7 @@ buffers_get_list_invoker (ProcRecord *proc_record,
filter, &num_buffers);
}
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
{
......@@ -238,7 +238,7 @@ buffers_get_list_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord buffers_get_list_proc =
static GimpProcedure buffers_get_list_proc =
{
TRUE, TRUE,
"gimp-buffers-get-list",
......@@ -255,11 +255,11 @@ static ProcRecord buffers_get_list_proc =
};
static Argument *
buffer_rename_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
buffer_rename_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -284,7 +284,7 @@ buffer_rename_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_take_string (&return_vals[1].value, real_name);
......@@ -292,7 +292,7 @@ buffer_rename_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord buffer_rename_proc =
static GimpProcedure buffer_rename_proc =
{
TRUE, TRUE,
"gimp-buffer-rename",
......@@ -309,11 +309,11 @@ static ProcRecord buffer_rename_proc =
};
static Argument *
buffer_delete_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
buffer_delete_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gchar *buffer_name;
......@@ -331,10 +331,10 @@ buffer_delete_invoker (ProcRecord *proc_record,
success = FALSE;
}
return gimp_procedure_get_return_values (proc_record, success);
return gimp_procedure_get_return_values (procedure, success);
}
static ProcRecord buffer_delete_proc =
static GimpProcedure buffer_delete_proc =
{
TRUE, TRUE,
"gimp-buffer-delete",
......@@ -351,11 +351,11 @@ static ProcRecord buffer_delete_proc =
};
static Argument *
buffer_get_width_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
buffer_get_width_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -375,7 +375,7 @@ buffer_get_width_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_int (&return_vals[1].value, width);
......@@ -383,7 +383,7 @@ buffer_get_width_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord buffer_get_width_proc =
static GimpProcedure buffer_get_width_proc =
{
TRUE, TRUE,
"gimp-buffer-get-width",
......@@ -400,11 +400,11 @@ static ProcRecord buffer_get_width_proc =
};
static Argument *
buffer_get_height_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
buffer_get_height_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_vals;
......@@ -424,7 +424,7 @@ buffer_get_height_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (proc_record, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_int (&return_vals[1].value, height);
......@@ -432,7 +432,7 @@ buffer_get_height_invoker (ProcRecord *proc_record,
return return_vals;
}
static ProcRecord buffer_get_height_proc =
static GimpProcedure buffer_get_height_proc =
{
TRUE, TRUE,
"gimp-buffer-get-height",
......@@ -449,11 +449,11 @@ static ProcRecord buffer_get_height_proc =
};
static Argument *
buffer_get_bytes_invoker (ProcRecord *proc_record,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
buffer_get_bytes_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{