2000-05-31 14:15:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2000-06-01 22:59:22 +08:00
|
|
|
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
|
2000-05-31 14:15:06 +08:00
|
|
|
*
|
|
|
|
* gimpdrawable_pdb.c
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 18:26:47 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2000-05-31 14:15:06 +08:00
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-06-01 22:59:22 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-04-13 13:44:11 +08:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
2000-05-31 14:15:06 +08:00
|
|
|
*/
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl */
|
2000-06-01 05:16:11 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 22:59:22 +08:00
|
|
|
gimp_drawable_merge_shadow (gint32 drawable_ID,
|
|
|
|
gboolean undo)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_merge_shadow",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, undo,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 22:59:22 +08:00
|
|
|
gimp_drawable_fill (gint32 drawable_ID,
|
|
|
|
GimpFillType fill_type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_fill",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, fill_type,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 22:59:22 +08:00
|
|
|
gimp_drawable_update (gint32 drawable_ID,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_update",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, x,
|
|
|
|
GIMP_PDB_INT32, y,
|
|
|
|
GIMP_PDB_INT32, width,
|
|
|
|
GIMP_PDB_INT32, height,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean
|
|
|
|
gimp_drawable_mask_bounds (gint32 drawable_ID,
|
|
|
|
gint *x1,
|
|
|
|
gint *y1,
|
|
|
|
gint *x2,
|
|
|
|
gint *y2)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean non_empty = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_mask_bounds",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
{
|
|
|
|
non_empty = return_vals[1].data.d_int32;
|
|
|
|
*x1 = return_vals[2].data.d_int32;
|
|
|
|
*y1 = return_vals[3].data.d_int32;
|
|
|
|
*x2 = return_vals[4].data.d_int32;
|
|
|
|
*y2 = return_vals[5].data.d_int32;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return non_empty;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gint32
|
|
|
|
gimp_drawable_image (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint32 image_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_image",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
image_ID = return_vals[1].data.d_image;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return image_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
GimpImageType
|
|
|
|
gimp_drawable_type (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
GimpImageType type = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_type",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
type = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return type;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean
|
|
|
|
gimp_drawable_has_alpha (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-23 04:06:02 +08:00
|
|
|
gboolean has_alpha = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_has_alpha",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
has_alpha = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return has_alpha;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
GimpImageType
|
|
|
|
gimp_drawable_type_with_alpha (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
GimpImageType type_with_alpha = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_type_with_alpha",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
type_with_alpha = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return type_with_alpha;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1999-10-25 04:49:09 +08:00
|
|
|
gimp_drawable_is_rgb (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean color = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-25 04:49:09 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_rgb",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
color = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return color;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_drawable_is_gray (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean gray = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_gray",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
gray = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return gray;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
2000-06-01 22:59:22 +08:00
|
|
|
gimp_drawable_is_indexed (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean indexed = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_indexed",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
indexed = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return indexed;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gint
|
|
|
|
gimp_drawable_bytes (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint bytes = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_bytes",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
bytes = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return bytes;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gint
|
|
|
|
gimp_drawable_width (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint width = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_width",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
width = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return width;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gint
|
|
|
|
gimp_drawable_height (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint height = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_height",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
height = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return height;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 22:59:22 +08:00
|
|
|
gimp_drawable_offsets (gint32 drawable_ID,
|
|
|
|
gint *offset_x,
|
|
|
|
gint *offset_y)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_offsets",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-23 04:06:02 +08:00
|
|
|
*offset_x = 0;
|
|
|
|
*offset_y = 0;
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-06-01 22:59:22 +08:00
|
|
|
*offset_x = return_vals[1].data.d_int32;
|
|
|
|
*offset_y = return_vals[2].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 22:59:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_drawable_is_layer (gint32 drawable_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean layer = FALSE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 22:59:22 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
layer = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean
|
|
|
|
gimp_drawable_is_layer_mask (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean layer_mask = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
layer_mask = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-01 22:59:22 +08:00
|
|
|
|
|
|
|
return layer_mask;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean
|
|
|
|
gimp_drawable_is_channel (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gboolean channel = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 22:59:22 +08:00
|
|
|
channel = return_vals[1].data.d_int32;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-01 22:59:22 +08:00
|
|
|
|
|
|
|
return channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 22:59:22 +08:00
|
|
|
_gimp_drawable_thumbnail (gint32 drawable_ID,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint *ret_width,
|
|
|
|
gint *ret_height,
|
|
|
|
gint *bpp,
|
|
|
|
gint *thumbnail_data_count,
|
|
|
|
guint8 **thumbnail_data)
|
1999-06-24 07:01:14 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1999-06-24 07:01:14 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_thumbnail",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, width,
|
|
|
|
GIMP_PDB_INT32, height,
|
|
|
|
GIMP_PDB_END);
|
1999-06-24 07:01:14 +08:00
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
*ret_width = 0;
|
|
|
|
*ret_height = 0;
|
2000-06-23 04:06:02 +08:00
|
|
|
*bpp = 0;
|
2000-06-01 22:59:22 +08:00
|
|
|
*thumbnail_data_count = 0;
|
|
|
|
*thumbnail_data = NULL;
|
2000-06-23 04:06:02 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
1999-06-24 07:01:14 +08:00
|
|
|
{
|
2000-06-01 22:59:22 +08:00
|
|
|
*ret_width = return_vals[1].data.d_int32;
|
|
|
|
*ret_height = return_vals[2].data.d_int32;
|
|
|
|
*bpp = return_vals[3].data.d_int32;
|
|
|
|
*thumbnail_data_count = return_vals[4].data.d_int32;
|
|
|
|
*thumbnail_data = g_new (guint8, *thumbnail_data_count);
|
|
|
|
memcpy (*thumbnail_data, return_vals[5].data.d_int8array,
|
|
|
|
*thumbnail_data_count * sizeof (guint8));
|
1999-06-24 07:01:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1999-06-24 07:01:14 +08:00
|
|
|
}
|