app/vectors/Makefile app/vectors/Makefile.am app/vectors/Makefile.in

2002-02-22  Simon Budig  <simon@gimp.org>

        * app/vectors/Makefile
        * app/vectors/Makefile.am
        * app/vectors/Makefile.in
        * app/vectors/gimpanchor.h
        * app/vectors/gimpbezier.c
        * app/vectors/gimpbezier.h
        * app/vectors/gimpvectors.c
        * app/vectors/gimpvectors.h
        * app/vectors/vectors-types.h: new files, the beginning
        of a new vector infrastructure for gimp.

        * configure.in
        * app/Makefile.am
        * app/core/core-types.h: changed accordingly.

        * app/tools/Makefile.am
        * app/tools/gimpvectortool.c
        * app/tools/gimpvectortool.h
        * app/tools/tools.c: New tool without practical use (yet),
        using the new infrastructure.

        to be continued...
This commit is contained in:
Simon Budig 2002-02-22 00:11:37 +00:00 committed by Simon Budig
parent 9f9fa587ec
commit a7fcc25f10
17 changed files with 2678 additions and 0 deletions

View File

@ -1,3 +1,28 @@
2002-02-22 Simon Budig <simon@gimp.org>
* app/vectors/Makefile
* app/vectors/Makefile.am
* app/vectors/Makefile.in
* app/vectors/gimpanchor.h
* app/vectors/gimpbezier.c
* app/vectors/gimpbezier.h
* app/vectors/gimpvectors.c
* app/vectors/gimpvectors.h
* app/vectors/vectors-types.h: new files, the beginning
of a new vector infrastructure for gimp.
* configure.in
* app/Makefile.am
* app/core/core-types.h: changed accordingly.
* app/tools/Makefile.am
* app/tools/gimpvectortool.c
* app/tools/gimpvectortool.h
* app/tools/tools.c: New tool without practical use (yet),
using the new infrastructure.
to be continued...
2002-02-21 Michael Natterer <mitch@gimp.org>
* app/Makefile.am

View File

@ -4,6 +4,7 @@ SUBDIRS = \
paint-funcs \
base \
core \
vectors \
config \
paint \
xcf \
@ -128,6 +129,7 @@ gimp_1_3_LDADD = @STRIP_BEGIN@ \
widgets/libappwidgets.a \
core/libappcore.a \
pdb/libapppdb.a \
vectors/libappvectors.a \
paint/libapppaint.a \
xcf/libappxcf.a \
file/libappfile.a \

View File

@ -26,6 +26,7 @@
#include "base/base-types.h"
#include "pdb/pdb-types.h"
#include "plug-in/plug-in-types.h"
#include "vectors/vectors-types.h"
#include "undo_types.h" /* EEK */

View File

@ -103,6 +103,8 @@ libapptools_a_SOURCES = @STRIP_BEGIN@ \
gimptoolmodule.h \
gimptransformtool.c \
gimptransformtool.h \
gimpvectortool.c \
gimpvectortool.h \
\
transform_options.c \
transform_options.h \

558
app/tools/gimpvectortool.c Normal file
View File

