56
56
return gtk_text_buffer_get_text (GTK_TEXT_BUFFER (self), start, end, invisible_chars);
59
/* As the name suggests it is copied from GTK 2.14.3
60
* It was changed to use GSList * as arguments */
62
_gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
65
guint left_margin_accumulative = 0;
66
guint right_margin_accumulative = 0;
68
g_return_if_fail (!dest->realized);
70
for (; tags; tags = tags->next)
73
GtkTextAttributes *vals;
78
if (tag->bg_color_set)
80
dest->appearance.bg_color = vals->appearance.bg_color;
82
dest->appearance.draw_bg = TRUE;
84
if (tag->fg_color_set)
85
dest->appearance.fg_color = vals->appearance.fg_color;
87
if (tag->pg_bg_color_set)
89
dest->pg_bg_color = gdk_color_copy (vals->pg_bg_color);
92
if (tag->bg_stipple_set)
94
g_object_ref (vals->appearance.bg_stipple);
95
if (dest->appearance.bg_stipple)
96
g_object_unref (dest->appearance.bg_stipple);
97
dest->appearance.bg_stipple = vals->appearance.bg_stipple;
99
dest->appearance.draw_bg = TRUE;
102
if (tag->fg_stipple_set)
104
g_object_ref (vals->appearance.fg_stipple);
105
if (dest->appearance.fg_stipple)
106
g_object_unref (dest->appearance.fg_stipple);
107
dest->appearance.fg_stipple = vals->appearance.fg_stipple;
113
pango_font_description_merge (dest->font, vals->font, TRUE);
115
dest->font = pango_font_description_copy (vals->font);
118
/* multiply all the scales together to get a composite */
120
dest->font_scale *= vals->font_scale;
122
if (tag->justification_set)
123
dest->justification = vals->justification;
125
if (vals->direction != GTK_TEXT_DIR_NONE)
126
dest->direction = vals->direction;
128
if (tag->left_margin_set)
130
if (tag->accumulative_margin)
131
left_margin_accumulative += vals->left_margin;
133
dest->left_margin = vals->left_margin;
137
dest->indent = vals->indent;
140
dest->appearance.rise = vals->appearance.rise;
142
if (tag->right_margin_set)
144
if (tag->accumulative_margin)
145
right_margin_accumulative += vals->right_margin;
147
dest->right_margin = vals->right_margin;
150
if (tag->pixels_above_lines_set)
151
dest->pixels_above_lines = vals->pixels_above_lines;
153
if (tag->pixels_below_lines_set)
154
dest->pixels_below_lines = vals->pixels_below_lines;
156
if (tag->pixels_inside_wrap_set)
157
dest->pixels_inside_wrap = vals->pixels_inside_wrap;
162
pango_tab_array_free (dest->tabs);
163
dest->tabs = pango_tab_array_copy (vals->tabs);
166
if (tag->wrap_mode_set)
167
dest->wrap_mode = vals->wrap_mode;
169
if (tag->underline_set)
170
dest->appearance.underline = vals->appearance.underline;
172
if (tag->strikethrough_set)
173
dest->appearance.strikethrough = vals->appearance.strikethrough;
175
if (tag->invisible_set)
176
dest->invisible = vals->invisible;
178
if (tag->editable_set)
179
dest->editable = vals->editable;
181
if (tag->bg_full_height_set)
182
dest->bg_full_height = vals->bg_full_height;
184
if (tag->language_set)
185
dest->language = vals->language;
188
dest->left_margin += left_margin_accumulative;
189
dest->right_margin += right_margin_accumulative;
60
193
brasero_jacket_buffer_add_default_tag (BraseroJacketBuffer *self,
63
196
BraseroJacketBufferPrivate *priv;
65
198
priv = BRASERO_JACKET_BUFFER_PRIVATE (self);
66
priv->tags = g_slist_prepend (priv->tags, tag);
201
priv->tags = g_slist_append (priv->tags, tag);
205
brasero_jacket_buffer_get_attributes (BraseroJacketBuffer *self,
206
GtkTextAttributes *attributes)
208
BraseroJacketBufferPrivate *priv;
210
priv = BRASERO_JACKET_BUFFER_PRIVATE (self);
212
/* Now also merge changes that are 'on hold', that is non applied tags */
216
_gtk_text_attributes_fill_from_tags (attributes, priv->tags);