Commit ed011014 authored by Martin Nordholts's avatar Martin Nordholts

app: Add hidden --dump-pdb-procedures-deprecated option

Allow to dump the names of all internal deprecated PDB
procedures. This enables us to do static analysis on *.scm files and
look for usage of deprecated procedures.
parent 3474a385
......@@ -43,7 +43,7 @@
#include "libgimpbase/gimpbase.h"
#include "core/core-types.h"
#include "pdb/pdb-types.h"
#include "base/tile.h"
......@@ -51,6 +51,10 @@
#include "core/gimp.h"
#include "pdb/gimppdb.h"
#include "pdb/gimpprocedure.h"
#include "pdb/internal-procs.h"
#include "about.h"
#include "app.h"
#include "sanity.h"
......@@ -88,6 +92,11 @@ static gboolean gimp_option_dump_gimprc (const gchar *option_name,
const gchar *value,
gpointer data,
GError **error);
static gboolean gimp_option_dump_pdb_procedures_deprecated
(const gchar *option_name,
const gchar *value,
gpointer data,
GError **error);
static void gimp_show_version_and_exit (void) G_GNUC_NORETURN;
static void gimp_show_license_and_exit (void) G_GNUC_NORETURN;
......@@ -255,6 +264,12 @@ static const GOptionEntry main_entries[] =
G_OPTION_ARG_CALLBACK, gimp_option_dump_gimprc,
NULL, NULL
},
{
"dump-pdb-procedures-deprecated", 0,
G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK, gimp_option_dump_pdb_procedures_deprecated,
N_("Output a gimprc file with default settings"), NULL
},
{
G_OPTION_REMAINING, 0, 0,
G_OPTION_ARG_FILENAME_ARRAY, &filenames,
......@@ -594,6 +609,43 @@ gimp_option_dump_gimprc (const gchar *option_name,
return FALSE;
}
static gboolean
gimp_option_dump_pdb_procedures_deprecated (const gchar *option_name,
const gchar *value,
gpointer data,
GError **error)
{
Gimp *gimp;
GList *deprecated_procs;
GList *iter;
gimp = g_object_new (GIMP_TYPE_GIMP, NULL);
/* Make sure to turn of on compatibility mode so deprecated
* procedure are included
*/
gimp->pdb_compat_mode = GIMP_PDB_COMPAT_ON;
internal_procs_init (gimp->pdb);
deprecated_procs = gimp_pdb_get_deprecated_procedures (gimp->pdb);
for (iter = deprecated_procs; iter; iter = g_list_next (iter))
{
GimpProcedure *procedure = GIMP_PROCEDURE (iter->data);
g_print ("%s\n", procedure->original_name);
}
g_list_free (deprecated_procs);
g_object_unref (gimp);
app_exit (EXIT_SUCCESS);
return FALSE;
}
static void
gimp_show_version_and_exit (void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment