2000-06-09 02:10:03 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-06-09 02:10:03 +08:00
|
|
|
*
|
|
|
|
* gimppaths_pdb.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-06-09 02:10:03 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-06-09 02:10:03 +08:00
|
|
|
*
|
|
|
|
* 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
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2000-06-09 02:10:03 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2001-03-18 20:51:37 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2001-03-18 20:51:37 +08:00
|
|
|
#include <string.h>
|
2000-06-09 02:10:03 +08:00
|
|
|
|
|
|
|
#include "gimp.h"
|
2006-11-01 02:33:44 +08:00
|
|
|
#undef GIMP_DISABLE_DEPRECATED
|
|
|
|
#undef __GIMP_PATHS_PDB_H__
|
|
|
|
#include "gimppaths_pdb.h"
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION: gimppaths
|
|
|
|
* @title: gimppaths
|
|
|
|
* @short_description: Deprecated operations related to paths.
|
|
|
|
*
|
|
|
|
* Deprecated operations related to paths.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_list:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image to list the paths from.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @num_paths: The number of paths returned.
|
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_image_get_vectors() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: List of the paths belonging to this image.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-09 02:10:03 +08:00
|
|
|
gchar **
|
|
|
|
gimp_path_list (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint *num_paths)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gchar **path_list = NULL;
|
|
|
|
gint i;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-list",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
|
|
|
*num_paths = 0;
|
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
|
|
|
*num_paths = return_vals[1].data.d_int32;
|
|
|
|
path_list = g_new (gchar *, *num_paths);
|
|
|
|
for (i = 0; i < *num_paths; i++)
|
2006-04-12 18:38:15 +08:00
|
|
|
path_list[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return path_list;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_get_current:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image to get the current path from.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_image_get_active_vectors() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The name of the current path.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-09 02:10:03 +08:00
|
|
|
gchar *
|
|
|
|
gimp_path_get_current (gint32 image_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2003-07-09 21:18:56 +08:00
|
|
|
gchar *name = NULL;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-get-current",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2003-07-09 21:18:56 +08:00
|
|
|
name = g_strdup (return_vals[1].data.d_string);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-07-09 21:18:56 +08:00
|
|
|
return name;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_set_current:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image in which a path will become current.
|
2004-06-17 22:08:29 +08:00
|
|
|
* @name: The name of the path to make current.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_image_set_active_vectors() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_set_current (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-set-current",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-09 02:10:03 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2003-05-16 05:15:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_delete:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image to delete the path from.
|
2003-07-09 21:18:56 +08:00
|
|
|
* @name: The name of the path to delete.
|
2003-05-16 05:15:00 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_image_remove_vectors() instead.
|
2003-05-16 05:15:00 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-05-16 05:15:00 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_delete (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name)
|
2003-05-16 05:15:00 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-delete",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2003-05-16 05:15:00 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_path_get_points:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image to list the paths from.
|
2004-06-17 22:08:29 +08:00
|
|
|
* @name: The name of the path whose points should be listed.
|
2003-05-16 05:15:00 +08:00
|
|
|
* @path_closed: Return if the path is closed. (0 = path open, 1 = path closed).
|
|
|
|
* @num_path_point_details: The number of points returned. Each point is made up of (x, y, pnt_type) of floats.
|
2003-07-09 21:18:56 +08:00
|
|
|
* @points_pairs: The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points are returned in pixel resolution.
|
2003-05-16 05:15:00 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_stroke_get_points() instead.
|
2003-05-16 05:15:00 +08:00
|
|
|
*
|
|
|
|
* Returns: The type of the path. Currently only one type (1 = Bezier) is supported.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-05-16 05:15:00 +08:00
|
|
|
gint
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_get_points (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name,
|
|
|
|
gint *path_closed,
|
|
|
|
gint *num_path_point_details,
|
|
|
|
gdouble **points_pairs)
|
2003-05-16 05:15:00 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint path_type = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-get-points",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2003-05-16 05:15:00 +08:00
|
|
|
|
|
|
|
*num_path_point_details = 0;
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
path_type = return_vals[1].data.d_int32;
|
|
|
|
*path_closed = return_vals[2].data.d_int32;
|
|
|
|
*num_path_point_details = return_vals[3].data.d_int32;
|
|
|
|
*points_pairs = g_new (gdouble, *num_path_point_details);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (*points_pairs,
|
|
|
|
return_vals[4].data.d_floatarray,
|
|
|
|
*num_path_point_details * sizeof (gdouble));
|
2003-05-16 05:15:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return path_type;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_set_points:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image to set the paths in.
|
2004-06-17 22:08:29 +08:00
|
|
|
* @name: The name of the path to create. If it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @ptype: The type of the path. Currently only one type (1 = Bezier) is supported.
|
2004-06-17 22:08:29 +08:00
|
|
|
* @num_path_points: The number of elements in the array, i.e. the number of points in the path * 3. Each point is made up of (x, y, type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. Note that for BEZIER curves, points must be given in the following order: ACCACCAC... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If (num_path_points/3) % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC.
|
2003-07-09 21:18:56 +08:00
|
|
|
* @points_pairs: The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are returned in pixel resolution.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_stroke_new_from_points() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_set_points (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name,
|
|
|
|
gint ptype,
|
|
|
|
gint num_path_points,
|
|
|
|
const gdouble *points_pairs)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-set-points",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_INT32, ptype,
|
|
|
|
GIMP_PDB_INT32, num_path_points,
|
|
|
|
GIMP_PDB_FLOATARRAY, points_pairs,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-09 02:10:03 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_stroke_current:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image which contains the path to stroke.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_edit_stroke_vectors() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-09 02:10:03 +08:00
|
|
|
gimp_path_stroke_current (gint32 image_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-stroke-current",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-09 02:10:03 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_get_point_at_dist:
|
2006-03-24 05:17:16 +08:00
|
|
|
* @image_ID: The image the paths belongs to.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @distance: The distance along the path.
|
|
|
|
* @y_point: The y position of the point.
|
2004-12-15 06:36:40 +08:00
|
|
|
* @slope: The slope (dy / dx) at the specified point.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_stroke_get_point_at_dist() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The x position of the point.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-09 02:10:03 +08:00
|
|
|
gint
|
|
|
|
gimp_path_get_point_at_dist (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble distance,
|
|
|
|
gint *y_point,
|
|
|
|
gdouble *slope)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint x_point = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-get-point-at-dist",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_FLOAT, distance,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
|
|
|
x_point = return_vals[1].data.d_int32;
|
|
|
|
*y_point = return_vals[2].data.d_int32;
|
2004-12-15 06:36:40 +08:00
|
|
|
*slope = return_vals[3].data.d_float;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return x_point;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_get_tattoo:
|
|
|
|
* @image_ID: The image.
|
2004-06-17 22:08:29 +08:00
|
|
|
* @name: The name of the path whose tattoo should be obtained.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_get_tattoo() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2004-06-17 22:08:29 +08:00
|
|
|
* Returns: The tattoo associated with the named path.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-09 02:10:03 +08:00
|
|
|
gint
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_get_tattoo (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint tattoo = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-get-tattoo",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-09 02:10:03 +08:00
|
|
|
tattoo = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return tattoo;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-05-16 05:15:00 +08:00
|
|
|
* gimp_path_set_tattoo:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-07-09 21:18:56 +08:00
|
|
|
* @name: the name of the path whose tattoo should be set.
|
2003-05-16 05:15:00 +08:00
|
|
|
* @tattovalue: The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_set_tattoo() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-05-16 05:15:00 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-05-16 05:15:00 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_set_tattoo (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name,
|
|
|
|
gint tattovalue)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2003-05-16 05:15:00 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-set-tattoo",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_INT32, tattovalue,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2003-05-16 05:15:00 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-05-16 05:15:00 +08:00
|
|
|
return success;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-05-16 05:15:00 +08:00
|
|
|
* gimp_get_path_by_tattoo:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @tattoo: The tattoo of the required path.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_image_get_vectors_by_tattoo() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-05-16 05:15:00 +08:00
|
|
|
* Returns: The name of the path with the specified tattoo.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-05-16 05:15:00 +08:00
|
|
|
gchar *
|
|
|
|
gimp_get_path_by_tattoo (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint tattoo)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2003-07-09 21:18:56 +08:00
|
|
|
gchar *name = NULL;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-get-path-by-tattoo",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, tattoo,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2003-05-16 05:15:00 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2003-07-09 21:18:56 +08:00
|
|
|
name = g_strdup (return_vals[1].data.d_string);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2000-06-09 02:10:03 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2003-07-09 21:18:56 +08:00
|
|
|
return name;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_get_locked:
|
|
|
|
* @image_ID: The image.
|
2004-06-17 22:08:29 +08:00
|
|
|
* @name: The name of the path whose locked status should be obtained.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_get_linked() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2005-03-03 19:10:37 +08:00
|
|
|
* Returns: TRUE if the path is locked, FALSE otherwise.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-03-03 19:10:37 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_get_locked (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2005-03-03 19:10:37 +08:00
|
|
|
gboolean locked = FALSE;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-get-locked",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2005-03-03 19:10:37 +08:00
|
|
|
locked = return_vals[1].data.d_int32;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2005-03-03 19:10:37 +08:00
|
|
|
return locked;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_path_set_locked:
|
|
|
|
* @image_ID: The image.
|
2003-07-09 21:18:56 +08:00
|
|
|
* @name: the name of the path whose locked status should be set.
|
2005-03-03 19:10:37 +08:00
|
|
|
* @locked: Whether the path is locked.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_set_linked() instead.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_path_set_locked (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name,
|
|
|
|
gboolean locked)
|
2000-06-09 02:10:03 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-09 02:10:03 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-set-locked",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_INT32, locked,
|
|
|
|
GIMP_PDB_END);
|
2000-06-09 02:10:03 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-09 02:10:03 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-09 02:10:03 +08:00
|
|
|
}
|
2003-07-09 21:18:56 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_path_to_selection:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @name: The name of the path which should be made into selection.
|
|
|
|
* @op: The desired operation with current selection.
|
|
|
|
* @antialias: Antialias selection.
|
|
|
|
* @feather: Feather selection.
|
|
|
|
* @feather_radius_x: Feather radius x.
|
|
|
|
* @feather_radius_y: Feather radius y.
|
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_to_selection() instead.
|
2003-07-09 21:18:56 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-07-09 21:18:56 +08:00
|
|
|
gboolean
|
|
|
|
gimp_path_to_selection (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name,
|
|
|
|
GimpChannelOps op,
|
|
|
|
gboolean antialias,
|
|
|
|
gboolean feather,
|
|
|
|
gdouble feather_radius_x,
|
|
|
|
gdouble feather_radius_y)
|
2003-07-09 21:18:56 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-to-selection",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_INT32, op,
|
|
|
|
GIMP_PDB_INT32, antialias,
|
|
|
|
GIMP_PDB_INT32, feather,
|
|
|
|
GIMP_PDB_FLOAT, feather_radius_x,
|
|
|
|
GIMP_PDB_FLOAT, feather_radius_y,
|
|
|
|
GIMP_PDB_END);
|
2003-07-09 21:18:56 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2003-09-22 03:03:10 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_path_import:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @filename: The name of the SVG file to import.
|
|
|
|
* @merge: Merge paths into a single vectors object.
|
2003-09-25 08:39:46 +08:00
|
|
|
* @scale: Scale the SVG to image dimensions.
|
2003-09-22 03:03:10 +08:00
|
|
|
*
|
2010-07-13 05:11:56 +08:00
|
|
|
* Deprecated: Use gimp_vectors_import_from_file() instead.
|
2003-09-22 03:03:10 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-09-22 03:03:10 +08:00
|
|
|
gboolean
|
|
|
|
gimp_path_import (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *filename,
|
|
|
|
gboolean merge,
|
|
|
|
gboolean scale)
|
2003-09-22 03:03:10 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-path-import",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, filename,
|
|
|
|
GIMP_PDB_INT32, merge,
|
|
|
|
GIMP_PDB_INT32, scale,
|
|
|
|
GIMP_PDB_END);
|
2003-09-22 03:03:10 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|