[vte/vte-next: 146/223] Move write_contents to VteBuffer
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 146/223] Move write_contents to VteBuffer
- Date: Wed, 22 Jun 2011 21:00:52 +0000 (UTC)
commit 94b1997c8c28b70673a73c618ac116718ddc1a3b
Author: Christian Persch <chpe gnome org>
Date: Fri Jun 10 22:56:50 2011 +0200
Move write_contents to VteBuffer
doc/reference/vte-sections.txt | 8 ++++----
src/ring.c | 14 +++++++-------
src/ring.h | 10 +++++-----
src/vte.c | 31 +++++++++++++++----------------
src/vte.h | 19 -------------------
src/vteapp.c | 6 +++---
src/vtebuffer.h | 7 +++++++
src/vteenums.h | 12 ++++++++++++
8 files changed, 53 insertions(+), 54 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 3817c61..6acf5f1 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -6,7 +6,7 @@ VteTerminalCursorBlinkMode
VteTerminalCursorShape
VteTerminalEffect
VteEraseBinding
-VteTerminalWriteFlags
+VteWriteFlags
VteSelectionFunc
vte_terminal_new
vte_terminal_get_buffer
@@ -43,7 +43,6 @@ vte_terminal_match_set_cursor
vte_terminal_match_set_cursor_type
vte_terminal_match_set_cursor_name
vte_terminal_get_status_line
-vte_terminal_write_contents
vte_terminal_search_find_next
vte_terminal_search_find_previous
vte_terminal_search_get_gregex
@@ -74,8 +73,8 @@ VTE_TYPE_TERMINAL_EFFECT
vte_terminal_effect_get_type
VTE_TYPE_ERASE_BINDING
vte_erase_binding_get_type
-VTE_TYPE_TERMINAL_WRITE_FLAGS
-vte_terminal_write_flags_get_type
+VTE_TYPE_WRITE_FLAGS
+vte_write_flags_get_type
VTE_TYPE_TERMINAL
vte_terminal_get_type
VTE_IS_TERMINAL
@@ -114,6 +113,7 @@ vte_buffer_feed_child_binary
vte_buffer_reset
vte_buffer_get_icon_title
vte_buffer_get_window_title
+vte_buffer_write_contents_sync
<SUBSECTION Standard>
VTE_TYPE_BUFFER
diff --git a/src/ring.c b/src/ring.c
index a784349..e54ab23 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -564,7 +564,7 @@ static gboolean
_vte_ring_write_row (VteRing *ring,
GOutputStream *stream,
VteRowData *row,
- VteTerminalWriteFlags flags,
+ VteWriteFlags flags,
GCancellable *cancellable,
GError **error)
{
@@ -587,7 +587,7 @@ _vte_ring_write_row (VteRing *ring,
}
/**
- * _vte_ring_write_contents:
+ * _vte_ring_write_contents_sync:
* @ring: a #VteRing
* @stream: a #GOutputStream to write to
* @flags: a set of #VteTerminalWriteFlags
@@ -599,11 +599,11 @@ _vte_ring_write_row (VteRing *ring,
* Return: %TRUE on success, %FALSE if there was an error
*/
gboolean
-_vte_ring_write_contents (VteRing *ring,
- GOutputStream *stream,
- VteTerminalWriteFlags flags,
- GCancellable *cancellable,
- GError **error)
+_vte_ring_write_contents_sync(VteRing *ring,
+ GOutputStream *stream,
+ VteWriteFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
gulong i;
diff --git a/src/ring.h b/src/ring.h
index 45fa90b..fa25de5 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -80,11 +80,11 @@ void _vte_ring_shrink (VteRing *ring, gulong max_len);
VteRowData *_vte_ring_insert (VteRing *ring, gulong position);
VteRowData *_vte_ring_append (VteRing *ring);
void _vte_ring_remove (VteRing *ring, gulong position);
-gboolean _vte_ring_write_contents (VteRing *ring,
- GOutputStream *stream,
- VteTerminalWriteFlags flags,
- GCancellable *cancellable,
- GError **error);
+gboolean _vte_ring_write_contents_sync(VteRing *ring,
+ GOutputStream *stream,
+ VteWriteFlags flags,
+ GCancellable *cancellable,
+ GError **error);
G_END_DECLS
diff --git a/src/vte.c b/src/vte.c
index aae69ea..bfa4d92 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -13162,14 +13162,14 @@ update_timeout (gpointer data)
}
/**
- * vte_terminal_write_contents:
- * @terminal: a #VteTerminal
+ * vte_buffer_write_contents_sync:
+ * @buffer: a #VteBuffer
* @stream: a #GOutputStream to write to
- * @flags: a set of #VteTerminalWriteFlags
+ * @flags: a set of #VteBufferWriteFlags
* @cancellable: (allow-none): a #GCancellable object, or %NULL
* @error: (allow-none): a #GError location to store the error occuring, or %NULL
*
- * Write contents of the current contents of @terminal (including any
+ * Write contents of the current contents of @buffer (including any
* scrollback history) to @stream according to @flags.
*
* If @cancellable is not %NULL, then the operation can be cancelled by triggering
@@ -13181,23 +13181,22 @@ update_timeout (gpointer data)
* depending on scrollback history and @stream availability for writing.
*
* Returns: %TRUE on success, %FALSE if there was an error
- *
- * Since: 0.24
*/
gboolean
-vte_terminal_write_contents (VteTerminal *terminal,
- GOutputStream *stream,
- VteTerminalWriteFlags flags,
- GCancellable *cancellable,
- GError **error)
+vte_buffer_write_contents_sync (VteBuffer *buffer,
+ GOutputStream *stream,
+ VteWriteFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ g_return_val_if_fail(VTE_IS_BUFFER(buffer), FALSE);
g_return_val_if_fail(G_IS_OUTPUT_STREAM(stream), FALSE);
- return _vte_ring_write_contents (terminal->pvt->screen->row_data,
- stream, flags,
- cancellable, error);
-}
+ g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
+ return _vte_ring_write_contents_sync(buffer->pvt->screen->row_data,
+ stream, flags,
+ cancellable, error);
+}
/*
* Buffer search
diff --git a/src/vte.h b/src/vte.h
index f1516e8..9ce3c30 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -276,25 +276,6 @@ glong vte_terminal_get_char_height(VteTerminal *terminal);
glong vte_terminal_get_row_count(VteTerminal *terminal);
glong vte_terminal_get_column_count(VteTerminal *terminal);
-/* Writing contents out */
-
-/**
- * VteTerminalWriteFlags:
- * @VTE_TERMINAL_WRITE_DEFAULT: Write contents as UTF-8 text. This is the default.
- *
- * A flag type to determine how terminal contents should be written
- * to an output stream.
- */
-typedef enum {
- VTE_TERMINAL_WRITE_DEFAULT = 0
-} VteTerminalWriteFlags;
-
-gboolean vte_terminal_write_contents (VteTerminal *terminal,
- GOutputStream *stream,
- VteTerminalWriteFlags flags,
- GCancellable *cancellable,
- GError **error);
-
G_END_DECLS
#endif
diff --git a/src/vteapp.c b/src/vteapp.c
index 18467c2..41a5fe6 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -139,9 +139,9 @@ destroy_and_quit(VteTerminal *terminal, GtkWidget *window)
stream = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &error));
if (stream) {
- vte_terminal_write_contents (terminal, stream,
- VTE_TERMINAL_WRITE_DEFAULT,
- NULL, &error);
+ vte_buffer_write_contents_sync(vte_terminal_get_buffer(terminal), stream,
+ VTE_WRITE_FLAG_DEFAULT,
+ NULL, &error);
g_object_unref (stream);
}
diff --git a/src/vtebuffer.h b/src/vtebuffer.h
index 129eba0..26ca497 100644
--- a/src/vtebuffer.h
+++ b/src/vtebuffer.h
@@ -104,6 +104,13 @@ const char *vte_buffer_get_window_title (VteBuffer *buffer);
const char *vte_buffer_get_icon_title (VteBuffer *buffer);
+gboolean vte_buffer_write_contents_sync (VteBuffer *buffer,
+ GOutputStream *stream,
+ VteWriteFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+
G_END_DECLS
#endif /* VTE_BUFFER_H */
diff --git a/src/vteenums.h b/src/vteenums.h
index fc31b3c..9ee001d 100644
--- a/src/vteenums.h
+++ b/src/vteenums.h
@@ -86,6 +86,18 @@ typedef enum {
VTE_TERMINAL_EFFECT_COLOR
} VteTerminalEffect;
+
+/**
+ * VteWriteFlags:
+ * @VTE_TERMINAL_WRITE_DEFAULT: Write contents as UTF-8 text. This is the default.
+ *
+ * A flag type to determine how terminal contents should be written
+ * to an output stream.
+ */
+typedef enum {
+ VTE_WRITE_FLAG_DEFAULT = 0
+} VteWriteFlags;
+
G_END_DECLS
#endif /* VTE_ENUMS_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]