Code

e5d634985dcb8a3977b586c027a2f697d889f702
[inkscape.git] / src / display / canvas-text.h
1 #ifndef __SP_CANVASTEXT_H__
2 #define __SP_CANVASTEXT_H__
4 /*
5  * Canvas text.
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *   Maximilian Albert <maximilian.albert@gmail.com>
10  *
11  * Copyright (C) 2000-2002 Lauris Kaplinski
12  * Copyright (C) 2008 Maximilian Albert
13  *
14  * Released under GNU GPL, read the file 'COPYING' for more information
15  */
17 /*
18  * FIXME: The following code should actually be in a separate file called display/canvas-text.h. It
19  * temporarily had to be moved here because of linker errors.
20  */
22 struct SPItem;
23 struct SPDesktop;
25 #define SP_TYPE_CANVASTEXT (sp_canvastext_get_type ())
26 #define SP_CANVASTEXT(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CANVASTEXT, SPCanvasText))
27 #define SP_IS_CANVASTEXT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CANVASTEXT))
29 struct SPCanvasText : public SPCanvasItem{
30     SPItem *item;  // the item to which this line belongs in some sense; may be NULL for some users
31     guint32 rgba;
32     guint32 rgba_stroke;
33     SPDesktop *desktop; // the desktop to which this text is attached; needed for coordinate transforms (TODO: these should be eliminated)
35     gchar* text;
36     Geom::Point s;
37     Geom::Matrix affine;
38     double fontsize;
39     double anchor_x;
40     double anchor_y;
41 };
42 struct SPCanvasTextClass : public SPCanvasItemClass{};
44 GtkType sp_canvastext_get_type (void);
46 SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text);
48 void sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba, guint32 rgba_stroke);
49 void sp_canvastext_set_coords (SPCanvasText *ct, gdouble x0, gdouble y0);
50 void sp_canvastext_set_coords (SPCanvasText *ct, const Geom::Point start);
51 void sp_canvastext_set_text (SPCanvasText *ct, gchar const* new_text);
52 void sp_canvastext_set_number_as_text (SPCanvasText *ct, int num);
53 void sp_canvastext_set_fontsize (SPCanvasText *ct, double size);
54 void sp_canvastext_set_anchor (SPCanvasText *ct, double anchor_x, double anchor_y);
56 #endif
59 /*
60   Local Variables:
61   mode:c++
62   c-file-style:"stroustrup"
63   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
64   indent-tabs-mode:nil
65   fill-column:99
66   End:
67 */
68 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :