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>
	    Tuomas Kuosmanen <tigert@gimp.org>
	    Tor Lillqvist <tml@iki.fi>
	    Andy Thomas <alt@gimp.org>
	    Andreas Bogk <andreas@andreas.org>
	    Vincent Kolwitz <vincent@andreas.org>

	The remaining bits ...

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl
	* tools/pdbgen/pdb/gradient.pdb  -> gradients.pdb

	* app/Makefile.am
	* app/gradient_cmds.c  -> gradients_cmds.c

	* libgimp/gimpbrushes_pdb.[ch]
	* libgimp/gimpfileops_pdb.[ch]
	* libgimp/gimpguides_pdb.[ch]
	* libgimp/gimphelp_pdb.[ch]
	* libgimp/gimpmessage_pdb.[ch]
	* libgimp/gimpparasite_pdb.[ch]
	* libgimp/gimppatterns_pdb.[ch]
	* libgimp/gimpplugin_pdb.[ch]: replaced with code based on
	files generated using pdbgen

	* libgimp/gimpbrushmenu.c
	* libgimp/gimppatternmenu.c:
	reflect changes in gimp[brushes|patterns]_pdb.[ch]

	* tools/pdbgen/pdb/gradient.pdb  -> gradients.pdb

	* tools/pdbgen/pdb/plug_in.pdb: made it create libgimp code
This commit is contained in:
Michael Natterer
2000-06-01 21:18:04 +00:00
committed by Michael Natterer
parent 5f7e2a8d1c
commit db71b6e0e1
31 changed files with 841 additions and 515 deletions

View File

@ -3,6 +3,45 @@
Simon Budig <Simon.Budig@unix-ag.org>
Garry R. Osgood <gosgood@idt.net>
Seth Burgess <sjburges@gimp.org>
Tuomas Kuosmanen <tigert@gimp.org>
Tor Lillqvist <tml@iki.fi>
Andy Thomas <alt@gimp.org>
Andreas Bogk <andreas@andreas.org>
Vincent Kolwitz <vincent@andreas.org>
The remaining bits ...
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl
* tools/pdbgen/pdb/gradient.pdb -> gradients.pdb
* app/Makefile.am
* app/gradient_cmds.c -> gradients_cmds.c
* libgimp/gimpbrushes_pdb.[ch]
* libgimp/gimpfileops_pdb.[ch]
* libgimp/gimpguides_pdb.[ch]
* libgimp/gimphelp_pdb.[ch]
* libgimp/gimpmessage_pdb.[ch]
* libgimp/gimpparasite_pdb.[ch]
* libgimp/gimppatterns_pdb.[ch]
* libgimp/gimpplugin_pdb.[ch]: replaced with code based on
files generated using pdbgen
* libgimp/gimpbrushmenu.c
* libgimp/gimppatternmenu.c:
reflect changes in gimp[brushes|patterns]_pdb.[ch]
* tools/pdbgen/pdb/gradient.pdb -> gradients.pdb
* tools/pdbgen/pdb/plug_in.pdb: made it create libgimp code
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>
Tor Lillqvist <tml@iki.fi>
* libgimp/gimpchannel_pdb.[ch]
* libgimp/gimpproceduraldb_pdb.[ch]

View File

@ -227,7 +227,7 @@ gimp_SOURCES = \
gradient_select.c \
gradient_select_cmds.c \
gradient.h \
gradient_cmds.c \
gradients_cmds.c \
gtkwrapbox.c \
gtkwrapbox.h \
gtkhwrapbox.c \

381
app/gradients_cmds.c Normal file
View File

@ -0,0 +1,381 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2000 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 2 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, 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. */
#include "procedural_db.h"
#include "gimpcontext.h"
#include "gradient_header.h"
static ProcRecord gradients_get_list_proc;
static ProcRecord gradients_get_active_proc;
static ProcRecord gradients_set_active_proc;
static ProcRecord gradients_sample_uniform_proc;
static ProcRecord gradients_sample_custom_proc;
void
register_gradients_procs (void)
{
procedural_db_register (&gradients_get_list_proc);
procedural_db_register (&gradients_get_active_proc);
procedural_db_register (&gradients_set_active_proc);
procedural_db_register (&gradients_sample_uniform_proc);
procedural_db_register (&gradients_sample_custom_proc);
}
static Argument *
gradients_get_list_invoker (Argument *args)
{
gboolean success;
Argument *return_args;
gchar **gradients;
gradient_t *grad;
GSList *list;
int i = 0;
gradients = g_new (gchar *, num_gradients);
success = (list = gradients_list) != NULL;
while (list)
{
grad = list->data;
gradients[i++] = g_strdup (grad->name);
list = list->next;
}
return_args = procedural_db_return_args (&gradients_get_list_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_gradients;
return_args[2].value.pdb_pointer = gradients;
}
return return_args;
}
static ProcArg gradients_get_list_outargs[] =
{
{
PDB_INT32,
"num_gradients",
"The number of loaded gradients"
},
{
PDB_STRINGARRAY,
"gradient_names",
"The list of gradient names"
}
};
static ProcRecord gradients_get_list_proc =
{
"gimp_gradients_get_list",
"Retrieve the list of loaded gradients.",
"This procedure returns a list of the gradients that are currently loaded in the gradient editor. You can later use the gimp_gradients_set_active function to set the active gradient.",
"Federico Mena Quintero",
"Federico Mena Quintero",
"1997",
PDB_INTERNAL,
0,
NULL,
2,
gradients_get_list_outargs,
{ { gradients_get_list_invoker } }
};
static Argument *
gradients_get_active_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
success = gimp_context_get_gradient (NULL) != NULL;
return_args = procedural_db_return_args (&gradients_get_active_proc, success);
if (success)
return_args[1].value.pdb_pointer = g_strdup (gimp_context_get_gradient (NULL)->name);
return return_args;
}
static ProcArg gradients_get_active_outargs[] =
{
{
PDB_STRING,
"name",
"The name of the active gradient"
}
};
static ProcRecord gradients_get_active_proc =
{
"gimp_gradients_get_active",
"Retrieve the name of the active gradient.",
"This procedure returns the name of the active gradient in the gradient editor.",
"Federico Mena Quintero",
"Federico Mena Quintero",
"1997",
PDB_INTERNAL,
0,
NULL,
1,
gradients_get_active_outargs,
{ { gradients_get_active_invoker } }
};
static Argument *
gradients_set_active_invoker (Argument *args)
{
gboolean success = TRUE;
gchar *name;
gradient_t *gradient;
name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL)
success = FALSE;
if (success)
{
gradient = gradient_list_get_gradient (gradients_list, name);
success = FALSE;
if (gradient)
{
gimp_context_set_gradient (NULL, gradient);
success = TRUE;
}
}
return procedural_db_return_args (&gradients_set_active_proc, success);
}
static ProcArg gradients_set_active_inargs[] =
{
{
PDB_STRING,
"name",
"The name of the gradient to set"
}
};
static ProcRecord gradients_set_active_proc =
{
"gimp_gradients_set_active",
"Sets the specified gradient as the active gradient.",
"This procedure lets you set the specified gradient as the active or \"current\" one. The name is simply a string which corresponds to one of the loaded gradients in the gradient editor. If no matching gradient is found, this procedure will return an error. Otherwise, the specified gradient will become active and will be used for subsequent custom gradient operations.",
"Federico Mena Quintero",
"Federico Mena Quintero",
"1997",
PDB_INTERNAL,
1,
gradients_set_active_inargs,
0,
NULL,
{ { gradients_set_active_invoker } }
};
static Argument *
gradients_sample_uniform_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gint32 i;
gint32 array_length = 0;
gdouble *color_samples = NULL;
gradient_t *gradient;
gdouble pos, delta;
gdouble r, g, b, a;
gdouble *pv;
i = args[0].value.pdb_int;
if (i < 2)
success = FALSE;
if (success)
{
pos = 0.0;
delta = 1.0 / (i - 1);
array_length = i * 4;
pv = color_samples = g_new (gdouble, array_length);
gradient = gimp_context_get_gradient (NULL);
while (i--)
{
gradient_get_color_at (gradient, pos, &r, &g, &b, &a);
*pv++ = r;
*pv++ = g;
*pv++ = b;
*pv++ = a;
pos += delta;
}
}
return_args = procedural_db_return_args (&gradients_sample_uniform_proc, success);
if (success)
{
return_args[1].value.pdb_int = array_length;
return_args[2].value.pdb_pointer = color_samples;
}
return return_args;
}
static ProcArg gradients_sample_uniform_inargs[] =
{
{
PDB_INT32,
"num_samples",
"The number of samples to take"
}
};
static ProcArg gradients_sample_uniform_outargs[] =
{
{
PDB_INT32,
"array_length",
"Length of the color_samples array (4 * num_samples)"
},
{
PDB_FLOATARRAY,
"color_samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }"
}
};
static ProcRecord gradients_sample_uniform_proc =
{
"gimp_gradients_sample_uniform",
"Sample the active gradient in uniform parts.",
"This procedure samples the active gradient from the gradient editor in the specified number of uniform parts. It returns a list of floating-point values which correspond to the RGBA values for each sample. The minimum number of samples to take is 2, in which case the returned colors will correspond to the { 0.0, 1.0 } positions in the gradient. For example, if the number of samples is 3, the procedure will return the colors at positions { 0.0, 0.5, 1.0 }.",
"Federico Mena Quintero",
"Federico Mena Quintero",
"1997",
PDB_INTERNAL,
1,
gradients_sample_uniform_inargs,
2,
gradients_sample_uniform_outargs,
{ { gradients_sample_uniform_invoker } }
};
static Argument *
gradients_sample_custom_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gint32 i;
gdouble *pos;
gint32 array_length = 0;
gdouble *color_samples = NULL;
gradient_t *gradient;
gdouble r, g, b, a;
gdouble *pv;
i = args[0].value.pdb_int;
if (i <= 0)
success = FALSE;
pos = (gdouble *) args[1].value.pdb_pointer;
if (success)
{
array_length = i * 4;
pv = color_samples = g_new (gdouble, array_length);
gradient = gimp_context_get_gradient (NULL);
while (i--)
{
gradient_get_color_at (gradient, *pos, &r, &g, &b, &a);
*pv++ = r;
*pv++ = g;
*pv++ = b;
*pv++ = a;
pos++;
}
}
return_args = procedural_db_return_args (&gradients_sample_custom_proc, success);
if (success)
{
return_args[1].value.pdb_int = array_length;
return_args[2].value.pdb_pointer = color_samples;
}
return return_args;
}
static ProcArg gradients_sample_custom_inargs[] =
{
{
PDB_INT32,
"num_samples",
"The number of samples to take"
},
{
PDB_FLOATARRAY,
"positions",
"The list of positions to sample along the gradient"
}
};
static ProcArg gradients_sample_custom_outargs[] =
{
{
PDB_INT32,
"array_length",
"Length of the color_samples array (4 * num_samples)"
},
{
PDB_FLOATARRAY,
"color_samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }"
}
};
static ProcRecord gradients_sample_custom_proc =
{
"gimp_gradients_sample_custom",
"Sample the active gradient in custom positions.",
"This procedure samples the active gradient from the gradient editor in the specified number of points. The procedure will sample the gradient in the specified positions from the list. The left endpoint of the gradient corresponds to position 0.0, and the right endpoint corresponds to 1.0. The procedure returns a list of floating-point values which correspond to the RGBA values for each sample.",
"Federico Mena Quintero",
"Federico Mena Quintero",
"1997",
PDB_INTERNAL,
2,
gradients_sample_custom_inargs,
2,
gradients_sample_custom_outargs,
{ { gradients_sample_custom_invoker } }
};

View File

@ -39,7 +39,7 @@ void register_edit_procs (void);
void register_fileops_procs (void);
void register_floating_sel_procs (void);
void register_gimprc_procs (void);
void register_gradient_procs (void);
void register_gradients_procs (void);
void register_gradient_select_procs (void);
void register_guides_procs (void);
void register_help_procs (void);
@ -102,7 +102,7 @@ internal_procs_init (void)
register_gimprc_procs ();
app_init_update_status (NULL, _("Gradients"), 0.292);
register_gradient_procs ();
register_gradients_procs ();
app_init_update_status (NULL, _("Gradient UI"), 0.307);
register_gradient_select_procs ();

View File

