1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) 2000 Naba Kumar
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.
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.
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
24 #include <libanjuta/anjuta-plugin.h>
25 #include <libanjuta/interfaces/ianjuta-buildable.h>
26 #include <libanjuta/interfaces/ianjuta-editor.h>
28 #include "configuration-list.h"
31 #define BUILDER_FILE PACKAGE_DATA_DIR "/glade/anjuta-build-basic-autotools-plugin.ui"
33 extern GType
basic_autotools_plugin_get_type (GTypeModule
*module
);
34 #define ANJUTA_TYPE_PLUGIN_BASIC_AUTOTOOLS (basic_autotools_plugin_get_type (NULL))
35 #define ANJUTA_PLUGIN_BASIC_AUTOTOOLS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_PLUGIN_BASIC_AUTOTOOLS, BasicAutotoolsPlugin))
36 #define ANJUTA_PLUGIN_BASIC_AUTOTOOLS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), ANJUTA_TYPE_PLUGIN_BASIC_AUTOTOOLS, BasicAutotoolsPluginClass))
37 #define ANJUTA_IS_PLUGIN_BASIC_AUTOTOOLS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_BASIC_AUTOTOOLS))
38 #define ANJUTA_IS_PLUGIN_BASIC_AUTOTOOLS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_PLUGIN_BASIC_AUTOTOOLS))
39 #define ANJUTA_PLUGIN_BASIC_AUTOTOOLS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ANJUTA_TYPE_PLUGIN_BASIC_AUTOTOOLS, BasicAutotoolsPluginClass))
41 typedef struct _BasicAutotoolsPlugin BasicAutotoolsPlugin
;
42 typedef struct _BasicAutotoolsPluginClass BasicAutotoolsPluginClass
;
44 struct _BasicAutotoolsPlugin
{
47 /* Build contexts pool */
53 gint project_root_watch_id
;
54 gint project_build_watch_id
;
58 GFile
*fm_current_file
;
59 GFile
*pm_current_file
;
60 GFile
*current_editor_file
;
61 GFile
*project_root_dir
;
62 GFile
*project_build_dir
;
63 IAnjutaEditor
*current_editor
;
67 GtkActionGroup
*build_action_group
;
68 GtkActionGroup
*build_popup_action_group
;
69 GtkWidget
*configuration_menu
;
71 /* commands overrides */
72 gchar
*commands
[IANJUTA_BUILDABLE_N_COMMANDS
];
74 /* Build parameters */
75 BuildConfigurationList
*configurations
;
77 /* Execution parameters */
79 gboolean run_in_terminal
;
82 /* Editors that have been created so far */
83 GHashTable
*editors_created
;
89 struct _BasicAutotoolsPluginClass
{
90 AnjutaPluginClass parent_class
;
93 typedef struct _BuildContext BuildContext
;
95 BuildContext
* build_get_context (BasicAutotoolsPlugin
*plugin
, const gchar
*dir
, gboolean with_view
);
96 void build_context_destroy (BuildContext
*context
);
98 void build_set_command_in_context (BuildContext
* context
, BuildProgram
*prog
);
99 gboolean
build_execute_command_in_context (BuildContext
* context
, GError
**err
);
100 gboolean
build_save_and_execute_command_in_context (BuildContext
* context
, GError
**err
);
101 const gchar
*build_context_get_work_dir (BuildContext
* context
);
102 AnjutaPlugin
*build_context_get_plugin (BuildContext
* context
);
105 void build_update_configuration_menu (BasicAutotoolsPlugin
*plugin
);