pdb: remove deprecated vectors procedures

that have a replacement with identical signature. Register them as
compat aliases with the PDB instead. Implement the libgimp API
manually, calling the new item functions.
This commit is contained in:
Michael Natterer 2010-09-15 21:13:22 +02:00
parent f1cf31f9da
commit 97b35ab332
10 changed files with 264 additions and 1111 deletions

View File

@ -423,7 +423,19 @@ gimp_pdb_compat_procs_register (GimpPDB *pdb,
/* deprecations since 2.2 */
{ "gimp-layer-get-preserve-trans", "gimp-layer-get-lock-alpha" },
{ "gimp-layer-set-preserve-trans", "gimp-layer-set-lock-alpha" }
{ "gimp-layer-set-preserve-trans", "gimp-layer-set-lock-alpha" },
/* deprecations since 2.6 */
{ "gimp-vectors-is-valid", "gimp-item-is-valid" },
{ "gimp-vectors-get-image", "gimp-item-get-image" },
{ "gimp-vectors-get-name", "gimp-item-get-name" },
{ "gimp-vectors-set-name", "gimp-item-set-name" },
{ "gimp-vectors-get-visible", "gimp-item-get-visible" },
{ "gimp-vectors-set-visible", "gimp-item-set-visible" },
{ "gimp-vectors-get-linked", "gimp-item-get-linked" },
{ "gimp-vectors-set-linked", "gimp-item-set-linked" },
{ "gimp-vectors-get-tattoo", "gimp-item-get-tattoo" },
{ "gimp-vectors-set-tattoo", "gimp-item-set-tattoo" }
};
g_return_if_fail (GIMP_IS_PDB (pdb));

View File

