canvas-text.h revision f8307d2d97a6e202153ae676f974f79e1b0ec5cd
4116N/A#ifndef SEEN_SP_CANVASTEXT_H
4116N/A#define SEEN_SP_CANVASTEXT_H
4116N/A
4116N/A/*
4116N/A * Canvas text.
4116N/A *
4116N/A * Authors:
4116N/A * Lauris Kaplinski <lauris@kaplinski.com>
4116N/A * Maximilian Albert <maximilian.albert@gmail.com>
4116N/A *
4116N/A * Copyright (C) 2000-2002 Lauris Kaplinski
4116N/A * Copyright (C) 2008 Maximilian Albert
4116N/A *
4116N/A * Released under GNU GPL, read the file 'COPYING' for more information
4116N/A */
4116N/A
4116N/A#include "sp-canvas-item.h"
4116N/A
4116N/Astruct SPItem;
4116N/Astruct SPDesktop;
5680N/A
5680N/A#define SP_TYPE_CANVASTEXT (sp_canvastext_get_type ())
5588N/A#define SP_CANVASTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_CANVASTEXT, SPCanvasText))
4116N/A#define SP_IS_CANVASTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_CANVASTEXT))
5680N/A
5680N/Aenum CanvasTextAnchorPositionEnum {
4116N/A TEXT_ANCHOR_CENTER,
4116N/A TEXT_ANCHOR_TOP,
4116N/A TEXT_ANCHOR_BOTTOM,
5588N/A TEXT_ANCHOR_LEFT,
4116N/A TEXT_ANCHOR_RIGHT,
4116N/A TEXT_ANCHOR_ZERO
4116N/A};
5588N/A
4116N/Astruct SPCanvasText : public SPCanvasItem {
4116N/A SPItem *item; // the item to which this line belongs in some sense; may be NULL for some users
4116N/A guint32 rgba;
5588N/A guint32 rgba_stroke;
4116N/A guint32 rgba_background;
5680N/A bool outline;
5680N/A bool background;
5680N/A CanvasTextAnchorPositionEnum anchor_position;
4116N/A
4116N/A SPDesktop *desktop; // the desktop to which this text is attached; needed for coordinate transforms (TODO: these should be eliminated)
5680N/A
4116N/A gchar* text;
4116N/A Geom::Point s;
4116N/A Geom::Affine affine;
4116N/A double fontsize;
4116N/A double anchor_x;
5588N/A double anchor_y;
4116N/A};
4116N/Astruct SPCanvasTextClass : public SPCanvasItemClass{};
4116N/A
4116N/AGType sp_canvastext_get_type (void);
4116N/A
4116N/ASPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text);
void sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba, guint32 rgba_stroke);
void sp_canvastext_set_coords (SPCanvasText *ct, gdouble x0, gdouble y0);
void sp_canvastext_set_coords (SPCanvasText *ct, const Geom::Point start);
void sp_canvastext_set_text (SPCanvasText *ct, gchar const* new_text);
void sp_canvastext_set_number_as_text (SPCanvasText *ct, int num);
void sp_canvastext_set_fontsize (SPCanvasText *ct, double size);
void sp_canvastext_set_anchor (SPCanvasText *ct, double anchor_x, double anchor_y);
#endif // SEEN_SP_CANVASTEXT_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :