added enum GimpPDBCompatMode which can be one of { OFF, ON, WARN }.

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

	* app/pdb/pdb-types.h: added enum GimpPDBCompatMode which can
	be one of { OFF, ON, WARN }.

	* app/main.c: added --pdb-compat-mode command line option. Renamed
	--enable-stack-trace to --stack-trace-mode. Made default values of
	stack_trace_mode and pdb_compat_mode depend on GIMP_MINOR_VERSION
	(default to compat ON and stack_trace NEVER).

	* app/app_procs.[ch]: pass pdb_compat_mode to gimp_new().

	* app/core/gimp.[ch]: added pdb_compat_mode to the Gimp struct
	and to gimp_new().

	* app/pdb/procedural_db.c: leave the compat table empty for
	GIMP_PDB_COMPAT_OFF.

	* app/plug-in/plug-in-message.c: warn when a deprecated procedure
	is called for GIMP_PDB_COMPAT_WARN.

	* docs/gimp-1.3.1.in: changed accordingly.
This commit is contained in:
Michael Natterer 2003-12-05 17:08:35 +00:00 committed by Michael Natterer
parent 3ad199d5b3
commit ca45a5c65a
15 changed files with 147 additions and 38 deletions

View File

@ -1,3 +1,26 @@
2003-12-05 Michael Natterer <mitch@gimp.org>
* app/pdb/pdb-types.h: added enum GimpPDBCompatMode which can
be one of { OFF, ON, WARN }.
* app/main.c: added --pdb-compat-mode command line option. Renamed
--enable-stack-trace to --stack-trace-mode. Made default values of
stack_trace_mode and pdb_compat_mode depend on GIMP_MINOR_VERSION
(default to compat ON and stack_trace NEVER).
* app/app_procs.[ch]: pass pdb_compat_mode to gimp_new().
* app/core/gimp.[ch]: added pdb_compat_mode to the Gimp struct
and to gimp_new().
* app/pdb/procedural_db.c: leave the compat table empty for
GIMP_PDB_COMPAT_OFF.
* app/plug-in/plug-in-message.c: warn when a deprecated procedure
is called for GIMP_PDB_COMPAT_WARN.
* docs/gimp-1.3.1.in: changed accordingly.
2003-12-05 Michael Natterer <mitch@gimp.org>
Name all PDB procedures which deal with floating selections

View File

@ -94,7 +94,8 @@ app_run (const gchar *full_prog_name,
gboolean use_shm,
gboolean use_cpu_accel,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode)
GimpStackTraceMode stack_trace_mode,
GimpPDBCompatMode pdb_compat_mode)
{
GimpInitStatusFunc update_status_func = NULL;
Gimp *gimp;
@ -111,7 +112,8 @@ app_run (const gchar *full_prog_name,
no_interface,
use_shm,
console_messages,
stack_trace_mode);
stack_trace_mode,
pdb_compat_mode);
g_log_set_handler ("Gimp",
G_LOG_LEVEL_MESSAGE,

View File

@ -44,7 +44,8 @@ void app_run (const gchar *full_prog_name,
gboolean use_shm,
gboolean use_cpu_accel,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode);
GimpStackTraceMode stack_trace_mode,
GimpPDBCompatMode pdb_compat_mode);
#endif /* __APP_PROCS_H__ */

View File