@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 658 procedures registered total */
/* 648 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)

View File

@ -47,29 +47,6 @@
#include "gimp-intl.h"
static GValueArray *
vectors_is_valid_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
GValueArray *return_vals;
GimpVectors *vectors;
gboolean valid = FALSE;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
valid = (GIMP_IS_VECTORS (vectors) &&
! gimp_item_is_removed (GIMP_ITEM (vectors)));
return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
g_value_set_boolean (&return_vals->values[1], valid);
return return_vals;
}
static GValueArray *
vectors_new_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -178,247 +155,6 @@ vectors_copy_invoker (GimpProcedure *procedure,
return return_vals;
}
static GValueArray *
vectors_get_image_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
GimpImage *image = NULL;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
image = gimp_item_get_image (GIMP_ITEM (vectors));
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_image (&return_vals->values[1], image);
return return_vals;
}
static GValueArray *
vectors_get_name_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gchar *name = NULL;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
name = g_strdup (gimp_object_get_name (vectors));
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], name);
return return_vals;
}
static GValueArray *
vectors_set_name_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
const gchar *name;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
name = g_value_get_string (&args->values[1]);
if (success)
{
success = gimp_item_rename (GIMP_ITEM (vectors), name, error);
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_get_visible_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gboolean visible = FALSE;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
visible = gimp_item_get_visible (GIMP_ITEM (vectors));
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (&return_vals->values[1], visible);
return return_vals;
}
static GValueArray *
vectors_set_visible_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gboolean visible;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
visible = g_value_get_boolean (&args->values[1]);
if (success)
{
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_get_linked_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gboolean linked = FALSE;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
linked = gimp_item_get_linked (GIMP_ITEM (vectors));
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (&return_vals->values[1], linked);
return return_vals;
}
static GValueArray *
vectors_set_linked_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gboolean linked;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
linked = g_value_get_boolean (&args->values[1]);
if (success)
{
gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_get_tattoo_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gint32 tattoo = 0;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], tattoo);
return return_vals;
}
static GValueArray *
vectors_set_tattoo_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 tattoo;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
tattoo = g_value_get_int (&args->values[1]);
if (success)
{
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_get_strokes_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -1546,35 +1282,6 @@ register_vectors_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-vectors-is-valid
*/
procedure = gimp_procedure_new (vectors_is_valid_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-is-valid");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-is-valid",
"Deprecated: Use 'gimp-item-is-valid' instead.",
"Deprecated: Use 'gimp-item-is-valid' instead.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2007",
"gimp-item-is-valid");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object to check",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Whether the vectors ID is valid",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-new
*/
@ -1675,269 +1382,6 @@ register_vectors_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-image
*/
procedure = gimp_procedure_new (vectors_get_image_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-get-image");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-get-image",
"Deprecated: Use 'gimp-item-get-image' instead.",
"Deprecated: Use 'gimp-item-get-image' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-get-image");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_image_id ("image",
"image",
"The vectors image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-name
*/
procedure = gimp_procedure_new (vectors_get_name_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-get-name");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-get-name",
"Deprecated: Use 'gimp-item-get-name' instead.",
"Deprecated: Use 'gimp-item-get-name' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-get-name");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_string ("name",
"name",
"The name of the vectors object",
FALSE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-set-name
*/
procedure = gimp_procedure_new (vectors_set_name_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-set-name");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-set-name",
"Deprecated: Use 'gimp-item-set-name' instead.",
"Deprecated: Use 'gimp-item-set-name' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-set-name");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("name",
"name",
"the new name of the path",
FALSE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-visible
*/
procedure = gimp_procedure_new (vectors_get_visible_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-get-visible");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-get-visible",
"Deprecated: Use 'gimp-item-get-visible' instead.",
"Deprecated: Use 'gimp-item-get-visible' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-get-visible");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("visible",
"visible",
"TRUE if the path is visible, FALSE otherwise",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-set-visible
*/
procedure = gimp_procedure_new (vectors_set_visible_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-set-visible");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-set-visible",
"Deprecated: Use 'gimp-item-set-visible' instead.",
"Deprecated: Use 'gimp-item-set-visible' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-set-visible");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("visible",
"visible",
"Whether the path is visible",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-linked
*/
procedure = gimp_procedure_new (vectors_get_linked_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-get-linked");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-get-linked",
"Deprecated: Use 'gimp-item-get-linked' instead.",
"Deprecated: Use 'gimp-item-get-linked' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-get-linked");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("linked",
"linked",
"TRUE if the path is linked, FALSE otherwise",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-set-linked
*/
procedure = gimp_procedure_new (vectors_set_linked_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-set-linked");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-set-linked",
"Deprecated: Use 'gimp-item-set-linked' instead.",
"Deprecated: Use 'gimp-item-set-linked' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-set-linked");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("linked",
"linked",
"Whether the path is linked",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-tattoo
*/
procedure = gimp_procedure_new (vectors_get_tattoo_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-get-tattoo");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-get-tattoo",
"Deprecated: Use 'gimp-item-get-tattoo' instead.",
"Deprecated: Use 'gimp-item-get-tattoo' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-get-tattoo");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("tattoo",
"tattoo",
"The vectors tattoo",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-set-tattoo
*/
procedure = gimp_procedure_new (vectors_set_tattoo_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-set-tattoo");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-set-tattoo",
"Deprecated: Use 'gimp-item-set-tattoo' instead.",
"Deprecated: Use 'gimp-item-set-tattoo' instead.",
"Simon Budig",
"Simon Budig",
"2005",
"gimp-item-set-tattoo");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("tattoo",
"tattoo",
"the new tattoo",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-strokes
*/

View File

@ -226,6 +226,8 @@ libgimp_2_0_la_sources = \
gimptile.h \
gimpunitcache.c \
gimpunitcache.h \
gimpvectors.c \
gimpvectors.h \
stdplugins-intl.h \
libgimp-intl.h
@ -326,6 +328,7 @@ gimpinclude_HEADERS = \
gimpregioniterator.h \
gimpselection.h \
gimptile.h \
gimpvectors.h \
\
gimpui.h \
gimpuitypes.h \

View File

@ -54,6 +54,7 @@
#include <libgimp/gimpregioniterator.h>
#include <libgimp/gimpselection.h>
#include <libgimp/gimptile.h>
#include <libgimp/gimpvectors.h>
#include <libgimp/gimp_pdb.h>

197
libgimp/gimpvectors.c Normal file
View File

@ -0,0 +1,197 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpvectors.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 3 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, see
* <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <string.h>
#include "gimp.h"
#undef GIMP_DISABLE_DEPRECATED
#undef __GIMP_VECTORS_H__
#include "gimpvectors.h"
/**
* gimp_vectors_is_valid:
* @vectors_ID: The vectors object to check.
*
* Deprecated: Use gimp_item_is_valid() instead.
*
* Returns: Whether the vectors ID is valid.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_is_valid (gint32 vectors_ID)
{
return gimp_item_is_valid (vectors_ID);
}
/**
* gimp_vectors_get_image:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_image() instead.
*
* Returns: The vectors image.
*
* Since: GIMP 2.4
*/
gint32
gimp_vectors_get_image (gint32 vectors_ID)
{
return gimp_item_get_image (vectors_ID);
}
/**
* gimp_vectors_get_name:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_name() instead.
*
* Returns: The name of the vectors object.
*
* Since: GIMP 2.4
*/
gchar *
gimp_vectors_get_name (gint32 vectors_ID)
{
return gimp_item_get_name (vectors_ID);
}
/**
* gimp_vectors_set_name:
* @vectors_ID: The vectors object.
* @name: the new name of the path.
*
* Deprecated: Use gimp_item_set_name() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_name (gint32 vectors_ID,
const gchar *name)
{
return gimp_item_set_name (vectors_ID, name);
}
/**
* gimp_vectors_get_visible:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_visible() instead.
*
* Returns: TRUE if the path is visible, FALSE otherwise.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_get_visible (gint32 vectors_ID)
{
return gimp_vectors_get_visible (vectors_ID);
}
/**
* gimp_vectors_set_visible:
* @vectors_ID: The vectors object.
* @visible: Whether the path is visible.
*
* Deprecated: Use gimp_item_set_visible() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_visible (gint32 vectors_ID,
gboolean visible)
{
return gimp_item_set_visible (vectors_ID, visible);
}
/**
* gimp_vectors_get_linked:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_linked() instead.
*
* Returns: TRUE if the path is linked, FALSE otherwise.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_get_linked (gint32 vectors_ID)
{
return gimp_item_get_linked (vectors_ID);
}
/**
* gimp_vectors_set_linked:
* @vectors_ID: The vectors object.
* @linked: Whether the path is linked.
*
* Deprecated: Use gimp_item_set_linked() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_linked (gint32 vectors_ID,
gboolean linked)
{
return gimp_item_set_linked (vectors_ID, linked);
}
/**
* gimp_vectors_get_tattoo:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_tattoo() instead.
*
* Returns: The vectors tattoo.
*
* Since: GIMP 2.4
*/
gint
gimp_vectors_get_tattoo (gint32 vectors_ID)
{
return gimp_item_get_tattoo (vectors_ID);
}
/**
* gimp_vectors_set_tattoo:
* @vectors_ID: The vectors object.
* @tattoo: the new tattoo.
*
* Deprecated: Use gimp_item_set_tattoo() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_tattoo (gint32 vectors_ID,
gint tattoo)
{
return gimp_vectors_set_tattoo (vectors_ID, tattoo);
}

48
libgimp/gimpvectors.h Normal file
View File

@ -0,0 +1,48 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpvectors.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 3 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, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VECTORS_H__
#define __GIMP_VECTORS_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_vectors_is_valid (gint32 vectors_ID);
gint32 gimp_vectors_get_image (gint32 vectors_ID);
gchar * gimp_vectors_get_name (gint32 vectors_ID);
gboolean gimp_vectors_set_name (gint32 vectors_ID,
const gchar *name);
gboolean gimp_vectors_get_visible (gint32 vectors_ID);
gboolean gimp_vectors_set_visible (gint32 vectors_ID,
gboolean visible);
gboolean gimp_vectors_get_linked (gint32 vectors_ID);
gboolean gimp_vectors_set_linked (gint32 vectors_ID,
gboolean linked);
gint gimp_vectors_get_tattoo (gint32 vectors_ID);
gboolean gimp_vectors_set_tattoo (gint32 vectors_ID,
gint tattoo);
#endif /* GIMP_DISABLE_DEPRECATED */
G_END_DECLS
#endif /* __GIMP_VECTORS_H__ */

View File

@ -39,36 +39,6 @@
**/
/**
* gimp_vectors_is_valid:
* @vectors_ID: The vectors object to check.
*
* Deprecated: Use gimp_item_is_valid() instead.
*
* Returns: Whether the vectors ID is valid.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_is_valid (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean valid = FALSE;
return_vals = gimp_run_procedure ("gimp-vectors-is-valid",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
valid = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return valid;
}
/**
* gimp_vectors_new:
* @image_ID: The image.
@ -174,284 +144,6 @@ gimp_vectors_copy (gint32 vectors_ID)
return vectors_copy_ID;
}
/**
* gimp_vectors_get_image:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_image() instead.
*
* Returns: The vectors image.
*
* Since: GIMP 2.4
*/
gint32
gimp_vectors_get_image (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 image_ID = -1;
return_vals = gimp_run_procedure ("gimp-vectors-get-image",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
image_ID = return_vals[1].data.d_image;
gimp_destroy_params (return_vals, nreturn_vals);
return image_ID;
}
/**
* gimp_vectors_get_name:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_name() instead.
*
* Returns: The name of the vectors object.
*
* Since: GIMP 2.4
*/
gchar *
gimp_vectors_get_name (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *name = NULL;
return_vals = gimp_run_procedure ("gimp-vectors-get-name",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return name;
}
/**
* gimp_vectors_set_name:
* @vectors_ID: The vectors object.
* @name: the new name of the path.
*
* Deprecated: Use gimp_item_set_name() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_name (gint32 vectors_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-vectors-set-name",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_vectors_get_visible:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_visible() instead.
*
* Returns: TRUE if the path is visible, FALSE otherwise.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_get_visible (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean visible = FALSE;
return_vals = gimp_run_procedure ("gimp-vectors-get-visible",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
visible = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return visible;
}
/**
* gimp_vectors_set_visible:
* @vectors_ID: The vectors object.
* @visible: Whether the path is visible.
*
* Deprecated: Use gimp_item_set_visible() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_visible (gint32 vectors_ID,
gboolean visible)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-vectors-set-visible",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_INT32, visible,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_vectors_get_linked:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_linked() instead.
*
* Returns: TRUE if the path is linked, FALSE otherwise.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_get_linked (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean linked = FALSE;
return_vals = gimp_run_procedure ("gimp-vectors-get-linked",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
linked = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return linked;
}
/**
* gimp_vectors_set_linked:
* @vectors_ID: The vectors object.
* @linked: Whether the path is linked.
*
* Deprecated: Use gimp_item_set_linked() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_linked (gint32 vectors_ID,
gboolean linked)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-vectors-set-linked",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_INT32, linked,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_vectors_get_tattoo:
* @vectors_ID: The vectors object.
*
* Deprecated: Use gimp_item_get_tattoo() instead.
*
* Returns: The vectors tattoo.
*
* Since: GIMP 2.4
*/
gint
gimp_vectors_get_tattoo (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint tattoo = 0;
return_vals = gimp_run_procedure ("gimp-vectors-get-tattoo",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
tattoo = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return tattoo;
}
/**
* gimp_vectors_set_tattoo:
* @vectors_ID: The vectors object.
* @tattoo: the new tattoo.
*
* Deprecated: Use gimp_item_set_tattoo() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_set_tattoo (gint32 vectors_ID,
gint tattoo)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-vectors-set-tattoo",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_INT32, tattoo,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_vectors_get_strokes:
* @vectors_ID: The vectors object.

View File

@ -28,29 +28,11 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_vectors_is_valid (gint32 vectors_ID);
#endif /* GIMP_DISABLE_DEPRECATED */
gint32 gimp_vectors_new (gint32 image_ID,
const gchar *name);
gint32 gimp_vectors_new_from_text_layer (gint32 image_ID,
gint32 layer_ID);
gint32 gimp_vectors_copy (gint32 vectors_ID);
#ifndef GIMP_DISABLE_DEPRECATED
gint32 gimp_vectors_get_image (gint32 vectors_ID);
gchar* gimp_vectors_get_name (gint32 vectors_ID);
gboolean gimp_vectors_set_name (gint32 vectors_ID,
const gchar *name);
gboolean gimp_vectors_get_visible (gint32 vectors_ID);
gboolean gimp_vectors_set_visible (gint32 vectors_ID,
gboolean visible);
gboolean gimp_vectors_get_linked (gint32 vectors_ID);
gboolean gimp_vectors_set_linked (gint32 vectors_ID,
gboolean linked);
gint gimp_vectors_get_tattoo (gint32 vectors_ID);
gboolean gimp_vectors_set_tattoo (gint32 vectors_ID,
gint tattoo);
#endif /* GIMP_DISABLE_DEPRECATED */
gint* gimp_vectors_get_strokes (gint32 vectors_ID,
gint *num_strokes);
gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID,

View File

@ -14,30 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
sub vectors_is_valid {
&std_pdb_deprecated ('gimp-item-is-valid');
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors', no_validate => 1,
desc => 'The vectors object to check' }
);
@outargs = (
{ name => 'valid', type => 'boolean',
desc => 'Whether the vectors ID is valid' }
);
%invoke = (
code => <<'CODE'
{
valid = (GIMP_IS_VECTORS (vectors) &&
! gimp_item_is_removed (GIMP_ITEM (vectors)));
}
CODE
);
}
sub vectors_new {
$blurb = 'Creates a new empty vectors object.';
@ -70,7 +46,6 @@ CODE
);
}
# Get Vectors from text layer
sub vectors_new_from_text_layer {
$blurb = 'Creates a new vectors object from a text layer.';
@ -147,201 +122,6 @@ CODE
);
}
sub vectors_get_image {
&std_pdb_deprecated ('gimp-item-get-image');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'image', type => 'image',
desc => 'The vectors image' }
);
%invoke = (
code => <<"CODE"
{
image = gimp_item_get_image (GIMP_ITEM (vectors));
}
CODE
);
}
sub vectors_get_name {
&std_pdb_deprecated ('gimp-item-get-name');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'name', type => 'string',
desc => 'The name of the vectors object' }
);
%invoke = (
code => <<"CODE"
{
name = g_strdup (gimp_object_get_name (vectors));
}
CODE
);
}
sub vectors_set_name {
&std_pdb_deprecated ('gimp-item-set-name');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'name', type => 'string',
desc => 'the new name of the path' }
);
%invoke = (
code => <<"CODE"
{
success = gimp_item_rename (GIMP_ITEM (vectors), name, error);
}
CODE
);
}
sub vectors_get_visible {
&std_pdb_deprecated ('gimp-item-get-visible');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'visible', type => 'boolean',
desc => 'TRUE if the path is visible, FALSE otherwise' }
);
%invoke = (
code => <<"CODE"
{
visible = gimp_item_get_visible (GIMP_ITEM (vectors));
}
CODE
);
}
sub vectors_set_visible {
&std_pdb_deprecated ('gimp-item-set-visible');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'visible', type => 'boolean',
desc => 'Whether the path is visible' }
);
%invoke = (
code => <<"CODE"
{
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
}
CODE
);
}
sub vectors_get_linked {
&std_pdb_deprecated ('gimp-item-get-linked');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'linked', type => 'boolean',
desc => 'TRUE if the path is linked, FALSE otherwise' }
);
%invoke = (
code => <<"CODE"
{
linked = gimp_item_get_linked (GIMP_ITEM (vectors));
}
CODE
);
}
sub vectors_set_linked {
&std_pdb_deprecated ('gimp-item-set-linked');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'linked', type => 'boolean',
desc => 'Whether the path is linked' }
);
%invoke = (
code => <<"CODE"
{
gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
}
CODE
);
}
sub vectors_get_tattoo {
&std_pdb_deprecated ('gimp-item-get-tattoo');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'tattoo', type => 'int32',
desc => 'The vectors tattoo' }
);
%invoke = (
code => <<"CODE"
{
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
}
CODE
);
}
sub vectors_set_tattoo {
&std_pdb_deprecated ('gimp-item-set-tattoo');
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'tattoo', type => 'int32',
desc => 'the new tattoo' }
);
%invoke = (
code => <<"CODE"
{
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
}
CODE
);
}
sub vectors_get_strokes {
$blurb = 'List the strokes associated with the passed path.';
@ -1497,15 +1277,9 @@ CODE
"gimppdb-utils.h"
"gimp-intl.h");
@procs = qw(vectors_is_valid
vectors_new
@procs = qw(vectors_new
vectors_new_from_text_layer
vectors_copy
vectors_get_image
vectors_get_name vectors_set_name
vectors_get_visible vectors_set_visible
vectors_get_linked vectors_set_linked
vectors_get_tattoo vectors_set_tattoo
vectors_get_strokes
vectors_stroke_get_length
vectors_stroke_get_point_at_dist