1 #ifndef __SP_RECT_H__
2 #define __SP_RECT_H__
4 /*
5 * SVG <rect> implementation
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 1999-2002 Lauris Kaplinski
11 * Copyright (C) 2000-2001 Ximian, Inc.
12 *
13 * Released under GNU GPL, read the file 'COPYING' for more information
14 */
16 #include "svg/svg-length.h"
17 #include "sp-shape.h"
21 #define SP_TYPE_RECT (sp_rect_get_type ())
22 #define SP_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_RECT, SPRect))
23 #define SP_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_RECT, SPRectClass))
24 #define SP_IS_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_RECT))
25 #define SP_IS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_RECT))
27 class SPRect;
28 class SPRectClass;
30 struct SPRect : public SPShape {
31 SVGLength x;
32 SVGLength y;
33 SVGLength width;
34 SVGLength height;
35 SVGLength rx;
36 SVGLength ry;
37 };
39 struct SPRectClass {
40 SPShapeClass parent_class;
41 };
44 /* Standard GType function */
45 GType sp_rect_get_type (void);
47 void sp_rect_position_set (SPRect * rect, gdouble x, gdouble y, gdouble width, gdouble height);
49 /* If SET if FALSE, VALUE is just ignored */
50 void sp_rect_set_rx(SPRect * rect, gboolean set, gdouble value);
51 void sp_rect_set_ry(SPRect * rect, gboolean set, gdouble value);
53 void sp_rect_set_visible_rx (SPRect *rect, gdouble rx);
54 void sp_rect_set_visible_ry (SPRect *rect, gdouble ry);
55 gdouble sp_rect_get_visible_rx (SPRect *rect);
56 gdouble sp_rect_get_visible_ry (SPRect *rect);
58 void sp_rect_set_visible_width (SPRect *rect, gdouble rx);
59 void sp_rect_set_visible_height (SPRect *rect, gdouble ry);
60 gdouble sp_rect_get_visible_width (SPRect *rect);
61 gdouble sp_rect_get_visible_height (SPRect *rect);
63 void sp_rect_compensate_rxry (SPRect *rect, NR::Matrix xform);
65 #endif