2000-06-01 05:16:11 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimppatterns_pdb.c
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* 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 */
|
|
|
|
|
2001-03-18 20:51:37 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_patterns_get_pattern_data:
|
|
|
|
* @name: the pattern name (\"\" means current active pattern).
|
|
|
|
* @width: The pattern width.
|
|
|
|
* @height: The pattern height.
|
|
|
|
* @mask_bpp: Pattern bytes per pixel.
|
|
|
|
* @length: Length of pattern mask data.
|
|
|
|
* @mask_data: The pattern mask data.
|
|
|
|
*
|
|
|
|
* Retrieve information about the currently active pattern (including
|
|
|
|
* data).
|
|
|
|
*
|
|
|
|
* This procedure retrieves information about the currently active
|
|
|
|
* pattern. This includes the pattern name, and the pattern extents
|
|
|
|
* (width and height). It also returns the pattern data.
|
|
|
|
*
|
|
|
|
* Returns: The pattern name.
|
|
|
|
*/
|
2000-06-01 05:16:11 +08:00
|
|
|
gchar *
|
|
|
|
gimp_patterns_get_pattern_data (gchar *name,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
gint *mask_bpp,
|
2000-08-22 02:59:12 +08:00
|
|
|
gint *length,
|
2000-06-01 05:16:11 +08:00
|
|
|
guint8 **mask_data)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-22 02:59:12 +08:00
|
|
|
gchar *ret_name = NULL;
|
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_patterns_get_pattern_data",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-22 02:59:12 +08:00
|
|
|
*length = 0;
|
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-22 02:59:12 +08:00
|
|
|
ret_name = g_strdup (return_vals[1].data.d_string);
|
2000-06-01 05:16:11 +08:00
|
|
|
*width = return_vals[2].data.d_int32;
|
|
|
|
*height = return_vals[3].data.d_int32;
|
|
|
|
*mask_bpp = return_vals[4].data.d_int32;
|
2000-08-22 02:59:12 +08:00
|
|
|
*length = return_vals[5].data.d_int32;
|
|
|
|
*mask_data = g_new (guint8, *length);
|
2000-06-01 05:16:11 +08:00
|
|
|
memcpy (*mask_data, return_vals[6].data.d_int8array,
|
2000-08-22 02:59:12 +08:00
|
|
|
*length * sizeof (guint8));
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-08-22 02:59:12 +08:00
|
|
|
return ret_name;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|