am-project: Fix failures due to the previous patches in the regression test
[anjuta.git] / libanjuta / anjuta-project.h
blob0db71dd2652a609f500437cee332b7180311b6f8
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta-project.h
4 * Copyright (C) Sébastien Granjoux 2009 <seb.sfo@free.fr>
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _ANJUTA_PROJECT_H_
21 #define _ANJUTA_PROJECT_H_
23 #include <glib.h>
24 #include <gio/gio.h>
26 G_BEGIN_DECLS
28 #define ANJUTA_TYPE_PROJECT_PROPERTY (anjuta_project_property_get_type ())
29 #define ANJUTA_IS_PROJECT_PROPERTY
31 typedef struct _AnjutaProjectProperty AnjutaProjectProperty;
32 typedef struct _AnjutaProjectPropertyInfo AnjutaProjectPropertyInfo;
34 typedef enum
36 ANJUTA_PROJECT_PROPERTY_STRING = 1,
37 ANJUTA_PROJECT_PROPERTY_LIST,
38 ANJUTA_PROJECT_PROPERTY_BOOLEAN,
39 ANJUTA_PROJECT_PROPERTY_MAP
40 } AnjutaProjectValueType;
42 typedef enum
44 ANJUTA_PROJECT_PROPERTY_READ_ONLY = 1 << 0,
45 ANJUTA_PROJECT_PROPERTY_READ_WRITE = 1 << 1,
46 ANJUTA_PROJECT_PROPERTY_HIDDEN = 1 << 2,
47 ANJUTA_PROJECT_PROPERTY_STATIC = 1 << 3,
48 } AnjutaProjectPropertyFlags;
50 struct _AnjutaProjectProperty
52 gchar *name;
53 gchar *value;
54 AnjutaProjectPropertyInfo *info;
55 gpointer user_data;
58 GType anjuta_project_property_get_type (void);
59 AnjutaProjectProperty *anjuta_project_property_new (const gchar *value, const gchar *name, gpointer user_data);
60 AnjutaProjectProperty * anjuta_project_property_copy (AnjutaProjectProperty *prop);
61 void anjuta_project_property_free (AnjutaProjectProperty *prop);
64 struct _AnjutaProjectPropertyInfo
66 gchar *id;
67 gchar *name;
68 AnjutaProjectValueType type;
69 AnjutaProjectPropertyFlags flags;
70 gchar *description;
71 AnjutaProjectProperty *default_value;
72 gpointer user_data;
75 GType anjuta_project_property_info_get_type (void);
76 AnjutaProjectPropertyInfo *anjuta_project_property_info_new (const gchar *id, const gchar *name, AnjutaProjectValueType type, AnjutaProjectPropertyFlags flags, const gchar *description, AnjutaProjectProperty *default_value, gpointer user_data);
77 AnjutaProjectPropertyInfo * anjuta_project_property_info_copy (AnjutaProjectPropertyInfo *info);
78 void anjuta_project_property_info_free (AnjutaProjectPropertyInfo *info);
81 #define ANJUTA_TYPE_PROJECT_NODE (anjuta_project_node_get_type ())
82 #define ANJUTA_PROJECT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PROJECT_NODE, AnjutaProjectNode))
83 #define ANJUTA_PROJECT_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_PROJECT_NODE, AnjutaProjectNodeClass))
84 #define ANJUTA_IS_PROJECT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_PROJECT_NODE))
85 #define ANJUTA_IS_PROJECT_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_PROJECT_NODE))
86 #define ANJUTA_PROJECT_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_PROJECT_NODE, AnjutaProjectNodeClass))
88 typedef struct _AnjutaProjectNode AnjutaProjectNode;
89 typedef struct _AnjutaProjectNodeClass AnjutaProjectNodeClass;
91 typedef enum
93 ANJUTA_PROJECT_UNKNOWN = 0,
94 ANJUTA_PROJECT_SHAREDLIB,
95 ANJUTA_PROJECT_STATICLIB,
96 ANJUTA_PROJECT_PROGRAM,
97 ANJUTA_PROJECT_PYTHON,
98 ANJUTA_PROJECT_JAVA,
99 ANJUTA_PROJECT_LISP,
100 ANJUTA_PROJECT_HEADER,
101 ANJUTA_PROJECT_MAN,
102 ANJUTA_PROJECT_INFO,
103 ANJUTA_PROJECT_GENERIC,
104 ANJUTA_PROJECT_DATA,
105 ANJUTA_PROJECT_EXTRA,
106 ANJUTA_PROJECT_INTLTOOL,
107 ANJUTA_PROJECT_CONFIGURE,
108 ANJUTA_PROJECT_IDL,
109 ANJUTA_PROJECT_MKENUMS,
110 ANJUTA_PROJECT_GENMARSHAL,
111 ANJUTA_PROJECT_SCRIPT,
112 ANJUTA_PROJECT_ROOT_GROUP,
113 ANJUTA_PROJECT_LT_MODULE,
114 ANJUTA_PROJECT_PROXY = 1 << 16,
115 ANJUTA_PROJECT_PROJECT = 1 << 17,
116 ANJUTA_PROJECT_PRIMARY = 1 << 18,
117 ANJUTA_PROJECT_EXECUTABLE = 1 << 19,
118 ANJUTA_PROJECT_READ_ONLY = 1 << 20, /* Node cannot be created by the backend */
119 ANJUTA_PROJECT_ID_MASK = 0xFFFF << 0,
120 ANJUTA_PROJECT_FLAG_MASK = 0xFF << 16,
121 ANJUTA_PROJECT_TYPE_MASK = 0xFF << 24,
122 ANJUTA_PROJECT_ROOT = 1 << 24,
123 ANJUTA_PROJECT_GROUP = 2 << 24,
124 ANJUTA_PROJECT_TARGET = 3 << 24,
125 ANJUTA_PROJECT_SOURCE = 4 << 24,
126 ANJUTA_PROJECT_MODULE = 5 << 24,
127 ANJUTA_PROJECT_PACKAGE = 6 << 24,
128 ANJUTA_PROJECT_VARIABLE = 7 << 24,
129 ANJUTA_PROJECT_OBJECT = 8 << 24,
130 } AnjutaProjectNodeType;
132 typedef enum
134 ANJUTA_PROJECT_OK = 0,
135 ANJUTA_PROJECT_MODIFIED = 1 << 0, /* Node has been modified */
136 ANJUTA_PROJECT_INCOMPLETE = 1 << 1, /* Node is not fully loaded */
137 ANJUTA_PROJECT_LOADING = 1 << 2, /* Node is send to the worker thread */
138 ANJUTA_PROJECT_REMOVED = 1 << 3, /* Node has been removed */
139 ANJUTA_PROJECT_CAN_ADD_GROUP = 1 << 8,
140 ANJUTA_PROJECT_CAN_ADD_TARGET = 1 << 9,
141 ANJUTA_PROJECT_CAN_ADD_SOURCE = 1 << 10,
142 ANJUTA_PROJECT_CAN_ADD_MODULE = 1 << 11,
143 ANJUTA_PROJECT_CAN_ADD_PACKAGE = 1 << 12,
144 ANJUTA_PROJECT_CAN_REMOVE = 1 << 16,
145 ANJUTA_PROJECT_CAN_SAVE = 1 << 17,
146 ANJUTA_PROJECT_REMOVE_FILE = 1 << 18
147 } AnjutaProjectNodeState;
150 * AnjutaProjectNode:
152 * The #AnjutaProjectNode struct contains private data only, and should
153 * accessed using the functions below.
155 struct _AnjutaProjectNode
157 GInitiallyUnowned parent_instance;
159 /*< private >*/
160 AnjutaProjectNode *next;
161 AnjutaProjectNode *prev;
162 AnjutaProjectNode *parent;
163 AnjutaProjectNode *children;
165 AnjutaProjectNodeType type;
166 AnjutaProjectNodeState state;
168 GList *properties_info;
169 GList *properties;
170 GFile *file;
171 gchar *name;
174 struct _AnjutaProjectNodeClass
176 GInitiallyUnownedClass parent_class;
178 void (*updated) (GError *error);
179 void (*loaded) (GError *error);
184 typedef gboolean (*AnjutaProjectNodeTraverseFunc) (AnjutaProjectNode *node, gpointer data);
186 * AnjutaProjectNodeForeachFunc:
187 * @data: (closure):
189 typedef void (*AnjutaProjectNodeForeachFunc) (AnjutaProjectNode *node, gpointer data);
192 GType anjuta_project_node_get_type (void) G_GNUC_CONST;
194 AnjutaProjectNode *anjuta_project_node_root (AnjutaProjectNode *node);
195 AnjutaProjectNode *anjuta_project_node_parent (AnjutaProjectNode *node);
196 AnjutaProjectNode *anjuta_project_node_first_child (AnjutaProjectNode *node);
197 AnjutaProjectNode *anjuta_project_node_last_child (AnjutaProjectNode *node);
198 AnjutaProjectNode *anjuta_project_node_next_sibling (AnjutaProjectNode *node);
199 AnjutaProjectNode *anjuta_project_node_prev_sibling (AnjutaProjectNode *node);
200 AnjutaProjectNode *anjuta_project_node_nth_child (AnjutaProjectNode *node, guint n);
201 AnjutaProjectNode *anjuta_project_node_parent_type (AnjutaProjectNode *node, AnjutaProjectNodeType type);
203 void anjuta_project_node_foreach (AnjutaProjectNode *node, GTraverseType order, AnjutaProjectNodeForeachFunc func, gpointer data);
204 void anjuta_project_node_children_foreach (AnjutaProjectNode *node, AnjutaProjectNodeForeachFunc func, gpointer data);
205 AnjutaProjectNode *anjuta_project_node_traverse (AnjutaProjectNode *node, GTraverseType order, AnjutaProjectNodeTraverseFunc func, gpointer data);
206 AnjutaProjectNode *anjuta_project_node_children_traverse (AnjutaProjectNode *node, AnjutaProjectNodeTraverseFunc func, gpointer data);
208 void anjuta_project_node_check (AnjutaProjectNode *parent);
209 void anjuta_project_node_dump (AnjutaProjectNode *parent);
211 AnjutaProjectNode *anjuta_project_node_insert_before (AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNode *node);
212 AnjutaProjectNode *anjuta_project_node_insert_after (AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNode *node);
213 AnjutaProjectNode *anjuta_project_node_remove (AnjutaProjectNode *node);
214 AnjutaProjectNode *anjuta_project_node_append (AnjutaProjectNode *parent, AnjutaProjectNode *node);
215 AnjutaProjectNode *anjuta_project_node_prepend (AnjutaProjectNode *parent, AnjutaProjectNode *node);
217 AnjutaProjectNodeType anjuta_project_node_get_node_type (const AnjutaProjectNode *node);
218 AnjutaProjectNodeType anjuta_project_node_get_full_type (const AnjutaProjectNode *node);
219 AnjutaProjectNodeState anjuta_project_node_get_state (const AnjutaProjectNode *node);
220 const gchar *anjuta_project_node_get_name (const AnjutaProjectNode *node);
221 GFile *anjuta_project_node_get_file (const AnjutaProjectNode *node);
223 GList *anjuta_project_node_get_properties_info (AnjutaProjectNode *node);
224 GList *anjuta_project_node_get_properties (AnjutaProjectNode *node);
225 AnjutaProjectPropertyInfo *anjuta_project_node_get_property_info (AnjutaProjectNode *node, const gchar *id);
226 AnjutaProjectProperty *anjuta_project_node_get_property (AnjutaProjectNode *node, const gchar *id);
227 AnjutaProjectProperty *anjuta_project_node_get_map_property (AnjutaProjectNode *node, const gchar *id, const gchar *name);
230 AnjutaProjectPropertyInfo *anjuta_project_node_insert_property_info (AnjutaProjectNode *node, AnjutaProjectPropertyInfo *info);
231 AnjutaProjectProperty *anjuta_project_node_insert_property (AnjutaProjectNode *node, AnjutaProjectPropertyInfo *info, AnjutaProjectProperty *property);
232 AnjutaProjectProperty *anjuta_project_node_remove_property (AnjutaProjectNode *node, AnjutaProjectProperty *property);
234 gboolean anjuta_project_node_set_state (AnjutaProjectNode *node, AnjutaProjectNodeState state);
235 gboolean anjuta_project_node_clear_state (AnjutaProjectNode *node, AnjutaProjectNodeState state);
237 AnjutaProjectNode *anjuta_project_node_get_group_from_file (const AnjutaProjectNode *root, GFile *directory);
238 AnjutaProjectNode *anjuta_project_target_get_node_from_name (const AnjutaProjectNode *parent, const gchar *name);
239 AnjutaProjectNode *anjuta_project_node_get_source_from_file (const AnjutaProjectNode *parent, GFile *file);
243 #define ANJUTA_TYPE_PROJECT_NODE_INFO (anjuta_project_node_info_get_type ())
245 typedef struct _AnjutaProjectNodeInfo AnjutaProjectNodeInfo;
247 struct _AnjutaProjectNodeInfo
249 AnjutaProjectNodeType type;
250 gchar *name;
251 gchar *mime_type;
252 gchar *property_help_id;
255 GType anjuta_project_node_info_get_type (void);
257 AnjutaProjectNodeInfo *anjuta_project_node_info_new (AnjutaProjectNodeType type, const gchar *name, const gchar *mime_type);
258 AnjutaProjectNodeInfo *anjuta_project_node_info_copy (AnjutaProjectNodeInfo *info);
259 void anjuta_project_node_info_free (AnjutaProjectNodeInfo *info);
261 const gchar *anjuta_project_node_info_name (const AnjutaProjectNodeInfo *info);
262 const gchar *anjuta_project_node_info_mime (const AnjutaProjectNodeInfo *info);
263 AnjutaProjectNodeType anjuta_project_node_info_type (const AnjutaProjectNodeInfo *info);
264 const gchar *anjuta_project_node_info_property_help_id (const AnjutaProjectNodeInfo *info);
266 G_END_DECLS
268 #endif