1 /* attribute.c : Glue to access fields in PangoAttribute and
2 * subclasses.
3 *
4 * Copyright (c) 2005 Novell, Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the Lesser GNU General
8 * Public License as published by the Free Software Foundation.
9 *
10 * This program 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.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
19 */
20
21 #include <pango/pango-attributes.h>
22
23 /* Forward declarations */
24 PangoAttrType pangosharp_attribute_get_attr_type (PangoAttribute *attr);
25 guint pangosharp_attribute_get_start_index (PangoAttribute *attr);
26 void pangosharp_attribute_set_start_index (PangoAttribute *attr, guint ind);
27 guint pangosharp_attribute_get_end_index (PangoAttribute *attr);
28 void pangosharp_attribute_set_end_index (PangoAttribute *attr, guint ind);
29 const char *pangosharp_attr_string_get_value (PangoAttrString *attr);
30 PangoLanguage *pangosharp_attr_language_get_value (PangoAttrLanguage *attr);
31 PangoColor pangosharp_attr_color_get_color (PangoAttrColor *attr);
32 int pangosharp_attr_int_get_value (PangoAttrInt *attr);
33 double pangosharp_attr_float_get_value (PangoAttrFloat *attr);
34 PangoFontDescription *pangosharp_attr_font_desc_get_desc (PangoAttrFontDesc *attr);
35 PangoRectangle pangosharp_attr_shape_get_ink_rect (PangoAttrShape *attr);
36 PangoRectangle pangosharp_attr_shape_get_logical_rect (PangoAttrShape *attr);
37 #ifdef GTK_SHARP_2_6
38 int pangosharp_attr_size_get_size (PangoAttrSize *attr);
39 gboolean pangosharp_attr_size_get_absolute (PangoAttrSize *attr);
40 #endif
41 /* */
42
43 PangoAttrType
pangosharp_attribute_get_attr_type(PangoAttribute * attr)44 pangosharp_attribute_get_attr_type (PangoAttribute *attr)
45 {
46 return attr->klass->type;
47 }
48
49 guint
pangosharp_attribute_get_start_index(PangoAttribute * attr)50 pangosharp_attribute_get_start_index (PangoAttribute *attr)
51 {
52 return attr->start_index;
53 }
54
55 void
pangosharp_attribute_set_start_index(PangoAttribute * attr,guint ind)56 pangosharp_attribute_set_start_index (PangoAttribute *attr, guint ind)
57 {
58 attr->start_index = ind;
59 }
60
61 guint
pangosharp_attribute_get_end_index(PangoAttribute * attr)62 pangosharp_attribute_get_end_index (PangoAttribute *attr)
63 {
64 return attr->end_index;
65 }
66
67 void
pangosharp_attribute_set_end_index(PangoAttribute * attr,guint ind)68 pangosharp_attribute_set_end_index (PangoAttribute *attr, guint ind)
69 {
70 attr->end_index = ind;
71 }
72
73 const char *
pangosharp_attr_string_get_value(PangoAttrString * attr)74 pangosharp_attr_string_get_value (PangoAttrString *attr)
75 {
76 return attr->value;
77 }
78
79 PangoLanguage *
pangosharp_attr_language_get_value(PangoAttrLanguage * attr)80 pangosharp_attr_language_get_value (PangoAttrLanguage *attr)
81 {
82 return attr->value;
83 }
84
85 PangoColor
pangosharp_attr_color_get_color(PangoAttrColor * attr)86 pangosharp_attr_color_get_color (PangoAttrColor *attr)
87 {
88 return attr->color;
89 }
90
91 int
pangosharp_attr_int_get_value(PangoAttrInt * attr)92 pangosharp_attr_int_get_value (PangoAttrInt *attr)
93 {
94 return attr->value;
95 }
96
97 double
pangosharp_attr_float_get_value(PangoAttrFloat * attr)98 pangosharp_attr_float_get_value (PangoAttrFloat *attr)
99 {
100 return attr->value;
101 }
102
103 PangoFontDescription *
pangosharp_attr_font_desc_get_desc(PangoAttrFontDesc * attr)104 pangosharp_attr_font_desc_get_desc (PangoAttrFontDesc *attr)
105 {
106 return attr->desc;
107 }
108
109 PangoRectangle
pangosharp_attr_shape_get_ink_rect(PangoAttrShape * attr)110 pangosharp_attr_shape_get_ink_rect (PangoAttrShape *attr)
111 {
112 return attr->ink_rect;
113 }
114
115 PangoRectangle
pangosharp_attr_shape_get_logical_rect(PangoAttrShape * attr)116 pangosharp_attr_shape_get_logical_rect (PangoAttrShape *attr)
117 {
118 return attr->logical_rect;
119 }
120
121 #ifdef GTK_SHARP_2_6
122 int
pangosharp_attr_size_get_size(PangoAttrSize * attr)123 pangosharp_attr_size_get_size (PangoAttrSize *attr)
124 {
125 return attr->size;
126 }
127
128 gboolean
pangosharp_attr_size_get_absolute(PangoAttrSize * attr)129 pangosharp_attr_size_get_absolute (PangoAttrSize *attr)
130 {
131 return attr->absolute;
132 }
133 #endif
134
135