gimp/app/pdb/vectors-cmds.c

2464 lines
114 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl. */
#include "config.h"
#include <string.h>
#include <gegl.h>
#include "pdb-types.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "core/gimplist.h"
#include "core/gimpparamspecs.h"
#include "text/gimptext-vectors.h"
#include "text/gimptextlayer.h"
#include "vectors/gimpanchor.h"
#include "vectors/gimpbezierstroke.h"
#include "vectors/gimpstroke-new.h"
#include "vectors/gimpvectors-export.h"
#include "vectors/gimpvectors-import.h"
#include "vectors/gimpvectors.h"
#include "gimppdb.h"
#include "gimppdb-utils.h"
#include "gimpprocedure.h"
#include "internal-procs.h"
#include "gimp-intl.h"
static GValueArray *
vectors_new_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
const gchar *name;
GimpVectors *vectors = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
name = g_value_get_string (&args->values[1]);
if (success)
{
vectors = gimp_vectors_new (image, name);
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_vectors (&return_vals->values[1], vectors);
return return_vals;
}
static GValueArray *
vectors_new_from_text_layer_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
GimpLayer *layer;
GimpVectors *vectors = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
layer = gimp_value_get_layer (&args->values[1], gimp);
if (success)
{
if (gimp_pdb_layer_is_text_layer (layer, FALSE, error))
{
gint x, y;
vectors = gimp_text_vectors_new (image,
gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)));
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
}
else
{
success = FALSE;
}
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_vectors (&return_vals->values[1], vectors);
return return_vals;
}
static GValueArray *
vectors_copy_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
GimpVectors *vectors_copy = NULL;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
vectors_copy = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
G_TYPE_FROM_INSTANCE (vectors)));
if (! vectors_copy)
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_vectors (&return_vals->values[1], vectors_copy);
return return_vals;
}
static GValueArray *
vectors_get_strokes_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gint32 num_strokes = 0;
gint32 *stroke_ids = NULL;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
if (success)
{
num_strokes = gimp_vectors_get_n_strokes (vectors);
if (num_strokes)
{
GimpStroke *cur_stroke;
gint i = 0;
stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke))
{
stroke_ids[i] = gimp_stroke_get_ID (cur_stroke);
i++;
}
}
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_set_int (&return_vals->values[1], num_strokes);
gimp_value_take_int32array (&return_vals->values[2], stroke_ids, num_strokes);
}
return return_vals;
}
static GValueArray *
vectors_stroke_get_length_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gint32 stroke_id;
gdouble precision;
gdouble length = 0.0;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
precision = g_value_get_double (&args->values[2]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, FALSE, error);
if (stroke)
length = gimp_stroke_get_length (stroke, precision);
else
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], length);
return return_vals;
}
static GValueArray *
vectors_stroke_get_point_at_dist_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gint32 stroke_id;
gdouble dist;
gdouble precision;
gdouble x_point = 0.0;
gdouble y_point = 0.0;
gdouble slope = 0.0;
gboolean valid = FALSE;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
dist = g_value_get_double (&args->values[2]);
precision = g_value_get_double (&args->values[3]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, FALSE, error);
if (stroke)
{
GimpCoords coord;
valid = gimp_stroke_get_point_at_dist (stroke, dist, precision,
&coord, &slope);
x_point = valid ? coord.x : 0;
y_point = valid ? coord.y : 0;
}
else
2006-03-25 05:57:47 +08:00
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_set_double (&return_vals->values[1], x_point);
g_value_set_double (&return_vals->values[2], y_point);
g_value_set_double (&return_vals->values[3], slope);
g_value_set_boolean (&return_vals->values[4], valid);
}
return return_vals;
}
static GValueArray *
vectors_remove_stroke_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Remove path stroke"),
vectors);
gimp_vectors_stroke_remove (vectors, stroke);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_close_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Close path stroke"),
vectors);
gimp_stroke_close (stroke);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_translate_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gint32 off_x;
gint32 off_y;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
off_x = g_value_get_int (&args->values[2]);
off_y = g_value_get_int (&args->values[3]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Translate path stroke"),
vectors);
gimp_stroke_translate (stroke, off_x, off_y);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_scale_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gdouble scale_x;
gdouble scale_y;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
scale_x = g_value_get_double (&args->values[2]);
scale_y = g_value_get_double (&args->values[3]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Scale path stroke"),
vectors);
gimp_stroke_scale (stroke, scale_x, scale_y);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_rotate_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gdouble center_x;
gdouble center_y;
gdouble angle;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
center_x = g_value_get_double (&args->values[2]);
center_y = g_value_get_double (&args->values[3]);
angle = g_value_get_double (&args->values[4]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Rotate path stroke"),
vectors);
gimp_stroke_rotate (stroke, center_x, center_y, angle);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_flip_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gint32 flip_type;
gdouble axis;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
flip_type = g_value_get_enum (&args->values[2]);
axis = g_value_get_double (&args->values[3]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Flip path stroke"),
vectors);
gimp_stroke_flip (stroke, flip_type, axis);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_flip_free_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
x1 = g_value_get_double (&args->values[2]);
y1 = g_value_get_double (&args->values[3]);
x2 = g_value_get_double (&args->values[4]);
y2 = g_value_get_double (&args->values[5]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Flip path stroke"),
vectors);
gimp_stroke_flip_free (stroke, x1, y1, x2, y2);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_stroke_get_points_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
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)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, FALSE, error);
if (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,
error ? *error : NULL);
if (success)
{
g_value_set_enum (&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_new_from_points_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gint32 type;
gint32 num_points;
const gdouble *controlpoints;
gboolean closed;
gint32 stroke_id = 0;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
type = g_value_get_enum (&args->values[1]);
num_points = g_value_get_int (&args->values[2]);
controlpoints = gimp_value_get_floatarray (&args->values[3]);
closed = g_value_get_boolean (&args->values[4]);
if (success)
{
GimpStroke *stroke;
GimpCoords *coords;
GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES;
gint i;
success = FALSE;
if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER &&
num_points % 6 == 0)
{
coords = g_new (GimpCoords, num_points/2);
for (i = 0; i < num_points/2; i++)
{
coords[i] = default_coords;
coords[i].x = controlpoints[i*2];
coords[i].y = controlpoints[i*2+1];
}
stroke = gimp_stroke_new_from_coords (type, coords, num_points/2, closed);
if (stroke)
{
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Add path stroke"),
vectors);
gimp_vectors_stroke_add (vectors, stroke);
stroke_id = gimp_stroke_get_ID (stroke);
success = TRUE;
}
g_free (coords);
}
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], stroke_id);
return return_vals;
}
static GValueArray *
vectors_stroke_interpolate_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gint32 stroke_id;
gdouble precision;
gint32 num_coords = 0;
gdouble *coords = NULL;
gboolean closed = FALSE;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
precision = g_value_get_double (&args->values[2]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, FALSE, error);
if (stroke)
{
GArray *coords_array;
gint i;
coords_array = gimp_stroke_interpolate (stroke, precision, &closed);
if (coords_array)
{
num_coords = coords_array->len;
coords = g_new (gdouble, num_coords * 2);
for (i = 0; i < num_coords; i++)
{
coords[2*i] = g_array_index (coords_array, GimpCoords, i).x;
coords[2*i+1] = g_array_index (coords_array, GimpCoords, i).y;
}
g_array_free (coords_array, TRUE);
num_coords *= 2;
}
else
2006-03-25 05:57:47 +08:00
success = FALSE;
}
else
2006-03-25 05:57:47 +08:00
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_set_int (&return_vals->values[1], num_coords);
gimp_value_take_floatarray (&return_vals->values[2], coords, num_coords);
g_value_set_boolean (&return_vals->values[3], closed);
}
return return_vals;
}
static GValueArray *
vectors_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gdouble x0;
gdouble y0;
gint32 stroke_id = 0;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
x0 = g_value_get_double (&args->values[1]);
y0 = g_value_get_double (&args->values[2]);
if (success)
{
if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error))
2009-08-22 00:06:58 +08:00
{
GimpStroke *stroke;
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
2009-08-22 00:06:58 +08:00
coord0.x = x0;
coord0.y = y0;
2009-08-22 00:06:58 +08:00
stroke = gimp_bezier_stroke_new_moveto (&coord0);
2009-08-22 00:06:58 +08:00
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Add path stroke"),
vectors);
2009-08-22 00:06:58 +08:00
gimp_vectors_stroke_add (vectors, stroke);
2009-08-22 00:06:58 +08:00
stroke_id = gimp_stroke_get_ID (stroke);
}
else
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], stroke_id);
return return_vals;
}
static GValueArray *
vectors_bezier_stroke_lineto_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gdouble x0;
gdouble y0;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
x0 = g_value_get_double (&args->values[2]);
y0 = g_value_get_double (&args->values[3]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
coord0.x = x0;
coord0.y = y0;
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Extend path stroke"),
vectors);
gimp_bezier_stroke_lineto (stroke, &coord0);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_bezier_stroke_conicto_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gdouble x0;
gdouble y0;
gdouble x1;
gdouble y1;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
x0 = g_value_get_double (&args->values[2]);
y0 = g_value_get_double (&args->values[3]);
x1 = g_value_get_double (&args->values[4]);
y1 = g_value_get_double (&args->values[5]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
GimpCoords coord1 = GIMP_COORDS_DEFAULT_VALUES;
coord0.x = x0;
coord0.y = y0;
coord1.x = x1;
coord1.y = y1;
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Extend path stroke"),
vectors);
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 stroke_id;
gdouble x0;
gdouble y0;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
x0 = g_value_get_double (&args->values[2]);
y0 = g_value_get_double (&args->values[3]);
x1 = g_value_get_double (&args->values[4]);
y1 = g_value_get_double (&args->values[5]);
x2 = g_value_get_double (&args->values[6]);
y2 = g_value_get_double (&args->values[7]);
if (success)
{
2009-08-22 00:06:58 +08:00
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, TRUE, error);
if (stroke)
{
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
GimpCoords coord1 = GIMP_COORDS_DEFAULT_VALUES;
GimpCoords coord2 = GIMP_COORDS_DEFAULT_VALUES;
coord0.x = x0;
coord0.y = y0;
coord1.x = x1;
coord1.y = y1;
coord2.x = x2;
coord2.y = y2;
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Extend path stroke"),
vectors);
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpVectors *vectors;
gdouble x0;
gdouble y0;
gdouble radius_x;
gdouble radius_y;
gdouble angle;
gint32 stroke_id = 0;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
x0 = g_value_get_double (&args->values[1]);
y0 = g_value_get_double (&args->values[2]);
radius_x = g_value_get_double (&args->values[3]);
radius_y = g_value_get_double (&args->values[4]);
angle = g_value_get_double (&args->values[5]);
if (success)
{
if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error))
2009-08-22 00:06:58 +08:00
{
GimpStroke *stroke;
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
2009-08-22 00:06:58 +08:00
coord0.x = x0;
coord0.y = y0;
2009-08-22 00:06:58 +08:00
stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle);
2009-08-22 00:06:58 +08:00
if (gimp_item_is_attached (GIMP_ITEM (vectors)))
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
_("Add path stroke"),
vectors);
2009-08-22 00:06:58 +08:00
gimp_vectors_stroke_add (vectors, stroke);
2009-08-22 00:06:58 +08:00
stroke_id = gimp_stroke_get_ID (stroke);
}
else
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], stroke_id);
return return_vals;
}
static GValueArray *
vectors_to_selection_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpVectors *vectors;
gint32 operation;
gboolean antialias;
gboolean feather;
gdouble feather_radius_x;
gdouble feather_radius_y;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
operation = g_value_get_enum (&args->values[1]);
antialias = g_value_get_boolean (&args->values[2]);
feather = g_value_get_boolean (&args->values[3]);
feather_radius_x = g_value_get_double (&args->values[4]);
feather_radius_y = g_value_get_double (&args->values[5]);
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), NULL, FALSE, error))
gimp_item_to_selection (GIMP_ITEM (vectors),
operation,
antialias,
feather,
feather_radius_x,
feather_radius_y);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_import_from_file_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
const gchar *filename;
gboolean merge;
gboolean scale;
gint32 num_vectors = 0;
gint32 *vectors_ids = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
filename = g_value_get_string (&args->values[1]);
merge = g_value_get_boolean (&args->values[2]);
scale = g_value_get_boolean (&args->values[3]);
if (success)
{
GList *list, *vectors_list = NULL;
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
/* FIXME tree */
success = gimp_vectors_import_file (image, filename,
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
merge, scale, NULL, -1,
&vectors_list, error);
if (success)
{
num_vectors = g_list_length (vectors_list);
if (num_vectors)
{
gint i;
vectors_ids = g_new (gint32, num_vectors);
list = vectors_list;
for (i = 0; i < num_vectors; i++, list = g_list_next (list))
vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
g_list_free (vectors_list);
}
}
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_set_int (&return_vals->values[1], num_vectors);
gimp_value_take_int32array (&return_vals->values[2], vectors_ids, num_vectors);
}
return return_vals;
}
static GValueArray *
vectors_import_from_string_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
const gchar *string;
gint32 length;
gboolean merge;
gboolean scale;
gint32 num_vectors = 0;
gint32 *vectors_ids = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
string = g_value_get_string (&args->values[1]);
length = g_value_get_int (&args->values[2]);
merge = g_value_get_boolean (&args->values[3]);
scale = g_value_get_boolean (&args->values[4]);
if (success)
{
GList *list, *vectors_list = NULL;
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
/* FIXME tree */
success = gimp_vectors_import_buffer (image, string, length,
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
merge, scale, NULL, -1,
&vectors_list, error);
if (success)
{
num_vectors = g_list_length (vectors_list);
if (num_vectors)
{
gint i;
vectors_ids = g_new (gint32, num_vectors);
list = vectors_list;
for (i = 0; i < num_vectors; i++, list = g_list_next (list))
vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
g_list_free (vectors_list);
}
}
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
g_value_set_int (&return_vals->values[1], num_vectors);
gimp_value_take_int32array (&return_vals->values[2], vectors_ids, num_vectors);
}
return return_vals;
}
static GValueArray *
vectors_export_to_file_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpImage *image;
const gchar *filename;
GimpVectors *vectors;
image = gimp_value_get_image (&args->values[0], gimp);
filename = g_value_get_string (&args->values[1]);
vectors = gimp_value_get_vectors (&args->values[2], gimp);
if (success)
{
success = gimp_vectors_export_file (image, vectors, filename, error);
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
vectors_export_to_string_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args,
GError **error)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
GimpVectors *vectors;
gchar *string = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
vectors = gimp_value_get_vectors (&args->values[1], gimp);
if (success)
{
string = gimp_vectors_export_string (image, vectors);
success = (string != NULL);
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], string);
return return_vals;
}
void
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
register_vectors_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-vectors-new
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_new_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-new");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-new",
"Creates a new empty vectors object.",
"Creates a new empty vectors object. The vectors object needs to be added to the image using 'gimp-image-insert-vectors'.",
"Simon Budig",
"Simon Budig",
"2005",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("name",
"name",
"the name of the new vector object.",
2007-04-25 22:23:05 +08:00
FALSE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"the current vector object, 0 if no vector exists in the image.",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-new-from-text-layer
*/
procedure = gimp_procedure_new (vectors_new_from_text_layer_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-new-from-text-layer");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-new-from-text-layer",
"Creates a new vectors object from a text layer.",
"Creates a new vectors object from a text layer. The vectors object needs to be added to the image using 'gimp-image-insert-vectors'.",
"Marcus Heese <heese@cip.ifi.lmu.de>",
"Marcus Heese",
"2008",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image.",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_layer_id ("layer",
"layer",
"The text layer.",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors of the text layer.",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-copy
*/
procedure = gimp_procedure_new (vectors_copy_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-copy");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-copy",
"Copy a vectors object.",
"This procedure copies the specified vectors object and returns the copy.",
"Barak Itkin <lightningismyname@gmail.com>",
"Barak Itkin",
"2008",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object to copy",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_vectors_id ("vectors-copy",
"vectors copy",
"The newly copied vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-get-strokes
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_get_strokes_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-get-strokes");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-get-strokes",
"List the strokes associated with the passed path.",
"Returns an Array with the stroke-IDs associated with the passed path.",
"Simon Budig",
"Simon Budig",
"2005",
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_return_value (procedure,
gimp_param_spec_int32 ("num-strokes",
"num strokes",
"The number of strokes returned.",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32_array ("stroke-ids",
"stroke ids",
"List of the strokes belonging to the path.",
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-get-length
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_stroke_get_length_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-get-length");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-get-length",
"Measure the length of the given stroke.",
"Measure the length of the given stroke.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("precision",
"precision",
"The precision used for the approximation",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_double ("length",
"length",
"The length (in pixels) of the given stroke.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-get-point-at-dist
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_stroke_get_point_at_dist_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-get-point-at-dist");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-get-point-at-dist",
"Get point at a specified distance along the stroke.",
"This will return the x,y position of a point at a given distance along the stroke. The distance will be obtained by first digitizing the curve internally and then walking along the curve. For a closed stroke the start of the path is the first point on the path that was created. This might not be obvious. If the stroke is not long enough, a \"valid\" flag will be FALSE.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("dist",
"dist",
"The given distance.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("precision",
"precision",
"The precision used for the approximation",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_double ("x-point",
"x point",
"The x position of the point.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_double ("y-point",
"y point",
"The y position of the point.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_double ("slope",
"slope",
"The slope (dy / dx) at the specified point.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Indicator for the validity of the returned data.",
FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-remove-stroke
*/
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-remove-stroke",
"remove the stroke from a vectors object.",
"Remove the stroke from a vectors object.",
"Simon Budig",
"Simon Budig",
"2005",
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));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-close
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_stroke_close_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-close");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-close",
"closes the specified stroke.",
"Closes the specified stroke.",
"Simon Budig",
"Simon Budig",
"2005",
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));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-translate
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_stroke_translate_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-translate");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-translate",
"translate the given stroke.",
"Translate the given stroke.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
gimp_param_spec_int32 ("off-x",
"off x",
"Offset in x direction",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("off-y",
"off y",
"Offset in y direction",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-scale
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_stroke_scale_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-scale");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-scale",
"scales the given stroke.",
"Scale the given stroke.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("scale-x",
"scale x",
"Scale factor in x direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("scale-y",
"scale y",
"Scale factor in y direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-rotate
*/
procedure = gimp_procedure_new (vectors_stroke_rotate_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-rotate");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-rotate",
"rotates the given stroke.",
"Rotates the given stroke around given center by angle (in degrees).",
"Jo\xc3\xa3o S. O. Bueno",
"Jo\xc3\xa3o S. O. Bueno",
"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_argument (procedure,
g_param_spec_double ("center-x",
"center x",
"X coordinate of the rotation center",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("center-y",
"center y",
"Y coordinate of the rotation center",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("angle",
"angle",
"angle to rotate about",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-flip
*/
procedure = gimp_procedure_new (vectors_stroke_flip_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-flip");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-flip",
"flips the given stroke.",
"Rotates the given stroke around given center by angle (in degrees).",
"Jo\xc3\xa3o S. O. Bueno",
"Jo\xc3\xa3o S. O. Bueno",
"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_argument (procedure,
gimp_param_spec_enum ("flip-type",
"flip type",
"Flip orientation, either vertical or horizontal",
GIMP_TYPE_ORIENTATION_TYPE,
GIMP_ORIENTATION_HORIZONTAL,
GIMP_PARAM_READWRITE));
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[2]),
GIMP_ORIENTATION_UNKNOWN);
gimp_procedure_add_argument (procedure,
g_param_spec_double ("axis",
"axis",
"axis coordinate about which to flip, in pixels",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-flip-free
*/
procedure = gimp_procedure_new (vectors_stroke_flip_free_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-flip-free");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-flip-free",
"flips the given stroke about an arbitrary axis.",
"Flips the given stroke about an arbitrary axis. Axis is defined by two coordinates in the image (in pixels), through which the flipping axis passes.",
"Jo\xc3\xa3o S. O. Bueno",
"Jo\xc3\xa3o S. O. Bueno",
"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_argument (procedure,
g_param_spec_double ("x1",
"x1",
"X coordinate of the first point of the flipping axis",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y1",
"y1",
"Y coordinate of the first point of the flipping axis",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x2",
"x2",
"X coordinate of the second point of the flipping axis",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y2",
"y2",
"Y coordinate of the second point of the flipping axis",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
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,
g_param_spec_enum ("type",
"type",
"type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).",
GIMP_TYPE_VECTORS_STROKE_TYPE,
GIMP_VECTORS_STROKE_TYPE_BEZIER,
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-new-from-points
*/
procedure = gimp_procedure_new (vectors_stroke_new_from_points_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-new-from-points");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-new-from-points",
"Adds a stroke of a given type to the vectors object.",
"Adds a stroke of a given type to the vectors object. The coordinates of the control points can be specified. For now only strokes of the type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control points are specified as a pair of float values for the x- and y-coordinate. The Bezier stroke type needs a multiple of three control points. Each Bezier segment endpoint (anchor, A) has two additional control points (C) associated. They are specified in the order CACCACCAC...",
"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,
g_param_spec_enum ("type",
"type",
"type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).",
GIMP_TYPE_VECTORS_STROKE_TYPE,
GIMP_VECTORS_STROKE_TYPE_BEZIER,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-points",
"num points",
"The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate).",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_float_array ("controlpoints",
"controlpoints",
"List of the x- and y-coordinates of the control points.",
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("closed",
"closed",
"Whether the stroke is to be closed or not.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("stroke-id",
"stroke id",
"The stroke ID of the newly created stroke.",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-stroke-interpolate
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_stroke_interpolate_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-stroke-interpolate");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-stroke-interpolate",
"returns polygonal approximation of the stroke.",
"returns polygonal approximation of the stroke.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("precision",
"precision",
"The precision used for the approximation",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("num-coords",
"num coords",
"The number of floats returned.",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_float_array ("coords",
"coords",
"List of the coords along the path (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));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-bezier-stroke-new-moveto
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_bezier_stroke_new_moveto_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-bezier-stroke-new-moveto");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-bezier-stroke-new-moveto",
"Adds a bezier stroke with a single moveto to the vectors object.",
"Adds a bezier stroke with a single moveto to the vectors object.",
"Simon Budig",
"Simon Budig",
"2005",
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,
g_param_spec_double ("x0",
"x0",
"The x-coordinate of the moveto",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The y-coordinate of the moveto",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("stroke-id",
"stroke id",
"The resulting stroke",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-bezier-stroke-lineto
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_bezier_stroke_lineto_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-bezier-stroke-lineto");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-bezier-stroke-lineto",
"Extends a bezier stroke with a lineto.",
"Extends a bezier stroke with a lineto.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("x0",
"x0",
"The x-coordinate of the lineto",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The y-coordinate of the lineto",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-bezier-stroke-conicto
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_bezier_stroke_conicto_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-bezier-stroke-conicto");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-bezier-stroke-conicto",
"Extends a bezier stroke with a conic bezier spline.",
"Extends a bezier stroke with a conic bezier spline. Actually a cubic bezier spline gets added that realizes the shape of a conic bezier spline.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("x0",
"x0",
"The x-coordinate of the control point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The y-coordinate of the control point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x1",
"x1",
"The x-coordinate of the end point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y1",
"y1",
"The y-coordinate of the end point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-bezier-stroke-cubicto
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_bezier_stroke_cubicto_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-bezier-stroke-cubicto");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-bezier-stroke-cubicto",
"Extends a bezier stroke with a cubic bezier spline.",
"Extends a bezier stroke with a cubic bezier spline.",
"Simon Budig",
"Simon Budig",
"2005",
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_argument (procedure,
g_param_spec_double ("x0",
"x0",
"The x-coordinate of the first control point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The y-coordinate of the first control point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x1",
"x1",
"The x-coordinate of the second control point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y1",
"y1",
"The y-coordinate of the second control point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x2",
"x2",
"The x-coordinate of the end point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y2",
"y2",
"The y-coordinate of the end point",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-bezier-stroke-new-ellipse
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (vectors_bezier_stroke_new_ellipse_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-bezier-stroke-new-ellipse");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-bezier-stroke-new-ellipse",
"Adds a bezier stroke describing an ellipse the vectors object.",
"Adds a bezier stroke describing an ellipse the vectors object.",
"Simon Budig",
"Simon Budig",
"2005",
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,
g_param_spec_double ("x0",
"x0",
"The x-coordinate of the center",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The y-coordinate of the center",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("radius-x",
"radius x",
"The radius in x direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("radius-y",
"radius y",
"The radius in y direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("angle",
"angle",
"The angle the x-axis of the ellipse (radians, counterclockwise)",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("stroke-id",
"stroke id",
"The resulting stroke",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-to-selection
*/
procedure = gimp_procedure_new (vectors_to_selection_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-to-selection");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-to-selection",
"Deprecated: Use 'gimp-image-select-item' instead.",
"Deprecated: Use 'gimp-image-select-item' instead.",
"Simon Budig",
"Simon Budig",
"2006",
"gimp-image-select-item");
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object to render to the selection",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("operation",
"operation",
"The desired operation with current selection",
GIMP_TYPE_CHANNEL_OPS,
GIMP_CHANNEL_OP_ADD,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("antialias",
"antialias",
"Antialias selection.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("feather",
"feather",
"Feather selection.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("feather-radius-x",
"feather radius x",
"Feather radius x.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("feather-radius-y",
"feather radius y",
"Feather radius y.",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-import-from-file
*/
procedure = gimp_procedure_new (vectors_import_from_file_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-import-from-file");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-import-from-file",
"Import paths from an SVG file.",
"This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.",
"Simon Budig",
"Simon Budig",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("filename",
"filename",
"The name of the SVG file to import.",
2007-04-25 22:23:05 +08:00
TRUE, FALSE, TRUE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("merge",
"merge",
"Merge paths into a single vectors object.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("scale",
"scale",
"Scale the SVG to image dimensions.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("num-vectors",
"num vectors",
"The number of newly created vectors",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32_array ("vectors-ids",
"vectors ids",
"The list of newly created vectors",
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-import-from-string
*/
procedure = gimp_procedure_new (vectors_import_from_string_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-import-from-string");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-import-from-string",
"Import paths from an SVG string.",
"This procedure works like 'gimp-vectors-import-from-file' but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.",
"Simon Budig",
"Simon Budig",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("string",
"string",
"A string that must be a complete and valid SVG document.",
2007-04-25 22:23:05 +08:00
TRUE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("length",
"length",
"Number of bytes in string or -1 if the string is NULL terminated.",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("merge",
"merge",
"Merge paths into a single vectors object.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("scale",
"scale",
"Scale the SVG to image dimensions.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("num-vectors",
"num vectors",
"The number of newly created vectors",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32_array ("vectors-ids",
"vectors ids",
"The list of newly created vectors",
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-export-to-file
*/
procedure = gimp_procedure_new (vectors_export_to_file_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-export-to-file");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-export-to-file",
"save a path as an SVG file.",
"This procedure creates an SVG file to save a Vectors object, that is, a path. The resulting file can be edited using a vector graphics application, or later reloaded into GIMP. If you pass 0 as the 'vectors' argument, then all paths in the image will be exported.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs",
"2007",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("filename",
"filename",
"The name of the SVG file to create.",
TRUE, FALSE, TRUE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object to be saved, or 0 for all in the image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-export-to-string
*/
procedure = gimp_procedure_new (vectors_export_to_string_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-vectors-export-to-string");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-export-to-string",
"Save a path as an SVG string.",
"This procedure works like 'gimp-vectors-export-to-file' but creates a string rather than a file. The contents are a NUL-terminated string that holds a complete XML document. If you pass 0 as the 'vectors' argument, then all paths in the image will be exported.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs",
"2007",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object to save, or 0 for all in the image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_string ("string",
"string",
"A string whose contents are a complete SVG document.",
FALSE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
}