code-analyzer: Fixed bgo#667903 - Code Analyzer Crashes
[anjuta.git] / libfoocanvas / foo-canvas-polygon.h
blob354befc98e1e354abd7524fdab5285fae8bafa86
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@
25 /* Polygon item type for FooCanvas widget
27 * FooCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is
28 * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties.
31 * Author: Federico Mena <federico@nuclecu.unam.mx>
34 #ifndef FOO_CANVAS_POLYGON_H
35 #define FOO_CANVAS_POLYGON_H
38 #include <libfoocanvas/foo-canvas.h>
40 G_BEGIN_DECLS
43 /* Polygon item for the canvas. A polygon is a bit different from rectangles and ellipses in that
44 * points inside it will always be considered "inside", even if the fill color is not set. If you
45 * want to have a hollow polygon, use a line item instead.
47 * The following object arguments are available:
49 * name type read/write description
50 * ------------------------------------------------------------------------------------------
51 * points FooCanvasPoints* RW Pointer to a FooCanvasPoints structure.
52 * This can be created by a call to
53 * foo_canvas_points_new() (in foo-canvas-util.h).
54 * X coordinates are in the even indices of the
55 * points->coords array, Y coordinates are in
56 * the odd indices.
57 * fill_color string W X color specification for fill color,
58 * or NULL pointer for no color (transparent).
59 * fill_color_gdk GdkColor* RW Allocated GdkColor for fill.
60 * outline_color string W X color specification for outline color,
61 * or NULL pointer for no color (transparent).
62 * outline_color_gdk GdkColor* RW Allocated GdkColor for outline.
63 * fill_stipple GdkBitmap* RW Stipple pattern for fill
64 * outline_stipple GdkBitmap* RW Stipple pattern for outline
65 * width_pixels uint RW Width of the outline in pixels. The outline will
66 * not be scaled when the canvas zoom factor is changed.
67 * width_units double RW Width of the outline in canvas units. The outline
68 * will be scaled when the canvas zoom factor is changed.
71 #define FOO_TYPE_CANVAS_POLYGON (foo_canvas_polygon_get_type ())
72 #define FOO_CANVAS_POLYGON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_POLYGON, FooCanvasPolygon))
73 #define FOO_CANVAS_POLYGON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_POLYGON, FooCanvasPolygonClass))
74 #define FOO_IS_CANVAS_POLYGON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_POLYGON))
75 #define FOO_IS_CANVAS_POLYGON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_POLYGON))
76 #define FOO_CANVAS_POLYGON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_POLYGON, FooCanvasPolygonClass))
79 typedef struct _FooCanvasPolygon FooCanvasPolygon;
80 typedef struct _FooCanvasPolygonClass FooCanvasPolygonClass;
82 struct _FooCanvasPolygon {
83 FooCanvasItem item;
85 double *coords; /* Array of coordinates for the polygon's points. X coords
86 * are in the even indices, Y coords are in the odd indices.
88 GdkBitmap *fill_stipple; /* Stipple for fill */
89 GdkBitmap *outline_stipple; /* Stipple for outline */
91 gulong fill_pixel; /* Color for fill */
92 gulong outline_pixel; /* Color for outline */
93 double width; /* Width of polygon's outline */
95 int num_points; /* Number of points in the polygon */
96 guint fill_color; /* Fill color, RGBA */
97 guint outline_color; /* Outline color, RGBA */
99 guint32 fill_rgba; /* RGBA color for filling */ /*AA*/
100 guint32 outline_rgba; /* RGBA color for outline */ /*AA*/
102 guint fill_set : 1; /* Is fill color set? */
103 guint outline_set : 1; /* Is outline color set? */
104 guint width_pixels : 1; /* Is outline width specified in pixels or units? */
105 guint aa: 1; /* Enable anti-alias for this item */
108 struct _FooCanvasPolygonClass {
109 FooCanvasItemClass parent_class;
113 /* Standard Gtk function */
114 GType foo_canvas_polygon_get_type (void) G_GNUC_CONST;
117 G_END_DECLS
119 #endif