[CPML] s/cpml_(.*?)_length/cpml_\1_get_length/
[adg.git] / nodist / AdgText / foo-canvas-text.h
blob38c3fb600658bd385eee9ffc67b144097fd34ffe
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
4 * All rights reserved.
6 * This file is part of the Gnome Library.
8 * The Gnome Library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * The Gnome Library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with the Gnome Library; see the file COPYING.LIB. If not,
20 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 @NOTATION@
26 /* Text item type for FooCanvas widget
28 * FooCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is
29 * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties.
32 * Author: Federico Mena <federico@nuclecu.unam.mx>
33 * Port to Pango co-done by Gergõ Érdi <cactus@cactus.rulez.org>
36 #ifndef FOO_CANVAS_TEXT_H
37 #define FOO_CANVAS_TEXT_H
40 #include <libfoocanvas/foo-canvas.h>
43 G_BEGIN_DECLS
46 /* Text item for the canvas. Text items are positioned by an anchor point and an anchor direction.
48 * A clipping rectangle may be specified for the text. The rectangle is anchored at the text's anchor
49 * point, and is specified by clipping width and height parameters. If the clipping rectangle is
50 * enabled, it will clip the text.
52 * In addition, x and y offset values may be specified. These specify an offset from the anchor
53 * position. If used in conjunction with the clipping rectangle, these could be used to implement
54 * simple scrolling of the text within the clipping rectangle.
56 * Properties marked with [*] also have _set properties associated
57 * with them, that determine if the specified value should be used
58 * instead of the default (style-defined) values
60 * The following object arguments are available:
62 * name type read/write description
63 * ------------------------------------------------------------------------------------------
64 * text string RW The string of the text label
65 * markup string W A Pango markup string for the text label
67 * x double RW X coordinate of anchor point
68 * y double RW Y coordinate of anchor point
70 * font string W A string describing the font
71 * font_desc PangoFontDescription* RW Pointer to a PangoFontDescriptor
72 * attributes PangoAttrList* RW Pointer to a Pango attribute list
73 * style PangoStyle RW Pango style of font to use [*]
74 * variant PangoVariant RW Pango variant of font to use [*]
75 * weight int RW Pango weight of font to use [*]
76 * stretch PangoStretch RW Pango stretch of font to use [*]
77 * size int RW Size (in pixels) of font [*]
78 * size_points double RW Size (in points) of font
79 * scale double RW Ratio to scale font [*]
81 * anchor GtkAnchorType RW Anchor side for the text
82 * justification GtkJustification RW Justification for multiline text
83 * clip_width double RW Width of clip rectangle
84 * clip_height double RW Height of clip rectangle
85 * clip boolean RW Use clipping rectangle?
86 * x_offset double RW Horizontal offset distance from anchor position
87 * y_offset double RW Vertical offset distance from anchor position
89 * text_width double R Used to query the width of the rendered text
90 * text_height double R Used to query the rendered height of the text
92 * fill_color string W X color specification for text
93 * fill_color_gdk GdkColor* RW Pointer to an allocated GdkColor
94 * fill_color_rgba guint RW RGBA value used for AA color.
95 * fill_stipple GdkBitmap* RW Stipple pattern for filling the text
98 #define FOO_TYPE_CANVAS_TEXT (foo_canvas_text_get_type ())
99 #define FOO_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_TEXT, FooCanvasText))
100 #define FOO_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_TEXT, FooCanvasTextClass))
101 #define FOO_IS_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_TEXT))
102 #define FOO_IS_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_TEXT))
103 #define FOO_CANVAS_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_TEXT, FooCanvasTextClass))
106 typedef struct _FooCanvasText FooCanvasText;
107 typedef struct _FooCanvasTextClass FooCanvasTextClass;
109 typedef struct _FooCanvasTextPrivate FooCanvasTextPrivate;
111 struct _FooCanvasText {
112 FooCanvasItem item;
114 PangoFontDescription *font_desc; /* Font description for text */
115 PangoAttrList *attr_list; /* Attribute list of the text (caching) */
116 PangoUnderline underline;
117 gboolean strikethrough;
118 int rise;
119 double scale;
121 char *text; /* Text to display */
122 GdkBitmap *stipple; /* Stipple for text */
123 GdkGC *gc; /* GC for drawing text */
124 PangoLayout *layout; /* The PangoLayout containing the text */
126 gulong pixel; /* Fill color */
128 double x, y; /* Position at anchor */
130 double clip_width; /* Width of optional clip rectangle */
131 double clip_height; /* Height of optional clip rectangle */
133 double xofs, yofs; /* Text offset distance from anchor position */
135 GtkAnchorType anchor; /* Anchor side for text */
136 GtkJustification justification; /* Justification for text */
138 int cx, cy; /* Top-left canvas coordinates for text */
139 int clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */
140 int clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */
141 int max_width; /* Maximum width of text lines */
142 int height; /* Rendered text height in pixels */
144 guint32 rgba; /* RGBA color for text */ /*AA*/
146 guint clip : 1; /* Use clip rectangle? */
148 guint underline_set : 1; /* Apply specified underline style? */
149 guint strike_set : 1; /* Apply specified strikethrough style? */
150 guint rise_set : 1; /* Apply specified ascension/descension? */
152 guint scale_set : 1; /* Apply specified font scaling ratio? */
154 FooCanvasTextPrivate *priv;
157 struct _FooCanvasTextClass {
158 FooCanvasItemClass parent_class;
162 /* Standard Gtk function */
163 GType foo_canvas_text_get_type (void) G_GNUC_CONST;
166 G_END_DECLS
168 #endif