@ -0,0 +1,558 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* Vector tool
* Copyright (C) 1999 Sven Neumann <sven@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
#include "gui/gui-types.h"
#include "core/gimpimage.h"
#include "core/gimpimage-guides.h"
#include "core/gimptoolinfo.h"
#include "vectors/gimpanchor.h"
#include "vectors/gimpvectors.h"
#include "vectors/gimpbezier.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplayshell.h"
#include "gui/info-dialog.h"
#include "gimpvectortool.h"
#include "tool_manager.h"
#include "tool_options.h"
#include "gimprc.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
/* definitions */
#define TARGET 8
#define ARC_RADIUS 30
#define STATUSBAR_SIZE 128
/* maximum information buffer size */
#define MAX_INFO_BUF 16
/* the vector tool options */
typedef struct _VectorOptions VectorOptions;
struct _VectorOptions
{
GimpToolOptions tool_options;
gboolean use_info_window;
gboolean use_info_window_d;
GtkWidget *use_info_window_w;
};
/* local function prototypes */
static void gimp_vector_tool_class_init (GimpVectorToolClass *klass);
static void gimp_vector_tool_init (GimpVectorTool *tool);
static void gimp_vector_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp);
static void gimp_vector_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_vector_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_vector_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_vector_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_vector_tool_draw (GimpDrawTool *draw_tool);
static GimpToolOptions * vector_tool_options_new (GimpToolInfo *tool_info);
static void vector_tool_options_reset (GimpToolOptions *tool_options);
static GimpDrawToolClass *parent_class = NULL;
void
gimp_vector_tool_register (Gimp *gimp,
GimpToolRegisterCallback callback)
{
(* callback) (gimp,
GIMP_TYPE_VECTOR_TOOL,
vector_tool_options_new,
FALSE,
"gimp:vector_tool",
_("Vector Tool"),
_("Vector angles and lengths"),
N_("/Tools/Vector"), NULL,
NULL, "tools/vector.html",
GIMP_STOCK_TOOL_PATH);
}
GType
gimp_vector_tool_get_type (void)
{
static GType tool_type = 0;
if (! tool_type)
{
static const GTypeInfo tool_info =
{
sizeof (GimpVectorToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_vector_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpVectorTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_vector_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
"GimpVectorTool",
&tool_info, 0);
}
return tool_type;
}
static void
gimp_vector_tool_class_init (GimpVectorToolClass *klass)
{
GimpToolClass *tool_class;
GimpDrawToolClass *draw_tool_class;
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
tool_class->control = gimp_vector_tool_control;
tool_class->button_press = gimp_vector_tool_button_press;
tool_class->button_release = gimp_vector_tool_button_release;
tool_class->motion = gimp_vector_tool_motion;
tool_class->cursor_update = gimp_vector_tool_cursor_update;
draw_tool_class->draw = gimp_vector_tool_draw;
}
static void
gimp_vector_tool_init (GimpVectorTool *vector_tool)
{
GimpTool *tool;
tool = GIMP_TOOL (vector_tool);
tool->tool_cursor = GIMP_CURSOR_MODIFIER_NONE;
tool->preserve = TRUE; /* Preserve on drawable change */
vector_tool->vectors = g_object_new (GIMP_TYPE_BEZIER, 0);
}
static void
gimp_vector_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp)
{
GimpVectorTool *vector_tool;
vector_tool = GIMP_VECTOR_TOOL (tool);
switch (action)
{
case PAUSE:
break;
case RESUME:
break;
case HALT:
gimp_tool_pop_status (tool);
tool->state = INACTIVE;
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
}
static void
gimp_vector_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpVectorTool *vector_tool;
VectorOptions *options;
GimpDisplayShell *shell;
gint i;
GimpCoords cur_point;
GimpAnchor *anchor;
vector_tool = GIMP_VECTOR_TOOL (tool);
options = (VectorOptions *) tool->tool_info->tool_options;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
/* if we are changing displays, pop the statusbar of the old one */
if (tool->state == ACTIVE && gdisp != tool->gdisp)
{
gimp_tool_pop_status (tool);
}
vector_tool->function = VCREATING;
if (tool->state == ACTIVE && gdisp == tool->gdisp)
{
/* if the cursor is in one of the handles,
* the new function will be moving or adding a new point or guide
*/
anchor = gimp_bezier_anchor_get (vector_tool->vectors, coords);
if (anchor && gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), gdisp,
coords->x,
coords->y,
GIMP_HANDLE_CIRCLE,
anchor->position.x,
anchor->position.y,
TARGET, TARGET,
GTK_ANCHOR_CENTER,
FALSE))
{
vector_tool->function = VMOVING;
vector_tool->cur_anchor = anchor;
}
}
if (vector_tool->function == VCREATING)
{
if (tool->state == ACTIVE)
{
/* reset everything */
gimp_draw_tool_stop (GIMP_DRAW_TOOL (vector_tool));
}
cur_point.x = coords->x;
cur_point.y = coords->y;
anchor = gimp_vectors_anchor_set (vector_tool->vectors, &cur_point, TRUE);
vector_tool->cur_anchor = anchor;
vector_tool->function = VMOVING;
/* set the gdisplay */
tool->gdisp = gdisp;
if (tool->state == ACTIVE)
{
gimp_tool_pop_status (tool);
gimp_tool_push_status (tool, "");
}
/* start drawing the vector tool */
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), gdisp);
}
tool->state = ACTIVE;
}
static void
gimp_vector_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpVectorTool *vector_tool;
vector_tool = GIMP_VECTOR_TOOL (tool);
vector_tool->function = VFINISHED;
}
static void
gimp_vector_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpVectorTool *vector_tool;
VectorOptions *options;
gint tmp;
GimpAnchor *anchor;
vector_tool = GIMP_VECTOR_TOOL (tool);
options = (VectorOptions *) tool->tool_info->tool_options;
gimp_draw_tool_pause (GIMP_DRAW_TOOL (vector_tool));
switch (vector_tool->function)
{
case VMOVING:
/* if we are moving the start point and only have two, make it the end point */
anchor = vector_tool->cur_anchor;
if (anchor)
gimp_vectors_anchor_move_absolute (vector_tool->vectors,
vector_tool->cur_anchor,
coords, 0);
default:
break;
}
gimp_draw_tool_resume (GIMP_DRAW_TOOL (vector_tool));
}
static void
gimp_vector_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpVectorTool *vector_tool;
gboolean in_handle = FALSE;
GdkCursorType ctype = GIMP_MOUSE_CURSOR;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
gint i;
GimpAnchor *anchor;
vector_tool = GIMP_VECTOR_TOOL (tool);
if (tool->state == ACTIVE && tool->gdisp == gdisp)
{
anchor = gimp_bezier_anchor_get (vector_tool->vectors, coords);
if (anchor && gimp_draw_tool_on_handle (GIMP_DRAW_TOOL (tool), gdisp,
coords->x,
coords->y,
GIMP_HANDLE_CIRCLE,
anchor->position.x,
anchor->position.y,
TARGET, TARGET,
GTK_ANCHOR_CENTER,
FALSE))
{
in_handle = TRUE;
ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
}
}
tool->cursor = ctype;
tool->cursor_modifier = cmodifier;
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
}
static void
gimp_vector_tool_draw (GimpDrawTool *draw_tool)
{
GimpVectorTool *vector_tool;
GimpTool *tool;
gint i;
gint angle1, angle2;
gint draw_arc = 0;
GimpAnchor *cur_anchor = NULL;
GimpStroke *cur_stroke = NULL;
GimpVectors *vectors;
vector_tool = GIMP_VECTOR_TOOL (draw_tool);
tool = GIMP_TOOL (draw_tool);
vectors = vector_tool->vectors;
while ((cur_anchor = gimp_vectors_anchor_get_next (vectors, cur_anchor))) {
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
cur_anchor->position.x,
cur_anchor->position.y,
TARGET,
TARGET,
GTK_ANCHOR_CENTER,
FALSE);
}
for (i = 0; i < vector_tool->num_points; i++)
{
if (i == 0 && vector_tool->num_points == 3)
{
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
vector_tool->x[i],
vector_tool->y[i],
TARGET,
TARGET,
GTK_ANCHOR_CENTER,
FALSE);
}
else
{
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
vector_tool->x[i],
vector_tool->y[i],
TARGET * 2,
TARGET * 2,
GTK_ANCHOR_CENTER,
FALSE);
}
if (i > 0)
{
gimp_draw_tool_draw_line (draw_tool,
vector_tool->x[0],
vector_tool->y[0],
vector_tool->x[i],
vector_tool->y[i],
FALSE);
/* only draw the arc if the lines are long enough */
if (gimp_draw_tool_calc_distance (draw_tool, tool->gdisp,
vector_tool->x[0],
vector_tool->y[0],
vector_tool->x[i],
vector_tool->y[i]) > ARC_RADIUS)
{
draw_arc++;
}
}
}
if (vector_tool->num_points > 1 && draw_arc == vector_tool->num_points - 1)
{
angle1 = vector_tool->angle2 * 64.0;
angle2 = (vector_tool->angle1 - vector_tool->angle2) * 64.0;
if (angle2 > 11520)
angle2 -= 23040;
if (angle2 < -11520)
angle2 += 23040;
if (angle2 != 0)
{
gimp_draw_tool_draw_arc_by_anchor (draw_tool,
FALSE,
vector_tool->x[0],
vector_tool->y[0],
ARC_RADIUS,
ARC_RADIUS,
angle1, angle2,
GTK_ANCHOR_CENTER,
FALSE);
if (vector_tool->num_points == 2)
{
gdouble target;
gdouble arc_radius;
target = FUNSCALEX (tool->gdisp, (TARGET >> 1));
arc_radius = FUNSCALEX (tool->gdisp, ARC_RADIUS);
gimp_draw_tool_draw_line
(draw_tool,
vector_tool->x[0],
vector_tool->y[0],
(vector_tool->x[1] >= vector_tool->x[0] ?
vector_tool->x[0] + arc_radius + target :
vector_tool->x[0] - arc_radius - target),
vector_tool->y[0],
FALSE);
}
}
}
}
static GimpToolOptions *
vector_tool_options_new (GimpToolInfo *tool_info)
{
VectorOptions *options;
GtkWidget *vbox;
options = g_new0 (VectorOptions, 1);
tool_options_init ((GimpToolOptions *) options, tool_info);
((GimpToolOptions *) options)->reset_func = vector_tool_options_reset;
options->use_info_window = options->use_info_window_d = FALSE;
/* the main vbox */
vbox = options->tool_options.main_vbox;
/* the use_info_window toggle button */
options->use_info_window_w =
gtk_check_button_new_with_label (_("Use Info Window"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->use_info_window_w),
options->use_info_window_d);
gtk_box_pack_start (GTK_BOX (vbox), options->use_info_window_w,
FALSE, FALSE, 0);
gtk_widget_show (options->use_info_window_w);
g_signal_connect (G_OBJECT (options->use_info_window_w), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&options->use_info_window);
return (GimpToolOptions *) options;
}
static void
vector_tool_options_reset (GimpToolOptions *tool_options)
{
VectorOptions *options;
options = (VectorOptions *) tool_options;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->use_info_window_w),
options->use_info_window_d);
}

