2 * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
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.
25 /* Rectangle and ellipse item types 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_RECT_ELLIPSE_H
35 #define FOO_CANVAS_RECT_ELLIPSE_H
38 #include <libfoocanvas/foo-canvas.h>
43 /* Base class for rectangle and ellipse item types. These are defined by their top-left and
44 * bottom-right corners. Rectangles and ellipses share the following arguments:
46 * name type read/write description
47 * ------------------------------------------------------------------------------------------
48 * x1 double RW Leftmost coordinate of rectangle or ellipse
49 * y1 double RW Topmost coordinate of rectangle or ellipse
50 * x2 double RW Rightmost coordinate of rectangle or ellipse
51 * y2 double RW Bottommost coordinate of rectangle or ellipse
52 * fill_color string W X color specification for fill color,
53 * or NULL pointer for no color (transparent)
54 * fill_color_gdk GdkColor* RW Allocated GdkColor for fill
55 * outline_color string W X color specification for outline color,
56 * or NULL pointer for no color (transparent)
57 * outline_color_gdk GdkColor* RW Allocated GdkColor for outline
58 * fill_stipple GdkBitmap* RW Stipple pattern for fill
59 * outline_stipple GdkBitmap* RW Stipple pattern for outline
60 * width_pixels uint RW Width of the outline in pixels. The outline will
61 * not be scaled when the canvas zoom factor is changed.
62 * width_units double RW Width of the outline in canvas units. The outline
63 * will be scaled when the canvas zoom factor is changed.
67 #define FOO_TYPE_CANVAS_RE (foo_canvas_re_get_type ())
68 #define FOO_CANVAS_RE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_RE, FooCanvasRE))
69 #define FOO_CANVAS_RE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_RE, FooCanvasREClass))
70 #define FOO_IS_CANVAS_RE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_RE))
71 #define FOO_IS_CANVAS_RE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_RE))
72 #define FOO_CANVAS_RE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_RE, FooCanvasREClass))
75 typedef struct _FooCanvasRE FooCanvasRE
;
76 typedef struct _FooCanvasREClass FooCanvasREClass
;
81 GdkBitmap
*fill_stipple
; /* Stipple for fill */
82 GdkBitmap
*outline_stipple
; /* Stipple for outline */
84 gulong fill_pixel
; /* Fill color */
85 gulong outline_pixel
; /* Outline color */
87 double x1
, y1
, x2
, y2
; /* Corners of item */
88 double width
; /* Outline width */
90 guint fill_color
; /* Fill color, RGBA */
91 guint outline_color
; /* Outline color, RGBA */
93 /* Configuration flags */
95 unsigned int fill_set
: 1; /* Is fill color set? */
96 unsigned int outline_set
: 1; /* Is outline color set? */
97 unsigned int width_pixels
: 1; /* Is outline width specified in pixels or units? */
98 unsigned int aa
: 1; /* Enable anti-alias for this item */
101 struct _FooCanvasREClass
{
102 FooCanvasItemClass parent_class
;
106 /* Standard Gtk function */
107 GType
foo_canvas_re_get_type (void) G_GNUC_CONST
;
110 /* Rectangle item. No configurable or queryable arguments are available (use those in
115 #define FOO_TYPE_CANVAS_RECT (foo_canvas_rect_get_type ())
116 #define FOO_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_RECT, FooCanvasRect))
117 #define FOO_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_RECT, FooCanvasRectClass))
118 #define FOO_IS_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_RECT))
119 #define FOO_IS_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_RECT))
120 #define FOO_CANVAS_RECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_RECT, FooCanvasRectClass))
123 typedef struct _FooCanvasRect FooCanvasRect
;
124 typedef struct _FooCanvasRectPrivate FooCanvasRectPrivate
;
125 typedef struct _FooCanvasRectClass FooCanvasRectClass
;
127 struct _FooCanvasRect
{
129 FooCanvasRectPrivate
*priv
;
132 struct _FooCanvasRectClass
{
133 FooCanvasREClass parent_class
;
137 /* Standard Gtk function */
138 GType
foo_canvas_rect_get_type (void) G_GNUC_CONST
;
141 /* Ellipse item. No configurable or queryable arguments are available (use those in
146 #define FOO_TYPE_CANVAS_ELLIPSE (foo_canvas_ellipse_get_type ())
147 #define FOO_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_ELLIPSE, FooCanvasEllipse))
148 #define FOO_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_ELLIPSE, FooCanvasEllipseClass))
149 #define FOO_IS_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_ELLIPSE))
150 #define FOO_IS_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_ELLIPSE))
151 #define FOO_CANVAS_ELLIPSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_ELLIPSE, FooCanvasEllipseClass))
154 typedef struct _FooCanvasEllipse FooCanvasEllipse
;
155 typedef struct _FooCanvasEllipseClass FooCanvasEllipseClass
;
157 struct _FooCanvasEllipse
{
161 struct _FooCanvasEllipseClass
{
162 FooCanvasREClass parent_class
;
166 /* Standard Gtk function */
167 GType
foo_canvas_ellipse_get_type (void) G_GNUC_CONST
;