[vte/vte-next: 142/223] Move reset to VteBuffer



commit 278545e914d72aee3306ff0359e9e14d85b6aa76
Author: Christian Persch <chpe gnome org>
Date:   Fri Jun 10 00:06:31 2011 +0200

    Move reset to VteBuffer

 doc/reference/vte-sections.txt |    2 +-
 src/vte.c                      |   24 ++++++++++++------------
 src/vte.h                      |    5 -----
 src/vtebuffer.h                |    4 ++++
 src/vteseq.c                   |    4 ++--
 5 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 1a980c0..a188449 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -31,7 +31,6 @@ vte_terminal_set_word_chars
 vte_terminal_is_word_char
 vte_terminal_set_mouse_autohide
 vte_terminal_get_mouse_autohide
-vte_terminal_reset
 vte_terminal_get_text
 vte_terminal_get_text_include_trailing_spaces
 vte_terminal_get_text_range
@@ -114,6 +113,7 @@ vte_buffer_set_scrollback_lines
 vte_buffer_feed
 vte_buffer_feed_child
 vte_buffer_feed_child_binary
+vte_buffer_reset
 
 <SUBSECTION Standard>
 VTE_TYPE_BUFFER
diff --git a/src/vte.c b/src/vte.c
index 9624d5c..151e755 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -12324,8 +12324,8 @@ vte_terminal_get_mouse_autohide(VteTerminal *terminal)
 }
 
 /**
- * vte_terminal_reset:
- * @terminal: a #VteTerminal
+ * vte_buffer:
+ * @buffer: a #VteBuffer
  * @clear_tabstops: whether to reset tabstops
  * @clear_history: whether to empty the terminal's scrollback buffer
  *
@@ -12336,19 +12336,19 @@ vte_terminal_get_mouse_autohide(VteTerminal *terminal)
  *
  */
 void
-vte_terminal_reset(VteTerminal *terminal,
-                   gboolean clear_tabstops,
-                   gboolean clear_history)
+vte_buffer_reset(VteBuffer *buffer,
+                 gboolean clear_tabstops,
+                 gboolean clear_history)
 {
-        VteTerminalPrivate *pvt;
-        VteBuffer *buffer;
+        VteBufferPrivate *pvt;
+        VteTerminal *terminal;
 
-	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+	g_return_if_fail(VTE_IS_BUFFER(buffer));
 
-        pvt = terminal->pvt;
-        buffer = terminal->term_pvt->buffer;
+        pvt = buffer->pvt;
+        terminal = pvt->terminal;
 
-        g_object_freeze_notify(G_OBJECT(terminal));
+        g_object_freeze_notify(G_OBJECT(buffer));
 
 	/* Stop processing any of the data we've got backed up. */
 	vte_terminal_stop_processing (terminal);
@@ -12485,7 +12485,7 @@ vte_terminal_reset(VteTerminal *terminal,
 	vte_terminal_maybe_scroll_to_bottom(terminal);
 	_vte_invalidate_all(terminal);
 
-        g_object_thaw_notify(G_OBJECT(terminal));
+        g_object_thaw_notify(G_OBJECT(buffer));
 }
 
 /**
diff --git a/src/vte.h b/src/vte.h
index a1b8601..daa521d 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -213,11 +213,6 @@ gboolean vte_terminal_is_word_char(VteTerminal *terminal, gunichar c);
 void vte_terminal_set_mouse_autohide(VteTerminal *terminal, gboolean setting);
 gboolean vte_terminal_get_mouse_autohide(VteTerminal *terminal);
 
-/* Reset the terminal, optionally clearing the tab stops and line history. */
-void vte_terminal_reset(VteTerminal *terminal,
-                        gboolean clear_tabstops,
-			gboolean clear_history);
-
 /* Read the contents of the terminal, using a callback function to determine
  * if a particular location on the screen (0-based) is interesting enough to
  * include.  Each byte in the returned string will have a corresponding
diff --git a/src/vtebuffer.h b/src/vtebuffer.h
index a97191e..907379f 100644
--- a/src/vtebuffer.h
+++ b/src/vtebuffer.h
@@ -82,6 +82,10 @@ void vte_buffer_feed_child_binary       (VteBuffer *buffer,
                                          const char *data,
                                          gsize length);
 
+void vte_buffer_reset                   (VteBuffer *buffer,
+                                         gboolean clear_tabstops,
+                                         gboolean clear_history);
+
 G_END_DECLS
 
 #endif /* VTE_BUFFER_H */
diff --git a/src/vteseq.c b/src/vteseq.c
index 5db07e0..bbe5d5f 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -2773,7 +2773,7 @@ vte_sequence_handler_erase_in_line (VteTerminal *terminal, GValueArray *params)
 static void
 vte_sequence_handler_full_reset (VteTerminal *terminal, GValueArray *params)
 {
-	vte_terminal_reset(terminal, TRUE, TRUE);
+	vte_buffer_reset(terminal->term_pvt->buffer, TRUE, TRUE);
 }
 
 /* Insert a specified number of blank characters. */
@@ -3045,7 +3045,7 @@ vte_sequence_handler_screen_alignment_test (VteTerminal *terminal, GValueArray *
 static void
 vte_sequence_handler_soft_reset (VteTerminal *terminal, GValueArray *params)
 {
-	vte_terminal_reset(terminal, FALSE, FALSE);
+	vte_buffer_reset(terminal->term_pvt->buffer, FALSE, FALSE);
 }
 
 /* Window manipulation control sequences.  Most of these are considered



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]