offset the current invalid region, fixes redraw bug while scrolling the

2001-01-12  Havoc Pennington  <hp@redhat.com>

	* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
	current invalid region, fixes redraw bug while scrolling the
	text widget

	* gtk/gtktextview.c, gtk/gtktextview.h:
	Rearrange the scrolling/validation/etc. code in a major way,
	so it seems to make sense to me. Probably isn't genuinely that
	much better, but...

	* gtk/gtktexttag.c (set_fg_color): fix name of property used for
	notifies

	* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
This commit is contained in:
Havoc Pennington 2001-01-12 23:23:40 +00:00 committed by Havoc Pennington
parent 8e1a69c28b
commit f4b31ff5e6
13 changed files with 686 additions and 255 deletions

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -1,3 +1,19 @@
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
current invalid region, fixes redraw bug while scrolling the
text widget
* gtk/gtktextview.c, gtk/gtktextview.h:
Rearrange the scrolling/validation/etc. code in a major way,
so it seems to make sense to me. Probably isn't genuinely that
much better, but...
* gtk/gtktexttag.c (set_fg_color): fix name of property used for
notifies
* gtk/gtktextmark.c (gtk_text_mark_get_left_gravity): new function
2001-01-12 Alexander Larsson <alla@lysator.liu.se>
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_set_rotation):

View File

@ -142,7 +142,11 @@ gdk_window_scroll (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
/* Move the current invalid region */
if (obj->update_area)
gdk_region_offset (obj->update_area, dx, dy);
/* We can guffaw scroll if we are a child window, and the parent
* does not extend beyond our edges.
*/

View File

@ -213,6 +213,26 @@ gtk_text_mark_get_buffer (GtkTextMark *mark)
return _gtk_text_btree_get_buffer (seg->body.mark.tree);
}
/**
* gtk_text_mark_get_left_gravity:
* @mark: a #GtkTextMark
*
*
*
* Return value: %TRUE if the mark has left gravity, %FALSE otherwise
**/
gboolean
gtk_text_mark_get_left_gravity (GtkTextMark *mark)
{
GtkTextLineSegment *seg;
g_return_val_if_fail (GTK_IS_TEXT_MARK (mark), FALSE);
seg = mark->segment;
return seg->type == &gtk_text_left_mark_type;
}
/*
* Macro that determines the size of a mark segment:
*/

View File

@ -89,6 +89,7 @@ gboolean gtk_text_mark_get_visible (GtkTextMark *mark);
const char * gtk_text_mark_get_name (GtkTextMark *mark);
gboolean gtk_text_mark_get_deleted (GtkTextMark *mark);
GtkTextBuffer* gtk_text_mark_get_buffer (GtkTextMark *mark);
gboolean gtk_text_mark_get_left_gravity (GtkTextMark *mark);
#ifdef __cplusplus

View File

@ -686,7 +686,7 @@ set_bg_color (GtkTextTag *tag, GdkColor *color)
if (!tag->bg_color_set)
{
tag->bg_color_set = TRUE;
g_object_notify (G_OBJECT (tag), "bg_color_set");
g_object_notify (G_OBJECT (tag), "background_set");
}
tag->values->appearance.bg_color = *color;
@ -696,7 +696,7 @@ set_bg_color (GtkTextTag *tag, GdkColor *color)
if (tag->bg_color_set)
{
tag->bg_color_set = FALSE;
g_object_notify (G_OBJECT (tag), "bg_color_set");
g_object_notify (G_OBJECT (tag), "background_set");
}
}
}
@ -709,7 +709,7 @@ set_fg_color (GtkTextTag *tag, GdkColor *color)
if (!tag->fg_color_set)
{
tag->fg_color_set = TRUE;
g_object_notify (G_OBJECT (tag), "fg_color_set");
g_object_notify (G_OBJECT (tag), "foreground_set");
}
tag->values->appearance.fg_color = *color;
}
@ -718,7 +718,7 @@ set_fg_color (GtkTextTag *tag, GdkColor *color)
if (tag->fg_color_set)
{
tag->fg_color_set = FALSE;
g_object_notify (G_OBJECT (tag), "fg_color_set");
g_object_notify (G_OBJECT (tag), "foreground_set");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -56,8 +56,9 @@ typedef enum
typedef struct _GtkTextView GtkTextView;
typedef struct _GtkTextViewClass GtkTextViewClass;
/* Internal private type. */
/* Internal private types. */
typedef struct _GtkTextWindow GtkTextWindow;
typedef struct _GtkTextPendingScroll GtkTextPendingScroll;
struct _GtkTextView
{
@ -89,6 +90,11 @@ struct _GtkTextView
/* just selected a word or line via double/triple click */
guint just_selected_element : 1;
/* debug flag - means that we've validated onscreen since the
* last "invalidate" signal from the layout
*/
guint onscreen_validated : 1;
GtkTextWindow *text_window;
GtkTextWindow *left_window;
GtkTextWindow *right_window;
@ -132,6 +138,8 @@ struct _GtkTextView
gint drag_start_y;
GSList *children;
GtkTextPendingScroll *pending_scroll;
};
struct _GtkTextViewClass
@ -172,13 +180,19 @@ GtkWidget * gtk_text_view_new_with_buffer (GtkTextBuffer *buffer);
void gtk_text_view_set_buffer (GtkTextView *text_view,
GtkTextBuffer *buffer);
GtkTextBuffer *gtk_text_view_get_buffer (GtkTextView *text_view);
gboolean gtk_text_view_scroll_to_mark (GtkTextView *text_view,
gboolean gtk_text_view_scroll_to_iter (GtkTextView *text_view,
GtkTextIter *iter,
gdouble within_margin,
gboolean use_align,
gdouble xalign,
gdouble yalign);
void gtk_text_view_scroll_to_mark (GtkTextView *text_view,
GtkTextMark *mark,
gdouble within_margin,
gboolean use_align,
gdouble xalign,
gdouble yalign);
gboolean gtk_text_view_scroll_mark_onscreen (GtkTextView *text_view,
void gtk_text_view_scroll_mark_onscreen (GtkTextView *text_view,
GtkTextMark *mark);
gboolean gtk_text_view_move_mark_onscreen (GtkTextView *text_view,
GtkTextMark *mark);