View File

@ -0,0 +1,78 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_VECTOR_TOOL_H__
#define __GIMP_VECTOR_TOOL_H__
#include "gimpdrawtool.h"
/* possible vector functions */
typedef enum
{
VCREATING,
VADDING,
VMOVING,
VMOVING_ALL,
VGUIDING,
VFINISHED
} VectorFunction;
#define GIMP_TYPE_VECTOR_TOOL (gimp_vector_tool_get_type ())
#define GIMP_VECTOR_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTOR_TOOL, GimpVectorTool))
#define GIMP_VECTOR_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTOR_TOOL, GimpVectorToolClass))
#define GIMP_IS_VECTOR_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTOR_TOOL))
#define GIMP_IS_VECTOR_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VECTOR_TOOL))
#define GIMP_VECTOR_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VECTOR_TOOL, GimpVectorToolClass))
typedef struct _GimpVectorTool GimpVectorTool;
typedef struct _GimpVectorToolClass GimpVectorToolClass;
struct _GimpVectorTool
{
GimpDrawTool parent_instance;
VectorFunction function; /* function we're performing */
gint last_x; /* last x coordinate */
gint last_y; /* last y coordinate */
gint point; /* what are we manipulating? */
gint num_points; /* how many points? */
gint x[3]; /* three x coordinates */
gint y[3]; /* three y coordinates */
gdouble angle1; /* first angle */
gdouble angle2; /* second angle */
GimpAnchor *cur_anchor; /* The current Anchor */
GimpVectors *vectors; /* The current Vector data */
};
struct _GimpVectorToolClass
{
GimpDrawToolClass parent_class;
};
void gimp_vector_tool_register (Gimp *gimp,
GimpToolRegisterCallback callback);
GType gimp_vector_tool_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VECTOR_TOOL_H__ */

View File

