/* PIKA - Photo and Image Kooker Application
* a rebranding of The GNU Image Manipulation Program (created with heckimp)
* A derived work which may be trivial. However, any changes may be (C)2023 by Aldercone Studio
*
* Original copyright, applying to most contents (license remains unchanged):
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/* NOTE: This file is auto-generated by pdbgen.pl. */
#include "config.h"
#include "stamp-pdbgen.h"
#include
#include
#include "libpikabase/pikabase.h"
#include "libpikabase/pikabase.h"
#include "pdb-types.h"
#include "core/pika.h"
#include "core/pikaparamspecs-desc.h"
#include "core/pikaparamspecs.h"
#include "pika-pdb-compat.h"
#include "pikapdb-query.h"
#include "plug-in/pikaplugin-proc.h"
#include "plug-in/pikapluginmanager-data.h"
#include "plug-in/pikapluginmanager.h"
#include "plug-in/pikapluginprocedure.h"
#include "pikapdb.h"
#include "pikapdberror.h"
#include "pikapdb-utils.h"
#include "pikaprocedure.h"
#include "internal-procs.h"
#include "pika-intl.h"
static PikaProcedure *
lookup_procedure (PikaPDB *pdb,
const gchar *proc_name,
GError **error)
{
PikaProcedure *proc = pika_pdb_lookup_procedure (pdb, proc_name);
if (! proc)
{
const gchar *compat_name = pika_pdb_lookup_compat_proc_name (pdb,
proc_name);
if (compat_name)
proc = pika_pdb_lookup_procedure (pdb, compat_name);
}
if (! proc)
g_set_error (error, PIKA_PDB_ERROR, PIKA_PDB_ERROR_PROCEDURE_NOT_FOUND,
_("Procedure '%s' not found"), proc_name);
return proc;
}
static PikaValueArray *
pdb_temp_name_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
PikaValueArray *return_vals;
gchar *temp_name = NULL;
static gint proc_number = 0;
temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++);
return_vals = pika_procedure_get_return_values (procedure, TRUE, NULL);
g_value_take_string (pika_value_array_index (return_vals, 1), temp_name);
return return_vals;
}
static PikaValueArray *
pdb_dump_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
GFile *file;
file = g_value_get_object (pika_value_array_index (args, 0));
if (success)
{
if (file)
success = pika_pdb_dump (pika->pdb, file, error);
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_query_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *name;
const gchar *blurb;
const gchar *help;
const gchar *authors;
const gchar *copyright;
const gchar *date;
const gchar *proc_type;
gchar **procedure_names = NULL;
name = g_value_get_string (pika_value_array_index (args, 0));
blurb = g_value_get_string (pika_value_array_index (args, 1));
help = g_value_get_string (pika_value_array_index (args, 2));
authors = g_value_get_string (pika_value_array_index (args, 3));
copyright = g_value_get_string (pika_value_array_index (args, 4));
date = g_value_get_string (pika_value_array_index (args, 5));
proc_type = g_value_get_string (pika_value_array_index (args, 6));
if (success)
{
success = pika_pdb_query (pika->pdb,
name, blurb, help, authors,
copyright, date, proc_type,
&procedure_names,
error);
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_boxed (pika_value_array_index (return_vals, 1), procedure_names);
return return_vals;
}
static PikaValueArray *
pdb_proc_exists_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gboolean exists = FALSE;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = pika_pdb_lookup_procedure (pika->pdb,
procedure_name);
if (! proc)
{
procedure_name = pika_pdb_lookup_compat_proc_name (pika->pdb,
procedure_name);
if (procedure_name)
proc = pika_pdb_lookup_procedure (pika->pdb, procedure_name);
}
exists = (proc != NULL);
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (pika_value_array_index (return_vals, 1), exists);
return return_vals;
}
static PikaValueArray *
pdb_get_proc_info_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gint proc_type = 0;
gint num_args = 0;
gint num_values = 0;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (proc)
{
proc_type = proc->proc_type;
num_args = proc->num_args;
num_values = proc->num_values;
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_set_enum (pika_value_array_index (return_vals, 1), proc_type);
g_value_set_int (pika_value_array_index (return_vals, 2), num_args);
g_value_set_int (pika_value_array_index (return_vals, 3), num_values);
}
return return_vals;
}
static PikaValueArray *
pdb_get_proc_argument_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gint arg_num;
GParamSpec *param_spec = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
arg_num = g_value_get_int (pika_value_array_index (args, 1));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (proc && (arg_num >= 0 && arg_num < proc->num_args))
{
param_spec = g_param_spec_ref (proc->args[arg_num]);
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_param (pika_value_array_index (return_vals, 1), param_spec);
return return_vals;
}
static PikaValueArray *
pdb_get_proc_return_value_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gint val_num;
GParamSpec *param_spec = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
val_num = g_value_get_int (pika_value_array_index (args, 1));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (proc && (val_num >= 0 && val_num < proc->num_values))
{
param_spec = g_param_spec_ref (proc->values[val_num]);
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_param (pika_value_array_index (return_vals, 1), param_spec);
return return_vals;
}
static PikaValueArray *
pdb_set_proc_image_types_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *image_types;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
image_types = g_value_get_string (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_proc_image_types (plug_in, procedure_name,
image_types, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_get_proc_image_types_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gchar *image_types = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (PIKA_IS_PLUG_IN_PROCEDURE (proc))
{
image_types = g_strdup (PIKA_PLUG_IN_PROCEDURE (proc)->image_types);
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (pika_value_array_index (return_vals, 1), image_types);
return return_vals;
}
static PikaValueArray *
pdb_set_proc_sensitivity_mask_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
gint mask;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
mask = g_value_get_int (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_proc_sensitivity_mask (plug_in, procedure_name,
mask, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_proc_menu_label_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *menu_label;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
menu_label = g_value_get_string (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_proc_menu_label (plug_in, procedure_name,
menu_label, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_get_proc_menu_label_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gchar *menu_label = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (PIKA_IS_PLUG_IN_PROCEDURE (proc))
{
menu_label = g_strdup (PIKA_PLUG_IN_PROCEDURE (proc)->menu_label);
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (pika_value_array_index (return_vals, 1), menu_label);
return return_vals;
}
static PikaValueArray *
pdb_add_proc_menu_path_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *menu_path;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
menu_path = g_value_get_string (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_add_proc_menu_path (plug_in, procedure_name,
menu_path, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_get_proc_menu_paths_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gchar **menu_paths = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (PIKA_IS_PLUG_IN_PROCEDURE (proc))
{
PikaPlugInProcedure *plug_in_proc = PIKA_PLUG_IN_PROCEDURE (proc);
guint num_menu_paths;
num_menu_paths = g_list_length (plug_in_proc->menu_paths);
if (num_menu_paths > 0)
{
GList *list;
gint i;
menu_paths = g_new0 (gchar *, num_menu_paths + 1);
for (list = plug_in_proc->menu_paths, i = 0;
list;
list = g_list_next (list), i++)
{
menu_paths[i] = g_strdup (list->data);
}
}
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_boxed (pika_value_array_index (return_vals, 1), menu_paths);
return return_vals;
}
static PikaValueArray *
pdb_set_proc_icon_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
gint icon_type;
GBytes *icon_data;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
icon_type = g_value_get_enum (pika_value_array_index (args, 1));
icon_data = g_value_get_boxed (pika_value_array_index (args, 2));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_proc_icon (plug_in, procedure_name,
icon_type,
g_bytes_get_data (icon_data, NULL),
g_bytes_get_size (icon_data),
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_proc_documentation_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *blurb;
const gchar *help;
const gchar *help_id;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
blurb = g_value_get_string (pika_value_array_index (args, 1));
help = g_value_get_string (pika_value_array_index (args, 2));
help_id = g_value_get_string (pika_value_array_index (args, 3));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_proc_help (plug_in, procedure_name,
blurb, help, help_id, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_get_proc_documentation_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gchar *blurb = NULL;
gchar *help = NULL;
gchar *help_id = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (proc)
{
blurb = g_strdup (pika_procedure_get_blurb (proc));
help = g_strdup (pika_procedure_get_help (proc));
help_id = g_strdup (pika_procedure_get_help_id (proc));
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_take_string (pika_value_array_index (return_vals, 1), blurb);
g_value_take_string (pika_value_array_index (return_vals, 2), help);
g_value_take_string (pika_value_array_index (return_vals, 3), help_id);
}
return return_vals;
}
static PikaValueArray *
pdb_set_proc_attribution_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *authors;
const gchar *copyright;
const gchar *date;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
authors = g_value_get_string (pika_value_array_index (args, 1));
copyright = g_value_get_string (pika_value_array_index (args, 2));
date = g_value_get_string (pika_value_array_index (args, 3));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_proc_attribution (plug_in, procedure_name,
authors, copyright, date,
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_get_proc_attribution_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *procedure_name;
gchar *authors = NULL;
gchar *copyright = NULL;
gchar *date = NULL;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_pdb_is_canonical_procedure (procedure_name, error))
{
PikaProcedure *proc = lookup_procedure (pika->pdb, procedure_name,
error);
if (proc)
{
authors = g_strdup (proc->authors);
copyright = g_strdup (proc->copyright);
date = g_strdup (proc->date);
}
else
success = FALSE;
}
else
success = FALSE;
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_take_string (pika_value_array_index (return_vals, 1), authors);
g_value_take_string (pika_value_array_index (return_vals, 2), copyright);
g_value_take_string (pika_value_array_index (return_vals, 3), date);
}
return return_vals;
}
static PikaValueArray *
pdb_set_file_proc_load_handler_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *extensions;
const gchar *prefixes;
const gchar *magics;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
extensions = g_value_get_string (pika_value_array_index (args, 1));
prefixes = g_value_get_string (pika_value_array_index (args, 2));
magics = g_value_get_string (pika_value_array_index (args, 3));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_file_proc_load_handler (plug_in,
procedure_name,
extensions, prefixes,
magics, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_file_proc_save_handler_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *extensions;
const gchar *prefixes;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
extensions = g_value_get_string (pika_value_array_index (args, 1));
prefixes = g_value_get_string (pika_value_array_index (args, 2));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_file_proc_save_handler (plug_in,
procedure_name,
extensions, prefixes,
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_file_proc_priority_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
gint priority;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
priority = g_value_get_int (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_file_proc_priority (plug_in,
procedure_name,
priority, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_file_proc_mime_types_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *mime_types;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
mime_types = g_value_get_string (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_file_proc_mime_types (plug_in,
procedure_name,
mime_types, error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_file_proc_handles_remote_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_file_proc_handles_remote (plug_in,
procedure_name,
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_file_proc_handles_raw_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_file_proc_handles_raw (plug_in,
procedure_name,
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_file_proc_thumbnail_loader_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *load_proc;
const gchar *thumb_proc;
load_proc = g_value_get_string (pika_value_array_index (args, 0));
thumb_proc = g_value_get_string (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (load_proc, error) &&
pika_pdb_is_canonical_procedure (thumb_proc, error))
{
success = pika_plug_in_set_file_proc_thumb_loader (plug_in,
load_proc, thumb_proc,
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_set_batch_interpreter_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *procedure_name;
const gchar *interpreter_name;
procedure_name = g_value_get_string (pika_value_array_index (args, 0));
interpreter_name = g_value_get_string (pika_value_array_index (args, 1));
if (success)
{
PikaPlugIn *plug_in = pika->plug_in_manager->current_plug_in;
if (plug_in &&
pika_pdb_is_canonical_procedure (procedure_name, error))
{
success = pika_plug_in_set_batch_interpreter (plug_in,
procedure_name,
interpreter_name,
error);
}
else
success = FALSE;
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static PikaValueArray *
pdb_get_data_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
PikaValueArray *return_vals;
const gchar *identifier;
GBytes *data = NULL;
identifier = g_value_get_string (pika_value_array_index (args, 0));
if (success)
{
if (pika_is_canonical_identifier (identifier))
{
const guint8 *orig_data;
gint bytes;
orig_data = pika_plug_in_manager_get_data (pika->plug_in_manager,
identifier, &bytes);
if (orig_data)
data = g_bytes_new (orig_data, bytes);
else
success = FALSE;
}
else
{
g_set_error (error, PIKA_PDB_ERROR, PIKA_PDB_ERROR_INVALID_ARGUMENT,
_("Data label '%s' is not a canonical identifier"),
identifier);
success = FALSE;
}
}
return_vals = pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_boxed (pika_value_array_index (return_vals, 1), data);
return return_vals;
}
static PikaValueArray *
pdb_set_data_invoker (PikaProcedure *procedure,
Pika *pika,
PikaContext *context,
PikaProgress *progress,
const PikaValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *identifier;
GBytes *data;
identifier = g_value_get_string (pika_value_array_index (args, 0));
data = g_value_get_boxed (pika_value_array_index (args, 1));
if (success)
{
if (pika_is_canonical_identifier (identifier))
{
pika_plug_in_manager_set_data (pika->plug_in_manager,
identifier,
g_bytes_get_size (data),
g_bytes_get_data (data, NULL));
}
else
{
g_set_error (error, PIKA_PDB_ERROR, PIKA_PDB_ERROR_INVALID_ARGUMENT,
_("Data label '%s' is not a canonical identifier"),
identifier);
success = FALSE;
}
}
return pika_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
void
register_pdb_procs (PikaPDB *pdb)
{
PikaProcedure *procedure;
/*
* pika-pdb-temp-name
*/
procedure = pika_procedure_new (pdb_temp_name_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-temp-name");
pika_procedure_set_static_help (procedure,
"Generates a unique temporary PDB name.",
"This procedure generates a temporary PDB entry name that is guaranteed to be unique.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Andy Thomas",
"Andy Thomas",
"1998");
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("temp-name",
"temp name",
"A unique temporary name for a temporary PDB entry",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-dump
*/
procedure = pika_procedure_new (pdb_dump_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-dump");
pika_procedure_set_static_help (procedure,
"Dumps the current contents of the procedural database",
"This procedure dumps the contents of the procedural database to the specified file. The file will contain all of the information provided for each registered procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Josh MacDonald",
"Spencer Kimball & Josh MacDonald & Peter Mattis",
"1995-1996");
pika_procedure_add_argument (procedure,
g_param_spec_object ("file",
"file",
"The dump filename",
G_TYPE_FILE,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-query
*/
procedure = pika_procedure_new (pdb_query_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-query");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for its contents using regular expression matching.",
"This procedure queries the contents of the procedural database. It is supplied with seven arguments matching procedures on { name, blurb, help, authors, copyright, date, procedure type}. This is accomplished using regular expression matching. For instance, to find all procedures with \"jpeg\" listed in the blurb, all seven arguments can be supplied as \".*\", except for the second, which can be supplied as \".*jpeg.*\". There are two return arguments for this procedure. The first is the number of procedures matching the query. The second is a concatenated list of procedure names corresponding to those matching the query. If no matching entries are found, then the returned string is NULL and the number of entries is 0.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("name",
"name",
"The regex for procedure name",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("blurb",
"blurb",
"The regex for procedure blurb",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("help",
"help",
"The regex for procedure help",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("authors",
"authors",
"The regex for procedure authors",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("copyright",
"copyright",
"The regex for procedure copyright",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("date",
"date",
"The regex for procedure date",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("proc-type",
"proc type",
"The regex for procedure type: { 'Internal PIKA procedure', 'PIKA Plug-in', 'PIKA Extension', 'Temporary Procedure' }",
TRUE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_boxed ("procedure-names",
"procedure names",
"The list of procedure names",
G_TYPE_STRV,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-proc-exists
*/
procedure = pika_procedure_new (pdb_proc_exists_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-proc-exists");
pika_procedure_set_static_help (procedure,
"Checks if the specified procedure exists in the procedural database",
"This procedure checks if the specified procedure is registered in the procedural database.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Sven Neumann ",
"Sven Neumann",
"2008");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_boolean ("exists",
"exists",
"Whether a procedure of that name is registered",
FALSE,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-info
*/
procedure = pika_procedure_new (pdb_get_proc_info_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-info");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for information on the specified procedure.",
"This procedure returns information on the specified procedure. The procedure type, number of input, and number of return values are returned. For specific information on each input argument and return value, use the 'pika-pdb-db-proc-argument' and 'pika-pdb-db-proc-return-value' procedures.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_enum ("proc-type",
"proc type",
"The procedure type",
PIKA_TYPE_PDB_PROC_TYPE,
PIKA_PDB_PROC_TYPE_INTERNAL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_int ("num-args",
"num args",
"The number of input arguments",
G_MININT32, G_MAXINT32, 0,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_int ("num-values",
"num values",
"The number of return values",
G_MININT32, G_MAXINT32, 0,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-argument
*/
procedure = pika_procedure_new (pdb_get_proc_argument_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-argument");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for information on the specified procedure's argument.",
"This procedure returns the #GParamSpec of procedure_name's argument.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_int ("arg-num",
"arg num",
"The argument number",
G_MININT32, G_MAXINT32, 0,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_param ("param-spec",
"param spec",
"The GParamSpec of the argument",
G_TYPE_PARAM,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-return-value
*/
procedure = pika_procedure_new (pdb_get_proc_return_value_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-return-value");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for information on the specified procedure's return value.",
"This procedure returns the #GParamSpec of procedure_name's return value.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_int ("val-num",
"val num",
"The return value number",
G_MININT32, G_MAXINT32, 0,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_param ("param-spec",
"param spec",
"The GParamSpec of the return value",
G_TYPE_PARAM,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-proc-image-types
*/
procedure = pika_procedure_new (pdb_set_proc_image_types_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-proc-image-types");
pika_procedure_set_static_help (procedure,
"Set the supported image types for a plug-in procedure.",
"This procedure sets the supported images types for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure for which to install the menu path",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("image-types",
"image types",
"The procedure's supported image types",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-image-types
*/
procedure = pika_procedure_new (pdb_get_proc_image_types_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-image-types");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for the image types supported by the specified procedure.",
"This procedure returns the image types supported by the specified procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("image-types",
"image types",
"The image types",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-proc-sensitivity-mask
*/
procedure = pika_procedure_new (pdb_set_proc_sensitivity_mask_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-proc-sensitivity-mask");
pika_procedure_set_static_help (procedure,
"Set the sensitivity mask for a plug-in procedure.",
"This procedure sets the sensitivity mask for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Jehan",
"Jehan",
"2021");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_int ("mask",
"mask",
"The procedure's sensitivity mask",
G_MININT32, G_MAXINT32, 0,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-proc-menu-label
*/
procedure = pika_procedure_new (pdb_set_proc_menu_label_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-proc-menu-label");
pika_procedure_set_static_help (procedure,
"Set the menu label for a plug-in procedure.",
"This procedure sets the menu label for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure for which to install the menu path",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("menu-label",
"menu label",
"The procedure's menu label",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-menu-label
*/
procedure = pika_procedure_new (pdb_get_proc_menu_label_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-menu-label");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for the procedure's menu label.",
"This procedure returns the menu label of the specified procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("menu-label",
"menu label",
"The menu_label",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-add-proc-menu-path
*/
procedure = pika_procedure_new (pdb_add_proc_menu_path_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-add-proc-menu-path");
pika_procedure_set_static_help (procedure,
"Register an additional menu path for a plug-in procedure.",
"This procedure installs an additional menu entry for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure for which to install the menu path",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("menu-path",
"menu path",
"The procedure's additional menu path",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-menu-paths
*/
procedure = pika_procedure_new (pdb_get_proc_menu_paths_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-menu-paths");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for the procedure's menu paths.",
"This procedure returns the menu paths of the specified procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_boxed ("menu-paths",
"menu paths",
"The menu paths of the plug-in",
G_TYPE_STRV,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-proc-icon
*/
procedure = pika_procedure_new (pdb_set_proc_icon_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-proc-icon");
pika_procedure_set_static_help (procedure,
"Register an icon for a plug-in procedure.",
"This procedure installs an icon for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure for which to install the icon",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_enum ("icon-type",
"icon type",
"The type of the icon",
PIKA_TYPE_ICON_TYPE,
PIKA_ICON_TYPE_ICON_NAME,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_boxed ("icon-data",
"icon data",
"The procedure's icon. The format depends on the 'icon_type' parameter",
G_TYPE_BYTES,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-proc-documentation
*/
procedure = pika_procedure_new (pdb_set_proc_documentation_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-proc-documentation");
pika_procedure_set_static_help (procedure,
"Set the documentation for a plug-in procedure.",
"This procedure sets the documentation for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure for which to install the menu path",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("blurb",
"blurb",
"A short blurb",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("help",
"help",
"Detailed procedure help",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("help-id",
"help id",
"The procedure help_id",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-documentation
*/
procedure = pika_procedure_new (pdb_get_proc_documentation_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-documentation");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for documentation on the specified procedure.",
"This procedure returns documentation on the specified procedure. A short blurb, detailed help and help_id.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("blurb",
"blurb",
"A short blurb",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("help",
"help",
"Detailed procedure help",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("help-id",
"help id",
"The procedure help_id",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-proc-attribution
*/
procedure = pika_procedure_new (pdb_set_proc_attribution_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-proc-attribution");
pika_procedure_set_static_help (procedure,
"Set the attribution for a plug-in procedure.",
"This procedure sets the attribution for the given procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure for which to install the menu path",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("authors",
"authors",
"Authors of the procedure",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("copyright",
"copyright",
"The copyright",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("date",
"date",
"Copyright date",
FALSE, TRUE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-proc-attribution
*/
procedure = pika_procedure_new (pdb_get_proc_attribution_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-proc-attribution");
pika_procedure_set_static_help (procedure,
"Queries the procedural database for attribution information on the specified procedure.",
"This procedure returns attribution information on the specified procedure. The authors, copyright information and date are returned.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2019");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The procedure name",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("authors",
"authors",
"Authors of the procedure",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("copyright",
"copyright",
"The copyright",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
pika_param_spec_string ("date",
"date",
"Copyright date",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-load-handler
*/
procedure = pika_procedure_new (pdb_set_file_proc_load_handler_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-load-handler");
pika_procedure_set_static_help (procedure,
"Registers a file load handler procedure.",
"Registers a procedural database procedure to be called to load files of a particular file format using magic file information.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to be used for loading",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("extensions",
"extensions",
"comma separated list of extensions this handler can load (i.e. \"jpg,jpeg\")",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE | PIKA_PARAM_NO_VALIDATE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("prefixes",
"prefixes",
"comma separated list of prefixes this handler can load (i.e. \"http:,ftp:\")",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE | PIKA_PARAM_NO_VALIDATE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("magics",
"magics",
"comma separated list of magic file information this handler can load (i.e. \"0,string,GIF\")",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE | PIKA_PARAM_NO_VALIDATE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-save-handler
*/
procedure = pika_procedure_new (pdb_set_file_proc_save_handler_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-save-handler");
pika_procedure_set_static_help (procedure,
"Registers a file save handler procedure.",
"Registers a procedural database procedure to be called to save files in a particular file format.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to be used for saving",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("extensions",
"extensions",
"comma separated list of extensions this handler can save (i.e. \"jpg,jpeg\")",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE | PIKA_PARAM_NO_VALIDATE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("prefixes",
"prefixes",
"comma separated list of prefixes this handler can save (i.e. \"http:,ftp:\")",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE | PIKA_PARAM_NO_VALIDATE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-priority
*/
procedure = pika_procedure_new (pdb_set_file_proc_priority_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-priority");
pika_procedure_set_static_help (procedure,
"Sets the priority of a file handler procedure.",
"Sets the priority of a file handler procedure. When more than one procedure matches a given file, the procedure with the lowest priority is used; if more than one procedure has the lowest priority, it is unspecified which one of them is used. The default priority for file handler procedures is 0.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Ell",
"Ell",
"2018");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to set the priority of.",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_int ("priority",
"priority",
"The procedure priority.",
G_MININT32, G_MAXINT32, 0,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-mime-types
*/
procedure = pika_procedure_new (pdb_set_file_proc_mime_types_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-mime-types");
pika_procedure_set_static_help (procedure,
"Associates MIME types with a file handler procedure.",
"Registers MIME types for a file handler procedure. This allows PIKA to determine the MIME type of the file opened or saved using this procedure. It is recommended that only one MIME type is registered per file procedure; when registering more than one MIME type, PIKA will associate the first one with files opened or saved with this procedure.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Sven Neumann ",
"Sven Neumann",
"2004");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to associate a MIME type with.",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("mime-types",
"mime types",
"A comma-separated list of MIME types, such as \"image/jpeg\".",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-handles-remote
*/
procedure = pika_procedure_new (pdb_set_file_proc_handles_remote_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-handles-remote");
pika_procedure_set_static_help (procedure,
"Registers a file handler procedure as capable of handling remote URIs.",
"Registers a file handler procedure as capable of handling remote URIs. This allows PIKA to call the procedure directly for all kinds of URIs, not only on local file:// URIs.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2012");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to enable remote URIs for.",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-handles-raw
*/
procedure = pika_procedure_new (pdb_set_file_proc_handles_raw_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-handles-raw");
pika_procedure_set_static_help (procedure,
"Registers a file handler procedure as capable of handling raw camera files.",
"Registers a file handler procedure as capable of handling raw digital camera files. Use this procedure only to register raw load handlers, calling it on a save handler will generate an error.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Michael Natterer ",
"Michael Natterer",
"2017");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to enable raw handling for.",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-file-proc-thumbnail-loader
*/
procedure = pika_procedure_new (pdb_set_file_proc_thumbnail_loader_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-file-proc-thumbnail-loader");
pika_procedure_set_static_help (procedure,
"Associates a thumbnail loader with a file load procedure.",
"Some file formats allow for embedded thumbnails, other file formats contain a scalable image or provide the image data in different resolutions. A file plug-in for such a format may register a special procedure that allows PIKA to load a thumbnail preview of the image. This procedure is then associated with the standard load procedure using this function.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Sven Neumann ",
"Sven Neumann",
"2004");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("load-proc",
"load proc",
"The name of the file load procedure.",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("thumb-proc",
"thumb proc",
"The name of the thumbnail load procedure.",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-batch-interpreter
*/
procedure = pika_procedure_new (pdb_set_batch_interpreter_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-batch-interpreter");
pika_procedure_set_static_help (procedure,
"Registers a batch interpreter procedure.",
"Registers a procedural database procedure to be called with the command line interface options --batch-interpreter and --batch.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Jehan",
"Jehan",
"2022");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("procedure-name",
"procedure name",
"The name of the procedure to be used for running batch commands",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
pika_param_spec_string ("interpreter-name",
"interpreter name",
"A public-facing name for the interpreter, such as \"Python 3\".",
FALSE, FALSE, FALSE,
NULL,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-get-data
*/
procedure = pika_procedure_new (pdb_get_data_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-get-data");
pika_procedure_set_static_help (procedure,
"Returns data associated with the specified identifier.",
"This procedure returns any data which may have been associated with the specified identifier. The data is a variable length array of bytes. If no data has been associated with the identifier, an error is returned.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("identifier",
"identifier",
"The identifier associated with data",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_return_value (procedure,
g_param_spec_boxed ("data",
"data",
"A byte array containing data",
G_TYPE_BYTES,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* pika-pdb-set-data
*/
procedure = pika_procedure_new (pdb_set_data_invoker);
pika_object_set_static_name (PIKA_OBJECT (procedure),
"pika-pdb-set-data");
pika_procedure_set_static_help (procedure,
"Associates the specified identifier with the supplied data.",
"This procedure associates the supplied data with the provided identifier. The data may be subsequently retrieved by a call to 'procedural-db-get-data'.",
NULL);
pika_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997");
pika_procedure_add_argument (procedure,
pika_param_spec_string ("identifier",
"identifier",
"The identifier associated with data",
FALSE, FALSE, TRUE,
NULL,
PIKA_PARAM_READWRITE));
pika_procedure_add_argument (procedure,
g_param_spec_boxed ("data",
"data",
"A byte array containing data",
G_TYPE_BYTES,
PIKA_PARAM_READWRITE));
pika_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
}