@ -216,6 +216,7 @@ gimp_init (Gimp *gimp)
gimp->use_shm = FALSE;
gimp->message_handler = GIMP_CONSOLE;
gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
gimp->pdb_compat_mode = GIMP_PDB_COMPAT_OFF;
gimp->gui_threads_enter_func = NULL;
gimp->gui_threads_leave_func = NULL;
@ -715,7 +716,8 @@ gimp_new (const gchar *name,
gboolean no_interface,
gboolean use_shm,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode)
GimpStackTraceMode stack_trace_mode,
GimpPDBCompatMode pdb_compat_mode)
{
Gimp *gimp;
@ -733,6 +735,7 @@ gimp_new (const gchar *name,
gimp->use_shm = use_shm ? TRUE : FALSE;
gimp->console_messages = console_messages ? TRUE : FALSE;
gimp->stack_trace_mode = stack_trace_mode;
gimp->pdb_compat_mode = pdb_compat_mode;
return gimp;
}

View File

@ -91,6 +91,7 @@ struct _Gimp
GimpMessageHandlerType message_handler;
gboolean console_messages;
GimpStackTraceMode stack_trace_mode;
GimpPDBCompatMode pdb_compat_mode;
GimpThreadEnterFunc gui_threads_enter_func;
GimpThreadLeaveFunc gui_threads_leave_func;
@ -217,7 +218,8 @@ Gimp * gimp_new (const gchar *name,
gboolean no_interface,
gboolean use_shm,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode);
GimpStackTraceMode stack_trace_mode,
GimpPDBCompatMode pdb_compat_mode);
void gimp_load_config (Gimp *gimp,
const gchar *alternate_system_gimprc,

View File

@ -107,7 +107,13 @@ main (int argc,
gboolean use_cpu_accel = TRUE;
gboolean console_messages = FALSE;
gboolean use_debug_handler = FALSE;
#if ((GIMP_MINOR_VERSION % 2) == 0)
GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_NEVER;
GimpPDBCompatMode pdb_compat_mode = GIMP_PDB_COMPAT_ON;
#else
GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_QUERY;
GimpPDBCompatMode pdb_compat_mode = GIMP_PDB_COMPAT_WARN;
#endif
gint i, j;
#if 0
@ -345,7 +351,7 @@ main (int argc,
argv[i] = NULL;
}
}
else if (strcmp (argv[i], "--enable-stack-trace") == 0)
else if (strcmp (argv[i], "--stack-trace-mode") == 0)
{
argv[i] = NULL;
if (argc <= ++i)
@ -363,6 +369,27 @@ main (int argc,
else
show_help = TRUE;
argv[i] = NULL;
}
}
else if (strcmp (argv[i], "--pdb-compat-mode") == 0)
{
argv[i] = NULL;
if (argc <= ++i)
{
show_help = TRUE;
}
else
{
if (! strcmp (argv[i], "off"))
pdb_compat_mode = GIMP_PDB_COMPAT_OFF;
else if (! strcmp (argv[i], "on"))
pdb_compat_mode = GIMP_PDB_COMPAT_ON;
else if (! strcmp (argv[i], "warn"))
pdb_compat_mode = GIMP_PDB_COMPAT_WARN;
else
show_help = TRUE;
argv[i] = NULL;
}
}
@ -456,7 +483,8 @@ main (int argc,
use_shm,
use_cpu_accel,
console_messages,
stack_trace_mode);
stack_trace_mode,
pdb_compat_mode);
g_free (batch_cmds);
@ -494,8 +522,10 @@ gimp_show_help (const gchar *progname)
g_print (_(" --dump-gimprc Output a gimprc file with default settings.\n"));
g_print (_(" -c, --console-messages Display warnings to console instead of a dialog box.\n"));
g_print (_(" --debug-handlers Enable non-fatal debugging signal handlers.\n"));
g_print (_(" --enable-stack-trace <never | query | always>\n"
g_print (_(" --stack-trace-mode <never | query | always>\n"
" Debugging mode for fatal signals.\n"));
g_print (_(" --pdb-compat-mode <off | on | warn>\n"
" Procedural Database compat mode.\n"));
g_print (_(" -b, --batch <commands> Process commands in batch mode.\n"));
g_print ("\n");
};

View File

@ -151,17 +151,20 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};
gint i;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (status_callback != NULL);
internal_procs_init (gimp, status_callback);
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
}
}
void

View File

@ -151,17 +151,20 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};
gint i;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (status_callback != NULL);
internal_procs_init (gimp, status_callback);
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
}
}
void

View File

@ -151,17 +151,20 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};
gint i;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (status_callback != NULL);
internal_procs_init (gimp, status_callback);
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
}
}
void

View File

@ -28,4 +28,12 @@ typedef struct _ProcArg ProcArg;
typedef struct _ProcRecord ProcRecord;
typedef enum
{
GIMP_PDB_COMPAT_OFF,
GIMP_PDB_COMPAT_ON,
GIMP_PDB_COMPAT_WARN
} GimpPDBCompatMode;
#endif /* __PDB_TYPES_H__ */

View File

@ -151,17 +151,20 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" }
};
gint i;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (status_callback != NULL);
internal_procs_init (gimp, status_callback);
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (compat_procs); i++)
g_hash_table_insert (gimp->procedural_compat_ht,
(gpointer) compat_procs[i].old_name,
(gpointer) compat_procs[i].new_name);
}
}
void

View File

@ -343,7 +343,18 @@ plug_in_handle_proc_run (PlugIn *plug_in,
proc_run->name);
if (proc_name)
proc_rec = procedural_db_lookup (plug_in->gimp, proc_name);
{
proc_rec = procedural_db_lookup (plug_in->gimp, proc_name);
if (plug_in->gimp->pdb_compat_mode == GIMP_PDB_COMPAT_WARN)
{
g_message ("WARNING: Plug-In '%s'\n\n(%s)\n\n"
"called deprecated procedure '%s'.\n"
"It should call '%s' instead!",
plug_in->name, plug_in->prog,
proc_run->name, proc_name);
}
}
}
if (! proc_name)

View File

@ -343,7 +343,18 @@ plug_in_handle_proc_run (PlugIn *plug_in,
proc_run->name);
if (proc_name)
proc_rec = procedural_db_lookup (plug_in->gimp, proc_name);
{
proc_rec = procedural_db_lookup (plug_in->gimp, proc_name);
if (plug_in->gimp->pdb_compat_mode == GIMP_PDB_COMPAT_WARN)
{
g_message ("WARNING: Plug-In '%s'\n\n(%s)\n\n"
"called deprecated procedure '%s'.\n"
"It should call '%s' instead!",
plug_in->name, plug_in->prog,
proc_run->name, proc_name);
}
}
}
if (! proc_name)

View File

@ -1,4 +1,4 @@
.TH GIMP 1 "30 November 2003" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.TH GIMP 1 "December 2003" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.SH NAME
gimp - an image manipulation and paint program.
.SH SYNOPSIS
@ -96,9 +96,12 @@ Do not popup dialog boxes on errors or warnings. Print the messages on
the console instead.
.B \-\-dump\-gimprc
.TP 8
.B \-\-enable\-stack\-trace \fI{never|query|always}\fP
.B \-\-stack\-trace\-mode \fI{never|query|always}\fP
If a stack-trace should be generated in case of fatal signals.
.TP 8
.B \-\-pdb\-compat\-mode \fI{off|on|warn}\fP
If the PDB should provide aliases for deprecated functions.
.TP 8
.B \-b, \-\-batch \fI<commands>\fP
Execute the set of \fI<commands>\fP non-interactively. The set
of \fI<commands>\fP is typically in the form of a script that

View File

@ -1,4 +1,4 @@
.TH GIMP 1 "30 November 2003" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.TH GIMP 1 "December 2003" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.SH NAME
gimp - an image manipulation and paint program.
.SH SYNOPSIS
@ -96,9 +96,12 @@ Do not popup dialog boxes on errors or warnings. Print the messages on
the console instead.
.B \-\-dump\-gimprc
.TP 8
.B \-\-enable\-stack\-trace \fI{never|query|always}\fP
.B \-\-stack\-trace\-mode \fI{never|query|always}\fP
If a stack-trace should be generated in case of fatal signals.
.TP 8
.B \-\-pdb\-compat\-mode \fI{off|on|warn}\fP
If the PDB should provide aliases for deprecated functions.
.TP 8
.B \-b, \-\-batch \fI<commands>\fP
Execute the set of \fI<commands>\fP non-interactively. The set
of \fI<commands>\fP is typically in the form of a script that