Implement support for listing and merging branches.
[anjuta-git-plugin.git] / libanjuta / anjuta-launcher.h
blob3a3c5d772e440b43f477b4e20055578b033ff222
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta-launcher.h
4 * Copyright (C) 2003 Naba Kumar <naba@gnome.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ANJUTA_LAUNCHER_H__
21 #define __ANJUTA_LAUNCHER_H__
23 #include <sys/types.h>
24 #include <glib.h>
25 #include <glib-object.h>
27 G_BEGIN_DECLS
29 typedef struct _AnjutaLauncher AnjutaLauncher;
30 typedef struct _AnjutaLauncherClass AnjutaLauncherClass;
31 typedef struct _AnjutaLauncherPriv AnjutaLauncherPriv;
33 #define ANJUTA_TYPE_LAUNCHER (anjuta_launcher_get_type ())
35 #define ANJUTA_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_LAUNCHER, AnjutaLauncher))
36 #define ANJUTA_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_LAUNCHER, AnjutaLauncherClass))
38 #define ANJUTA_IS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_LAUNCHER))
39 #define ANJUTA_IS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_LAUNCHER))
41 typedef enum {
42 ANJUTA_LAUNCHER_OUTPUT_STDOUT,
43 ANJUTA_LAUNCHER_OUTPUT_STDERR,
44 ANJUTA_LAUNCHER_OUTPUT_PTY
45 } AnjutaLauncherOutputType;
47 /**
48 * AnjutaLauncherOutputCallback:
49 * @launcher: a #AnjutaLauncher object
50 * @output_type: Type of the output
51 * @chars: Characters being outputed
52 * @user_data: User data passed back to the user
54 * This callback is called when new characters arrive from the launcher
55 * execution.
57 typedef void (*AnjutaLauncherOutputCallback) (AnjutaLauncher *launcher,
58 AnjutaLauncherOutputType output_type,
59 const gchar *chars,
60 gpointer user_data);
62 struct _AnjutaLauncher
64 GObject parent;
65 AnjutaLauncherPriv *priv;
68 struct _AnjutaLauncherClass
70 GObjectClass parent_class;
72 /* Signals */
73 void (*child_exited) (AnjutaLauncher *launcher,
74 int child_pid, int exit_status,
75 gulong time_taken_in_seconds);
76 void (*busy) (AnjutaLauncher *launcher, gboolean busy_flag);
79 GType anjuta_launcher_get_type (void);
80 AnjutaLauncher* anjuta_launcher_new (void);
81 gboolean anjuta_launcher_is_busy (AnjutaLauncher *launcher);
82 gboolean anjuta_launcher_execute (AnjutaLauncher *launcher,
83 const gchar *command_str,
84 AnjutaLauncherOutputCallback callback,
85 gpointer callback_data);
86 gboolean anjuta_launcher_execute_v (AnjutaLauncher *launcher,
87 gchar *const argv[],
88 AnjutaLauncherOutputCallback callback,
89 gpointer callback_data);
90 void anjuta_launcher_set_encoding (AnjutaLauncher *launcher,
91 const gchar *charset);
93 void anjuta_launcher_set_env (AnjutaLauncher *launcher,
94 const gchar *name,
95 const gchar *value);
97 void anjuta_launcher_send_stdin (AnjutaLauncher *launcher,
98 const gchar *input_str);
99 void anjuta_launcher_send_stdin_eof (AnjutaLauncher *launcher);
101 void anjuta_launcher_send_ptyin (AnjutaLauncher *launcher,
102 const gchar *input_str);
103 pid_t anjuta_launcher_get_child_pid (AnjutaLauncher *launcher);
104 void anjuta_launcher_reset (AnjutaLauncher *launcher);
105 void anjuta_launcher_signal (AnjutaLauncher *launcher, int sig);
106 gboolean anjuta_launcher_set_buffered_output (AnjutaLauncher *launcher,
107 gboolean buffered);
108 gboolean anjuta_launcher_set_check_passwd_prompt (AnjutaLauncher *launcher,
109 gboolean check_passwd);
110 /* Returns old value */
111 gboolean anjuta_launcher_set_terminal_echo (AnjutaLauncher *launcher,
112 gboolean echo_on);
113 gboolean anjuta_launcher_set_terminate_on_exit (AnjutaLauncher *launcher,
114 gboolean terminate_on_exit);
116 G_END_DECLS
118 #endif /* __ANJUTA_LAUNCHER_H__ */