@ -37,7 +37,7 @@ PDB_WRAPPERS_C = \
gimpfileops_pdb.c \
gimpfloatingsel_pdb.c \
gimpgimprc_pdb.c \
gimpgradient_pdb.c \
gimpgradients_pdb.c \
gimpgradientselect_pdb.c \
gimpguides_pdb.c \
gimphelp_pdb.c \
@ -70,7 +70,7 @@ PDB_WRAPPERS_H = \
gimpfileops_pdb.h \
gimpfloatingsel_pdb.h \
gimpgimprc_pdb.h \
gimpgradient_pdb.h \
gimpgradients_pdb.h \
gimpgradientselect_pdb.h \
gimpguides_pdb.h \
gimphelp_pdb.h \

View File

@ -82,6 +82,8 @@ extern "C" {
#define gimp_drawable_image_id gimp_drawable_image
#define gimp_drawable_bpp gimp_drawable_bytes
#define gimp_channel_get_image_id gimp_drawable_image
#define gimp_layer_get_mask_id gimp_layer_mask
#define gimp_layer_get_image_id gimp_drawable_image
#define gimp_layer_is_floating_selection gimp_layer_is_floating_sel

View File

@ -34,7 +34,7 @@
#include <libgimp/gimpfileops_pdb.h>
#include <libgimp/gimpfloatingsel_pdb.h>
#include <libgimp/gimpgimprc_pdb.h>
#include <libgimp/gimpgradient_pdb.h>
#include <libgimp/gimpgradients_pdb.h>
#include <libgimp/gimpgradientselect_pdb.h>
#include <libgimp/gimpguides_pdb.h>
#include <libgimp/gimphelp_pdb.h>

View File

@ -28,18 +28,22 @@ gimp_brushes_get_brush_data (gchar *brush_name,
GimpLayerModeEffects *paint_mode,
gint *width,
gint *height,
gint *mask_data_size,
guint8 **mask_data)
{
GParam *return_vals;
gint nreturn_vals;
gint num_mask_data;
return_vals = gimp_run_procedure ("gimp_brushes_get_brush_data",
&nreturn_vals,
PARAM_STRING, brush_name,
PARAM_END);
brush_name = NULL;
brush_name = NULL;
*width = 0;
*height = 0;
*mask_data_size = 0;
*mask_data = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
brush_name = g_strdup (return_vals[1].data.d_string);
@ -48,10 +52,10 @@ gimp_brushes_get_brush_data (gchar *brush_name,
*paint_mode = return_vals[4].data.d_int32;
*width = return_vals[5].data.d_int32;
*height = return_vals[6].data.d_int32;
num_mask_data = return_vals[7].data.d_int32;
*mask_data = g_new (guint8, num_mask_data);
*mask_data_size = return_vals[7].data.d_int32;
*mask_data = g_new (guint8, *mask_data_size);
memcpy (*mask_data, return_vals[8].data.d_int8array,
num_mask_data * sizeof (guint8));
*mask_data_size * sizeof (guint8));
}
gimp_destroy_params (return_vals, nreturn_vals);

View File

@ -37,6 +37,7 @@ gchar* gimp_brushes_get_brush_data (gchar *brush_name,
GimpLayerModeEffects *paint_mode,
gint *width,
gint *height,
gint *mask_data_size,
guint8 **mask_data);

View File

@ -270,7 +270,7 @@ brush_select_invoker (gchar *name,
bsel->height = height;
mask_d_sz = width * height;
bsel->mask_data = g_malloc (mask_d_sz);
g_memmove(bsel->mask_data, mask_data, mask_d_sz);
g_memmove (bsel->mask_data, mask_data, mask_d_sz);
brush_pre_update (bsel->brush_preview,
bsel->width, bsel->height, bsel->mask_data);
@ -326,6 +326,7 @@ gimp_brush_select_widget (gchar *dname,
gint init_spacing;
GimpLayerModeEffects init_paint_mode;
gdouble init_opacity;
gint mask_data_size;
guint8 *mask_data;
gchar *brush_name;
BSelect *bsel;
@ -366,6 +367,7 @@ gimp_brush_select_widget (gchar *dname,
&init_paint_mode,
&width,
&height,
&mask_data_size,
&mask_data);
if (brush_name)
{
@ -431,6 +433,7 @@ gimp_brush_select_widget_set_popup (GtkWidget *widget,
gint init_spacing;
GimpLayerModeEffects init_paint_mode;
gdouble init_opacity;
gint *mask_data_size;
guint8 *mask_data;
gchar *brush_name;
BSelect *bsel;
@ -445,6 +448,7 @@ gimp_brush_select_widget_set_popup (GtkWidget *widget,
&init_paint_mode,
&width,
&height,
&mask_data_size,
&mask_data);
if (opacity == -1.0)

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpfileops_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,21 +19,22 @@
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
void
gimp_register_magic_load_handler (gchar *name,
gimp_register_magic_load_handler (gchar *procedure_name,
gchar *extensions,
gchar *prefixes,
gchar *magics)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_register_magic_load_handler",
&nreturn_vals,
PARAM_STRING, name,
PARAM_STRING, procedure_name,
PARAM_STRING, extensions,
PARAM_STRING, prefixes,
PARAM_STRING, magics,
@ -43,16 +44,16 @@ gimp_register_magic_load_handler (gchar *name,
}
void
gimp_register_load_handler (gchar *name,
gimp_register_load_handler (gchar *procedure_name,
gchar *extensions,
gchar *prefixes)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_register_load_handler",
&nreturn_vals,
PARAM_STRING, name,
PARAM_STRING, procedure_name,
PARAM_STRING, extensions,
PARAM_STRING, prefixes,
PARAM_END);
@ -61,16 +62,16 @@ gimp_register_load_handler (gchar *name,
}
void
gimp_register_save_handler (gchar *name,
gimp_register_save_handler (gchar *procedure_name,
gchar *extensions,
gchar *prefixes)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_register_save_handler",
&nreturn_vals,
PARAM_STRING, name,
PARAM_STRING, procedure_name,
PARAM_STRING, extensions,
PARAM_STRING, prefixes,
PARAM_END);

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpfileops_pdb.h
*
@ -7,20 +7,22 @@
* 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.
*/
*/
#ifndef __GIMP_FILE_OPS_PDB_H__
#define __GIMP_FILE_OPS_PDB_H__
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_FILEOPS_PDB_H__
#define __GIMP_FILEOPS_PDB_H__
#ifdef __cplusplus
extern "C" {
@ -29,28 +31,20 @@ extern "C" {
/* For information look into the C source or the html documentation */
/* Install a load file format handler in the procedure database.
*/
void gimp_register_magic_load_handler (gchar *name,
gchar *extensions,
gchar *prefixes,
gchar *magics);
/* Install a load file format handler in the procedure database.
*/
void gimp_register_load_handler (gchar *name,
gchar *extensions,
gchar *prefixes);
/* Install a save file format handler in the procedure database.
*/
void gimp_register_save_handler (gchar *name,
gchar *extensions,
gchar *prefixes);
void gimp_register_magic_load_handler (gchar *procedure_name,
gchar *extensions,
gchar *prefixes,
gchar *magics);
void gimp_register_load_handler (gchar *procedure_name,
gchar *extensions,
gchar *prefixes);
void gimp_register_save_handler (gchar *procedure_name,
gchar *extensions,
gchar *prefixes);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_FILE_OPS_PDB_H__ */
#endif /* __GIMP_FILEOPS_PDB_H__ */

View File

@ -1,7 +1,7 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpgradient_pdb.c
* gimpgradients_pdb.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -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,27 +19,28 @@
* Boston, MA 02111-1307, USA.
*/
#include "gimp.h"
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
gchar **
gimp_gradients_get_list (gint *num_gradients)
{
GParam *return_vals;
gint nreturn_vals;
gchar **gradient_names;
gint i;
GParam *return_vals;
gint nreturn_vals;
gchar **gradient_names = NULL;
gint i;
return_vals = gimp_run_procedure ("gimp_gradients_get_list",
&nreturn_vals,
PARAM_END);
*num_gradients = 0;
gradient_names = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*num_gradients = return_vals[1].data.d_int32;
gradient_names = g_new (char *, *num_gradients);
gradient_names = g_new (gchar *, *num_gradients);
for (i = 0; i < *num_gradients; i++)
gradient_names[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
}
@ -49,82 +50,73 @@ gimp_gradients_get_list (gint *num_gradients)
return gradient_names;
}
gchar *
gimp_gradients_get_active (void)
{
GParam *return_vals;
gint nreturn_vals;
gchar *result;
gint nreturn_vals;
gchar *name = NULL;
return_vals = gimp_run_procedure ("gimp_gradients_get_active",
&nreturn_vals,
PARAM_END);
result = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
result = g_strdup (return_vals[1].data.d_string);
name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return result;
return name;
}
void
gimp_gradients_set_active (gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_gradients_set_active",
&nreturn_vals,
PARAM_STRING, name,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
gdouble *
gimp_gradients_sample_uniform (gint num_samples)
{
GParam *return_vals;
gint nreturn_vals;
gdouble *result;
gint nresult;
gint i;
GParam *return_vals;
gint nreturn_vals;
gdouble *color_samples = NULL;
gint num_color_samples;
return_vals = gimp_run_procedure ("gimp_gradients_sample_uniform",
&nreturn_vals,
PARAM_INT32, num_samples,
PARAM_END);
result = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
nresult = return_vals[1].data.d_int32;
result = g_new(gdouble, nresult);
for (i = 0; i < nresult; i++)
result[i] = return_vals[2].data.d_floatarray[i];
num_color_samples = return_vals[1].data.d_int32;
color_samples = g_new (gdouble, num_color_samples);
memcpy (color_samples, return_vals[2].data.d_floatarray,
num_color_samples * sizeof (gdouble));
}
gimp_destroy_params (return_vals, nreturn_vals);
return result;
return color_samples;
}
gdouble *
gimp_gradients_sample_custom (gint num_samples,
gdouble *positions)
{
GParam *return_vals;
gint nreturn_vals;
gdouble *result;
gint nresult;
gint i;
GParam *return_vals;
gint nreturn_vals;
gdouble *color_samples = NULL;
gint num_color_samples;
return_vals = gimp_run_procedure ("gimp_gradients_sample_custom",
&nreturn_vals,
@ -132,17 +124,15 @@ gimp_gradients_sample_custom (gint num_samples,
PARAM_FLOATARRAY, positions,
PARAM_END);
result = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
nresult = return_vals[1].data.d_int32;
result = g_new (gdouble, nresult);
for (i = 0; i < nresult; i++)
result[i] = return_vals[2].data.d_floatarray[i];
num_color_samples = return_vals[1].data.d_int32;
color_samples = g_new (gdouble, num_color_samples);
memcpy (color_samples, return_vals[2].data.d_floatarray,
num_color_samples * sizeof (gdouble));
}
gimp_destroy_params (return_vals, nreturn_vals);
return result;
return color_samples;
}

View File

@ -1,26 +1,28 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpgradient_pdb.h
* gimpgradients_pdb.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
* 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_GRADIENT_PDB_H__
#define __GIMP_GRADIENT_PDB_H__
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_GRADIENTS_PDB_H__
#define __GIMP_GRADIENTS_PDB_H__
#ifdef __cplusplus
extern "C" {
@ -29,16 +31,16 @@ extern "C" {
/* For information look into the C source or the html documentation */
gchar ** gimp_gradients_get_list (gint *num_gradients);
gchar * gimp_gradients_get_active (void);
void gimp_gradients_set_active (gchar *name);
gdouble * gimp_gradients_sample_uniform (gint num_samples);
gdouble * gimp_gradients_sample_custom (gint num_samples,
gdouble *positions);
gchar** gimp_gradients_get_list (gint *num_gradients);
gchar* gimp_gradients_get_active (void);
void gimp_gradients_set_active (gchar *name);
gdouble* gimp_gradients_sample_uniform (gint num_samples);
gdouble* gimp_gradients_sample_custom (gint num_samples,
gdouble *positions);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_GRADIENT_PDB_H__ */
#endif /* __GIMP_GRADIENTS_PDB_H__ */

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpguides_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,16 +19,17 @@
* Boston, MA 02111-1307, USA.
*/
#include "gimp.h"
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
gint32
gimp_image_add_hguide (gint32 image_ID,
gint32 yposition)
gint yposition)
{
GParam *return_vals;
gint nreturn_vals;
gint32 guide_ID;
gint32 guide_ID = -1;
return_vals = gimp_run_procedure ("gimp_image_add_hguide",
&nreturn_vals,
@ -36,7 +37,6 @@ gimp_image_add_hguide (gint32 image_ID,
PARAM_INT32, yposition,
PARAM_END);
guide_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
guide_ID = return_vals[1].data.d_int32;
@ -47,11 +47,11 @@ gimp_image_add_hguide (gint32 image_ID,
gint32
gimp_image_add_vguide (gint32 image_ID,
gint32 xposition)
gint xposition)
{
GParam *return_vals;
gint nreturn_vals;
gint32 guide_ID;
gint32 guide_ID = -1;
return_vals = gimp_run_procedure ("gimp_image_add_vguide",
&nreturn_vals,
@ -59,7 +59,6 @@ gimp_image_add_vguide (gint32 image_ID,
PARAM_INT32, xposition,
PARAM_END);
guide_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
guide_ID = return_vals[1].data.d_int32;
@ -90,7 +89,7 @@ gimp_image_find_next_guide (gint32 image_ID,
{
GParam *return_vals;
gint nreturn_vals;
gint32 rtn_guide_ID;
gint32 next_guide_ID = -1;
return_vals = gimp_run_procedure ("gimp_image_find_next_guide",
&nreturn_vals,
@ -98,22 +97,21 @@ gimp_image_find_next_guide (gint32 image_ID,
PARAM_INT32, guide_ID,
PARAM_END);
rtn_guide_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
rtn_guide_ID = return_vals[1].data.d_int32;
next_guide_ID = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return rtn_guide_ID;
return next_guide_ID;
}
GOrientation
GimpOrientationType
gimp_image_get_guide_orientation (gint32 image_ID,
gint32 guide_ID)
{
GParam *return_vals;
gint nreturn_vals;
GOrientation guide_orientation;
GimpOrientationType orientation = GIMP_UNKNOWN;
return_vals = gimp_run_procedure ("gimp_image_get_guide_orientation",
&nreturn_vals,
@ -121,22 +119,21 @@ gimp_image_get_guide_orientation (gint32 image_ID,
PARAM_INT32, guide_ID,
PARAM_END);
guide_orientation = ORIENTATION_UNKNOWN;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
guide_orientation = return_vals[1].data.d_int32;
orientation = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return guide_orientation;
return orientation;
}
gint32
gint
gimp_image_get_guide_position (gint32 image_ID,
gint32 guide_ID)
{
GParam *return_vals;
gint nreturn_vals;
gint32 guide_position;
gint position = -1;
return_vals = gimp_run_procedure ("gimp_image_get_guide_position",
&nreturn_vals,
@ -144,11 +141,10 @@ gimp_image_get_guide_position (gint32 image_ID,
PARAM_INT32, guide_ID,
PARAM_END);
guide_position = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
guide_position = return_vals[1].data.d_int32;
position = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return guide_position;
return position;
}

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpguides_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_GUIDES_PDB_H__
#define __GIMP_GUIDES_PDB_H__
@ -29,18 +31,18 @@ extern "C" {
/* For information look into the C source or the html documentation */
gint32 gimp_image_add_hguide (gint32 image_ID,
gint32 yposition);
gint32 gimp_image_add_vguide (gint32 image_ID,
gint32 xposition);
void gimp_image_delete_guide (gint32 image_ID,
gint32 guide_ID);
gint32 gimp_image_find_next_guide (gint32 image_ID,
gint32 guide_ID);
GOrientation gimp_image_get_guide_orientation (gint32 image_ID,
gint32 guide_ID);
gint32 gimp_image_get_guide_position (gint32 image_ID,
gint32 guide_ID);
gint32 gimp_image_add_hguide (gint32 image_ID,
gint yposition);
gint32 gimp_image_add_vguide (gint32 image_ID,
gint xposition);
void gimp_image_delete_guide (gint32 image_ID,
gint32 guide_ID);
gint32 gimp_image_find_next_guide (gint32 image_ID,
gint32 guide_ID);
GimpOrientationType gimp_image_get_guide_orientation (gint32 image_ID,
gint32 guide_ID);
gint gimp_image_get_guide_position (gint32 image_ID,
gint32 guide_ID);
#ifdef __cplusplus

View File

@ -1,8 +1,7 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimphelp_pdb.c
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -12,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
@ -20,20 +19,22 @@
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
void
gimp_help (gchar *prog_name,
gchar *help_data)
gchar *help_page)
{
GParam *return_vals;
gint nreturn_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_help",
&nreturn_vals,
&nreturn_vals,
PARAM_STRING, prog_name,
PARAM_STRING, help_data,
PARAM_END);
PARAM_STRING, help_page,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}

View File

@ -1,24 +1,25 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimphelp_pdb.h
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
*
* 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
* 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_HELP_PDB_H__
#define __GIMP_HELP_PDB_H__
@ -30,8 +31,8 @@ extern "C" {
/* For information look into the C source or the html documentation */
void gimp_help (gchar *prog_name,
gchar *help_data);
void gimp_help (gchar *prog_name,
gchar *help_page);
#ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpmessage_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,12 +19,14 @@
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
void
gimp_message (const gchar *message)
gimp_message (gchar *message)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_message",
@ -34,3 +36,36 @@ gimp_message (const gchar *message)
gimp_destroy_params (return_vals, nreturn_vals);
}
GimpMessageHandlerType
gimp_message_get_handler (void)
{
GParam *return_vals;
gint nreturn_vals;
GimpMessageHandlerType handler = 0;
return_vals = gimp_run_procedure ("gimp_message_get_handler",
&nreturn_vals,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
handler = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return handler;
}
void
gimp_message_set_handler (GimpMessageHandlerType handler)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_message_set_handler",
&nreturn_vals,
PARAM_INT32, handler,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpmessage_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_MESSAGE_PDB_H__
#define __GIMP_MESSAGE_PDB_H__
@ -28,13 +30,14 @@ extern "C" {
/* For information look into the C source or the html documentation */
/* Pops up a dialog box with "message". Useful for status and
* error reports. If "message" is NULL, do nothing.
*/
void gimp_message (const gchar *message);
void gimp_message (gchar *message);
GimpMessageHandlerType gimp_message_get_handler (void);
void gimp_message_set_handler (GimpMessageHandlerType handler);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_PLUG_IN_PDB_H__ */
#endif /* __GIMP_MESSAGE_PDB_H__ */

View File

@ -1,8 +1,7 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpparasite.c
* Copyright (C) 1998 Jay Cox <jaycox@earthlink.net>
* gimpparasite_pdb.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -20,31 +19,32 @@
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
GimpParasite *
gimp_parasite_find (const gchar *name)
gimp_parasite_find (gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
GimpParasite *parasite;
GimpParasite *parasite = NULL;
return_vals = gimp_run_procedure ("gimp_parasite_find",
&nreturn_vals,
PARAM_STRING, name,
PARAM_END);
parasite = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
parasite = parasite_copy (&return_vals[1].data.d_parasite);
gimp_destroy_params (return_vals, nreturn_vals);
return parasite;
}
void
gimp_parasite_attach (const GimpParasite *parasite)
gimp_parasite_attach (GimpParasite *parasite)
{
GParam *return_vals;
gint nreturn_vals;
@ -58,7 +58,7 @@ gimp_parasite_attach (const GimpParasite *parasite)
}
void
gimp_parasite_detach (const gchar *name)
gimp_parasite_detach (gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
@ -71,14 +71,39 @@ gimp_parasite_detach (const gchar *name)
gimp_destroy_params (return_vals, nreturn_vals);
}
GimpParasite *
gimp_drawable_parasite_find (gint32 drawable_ID,
const gchar *name)
void
gimp_parasite_list (gint *num_parasites,
gchar **parasites)
{
GParam *return_vals;
gint nreturn_vals;
GimpParasite *parasite;
gint i;
return_vals = gimp_run_procedure ("gimp_parasite_list",
&nreturn_vals,
PARAM_END);
*num_parasites = 0;
*parasites = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*num_parasites = return_vals[1].data.d_int32;
parasites = g_new (gchar *, *num_parasites);
for (i = 0; i < *num_parasites; i++)
parasites[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
}
gimp_destroy_params (return_vals, nreturn_vals);
}
GimpParasite *
gimp_drawable_parasite_find (gint32 drawable_ID,
gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
GimpParasite *parasite = NULL;
return_vals = gimp_run_procedure ("gimp_drawable_parasite_find",
&nreturn_vals,
PARAM_DRAWABLE, drawable_ID,
@ -86,20 +111,16 @@ gimp_drawable_parasite_find (gint32 drawable_ID,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
}
else
parasite = NULL;
parasite = parasite_copy (&return_vals[1].data.d_parasite);
gimp_destroy_params (return_vals, nreturn_vals);
return parasite;
}
void
gimp_drawable_parasite_attach (gint32 drawable_ID,
const GimpParasite *parasite)
gimp_drawable_parasite_attach (gint32 drawable_ID,
GimpParasite *parasite)
{
GParam *return_vals;
gint nreturn_vals;
@ -114,8 +135,8 @@ gimp_drawable_parasite_attach (gint32 drawable_ID,
}
void
gimp_drawable_parasite_detach (gint32 drawable_ID,
const gchar *name)
gimp_drawable_parasite_detach (gint32 drawable_ID,
gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
@ -126,13 +147,40 @@ gimp_drawable_parasite_detach (gint32 drawable_ID,
PARAM_STRING, name,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_drawable_parasite_list (gint32 drawable_ID,
gint *num_parasites,
gchar **parasites)
{
GParam *return_vals;
gint nreturn_vals;
gint i;
return_vals = gimp_run_procedure ("gimp_drawable_parasite_list",
&nreturn_vals,
PARAM_DRAWABLE, drawable_ID,
PARAM_END);
*num_parasites = 0;
*parasites = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*num_parasites = return_vals[1].data.d_int32;
parasites = g_new (gchar *, *num_parasites);
for (i = 0; i < *num_parasites; i++)
parasites[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
}
gimp_destroy_params (return_vals, nreturn_vals);
}
GimpParasite *
gimp_image_parasite_find (gint32 image_ID,
const gchar *name)
gimp_image_parasite_find (gint32 image_ID,
gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
@ -145,16 +193,16 @@ gimp_image_parasite_find (gint32 image_ID,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
parasite = parasite_copy (&return_vals[1].data.d_parasite);
gimp_destroy_params (return_vals, nreturn_vals);
return parasite;
}
void
gimp_image_parasite_attach (gint32 image_ID,
const GimpParasite *parasite)
gimp_image_parasite_attach (gint32 image_ID,
GimpParasite *parasite)
{
GParam *return_vals;
gint nreturn_vals;
@ -169,8 +217,8 @@ gimp_image_parasite_attach (gint32 image_ID,
}
void
gimp_image_parasite_detach (gint32 image_ID,
const gchar *name)
gimp_image_parasite_detach (gint32 image_ID,
gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
@ -183,3 +231,30 @@ gimp_image_parasite_detach (gint32 image_ID,
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_image_parasite_list (gint32 image_ID,
gint *num_parasites,
gchar **parasites)
{
GParam *return_vals;
gint nreturn_vals;
gint i;
return_vals = gimp_run_procedure ("gimp_image_parasite_list",
&nreturn_vals,
PARAM_IMAGE, image_ID,
PARAM_END);
*num_parasites = 0;
*parasites = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*num_parasites = return_vals[1].data.d_int32;
parasites = g_new (gchar *, *num_parasites);
for (i = 0; i < *num_parasites; i++)
parasites[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
}
gimp_destroy_params (return_vals, nreturn_vals);
}

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpparasite_pdb.h
*
@ -7,10 +7,10 @@
* 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
@ -19,6 +19,8 @@
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_PARASITE_PDB_H__
#define __GIMP_PARASITE_PDB_H__
@ -29,22 +31,29 @@ extern "C" {
/* For information look into the C source or the html documentation */
GimpParasite * gimp_parasite_find (const gchar *name);
void gimp_parasite_attach (const GimpParasite *parasite);
void gimp_parasite_detach (const gchar *name);
GimpParasite * gimp_drawable_parasite_find (gint32 drawable_ID,
const gchar *name);
void gimp_drawable_parasite_attach (gint32 drawable_ID,
const GimpParasite *parasite);
void gimp_drawable_parasite_detach (gint32 drawable_ID,
const gchar *name);
GimpParasite * gimp_image_parasite_find (gint32 image_ID,
const gchar *name);
void gimp_image_parasite_attach (gint32 image_ID,
const GimpParasite *parasite);
void gimp_image_parasite_detach (gint32 image_ID,
const gchar *name);
GimpParasite* gimp_parasite_find (gchar *name);
void gimp_parasite_attach (GimpParasite *parasite);
void gimp_parasite_detach (gchar *name);
void gimp_parasite_list (gint *num_parasites,
gchar** parasites);
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
gchar *name);
void gimp_drawable_parasite_attach (gint32 drawable_ID,
GimpParasite *parasite);
void gimp_drawable_parasite_detach (gint32 drawable_ID,
gchar *name);
void gimp_drawable_parasite_list (gint32 drawable_ID,
gint *num_parasites,
gchar** parasites);
GimpParasite* gimp_image_parasite_find (gint32 image_ID,
gchar *name);
void gimp_image_parasite_attach (gint32 image_ID,
GimpParasite *parasite);
void gimp_image_parasite_detach (gint32 image_ID,
gchar *name);
void gimp_image_parasite_list (gint32 image_ID,
gint *num_parasites,
gchar** parasites);
#ifdef __cplusplus

View File

@ -105,7 +105,8 @@ pattern_popup_open (gint x,
y = (y < 0) ? 0 : y;
x = (x + psel->width > scr_w) ? scr_w - psel->width : x;
y = (y + psel->height > scr_h) ? scr_h - psel->height : y;
gtk_preview_size (GTK_PREVIEW (psel->device_patpreview), psel->width, psel->height);
gtk_preview_size (GTK_PREVIEW (psel->device_patpreview),
psel->width, psel->height);
gtk_widget_popup (psel->device_patpopup, x, y);
@ -291,10 +292,10 @@ gimp_pattern_select_widget (gchar *dname,
GtkWidget *hbox;
GtkWidget *pattern;
GtkWidget *button;
gint length;
gint width;
gint height;
gint bytes;
gint mask_data_size;
guint8 *mask_data;
gchar *pattern_name;
PSelect *psel;
@ -330,11 +331,17 @@ gimp_pattern_select_widget (gchar *dname,
/* Do initial pattern setup */
pattern_name =
gimp_patterns_get_pattern_data (ipattern, &length, &width, &height, &bytes, &mask_data);
gimp_patterns_get_pattern_data (ipattern,
&width,
&height,
&bytes,
&mask_data_size,
&mask_data);
if(pattern_name)
{
pattern_pre_update (psel->pattern_preview, width, height, bytes, mask_data);
pattern_pre_update (psel->pattern_preview,
width, height, bytes, mask_data);
psel->mask_data = mask_data;
psel->pattern_name = pattern_name;
psel->width = width;
@ -376,10 +383,10 @@ void
gimp_pattern_select_widget_set_popup (GtkWidget *widget,
gchar *pname)
{
gint length;
gint width;
gint height;
gint bytes;
gint mask_data_size;
guint8 *mask_data;
gchar *pattern_name;
PSelect *psel;
@ -390,7 +397,11 @@ gimp_pattern_select_widget_set_popup (GtkWidget *widget,
{
pattern_name =
gimp_patterns_get_pattern_data (pname,
&length, &width, &height, &bytes, &mask_data);
&width,
&height,
&bytes,
&mask_data_size,
&mask_data);
pattern_select_invoker (pname, width, height, bytes, mask_data, 0, psel);

View File

@ -25,10 +25,10 @@
gchar *
gimp_patterns_get_pattern_data (gchar *name,
gint *length,
gint *width,
gint *height,
gint *mask_bpp,
gint *mask_data_size,
guint8 **mask_data)
{
GParam *return_vals;
@ -39,18 +39,22 @@ gimp_patterns_get_pattern_data (gchar *name,
PARAM_STRING, name,
PARAM_END);
*length = 0;
name = NULL;
*width = 0;
*height = 0;
*mask_bpp = 0;
*mask_data_size = 0;
*mask_data = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
name = g_strdup (return_vals[1].data.d_string);
*width = return_vals[2].data.d_int32;
*height = return_vals[3].data.d_int32;
*mask_bpp = return_vals[4].data.d_int32;
*length = return_vals[5].data.d_int32;
*mask_data = g_new (guint8, *length);
*mask_data_size = return_vals[5].data.d_int32;
*mask_data = g_new (guint8, *mask_data_size);
memcpy (*mask_data, return_vals[6].data.d_int8array,
*length * sizeof (guint8));
*mask_data_size * sizeof (guint8));
}
gimp_destroy_params (return_vals, nreturn_vals);

View File

@ -31,10 +31,10 @@ extern "C" {
gchar* gimp_patterns_get_pattern_data (gchar *name,
gint *length,
gint *width,
gint *height,
gint *mask_bpp,
gint *mask_data_size,
guint8 **mask_data);

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpplugin_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,13 +19,14 @@
* Boston, MA 02111-1307, USA.
*/
#include "gimp.h"
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
void
gimp_progress_init (gchar *message)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_progress_init",
@ -40,7 +41,7 @@ gimp_progress_init (gchar *message)
void
gimp_progress_update (gdouble percentage)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_progress_update",
@ -51,11 +52,30 @@ gimp_progress_update (gdouble percentage)
gimp_destroy_params (return_vals, nreturn_vals);
}
gchar *
gimp_temp_PDB_name (void)
{
GParam *return_vals;
gint nreturn_vals;
gchar *temp_name = NULL;
return_vals = gimp_run_procedure ("gimp_temp_PDB_name",
&nreturn_vals,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
temp_name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return temp_name;
}
void
gimp_plugin_domain_register (gchar *domain_name,
gchar *domain_path)
{
GimpParam *return_vals;
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_plugin_domain_register",
@ -71,12 +91,12 @@ void
gimp_plugin_help_register (gchar *help_path)
{
GParam *return_vals;
gint nreturn_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_plugin_help_register",
&nreturn_vals,
PARAM_STRING, help_path,
PARAM_END);
&nreturn_vals,
PARAM_STRING, help_path,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}

View File

@ -1,5 +1,5 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpplugin_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_PLUG_IN_PDB_H__
#define __GIMP_PLUG_IN_PDB_H__
@ -29,22 +31,11 @@ extern "C" {
/* For information look into the C source or the html documentation */
/* Initialize the progress bar with "message". If "message"
* is NULL, the message displayed in the progress window will
* be the name of the plug-in.
*/
void gimp_progress_init (gchar *message);
/* Update the progress bar. If the progress bar has not been
* initialized then it will be automatically initialized as if
* "gimp_progress_init (NULL)" were called. "percentage" is a
* value between 0 and 1.
*/
void gimp_progress_update (gdouble percentage);
gchar* gimp_temp_PDB_name (void);
void gimp_plugin_domain_register (gchar *domain_name,
gchar *domain_path);
void gimp_plugin_help_register (gchar *help_path);

View File

@ -14,7 +14,7 @@ pdb_sources = \
pdb/fileops.pdb \
pdb/floating_sel.pdb \
pdb/gimprc.pdb \
pdb/gradient.pdb \
pdb/gradients.pdb \
pdb/gradient_select.pdb \
pdb/guides.pdb \
pdb/help.pdb \

View File

@ -12,7 +12,7 @@
fileops
floating_sel
gimprc
gradient
gradients
gradient_select
guides
help

View File

@ -1,240 +0,0 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1995 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 2 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Federico Mena Quintero';
$date = '1997';
}
sub gradients_get_list {
$blurb = 'Retrieve the list of loaded gradients.';
$help = <<'HELP';
This procedure returns a list of the gradients that are currently loaded in the
gradient editor. You can later use the gimp_gradients_set_active function to
set the active gradient.
HELP
&pdb_misc;
@outargs = (
{ name => 'gradient_names', type => 'stringarray',
desc => 'The list of gradient names', alias => 'gradients',
array => { name => 'num_gradients',
desc => 'The number of loaded gradients',
no_declare => 1 } }
);
%invoke = (
vars => [ 'gradient_t *grad', 'GSList *list', 'int i = 0' ],
success => 'NONE',
code => <<'CODE'
{
gradients = g_new (gchar *, num_gradients);
success = (list = gradients_list) != NULL;
while (list)
{
grad = list->data;
gradients[i++] = g_strdup (grad->name);
list = list->next;
}
}
CODE
);
}
sub gradients_get_active {
$blurb = 'Retrieve the name of the active gradient.';
$help = <<'HELP';
This procedure returns the name of the active gradient in the gradient editor.
HELP
&pdb_misc;
@outargs = (
{ name => 'name', type => 'string',
desc => 'The name of the active gradient',
alias => 'g_strdup (gimp_context_get_gradient (NULL)->name)',
no_declare => 1 }
);
%invoke = ( code => 'success = gimp_context_get_gradient (NULL) != NULL;' );
}
sub gradients_set_active {
$blurb = 'Sets the specified gradient as the active gradient.';
$help = <<'HELP';
This procedure lets you set the specified gradient as the active or "current"
one. The name is simply a string which corresponds to one of the loaded
gradients in the gradient editor. If no matching gradient is found, this
procedure will return an error. Otherwise, the specified gradient will become
active and will be used for subsequent custom gradient operations.
HELP
&pdb_misc;
@inargs = (
{ name => 'name', type => 'string',
desc => 'The name of the gradient to set' }
);
%invoke = (
vars => [ 'gradient_t *gradient' ],
code => <<'CODE'
{
gradient = gradient_list_get_gradient (gradients_list, name);
success = FALSE;
if (gradient)
{
gimp_context_set_gradient (NULL, gradient);
success = TRUE;
}
}
CODE
);
}
sub sample_num_arg {
{ name => 'num_samples', type => $_[0] . 'int32',
desc => 'The number of samples to take', alias => 'i' }
}
sub sample_outargs {
@outargs = (
{ name => 'color_samples', type => 'floatarray', init => 1,
desc => 'Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }',
array => { name => 'array_length', no_lib => 1, init => 1,
desc => 'Length of the color_samples array (4 *
num_samples)' } }
);
}
sub gradients_sample_uniform {
$blurb = 'Sample the active gradient in uniform parts.';
$help = <<'HELP';
This procedure samples the active gradient from the gradient editor in the
specified number of uniform parts. It returns a list of floating-point values
which correspond to the RGBA values for each sample. The minimum number of
samples to take is 2, in which case the returned colors will correspond to the
{ 0.0, 1.0 } positions in the gradient. For example, if the number of samples
is 3, the procedure will return the colors at positions { 0.0, 0.5, 1.0 }.
HELP
&pdb_misc;
@inargs = ( &sample_num_arg('2 <= ') );
&sample_outargs;
%invoke = (
vars => [ 'gradient_t *gradient', 'gdouble pos, delta', 'gdouble r, g, b, a', 'gdouble *pv' ],
code => <<'CODE'
{
pos = 0.0;
delta = 1.0 / (i - 1);
array_length = i * 4;
pv = color_samples = g_new (gdouble, array_length);
gradient = gimp_context_get_gradient (NULL);
while (i--)
{
gradient_get_color_at (gradient, pos, &r, &g, &b, &a);
*pv++ = r;
*pv++ = g;
*pv++ = b;
*pv++ = a;
pos += delta;
}
}
CODE
);
}
sub gradients_sample_custom {
$blurb = 'Sample the active gradient in custom positions.';
$help = <<'HELP';
This procedure samples the active gradient from the gradient editor in the
specified number of points. The procedure will sample the gradient in the
specified positions from the list. The left endpoint of the gradient
corresponds to position 0.0, and the right endpoint corresponds to 1.0. The
procedure returns a list of floating-point values which correspond to the RGBA
values for each sample.
HELP
&pdb_misc;
@inargs = (
{
name => 'positions',
type => 'floatarray',
desc => 'The list of positions to sample along the gradient',
alias => 'pos',
array => &sample_num_arg("")
}
);
&sample_outargs;
%invoke = (
vars => [ 'gradient_t *gradient', 'gdouble r, g, b, a', 'gdouble *pv' ],
code => <<'CODE'
{
array_length = i * 4;
pv = color_samples = g_new (gdouble, array_length);
gradient = gimp_context_get_gradient (NULL);
while (i--)
{
gradient_get_color_at (gradient, *pos, &r, &g, &b, &a);
*pv++ = r;
*pv++ = g;
*pv++ = b;
*pv++ = a;
pos++;
}
}
CODE
);
}
@headers = qw("gimpcontext.h" "gradient_header.h");
@procs = qw(gradients_get_list gradients_get_active gradients_set_active
gradients_sample_uniform gradients_sample_custom);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Gradients';
1;

View File

@ -346,7 +346,7 @@ CODE
@procs = qw(progress_init progress_update temp_PDB_name plugins_query
plugin_domain_register plugin_help_register);
%exports = (app => [@procs], lib => [@procs[0..2]]);
%exports = (app => [@procs], lib => [@procs[0..2,4,5]]);
$desc = 'Plug-in';