[vte/vte-next: 155/223] Move spawn to VteBuffer
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 155/223] Move spawn to VteBuffer
- Date: Wed, 22 Jun 2011 21:01:37 +0000 (UTC)
commit 8d2f19e4ac7e01d812fb4bd50086b5be8e74776b
Author: Christian Persch <chpe gnome org>
Date: Sat Jun 11 20:28:32 2011 +0200
Move spawn to VteBuffer
doc/reference/vte-sections.txt | 4 +---
src/vte.c | 20 +++++++++-----------
src/vte.h | 12 ------------
src/vteapp.c | 2 +-
src/vtebuffer.h | 12 ++++++++++++
5 files changed, 23 insertions(+), 27 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index e1b2e76..5966b13 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -55,9 +55,6 @@ VTE_STYLE_CLASS_TERMINAL
vte_get_default_emulation
vte_get_user_shell
-<SUBSECTION>
-vte_terminal_spawn_sync
-
<SUBSECTION Standard>
VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE
vte_terminal_cursor_blink_mode_get_type
@@ -116,6 +113,7 @@ vte_buffer_get_pty
vte_buffer_set_pty
vte_buffer_pty_new_sync
vte_buffer_watch_child
+vte_buffer_spawn_sync
<SUBSECTION Standard>
VTE_TYPE_BUFFER
diff --git a/src/vte.c b/src/vte.c
index ef65972..f188be0 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -2969,8 +2969,8 @@ vte_get_user_shell (void)
}
/**
- * vte_terminal_spawn_sync:
- * @terminal: a #VteTerminal
+ * vte_buffer_spawn_sync:
+ * @buffer: a #VteBuffer
* @pty_flags: flags from #VtePtyFlags
* @working_directory: (allow-none): the name of a directory the command should start
* in, or %NULL to use the current working directory
@@ -2985,9 +2985,9 @@ vte_get_user_shell (void)
* @error: (allow-none): return location for a #GError, or %NULL
*
* Starts the specified command under a newly-allocated controlling
- * pseudo-terminal. The @argv and @envv lists should be %NULL-terminated.
+ * pseudo-buffer. The @argv and @envv lists should be %NULL-terminated.
* The "TERM" environment variable is automatically set to reflect the
- * terminal widget's emulation setting.
+ * buffer widget's emulation setting.
* @pty_flags controls logging the session to the specified system log files.
*
* Note that %G_SPAWN_DO_NOT_REAP_CHILD will always be added to @spawn_flags.
@@ -2999,11 +2999,9 @@ vte_get_user_shell (void)
* See vte_pty_new(), g_spawn_async() and vte_buffer_watch_child() for more information.
*
* Returns: %TRUE on success, or %FALSE on error with @error filled in
- *
- * Since: 0.30
*/
gboolean
-vte_terminal_spawn_sync(VteTerminal *terminal,
+vte_buffer_spawn_sync(VteBuffer *buffer,
VtePtyFlags pty_flags,
const char *working_directory,
char **argv,
@@ -3018,12 +3016,12 @@ vte_terminal_spawn_sync(VteTerminal *terminal,
VtePty *pty;
GPid pid;
- 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(argv != NULL, FALSE);
g_return_val_if_fail(child_setup_data == NULL || child_setup, FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
- pty = vte_buffer_pty_new_sync(terminal->term_pvt->buffer, pty_flags, cancellable, error);
+ pty = vte_buffer_pty_new_sync(buffer, pty_flags, cancellable, error);
if (pty == NULL)
return FALSE;
@@ -3042,8 +3040,8 @@ vte_terminal_spawn_sync(VteTerminal *terminal,
return FALSE;
}
- vte_buffer_set_pty(terminal->term_pvt->buffer, pty);
- vte_buffer_watch_child(terminal->term_pvt->buffer, pid);
+ vte_buffer_set_pty(buffer, pty);
+ vte_buffer_watch_child(buffer, pid);
g_object_unref (pty);
if (child_pid)
diff --git a/src/vte.h b/src/vte.h
index e1177f7..52b00be 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -133,18 +133,6 @@ GtkWidget *vte_terminal_new(void);
VteBuffer *vte_terminal_get_buffer(VteTerminal *terminal);
-gboolean vte_terminal_spawn_sync(VteTerminal *terminal,
- VtePtyFlags pty_flags,
- const char *working_directory,
- char **argv,
- char **envv,
- GSpawnFlags spawn_flags,
- GSpawnChildSetupFunc child_setup,
- gpointer child_setup_data,
- GPid *child_pid /* out */,
- GCancellable *cancellable,
- GError **error);
-
/* Copy currently-selected text to the clipboard, or from the clipboard to
* the terminal. */
void vte_terminal_copy_clipboard(VteTerminal *terminal);
diff --git a/src/vteapp.c b/src/vteapp.c
index cf51f94..8e5ce66 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -1098,7 +1098,7 @@ main(int argc, char **argv)
command = "/bin/sh";
if (!g_shell_parse_argv(command, &command_argc, &command_argv, &err) ||
- !vte_terminal_spawn_sync(terminal,
+ !vte_buffer_spawn_sync(buffer,
pty_flags,
NULL,
command_argv,
diff --git a/src/vtebuffer.h b/src/vtebuffer.h
index f87ee3a..144740f 100644
--- a/src/vtebuffer.h
+++ b/src/vtebuffer.h
@@ -144,6 +144,18 @@ gboolean vte_buffer_write_contents_sync (VteBuffer *buffer,
void vte_buffer_watch_child (VteBuffer *buffer,
GPid child_pid);
+gboolean vte_buffer_spawn_sync (VteBuffer *buffer,
+ VtePtyFlags pty_flags,
+ const char *working_directory,
+ char **argv,
+ char **envv,
+ GSpawnFlags spawn_flags,
+ GSpawnChildSetupFunc child_setup,
+ gpointer child_setup_data,
+ GPid *child_pid /* out */,
+ GCancellable *cancellable,
+ GError **error);
+
G_END_DECLS
#endif /* VTE_BUFFER_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]