[vte] widget: Add accessor function to get scrollback lines number
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Add accessor function to get scrollback lines number
- Date: Fri, 15 Sep 2017 18:45:10 +0000 (UTC)
commit 9ac6663add75234a1d4cf0f51f37795b2ed21159
Author: Igor Zakharov <f2404 yandex ru>
Date: Fri Sep 15 20:44:42 2017 +0200
widget: Add accessor function to get scrollback lines number
https://bugzilla.gnome.org/show_bug.cgi?id=787642
doc/reference/vte-sections.txt | 1 +
src/vte/vteterminal.h | 2 ++
src/vtegtk.cc | 18 +++++++++++++++++-
3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 6695dd6..d834763 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -47,6 +47,7 @@ vte_terminal_get_cursor_shape
vte_terminal_get_cursor_blink_mode
vte_terminal_set_cursor_blink_mode
vte_terminal_set_scrollback_lines
+vte_terminal_get_scrollback_lines
vte_terminal_set_font
vte_terminal_get_font
vte_terminal_get_has_selection
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
index d00c251..156358e 100644
--- a/src/vte/vteterminal.h
+++ b/src/vte/vteterminal.h
@@ -281,6 +281,8 @@ VteCursorShape vte_terminal_get_cursor_shape(VteTerminal *terminal) _VTE_GNUC_NO
_VTE_PUBLIC
void vte_terminal_set_scrollback_lines(VteTerminal *terminal,
glong lines) _VTE_GNUC_NONNULL(1);
+_VTE_PUBLIC
+glong vte_terminal_get_scrollback_lines(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
/* Set or retrieve the current font. */
_VTE_PUBLIC
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index d2188f6..a910aa0 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -472,7 +472,7 @@ vte_terminal_get_property (GObject *object,
g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal));
break;
case PROP_SCROLLBACK_LINES:
- g_value_set_uint (value, impl->m_scrollback_lines);
+ g_value_set_uint (value, vte_terminal_get_scrollback_lines(terminal));
break;
case PROP_SCROLL_ON_KEYSTROKE:
g_value_set_boolean (value, vte_terminal_get_scroll_on_keystroke(terminal));
@@ -3808,6 +3808,22 @@ vte_terminal_set_scrollback_lines(VteTerminal *terminal, glong lines)
}
/**
+ * vte_terminal_get_scrollback_lines:
+ * @terminal: a #VteTerminal
+ *
+ * Returns: length of the scrollback buffer used by the terminal.
+ * A negative value means "infinite scrollback".
+ *
+ * Since: 0.52
+ */
+glong
+vte_terminal_get_scrollback_lines(VteTerminal *terminal)
+{
+ g_return_val_if_fail(VTE_IS_TERMINAL(terminal), 0);
+ return IMPL(terminal)->m_scrollback_lines;
+}
+
+/**
* vte_terminal_set_scroll_on_keystroke:
* @terminal: a #VteTerminal
* @scroll: whether the terminal should scroll on keystrokes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]