1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /*
3  * Libbrasero-burn
4  * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr>
5  *
6  * Libbrasero-burn is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
12  * GStreamer plugins to be used and distributed together with GStreamer
13  * and Libbrasero-burn. This permission is above and beyond the permissions granted
14  * by the GPL license by which Libbrasero-burn is covered. If you modify this code
15  * you may extend this exception to your version of the code, but you are not
16  * obligated to do so. If you do not wish to do so, delete this exception
17  * statement from your version.
18  *
19  * Libbrasero-burn is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to:
26  * 	The Free Software Foundation, Inc.,
27  * 	51 Franklin Street, Fifth Floor
28  * 	Boston, MA  02110-1301, USA.
29  */
30 
31 #ifndef PROCESS_H
32 #define PROCESS_H
33 
34 #include <glib.h>
35 #include <glib-object.h>
36 
37 #include "burn-job.h"
38 
39 G_BEGIN_DECLS
40 
41 #define BRASERO_TYPE_PROCESS         (brasero_process_get_type ())
42 #define BRASERO_PROCESS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), BRASERO_TYPE_PROCESS, BraseroProcess))
43 #define BRASERO_PROCESS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), BRASERO_TYPE_PROCESS, BraseroProcessClass))
44 #define BRASERO_IS_PROCESS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), BRASERO_TYPE_PROCESS))
45 #define BRASERO_IS_PROCESS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), BRASERO_TYPE_PROCESS))
46 #define BRASERO_PROCESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BRASERO_TYPE_PROCESS, BraseroProcessClass))
47 
48 typedef struct {
49 	BraseroJob parent;
50 } BraseroProcess;
51 
52 typedef struct {
53 	BraseroJobClass parent_class;
54 
55 	/* virtual functions */
56 	BraseroBurnResult	(*stdout_func)	(BraseroProcess *process,
57 						 const gchar *line);
58 	BraseroBurnResult	(*stderr_func)	(BraseroProcess *process,
59 						 const gchar *line);
60 	BraseroBurnResult	(*set_argv)	(BraseroProcess *process,
61 						 GPtrArray *argv,
62 						 GError **error);
63 
64 	/* since burn-process.c doesn't know if it should call finished_session
65 	 * of finished track this allows to override the default call which is
66 	 * brasero_job_finished_track */
67 	BraseroBurnResult      	(*post)       	(BraseroJob *job);
68 } BraseroProcessClass;
69 
70 GType brasero_process_get_type (void);
71 
72 /**
73  * This function allows to set an error that is used if the process doesn't
74  * return 0.
75  */
76 void
77 brasero_process_deferred_error (BraseroProcess *process,
78 				GError *error);
79 
80 void
81 brasero_process_set_working_directory (BraseroProcess *process,
82 				       const gchar *directory);
83 
84 G_END_DECLS
85 
86 #endif /* PROCESS_H */
87