2000-05-31 14:15:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* 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
|
1998-01-25 18:26:47 +08:00
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
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
|
|
|
*/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
gimp_drawable_update (gint32 drawable_ID,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint width,
|
|
|
|
guint height)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_update",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_INT32, x,
|
|
|
|
PARAM_INT32, y,
|
|
|
|
PARAM_INT32, width,
|
|
|
|
PARAM_INT32, height,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_drawable_merge_shadow (gint32 drawable_ID,
|
|
|
|
gint undoable)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_merge_shadow",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_INT32, undoable,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_drawable_image_id (gint32 drawable_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 image_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_image",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
image_ID = -1;
|
|
|
|
if (return_vals[0].data.d_int32 == STATUS_SUCCESS)
|
|
|
|
image_ID = return_vals[1].data.d_image;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return image_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gimp_drawable_width (gint32 drawable_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
guint width;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_width",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
width = 0;
|
|
|
|
if (return_vals[0].data.d_int32 == STATUS_SUCCESS)
|
|
|
|
width = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gimp_drawable_height (gint32 drawable_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
guint height;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_height",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
height = 0;
|
|
|
|
if (return_vals[0].data.d_int32 == STATUS_SUCCESS)
|
|
|
|
height = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return height;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gimp_drawable_bpp (gint32 drawable_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
guint bpp;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_bytes",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
bpp = 0;
|
|
|
|
if (return_vals[0].data.d_int32 == STATUS_SUCCESS)
|
|
|
|
bpp = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return bpp;
|
|
|
|
}
|
|
|
|
|
|
|
|
GDrawableType
|
|
|
|
gimp_drawable_type (gint32 drawable_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_type",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = -1;
|
|
|
|
if (return_vals[0].data.d_int32 == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_drawable_is_channel (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
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-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
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,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
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-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
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,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_drawable_has_alpha (gint32 drawable_ID)
|
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_has_alpha",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_drawable_is_indexed (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_indexed",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_drawable_is_layer (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_drawable_is_layer_mask (gint32 drawable_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_drawable_mask_bounds (gint32 drawable_ID,
|
|
|
|
gint *x1,
|
|
|
|
gint *y1,
|
|
|
|
gint *x2,
|
|
|
|
gint *y2)
|
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_mask_bounds",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
result = 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_drawable_offsets (gint32 drawable_ID,
|
|
|
|
gint *offset_x,
|
|
|
|
gint *offset_y)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_offsets",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*offset_x = return_vals[1].data.d_int32;
|
|
|
|
*offset_y = return_vals[2].data.d_int32;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-12-27 20:02:07 +08:00
|
|
|
gimp_drawable_fill (gint32 drawable_ID,
|
|
|
|
GimpFillType fill_type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_fill",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_INT32, fill_type,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_drawable_parasite_find (gint32 drawable_ID,
|
|
|
|
const gchar *name)
|
1998-10-08 16:15:21 +08:00
|
|
|
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *parasite;
|
1999-10-28 04:23:04 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_parasite_find",
|
1998-10-08 16:15:21 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
1998-10-14 10:54:02 +08:00
|
|
|
PARAM_STRING, name,
|
1998-10-08 16:15:21 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
2000-05-27 06:28:40 +08:00
|
|
|
{
|
|
|
|
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
|
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
else
|
|
|
|
parasite = NULL;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return parasite;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-05-27 06:28:40 +08:00
|
|
|
gimp_drawable_parasite_attach (gint32 drawable_ID,
|
|
|
|
const GimpParasite *parasite)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-08 16:15:21 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
|
1998-10-08 16:15:21 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
2000-05-27 06:28:40 +08:00
|
|
|
PARAM_PARASITE, parasite,
|
1998-10-08 16:15:21 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
|
|
|
|
void
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_drawable_attach_new_parasite (gint32 drawable,
|
|
|
|
const gchar *name,
|
|
|
|
gint flags,
|
|
|
|
gint size,
|
|
|
|
const gpointer data)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *p = gimp_parasite_new (name, flags, size, data);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
|
1998-10-30 18:21:33 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable,
|
|
|
|
PARAM_PARASITE, p,
|
|
|
|
PARAM_END);
|
|
|
|
|
2000-05-27 06:28:40 +08:00
|
|
|
gimp_parasite_free(p);
|
1998-10-30 18:21:33 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1998-10-08 16:15:21 +08:00
|
|
|
void
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_drawable_parasite_detach (gint32 drawable_ID,
|
|
|
|
const gchar *name)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-08 16:15:21 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_parasite_detach",
|
1998-10-08 16:15:21 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
1998-10-14 10:54:02 +08:00
|
|
|
PARAM_STRING, name,
|
1998-10-08 16:15:21 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1999-06-24 07:01:14 +08:00
|
|
|
guchar *
|
|
|
|
gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
gint *bytes)
|
|
|
|
{
|
2000-03-26 02:49:05 +08:00
|
|
|
GParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
1999-12-07 06:44:40 +08:00
|
|
|
guchar *drawable_data = NULL;
|
1999-06-24 07:01:14 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_drawable_thumbnail",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_DRAWABLE, drawable_ID,
|
|
|
|
PARAM_INT32, *width,
|
|
|
|
PARAM_INT32, *height,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*width = return_vals[1].data.d_int32;
|
|
|
|
*height = return_vals[2].data.d_int32;
|
|
|
|
*bytes = return_vals[3].data.d_int32;
|
1999-12-07 06:44:40 +08:00
|
|
|
drawable_data = g_new (guchar, return_vals[4].data.d_int32);
|
|
|
|
g_memmove (drawable_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32);
|
1999-06-24 07:01:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return drawable_data;
|
|
|
|
}
|