mirror of https://github.com/GNOME/gimp.git
app/vectors/Makefile.am app/vectors/vectors-enums.h added new file for the
2006-10-24 Simon Budig <simon@gimp.org> * app/vectors/Makefile.am * app/vectors/vectors-enums.h * app/vectors/vectors-types.h: added new file for the vectors enums, adjusted Makefile.am for the generation of vectors-enums.c * tools/pdbgen/Makefile.am * tools/pdbgen/pdb/vectors.pdb: Added implementation for gimp-vectors-stroke-get-points which returns the control points for the stroke. Renamed gimp-vectors-stroke-remove to gimp-vectors-remove-stroke. ATTENTION: this breaks scripts using this function, a simple name change is enough to make it work again. Also please note that yosh reordered the return values of gimp-vectors-stroke-interpolate, so your scripts need adjustment there as well. * tools/pdbgen/pdb/paths.pdb: deprecate gimp-path-get-points. Yay! * libgimp/gimp.def: added new symbol * plug-ins/pygimp/pygimp-vectors.c: reflect name change of gimp_vectors_remove_stroke (). * app/vectors/vectors-enums.c * app/pdb/internal_procs.c * app/pdb/paths_cmds.c * app/pdb/vectors_cmds.c * devel-docs/libgimp/tmpl/gimpvectors.sgml * libgimp/gimpenums.c.tail * libgimp/gimpenums.h * libgimp/gimppaths_pdb.[ch] * libgimp/gimpvectors_pdb.[ch] * tools/pdbgen/enums.pl: regenerated.
This commit is contained in:
parent
41b1d526b8
commit
f57321511e
37
ChangeLog
37
ChangeLog
|
@ -1,3 +1,40 @@
|
|||
2006-10-24 Simon Budig <simon@gimp.org>
|
||||
|
||||
* app/vectors/Makefile.am
|
||||
* app/vectors/vectors-enums.h
|
||||
* app/vectors/vectors-types.h: added new file for the vectors enums,
|
||||
adjusted Makefile.am for the generation of vectors-enums.c
|
||||
|
||||
* tools/pdbgen/Makefile.am
|
||||
* tools/pdbgen/pdb/vectors.pdb: Added implementation for
|
||||
gimp-vectors-stroke-get-points which returns the control points for
|
||||
the stroke.
|
||||
Renamed gimp-vectors-stroke-remove to gimp-vectors-remove-stroke.
|
||||
|
||||
ATTENTION: this breaks scripts using this function, a simple name
|
||||
change is enough to make it work again.
|
||||
Also please note that yosh reordered the return values of
|
||||
gimp-vectors-stroke-interpolate, so your scripts need adjustment
|
||||
there as well.
|
||||
|
||||
* tools/pdbgen/pdb/paths.pdb: deprecate gimp-path-get-points. Yay!
|
||||
|
||||
* libgimp/gimp.def: added new symbol
|
||||
|
||||
* plug-ins/pygimp/pygimp-vectors.c: reflect name change of
|
||||
gimp_vectors_remove_stroke ().
|
||||
|
||||
* app/vectors/vectors-enums.c
|
||||
* app/pdb/internal_procs.c
|
||||
* app/pdb/paths_cmds.c
|
||||
* app/pdb/vectors_cmds.c
|
||||
* devel-docs/libgimp/tmpl/gimpvectors.sgml
|
||||
* libgimp/gimpenums.c.tail
|
||||
* libgimp/gimpenums.h
|
||||
* libgimp/gimppaths_pdb.[ch]
|
||||
* libgimp/gimpvectors_pdb.[ch]
|
||||
* tools/pdbgen/enums.pl: regenerated.
|
||||
|
||||
2006-10-24 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* tools/gimp-mkenums (parse_trigraph): quote "true" to fix warning
|
||||
|
|
|
@ -75,7 +75,7 @@ void register_undo_procs (GimpPDB *pdb);
|
|||
void register_unit_procs (GimpPDB *pdb);
|
||||
void register_vectors_procs (GimpPDB *pdb);
|
||||
|
||||
/* 533 procedures registered total */
|
||||
/* 534 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (GimpPDB *pdb)
|
||||
|
|
|
@ -807,12 +807,12 @@ register_paths_procs (GimpPDB *pdb)
|
|||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-path-get-points");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-path-get-points",
|
||||
"List the points associated with the named path.",
|
||||
"List the points associated with the named path.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1999",
|
||||
NULL);
|
||||
"This procedure is deprecated! Use 'gimp-vectors-stroke-get-points' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-vectors-stroke-get-points' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-vectors-stroke-get-points");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
|
|
|
@ -428,7 +428,7 @@ vectors_stroke_get_point_at_dist_invoker (GimpProcedure *procedure,
|
|||
}
|
||||
|
||||
static GValueArray *
|
||||
vectors_stroke_remove_invoker (GimpProcedure *procedure,
|
||||
vectors_remove_stroke_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
|
@ -543,6 +543,72 @@ vectors_stroke_scale_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
vectors_stroke_get_points_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpVectors *vectors;
|
||||
gint32 stroke_id;
|
||||
gint32 type = 0;
|
||||
gint32 num_points = 0;
|
||||
gdouble *controlpoints = NULL;
|
||||
gboolean closed = FALSE;
|
||||
|
||||
vectors = gimp_value_get_vectors (&args->values[0], gimp);
|
||||
stroke_id = g_value_get_int (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
|
||||
|
||||
if (stroke && GIMP_IS_BEZIER_STROKE (stroke))
|
||||
{
|
||||
GArray *points_array;
|
||||
gint i;
|
||||
|
||||
points_array = gimp_stroke_control_points_get (stroke, &closed);
|
||||
|
||||
if (points_array)
|
||||
{
|
||||
num_points = points_array->len;
|
||||
controlpoints = g_new (gdouble, num_points * 2);
|
||||
|
||||
type = GIMP_VECTORS_STROKE_TYPE_BEZIER;
|
||||
for (i = 0; i < num_points; i++)
|
||||
{
|
||||
controlpoints[2*i] = g_array_index (points_array,
|
||||
GimpAnchor, i).position.x;
|
||||
controlpoints[2*i+1] = g_array_index (points_array,
|
||||
GimpAnchor, i).position.y;
|
||||
}
|
||||
g_array_free (points_array, TRUE);
|
||||
num_points *= 2;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_int (&return_vals->values[1], type);
|
||||
g_value_set_int (&return_vals->values[2], num_points);
|
||||
gimp_value_take_floatarray (&return_vals->values[3], controlpoints, num_points);
|
||||
g_value_set_boolean (&return_vals->values[4], closed);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
vectors_stroke_interpolate_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1305,12 +1371,12 @@ register_vectors_procs (GimpPDB *pdb)
|
|||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-stroke-remove
|
||||
* gimp-vectors-remove-stroke
|
||||
*/
|
||||
procedure = gimp_procedure_new (vectors_stroke_remove_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-vectors-stroke-remove");
|
||||
procedure = gimp_procedure_new (vectors_remove_stroke_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-vectors-remove-stroke");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-stroke-remove",
|
||||
"gimp-vectors-remove-stroke",
|
||||
"remove the stroke from a vectors object.",
|
||||
"Remove the stroke from a vectors object.",
|
||||
"Simon Budig",
|
||||
|
@ -1440,6 +1506,57 @@ register_vectors_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-stroke-get-points
|
||||
*/
|
||||
procedure = gimp_procedure_new (vectors_stroke_get_points_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-vectors-stroke-get-points");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-stroke-get-points",
|
||||
"returns the control points of a stroke.",
|
||||
"returns the control points of a stroke. The interpretation of the coordinates returned depends on the type of the stroke. For Gimp 2.4 this is always a bezier stroke, where the coordinates are the control points.",
|
||||
"Simon Budig",
|
||||
"Simon Budig",
|
||||
"2006",
|
||||
NULL);
|
||||
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 ("stroke-id",
|
||||
"stroke id",
|
||||
"The stroke ID",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("type",
|
||||
"type",
|
||||
"type of the stroke (always bezier for now).",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-points",
|
||||
"num points",
|
||||
"The number of floats returned.",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("controlpoints",
|
||||
"controlpoints",
|
||||
"List of the control points for the stroke (x0, y0, x1, y1, ...).",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("closed",
|
||||
"closed",
|
||||
"Whether the stroke is closed or not.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-stroke-interpolate
|
||||
*/
|
||||
|
|
|
@ -16,6 +16,7 @@ INCLUDES = \
|
|||
noinst_LIBRARIES = libappvectors.a
|
||||
|
||||
libappvectors_a_SOURCES = \
|
||||
vectors-enums.h \
|
||||
vectors-types.h \
|
||||
gimpanchor.c \
|
||||
gimpanchor.h \
|
||||
|
@ -36,4 +37,22 @@ libappvectors_a_SOURCES = \
|
|||
gimpvectors-warp.c \
|
||||
gimpvectors-warp.h
|
||||
|
||||
libappvectors_a_built_sources = \
|
||||
vectors-enums.c
|
||||
|
||||
EXTRA_DIST = makefile.msc
|
||||
|
||||
$(srcdir)/vectors-enums.c: $(srcdir)/vectors-enums.h $(GIMP_MKENUMS)
|
||||
$(GIMP_MKENUMS) \
|
||||
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"vectors-enums.h\"\n#include \"gimp-intl.h\"" \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
|
||||
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||
--vtail " { 0, NULL, NULL }\n };\n" \
|
||||
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
|
||||
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
|
||||
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
|
||||
$(srcdir)/vectors-enums.h > xgen-cec \
|
||||
&& cp xgen-cec $(@F) \
|
||||
&& rm -f xgen-cec
|
||||
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
/* Generated data (by gimp-mkenums) */
|
||||
|
||||
#include "config.h"
|
||||
#include <glib-object.h>
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
#include "vectors-enums.h"
|
||||
#include "gimp-intl.h"
|
||||
|
||||
/* enumerations from "./vectors-enums.h" */
|
||||
GType
|
||||
gimp_vectors_stroke_type_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_VECTORS_STROKE_TYPE_BEZIER, "GIMP_VECTORS_STROKE_TYPE_BEZIER", "bezier" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_VECTORS_STROKE_TYPE_BEZIER, "GIMP_VECTORS_STROKE_TYPE_BEZIER", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
type = g_enum_register_static ("GimpVectorsStrokeType", values);
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
/* Generated data ends here */
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* vectors-enums.h
|
||||
* Copyright (C) 2006 Simon Budig <simon@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __VECTORS_ENUMS_H__
|
||||
#define __VECTORS_ENUMS_H__
|
||||
|
||||
#define GIMP_TYPE_VECTORS_STROKE_TYPE (gimp_vectors_stroke_type_get_type ())
|
||||
|
||||
GType gimp_vectors_stroke_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_VECTORS_STROKE_TYPE_BEZIER
|
||||
} GimpVectorsStrokeType;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
GIMP_ANCHOR_ANCHOR,
|
||||
GIMP_ANCHOR_CONTROL
|
||||
} GimpAnchorType;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
GIMP_ANCHOR_FEATURE_NONE,
|
||||
GIMP_ANCHOR_FEATURE_EDGE,
|
||||
GIMP_ANCHOR_FEATURE_ALIGNED,
|
||||
GIMP_ANCHOR_FEATURE_SYMMETRIC
|
||||
} GimpAnchorFeatureType;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
EXTEND_SIMPLE,
|
||||
EXTEND_EDITABLE
|
||||
} GimpVectorExtendMode;
|
||||
|
||||
#endif /* __VECTORS_ENUMS_H__ */
|
|
@ -24,27 +24,7 @@
|
|||
|
||||
#include "core/core-types.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ANCHOR_ANCHOR,
|
||||
GIMP_ANCHOR_CONTROL
|
||||
} GimpAnchorType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ANCHOR_FEATURE_NONE,
|
||||
GIMP_ANCHOR_FEATURE_EDGE,
|
||||
GIMP_ANCHOR_FEATURE_ALIGNED,
|
||||
GIMP_ANCHOR_FEATURE_SYMMETRIC
|
||||
} GimpAnchorFeatureType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EXTEND_SIMPLE,
|
||||
EXTEND_EDITABLE
|
||||
} GimpVectorExtendMode;
|
||||
|
||||
#include "vectors/vectors-enums.h"
|
||||
|
||||
typedef struct _GimpAnchor GimpAnchor;
|
||||
|
||||
|
|
|
@ -187,16 +187,6 @@ gimpvectors
|
|||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vectors_stroke_remove ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vectors_ID:
|
||||
@stroke_id:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vectors_stroke_get_length ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -204,7 +194,7 @@ gimpvectors
|
|||
|
||||
@vectors_ID:
|
||||
@stroke_id:
|
||||
@prescision:
|
||||
@precision:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
@ -216,7 +206,8 @@ gimpvectors
|
|||
@vectors_ID:
|
||||
@stroke_id:
|
||||
@dist:
|
||||
@prescision:
|
||||
@precision:
|
||||
@x_point:
|
||||
@y_point:
|
||||
@slope:
|
||||
@valid:
|
||||
|
@ -230,9 +221,9 @@ gimpvectors
|
|||
|
||||
@vectors_ID:
|
||||
@stroke_id:
|
||||
@prescision:
|
||||
@precision:
|
||||
@num_coords:
|
||||
@coords:
|
||||
@closed:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
|
|
@ -630,6 +630,7 @@ EXPORTS
|
|||
gimp_vectors_stroke_remove
|
||||
gimp_vectors_stroke_scale
|
||||
gimp_vectors_stroke_translate
|
||||
gimp_vectors_stroke_type_get_type
|
||||
gimp_vectors_to_selection
|
||||
gimp_version
|
||||
gimp_wm_class
|
||||
|
|
|
@ -4,6 +4,8 @@ typedef GType (* GimpGetTypeFunc) (void);
|
|||
static const GimpGetTypeFunc get_type_funcs[] =
|
||||
{
|
||||
gimp_add_mask_type_get_type,
|
||||
gimp_anchor_feature_type_get_type,
|
||||
gimp_anchor_type_get_type,
|
||||
gimp_blend_mode_get_type,
|
||||
gimp_brush_application_mode_get_type,
|
||||
gimp_brush_generated_shape_get_type,
|
||||
|
@ -47,12 +49,16 @@ static const GimpGetTypeFunc get_type_funcs[] =
|
|||
gimp_size_type_get_type,
|
||||
gimp_stack_trace_mode_get_type,
|
||||
gimp_transfer_mode_get_type,
|
||||
gimp_transform_direction_get_type
|
||||
gimp_transform_direction_get_type,
|
||||
gimp_vector_extend_mode_get_type,
|
||||
gimp_vectors_stroke_type_get_type
|
||||
};
|
||||
|
||||
static const gchar * const type_names[] =
|
||||
{
|
||||
"GimpAddMaskType",
|
||||
"GimpAnchorFeatureType",
|
||||
"GimpAnchorType",
|
||||
"GimpBlendMode",
|
||||
"GimpBrushApplicationMode",
|
||||
"GimpBrushGeneratedShape",
|
||||
|
@ -96,7 +102,9 @@ static const gchar * const type_names[] =
|
|||
"GimpSizeType",
|
||||
"GimpStackTraceMode",
|
||||
"GimpTransferMode",
|
||||
"GimpTransformDirection"
|
||||
"GimpTransformDirection",
|
||||
"GimpVectorExtendMode",
|
||||
"GimpVectorsStrokeType"
|
||||
};
|
||||
|
||||
static gboolean enums_initialized = FALSE;
|
||||
|
|
|
@ -25,6 +25,30 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GIMP_TYPE_ANCHOR_FEATURE_TYPE (gimp_anchor_feature_type_get_type ())
|
||||
|
||||
GType gimp_anchor_feature_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ANCHOR_FEATURE_NONE,
|
||||
GIMP_ANCHOR_FEATURE_EDGE,
|
||||
GIMP_ANCHOR_FEATURE_ALIGNED,
|
||||
GIMP_ANCHOR_FEATURE_SYMMETRIC
|
||||
} GimpAnchorFeatureType;
|
||||
|
||||
|
||||
#define GIMP_TYPE_ANCHOR_TYPE (gimp_anchor_type_get_type ())
|
||||
|
||||
GType gimp_anchor_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ANCHOR_ANCHOR,
|
||||
GIMP_ANCHOR_CONTROL
|
||||
} GimpAnchorType;
|
||||
|
||||
|
||||
#define GIMP_TYPE_BRUSH_APPLICATION_MODE (gimp_brush_application_mode_get_type ())
|
||||
|
||||
GType gimp_brush_application_mode_get_type (void) G_GNUC_CONST;
|
||||
|
@ -275,6 +299,27 @@ typedef enum
|
|||
} GimpSelectCriterion;
|
||||
|
||||
|
||||
#define GIMP_TYPE_VECTOR_EXTEND_MODE (gimp_vector_extend_mode_get_type ())
|
||||
|
||||
GType gimp_vector_extend_mode_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EXTEND_SIMPLE,
|
||||
EXTEND_EDITABLE
|
||||
} GimpVectorExtendMode;
|
||||
|
||||
|
||||
#define GIMP_TYPE_VECTORS_STROKE_TYPE (gimp_vectors_stroke_type_get_type ())
|
||||
|
||||
GType gimp_vectors_stroke_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_VECTORS_STROKE_TYPE_BEZIER
|
||||
} GimpVectorsStrokeType;
|
||||
|
||||
|
||||
void gimp_enums_init (void);
|
||||
|
||||
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
|
||||
|
|
|
@ -164,9 +164,8 @@ gimp_path_delete (gint32 image_ID,
|
|||
* @num_path_point_details: The number of points returned. Each point is made up of (x, y, pnt_type) of floats.
|
||||
* @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.
|
||||
*
|
||||
* List the points associated with the named path.
|
||||
*
|
||||
* List the points associated with the named path.
|
||||
* This procedure is deprecated! Use gimp_vectors_stroke_get_points()
|
||||
* instead.
|
||||
*
|
||||
* Returns: The type of the path. Currently only one type (1 = Bezier) is supported.
|
||||
*/
|
||||
|
|
|
@ -37,12 +37,12 @@ gboolean gimp_path_set_current (gint32 image_ID,
|
|||
const gchar *name);
|
||||
gboolean gimp_path_delete (gint32 image_ID,
|
||||
const gchar *name);
|
||||
#endif /* GIMP_DISABLE_DEPRECATED */
|
||||
gint gimp_path_get_points (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint *path_closed,
|
||||
gint *num_path_point_details,
|
||||
gdouble **points_pairs);
|
||||
#endif /* GIMP_DISABLE_DEPRECATED */
|
||||
gboolean gimp_path_set_points (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint ptype,
|
||||
|
|
|
@ -507,7 +507,7 @@ gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
|
|||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_stroke_remove:
|
||||
* gimp_vectors_remove_stroke:
|
||||
* @vectors_ID: The vectors object.
|
||||
* @stroke_id: The stroke ID.
|
||||
*
|
||||
|
@ -520,14 +520,14 @@ gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
|
|||
* Since: GIMP 2.4
|
||||
*/
|
||||
gboolean
|
||||
gimp_vectors_stroke_remove (gint32 vectors_ID,
|
||||
gimp_vectors_remove_stroke (gint32 vectors_ID,
|
||||
gint stroke_id)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-vectors-stroke-remove",
|
||||
return_vals = gimp_run_procedure ("gimp-vectors-remove-stroke",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_INT32, stroke_id,
|
||||
|
@ -654,6 +654,60 @@ gimp_vectors_stroke_scale (gint32 vectors_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_stroke_get_points:
|
||||
* @vectors_ID: The vectors object.
|
||||
* @stroke_id: The stroke ID.
|
||||
* @num_points: The number of floats returned.
|
||||
* @controlpoints: List of the control points for the stroke (x0, y0, x1, y1, ...).
|
||||
* @closed: Whether the stroke is closed or not.
|
||||
*
|
||||
* returns the control points of a stroke.
|
||||
*
|
||||
* returns the control points of a stroke. The interpretation of the
|
||||
* coordinates returned depends on the type of the stroke. For Gimp 2.4
|
||||
* this is always a bezier stroke, where the coordinates are the
|
||||
* control points.
|
||||
*
|
||||
* Returns: type of the stroke (always bezier for now).
|
||||
*
|
||||
* Since: GIMP 2.4
|
||||
*/
|
||||
gint
|
||||
gimp_vectors_stroke_get_points (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gint *num_points,
|
||||
gdouble **controlpoints,
|
||||
gboolean *closed)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint type = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-vectors-stroke-get-points",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_INT32, stroke_id,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*num_points = 0;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
type = return_vals[1].data.d_int32;
|
||||
*num_points = return_vals[2].data.d_int32;
|
||||
*controlpoints = g_new (gdouble, *num_points);
|
||||
memcpy (*controlpoints,
|
||||
return_vals[3].data.d_floatarray,
|
||||
*num_points * sizeof (gdouble));
|
||||
*closed = return_vals[4].data.d_int32;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_stroke_interpolate:
|
||||
* @vectors_ID: The vectors object.
|
||||
|
|
|
@ -29,84 +29,89 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 gimp_vectors_new (gint32 image_ID,
|
||||
const gchar *name);
|
||||
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);
|
||||
gint* gimp_vectors_get_strokes (gint32 vectors_ID,
|
||||
gint *num_strokes);
|
||||
gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble precision);
|
||||
gboolean gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble dist,
|
||||
gdouble precision,
|
||||
gdouble *x_point,
|
||||
gdouble *y_point,
|
||||
gdouble *slope,
|
||||
gboolean *valid);
|
||||
gboolean gimp_vectors_stroke_remove (gint32 vectors_ID,
|
||||
gint stroke_id);
|
||||
gboolean gimp_vectors_stroke_close (gint32 vectors_ID,
|
||||
gint stroke_id);
|
||||
gboolean gimp_vectors_stroke_translate (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gint off_x,
|
||||
gint off_y);
|
||||
gboolean gimp_vectors_stroke_scale (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y);
|
||||
gdouble* gimp_vectors_stroke_interpolate (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble precision,
|
||||
gint *num_coords,
|
||||
gboolean *closed);
|
||||
gint gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID,
|
||||
gdouble x0,
|
||||
gdouble y0);
|
||||
gboolean gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble x0,
|
||||
gdouble y0);
|
||||
gboolean gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1);
|
||||
gboolean gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2);
|
||||
gint gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble radius_x,
|
||||
gdouble radius_y,
|
||||
gdouble angle);
|
||||
gboolean gimp_vectors_to_selection (gint32 vectors_ID,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
gint32 gimp_vectors_new (gint32 image_ID,
|
||||
const gchar *name);
|
||||
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);
|
||||
gint* gimp_vectors_get_strokes (gint32 vectors_ID,
|
||||
gint *num_strokes);
|
||||
gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble precision);
|
||||
gboolean gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble dist,
|
||||
gdouble precision,
|
||||
gdouble *x_point,
|
||||
gdouble *y_point,
|
||||
gdouble *slope,
|
||||
gboolean *valid);
|
||||
gboolean gimp_vectors_remove_stroke (gint32 vectors_ID,
|
||||
gint stroke_id);
|
||||
gboolean gimp_vectors_stroke_close (gint32 vectors_ID,
|
||||
gint stroke_id);
|
||||
gboolean gimp_vectors_stroke_translate (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gint off_x,
|
||||
gint off_y);
|
||||
gboolean gimp_vectors_stroke_scale (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y);
|
||||
gint gimp_vectors_stroke_get_points (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gint *num_points,
|
||||
gdouble **controlpoints,
|
||||
gboolean *closed);
|
||||
gdouble* gimp_vectors_stroke_interpolate (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble precision,
|
||||
gint *num_coords,
|
||||
gboolean *closed);
|
||||
gint gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID,
|
||||
gdouble x0,
|
||||
gdouble y0);
|
||||
gboolean gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble x0,
|
||||
gdouble y0);
|
||||
gboolean gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1);
|
||||
gboolean gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID,
|
||||
gint stroke_id,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2);
|
||||
gint gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble radius_x,
|
||||
gdouble radius_y,
|
||||
gdouble angle);
|
||||
gboolean gimp_vectors_to_selection (gint32 vectors_ID,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -40,7 +40,7 @@ vs_get_length(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "precision", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "d:get_length", kwlist,
|
||||
&precision))
|
||||
&precision))
|
||||
return NULL;
|
||||
|
||||
length = gimp_vectors_stroke_get_length(self->vectors_ID, self->stroke,
|
||||
|
@ -61,12 +61,12 @@ vs_get_point_at_dist(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs
|
|||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"dd:get_point_at_dist", kwlist,
|
||||
&dist, &precision))
|
||||
&dist, &precision))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_stroke_get_point_at_dist(self->vectors_ID, self->stroke,
|
||||
dist, precision,
|
||||
&x, &y, &slope, &valid);
|
||||
dist, precision,
|
||||
&x, &y, &slope, &valid);
|
||||
|
||||
ret = PyTuple_New(4);
|
||||
if (ret == NULL)
|
||||
|
@ -83,7 +83,7 @@ vs_get_point_at_dist(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs
|
|||
static PyObject *
|
||||
vs_remove(PyGimpVectorsStroke *self)
|
||||
{
|
||||
gimp_vectors_stroke_remove(self->vectors_ID, self->stroke);
|
||||
gimp_vectors_remove_stroke(self->vectors_ID, self->stroke);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ vs_translate(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "off_x", "off_y", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd:translate", kwlist,
|
||||
&off_x, &off_y))
|
||||
&off_x, &off_y))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_stroke_translate(self->vectors_ID, self->stroke, off_x, off_y);
|
||||
|
@ -122,7 +122,7 @@ vs_scale(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "scale_x", "scale_y", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd:scale", kwlist,
|
||||
&scale_x, &scale_y))
|
||||
&scale_x, &scale_y))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_stroke_scale(self->vectors_ID, self->stroke, scale_x, scale_y);
|
||||
|
@ -143,7 +143,7 @@ vs_interpolate(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "precision", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "d:interpolate", kwlist,
|
||||
&precision))
|
||||
&precision))
|
||||
return NULL;
|
||||
|
||||
coords = gimp_vectors_stroke_interpolate(self->vectors_ID, self->stroke,
|
||||
|
@ -155,7 +155,7 @@ vs_interpolate(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
|
||||
ret_coords = PyList_New(num_coords);
|
||||
if (ret_coords == NULL) {
|
||||
Py_DECREF(ret);
|
||||
Py_DECREF(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ vs_repr(PyGimpVectorsStroke *self)
|
|||
|
||||
name = gimp_vectors_get_name(self->vectors_ID);
|
||||
s = PyString_FromFormat("<gimp.VectorsStroke %d of gimp.Vectors '%s'>",
|
||||
self->stroke, name ? name : "(null)");
|
||||
self->stroke, name ? name : "(null)");
|
||||
g_free(name);
|
||||
|
||||
return s;
|
||||
|
@ -235,26 +235,26 @@ PyTypeObject PyGimpVectorsStroke_Type = {
|
|||
(reprfunc)0, /* tp_str */
|
||||
(getattrofunc)0, /* tp_getattro */
|
||||
(setattrofunc)0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
NULL, /* Documentation string */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
vs_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
(PyTypeObject *)0, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
vs_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
(PyTypeObject *)0, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)0, /* tp_init */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
};
|
||||
|
||||
static PyObject *
|
||||
|
@ -265,7 +265,7 @@ vectors_stroke_new(PyGimpVectors *vectors, gint stroke)
|
|||
self = PyObject_NEW(PyGimpVectorsStroke, &PyGimpVectorsStroke_Type);
|
||||
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
self->vectors_ID = vectors->ID;
|
||||
self->stroke = stroke;
|
||||
|
@ -282,8 +282,8 @@ vbs_lineto(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "x0", "y0", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"dd:lineto", kwlist,
|
||||
&x0, &y0))
|
||||
"dd:lineto", kwlist,
|
||||
&x0, &y0))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_bezier_stroke_lineto(self->vectors_ID, self->stroke, x0, y0);
|
||||
|
@ -300,12 +300,12 @@ vbs_conicto(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "x0", "y0", "x1", "y1", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"dddd:conicto", kwlist,
|
||||
&x0, &y0, &x1, &y1))
|
||||
"dddd:conicto", kwlist,
|
||||
&x0, &y0, &x1, &y1))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_bezier_stroke_conicto(self->vectors_ID, self->stroke,
|
||||
x0, y0, x1, y1);
|
||||
x0, y0, x1, y1);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
|
@ -319,12 +319,12 @@ vbs_cubicto(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
|
|||
static char *kwlist[] = { "x0", "y0", "x1", "y1", "x2", "y2", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"dddddd:conicto", kwlist,
|
||||
&x0, &y0, &x1, &y1, &x2, &y2))
|
||||
"dddddd:conicto", kwlist,
|
||||
&x0, &y0, &x1, &y1, &x2, &y2))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_bezier_stroke_cubicto(self->vectors_ID, self->stroke,
|
||||
x0, y0, x1, y1, x2, y2);
|
||||
x0, y0, x1, y1, x2, y2);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
|
@ -345,7 +345,7 @@ vbs_repr(PyGimpVectorsStroke *self)
|
|||
|
||||
name = gimp_vectors_get_name(self->vectors_ID);
|
||||
s = PyString_FromFormat("<gimp.VectorsBezierStroke %d of gimp.Vectors '%s'>",
|
||||
self->stroke, name ? name : "(null)");
|
||||
self->stroke, name ? name : "(null)");
|
||||
g_free(name);
|
||||
|
||||
return s;
|
||||
|
@ -372,26 +372,26 @@ PyTypeObject PyGimpVectorsBezierStroke_Type = {
|
|||
(reprfunc)0, /* tp_str */
|
||||
(getattrofunc)0, /* tp_getattro */
|
||||
(setattrofunc)0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
NULL, /* Documentation string */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
vbs_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&PyGimpVectorsStroke_Type, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
vbs_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
&PyGimpVectorsStroke_Type, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)0, /* tp_init */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
};
|
||||
|
||||
static PyObject *
|
||||
|
@ -402,7 +402,7 @@ vectors_bezier_stroke_new(PyGimpVectors *vectors, gint stroke)
|
|||
self = PyObject_NEW(PyGimpVectorsStroke, &PyGimpVectorsBezierStroke_Type);
|
||||
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
self->vectors_ID = vectors->ID;
|
||||
self->stroke = stroke;
|
||||
|
@ -420,8 +420,8 @@ vectors_bezier_stroke_new_moveto(PyGimpVectors *self, PyObject *args, PyObject *
|
|||
static char *kwlist[] = { "x0", "y0", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"dd:bezier_stroke_new_moveto", kwlist,
|
||||
&x0, &y0))
|
||||
"dd:bezier_stroke_new_moveto", kwlist,
|
||||
&x0, &y0))
|
||||
return NULL;
|
||||
|
||||
stroke = gimp_vectors_bezier_stroke_new_moveto(self->ID, x0, y0);
|
||||
|
@ -438,12 +438,12 @@ vectors_bezier_stroke_new_ellipse(PyGimpVectors *self, PyObject *args, PyObject
|
|||
static char *kwlist[] = { "x0", "y0", "radius_x", "radius_y", "angle", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"ddddd:bezier_stroke_new_ellipse", kwlist,
|
||||
&x0, &y0, &radius_x, &radius_y, &angle))
|
||||
"ddddd:bezier_stroke_new_ellipse", kwlist,
|
||||
&x0, &y0, &radius_x, &radius_y, &angle))
|
||||
return NULL;
|
||||
|
||||
stroke = gimp_vectors_bezier_stroke_new_ellipse(self->ID, x0, y0,
|
||||
radius_x, radius_y, angle);
|
||||
radius_x, radius_y, angle);
|
||||
|
||||
return vectors_bezier_stroke_new(self, stroke);
|
||||
}
|
||||
|
@ -456,12 +456,12 @@ vectors_to_selection(PyGimpVectors *self, PyObject *args, PyObject *kwargs)
|
|||
double feather_radius_x = 0.0, feather_radius_y = 0.0;
|
||||
|
||||
static char *kwlist[] = { "operation", "antialias", "feather",
|
||||
"feather_radius_x", "feather_radius_y", NULL };
|
||||
"feather_radius_x", "feather_radius_y", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"|iiidd:to_selection", kwlist,
|
||||
&operation, &antialias, &feather,
|
||||
&feather_radius_x, &feather_radius_y))
|
||||
&feather_radius_x, &feather_radius_y))
|
||||
return NULL;
|
||||
|
||||
gimp_vectors_to_selection(self->ID, operation, antialias, feather,
|
||||
|
@ -788,26 +788,26 @@ PyTypeObject PyGimpVectors_Type = {
|
|||
(reprfunc)0, /* tp_str */
|
||||
(getattrofunc)0, /* tp_getattro */
|
||||
(setattrofunc)0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
NULL, /* Documentation string */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
vectors_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
vectors_getsets, /* tp_getset */
|
||||
(PyTypeObject *)0, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
vectors_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
vectors_getsets, /* tp_getset */
|
||||
(PyTypeObject *)0, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)vectors_init, /* tp_init */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
};
|
||||
|
||||
PyObject *
|
||||
|
@ -816,14 +816,14 @@ pygimp_vectors_new(gint32 ID)
|
|||
PyGimpVectors *self;
|
||||
|
||||
if (ID == -1) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
self = PyObject_NEW(PyGimpVectors, &PyGimpVectors_Type);
|
||||
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
self->ID = ID;
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@ enum_headers = \
|
|||
../../app/core/core-enums.h \
|
||||
../../app/text/text-enums.h \
|
||||
../../app/paint/paint-enums.h \
|
||||
../../app/plug-in/plug-in-enums.h
|
||||
../../app/plug-in/plug-in-enums.h \
|
||||
../../app/vectors/vectors-enums.h
|
||||
|
||||
pdb_scripts = \
|
||||
pdbgen.pl \
|
||||
|
|
|
@ -546,6 +546,37 @@ package Gimp::CodeGen::enums;
|
|||
symbols => [ qw(GIMP_BLUR_CONVOLVE GIMP_SHARPEN_CONVOLVE) ],
|
||||
mapping => { GIMP_BLUR_CONVOLVE => '0',
|
||||
GIMP_SHARPEN_CONVOLVE => '1' }
|
||||
},
|
||||
GimpVectorsStrokeType =>
|
||||
{ contig => 1,
|
||||
header => 'vectors/vectors-enums.h',
|
||||
symbols => [ qw(GIMP_VECTORS_STROKE_TYPE_BEZIER) ],
|
||||
mapping => { GIMP_VECTORS_STROKE_TYPE_BEZIER => '0' }
|
||||
},
|
||||
GimpAnchorType =>
|
||||
{ contig => 1,
|
||||
header => 'vectors/vectors-enums.h',
|
||||
symbols => [ qw(GIMP_ANCHOR_ANCHOR GIMP_ANCHOR_CONTROL) ],
|
||||
mapping => { GIMP_ANCHOR_ANCHOR => '0',
|
||||
GIMP_ANCHOR_CONTROL => '1' }
|
||||
},
|
||||
GimpAnchorFeatureType =>
|
||||
{ contig => 1,
|
||||
header => 'vectors/vectors-enums.h',
|
||||
symbols => [ qw(GIMP_ANCHOR_FEATURE_NONE GIMP_ANCHOR_FEATURE_EDGE
|
||||
GIMP_ANCHOR_FEATURE_ALIGNED
|
||||
GIMP_ANCHOR_FEATURE_SYMMETRIC) ],
|
||||
mapping => { GIMP_ANCHOR_FEATURE_NONE => '0',
|
||||
GIMP_ANCHOR_FEATURE_EDGE => '1',
|
||||
GIMP_ANCHOR_FEATURE_ALIGNED => '2',
|
||||
GIMP_ANCHOR_FEATURE_SYMMETRIC => '3' }
|
||||
},
|
||||
GimpVectorExtendMode =>
|
||||
{ contig => 1,
|
||||
header => 'vectors/vectors-enums.h',
|
||||
symbols => [ qw(EXTEND_SIMPLE EXTEND_EDITABLE) ],
|
||||
mapping => { EXTEND_SIMPLE => '0',
|
||||
EXTEND_EDITABLE => '1' }
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -42,10 +42,7 @@ CODE
|
|||
}
|
||||
|
||||
sub path_get_points {
|
||||
$blurb = 'List the points associated with the named path.';
|
||||
$help = 'List the points associated with the named path.';
|
||||
|
||||
&andy_pdb_misc('1999');
|
||||
&std_pdb_deprecated('gimp-vectors-stroke-get-points');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
|
|
|
@ -396,7 +396,7 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub vectors_stroke_remove {
|
||||
sub vectors_remove_stroke {
|
||||
$blurb = 'remove the stroke from a vectors object.';
|
||||
|
||||
$help = <<'HELP';
|
||||
|
@ -525,6 +525,74 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub vectors_stroke_get_points {
|
||||
$blurb = 'returns the control points of a stroke.';
|
||||
|
||||
$help = <<'HELP';
|
||||
returns the control points of a stroke. The interpretation of the coordinates
|
||||
returned depends on the type of the stroke. For Gimp 2.4 this is always a
|
||||
bezier stroke, where the coordinates are the control points.
|
||||
HELP
|
||||
|
||||
&simon_pdb_misc('2006', '2.4');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'vectors', type => 'vectors',
|
||||
desc => 'The vectors object' },
|
||||
{ name => 'stroke_id', type => 'int32',
|
||||
desc => 'The stroke ID' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'type', type => 'int32',
|
||||
desc => 'type of the stroke (always bezier for now).' },
|
||||
{ name => 'controlpoints', type => 'floatarray',
|
||||
desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).',
|
||||
array => { name => 'num_points',
|
||||
desc => 'The number of floats returned.' } },
|
||||
{ name => 'closed', type => 'boolean',
|
||||
desc => 'Whether the stroke is closed or not.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<"CODE"
|
||||
{
|
||||
GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
|
||||
|
||||
if (stroke && GIMP_IS_BEZIER_STROKE (stroke))
|
||||
{
|
||||
GArray *points_array;
|
||||
gint i;
|
||||
|
||||
points_array = gimp_stroke_control_points_get (stroke, &closed);
|
||||
|
||||
if (points_array)
|
||||
{
|
||||
num_points = points_array->len;
|
||||
controlpoints = g_new (gdouble, num_points * 2);
|
||||
|
||||
type = GIMP_VECTORS_STROKE_TYPE_BEZIER;
|
||||
for (i = 0; i < num_points; i++)
|
||||
{
|
||||
controlpoints[2*i] = g_array_index (points_array,
|
||||
GimpAnchor, i).position.x;
|
||||
controlpoints[2*i+1] = g_array_index (points_array,
|
||||
GimpAnchor, i).position.y;
|
||||
}
|
||||
g_array_free (points_array, TRUE);
|
||||
num_points *= 2;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub vectors_stroke_interpolate {
|
||||
$blurb = 'returns polygonal approximation of the stroke.';
|
||||
|
||||
|
@ -888,10 +956,11 @@ CODE
|
|||
vectors_get_strokes
|
||||
vectors_stroke_get_length
|
||||
vectors_stroke_get_point_at_dist
|
||||
vectors_stroke_remove
|
||||
vectors_remove_stroke
|
||||
vectors_stroke_close
|
||||
vectors_stroke_translate
|
||||
vectors_stroke_scale
|
||||
vectors_stroke_get_points
|
||||
vectors_stroke_interpolate
|
||||
vectors_bezier_stroke_new_moveto
|
||||
vectors_bezier_stroke_lineto
|
||||
|
|
Loading…
Reference in New Issue