1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
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>
25 #include <glib-object.h>
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))
42 ANJUTA_LAUNCHER_OUTPUT_STDOUT
,
43 ANJUTA_LAUNCHER_OUTPUT_STDERR
,
44 ANJUTA_LAUNCHER_OUTPUT_PTY
45 } AnjutaLauncherOutputType
;
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
57 typedef void (*AnjutaLauncherOutputCallback
) (AnjutaLauncher
*launcher
,
58 AnjutaLauncherOutputType output_type
,
62 struct _AnjutaLauncher
65 AnjutaLauncherPriv
*priv
;
68 struct _AnjutaLauncherClass
70 GObjectClass parent_class
;
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
,
90 AnjutaLauncherOutputCallback callback
,
91 gpointer callback_data
);
92 void anjuta_launcher_set_encoding (AnjutaLauncher
*launcher
,
93 const gchar
*charset
);
95 void anjuta_launcher_send_stdin (AnjutaLauncher
*launcher
,
96 const gchar
*input_str
);
97 void anjuta_launcher_send_stdin_eof (AnjutaLauncher
*launcher
);
99 void anjuta_launcher_send_ptyin (AnjutaLauncher
*launcher
,
100 const gchar
*input_str
);
101 pid_t
anjuta_launcher_get_child_pid (AnjutaLauncher
*launcher
);
102 void anjuta_launcher_reset (AnjutaLauncher
*launcher
);
103 void anjuta_launcher_signal (AnjutaLauncher
*launcher
, int sig
);
104 gboolean
anjuta_launcher_set_buffered_output (AnjutaLauncher
*launcher
,
106 gboolean
anjuta_launcher_set_check_passwd_prompt (AnjutaLauncher
*launcher
,
107 gboolean check_passwd
);
108 /* Returns old value */
109 gboolean
anjuta_launcher_set_terminal_echo (AnjutaLauncher
*launcher
,
111 gboolean
anjuta_launcher_set_terminate_on_exit (AnjutaLauncher
*launcher
,
112 gboolean terminate_on_exit
);
116 #endif /* __ANJUTA_LAUNCHER_H__ */