2000-05-31 21:24:14 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2000-06-02 01:34:56 +08:00
|
|
|
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* gimpproceduraldb_pdb.c
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
2000-06-02 01:34:56 +08:00
|
|
|
* Lesser General Public License for more details.
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl */
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
|
|
|
void
|
2000-06-02 01:34:56 +08:00
|
|
|
gimp_procedural_db_dump (gchar *filename)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_dump",
|
2000-05-31 21:24:14 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, filename,
|
|
|
|
GIMP_PDB_END);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-06-02 01:34:56 +08:00
|
|
|
gimp_procedural_db_query (gchar *name,
|
|
|
|
gchar *blurb,
|
|
|
|
gchar *help,
|
|
|
|
gchar *author,
|
|
|
|
gchar *copyright,
|
|
|
|
gchar *date,
|
|
|
|
gchar *proc_type,
|
|
|
|
gint *num_matches,
|
2000-08-22 05:23:31 +08:00
|
|
|
gchar ***procedure_names)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint i;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_query",
|
2000-05-31 21:24:14 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_STRING, blurb,
|
|
|
|
GIMP_PDB_STRING, help,
|
|
|
|
GIMP_PDB_STRING, author,
|
|
|
|
GIMP_PDB_STRING, copyright,
|
|
|
|
GIMP_PDB_STRING, date,
|
|
|
|
GIMP_PDB_STRING, proc_type,
|
|
|
|
GIMP_PDB_END);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
*num_matches = 0;
|
2000-08-22 05:23:31 +08:00
|
|
|
*procedure_names = NULL;
|
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-06-02 01:34:56 +08:00
|
|
|
*num_matches = return_vals[1].data.d_int32;
|
2000-08-22 05:23:31 +08:00
|
|
|
*procedure_names = g_new (gchar *, *num_matches);
|
2000-06-02 01:34:56 +08:00
|
|
|
for (i = 0; i < *num_matches; i++)
|
2000-08-22 05:23:31 +08:00
|
|
|
(*procedure_names)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
void
|
2000-06-02 01:34:56 +08:00
|
|
|
_gimp_procedural_db_proc_info (gchar *procedure,
|
|
|
|
gchar **blurb,
|
|
|
|
gchar **help,
|
|
|
|
gchar **author,
|
|
|
|
gchar **copyright,
|
|
|
|
gchar **date,
|
|
|
|
GimpPDBProcType *proc_type,
|
|
|
|
gint *num_args,
|
|
|
|
gint *num_values)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_info",
|
2000-05-31 21:24:14 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, procedure,
|
|
|
|
GIMP_PDB_END);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
*blurb = NULL;
|
|
|
|
*help = NULL;
|
|
|
|
*author = NULL;
|
|
|
|
*copyright = NULL;
|
|
|
|
*date = NULL;
|
|
|
|
*proc_type = 0;
|
|
|
|
*num_args = 0;
|
|
|
|
*num_values = 0;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-06-02 01:34:56 +08:00
|
|
|
*blurb = g_strdup (return_vals[1].data.d_string);
|
|
|
|
*help = g_strdup (return_vals[2].data.d_string);
|
|
|
|
*author = g_strdup (return_vals[3].data.d_string);
|
|
|
|
*copyright = g_strdup (return_vals[4].data.d_string);
|
|
|
|
*date = g_strdup (return_vals[5].data.d_string);
|
|
|
|
*proc_type = return_vals[6].data.d_int32;
|
|
|
|
*num_args = return_vals[7].data.d_int32;
|
|
|
|
*num_values = return_vals[8].data.d_int32;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
void
|
|
|
|
_gimp_procedural_db_proc_arg (gchar *procedure,
|
|
|
|
gint arg_num,
|
|
|
|
GimpPDBArgType *arg_type,
|
|
|
|
gchar **arg_name,
|
|
|
|
gchar **arg_desc)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_arg",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, procedure,
|
|
|
|
GIMP_PDB_INT32, arg_num,
|
|
|
|
GIMP_PDB_END);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
|
|
|
*arg_type = 0;
|
|
|
|
*arg_name = NULL;
|
|
|
|
*arg_desc = NULL;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-06-02 01:34:56 +08:00
|
|
|
*arg_type = return_vals[1].data.d_int32;
|
|
|
|
*arg_name = g_strdup (return_vals[2].data.d_string);
|
|
|
|
*arg_desc = g_strdup (return_vals[3].data.d_string);
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
void
|
|
|
|
_gimp_procedural_db_proc_val (gchar *procedure,
|
|
|
|
gint val_num,
|
|
|
|
GimpPDBArgType *val_type,
|
|
|
|
gchar **val_name,
|
|
|
|
gchar **val_desc)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_proc_val",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, procedure,
|
|
|
|
GIMP_PDB_INT32, val_num,
|
|
|
|
GIMP_PDB_END);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
|
|
|
*val_type = 0;
|
|
|
|
*val_name = NULL;
|
|
|
|
*val_desc = NULL;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-06-02 01:34:56 +08:00
|
|
|
*val_type = return_vals[1].data.d_int32;
|
|
|
|
*val_name = g_strdup (return_vals[2].data.d_string);
|
|
|
|
*val_desc = g_strdup (return_vals[3].data.d_string);
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
void
|
|
|
|
_gimp_procedural_db_get_data (gchar *identifier,
|
|
|
|
gint *bytes,
|
|
|
|
guint8 **data)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_get_data",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, identifier,
|
|
|
|
GIMP_PDB_END);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
*bytes = 0;
|
|
|
|
*data = NULL;
|
2000-08-22 05:23:31 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-06-02 01:34:56 +08:00
|
|
|
*bytes = return_vals[1].data.d_int32;
|
|
|
|
*data = g_new (guint8, *bytes);
|
|
|
|
memcpy (*data, return_vals[2].data.d_int8array,
|
|
|
|
*bytes * sizeof (guint8));
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
gint
|
|
|
|
gimp_procedural_db_get_data_size (gchar *identifier)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint bytes = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_get_data_size",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, identifier,
|
|
|
|
GIMP_PDB_END);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-02 01:34:56 +08:00
|
|
|
bytes = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gimp_procedural_db_set_data (gchar *identifier,
|
|
|
|
gint bytes,
|
|
|
|
guint8 *data)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_procedural_db_set_data",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, identifier,
|
|
|
|
GIMP_PDB_INT32, bytes,
|
|
|
|
GIMP_PDB_INT8ARRAY, data,
|
|
|
|
GIMP_PDB_END);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|