Commit 8ff6644c authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford
Browse files

gtk/gtktextdisplay.c gtk/gtktextlayout.c gtk/gtktexttag.c gtk/gtktexttag.h

2000-09-08  Jonathan Blandford  <jrb@redhat.com>

	* 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.
parent 2e2272aa
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
2000-09-08 Jonathan Blandford <jrb@redhat.com>
* 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 <otaylor@redhat.com> Fri Sep 8 14:28:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Fix up visibility so that focus, * gtk/gtktextview.c: Fix up visibility so that focus,
......
...@@ -197,7 +197,7 @@ render_layout_line (GdkDrawable *drawable, ...@@ -197,7 +197,7 @@ render_layout_line (GdkDrawable *drawable,
fg_gc = render_state->fg_gc; 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, pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
NULL, &logical_rect); NULL, &logical_rect);
else else
...@@ -236,12 +236,12 @@ render_layout_line (GdkDrawable *drawable, ...@@ -236,12 +236,12 @@ render_layout_line (GdkDrawable *drawable,
break; 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, gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, overstrike_y, x + (x_off + ink_rect.x) / PANGO_SCALE - 1, strikethrough_y,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, overstrike_y); x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, strikethrough_y);
} }
x_off += logical_rect.width; x_off += logical_rect.width;
......
...@@ -1095,7 +1095,7 @@ gtk_text_attr_appearance_compare (const PangoAttribute *attr1, ...@@ -1095,7 +1095,7 @@ gtk_text_attr_appearance_compare (const PangoAttribute *attr1,
appearance1->fg_stipple == appearance2->fg_stipple && appearance1->fg_stipple == appearance2->fg_stipple &&
appearance1->bg_stipple == appearance2->bg_stipple && appearance1->bg_stipple == appearance2->bg_stipple &&
appearance1->underline == appearance2->underline && appearance1->underline == appearance2->underline &&
appearance1->overstrike == appearance2->overstrike && appearance1->strikethrough == appearance2->strikethrough &&
appearance1->draw_bg == appearance2->draw_bg); appearance1->draw_bg == appearance2->draw_bg);
} }
......
...@@ -84,7 +84,7 @@ enum { ...@@ -84,7 +84,7 @@ enum {
ARG_DIRECTION, ARG_DIRECTION,
ARG_LEFT_MARGIN, ARG_LEFT_MARGIN,
ARG_LEFT_WRAPPED_LINE_MARGIN, ARG_LEFT_WRAPPED_LINE_MARGIN,
ARG_OVERSTRIKE, ARG_STRIKETHROUGH,
ARG_RIGHT_MARGIN, ARG_RIGHT_MARGIN,
ARG_UNDERLINE, ARG_UNDERLINE,
ARG_OFFSET, ARG_OFFSET,
...@@ -107,7 +107,7 @@ enum { ...@@ -107,7 +107,7 @@ enum {
ARG_JUSTIFY_SET, ARG_JUSTIFY_SET,
ARG_LEFT_MARGIN_SET, ARG_LEFT_MARGIN_SET,
ARG_LEFT_WRAPPED_LINE_MARGIN_SET, ARG_LEFT_WRAPPED_LINE_MARGIN_SET,
ARG_OVERSTRIKE_SET, ARG_STRIKETHROUGH_SET,
ARG_RIGHT_MARGIN_SET, ARG_RIGHT_MARGIN_SET,
ARG_UNDERLINE_SET, ARG_UNDERLINE_SET,
ARG_OFFSET_SET, ARG_OFFSET_SET,
...@@ -204,8 +204,6 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) ...@@ -204,8 +204,6 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
GTK_ARG_READWRITE, ARG_LEFT_WRAPPED_LINE_MARGIN); GTK_ARG_READWRITE, ARG_LEFT_WRAPPED_LINE_MARGIN);
gtk_object_add_arg_type ("GtkTextTag::offset", GTK_TYPE_INT, gtk_object_add_arg_type ("GtkTextTag::offset", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_OFFSET); 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_object_add_arg_type ("GtkTextTag::pixels_above_lines", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_PIXELS_ABOVE_LINES); GTK_ARG_READWRITE, ARG_PIXELS_ABOVE_LINES);
gtk_object_add_arg_type ("GtkTextTag::pixels_below_lines", GTK_TYPE_INT, gtk_object_add_arg_type ("GtkTextTag::pixels_below_lines", GTK_TYPE_INT,
...@@ -214,6 +212,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) ...@@ -214,6 +212,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
GTK_ARG_READWRITE, ARG_PIXELS_INSIDE_WRAP); GTK_ARG_READWRITE, ARG_PIXELS_INSIDE_WRAP);
gtk_object_add_arg_type ("GtkTextTag::right_margin", GTK_TYPE_INT, gtk_object_add_arg_type ("GtkTextTag::right_margin", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_RIGHT_MARGIN); 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_object_add_arg_type ("GtkTextTag::underline", GTK_TYPE_ENUM,
GTK_ARG_READWRITE, ARG_UNDERLINE); GTK_ARG_READWRITE, ARG_UNDERLINE);
gtk_object_add_arg_type ("GtkTextTag::wrap_mode", GTK_TYPE_ENUM, gtk_object_add_arg_type ("GtkTextTag::wrap_mode", GTK_TYPE_ENUM,
...@@ -248,14 +248,14 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) ...@@ -248,14 +248,14 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
GTK_ARG_READWRITE, ARG_LEFT_WRAPPED_LINE_MARGIN_SET); GTK_ARG_READWRITE, ARG_LEFT_WRAPPED_LINE_MARGIN_SET);
gtk_object_add_arg_type ("GtkTextTag::offset_set", GTK_TYPE_BOOL, gtk_object_add_arg_type ("GtkTextTag::offset_set", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_OFFSET_SET); 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_object_add_arg_type ("GtkTextTag::pixels_above_lines_set", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_PIXELS_ABOVE_LINES_SET); GTK_ARG_READWRITE, ARG_PIXELS_ABOVE_LINES_SET);
gtk_object_add_arg_type ("GtkTextTag::pixels_below_lines_set", GTK_TYPE_BOOL, gtk_object_add_arg_type ("GtkTextTag::pixels_below_lines_set", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_PIXELS_BELOW_LINES_SET); GTK_ARG_READWRITE, ARG_PIXELS_BELOW_LINES_SET);
gtk_object_add_arg_type ("GtkTextTag::pixels_inside_wrap_set", GTK_TYPE_BOOL, gtk_object_add_arg_type ("GtkTextTag::pixels_inside_wrap_set", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_PIXELS_INSIDE_WRAP_SET); 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_object_add_arg_type ("GtkTextTag::right_margin_set", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_RIGHT_MARGIN_SET); GTK_ARG_READWRITE, ARG_RIGHT_MARGIN_SET);
gtk_object_add_arg_type ("GtkTextTag::underline_set", GTK_TYPE_ENUM, 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) ...@@ -549,9 +549,9 @@ gtk_text_tag_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
size_changed = TRUE; size_changed = TRUE;
break; break;
case ARG_OVERSTRIKE: case ARG_STRIKETHROUGH:
tkxt_tag->overstrike_set = TRUE; tkxt_tag->strikethrough_set = TRUE;
tkxt_tag->values->appearance.overstrike = GTK_VALUE_BOOL(*arg); tkxt_tag->values->appearance.strikethrough = GTK_VALUE_BOOL(*arg);
break; break;
case ARG_RIGHT_MARGIN: case ARG_RIGHT_MARGIN:
...@@ -645,8 +645,8 @@ gtk_text_tag_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) ...@@ -645,8 +645,8 @@ gtk_text_tag_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
size_changed = TRUE; size_changed = TRUE;
break; break;
case ARG_OVERSTRIKE_SET: case ARG_STRIKETHROUGH_SET:
tkxt_tag->overstrike_set = GTK_VALUE_BOOL(*arg); tkxt_tag->strikethrough_set = GTK_VALUE_BOOL(*arg);
break; break;
case ARG_RIGHT_MARGIN_SET: case ARG_RIGHT_MARGIN_SET:
...@@ -777,8 +777,8 @@ gtk_text_tag_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) ...@@ -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; GTK_VALUE_INT(*arg) = tag->values->left_wrapped_line_margin;
break; break;
case ARG_OVERSTRIKE: case ARG_STRIKETHROUGH:
GTK_VALUE_BOOL(*arg) = tag->values->appearance.overstrike; GTK_VALUE_BOOL(*arg) = tag->values->appearance.strikethrough;
break; break;
case ARG_RIGHT_MARGIN: case ARG_RIGHT_MARGIN:
...@@ -855,8 +855,8 @@ gtk_text_tag_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) ...@@ -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; GTK_VALUE_BOOL(*arg) = tag->left_wrapped_line_margin_set;
break; break;
case ARG_OVERSTRIKE_SET: case ARG_STRIKETHROUGH_SET:
GTK_VALUE_BOOL(*arg) = tag->overstrike_set; GTK_VALUE_BOOL(*arg) = tag->strikethrough_set;
break; break;
case ARG_RIGHT_MARGIN_SET: case ARG_RIGHT_MARGIN_SET:
...@@ -1274,8 +1274,8 @@ gtk_text_attributes_fill_from_tags(GtkTextAttributes *dest, ...@@ -1274,8 +1274,8 @@ gtk_text_attributes_fill_from_tags(GtkTextAttributes *dest,
if (tag->underline_set) if (tag->underline_set)
dest->appearance.underline = vals->appearance.underline; dest->appearance.underline = vals->appearance.underline;
if (tag->overstrike_set) if (tag->strikethrough_set)
dest->appearance.overstrike = vals->appearance.overstrike; dest->appearance.strikethrough = vals->appearance.strikethrough;
if (tag->invisible_set) if (tag->invisible_set)
dest->invisible = vals->invisible; dest->invisible = vals->invisible;
......
...@@ -68,7 +68,7 @@ struct _GtkTextTag { ...@@ -68,7 +68,7 @@ struct _GtkTextTag {
guint left_margin_set : 1; guint left_margin_set : 1;
guint left_wrapped_line_margin_set : 1; guint left_wrapped_line_margin_set : 1;
guint offset_set : 1; guint offset_set : 1;
guint overstrike_set : 1; guint strikethrough_set : 1;
guint right_margin_set : 1; guint right_margin_set : 1;
guint pixels_above_lines_set : 1; guint pixels_above_lines_set : 1;
guint pixels_below_lines_set : 1; guint pixels_below_lines_set : 1;
...@@ -118,7 +118,7 @@ struct _GtkTextAppearance ...@@ -118,7 +118,7 @@ struct _GtkTextAppearance
GdkBitmap *fg_stipple; GdkBitmap *fg_stipple;
guint underline : 4; /* PangoUnderline */ guint underline : 4; /* PangoUnderline */
guint overstrike : 1; guint strikethrough : 1;
/* Whether to use background-related values; this is irrelevant for /* Whether to use background-related values; this is irrelevant for
* the values struct when in a tag, but is used for the composite * the values struct when in a tag, but is used for the composite
......
...@@ -461,12 +461,12 @@ fill_example_buffer (GtkTextBuffer *buffer) ...@@ -461,12 +461,12 @@ fill_example_buffer (GtkTextBuffer *buffer)
"font", "Sans 10", "font", "Sans 10",
NULL); NULL);
tag = gtk_text_buffer_create_tag (buffer, "overstrike"); tag = gtk_text_buffer_create_tag (buffer, "strikethrough");
setup_tag (tag); setup_tag (tag);
gtk_object_set (GTK_OBJECT (tag), gtk_object_set (GTK_OBJECT (tag),
"overstrike", TRUE, "strikethrough", TRUE,
NULL); NULL);
...@@ -548,7 +548,7 @@ fill_example_buffer (GtkTextBuffer *buffer) ...@@ -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, &iter, 1, 14);
gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 24); 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, &iter, 0, 9);
gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16);
......
...@@ -461,12 +461,12 @@ fill_example_buffer (GtkTextBuffer *buffer) ...@@ -461,12 +461,12 @@ fill_example_buffer (GtkTextBuffer *buffer)
"font", "Sans 10", "font", "Sans 10",
NULL); NULL);
tag = gtk_text_buffer_create_tag (buffer, "overstrike"); tag = gtk_text_buffer_create_tag (buffer, "strikethrough");
setup_tag (tag); setup_tag (tag);
gtk_object_set (GTK_OBJECT (tag), gtk_object_set (GTK_OBJECT (tag),
"overstrike", TRUE, "strikethrough", TRUE,
NULL); NULL);
...@@ -548,7 +548,7 @@ fill_example_buffer (GtkTextBuffer *buffer) ...@@ -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, &iter, 1, 14);
gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 24); 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, &iter, 0, 9);
gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment