Rename GtkTextStyleValues to GtkTextAttributes

2000-08-31  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
	gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
	gtk/gtktexttagprivate.h, gtk/gtktextview.c:
	Rename GtkTextStyleValues to GtkTextAttributes
This commit is contained in:
Havoc Pennington 2000-08-31 17:08:45 +00:00 committed by Havoc Pennington
parent 41b5d5d26d
commit 78500e9045
15 changed files with 126 additions and 77 deletions

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1,3 +1,10 @@
2000-08-31 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.h, gtk/gtktextiter.c, gtk/gtktextlayout.h,
gtk/gtktextlayout.c, gtk/gtktexttag.h, gtk/gtktexttag.c,
gtk/gtktexttagprivate.h, gtk/gtktextview.c:
Rename GtkTextStyleValues to GtkTextAttributes
2000-08-31 Havoc Pennington <hp@pobox.com> 2000-08-31 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (GtkTextBTree): cache end line, * gtk/gtktextbtree.c (GtkTextBTree): cache end line,

View File

@ -1126,7 +1126,7 @@ gtk_text_iter_has_tag (const GtkTextIter *iter,
* Returns whether @iter is within an editable region of text. * Returns whether @iter is within an editable region of text.
* Non-editable text is "locked" and can't be changed by the user via * Non-editable text is "locked" and can't be changed by the user via
* #GtkTextView. This function is simply a convenience wrapper around * #GtkTextView. This function is simply a convenience wrapper around
* gtk_text_iter_get_style_values(). If no tags applied to this text * gtk_text_iter_get_attributes(). If no tags applied to this text
* affect editability, @default_setting will be returned. * affect editability, @default_setting will be returned.
* *
* Return value: whether @iter is inside an editable range * Return value: whether @iter is inside an editable range
@ -1135,18 +1135,18 @@ gboolean
gtk_text_iter_editable (const GtkTextIter *iter, gtk_text_iter_editable (const GtkTextIter *iter,
gboolean default_setting) gboolean default_setting)
{ {
GtkTextStyleValues *values; GtkTextAttributes *values;
gboolean retval; gboolean retval;
values = gtk_text_style_values_new (); values = gtk_text_attributes_new ();
values->editable = default_setting; values->editable = default_setting;
gtk_text_iter_get_style_values (iter, values); gtk_text_iter_get_attributes (iter, values);
retval = values->editable; retval = values->editable;
gtk_text_style_values_unref (values); gtk_text_attributes_unref (values);
return retval; return retval;
} }
@ -1155,7 +1155,7 @@ gtk_text_iter_editable (const GtkTextIter *iter,
* gtk_text_iter_get_language: * gtk_text_iter_get_language:
* @iter: an iterator * @iter: an iterator
* *
* A convenience wrapper around gtk_text_iter_get_style_values(), * A convenience wrapper around gtk_text_iter_get_attributes(),
* which returns the language in effect at @iter. If no tags affecting * which returns the language in effect at @iter. If no tags affecting
* language * apply to @iter, the return value is identical to that of * language * apply to @iter, the return value is identical to that of
* gtk_get_default_language(). * gtk_get_default_language().
@ -1165,16 +1165,16 @@ gtk_text_iter_editable (const GtkTextIter *iter,
static gchar* static gchar*
gtk_text_iter_get_language (const GtkTextIter *iter) gtk_text_iter_get_language (const GtkTextIter *iter)
{ {
GtkTextStyleValues *values; GtkTextAttributes *values;
gchar *retval; gchar *retval;
values = gtk_text_style_values_new (); values = gtk_text_attributes_new ();
gtk_text_iter_get_style_values (iter, values); gtk_text_iter_get_attributes (iter, values);
retval = g_strdup (values->language); retval = g_strdup (values->language);
gtk_text_style_values_unref (values); gtk_text_attributes_unref (values);
return retval; return retval;
} }
@ -1327,22 +1327,22 @@ gtk_text_iter_get_chars_in_line (const GtkTextIter *iter)
} }
/** /**
* gtk_text_iter_get_style_values: * gtk_text_iter_get_attributes:
* @iter: an iterator * @iter: an iterator
* @values: a #GtkTextStyleValues to be filled in * @values: a #GtkTextAttributes to be filled in
* *
* Computes the effect of any tags applied to this spot in the * Computes the effect of any tags applied to this spot in the
* text. The @values parameter should be initialized to the default * text. The @values parameter should be initialized to the default
* settings you wish to use if no tags are in effect. * settings you wish to use if no tags are in effect.
* gtk_text_iter_get_style_values() will modify @values, applying the * gtk_text_iter_get_attributes() will modify @values, applying the
* effects of any tags present at @iter. If any tags affected @values, * effects of any tags present at @iter. If any tags affected @values,
* the function returns TRUE. * the function returns TRUE.
* *
* Return value: TRUE if @values was modified * Return value: TRUE if @values was modified
**/ **/
gboolean gboolean
gtk_text_iter_get_style_values (const GtkTextIter *iter, gtk_text_iter_get_attributes (const GtkTextIter *iter,
GtkTextStyleValues *values) GtkTextAttributes *values)
{ {
GtkTextTag** tags; GtkTextTag** tags;
gint tag_count = 0; gint tag_count = 0;
@ -1362,7 +1362,7 @@ gtk_text_iter_get_style_values (const GtkTextIter *iter,
/* Sort tags in ascending order of priority */ /* Sort tags in ascending order of priority */
gtk_text_tag_array_sort (tags, tag_count); gtk_text_tag_array_sort (tags, tag_count);
gtk_text_style_values_fill_from_tags (values, gtk_text_attributes_fill_from_tags (values,
tags, tags,
tag_count); tag_count);

View File

@ -104,8 +104,8 @@ gboolean gtk_text_iter_ends_line (const GtkTextIter *iter);
gint gtk_text_iter_get_chars_in_line (const GtkTextIter *iter); gint gtk_text_iter_get_chars_in_line (const GtkTextIter *iter);
gboolean gtk_text_iter_get_style_values (const GtkTextIter *iter, gboolean gtk_text_iter_get_attributes (const GtkTextIter *iter,
GtkTextStyleValues *values); GtkTextAttributes *values);
gboolean gtk_text_iter_is_last (const GtkTextIter *iter); gboolean gtk_text_iter_is_last (const GtkTextIter *iter);
gboolean gtk_text_iter_is_first (const GtkTextIter *iter); gboolean gtk_text_iter_is_first (const GtkTextIter *iter);

View File

@ -190,7 +190,7 @@ free_style_cache (GtkTextLayout *text_layout)
{ {
if (text_layout->one_style_cache) if (text_layout->one_style_cache)
{ {
gtk_text_style_values_unref (text_layout->one_style_cache); gtk_text_attributes_unref (text_layout->one_style_cache);
text_layout->one_style_cache = NULL; text_layout->one_style_cache = NULL;
} }
} }
@ -205,7 +205,7 @@ gtk_text_layout_destroy (GtkObject *object)
gtk_text_layout_set_buffer (layout, NULL); gtk_text_layout_set_buffer (layout, NULL);
if (layout->default_style) if (layout->default_style)
gtk_text_style_values_unref (layout->default_style); gtk_text_attributes_unref (layout->default_style);
layout->default_style = NULL; layout->default_style = NULL;
if (layout->ltr_context) if (layout->ltr_context)
@ -274,7 +274,7 @@ gtk_text_layout_default_style_changed (GtkTextLayout *layout)
void void
gtk_text_layout_set_default_style (GtkTextLayout *layout, gtk_text_layout_set_default_style (GtkTextLayout *layout,
GtkTextStyleValues *values) GtkTextAttributes *values)
{ {
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
g_return_if_fail (values != NULL); g_return_if_fail (values != NULL);
@ -282,10 +282,10 @@ gtk_text_layout_set_default_style (GtkTextLayout *layout,
if (values == layout->default_style) if (values == layout->default_style)
return; return;
gtk_text_style_values_ref (values); gtk_text_attributes_ref (values);
if (layout->default_style) if (layout->default_style)
gtk_text_style_values_unref (layout->default_style); gtk_text_attributes_unref (layout->default_style);
layout->default_style = values; layout->default_style = values;
@ -785,13 +785,13 @@ gtk_text_layout_real_get_log_attrs (GtkTextLayout *layout,
/* If you get the style with get_style () you need to call /* If you get the style with get_style () you need to call
release_style () to free it. */ release_style () to free it. */
static GtkTextStyleValues* static GtkTextAttributes*
get_style (GtkTextLayout *layout, get_style (GtkTextLayout *layout,
const GtkTextIter *iter) const GtkTextIter *iter)
{ {
GtkTextTag** tags; GtkTextTag** tags;
gint tag_count = 0; gint tag_count = 0;
GtkTextStyleValues *style; GtkTextAttributes *style;
/* If we have the one-style cache, then it means /* If we have the one-style cache, then it means
that we haven't seen a toggle since we filled in the that we haven't seen a toggle since we filled in the
@ -799,7 +799,7 @@ get_style (GtkTextLayout *layout,
*/ */
if (layout->one_style_cache != NULL) if (layout->one_style_cache != NULL)
{ {
gtk_text_style_values_ref (layout->one_style_cache); gtk_text_attributes_ref (layout->one_style_cache);
return layout->one_style_cache; return layout->one_style_cache;
} }
@ -813,8 +813,8 @@ get_style (GtkTextLayout *layout,
{ {
/* One ref for the return value, one ref for the /* One ref for the return value, one ref for the
layout->one_style_cache reference */ layout->one_style_cache reference */
gtk_text_style_values_ref (layout->default_style); gtk_text_attributes_ref (layout->default_style);
gtk_text_style_values_ref (layout->default_style); gtk_text_attributes_ref (layout->default_style);
layout->one_style_cache = layout->default_style; layout->one_style_cache = layout->default_style;
if (tags) if (tags)
@ -826,12 +826,12 @@ get_style (GtkTextLayout *layout,
/* Sort tags in ascending order of priority */ /* Sort tags in ascending order of priority */
gtk_text_tag_array_sort (tags, tag_count); gtk_text_tag_array_sort (tags, tag_count);
style = gtk_text_style_values_new (); style = gtk_text_attributes_new ();
gtk_text_style_values_copy (layout->default_style, gtk_text_attributes_copy (layout->default_style,
style); style);
gtk_text_style_values_fill_from_tags (style, gtk_text_attributes_fill_from_tags (style,
tags, tags,
tag_count); tag_count);
@ -841,7 +841,7 @@ get_style (GtkTextLayout *layout,
/* Leave this style as the last one seen */ /* Leave this style as the last one seen */
g_assert (layout->one_style_cache == NULL); g_assert (layout->one_style_cache == NULL);
gtk_text_style_values_ref (style); /* ref held by layout->one_style_cache */ gtk_text_attributes_ref (style); /* ref held by layout->one_style_cache */
layout->one_style_cache = style; layout->one_style_cache = style;
/* Returning yet another refcount */ /* Returning yet another refcount */
@ -850,12 +850,12 @@ get_style (GtkTextLayout *layout,
static void static void
release_style (GtkTextLayout *layout, release_style (GtkTextLayout *layout,
GtkTextStyleValues *style) GtkTextAttributes *style)
{ {
g_return_if_fail (style != NULL); g_return_if_fail (style != NULL);
g_return_if_fail (style->refcount > 0); g_return_if_fail (style->refcount > 0);
gtk_text_style_values_unref (style); gtk_text_attributes_unref (style);
} }
/* /*
@ -934,7 +934,7 @@ totally_invisible_line (GtkTextLayout *layout,
static void static void
set_para_values (GtkTextLayout *layout, set_para_values (GtkTextLayout *layout,
GtkTextStyleValues *style, GtkTextAttributes *style,
GtkTextLineDisplay *display, GtkTextLineDisplay *display,
gdouble *align) gdouble *align)
{ {
@ -1085,7 +1085,7 @@ gtk_text_attr_appearance_new (const GtkTextAppearance *appearance)
static void static void
add_text_attrs (GtkTextLayout *layout, add_text_attrs (GtkTextLayout *layout,
GtkTextStyleValues *style, GtkTextAttributes *style,
gint byte_count, gint byte_count,
PangoAttrList *attrs, PangoAttrList *attrs,
gint start, gint start,
@ -1113,7 +1113,7 @@ add_text_attrs (GtkTextLayout *layout,
static void static void
add_pixmap_attrs (GtkTextLayout *layout, add_pixmap_attrs (GtkTextLayout *layout,
GtkTextLineDisplay *display, GtkTextLineDisplay *display,
GtkTextStyleValues *style, GtkTextAttributes *style,
GtkTextLineSegment *seg, GtkTextLineSegment *seg,
PangoAttrList *attrs, PangoAttrList *attrs,
gint start) gint start)
@ -1190,7 +1190,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
GtkTextLineDisplay *display; GtkTextLineDisplay *display;
GtkTextLineSegment *seg; GtkTextLineSegment *seg;
GtkTextIter iter; GtkTextIter iter;
GtkTextStyleValues *style; GtkTextAttributes *style;
gchar *text; gchar *text;
PangoAttrList *attrs; PangoAttrList *attrs;
gint byte_count, byte_offset; gint byte_count, byte_offset;

View File

@ -49,7 +49,7 @@ struct _GtkTextLayout
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
/* Default style used if no tags override it */ /* Default style used if no tags override it */
GtkTextStyleValues *default_style; GtkTextAttributes *default_style;
/* Pango contexts used for creating layouts */ /* Pango contexts used for creating layouts */
PangoContext *ltr_context; PangoContext *ltr_context;
@ -58,7 +58,7 @@ struct _GtkTextLayout
/* A cache of one style; this is used to ensure /* A cache of one style; this is used to ensure
* we don't constantly regenerate the style * we don't constantly regenerate the style
* over long runs with the same style. */ * over long runs with the same style. */
GtkTextStyleValues *one_style_cache; GtkTextAttributes *one_style_cache;
/* A cache of one line display. Getting the same line /* A cache of one line display. Getting the same line
* many times in a row is the most common case. * many times in a row is the most common case.
@ -146,7 +146,7 @@ GtkTextLayout *gtk_text_layout_new (void);
void gtk_text_layout_set_buffer (GtkTextLayout *layout, void gtk_text_layout_set_buffer (GtkTextLayout *layout,
GtkTextBuffer *buffer); GtkTextBuffer *buffer);
void gtk_text_layout_set_default_style (GtkTextLayout *layout, void gtk_text_layout_set_default_style (GtkTextLayout *layout,
GtkTextStyleValues *values); GtkTextAttributes *values);
void gtk_text_layout_set_contexts (GtkTextLayout *layout, void gtk_text_layout_set_contexts (GtkTextLayout *layout,
PangoContext *ltr_context, PangoContext *ltr_context,
PangoContext *rtl_context); PangoContext *rtl_context);

View File

@ -317,7 +317,7 @@ gtk_text_tag_new (const gchar *name)
tag->name = g_strdup(name); tag->name = g_strdup(name);
tag->values = gtk_text_style_values_new(); tag->values = gtk_text_attributes_new();
return tag; return tag;
} }
@ -336,7 +336,7 @@ gtk_text_tag_destroy (GtkObject *object)
g_assert(tkxt_tag->table == NULL); g_assert(tkxt_tag->table == NULL);
gtk_text_style_values_unref(tkxt_tag->values); gtk_text_attributes_unref(tkxt_tag->values);
tkxt_tag->values = NULL; tkxt_tag->values = NULL;
(* GTK_OBJECT_CLASS(parent_class)->destroy) (object); (* GTK_OBJECT_CLASS(parent_class)->destroy) (object);
@ -1045,15 +1045,15 @@ gtk_text_tag_array_sort(GtkTextTag** tag_array_p,
} }
/* /*
* StyleValues * Attributes
*/ */
GtkTextStyleValues* GtkTextAttributes*
gtk_text_style_values_new(void) gtk_text_attributes_new(void)
{ {
GtkTextStyleValues *values; GtkTextAttributes *values;
values = g_new0(GtkTextStyleValues, 1); values = g_new0(GtkTextAttributes, 1);
/* 0 is a valid value for most of the struct */ /* 0 is a valid value for most of the struct */
@ -1065,8 +1065,8 @@ gtk_text_style_values_new(void)
} }
void void
gtk_text_style_values_copy(GtkTextStyleValues *src, gtk_text_attributes_copy(GtkTextAttributes *src,
GtkTextStyleValues *dest) GtkTextAttributes *dest)
{ {
guint orig_refcount; guint orig_refcount;
@ -1110,7 +1110,7 @@ gtk_text_style_values_copy(GtkTextStyleValues *src,
} }
void void
gtk_text_style_values_ref(GtkTextStyleValues *values) gtk_text_attributes_ref(GtkTextAttributes *values)
{ {
g_return_if_fail(values != NULL); g_return_if_fail(values != NULL);
@ -1118,7 +1118,7 @@ gtk_text_style_values_ref(GtkTextStyleValues *values)
} }
void void
gtk_text_style_values_unref(GtkTextStyleValues *values) gtk_text_attributes_unref(GtkTextAttributes *values)
{ {
g_return_if_fail(values != NULL); g_return_if_fail(values != NULL);
g_return_if_fail(values->refcount > 0); g_return_if_fail(values->refcount > 0);
@ -1149,7 +1149,7 @@ gtk_text_style_values_unref(GtkTextStyleValues *values)
} }
void void
gtk_text_style_values_realize(GtkTextStyleValues *values, gtk_text_attributes_realize(GtkTextAttributes *values,
GdkColormap *cmap, GdkColormap *cmap,
GdkVisual *visual) GdkVisual *visual)
{ {
@ -1170,7 +1170,7 @@ gtk_text_style_values_realize(GtkTextStyleValues *values,
} }
void void
gtk_text_style_values_unrealize(GtkTextStyleValues *values, gtk_text_attributes_unrealize(GtkTextAttributes *values,
GdkColormap *cmap, GdkColormap *cmap,
GdkVisual *visual) GdkVisual *visual)
{ {
@ -1192,7 +1192,7 @@ gtk_text_style_values_unrealize(GtkTextStyleValues *values,
} }
void void
gtk_text_style_values_fill_from_tags(GtkTextStyleValues *dest, gtk_text_attributes_fill_from_tags(GtkTextAttributes *dest,
GtkTextTag** tags, GtkTextTag** tags,
guint n_tags) guint n_tags)
{ {
@ -1203,7 +1203,7 @@ gtk_text_style_values_fill_from_tags(GtkTextStyleValues *dest,
while (n < n_tags) while (n < n_tags)
{ {
GtkTextTag *tag = tags[n]; GtkTextTag *tag = tags[n];
GtkTextStyleValues *vals = tag->values; GtkTextAttributes *vals = tag->values;
if (n > 0) if (n > 0)
g_assert(tags[n]->priority > tags[n-1]->priority); g_assert(tags[n]->priority > tags[n-1]->priority);

View File

@ -19,7 +19,7 @@ typedef enum {
GTK_WRAPMODE_WORD GTK_WRAPMODE_WORD
} GtkWrapMode; } GtkWrapMode;
typedef struct _GtkTextStyleValues GtkTextStyleValues; typedef struct _GtkTextAttributes GtkTextAttributes;
#define GTK_TYPE_TEXT_TAG (gtk_text_tag_get_type()) #define GTK_TYPE_TEXT_TAG (gtk_text_tag_get_type())
#define GTK_TEXT_TAG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TEXT_TAG, GtkTextTag)) #define GTK_TEXT_TAG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TEXT_TAG, GtkTextTag))
@ -52,7 +52,7 @@ struct _GtkTextTag {
* defaults if no tag specifies an override. * defaults if no tag specifies an override.
*/ */
GtkTextStyleValues *values; GtkTextAttributes *values;
/* /*
Flags for whether a given value is set; if a value is unset, then Flags for whether a given value is set; if a value is unset, then
@ -128,12 +128,12 @@ struct _GtkTextAppearance
/* This is only used when we are actually laying out and rendering /* This is only used when we are actually laying out and rendering
* a paragraph; not when a GtkTextAppearance is part of a * a paragraph; not when a GtkTextAppearance is part of a
* GtkTextStyleValues. * GtkTextAttributes.
*/ */
guint inside_selection : 1; guint inside_selection : 1;
}; };
struct _GtkTextStyleValues struct _GtkTextAttributes
{ {
guint refcount; guint refcount;
@ -191,11 +191,11 @@ struct _GtkTextStyleValues
guint pad4 : 1; guint pad4 : 1;
}; };
GtkTextStyleValues *gtk_text_style_values_new (void); GtkTextAttributes *gtk_text_attributes_new (void);
void gtk_text_style_values_copy (GtkTextStyleValues *src, void gtk_text_attributes_copy (GtkTextAttributes *src,
GtkTextStyleValues *dest); GtkTextAttributes *dest);
void gtk_text_style_values_unref (GtkTextStyleValues *values); void gtk_text_attributes_unref (GtkTextAttributes *values);
void gtk_text_style_values_ref (GtkTextStyleValues *values); void gtk_text_attributes_ref (GtkTextAttributes *values);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -7,20 +7,20 @@
* the defaults with settings in the given tags, which should be sorted in * the defaults with settings in the given tags, which should be sorted in
* ascending order of priority * ascending order of priority
*/ */
void gtk_text_style_values_fill_from_tags (GtkTextStyleValues *values, void gtk_text_attributes_fill_from_tags (GtkTextAttributes *values,
GtkTextTag **tags, GtkTextTag **tags,
guint n_tags); guint n_tags);
void gtk_text_tag_array_sort (GtkTextTag **tag_array_p, void gtk_text_tag_array_sort (GtkTextTag **tag_array_p,
guint len); guint len);
/* ensure colors are allocated, etc. for drawing */ /* ensure colors are allocated, etc. for drawing */
void gtk_text_style_values_realize (GtkTextStyleValues *values, void gtk_text_attributes_realize (GtkTextAttributes *values,
GdkColormap *cmap, GdkColormap *cmap,
GdkVisual *visual); GdkVisual *visual);
/* free the stuff again */ /* free the stuff again */
void gtk_text_style_values_unrealize (GtkTextStyleValues *values, void gtk_text_attributes_unrealize (GtkTextAttributes *values,
GdkColormap *cmap, GdkColormap *cmap,
GdkVisual *visual); GdkVisual *visual);
#endif #endif

View File

@ -189,7 +189,7 @@ static void gtk_text_view_get_first_para_iter (GtkTextView *text_vi
GtkTextIter *iter); GtkTextIter *iter);
static void gtk_text_view_scroll_calc_now (GtkTextView *text_view); static void gtk_text_view_scroll_calc_now (GtkTextView *text_view);
static void gtk_text_view_set_values_from_style (GtkTextView *text_view, static void gtk_text_view_set_values_from_style (GtkTextView *text_view,
GtkTextStyleValues *values, GtkTextAttributes *values,
GtkStyle *style); GtkStyle *style);
static void gtk_text_view_ensure_layout (GtkTextView *text_view); static void gtk_text_view_ensure_layout (GtkTextView *text_view);
static void gtk_text_view_destroy_layout (GtkTextView *text_view); static void gtk_text_view_destroy_layout (GtkTextView *text_view);
@ -2471,7 +2471,7 @@ gtk_text_view_scroll_calc_now (GtkTextView *text_view)
static void static void
gtk_text_view_set_values_from_style (GtkTextView *text_view, gtk_text_view_set_values_from_style (GtkTextView *text_view,
GtkTextStyleValues *values, GtkTextAttributes *values,
GtkStyle *style) GtkStyle *style)
{ {
values->appearance.bg_color = style->base[GTK_STATE_NORMAL]; values->appearance.bg_color = style->base[GTK_STATE_NORMAL];
@ -2492,7 +2492,7 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
if (text_view->layout == NULL) if (text_view->layout == NULL)
{ {
GtkTextStyleValues *style; GtkTextAttributes *style;
PangoContext *ltr_context, *rtl_context; PangoContext *ltr_context, *rtl_context;
text_view->layout = gtk_text_layout_new (); text_view->layout = gtk_text_layout_new ();
@ -2520,7 +2520,7 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
g_object_unref (G_OBJECT (ltr_context)); g_object_unref (G_OBJECT (ltr_context));
g_object_unref (G_OBJECT (rtl_context)); g_object_unref (G_OBJECT (rtl_context));
style = gtk_text_style_values_new (); style = gtk_text_attributes_new ();
gtk_widget_ensure_style (widget); gtk_widget_ensure_style (widget);
gtk_text_view_set_values_from_style (text_view, style, widget->style); gtk_text_view_set_values_from_style (text_view, style, widget->style);
@ -2535,7 +2535,7 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
gtk_text_layout_set_default_style (text_view->layout, style); gtk_text_layout_set_default_style (text_view->layout, style);
gtk_text_style_values_unref (style); gtk_text_attributes_unref (style);
} }
} }