Code

A simple layout document as to what, why and how is cppification.
[inkscape.git] / src / sp-rect.h
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"
18 #include <2geom/forward.h>
22 #define SP_TYPE_RECT            (sp_rect_get_type ())
23 #define SP_RECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_RECT, SPRect))
24 #define SP_RECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_RECT, SPRectClass))
25 #define SP_IS_RECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_RECT))
26 #define SP_IS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_RECT))
28 class SPRect;
29 class SPRectClass;
31 struct SPRect : public SPShape {
32         SVGLength x;
33         SVGLength y;
34         SVGLength width;
35         SVGLength height;
36         SVGLength rx;
37         SVGLength ry;
38 };
40 struct SPRectClass {
41         SPShapeClass parent_class;
42 };
45 /* Standard GType function */
46 GType sp_rect_get_type (void);
48 void sp_rect_position_set (SPRect * rect, gdouble x, gdouble y, gdouble width, gdouble height);
50 /* If SET if FALSE, VALUE is just ignored */
51 void sp_rect_set_rx(SPRect * rect, gboolean set, gdouble value);
52 void sp_rect_set_ry(SPRect * rect, gboolean set, gdouble value);
54 void sp_rect_set_visible_rx (SPRect *rect, gdouble rx);
55 void sp_rect_set_visible_ry (SPRect *rect, gdouble ry);
56 gdouble sp_rect_get_visible_rx (SPRect *rect);
57 gdouble sp_rect_get_visible_ry (SPRect *rect);
58 Geom::Rect sp_rect_get_rect (SPRect *rect);
60 void sp_rect_set_visible_width (SPRect *rect, gdouble rx);
61 void sp_rect_set_visible_height (SPRect *rect, gdouble ry);
62 gdouble sp_rect_get_visible_width (SPRect *rect);
63 gdouble sp_rect_get_visible_height (SPRect *rect);
65 void sp_rect_compensate_rxry (SPRect *rect, Geom::Matrix xform);
67 #endif