@ -70,6 +70,7 @@
#include "gimpsmudgetool.h"
#include "gimptexttool.h"
#include "gimptoolmodule.h"
#include "gimpvectortool.h"
void
cheesey_module_loading_hack (const gchar *filename,
@ -126,6 +127,7 @@ tools_init (Gimp *gimp)
/* non-modifying tools */
gimp_path_tool_register,
gimp_vector_tool_register,
gimp_measure_tool_register,
gimp_magnify_tool_register,
gimp_histogram_tool_register,

447
app/vectors/Makefile Normal file
View File

@ -0,0 +1,447 @@
# Generated automatically from Makefile.in by configure.
# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = .
top_srcdir = ../..
prefix = /unstable
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/gimp
pkglibdir = $(libdir)/gimp
pkgincludedir = $(includedir)/gimp
top_builddir = ../..
ACLOCAL = aclocal -I /unstable/share/aclocal -I /usr/local/share/aclocal
AUTOCONF = autoconf
AUTOMAKE = automake
AUTOHEADER = autoheader
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
AA =
AS = ${CC}
ASFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CATALOGS = ca.gmo cs.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo fi.gmo fr.gmo ga.gmo gl.gmo hu.gmo hr.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sv.gmo tr.gmo uk.gmo zh_CN.gmo zh_TW.gmo
CATOBJEXT = .gmo
CC = gcc
CFLAGS = -g -O2 -Wall
CPP = cc -E
CPPFLAGS = -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
DATADIRNAME = share
DLLTOOL = @DLLTOOL@
ECHO = echo
EMACS = :
EXEEXT =
EXTENSIVE_TESTS =
GAP_DECODE_MPEG =
GETTEXT_PACKAGE = gimp14
GIMP =
GIMPINSTALL =
GIMPTOOL =
GIMP_CFLAGS =
GIMP_CFLAGS_NOUI =
GIMP_LIBS =
GIMP_LIBS_NOUI =
GIMP_MAJOR_VERSION = 1
GIMP_MICRO_VERSION = 4
GIMP_MINOR_VERSION = 3
GIMP_MODULES = modules
GIMP_MP_FLAGS =
GIMP_MP_LIBS =
GIMP_PERL =
GIMP_PERL_PO =
GIMP_PLUGINS = plug-ins
GIMP_PRINT_RELEASE_DATE = 02\ Dec\ 2000
GIMP_PRINT_VERSION = 4.0.4
GIMP_REMOTE =
GIMP_THREAD_FLAGS =
GIMP_THREAD_LIBS =
GIMP_VERSION = 1.3.4
GLIB_CFLAGS = -I/unstable/include/glib-2.0 -I/unstable/lib/glib-2.0/include
GLIB_GENMARSHAL = glib-genmarshal
GLIB_LIBS = -L/unstable/lib -lgobject-1.3 -lglib-1.3
GLIB_MKENUMS = glib-mkenums
GMOFILES = ca.gmo cs.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo fi.gmo fr.gmo ga.gmo gl.gmo hu.gmo hr.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sv.gmo tr.gmo uk.gmo zh_CN.gmo zh_TW.gmo
GMSGFMT = /usr/bin/msgfmt
GOBJECT_QUERY = gobject-query
GTKDOC = false
GTKXMHTML_CFLAGS =
GTKXMHTML_LIBS =
GTK_CFLAGS = -I/unstable/include/gtk-2.0 -I/unstable/lib/gtk-2.0/include -I/unstable/include/glib-2.0 -I/unstable/lib/glib-2.0/include -I/unstable/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/unstable/include/atk-1.0
GTK_LIBS = -L/unstable/lib -L/usr/X11R6/lib -lgtk-x11-1.3 -lgdk-x11-1.3 -lXi -lgdk_pixbuf-1.3 -lm -lpangox -lpangoxft -lXft -lXrender -lXext -lX11 -lfreetype -lpango -latk -lgobject-1.3 -lgmodule-1.3 -ldl -lglib-1.3
HAVE_FINITE =
HAVE_GLIBC_REGEX =
HAVE_ISFINITE =
HELPBROWSER =
HTML_DIR = ${datadir}/gtk-doc/html
INSTOBJEXT = .mo
INTLDEPS =
INTLLIBS =
INTLOBJS =
IN_GIMP =
JPEG = jpeg
LDFLAGS =
LIBAA =
LIBJPEG = -ljpeg
LIBMPEG =
LIBPNG = -lpng -lz
LIBTIFF = -ltiff
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBUCB =
LIBXMU = -lXmu -lXt -lSM -lICE
LIBXPM = -L/usr/X11R6/lib -lSM -lICE -lX11 -lXpm
LIBZ = -lz
LN_S = ln -s
LT_AGE = 0
LT_CURRENT = 4
LT_RELEASE = 1.3
LT_REVISION = 0
MAILER = -DMAILER=\"/usr/sbin/sendmail\"
MAINT =
MAKEINFO = makeinfo
MKINSTALLDIRS = ./mkinstalldirs
MPEG =
OBJDUMP = @OBJDUMP@
OBJEXT = o
PACKAGE = gimp
PANGOFT2_CFLAGS = -I/unstable/include/pango-1.0 -I/usr/include/freetype2 -I/unstable/include/glib-2.0 -I/unstable/lib/glib-2.0/include
PANGOFT2_LIBS = -L/unstable/lib -lpangoft2 -lfreetype -lpango -lgobject-1.3 -lgmodule-1.3 -ldl -lglib-1.3
PERL = /usr/bin/perl
PKG_CONFIG = /usr/bin/pkg-config
PNG = png
POFILES = ca.po cs.po da.po de.po el.po en_GB.po es.po fi.po fr.po ga.po gl.po hu.po hr.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ro.po ru.po sk.po sv.po tr.po uk.po zh_CN.po zh_TW.po
POSUB = po
PSP = psp
PYTHON = @PYTHON@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_LINK = @PYTHON_LINK@
RANLIB = ranlib
SENDMAIL = /usr/sbin/sendmail
SO = @SO@
STRIP = strip
STRIP_BEGIN = $(strip $(STRIP_DUMMY)
STRIP_DUMMY =
STRIP_END = )
TIFF = tiff
USE_NLS = yes
VERSION = 1.3.4
WEBBROWSER = webbrowser
XJT = xjt
XPM = xpm
X_LIBS = -L/usr/X11R6/lib
gimpdatadir = ${prefix}/share/gimp/1.3
gimpdir = .gimp-1.3
gimpplugindir = ${exec_prefix}/lib/gimp/1.3
gimpsysconfdir = ${prefix}/etc/gimp/1.3
localedir = ${prefix}/${DATADIRNAME}/locale
prefix = /unstable
pyexecdir = @pyexecdir@
pythondir = @pythondir@
AM_CPPFLAGS = $(strip $(STRIP_DUMMY) -DG_LOG_DOMAIN=\"Gimp-Vectors\" )
INCLUDES = $(strip $(STRIP_DUMMY) -I$(top_srcdir) -I$(top_srcdir)/app $(GTK_CFLAGS) -I$(includedir) )
noinst_LIBRARIES = libappvectors.a
libappvectors_a_sources = $(strip $(STRIP_DUMMY) gimpanchor.h gimpbezier.c gimpbezier.h gimpstroke.h gimpvectors.c gimpvectors.h )
libappvectors_a_SOURCES = $(libappvectors_a_sources)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I../..
LIBS =
X_CFLAGS = -I/usr/X11R6/include
X_EXTRA_LIBS =
X_PRE_LIBS = -lSM -lICE
libappvectors_a_LIBADD =
libappvectors_a_OBJECTS = gimpbezier.$(OBJEXT) gimpvectors.$(OBJEXT)
AR = ar
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
DEP_FILES = .deps/gimpbezier.P .deps/gimpvectors.P
SOURCES = $(libappvectors_a_SOURCES)
OBJECTS = $(libappvectors_a_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .obj .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu app/vectors/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
# FIXME: We should only use cygpath when building on Windows,
# and only if it is available.
.c.obj:
$(COMPILE) -c `cygpath -w $<`
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
-rm -f *.$(OBJEXT)
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
.s.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
.S.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
maintainer-clean-libtool:
libappvectors.a: $(libappvectors_a_OBJECTS) $(libappvectors_a_DEPENDENCIES)
-rm -f libappvectors.a
$(AR) cru libappvectors.a $(libappvectors_a_OBJECTS) $(libappvectors_a_LIBADD)
$(RANLIB) libappvectors.a
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = app/vectors
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu app/vectors/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-libtool clean-tags \
clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-libtool distclean-tags distclean-depend \
distclean-generic clean-am
-rm -f libtool
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-tags maintainer-clean-depend \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

29
app/vectors/Makefile.am Normal file
View File

@ -0,0 +1,29 @@
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Vectors\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir) \
@STRIP_END@
noinst_LIBRARIES = libappvectors.a
libappvectors_a_sources = @STRIP_BEGIN@ \
gimpanchor.h \
gimpbezier.c \
gimpbezier.h \
gimpstroke.h \
gimpvectors.c \
gimpvectors.h \
@STRIP_END@
libappvectors_a_SOURCES = $(libappvectors_a_sources)

447
app/vectors/Makefile.in Normal file
View File

@ -0,0 +1,447 @@
# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
AA = @AA@
AS = @AS@
ASFLAGS = @ASFLAGS@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
DATADIRNAME = @DATADIRNAME@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
EMACS = @EMACS@
EXEEXT = @EXEEXT@
EXTENSIVE_TESTS = @EXTENSIVE_TESTS@
GAP_DECODE_MPEG = @GAP_DECODE_MPEG@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GIMP = @GIMP@
GIMPINSTALL = @GIMPINSTALL@
GIMPTOOL = @GIMPTOOL@
GIMP_CFLAGS = @GIMP_CFLAGS@
GIMP_CFLAGS_NOUI = @GIMP_CFLAGS_NOUI@
GIMP_LIBS = @GIMP_LIBS@
GIMP_LIBS_NOUI = @GIMP_LIBS_NOUI@
GIMP_MAJOR_VERSION = @GIMP_MAJOR_VERSION@
GIMP_MICRO_VERSION = @GIMP_MICRO_VERSION@
GIMP_MINOR_VERSION = @GIMP_MINOR_VERSION@
GIMP_MODULES = @GIMP_MODULES@
GIMP_MP_FLAGS = @GIMP_MP_FLAGS@
GIMP_MP_LIBS = @GIMP_MP_LIBS@
GIMP_PERL = @GIMP_PERL@
GIMP_PERL_PO = @GIMP_PERL_PO@
GIMP_PLUGINS = @GIMP_PLUGINS@
GIMP_PRINT_RELEASE_DATE = @GIMP_PRINT_RELEASE_DATE@
GIMP_PRINT_VERSION = @GIMP_PRINT_VERSION@
GIMP_REMOTE = @GIMP_REMOTE@
GIMP_THREAD_FLAGS = @GIMP_THREAD_FLAGS@
GIMP_THREAD_LIBS = @GIMP_THREAD_LIBS@
GIMP_VERSION = @GIMP_VERSION@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GOBJECT_QUERY = @GOBJECT_QUERY@
GTKDOC = @GTKDOC@
GTKXMHTML_CFLAGS = @GTKXMHTML_CFLAGS@
GTKXMHTML_LIBS = @GTKXMHTML_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
HAVE_FINITE = @HAVE_FINITE@
HAVE_GLIBC_REGEX = @HAVE_GLIBC_REGEX@
HAVE_ISFINITE = @HAVE_ISFINITE@
HELPBROWSER = @HELPBROWSER@
HTML_DIR = @HTML_DIR@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
IN_GIMP = @IN_GIMP@
JPEG = @JPEG@
LDFLAGS = @LDFLAGS@
LIBAA = @LIBAA@
LIBJPEG = @LIBJPEG@
LIBMPEG = @LIBMPEG@
LIBPNG = @LIBPNG@
LIBTIFF = @LIBTIFF@
LIBTOOL = @LIBTOOL@
LIBUCB = @LIBUCB@
LIBXMU = @LIBXMU@
LIBXPM = @LIBXPM@
LIBZ = @LIBZ@
LN_S = @LN_S@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAILER = @MAILER@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MPEG = @MPEG@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
PANGOFT2_LIBS = @PANGOFT2_LIBS@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG = @PNG@
POFILES = @POFILES@
POSUB = @POSUB@
PSP = @PSP@
PYTHON = @PYTHON@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_LINK = @PYTHON_LINK@
RANLIB = @RANLIB@
SENDMAIL = @SENDMAIL@
SO = @SO@
STRIP = @STRIP@
STRIP_BEGIN = @STRIP_BEGIN@
STRIP_DUMMY = @STRIP_DUMMY@
STRIP_END = @STRIP_END@
TIFF = @TIFF@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WEBBROWSER = @WEBBROWSER@
XJT = @XJT@
XPM = @XPM@
X_LIBS = @X_LIBS@
gimpdatadir = @gimpdatadir@
gimpdir = @gimpdir@
gimpplugindir = @gimpplugindir@
gimpsysconfdir = @gimpsysconfdir@
localedir = @localedir@
prefix = @prefix@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
AM_CPPFLAGS = @STRIP_BEGIN@ -DG_LOG_DOMAIN=\"Gimp-Vectors\" @GIMP_THREAD_FLAGS@ @GIMP_MP_FLAGS@ @STRIP_END@
INCLUDES = @STRIP_BEGIN@ -I$(top_srcdir) -I$(top_srcdir)/app $(GTK_CFLAGS) -I$(includedir) @STRIP_END@
noinst_LIBRARIES = libappvectors.a
libappvectors_a_sources = @STRIP_BEGIN@ gimpanchor.h gimpbezier.c gimpbezier.h gimpstroke.h gimpvectors.c gimpvectors.h @STRIP_END@
libappvectors_a_SOURCES = $(libappvectors_a_sources)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I../..
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
libappvectors_a_LIBADD =
libappvectors_a_OBJECTS = gimpbezier.$(OBJEXT) gimpvectors.$(OBJEXT)
AR = ar
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
DEP_FILES = .deps/gimpbezier.P .deps/gimpvectors.P
SOURCES = $(libappvectors_a_SOURCES)
OBJECTS = $(libappvectors_a_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .obj .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu app/vectors/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
# FIXME: We should only use cygpath when building on Windows,
# and only if it is available.
.c.obj:
$(COMPILE) -c `cygpath -w $<`
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
-rm -f *.$(OBJEXT)
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
.s.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
.S.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
maintainer-clean-libtool:
libappvectors.a: $(libappvectors_a_OBJECTS) $(libappvectors_a_DEPENDENCIES)
-rm -f libappvectors.a
$(AR) cru libappvectors.a $(libappvectors_a_OBJECTS) $(libappvectors_a_LIBADD)
$(RANLIB) libappvectors.a
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = app/vectors
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu app/vectors/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-libtool clean-tags \
clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-libtool distclean-tags distclean-depend \
distclean-generic clean-am
-rm -f libtool
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-tags maintainer-clean-depend \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

34
app/vectors/gimpanchor.h Normal file
View File

@ -0,0 +1,34 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpanchor.h
* Copyright (C) 2001 Simon Budig <simon@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_ANCHOR_H__
#define __GIMP_ANCHOR_H__
struct _GimpAnchor
{
GimpCoords position;
gint type;
gboolean active;
};
#endif /* __GIMP_ANCHOR_H__ */

283
app/vectors/gimpbezier.c Normal file
View File

@ -0,0 +1,283 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpbezier.c
* Copyright (C) 2002 Simon Budig <simon@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "glib-object.h"
#include "vectors-types.h"
#include "gimpanchor.h"
#include "gimpbezier.h"
/* private BezierStroke struct */
typedef struct _GimpBezierStroke GimpBezierStroke;
struct _GimpBezierStroke
{
gboolean closed;
GList * controls; /* of GimpBezierNodes */
};
typedef struct _GimpBezierNode GimpBezierNode;
struct _GimpBezierNode
{
GimpAnchor * ctrl_prev;
GimpAnchor * ctrl;
GimpAnchor * ctrl_next;
};
/* private variables */
static GimpVectorsClass *parent_class = NULL;
static void
gimp_bezier_finalize (GObject *object)
{
/* blablabla */
}
/* local function prototypes */
static void gimp_bezier_init (GimpBezier *vectors);
static void
gimp_bezier_class_init (GimpBezierClass *klass)
{
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpViewableClass *viewable_class;
GimpVectorsClass *vectors_class;
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
vectors_class = GIMP_VECTORS_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
vectors_class->anchor_set = gimp_bezier_anchor_set;
vectors_class->anchor_get_next = gimp_bezier_anchor_get_next;
vectors_class->anchor_move_absolute = gimp_bezier_anchor_move_absolute;
/* Lots of pointers missing */
object_class->finalize = gimp_bezier_finalize;
}
GType
gimp_bezier_get_type (void)
{
static GType bezier_type = 0;
if (! bezier_type)
{
static const GTypeInfo bezier_info =
{
sizeof (GimpBezierClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_bezier_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpBezier),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_bezier_init,
};
bezier_type = g_type_register_static (GIMP_TYPE_VECTORS,
"GimpBezier",
&bezier_info, 0);
}
return bezier_type;
}
static void
gimp_bezier_init (GimpBezier *bezier)
{
bezier->anchors = NULL;
bezier->strokes = NULL;
};
GimpAnchor *
gimp_bezier_anchor_get (const GimpVectors *vectors,
const GimpCoords *coord)
{
gdouble dx, dy, mindist;
GList *list;
GimpBezier *bezier;
GimpAnchor *anchor = NULL;
g_return_val_if_fail (GIMP_IS_BEZIER (vectors), NULL);
bezier = GIMP_BEZIER(vectors);
list = bezier->anchors;
if (list) {
dx = coord->x - ((GimpAnchor *) list->data)->position.x;
dy = coord->y - ((GimpAnchor *) list->data)->position.y;
anchor = (GimpAnchor *) list->data;
mindist = dx * dx + dy * dy;
list = list->next;
}
while (list) {
dx = coord->x - ((GimpAnchor *) list->data)->position.x;
dy = coord->y - ((GimpAnchor *) list->data)->position.y;
if (mindist > dx * dx + dy * dy) {
mindist = dx * dx + dy * dy;
anchor = (GimpAnchor *) list->data;
}
list = list->next;
}
return anchor;
}
/* prev == NULL: "first" anchor */
GimpAnchor *
gimp_bezier_anchor_get_next (const GimpVectors *vectors,
const GimpAnchor *prev)
{
static GList *last_shown = NULL;
GimpBezier *bezier;
g_return_val_if_fail (GIMP_IS_BEZIER (vectors), NULL);
bezier = GIMP_BEZIER(vectors);
if (!prev) {
last_shown = bezier->anchors;
return (GimpAnchor *) last_shown->data;
} else {
if (!last_shown || last_shown->data != prev) {
last_shown = g_list_find (bezier->anchors, prev);
}
last_shown = last_shown->next;
}
if (last_shown)
return (GimpAnchor *) last_shown->data;
else
return NULL;
}
GimpAnchor *
gimp_bezier_anchor_set (const GimpVectors *vectors,
const GimpCoords *coord,
const gboolean new_stroke)
{
GimpBezier *bezier;
GimpAnchor *anchor;
g_return_val_if_fail (GIMP_IS_BEZIER (vectors), NULL);
bezier = GIMP_BEZIER(vectors);
anchor = g_new0 (GimpAnchor, 1);
anchor->position.x = coord->x;
anchor->position.y = coord->y;
anchor->position.pressure = 1;
anchor->active = FALSE;
bezier->anchors = g_list_append (bezier->anchors, anchor);
return anchor;
}
void
gimp_bezier_anchor_move_relative (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *deltacoord,
const gint type)
{
GimpBezier *bezier;
g_return_if_fail (GIMP_IS_BEZIER (vectors));
bezier = GIMP_BEZIER(vectors);
if (anchor) {
anchor->position.x += deltacoord->x;
anchor->position.y += deltacoord->y;
}
}
void
gimp_bezier_anchor_move_absolute (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *coord,
const gint type)
{
GimpBezier *bezier;
g_return_if_fail (GIMP_IS_BEZIER (vectors));
bezier = GIMP_BEZIER(vectors);
if (anchor) {
anchor->position.x = coord->x;
anchor->position.y = coord->y;
}
}
void
gimp_bezier_anchor_delete (GimpVectors *vectors,
GimpAnchor *anchor);
/* accessing the shape of the curve */
gdouble
gimp_bezier_get_length (const GimpVectors *vectors,
const GimpAnchor *start);
/* returns the number of valid coordinates */
gint
gimp_bezier_interpolate (const GimpVectors *vectors,
const GimpStroke *start,
const gdouble precision,
const gint max_points,
GimpCoords *ret_coords);
/* Allow a singular temorary anchor (marking the "working point")? */
GimpAnchor *
gimp_bezier_temp_anchor_get (const GimpVectors *vectors);
GimpAnchor *
gimp_bezier_temp_anchor_set (GimpVectors *vectors,
const GimpCoords *coord);
gboolean
gimp_bezier_temp_anchor_fix (GimpVectors *vectors);
void
gimp_bezier_temp_anchor_delete (GimpVectors *vectors);

112
app/vectors/gimpbezier.h Normal file
View File

@ -0,0 +1,112 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpbezier.h
* Copyright (C) 2001 Simon Budig <simon@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_BEZIER_H__
#define __GIMP_BEZIER_H__
/* Temporary implementation with straight lines. */
#include "config.h"
#include "glib-object.h"
#include "vectors-types.h"
#include "gimpvectors.h"
#define GIMP_TYPE_BEZIER (gimp_bezier_get_type ())
#define GIMP_BEZIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_BEZIER, GimpBezier))
#define GIMP_BEZIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_BEZIER, GimpBezierClass))
#define GIMP_IS_BEZIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_BEZIER))
#define GIMP_IS_BEZIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_BEZIER))
#define GIMP_BEZIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_BEZIER, GimpBezierClass))
/* Bezier Data Structure */
struct _GimpBezier
{
GimpVectors parent_instance;
GList * anchors;
GList * strokes;
};
struct _GimpBezierClass
{
GimpVectorsClass parent_class;
};
GType gimp_bezier_get_type (void) G_GNUC_CONST;
/* accessing / modifying the anchors */
GimpAnchor * gimp_bezier_anchor_get (const GimpVectors *vectors,
const GimpCoords *coord);
/* prev == NULL: "first" anchor */
GimpAnchor * gimp_bezier_anchor_get_next (const GimpVectors *vectors,
const GimpAnchor *prev);
GimpAnchor * gimp_bezier_anchor_set (const GimpVectors *vectors,
const GimpCoords *coord,
const gboolean new_stroke);
void gimp_bezier_anchor_move_relative (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *deltacoord,
const gint type);
void gimp_bezier_anchor_move_absolute (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *coord,
const gint type);
void gimp_bezier_anchor_delete (GimpVectors *vectors,
GimpAnchor *anchor);
/* accessing the shape of the curve */
gdouble gimp_bezier_get_length (const GimpVectors *vectors,
const GimpAnchor *start);
/* returns the number of valid coordinates */
gint gimp_bezier_interpolate (const GimpVectors *vectors,
const GimpStroke *start,
const gdouble precision,
const gint max_points,
GimpCoords *ret_coords);
/* Allow a singular temorary anchor (marking the "working point")? */
GimpAnchor * gimp_bezier_temp_anchor_get (const GimpVectors *vectors);
GimpAnchor * gimp_bezier_temp_anchor_set (GimpVectors *vectors,
const GimpCoords *coord);
gboolean gimp_bezier_temp_anchor_fix (GimpVectors *vectors);
void gimp_bezier_temp_anchor_delete (GimpVectors *vectors);
#endif /* __GIMP_BEZIER_H__ */

430
app/vectors/gimpvectors.c Normal file
View File

@ -0,0 +1,430 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpvectors.c
* Copyright (C) 2001 Simon Budig <simon@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "glib-object.h"
#include "vectors-types.h"
#include "gimpvectors.h"
/* private variables */
static GimpVectorsClass *parent_class = NULL;
static void
gimp_vectors_finalize (GObject *object)
{
/* blablabla */
}
static void
gimp_vectors_class_init (GimpVectorsClass *klass)
{
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpViewableClass *viewable_class;
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_vectors_finalize;
/* gimp_object_class->name_changed = gimp_vectors_name_changed; */
klass->changed = NULL;
klass->removed = NULL;
klass->anchor_get = NULL;
klass->anchor_get_next = NULL;
klass->anchor_set = NULL;
klass->anchor_move_relative = NULL;
klass->anchor_move_absolute = NULL;
klass->anchor_delete = NULL;
klass->stroke_get = NULL;
klass->stroke_get_next = NULL;
klass->stroke_get_length = NULL;
klass->get_length = NULL;
klass->get_distance = NULL;
klass->interpolate = NULL;
klass->temp_anchor_get = NULL;
klass->temp_anchor_set = NULL;
klass->temp_anchor_fix = NULL;
klass->make_bezier = NULL;
}
GType
gimp_vectors_get_type (void)
{
static GType vectors_type = 0;
if (! vectors_type)
{
static const GTypeInfo vectors_info =
{
sizeof (GimpVectorsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_vectors_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpVectors),
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
vectors_type = g_type_register_static (GIMP_TYPE_VIEWABLE,
"GimpVectors",
&vectors_info, 0);
}
return vectors_type;
}
/* Calling the virtual functions */
GimpAnchor *
gimp_vectors_anchor_get (const GimpVectors *vectors,
const GimpCoords *coord)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->anchor_get)
return vectors_class->anchor_get (vectors, coord);
else
g_printerr ("gimp_vectors_anchor_get: default implementation\n");
return NULL;
}
GimpAnchor *
gimp_vectors_anchor_get_next (const GimpVectors *vectors,
const GimpAnchor *prev)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->anchor_get_next)
return vectors_class->anchor_get_next (vectors, prev);
else
g_printerr ("gimp_vectors_anchor_get_next: default implementation\n");
return NULL;
}
GimpAnchor *
gimp_vectors_anchor_set (const GimpVectors *vectors,
const GimpCoords *coord,
const gboolean new_stroke)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->anchor_set)
return vectors_class->anchor_set (vectors, coord, new_stroke);
else
g_printerr ("gimp_vectors_anchor_set: default implementation\n");
return NULL;
}
void
gimp_vectors_anchor_move_relative (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *deltacoord,
const gint type)
{
GimpVectorsClass *vectors_class;
g_return_if_fail (GIMP_IS_VECTORS (vectors));
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->anchor_move_relative)
vectors_class->anchor_move_relative (vectors, anchor, deltacoord, type);
else
g_printerr ("gimp_vectors_anchor_move_relative: default implementation\n");
return;
}
void
gimp_vectors_anchor_move_absolute (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *coord,
const gint type)
{
GimpVectorsClass *vectors_class;
g_return_if_fail (GIMP_IS_VECTORS (vectors));
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->anchor_move_absolute)
vectors_class->anchor_move_absolute (vectors, anchor, coord, type);
else
g_printerr ("gimp_vectors_anchor_move_absolute: default implementation\n");
return;
}
void
gimp_vectors_anchor_delete (GimpVectors *vectors,
GimpAnchor *anchor)
{
GimpVectorsClass *vectors_class;
g_return_if_fail (GIMP_IS_VECTORS (vectors));
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->anchor_delete)
vectors_class->anchor_delete (vectors, anchor);
else
g_printerr ("gimp_vectors_anchor_delete: default implementation\n");
return;
}
GimpStroke *
gimp_vectors_stroke_get (const GimpVectors *vectors,
const GimpCoords *coord)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->stroke_get)
return vectors_class->stroke_get (vectors, coord);
else
g_printerr ("gimp_vectors_stroke_get: default implementation\n");
return NULL;
}
GimpStroke *
gimp_vectors_stroke_get_next (const GimpVectors *vectors,
const GimpStroke *prev)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->stroke_get_next)
return vectors_class->stroke_get_next (vectors, prev);
else
g_printerr ("gimp_vectors_stroke_get_next: default implementation\n");
return NULL;
}
gdouble
gimp_vectors_stroke_get_length (const GimpVectors *vectors,
const GimpStroke *prev)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), 0);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->stroke_get_length)
return vectors_class->stroke_get_length (vectors, prev);
else
g_printerr ("gimp_vectors_stroke_get_length: default implementation\n");
return 0;
}
gdouble
gimp_vectors_get_length (const GimpVectors *vectors,
const GimpAnchor *start)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), 0);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->get_length)
return vectors_class->get_length (vectors, start);
else
g_printerr ("gimp_vectors_get_length: default implementation\n");
return 0;
}
gdouble
gimp_vectors_get_distance (const GimpVectors *vectors,
const GimpCoords *coord)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), 0);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->get_distance)
return vectors_class->get_distance (vectors, coord);
else
g_printerr ("gimp_vectors_get_distance: default implementation\n");
return 0;
}
gint
gimp_vectors_interpolate (const GimpVectors *vectors,
const GimpStroke *stroke,
const gdouble precision,
const gint max_points,
GimpCoords *ret_coords)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), 0);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->interpolate)
return vectors_class->interpolate (vectors, stroke, precision, max_points, ret_coords);
else
g_printerr ("gimp_vectors_interpolate: default implementation\n");
return 0;
}
GimpAnchor *
gimp_vectors_temp_anchor_get (const GimpVectors *vectors)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->temp_anchor_get)
return vectors_class->temp_anchor_get (vectors);
else
g_printerr ("gimp_vectors_temp_anchor_get: default implementation\n");
return NULL;
}
GimpAnchor *
gimp_vectors_temp_anchor_set (GimpVectors *vectors,
const GimpCoords *coord)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->temp_anchor_set)
return vectors_class->temp_anchor_set (vectors, coord);
else
g_printerr ("gimp_vectors_temp_anchor_set: default implementation\n");
return NULL;
}
gboolean
gimp_vectors_temp_anchor_fix (GimpVectors *vectors)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->temp_anchor_fix)
return vectors_class->temp_anchor_fix (vectors);
else
g_printerr ("gimp_vectors_temp_anchor_fix: default implementation\n");
return FALSE;
}
GimpVectors *
gimp_vectors_make_bezier (const GimpVectors *vectors)
{
GimpVectorsClass *vectors_class;
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL);
vectors_class = GIMP_VECTORS_GET_CLASS (vectors);
if (vectors_class->make_bezier)
return vectors_class->make_bezier (vectors);
else
g_printerr ("gimp_vectors_make_bezier: default implementation\n");
return NULL;
}

191
app/vectors/gimpvectors.h Normal file
View File

@ -0,0 +1,191 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpvectors.h
* Copyright (C) 2001 Simon Budig <simon@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_VECTORS_H__
#define __GIMP_VECTORS_H__
#include "core/gimpviewable.h"
#define GIMP_TYPE_VECTORS (gimp_vectors_get_type ())
#define GIMP_VECTORS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS, GimpVectors))
#define GIMP_VECTORS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTORS, GimpVectorsClass))
#define GIMP_IS_VECTORS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTORS))
#define GIMP_IS_VECTORS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VECTORS))
#define GIMP_VECTORS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VECTORS, GimpVectorsClass))
struct _GimpVectors
{
GimpViewable parent_instance;
gboolean visible; /* controls visibility */
gboolean locked; /* transformation locking */
/* Stuff missing */
};
struct _GimpVectorsClass
{
GimpViewableClass parent_class;
void (* changed) (GimpVectors *vectors);
void (* removed) (GimpVectors *vectors);
GimpAnchor * (* anchor_get) (const GimpVectors *vectors,
const GimpCoords *coord);
GimpAnchor * (* anchor_get_next) (const GimpVectors *vectors,
const GimpAnchor *prev);
GimpAnchor * (* anchor_set) (const GimpVectors *vectors,
const GimpCoords *coord,
const gboolean new_stroke);
void (* anchor_move_relative) (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *deltacoord,
const gint type);
void (* anchor_move_absolute) (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *coord,
const gint type);
void (* anchor_delete) (GimpVectors *vectors,
GimpAnchor *anchor);
GimpStroke * (* stroke_get) (const GimpVectors *vectors,
const GimpCoords *coord);
GimpStroke * (* stroke_get_next) (const GimpVectors *vectors,
const GimpStroke *prev);
gdouble (* stroke_get_length) (const GimpVectors *vectors,
const GimpStroke *stroke);
gdouble (* get_length) (const GimpVectors *vectors,
const GimpAnchor *start);
gdouble (* get_distance) (const GimpVectors *vectors,
const GimpCoords *coord);
gint (* interpolate) (const GimpVectors *vectors,
const GimpStroke *stroke,
const gdouble precision,
const gint max_points,
GimpCoords *ret_coords);
GimpAnchor * (* temp_anchor_get) (const GimpVectors *vectors);
GimpAnchor * (* temp_anchor_set) (GimpVectors *vectors,
const GimpCoords *coord);
gboolean (* temp_anchor_fix) (GimpVectors *vectors);
GimpVectors * (* make_bezier) (const GimpVectors *vectors);
};
/* vectors utility functions */
GType gimp_vectors_get_type (void) G_GNUC_CONST;
/* accessing / modifying the anchors */
GimpAnchor * gimp_vectors_anchor_get (const GimpVectors *vectors,
const GimpCoords *coord);
/* prev == NULL: "first" anchor */
GimpAnchor * gimp_vectors_anchor_get_next (const GimpVectors *vectors,
const GimpAnchor *prev);
GimpAnchor * gimp_vectors_anchor_set (const GimpVectors *vectors,
const GimpCoords *coord,
const gboolean new_stroke);
/* type will be an xorable enum:
* VECTORS_NONE, VECTORS_FIX_ANGLE, VECTORS_FIX_RATIO, VECTORS_RESTRICT_ANGLE
* or so.
*/
void gimp_vectors_anchor_move_relative (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *deltacoord,
const gint type);
void gimp_vectors_anchor_move_absolute (GimpVectors *vectors,
GimpAnchor *anchor,
const GimpCoords *coord,
const gint type);
void gimp_vectors_anchor_delete (GimpVectors *vectors,
GimpAnchor *anchor);
/* GimpStroke is a connected component of a GimpVectors object */
GimpStroke * gimp_vectors_stroke_get (const GimpVectors *vectors,
const GimpCoords *coord);
/* prev == NULL: "first" stroke */
GimpStroke * gimp_vectors_stroke_get_next (const GimpVectors *vectors,
const GimpStroke *prev);
gdouble gimp_vectors_stroke_get_length (const GimpVectors *vectors,
const GimpStroke *stroke);
/* accessing the shape of the curve */
gdouble gimp_vectors_get_length (const GimpVectors *vectors,
const GimpAnchor *start);
gdouble gimp_vectors_get_distance (const GimpVectors *vectors,
const GimpCoords *coord);
/* returns the number of valid coordinates */
gint gimp_vectors_interpolate (const GimpVectors *vectors,
const GimpStroke *stroke,
const gdouble precision,
const gint max_points,
GimpCoords *ret_coords);
/* Allow a singular temorary anchor (marking the "working point")? */
GimpAnchor * gimp_vectors_temp_anchor_get (const GimpVectors *vectors);
GimpAnchor * gimp_vectors_temp_anchor_set (GimpVectors *vectors,
const GimpCoords *coord);
gboolean gimp_vectors_temp_anchor_fix (GimpVectors *vectors);
/* usually overloaded */
/* creates a bezier approximation. */
GimpVectors * gimp_vectors_make_bezier (const GimpVectors *vectors);
#endif /* __GIMP_VECTORS_H__ */

View File

@ -0,0 +1,36 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* vectors-types.h
* Copyright (C) 2001 Simon Budig <simon@gimp.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __VECTORS_TYPES_H__
#define __VECTORS_TYPES_H__
#include "core/core-types.h"
typedef struct _GimpAnchor GimpAnchor;
typedef gpointer GimpStroke;
typedef struct _GimpBezier GimpBezier;
typedef struct _GimpBezierClass GimpBezierClass;
typedef struct _GimpVectors GimpVectors;
typedef struct _GimpVectorsClass GimpVectorsClass;
#endif /* __VECTORS_TYPES_H__ */

View File

@ -845,6 +845,7 @@ app/paint-funcs/Makefile
app/pdb/Makefile
app/plug-in/Makefile
app/tools/Makefile
app/vectors/Makefile
app/widgets/Makefile
app/xcf/Makefile
plug-ins/Makefile