From 8ff6644c76de5b29bbb2e47f211e8b9c72e6aee9 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Fri, 8 Sep 2000 23:29:46 +0000 Subject: [PATCH] gtk/gtktextdisplay.c gtk/gtktextlayout.c gtk/gtktexttag.c gtk/gtktexttag.h 2000-09-08 Jonathan Blandford * gtk/gtktextdisplay.c * gtk/gtktextlayout.c * gtk/gtktexttag.c * gtk/gtktexttag.h * gtk/testtext.c: Change the overstrike property to strikethrough, to closer match pango. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-0 | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-2 | 10 ++++++++++ ChangeLog.pre-2-4 | 10 ++++++++++ ChangeLog.pre-2-6 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ gtk/gtktextdisplay.c | 10 +++++----- gtk/gtktextlayout.c | 2 +- gtk/gtktexttag.c | 34 +++++++++++++++++----------------- gtk/gtktexttag.h | 4 ++-- gtk/testtext.c | 6 +++--- tests/testtext.c | 6 +++--- 13 files changed, 101 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39af9097c4..fe498304c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 39af9097c4..fe498304c2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 39af9097c4..fe498304c2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 39af9097c4..fe498304c2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 39af9097c4..fe498304c2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 39af9097c4..fe498304c2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 39af9097c4..fe498304c2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2000-09-08 Jonathan Blandford + + * gtk/gtktextdisplay.c + * gtk/gtktextlayout.c + * gtk/gtktexttag.c + * gtk/gtktexttag.h + * gtk/testtext.c: Change the overstrike property to strikethrough, + to closer match pango. + + Fri Sep 8 14:28:00 2000 Owen Taylor * gtk/gtktextview.c: Fix up visibility so that focus, diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 0ddcb37895..54e7d189dd 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -197,7 +197,7 @@ render_layout_line (GdkDrawable *drawable, fg_gc = render_state->fg_gc; } - if (appearance->underline == PANGO_UNDERLINE_NONE && !appearance->overstrike) + if (appearance->underline == PANGO_UNDERLINE_NONE && !appearance->strikethrough) pango_glyph_string_extents (run->glyphs, run->item->analysis.font, NULL, &logical_rect); else @@ -236,12 +236,12 @@ render_layout_line (GdkDrawable *drawable, break; } - if (appearance->overstrike) + if (appearance->strikethrough) { - gint overstrike_y = y + (0.3 * logical_rect.y) / PANGO_SCALE; + gint strikethrough_y = y + (0.3 * logical_rect.y) / PANGO_SCALE; gdk_draw_line (drawable, fg_gc, - x + (x_off + ink_rect.x) / PANGO_SCALE - 1, overstrike_y, - x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, overstrike_y); + x + (x_off + ink_rect.x) / PANGO_SCALE - 1, strikethrough_y, + x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, strikethrough_y); } x_off += logical_rect.width; diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index a169fe486b..af2b76edb2 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -1095,7 +1095,7 @@ gtk_text_attr_appearance_compare (const PangoAttribute *attr1, appearance1->fg_stipple == appearance2->fg_stipple && appearance1->bg_stipple == appearance2->bg_stipple && appearance1->underline == appearance2->underline && - appearance1->overstrike == appearance2->overstrike && + appearance1->strikethrough == appearance2->strikethrough && appearance1->draw_bg == appearance2->draw_bg); } diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 724f648c62..69edf7b3a0 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -84,7 +84,7 @@ enum { ARG_DIRECTION, ARG_LEFT_MARGIN, ARG_LEFT_WRAPPED_LINE_MARGIN, - ARG_OVERSTRIKE, + ARG_STRIKETHROUGH, ARG_RIGHT_MARGIN, ARG_UNDERLINE, ARG_OFFSET, @@ -107,7 +107,7 @@ enum { ARG_JUSTIFY_SET, ARG_LEFT_MARGIN_SET, ARG_LEFT_WRAPPED_LINE_MARGIN_SET, - ARG_OVERSTRIKE_SET, + ARG_STRIKETHROUGH_SET, ARG_RIGHT_MARGIN_SET, ARG_UNDERLINE_SET, ARG_OFFSET_SET, @@ -204,8 +204,6 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) GTK_ARG_READWRITE, ARG_LEFT_WRAPPED_LINE_MARGIN); gtk_object_add_arg_type ("GtkTextTag::offset", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_OFFSET); - gtk_object_add_arg_type ("GtkTextTag::overstrike", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_OVERSTRIKE); gtk_object_add_arg_type ("GtkTextTag::pixels_above_lines", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_PIXELS_ABOVE_LINES); gtk_object_add_arg_type ("GtkTextTag::pixels_below_lines", GTK_TYPE_INT, @@ -214,6 +212,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) GTK_ARG_READWRITE, ARG_PIXELS_INSIDE_WRAP); gtk_object_add_arg_type ("GtkTextTag::right_margin", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_RIGHT_MARGIN); + gtk_object_add_arg_type ("GtkTextTag::strikethrough", GTK_TYPE_BOOL, + GTK_ARG_READWRITE, ARG_STRIKETHROUGH); gtk_object_add_arg_type ("GtkTextTag::underline", GTK_TYPE_ENUM, GTK_ARG_READWRITE, ARG_UNDERLINE); gtk_object_add_arg_type ("GtkTextTag::wrap_mode", GTK_TYPE_ENUM, @@ -248,14 +248,14 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) GTK_ARG_READWRITE, ARG_LEFT_WRAPPED_LINE_MARGIN_SET); gtk_object_add_arg_type ("GtkTextTag::offset_set", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_OFFSET_SET); - gtk_object_add_arg_type ("GtkTextTag::overstrike_set", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_OVERSTRIKE_SET); gtk_object_add_arg_type ("GtkTextTag::pixels_above_lines_set", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_PIXELS_ABOVE_LINES_SET); gtk_object_add_arg_type ("GtkTextTag::pixels_below_lines_set", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_PIXELS_BELOW_LINES_SET); gtk_object_add_arg_type ("GtkTextTag::pixels_inside_wrap_set", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_PIXELS_INSIDE_WRAP_SET); + gtk_object_add_arg_type ("GtkTextTag::strikethrough_set", GTK_TYPE_BOOL, + GTK_ARG_READWRITE, ARG_STRIKETHROUGH_SET); gtk_object_add_arg_type ("GtkTextTag::right_margin_set", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_RIGHT_MARGIN_SET); gtk_object_add_arg_type ("GtkTextTag::underline_set", GTK_TYPE_ENUM, @@ -549,9 +549,9 @@ gtk_text_tag_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) size_changed = TRUE; break; - case ARG_OVERSTRIKE: - tkxt_tag->overstrike_set = TRUE; - tkxt_tag->values->appearance.overstrike = GTK_VALUE_BOOL(*arg); + case ARG_STRIKETHROUGH: + tkxt_tag->strikethrough_set = TRUE; + tkxt_tag->values->appearance.strikethrough = GTK_VALUE_BOOL(*arg); break; case ARG_RIGHT_MARGIN: @@ -645,8 +645,8 @@ gtk_text_tag_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) size_changed = TRUE; break; - case ARG_OVERSTRIKE_SET: - tkxt_tag->overstrike_set = GTK_VALUE_BOOL(*arg); + case ARG_STRIKETHROUGH_SET: + tkxt_tag->strikethrough_set = GTK_VALUE_BOOL(*arg); break; case ARG_RIGHT_MARGIN_SET: @@ -777,8 +777,8 @@ gtk_text_tag_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) GTK_VALUE_INT(*arg) = tag->values->left_wrapped_line_margin; break; - case ARG_OVERSTRIKE: - GTK_VALUE_BOOL(*arg) = tag->values->appearance.overstrike; + case ARG_STRIKETHROUGH: + GTK_VALUE_BOOL(*arg) = tag->values->appearance.strikethrough; break; case ARG_RIGHT_MARGIN: @@ -855,8 +855,8 @@ gtk_text_tag_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) GTK_VALUE_BOOL(*arg) = tag->left_wrapped_line_margin_set; break; - case ARG_OVERSTRIKE_SET: - GTK_VALUE_BOOL(*arg) = tag->overstrike_set; + case ARG_STRIKETHROUGH_SET: + GTK_VALUE_BOOL(*arg) = tag->strikethrough_set; break; case ARG_RIGHT_MARGIN_SET: @@ -1274,8 +1274,8 @@ gtk_text_attributes_fill_from_tags(GtkTextAttributes *dest, if (tag->underline_set) dest->appearance.underline = vals->appearance.underline; - if (tag->overstrike_set) - dest->appearance.overstrike = vals->appearance.overstrike; + if (tag->strikethrough_set) + dest->appearance.strikethrough = vals->appearance.strikethrough; if (tag->invisible_set) dest->invisible = vals->invisible; diff --git a/gtk/gtktexttag.h b/gtk/gtktexttag.h index bbebed55d0..4b522c6c66 100644 --- a/gtk/gtktexttag.h +++ b/gtk/gtktexttag.h @@ -68,7 +68,7 @@ struct _GtkTextTag { guint left_margin_set : 1; guint left_wrapped_line_margin_set : 1; guint offset_set : 1; - guint overstrike_set : 1; + guint strikethrough_set : 1; guint right_margin_set : 1; guint pixels_above_lines_set : 1; guint pixels_below_lines_set : 1; @@ -118,7 +118,7 @@ struct _GtkTextAppearance GdkBitmap *fg_stipple; guint underline : 4; /* PangoUnderline */ - guint overstrike : 1; + guint strikethrough : 1; /* Whether to use background-related values; this is irrelevant for * the values struct when in a tag, but is used for the composite diff --git a/gtk/testtext.c b/gtk/testtext.c index f9c4bcaca9..4b53e46738 100644 --- a/gtk/testtext.c +++ b/gtk/testtext.c @@ -461,12 +461,12 @@ fill_example_buffer (GtkTextBuffer *buffer) "font", "Sans 10", NULL); - tag = gtk_text_buffer_create_tag (buffer, "overstrike"); + tag = gtk_text_buffer_create_tag (buffer, "strikethrough"); setup_tag (tag); gtk_object_set (GTK_OBJECT (tag), - "overstrike", TRUE, + "strikethrough", TRUE, NULL); @@ -548,7 +548,7 @@ fill_example_buffer (GtkTextBuffer *buffer) gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 1, 14); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 24); - gtk_text_buffer_apply_tag_by_name (buffer, "overstrike", &iter, &iter2); + gtk_text_buffer_apply_tag_by_name (buffer, "strikethrough", &iter, &iter2); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 9); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16); diff --git a/tests/testtext.c b/tests/testtext.c index f9c4bcaca9..4b53e46738 100644 --- a/tests/testtext.c +++ b/tests/testtext.c @@ -461,12 +461,12 @@ fill_example_buffer (GtkTextBuffer *buffer) "font", "Sans 10", NULL); - tag = gtk_text_buffer_create_tag (buffer, "overstrike"); + tag = gtk_text_buffer_create_tag (buffer, "strikethrough"); setup_tag (tag); gtk_object_set (GTK_OBJECT (tag), - "overstrike", TRUE, + "strikethrough", TRUE, NULL); @@ -548,7 +548,7 @@ fill_example_buffer (GtkTextBuffer *buffer) gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 1, 14); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 24); - gtk_text_buffer_apply_tag_by_name (buffer, "overstrike", &iter, &iter2); + gtk_text_buffer_apply_tag_by_name (buffer, "strikethrough", &iter, &iter2); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 9); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16);