Commit 1821c2df authored by Matthias Clasen's avatar Matthias Clasen
Browse files

text view: Expose cursor blink control

Derived classes like GtkSourceView with their own ::key-event
handler need access to this, in order to make their keynav
as nice as the builtin one, wrt to caret visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=760748
parent f8b8e4ea
......@@ -3950,6 +3950,7 @@ gtk_text_view_set_editable
gtk_text_view_get_editable
gtk_text_view_set_cursor_visible
gtk_text_view_get_cursor_visible
gtk_text_view_reset_cursor_blink
gtk_text_view_set_overwrite
gtk_text_view_get_overwrite
gtk_text_view_set_pixels_above_lines
......
......@@ -3538,6 +3538,28 @@ gtk_text_view_get_cursor_visible (GtkTextView *text_view)
return text_view->priv->cursor_visible;
}
/**
* gtk_text_view_reset_cursor_blink:
* @text_view: a #GtkTextView
*
* Ensures that the cursor is shown (i.e. not in an 'off' blink
* interval) and resets the time that it will stay blinking (or
* visible, in case blinking is disabled).
*
* This function should be called in response to user input
* (e.g. from derived classes that override the textview's
* #GtkWidget::key-press-event handler).
*
* Since: 3.20
*/
void
gtk_text_view_reset_cursor_blink (GtkTextView *text_view)
{
g_return_if_fail (GTK_IS_TEXT_VIEW (text_view));
gtk_text_view_reset_blink_time (text_view);
gtk_text_view_pend_cursor_blink (text_view);
}
/**
* gtk_text_view_place_cursor_onscreen:
......
......@@ -246,6 +246,9 @@ void gtk_text_view_set_cursor_visible (GtkTextView *text_view,
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_view_get_cursor_visible (GtkTextView *text_view);
GDK_AVAILABLE_IN_3_20
void gtk_text_view_reset_cursor_blink (GtkTextView *text_view);
GDK_AVAILABLE_IN_ALL
void gtk_text_view_get_cursor_locations (GtkTextView *text_view,
const GtkTextIter *iter,
......
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