Add progress handling to GitCommand
[anjuta-git-plugin.git] / plugins / git / git-command.h
blob97ddc4b3e7956dfdbb9de3653b7f7cd2069c423f
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta
4 * Copyright (C) James Liggett 2008 <jrliggett@cox.net>
5 *
6 * anjuta is free software.
7 *
8 * You may redistribute it and/or modify it under the terms of the
9 * GNU General Public License, as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
11 * any later version.
13 * anjuta is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with anjuta. If not, write to:
20 * The Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02110-1301, USA.
25 #ifndef _GIT_COMMAND_H_
26 #define _GIT_COMMAND_H_
28 #include <glib-object.h>
29 #include <string.h>
30 #include <wait.h>
31 #include <unistd.h>
32 #include <stdlib.h>
33 #include <libanjuta/anjuta-sync-command.h>
34 #include <libanjuta/anjuta-launcher.h>
36 G_BEGIN_DECLS
38 #define GIT_TYPE_COMMAND (git_command_get_type ())
39 #define GIT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIT_TYPE_COMMAND, GitCommand))
40 #define GIT_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIT_TYPE_COMMAND, GitCommandClass))
41 #define GIT_IS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIT_TYPE_COMMAND))
42 #define GIT_IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIT_TYPE_COMMAND))
43 #define GIT_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIT_TYPE_COMMAND, GitCommandClass))
45 typedef struct _GitCommandClass GitCommandClass;
46 typedef struct _GitCommand GitCommand;
47 typedef struct _GitCommandPriv GitCommandPriv;
49 struct _GitCommandClass
51 AnjutaSyncCommandClass parent_class;
53 /* Virtual methods */
54 void (*output_handler) (GitCommand *git_command, const gchar *output);
55 void (*error_handler) (GitCommand *git_command, const gchar *output);
58 struct _GitCommand
60 AnjutaSyncCommand parent_instance;
62 GitCommandPriv *priv;
65 GType git_command_get_type (void) G_GNUC_CONST;
66 void git_command_add_arg (GitCommand *self, const gchar *arg);
67 void git_command_add_list_to_args (GitCommand *self, GList *list);
68 void git_command_append_error (GitCommand *self, const gchar *error_line);
69 void git_command_push_info (GitCommand *self, const gchar *info);
70 GQueue *git_command_get_info_queue (GitCommand *self);
72 /* Generic output handlers */
73 void git_command_send_output_to_info (GitCommand *git_command,
74 const gchar *output);
76 /* Static helper methods */
77 GList *git_command_copy_path_list (GList *path_list);
78 void git_command_free_path_list (GList *path_list);
80 G_END_DECLS
82 #endif /* _GIT_COMMAND_H_ */