1 #ifndef SEEN_INKSCAPE_CTRLRECT_H
2 #define SEEN_INKSCAPE_CTRLRECT_H
4 /**
5 * \file sodipodi-ctrlrect.h
6 * \brief Simple non-transformed rectangle, usable for rubberband
7 *
8 * Authors:
9 * Lauris Kaplinski <lauris@ximian.com>
10 * Carl Hetherington <inkscape@carlh.net>
11 *
12 * Copyright (C) 1999-2001 Lauris Kaplinski
13 * Copyright (C) 2000-2001 Ximian, Inc.
14 *
15 * Released under GNU GPL
16 *
17 */
19 #include <glib/gtypes.h>
20 #include "sp-canvas-item.h"
21 #include "libnr/nr-rect-l.h"
23 struct SPCanvasBuf;
25 #define SP_TYPE_CTRLRECT (sp_ctrlrect_get_type ())
26 #define SP_CTRLRECT(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CTRLRECT, CtrlRect))
27 #define SP_CTRLRECT_CLASS(c) (GTK_CHECK_CLASS_CAST((c), SP_TYPE_CTRLRECT, SPCtrlRectClass))
28 #define SP_IS_CTRLRECT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CTRLRECT))
29 #define SP_IS_CTRLRECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CTRLRECT))
31 class CtrlRect : public SPCanvasItem
32 {
33 public:
35 void init();
36 void setColor(guint32 b, bool h, guint f);
37 void setShadow(int s, guint c);
38 void setRectangle(Geom::Rect const &r);
39 void setDashed(bool d);
41 void render(SPCanvasBuf *buf);
42 void update(Geom::Matrix const &affine, unsigned int flags);
44 private:
45 void _requestUpdate();
47 Geom::Rect _rect;
48 bool _has_fill;
49 bool _dashed;
50 NRRectL _area;
51 gint _shadow_size;
52 guint32 _border_color;
53 guint32 _fill_color;
54 guint32 _shadow_color;
55 int _shadow;
56 };
58 struct SPCtrlRectClass : public SPCanvasItemClass {};
60 GtkType sp_ctrlrect_get_type();
62 #endif // SEEN_RUBBERBAND_H
64 /*
65 Local Variables:
66 mode:c++
67 c-file-style:"stroustrup"
68 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
69 indent-tabs-mode:nil
70 fill-column:99
71 End:
72 */
73 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :