Code

cc194ccc42c743947404669249fae33916978117
[inkscape.git] / src / display / canvas-text.h
1 #ifndef SEEN_SP_CANVASTEXT_H
2 #define SEEN_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 #include "sp-canvas-item.h"
19 struct SPItem;
20 struct SPDesktop;
22 #define SP_TYPE_CANVASTEXT (sp_canvastext_get_type ())
23 #define SP_CANVASTEXT(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CANVASTEXT, SPCanvasText))
24 #define SP_IS_CANVASTEXT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CANVASTEXT))
26 struct SPCanvasText : public SPCanvasItem {
27     SPItem *item;  // the item to which this line belongs in some sense; may be NULL for some users
28     guint32 rgba;
29     guint32 rgba_stroke;
30     SPDesktop *desktop; // the desktop to which this text is attached; needed for coordinate transforms (TODO: these should be eliminated)
32     gchar* text;
33     Geom::Point s;
34     Geom::Matrix affine;
35     double fontsize;
36     double anchor_x;
37     double anchor_y;
38 };
39 struct SPCanvasTextClass : public SPCanvasItemClass{};
41 GtkType sp_canvastext_get_type (void);
43 SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text);
45 void sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba, guint32 rgba_stroke);
46 void sp_canvastext_set_coords (SPCanvasText *ct, gdouble x0, gdouble y0);
47 void sp_canvastext_set_coords (SPCanvasText *ct, const Geom::Point start);
48 void sp_canvastext_set_text (SPCanvasText *ct, gchar const* new_text);
49 void sp_canvastext_set_number_as_text (SPCanvasText *ct, int num);
50 void sp_canvastext_set_fontsize (SPCanvasText *ct, double size);
51 void sp_canvastext_set_anchor (SPCanvasText *ct, double anchor_x, double anchor_y);
53 #endif // SEEN_SP_CANVASTEXT_H
56 /*
57   Local Variables:
58   mode:c++
59   c-file-style:"stroustrup"
60   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
61   indent-tabs-mode:nil
62   fill-column:99
63   End:
64 */
65 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :