Commit 5f7e2a8d authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Sven Neumann <sven@gimp.org> Simon Budig <Simon.Budig@unix-ag.org> Garry

2000-06-01  Michael Natterer  <mitch@gimp.org>
	    Sven Neumann  <sven@gimp.org>
	    Simon Budig  <Simon.Budig@unix-ag.org>
	    Garry R. Osgood  <gosgood@idt.net>
	    Seth Burgess <sjburges@gimp.org>

	* libgimp/gimpchannel_pdb.[ch]
	* libgimp/gimpproceduraldb_pdb.[ch]
	* libgimp/gimpunit_pdb.[ch]: replaced with code based on
	files generated using pdbgen

	* libgimp/Makefile.am
	* libgimp/gimp.h
	* libgimp/gimp_pdb.h
	* libgimp/gimpchannel.[ch]
	* libgimp/gimpproceduraldb.[ch]: new files wrapping around the
	autogenerated PDB wrappers as found in *_pdb.[ch].

	* libgimp/gimpselection_pdb.h: minor change.

	* tools/pdbgen/pdb/procedural_db.pdb: made it create libgimp code

	* plug-ins/gap/gap_filter_pdb.c
	* plug-ins/script-fu/script-fu-console.c
	* plug-ins/script-fu/script-fu.c
	* plug-ins/xjt/xpdb_calls.c: gimp_query_procedure's signature
	is typesafe now.
