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> 2000-06-01 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org> Sven Neumann <sven@gimp.org>
......
...@@ -149,6 +149,8 @@ libgimp_la_SOURCES = \ ...@@ -149,6 +149,8 @@ libgimp_la_SOURCES = \
${PDB_WRAPPERS_H} \ ${PDB_WRAPPERS_H} \
gimpcolorspace.c \ gimpcolorspace.c \
gimpcolorspace.h \ gimpcolorspace.h \
gimpchannel.c \
gimpchannel.h \
gimpdrawable.c \ gimpdrawable.c \
gimpdrawable.h \ gimpdrawable.h \
gimpenv.c \ gimpenv.c \
...@@ -169,6 +171,8 @@ libgimp_la_SOURCES = \ ...@@ -169,6 +171,8 @@ libgimp_la_SOURCES = \
gimpparasiteio.h \ gimpparasiteio.h \
gimppixelrgn.c \ gimppixelrgn.c \
gimppixelrgn.h \ gimppixelrgn.h \
gimpproceduraldb.c \
gimpproceduraldb.h \
gimpprotocol.c \ gimpprotocol.c \
gimpprotocol.h \ gimpprotocol.h \
gimpselection.c \ gimpselection.c \
...@@ -212,6 +216,7 @@ gimpinclude_HEADERS = \ ...@@ -212,6 +216,7 @@ gimpinclude_HEADERS = \
gimp.h \ gimp.h \
${PDB_WRAPPERS_H} \ ${PDB_WRAPPERS_H} \
gimpchainbutton.h \ gimpchainbutton.h \
gimpchannel.h \
gimpcolorbutton.h \ gimpcolorbutton.h \
gimpcolordisplay.h \ gimpcolordisplay.h \
gimpcolorselector.h \ gimpcolorselector.h \
...@@ -238,6 +243,7 @@ gimpinclude_HEADERS = \ ...@@ -238,6 +243,7 @@ gimpinclude_HEADERS = \
gimppatheditor.h \ gimppatheditor.h \
gimppixelrgn.h \ gimppixelrgn.h \
gimppixmap.h \ gimppixmap.h \
gimpproceduraldb.h \
gimpquerybox.h \ gimpquerybox.h \
gimpselection.h \ gimpselection.h \
gimpsignal.h \ gimpsignal.h \
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <libgimp/gimpenums.h> #include <libgimp/gimpenums.h>
#include <libgimp/gimptypes.h> #include <libgimp/gimptypes.h>
#include <libgimp/gimpchannel.h>
#include <libgimp/gimpcolorspace.h> #include <libgimp/gimpcolorspace.h>
#include <libgimp/gimpdrawable.h> #include <libgimp/gimpdrawable.h>
#include <libgimp/gimpfeatures.h> #include <libgimp/gimpfeatures.h>
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
#include <libgimp/gimpmath.h> #include <libgimp/gimpmath.h>
#include <libgimp/gimpparasite.h> #include <libgimp/gimpparasite.h>
#include <libgimp/gimppixelrgn.h> #include <libgimp/gimppixelrgn.h>
#include <libgimp/gimpproceduraldb.h>
#include <libgimp/gimpselection.h> #include <libgimp/gimpselection.h>
#include <libgimp/gimptile.h> #include <libgimp/gimptile.h>
#include <libgimp/gimpunit.h> #include <libgimp/gimpunit.h>
......
...@@ -51,6 +51,6 @@ ...@@ -51,6 +51,6 @@
#include <libgimp/gimptexttool_pdb.h> #include <libgimp/gimptexttool_pdb.h>
#include <libgimp/gimptools_pdb.h> #include <libgimp/gimptools_pdb.h>
#include <libgimp/gimpundo_pdb.h> #include <libgimp/gimpundo_pdb.h>
#include <libgimp/gimpunit_pdb.h>
#endif /* __GIMP_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 /* 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 * gimpchannel_pdb.c
* *
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 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 * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the * License along with this library; if not, write to the
...@@ -19,20 +19,28 @@ ...@@ -19,20 +19,28 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "gimp.h" /* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
gint32 gint32
gimp_channel_new (gint32 image_ID, _gimp_channel_new (gint32 image_ID,
gchar *name, gint width,
guint width, gint height,
guint height, gchar *name,
gdouble opacity, gdouble opacity,
guchar *color) guchar red,
guchar green,
guchar blue)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_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", return_vals = gimp_run_procedure ("gimp_channel_new",
&nreturn_vals, &nreturn_vals,
...@@ -44,7 +52,6 @@ gimp_channel_new (gint32 image_ID, ...@@ -44,7 +52,6 @@ gimp_channel_new (gint32 image_ID,
PARAM_COLOR, color, PARAM_COLOR, color,
PARAM_END); PARAM_END);
channel_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS) if (return_vals[0].data.d_status == STATUS_SUCCESS)
channel_ID = return_vals[1].data.d_channel; channel_ID = return_vals[1].data.d_channel;
...@@ -58,19 +65,19 @@ gimp_channel_copy (gint32 channel_ID) ...@@ -58,19 +65,19 @@ gimp_channel_copy (gint32 channel_ID)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gint32 channel_copy_ID = -1;
return_vals = gimp_run_procedure ("gimp_channel_copy", return_vals = gimp_run_procedure ("gimp_channel_copy",
&nreturn_vals, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_END); PARAM_END);
channel_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS) 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); gimp_destroy_params (return_vals, nreturn_vals);
return channel_ID; return channel_copy_ID;
} }
void void
...@@ -87,43 +94,18 @@ gimp_channel_delete (gint32 channel_ID) ...@@ -87,43 +94,18 @@ gimp_channel_delete (gint32 channel_ID)
gimp_destroy_params (return_vals, nreturn_vals); gimp_destroy_params (return_vals, nreturn_vals);
} }
void gchar *
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*
gimp_channel_get_name (gint32 channel_ID) gimp_channel_get_name (gint32 channel_ID)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gchar *name; gchar *name = NULL;
return_vals = gimp_run_procedure ("gimp_channel_get_name", return_vals = gimp_run_procedure ("gimp_channel_get_name",
&nreturn_vals, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_END); PARAM_END);
name = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS) if (return_vals[0].data.d_status == STATUS_SUCCESS)
name = g_strdup (return_vals[1].data.d_string); name = g_strdup (return_vals[1].data.d_string);
...@@ -132,40 +114,34 @@ gimp_channel_get_name (gint32 channel_ID) ...@@ -132,40 +114,34 @@ gimp_channel_get_name (gint32 channel_ID)
return name; return name;
} }
gdouble void
gimp_channel_get_opacity (gint32 channel_ID) gimp_channel_set_name (gint32 channel_ID,
gchar *name)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_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, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_STRING, name,
PARAM_END); 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); gimp_destroy_params (return_vals, nreturn_vals);
return opacity;
} }
gboolean gboolean
gimp_channel_get_visible (gint32 channel_ID) gimp_channel_get_visible (gint32 channel_ID)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gboolean visible; gboolean visible = FALSE;
return_vals = gimp_run_procedure ("gimp_channel_get_visible", return_vals = gimp_run_procedure ("gimp_channel_get_visible",
&nreturn_vals, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_END); PARAM_END);
visible = FALSE;
if (return_vals[0].data.d_status == STATUS_SUCCESS) if (return_vals[0].data.d_status == STATUS_SUCCESS)
visible = return_vals[1].data.d_int32; visible = return_vals[1].data.d_int32;
...@@ -175,131 +151,175 @@ gimp_channel_get_visible (gint32 channel_ID) ...@@ -175,131 +151,175 @@ gimp_channel_get_visible (gint32 channel_ID)
} }
void void
gimp_channel_set_color (gint32 channel_ID, gimp_channel_set_visible (gint32 channel_ID,
guchar red, gboolean visible)
guchar green,
guchar blue)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
guchar color[3];
color[0] = red; return_vals = gimp_run_procedure ("gimp_channel_set_visible",
color[1] = green; &nreturn_vals,
color[2] = blue; 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, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_COLOR, color,
PARAM_END); 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); gimp_destroy_params (return_vals, nreturn_vals);
return show_masked;
} }
void void
gimp_channel_set_name (gint32 channel_ID, gimp_channel_set_show_masked (gint32 channel_ID,
gchar *name) gboolean show_masked)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_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, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_STRING, name, PARAM_INT32, show_masked,
PARAM_END); PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals); gimp_destroy_params (return_vals, nreturn_vals);
} }
void gdouble
gimp_channel_set_opacity (gint32 channel_ID, gimp_channel_get_opacity (gint32 channel_ID)
gdouble opacity)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_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, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_FLOAT, opacity,
PARAM_END); 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); gimp_destroy_params (return_vals, nreturn_vals);
return opacity;
} }
void void
gimp_channel_set_visible (gint32 channel_ID, gimp_channel_set_opacity (gint32 channel_ID,
gboolean visible) gdouble opacity)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_visible", return_vals = gimp_run_procedure ("gimp_channel_set_opacity",
&nreturn_vals, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_INT32, visible, PARAM_FLOAT, opacity,
PARAM_END); PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals); gimp_destroy_params (return_vals, nreturn_vals);
} }
gint void
gimp_channel_get_show_masked (gint32 channel_ID) gimp_channel_get_color (gint32 channel_ID,
guchar *red,
guchar *green,
guchar *blue)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_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, &nreturn_vals,
PARAM_CHANNEL, channel_ID, PARAM_CHANNEL, channel_ID,
PARAM_END); PARAM_END);
show_masked = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS) 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); gimp_destroy_params (return_vals, nreturn_vals);
return show_masked;
} }
void void
gimp_channel_set_show_masked (gint32 channel_ID, gimp_channel_set_color (gint32 channel_ID,
gint show_masked) guchar red,
guchar green,
guchar blue)
{ {
GParam *return_vals; GParam *return_vals;
gint nreturn_vals; gint nreturn_vals;