1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ 2 /* 3 anjuta-autogen.h 4 Copyright (C) 2004 Sebastien Granjoux 5 6 This program 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 This program 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 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 */ 20 21 #ifndef __ANJUTA_AUTOGEN_H__ 22 #define __ANJUTA_AUTOGEN_H__ 23 24 #include <glib.h> 25 26 /** 27 * AnjutaAutogen: 28 * 29 * A GObject wrapper for running GNU autogen. 30 **/ 31 32 typedef struct _AnjutaAutogen AnjutaAutogen; 33 typedef struct _AnjutaAutogenClass AnjutaAutogenClass; 34 35 #define ANJUTA_TYPE_AUTOGEN (anjuta_autogen_get_type ()) 36 #define ANJUTA_AUTOGEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_AUTOGEN, AnjutaAutogen)) 37 #define ANJUTA_AUTOGEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_AUTOGEN, AnjutaAutogenClass)) 38 #define ANJUTA_IS_AUTOGEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_AUTOGEN)) 39 #define ANJUTA_IS_AUTOGEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_AUTOGEN)) 40 #define ANJUTA_AUTOGEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_AUTOGEN, AnjutaAutogenClass)) 41 42 GType anjuta_autogen_get_type (void) G_GNUC_CONST; 43 44 /** 45 * AnjutaAutogenFunc: 46 * @autogen: #AnjutaAutogen object. 47 * @data: user data passed to the callback. 48 * 49 * This function is called when the autogen process is completed. 50 */ 51 typedef void (*AnjutaAutogenFunc) (AnjutaAutogen* autogen, gpointer data); 52 53 /** 54 * AnjutaAutogenOutputFunc: 55 * @output: data generated by autogen. 56 * @data: user data passed to the callback. 57 * 58 * This function is called each time there is new data from autogen. 59 */ 60 typedef void (*AnjutaAutogenOutputFunc) (const gchar* output, gpointer data); 61 62 63 AnjutaAutogen* anjuta_autogen_new (void); 64 65 gboolean anjuta_autogen_write_definition_file (AnjutaAutogen* this, GHashTable* values, GError **error); 66 67 void anjuta_autogen_set_library_path (AnjutaAutogen* this, const gchar *directory); 68 void anjuta_autogen_clear_library_path (AnjutaAutogen* this); 69 GList *anjuta_autogen_get_library_paths (AnjutaAutogen* this); 70 gboolean anjuta_autogen_set_input_file (AnjutaAutogen* this, const gchar* filename, const gchar* start_marker, const gchar* end_marker); 71 gboolean anjuta_autogen_set_output_file (AnjutaAutogen* this, const gchar* filename); 72 gboolean anjuta_autogen_set_output_callback (AnjutaAutogen* this, AnjutaAutogenOutputFunc func, gpointer user_data, GDestroyNotify destroy); 73 74 gboolean anjuta_autogen_execute (AnjutaAutogen* this, AnjutaAutogenFunc func, gpointer data, GError** error); 75 76 gboolean anjuta_check_autogen(void); 77 78 #endif 79