SwfdecAsObjectClass is gone now
[swfdec.git] / swfdec / swfdec_text_attributes.h
blobb1417f073a7d3b66b163104cc57f14c48e7bf7c8
1 /* Swfdec
2 * Copyright (C) 2007-2008 Benjamin Otte <otte@gnome.org>
3 * 2007 Pekka Lampila <pekka.lampila@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 #ifndef _SWFDEC_TEXT_ATTRIBUTES_H_
22 #define _SWFDEC_TEXT_ATTRIBUTES_H_
24 #include <glib.h>
25 #include <swfdec/swfdec_color.h>
27 G_BEGIN_DECLS
29 typedef struct _SwfdecTextAttributes SwfdecTextAttributes;
30 typedef struct _SwfdecTextAttributesClass SwfdecTextAttributesClass;
32 #define SWFDEC_TYPE_TEXT_ATTRIBUTES (swfdec_text_attributes_get_type())
33 #define SWFDEC_IS_TEXT_ATTRIBUTES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_TEXT_ATTRIBUTES))
34 #define SWFDEC_IS_TEXT_ATTRIBUTES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_TEXT_ATTRIBUTES))
35 #define SWFDEC_TEXT_ATTRIBUTES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_TEXT_ATTRIBUTES, SwfdecTextAttributes))
36 #define SWFDEC_TEXT_ATTRIBUTES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_TEXT_ATTRIBUTES, SwfdecTextAttributesClass))
37 #define SWFDEC_TEXT_ATTRIBUTES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_TEXT_ATTRIBUTES, SwfdecTextAttributesClass))
39 typedef enum {
40 SWFDEC_TEXT_ALIGN_LEFT,
41 SWFDEC_TEXT_ALIGN_RIGHT,
42 SWFDEC_TEXT_ALIGN_CENTER,
43 SWFDEC_TEXT_ALIGN_JUSTIFY
44 } SwfdecTextAlign;
46 typedef enum {
47 SWFDEC_TEXT_DISPLAY_NONE,
48 SWFDEC_TEXT_DISPLAY_INLINE,
49 SWFDEC_TEXT_DISPLAY_BLOCK,
50 } SwfdecTextDisplay;
52 typedef enum {
53 SWFDEC_TEXT_ATTRIBUTE_ALIGN = 0,
54 SWFDEC_TEXT_ATTRIBUTE_BLOCK_INDENT,
55 SWFDEC_TEXT_ATTRIBUTE_BOLD,
56 SWFDEC_TEXT_ATTRIBUTE_BULLET,
57 SWFDEC_TEXT_ATTRIBUTE_COLOR,
58 SWFDEC_TEXT_ATTRIBUTE_DISPLAY,
59 SWFDEC_TEXT_ATTRIBUTE_FONT,
60 SWFDEC_TEXT_ATTRIBUTE_INDENT,
61 SWFDEC_TEXT_ATTRIBUTE_ITALIC,
62 SWFDEC_TEXT_ATTRIBUTE_KERNING,
63 SWFDEC_TEXT_ATTRIBUTE_LEADING,
64 SWFDEC_TEXT_ATTRIBUTE_LEFT_MARGIN,
65 SWFDEC_TEXT_ATTRIBUTE_LETTER_SPACING,
66 SWFDEC_TEXT_ATTRIBUTE_RIGHT_MARGIN,
67 SWFDEC_TEXT_ATTRIBUTE_SIZE,
68 SWFDEC_TEXT_ATTRIBUTE_TAB_STOPS,
69 SWFDEC_TEXT_ATTRIBUTE_TARGET,
70 SWFDEC_TEXT_ATTRIBUTE_UNDERLINE,
71 SWFDEC_TEXT_ATTRIBUTE_URL,
72 } SwfdecTextAttribute;
74 #define SWFDEC_TEXT_ATTRIBUTES_MASK ((1 << (SWFDEC_TEXT_ATTRIBUTE_URL + 1)) - 1)
76 #define SWFDEC_TEXT_ATTRIBUTE_SET(flags, attribute) ((flags) |= (1 << (attribute)))
77 #define SWFDEC_TEXT_ATTRIBUTE_UNSET(flags, attribute) ((flags) &= ~(1 << (attribute)))
78 #define SWFDEC_TEXT_ATTRIBUTE_IS_SET(flags, attribute) (((flags) & (1 << (attribute))) ? TRUE : FALSE)
80 struct _SwfdecTextAttributes {
81 SwfdecTextAlign align;
82 int block_indent;
83 gboolean bold;
84 gboolean bullet;
85 SwfdecColor color;
86 SwfdecTextDisplay display;
87 const char * font;
88 int indent;
89 gboolean italic;
90 gboolean kerning;
91 int leading;
92 int left_margin;
93 double letter_spacing;
94 int right_margin;
95 int size;
96 guint * tab_stops;
97 gsize n_tab_stops;
98 const char * target;
99 gboolean underline;
100 const char * url;
104 void swfdec_text_attributes_reset (SwfdecTextAttributes * attr);
105 void swfdec_text_attributes_copy (SwfdecTextAttributes * attr,
106 const SwfdecTextAttributes * from,
107 guint flags);
108 void swfdec_text_attributes_mark (SwfdecTextAttributes * attr);
110 guint swfdec_text_attributes_diff (const SwfdecTextAttributes * a,
111 const SwfdecTextAttributes * b);
114 G_END_DECLS
115 #endif