am-project: Rename AM_PROPERTY_COMPILATION_FLAG
[anjuta.git] / libfoocanvas / foo-canvas-line.h
blobe928a75455209c45989f1c26486d8deeefaf1796
1 /*
2 * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
3 * All rights reserved.
5 * This file is part of the Gnome Library.
7 * The Gnome Library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * The Gnome Library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with the Gnome Library; see the file COPYING.LIB. If not,
19 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 @NOTATION@
26 /* Line/curve item type for FooCanvas widget
28 * FooCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is
29 * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties.
32 * Author: Federico Mena <federico@nuclecu.unam.mx>
35 #ifndef FOO_CANVAS_LINE_H
36 #define FOO_CANVAS_LINE_H
39 #include <libfoocanvas/foo-canvas.h>
42 G_BEGIN_DECLS
45 /* Line item for the canvas. This is a polyline with configurable width, cap/join styles, and arrowheads.
46 * If arrowheads are enabled, then three values are used to specify their shape:
48 * arrow_shape_a: Distance from tip of arrowhead to the center point.
49 * arrow_shape_b: Distance from tip of arrowhead to trailing point, measured along the shaft.
50 * arrow_shape_c: Distance of trailing point from outside edge of shaft.
52 * The following object arguments are available:
54 * name type read/write description
55 * ------------------------------------------------------------------------------------------
56 * points FooCanvasPoints* RW Pointer to a FooCanvasPoints structure.
57 * This can be created by a call to
58 * foo_canvas_points_new() (in foo-canvas-util.h).
59 * X coordinates are in the even indices of the
60 * points->coords array, Y coordinates are in
61 * the odd indices.
62 * fill_color string W X color specification for line
63 * fill_color_gdk GdkColor* RW Pointer to an allocated GdkColor
64 * fill_stipple GdkBitmap* RW Stipple pattern for the line
65 * width_pixels uint R Width of the line in pixels. The line width
66 * will not be scaled when the canvas zoom factor changes.
67 * width_units double R Width of the line in canvas units. The line width
68 * will be scaled when the canvas zoom factor changes.
69 * cap_style GdkCapStyle RW Cap ("endpoint") style for the line.
70 * join_style GdkJoinStyle RW Join ("vertex") style for the line.
71 * line_style GdkLineStyle RW Line dash style
72 * first_arrowhead boolean RW Specifies whether to draw an arrowhead on the
73 * first point of the line.
74 * last_arrowhead boolean RW Specifies whether to draw an arrowhead on the
75 * last point of the line.
76 * smooth boolean RW Specifies whether to smooth the line using
77 * parabolic splines.
78 * spline_steps uint RW Specifies the number of steps to use when rendering curves.
79 * arrow_shape_a double RW First arrow shape specifier.
80 * arrow_shape_b double RW Second arrow shape specifier.
81 * arrow_shape_c double RW Third arrow shape specifier.
85 #define FOO_TYPE_CANVAS_LINE (foo_canvas_line_get_type ())
86 #define FOO_CANVAS_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_LINE, FooCanvasLine))
87 #define FOO_CANVAS_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_LINE, FooCanvasLineClass))
88 #define FOO_IS_CANVAS_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_LINE))
89 #define FOO_IS_CANVAS_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_LINE))
90 #define FOO_CANVAS_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_LINE, FooCanvasLineClass))
93 typedef struct _FooCanvasLine FooCanvasLine;
94 typedef struct _FooCanvasLineClass FooCanvasLineClass;
96 struct _FooCanvasLine {
97 FooCanvasItem item;
99 double *coords; /* Array of coordinates for the line's points. X coords are in the
100 * even indices, Y coords are in the odd indices. If the line has
101 * arrowheads then the first and last points have been adjusted to
102 * refer to the necks of the arrowheads rather than their tips. The
103 * actual endpoints are stored in the first_arrow and last_arrow
104 * arrays, if they exist.
107 double *first_coords; /* Array of points describing polygon for the first arrowhead */
108 double *last_coords; /* Array of points describing polygon for the last arrowhead */
110 GdkBitmap *stipple; /* Stipple pattern */
112 double width; /* Width of the line */
114 double shape_a; /* Distance from tip of arrowhead to center */
115 double shape_b; /* Distance from tip of arrowhead to trailing point, measured along shaft */
116 double shape_c; /* Distance of trailing points from outside edge of shaft */
118 GdkCapStyle cap; /* Cap style for line */
119 GdkJoinStyle join; /* Join style for line */
120 GdkLineStyle line_style;/* Style for the line */
122 gulong fill_pixel; /* Color for line */
123 guint32 fill_rgba; /* RGBA color for outline */ /*AA*/
125 int num_points; /* Number of points in the line */
126 guint width_pixels : 1; /* Is the width specified in pixels or units? */
127 guint first_arrow : 1; /* Draw first arrowhead? */
128 guint last_arrow : 1; /* Draw last arrowhead? */
129 guint smooth : 1; /* Smooth line (with parabolic splines)? */
130 guint aa: 1; /* Enable anti-alias for this item */
133 struct _FooCanvasLineClass {
134 FooCanvasItemClass parent_class;
138 /* Standard Gtk function */
139 GType foo_canvas_line_get_type (void) G_GNUC_CONST;
142 G_END_DECLS
144 #endif