[vte] widget: Move some public API to its own file
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Move some public API to its own file
- Date: Wed, 18 Nov 2015 20:20:52 +0000 (UTC)
commit 3326680f18062a1b752190c0ceb52af7a99af921
Author: Christian Persch <chpe gnome org>
Date: Wed Nov 18 21:15:44 2015 +0100
widget: Move some public API to its own file
src/vte.cc | 41 ++++++-----------------------------------
src/vtegtk.cc | 33 +++++++++++++++++++++++++++++++++
src/vteinternal.hh | 1 +
3 files changed, 40 insertions(+), 35 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 21ca9b4..b2486ad 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -10980,43 +10980,14 @@ vte_terminal_set_scroll_on_keystroke(VteTerminal *terminal, gboolean scroll)
g_object_notify (G_OBJECT (terminal), "scroll-on-keystroke");
}
-/**
- * vte_terminal_set_rewrap_on_resize:
- * @terminal: a #VteTerminal
- * @rewrap: %TRUE if the terminal should rewrap on resize
- *
- * Controls whether or not the terminal will rewrap its contents, including
- * the scrollback history, whenever the terminal's width changes.
- */
-void
-vte_terminal_set_rewrap_on_resize(VteTerminal *terminal, gboolean rewrap)
+bool
+VteTerminalPrivate::set_rewrap_on_resize(bool rewrap)
{
- VteTerminalPrivate *pvt;
-
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
-
- pvt = terminal->pvt;
-
- if (rewrap == pvt->rewrap_on_resize)
- return;
-
- pvt->rewrap_on_resize = rewrap;
- g_object_notify (G_OBJECT (terminal), "rewrap-on-resize");
-}
+ if (rewrap == m_rewrap_on_resize)
+ return false;
-/**
- * vte_terminal_get_rewrap_on_resize:
- * @terminal: a #VteTerminal
- *
- * Checks whether or not the terminal will rewrap its contents upon resize.
- *
- * Returns: %TRUE if rewrapping is enabled, %FALSE if not
- */
-gboolean
-vte_terminal_get_rewrap_on_resize(VteTerminal *terminal)
-{
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
- return terminal->pvt->rewrap_on_resize;
+ m_rewrap_on_resize = rewrap;
+ return true;
}
/* Set up whatever background we wanted. */
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 2d13bd0..719ae11 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -2111,6 +2111,39 @@ vte_terminal_get_pty(VteTerminal *terminal)
}
/**
+ * vte_terminal_get_rewrap_on_resize:
+ * @terminal: a #VteTerminal
+ *
+ * Checks whether or not the terminal will rewrap its contents upon resize.
+ *
+ * Returns: %TRUE if rewrapping is enabled, %FALSE if not
+ */
+gboolean
+vte_terminal_get_rewrap_on_resize(VteTerminal *terminal)
+{
+ g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ return terminal->pvt->rewrap_on_resize;
+}
+
+/**
+ * vte_terminal_set_rewrap_on_resize:
+ * @terminal: a #VteTerminal
+ * @rewrap: %TRUE if the terminal should rewrap on resize
+ *
+ * Controls whether or not the terminal will rewrap its contents, including
+ * the scrollback history, whenever the terminal's width changes.
+ */
+void
+vte_terminal_set_rewrap_on_resize(VteTerminal *terminal,
+ gboolean rewrap)
+{
+ g_return_if_fail(VTE_IS_TERMINAL(terminal));
+
+ if (terminal->pvt->set_rewrap_on_resize(rewrap != FALSE))
+ g_object_notify_by_pspec(G_OBJECT(terminal), pspecs[PROP_REWRAP_ON_RESIZE]);
+}
+
+/**
* vte_terminal_get_row_count:
* @terminal: a #VteTerminal
*
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index c2e98b3..0caf513 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -615,6 +615,7 @@ public:
bool set_input_enabled(bool enabled);
bool set_mouse_autohide(bool autohide);
bool set_pty(VtePty *pty);
+ bool set_rewrap_on_resize(bool rewrap);
bool set_scrollback_lines(long lines);
bool set_word_char_exceptions(char const* exceptions);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]