parent d7b24953
2000-06-01 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
Simon Budig <Simon.Budig@unix-ag.org>
Garry R. Osgood <gosgood@idt.net>
Seth Burgess <sjburges@gimp.org>
* libgimp/gimpchannel_pdb.[ch]
* libgimp/gimpproceduraldb_pdb.[ch]
* libgimp/gimpunit_pdb.[ch]: replaced with code based on
files generated using pdbgen
* libgimp/Makefile.am
* libgimp/gimp.h
* libgimp/gimp_pdb.h
* libgimp/gimpchannel.[ch]
* libgimp/gimpproceduraldb.[ch]: new files wrapping around the
autogenerated PDB wrappers as found in *_pdb.[ch].
* libgimp/gimpselection_pdb.h: minor change.
* tools/pdbgen/pdb/procedural_db.pdb: made it create libgimp code
* plug-ins/gap/gap_filter_pdb.c
* plug-ins/script-fu/script-fu-console.c
* plug-ins/script-fu/script-fu.c
* plug-ins/xjt/xpdb_calls.c: gimp_query_procedure's signature
is typesafe now.
2000-06-01 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
......
......@@ -149,6 +149,8 @@ libgimp_la_SOURCES = \
${PDB_WRAPPERS_H} \
gimpcolorspace.c \
gimpcolorspace.h \
gimpchannel.c \
gimpchannel.h \
gimpdrawable.c \
gimpdrawable.h \
gimpenv.c \
......@@ -169,6 +171,8 @@ libgimp_la_SOURCES = \
gimpparasiteio.h \
gimppixelrgn.c \
gimppixelrgn.h \
gimpproceduraldb.c \
gimpproceduraldb.h \
gimpprotocol.c \
gimpprotocol.h \
gimpselection.c \
......@@ -212,6 +216,7 @@ gimpinclude_HEADERS = \
gimp.h \
${PDB_WRAPPERS_H} \
gimpchainbutton.h \
gimpchannel.h \
gimpcolorbutton.h \
gimpcolordisplay.h \
gimpcolorselector.h \
......@@ -238,6 +243,7 @@ gimpinclude_HEADERS = \
gimppatheditor.h \
gimppixelrgn.h \
gimppixmap.h \
gimpproceduraldb.h \
gimpquerybox.h \
gimpselection.h \
gimpsignal.h \
......
......@@ -27,6 +27,7 @@
#include <libgimp/gimpenums.h>
#include <libgimp/gimptypes.h>
#include <libgimp/gimpchannel.h>
#include <libgimp/gimpcolorspace.h>
#include <libgimp/gimpdrawable.h>
#include <libgimp/gimpfeatures.h>
......@@ -38,6 +39,7 @@
#include <libgimp/gimpmath.h>
#include <libgimp/gimpparasite.h>
#include <libgimp/gimppixelrgn.h>
#include <libgimp/gimpproceduraldb.h>
#include <libgimp/gimpselection.h>
#include <libgimp/gimptile.h>
#include <libgimp/gimpunit.h>
......
......@@ -51,6 +51,6 @@
#include <libgimp/gimptexttool_pdb.h>
#include <libgimp/gimptools_pdb.h>
#include <libgimp/gimpundo_pdb.h>
#include <libgimp/gimpunit_pdb.h>
#endif /* __GIMP_PDB_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpchannel.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
* Library General Public License for more details.
*
* 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.
*/
#include "gimp.h"
gint32
gimp_channel_new (gint32 image_ID,
gchar *name,
guint width,
guint height,
gdouble opacity,
guchar *color)
{
return _gimp_channel_new (image_ID,
width,
height,
name,
opacity,
color[0],
color[1],
color[2]);
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpchannel.h
*
* 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
* Lesser General Public License for more details.
*
* 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.
*/
#ifndef __GIMP_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* For information look into the C source or the html documentation */
gint32 gimp_channel_new (gint32 image_ID,
gchar *name,
guint width,
guint height,
gdouble opacity,
guchar *color);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_CHANNEL_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpchannel_pdb.c
*
......@@ -11,7 +11,7 @@
* 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
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
......@@ -19,20 +19,28 @@
* Boston, MA 02111-1307, USA.
*/
#include "gimp.h"
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
gint32
gimp_channel_new (gint32 image_ID,
gchar *name,
guint width,
guint height,
gdouble opacity,
guchar *color)
_gimp_channel_new (gint32 image_ID,
gint width,
gint height,
gchar *name,
gdouble opacity,
guchar red,
guchar green,
guchar blue)
{
GParam *return_vals;
gint nreturn_vals;
gint32 channel_ID;
gint32 channel_ID = -1;
guchar color[3];
color[0] = red;
color[1] = green;
color[2] = blue;
return_vals = gimp_run_procedure ("gimp_channel_new",
&nreturn_vals,
......@@ -44,7 +52,6 @@ gimp_channel_new (gint32 image_ID,
PARAM_COLOR, color,
PARAM_END);
channel_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
channel_ID = return_vals[1].data.d_channel;
......@@ -58,19 +65,19 @@ gimp_channel_copy (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gint32 channel_copy_ID = -1;
return_vals = gimp_run_procedure ("gimp_channel_copy",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
channel_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
channel_ID = return_vals[1].data.d_channel;
channel_copy_ID = return_vals[1].data.d_channel;
gimp_destroy_params (return_vals, nreturn_vals);
return channel_ID;
return channel_copy_ID;
}
void
......@@ -87,43 +94,18 @@ gimp_channel_delete (gint32 channel_ID)
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_channel_get_color (gint32 channel_ID,
guchar *red,
guchar *green,
guchar *blue)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_get_color",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*red = return_vals[1].data.d_color.red;
*green = return_vals[1].data.d_color.green;
*blue = return_vals[1].data.d_color.blue;
}
gimp_destroy_params (return_vals, nreturn_vals);
}
gchar*
gchar *
gimp_channel_get_name (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gchar *name;
gchar *name = NULL;
return_vals = gimp_run_procedure ("gimp_channel_get_name",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
name = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
name = g_strdup (return_vals[1].data.d_string);
......@@ -132,40 +114,34 @@ gimp_channel_get_name (gint32 channel_ID)
return name;
}
gdouble
gimp_channel_get_opacity (gint32 channel_ID)
void
gimp_channel_set_name (gint32 channel_ID,
gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
gdouble opacity;
return_vals = gimp_run_procedure ("gimp_channel_get_opacity",
return_vals = gimp_run_procedure ("gimp_channel_set_name",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_STRING, name,
PARAM_END);
opacity = 0.0;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
opacity = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return opacity;
}
gboolean
gimp_channel_get_visible (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gboolean visible;
GParam *return_vals;
gint nreturn_vals;
gboolean visible = FALSE;
return_vals = gimp_run_procedure ("gimp_channel_get_visible",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
visible = FALSE;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
visible = return_vals[1].data.d_int32;
......@@ -175,131 +151,175 @@ gimp_channel_get_visible (gint32 channel_ID)
}
void
gimp_channel_set_color (gint32 channel_ID,
guchar red,
guchar green,
guchar blue)
gimp_channel_set_visible (gint32 channel_ID,
gboolean visible)
{
GParam *return_vals;
gint nreturn_vals;
guchar color[3];
color[0] = red;
color[1] = green;
color[2] = blue;
return_vals = gimp_run_procedure ("gimp_channel_set_visible",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_INT32, visible,
PARAM_END);
return_vals = gimp_run_procedure ("gimp_channel_set_color",
gimp_destroy_params (return_vals, nreturn_vals);
}
gboolean
gimp_channel_get_show_masked (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gboolean show_masked = FALSE;
return_vals = gimp_run_procedure ("gimp_channel_get_show_masked",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_COLOR, color,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
show_masked = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return show_masked;
}
void
gimp_channel_set_name (gint32 channel_ID,
gchar *name)
gimp_channel_set_show_masked (gint32 channel_ID,
gboolean show_masked)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_name",
return_vals = gimp_run_procedure ("gimp_channel_set_show_masked",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_STRING, name,
PARAM_INT32, show_masked,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity)
gdouble
gimp_channel_get_opacity (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gdouble opacity = 0;
return_vals = gimp_run_procedure ("gimp_channel_set_opacity",
return_vals = gimp_run_procedure ("gimp_channel_get_opacity",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_FLOAT, opacity,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
opacity = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return opacity;
}
void
gimp_channel_set_visible (gint32 channel_ID,
gboolean visible)
gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_visible",
return_vals = gimp_run_procedure ("gimp_channel_set_opacity",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_INT32, visible,
PARAM_FLOAT, opacity,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
gint
gimp_channel_get_show_masked (gint32 channel_ID)
void
gimp_channel_get_color (gint32 channel_ID,
guchar *red,
guchar *green,
guchar *blue)
{
GParam *return_vals;
gint nreturn_vals;
gint show_masked;
return_vals = gimp_run_procedure ("gimp_channel_get_show_masked",
return_vals = gimp_run_procedure ("gimp_channel_get_color",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
show_masked = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
show_masked = return_vals[1].data.d_int32;
{
*red = return_vals[1].data.d_color.red;
*green = return_vals[1].data.d_color.green;
*blue = return_vals[1].data.d_color.blue;
}
gimp_destroy_params (return_vals, nreturn_vals);
return show_masked;
}
void
gimp_channel_set_show_masked (gint32 channel_ID,
gint show_masked)
gimp_channel_set_color (gint32 channel_ID,
guchar red,
guchar green,
guchar blue)
{
GParam *return_vals;
gint nreturn_vals;
guchar color[3];
return_vals = gimp_run_procedure ("gimp_channel_set_show_masked",
color[0] = red;
color[1] = green;
color[2] = blue;
return_vals = gimp_run_procedure ("gimp_channel_set_color",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_INT32, show_masked,
PARAM_COLOR, color,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
gint32
gint
gimp_channel_get_tattoo (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gint tattoo;
gint tattoo = 0;
return_vals = gimp_run_procedure ("gimp_channel_get_tattoo",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
tattoo = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
tattoo = return_vals[1].data.d_int32;
tattoo = return_vals[1].data.d_tattoo;
gimp_destroy_params (return_vals, nreturn_vals);
return tattoo;
}
void
gimp_channel_set_tattoo (gint32 channel_ID,
gint tattoo)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_tattoo",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_INT32, tattoo,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpchannel_pdb.h
*
......@@ -7,17 +7,19 @@
* 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
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* 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.
*/
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_CHANNEL_PDB_H__
#define __GIMP_CHANNEL_PDB_H__
......@@ -29,35 +31,39 @@ extern "C" {
/* For information look into the C source or the html documentation */
gint32 gimp_channel_new (gint32 image_ID,
gchar *name,
guint width,
guint height,
gdouble opacity,
guchar *color);
gint32 gimp_channel_copy (gint32 channel_ID);
void gimp_channel_delete (gint32 channel_ID);
void gimp_channel_get_color (gint32 channel_ID,
guchar *red,
guchar *green,
guchar *blue);
gchar * gimp_channel_get_name (gint32 channel_ID);
gdouble gimp_channel_get_opacity (gint32 channel_ID);
gint gimp_channel_get_show_masked (gint32 channel_ID);
gboolean gimp_channel_get_visible (gint32 channel_ID);
void gimp_channel_set_color (gint32 channel_ID,
guchar red,
guchar green,
guchar blue);
void gimp_channel_set_name (gint32 channel_ID,
gchar *name);
void gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity);
void gimp_channel_set_show_masked (gint32 channel_ID,
gint show_masked);
void gimp_channel_set_visible (gint32 channel_ID,
gboolean visible);
gint32 gimp_channel_get_tattoo (gint32 channel_ID);
gint32 _gimp_channel_new (gint32 image_ID,
gint width,
gint height,
gchar *name,
gdouble opacity,
guchar red,
guchar green,
guchar blue);
gint32 gimp_channel_copy (gint32 channel_ID);
void gimp_channel_delete (gint32 channel_ID);
gchar* gimp_channel_get_name (gint32 channel_ID);
void gimp_channel_set_name (gint32 channel_ID,
gchar *name);
gboolean gimp_channel_get_visible (gint32 channel_ID);
void gimp_channel_set_visible (gint32 channel_ID,
gboolean visible);
gboolean gimp_channel_get_show_masked (gint32 channel_ID);
void gimp_channel_set_show_masked (gint32 channel_ID,
gboolean show_masked);
gdouble gimp_channel_get_opacity (gint32 channel_ID);
void gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity);
void gimp_channel_get_color (gint32 channel_ID,
guchar *red,
guchar *green,
guchar *blue);
void gimp_channel_set_color (gint32 channel_ID,
guchar red,
guchar green,
guchar blue);
gint gimp_channel_get_tattoo (gint32 channel_ID);
void gimp_channel_set_tattoo (gint32 channel_ID,
gint tattoo);
#ifdef __cplusplus
......
......@@ -63,31 +63,31 @@ typedef struct
GtkWidget *scrolled_win;
/* the currently selected procedure */
gchar *selected_proc_name;
gchar *selected_scheme_proc_name;
gchar *selected_proc_blurb;
gchar *selected_proc_help;
gchar *selected_proc_author;
gchar *selected_proc_copyright;
gchar *selected_proc_date;
gint selected_proc_type;
gint selected_nparams;
gint selected_nreturn_vals;
GParamDef *selected_params;
GParamDef *selected_return_vals;
void (* apply_callback) (gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
gchar *selected_proc_help,
gchar *selected_proc_author,
gchar *selected_proc_copyright,
gchar *selected_proc_date,
gint selected_proc_type,
gint selected_nparams,
gint selected_nreturn_vals,
GParamDef</