mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
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.
This commit is contained in:
parent
2e2272aac1
commit
8ff6644c76
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -1,3 +1,13 @@
|
||||
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>
|
||||
|
||||
* gtk/gtktextview.c: Fix up visibility so that focus,
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user