[anjuta] am-project: Move node common functions from amp-project to amp-node
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] am-project: Move node common functions from amp-project to amp-node
- Date: Fri, 31 Dec 2010 19:15:54 +0000 (UTC)
commit aa53ed4c80f2a3e7337bcf26730a678354fb134f
Author: Sébastien Granjoux <seb sfo free fr>
Date: Mon Dec 27 18:16:02 2010 +0100
am-project: Move node common functions from amp-project to amp-node
plugins/am-project/am-project.c | 757 +++---------------------------------
plugins/am-project/am-project.h | 12 +-
plugins/am-project/amp-group.c | 207 ++++++++++
plugins/am-project/amp-module.c | 168 ++++++++
plugins/am-project/amp-node.c | 161 ++++++++-
plugins/am-project/amp-node.h | 45 +++
plugins/am-project/amp-package.c | 132 +++++++
plugins/am-project/amp-source.c | 32 ++
plugins/am-project/amp-target.c | 34 ++-
plugins/am-project/command-queue.c | 9 +-
plugins/am-project/plugin.c | 2 +-
plugins/am-project/projectparser.c | 2 +-
12 files changed, 851 insertions(+), 710 deletions(-)
---
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 6f89ded..b1aac88 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -67,7 +67,7 @@
#define WARNING_PREFIX "WARNING("
#define MESSAGE_DELIMITER ": "
-static const gchar *valid_am_makefiles[] = {"GNUmakefile.am", "makefile.am", "Makefile.am", NULL};
+const gchar *valid_am_makefiles[] = {"GNUmakefile.am", "makefile.am", "Makefile.am", NULL};
#define STR_REPLACE(target, source) \
@@ -220,8 +220,11 @@ enum {
static GObject *parent_class;
+/* Helper functions
+ *---------------------------------------------------------------------------*/
+
/* Work even if file is not a descendant of parent */
-static gchar*
+gchar*
get_relative_path (GFile *parent, GFile *file)
{
gchar *relative;
@@ -269,7 +272,7 @@ get_relative_path (GFile *parent, GFile *file)
return relative;
}
-static GFileType
+GFileType
file_type (GFile *file, const gchar *filename)
{
GFile *child;
@@ -517,6 +520,17 @@ AnjutaToken*
amp_project_get_configure_token (AmpProject *project)
{
return project->configure_token;
+
+}
+
+AnjutaToken *
+amp_project_get_config_token (AmpProject *project, GFile *file)
+{
+ AmpConfigFile *config;
+
+ config = g_hash_table_lookup (project->configs, file);
+
+ return config != NULL ? config->token : NULL;
}
static void
@@ -654,139 +668,6 @@ find_canonical_target (AnjutaProjectNode *node, gpointer data)
* ---------------- Data structures managment
*/
-static void
-amp_dump_node (AnjutaProjectNode *g_node)
-{
- gchar *name = NULL;
-
- switch (anjuta_project_node_get_node_type (g_node)) {
- case ANJUTA_PROJECT_GROUP:
- name = g_file_get_uri (anjuta_project_node_get_file (g_node));
- DEBUG_PRINT ("GROUP: %s", name);
- break;
- case ANJUTA_PROJECT_TARGET:
- name = g_strdup (anjuta_project_node_get_name (g_node));
- DEBUG_PRINT ("TARGET: %s", name);
- break;
- case ANJUTA_PROJECT_SOURCE:
- name = g_file_get_uri (anjuta_project_node_get_file (g_node));
- DEBUG_PRINT ("SOURCE: %s", name);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- g_free (name);
-}
-
-static void
-foreach_node_destroy (AnjutaProjectNode *g_node,
- gpointer data)
-{
- switch (anjuta_project_node_get_node_type (g_node)) {
- case ANJUTA_PROJECT_GROUP:
- amp_group_node_free ((AmpGroupNode *)g_node);
- break;
- case ANJUTA_PROJECT_TARGET:
- amp_target_node_free ((AmpTargetNode *)g_node);
- break;
- case ANJUTA_PROJECT_SOURCE:
- amp_source_node_free ((AmpSourceNode *)g_node);
- break;
- case ANJUTA_PROJECT_MODULE:
- amp_module_node_free ((AmpModuleNode *)g_node);
- break;
- case ANJUTA_PROJECT_PACKAGE:
- amp_package_node_free ((AmpPackageNode *)g_node);
- break;
- case ANJUTA_PROJECT_ROOT:
- amp_project_clear ((AmpProject *)g_node);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-}
-
-static gboolean
-project_node_destroy (AmpProject *project, AnjutaProjectNode *g_node)
-{
- g_return_val_if_fail (project != NULL, FALSE);
- g_return_val_if_fail (AMP_IS_PROJECT (project), FALSE);
-
- if (g_node) {
- /* free each node's data first */
- foreach_node_destroy (g_node, project);
- //anjuta_project_node_foreach (g_node, G_POST_ORDER,
- // foreach_node_destroy, project);
-
- /* now destroy the tree itself */
- //g_node_destroy (g_node);
- }
-
- return TRUE;
-}
-
-static AnjutaProjectNode *
-project_node_new (AmpProject *project, AnjutaProjectNode *parent, AnjutaProjectNodeType type, GFile *file, const gchar *name, GError **error)
-{
- AnjutaProjectNode *node = NULL;
-
- switch (type & ANJUTA_PROJECT_TYPE_MASK) {
- case ANJUTA_PROJECT_GROUP:
- if ((file == NULL) && (name != NULL))
- {
- file = g_file_get_child (anjuta_project_node_get_file (parent), name);
- node = ANJUTA_PROJECT_NODE (amp_group_node_new (file, FALSE, error));
- g_object_unref (file);
- }
- else
- {
- node = ANJUTA_PROJECT_NODE (amp_group_node_new (file, FALSE, error));
- }
- break;
- case ANJUTA_PROJECT_TARGET:
- node = ANJUTA_PROJECT_NODE (amp_target_node_new (name, 0, NULL, 0, error));
- break;
- case ANJUTA_PROJECT_SOURCE:
- if (file == NULL)
- {
- /* Look for parent */
- if (anjuta_project_node_get_node_type (parent) == ANJUTA_PROJECT_TARGET)
- {
- parent = anjuta_project_node_parent (parent);
- }
- if (anjuta_project_node_get_node_type (parent) == ANJUTA_PROJECT_GROUP)
- {
- file = g_file_get_child (anjuta_project_node_get_file (parent), name);
- }
- else
- {
- file = g_file_new_for_commandline_arg (name);
- }
- node = ANJUTA_PROJECT_NODE (amp_source_node_new (file, error));
- g_object_unref (file);
- }
- else
- {
- node = ANJUTA_PROJECT_NODE (amp_source_node_new (file, error));
- }
- break;
- case ANJUTA_PROJECT_MODULE:
- node = ANJUTA_PROJECT_NODE (amp_module_node_new (name, error));
- break;
- case ANJUTA_PROJECT_PACKAGE:
- node = ANJUTA_PROJECT_NODE (amp_package_node_new (name, error));
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- if (node != NULL) node->type = type;
-
- return node;
-}
-
/* Save a node. If the node doesn't correspond to a file, get its parent until
* a file node is found and save it. The node returned correspond to the
* file node */
@@ -1186,7 +1067,7 @@ project_load_sources (AmpProject *project, AnjutaToken *name, AnjutaToken *list,
/* Create source */
src_file = g_file_get_child (parent_file, value);
- source = project_node_new (project, NULL, ANJUTA_PROJECT_SOURCE | ANJUTA_PROJECT_PROJECT, src_file, NULL, NULL);
+ source = amp_node_new (NULL, ANJUTA_PROJECT_SOURCE | ANJUTA_PROJECT_PROJECT, src_file, NULL, NULL);
g_object_unref (src_file);
amp_source_node_add_token (AMP_SOURCE_NODE (source), arg);
@@ -1266,7 +1147,7 @@ project_load_data (AmpProject *project, AnjutaToken *name, AnjutaToken *list, An
/* Create source */
src_file = g_file_get_child (parent_file, value);
- source = project_node_new (project, NULL, ANJUTA_PROJECT_SOURCE | ANJUTA_PROJECT_PROJECT, src_file, NULL, NULL);
+ source = amp_node_new (NULL, ANJUTA_PROJECT_SOURCE | ANJUTA_PROJECT_PROJECT, src_file, NULL, NULL);
g_object_unref (src_file);
amp_source_node_add_token (AMP_SOURCE_NODE(source), arg);
@@ -1385,112 +1266,6 @@ project_load_group_properties (AmpProject *project, AnjutaToken *token, AnjutaTo
return NULL;
}
-/* Find if pkg-config modules are used in group targets */
-static gboolean
-project_load_group_module (AmpProject *project, AmpGroupNode *group)
-{
- AnjutaProjectNode *target;
- AnjutaProjectProperty *prop;
- gchar **group_cpp = NULL;
-
- prop = amp_node_get_property_from_token (ANJUTA_PROJECT_NODE (group), AM_TOKEN__CPPFLAGS);
- if (prop && (prop->value != NULL)) group_cpp = g_strsplit_set (prop->value, " \t", 0);
-
- /* Check all targets */
- for (target = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (group)); target != NULL; target = anjuta_project_node_next_sibling (target))
- {
- gint type = anjuta_project_node_get_full_type (target) & (ANJUTA_PROJECT_ID_MASK | ANJUTA_PROJECT_TYPE_MASK);
- gchar **target_lib = NULL;
- gchar **target_cpp = NULL;
-
- prop = NULL;
- switch (type)
- {
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_PROGRAM:
- prop = amp_node_get_property_from_token (target, AM_TOKEN_TARGET_LDADD);
- break;
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_STATICLIB:
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SHAREDLIB:
- prop = amp_node_get_property_from_token (target, AM_TOKEN_TARGET_LIBADD);
- break;
- default:
- break;
- }
- if (prop && (prop->value != NULL)) target_lib = g_strsplit_set (prop->value, " \t", 0);
-
- /* Check if targets use libraries */
- if (target_lib != NULL)
- {
- AnjutaProjectNode *module;
-
- prop = amp_node_get_property_from_token (target, AM_TOKEN_TARGET_CPPFLAGS);
- if (prop && (prop->value != NULL)) target_cpp = g_strsplit_set (prop->value, " \t", 0);
-
- for (module = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (project)); module != NULL; module = anjuta_project_node_next_sibling (module))
- {
- if (anjuta_project_node_get_node_type (module) == ANJUTA_PROJECT_MODULE)
- {
- const gchar *name = anjuta_project_node_get_name (module);
- gchar *lib_flags = g_strconcat ("$(", name, "_LIBS)", NULL);
- gchar **flags;
-
- for (flags = target_lib; *flags != NULL; flags++)
- {
-
- if (strcmp (*flags, lib_flags) == 0)
- {
- gchar *cpp_flags = g_strconcat ("$(", name, "_CFLAGS)", NULL);
- gchar **cflags;
- gboolean found = FALSE;
-
- if (group_cpp != NULL)
- {
- for (cflags = group_cpp; *cflags != NULL; cflags++)
- {
- if (strcmp (*cflags, cpp_flags) == 0)
- {
- found = TRUE;
- break;
- }
- }
- }
- if ((target_cpp != NULL) && !found)
- {
- for (cflags = target_cpp; *cflags != NULL; cflags++)
- {
- if (strcmp (*cflags, cpp_flags) == 0)
- {
- found = TRUE;
- break;
- }
- }
- }
- if (found)
- {
- /* Add new module */
- AnjutaProjectNode *new_module;
-
- new_module = project_node_new (project, NULL, ANJUTA_PROJECT_MODULE, NULL, name, NULL);
- anjuta_project_node_append (target, new_module);
- }
- g_free (cpp_flags);
- }
- }
- g_free (lib_flags);
- }
- }
- g_strfreev (target_cpp);
- g_strfreev (target_lib);
- }
- }
- g_strfreev (group_cpp);
-
- return TRUE;
-}
-
-
-static AmpGroupNode* project_load_makefile (AmpProject *project, AmpGroupNode *group);
-
static gboolean
find_group (AnjutaProjectNode *node, gpointer data)
{
@@ -1540,7 +1315,8 @@ project_load_subdirs (AmpProject *project, AnjutaToken *list, AnjutaProjectNode
group = amp_group_node_new (subdir, dist_only, NULL);
g_hash_table_insert (project->groups, g_file_get_uri (subdir), group);
anjuta_project_node_append (parent, ANJUTA_PROJECT_NODE (group));
- group = project_load_makefile (project, group);
+
+ amp_node_load (AMP_NODE (group), NULL, project, NULL);
}
amp_group_node_add_token (group, arg, dist_only ? AM_GROUP_TOKEN_DIST_SUBDIRS : AM_GROUP_TOKEN_SUBDIRS);
g_object_unref (subdir);
@@ -1549,57 +1325,6 @@ project_load_subdirs (AmpProject *project, AnjutaToken *list, AnjutaProjectNode
}
}
-static AmpGroupNode*
-project_load_makefile (AmpProject *project, AmpGroupNode *group)
-{
- const gchar **filename;
- AnjutaTokenFile *tfile;
- GFile *makefile = NULL;
- GFile *file = anjuta_project_node_get_file ((AnjutaProjectNode *)group);
-
- /* Find makefile name
- * It has to be in the config_files list with .am extension */
- for (filename = valid_am_makefiles; *filename != NULL; filename++)
- {
- makefile = g_file_get_child (file, *filename);
- if (file_type (file, *filename) == G_FILE_TYPE_REGULAR)
- {
- gchar *final_filename = g_strdup (*filename);
- gchar *ptr;
- GFile *final_file;
- AmpConfigFile *config;
-
- ptr = g_strrstr (final_filename,".am");
- if (ptr != NULL) *ptr = '\0';
- final_file = g_file_get_child (file, final_filename);
- g_free (final_filename);
-
- config = g_hash_table_lookup (project->configs, final_file);
- g_object_unref (final_file);
- if (config != NULL)
- {
- amp_group_node_add_token (group, config->token, AM_GROUP_TOKEN_CONFIGURE);
- break;
- }
- }
- g_object_unref (makefile);
- }
-
- if (*filename == NULL)
- {
- /* Unable to find automake file */
- return group;
- }
-
- /* Parse makefile.am */
- DEBUG_PRINT ("Parse: %s", g_file_get_uri (makefile));
- tfile = amp_group_node_set_makefile (group, makefile, project);
-
- project_load_group_module (project, group);
-
- return group;
-}
-
void
amp_project_set_am_variable (AmpProject* project, AmpGroupNode* group, AnjutaTokenType variable, AnjutaToken *name, AnjutaToken *list, GHashTable *orphan_properties)
{
@@ -1763,30 +1488,8 @@ amp_project_update_node (AnjutaProjectNode *key, AnjutaProjectNode *value, GHash
if (new_node && new_node != node)
{
GList *properties;
-
- switch (anjuta_project_node_get_node_type (node))
- {
- case ANJUTA_PROJECT_GROUP:
- amp_group_node_update_node (AMP_GROUP_NODE (node), AMP_GROUP_NODE (new_node));
- break;
- case ANJUTA_PROJECT_TARGET:
- amp_target_node_update_node (AMP_TARGET_NODE (node), AMP_TARGET_NODE (new_node));
- break;
- case ANJUTA_PROJECT_SOURCE:
- amp_source_node_update_node (AMP_SOURCE_NODE (node), AMP_SOURCE_NODE (new_node));
- break;
- case ANJUTA_PROJECT_MODULE:
- amp_module_node_update_node (AMP_MODULE_NODE (node), AMP_MODULE_NODE (new_node));
- break;
- case ANJUTA_PROJECT_PACKAGE:
- amp_package_node_update_node (AMP_PACKAGE_NODE (node), AMP_PACKAGE_NODE (new_node));
- break;
- case ANJUTA_PROJECT_ROOT:
- amp_project_update_root (AMP_PROJECT (node), AMP_PROJECT (new_node));
- break;
- default:
- break;
- }
+
+ amp_node_update (AMP_NODE (node), AMP_NODE (new_node));
/* Swap custom properties */
properties = node->custom_properties;
@@ -1867,7 +1570,7 @@ amp_project_get_type_info (AmpProject *project, AnjutaProjectNodeType type)
return (AnjutaProjectNodeInfo *)info;
}
-static AnjutaProjectNode *
+static gboolean
amp_project_load_root (AmpProject *project, GError **error)
{
AmpAcScanner *scanner;
@@ -1904,7 +1607,7 @@ amp_project_load_root (AmpProject *project, GError **error)
IANJUTA_PROJECT_ERROR_DOESNT_EXIST,
_("Project doesn't exist or invalid path"));
- return NULL;
+ return FALSE;
}
/* Parse configure */
@@ -1920,161 +1623,24 @@ amp_project_load_root (AmpProject *project, GError **error)
IANJUTA_PROJECT_ERROR_PROJECT_MALFORMED,
err == NULL ? _("Unable to parse project file") : err->message);
if (err != NULL) g_error_free (err);
- return NULL;
+ return FALSE;
}
/* Load all makefiles recursively */
group = amp_group_node_new (root_file, FALSE, NULL);
g_hash_table_insert (project->groups, g_file_get_uri (root_file), group);
anjuta_project_node_append (ANJUTA_PROJECT_NODE (project), ANJUTA_PROJECT_NODE (group));
-
- if (project_load_makefile (project, group) == NULL)
- {
- g_set_error (error, IANJUTA_PROJECT_ERROR,
- IANJUTA_PROJECT_ERROR_DOESNT_EXIST,
- _("Project doesn't exist or invalid path"));
- return NULL;
- }
-
- return ANJUTA_PROJECT_NODE (project);
-}
-
-static void
-list_all_children (GList **children, GFile *dir)
-{
- GFileEnumerator *list;
-
- list = g_file_enumerate_children (dir,
- G_FILE_ATTRIBUTE_STANDARD_NAME,
- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
- NULL,
- NULL);
-
- if (list != NULL)
- {
- GFileInfo *info;
-
- while ((info = g_file_enumerator_next_file (list, NULL, NULL)) != NULL)
- {
- const gchar *name;
- GFile *file;
-
- name = g_file_info_get_name (info);
- file = g_file_get_child (dir, name);
- g_object_unref (info);
-
- if (g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY)
- {
- list_all_children (children, file);
- g_object_unref (file);
- }
- else
- {
- *children = g_list_prepend (*children, file);
- }
- }
- g_file_enumerator_close (list, NULL, NULL);
- g_object_unref (list);
- }
-}
-
-static AnjutaProjectNode *
-amp_project_load_package (AmpProject *project, AnjutaProjectNode *node, GError **error)
-{
- GList* deps;
- GList* dep;
- GList* include_dirs = NULL;
-
- deps = anjuta_pkg_config_list_dependencies (anjuta_project_node_get_name (node),
- error);
- for (dep = deps; dep != NULL; dep = g_list_next (dep))
- {
- /* Create a package node for the depedencies */
- AnjutaProjectNode *pkg;
-
- pkg = project_node_new (project, NULL, ANJUTA_PROJECT_PACKAGE, NULL, dep->data, NULL);
- anjuta_project_node_append (node, pkg);
- }
- anjuta_util_glist_strings_free (deps);
-
- if (*error != NULL)
- {
- g_warning ("Error getting dependencies: %s", (*error)->message);
- g_error_free (*error);
- *error = NULL;
- }
-
- if ((include_dirs = anjuta_pkg_config_get_directories (anjuta_project_node_get_name (node),
- TRUE, error)))
- {
- GList* include_dir;
-
- for (include_dir = include_dirs; include_dir != NULL; include_dir = g_list_next (include_dir))
- {
- GList* children = NULL;
- GList* file = NULL;
- GFile* dir = g_file_new_for_path (include_dir->data);
-
- list_all_children (&children, dir);
- for (file = g_list_first (children); file != NULL; file = g_list_next (file))
- {
- /* Create a source for files */
- AnjutaProjectNode *source;
-
- source = project_node_new (project, NULL, ANJUTA_PROJECT_SOURCE, (GFile *)file->data, NULL, NULL);
- anjuta_project_node_append (node, source);
- g_object_unref ((GObject *)file->data);
- }
- g_list_free (children);
- g_object_unref (dir);
- }
- }
- anjuta_util_glist_strings_free (include_dirs);
-
- return node;
-}
-
-static AmpGroupNode *
-amp_project_load_group (AmpProject *project, AmpGroupNode *group, GError **error)
-{
- if (project_load_makefile (project, group) == NULL)
+ if (!amp_node_load (AMP_NODE (group), NULL, project, NULL))
{
g_set_error (error, IANJUTA_PROJECT_ERROR,
IANJUTA_PROJECT_ERROR_DOESNT_EXIST,
_("Project doesn't exist or invalid path"));
- return NULL;
- }
-
- return group;
-}
-
-AnjutaProjectNode *
-amp_project_load_node (AmpProject *project, AnjutaProjectNode *node, AnjutaProjectNode *parent, GError **error)
-{
- AnjutaProjectNode *loaded = NULL;
- //GTimer *timer;
-
- //timer = g_timer_new ();
- switch (anjuta_project_node_get_node_type (node))
- {
- case ANJUTA_PROJECT_ROOT:
- loaded = amp_project_load_root (AMP_PROJECT (node), error);
- break;
- case ANJUTA_PROJECT_PACKAGE:
- loaded = amp_project_load_package (project, node, error);
- break;
- case ANJUTA_PROJECT_GROUP:
- loaded = ANJUTA_PROJECT_NODE (amp_project_load_group (project, AMP_GROUP_NODE (node), error));
- break;
- default:
- break;
+ return FALSE;
}
- //g_message ("Node %x loaded in %g", anjuta_project_node_get_node_type (node), g_timer_elapsed (timer, NULL));
- //g_timer_destroy (timer);
- return loaded;
+ return TRUE;
}
void
@@ -2420,55 +1986,6 @@ amp_project_get_source (AmpProject *project, const gchar *id)
}
gchar *
-amp_project_get_node_id (AmpProject *project, const gchar *path)
-{
- AnjutaProjectNode *node = NULL;
-
- if (path != NULL)
- {
- for (; *path != '\0';)
- {
- gchar *end;
- guint child = g_ascii_strtoull (path, &end, 10);
-
- if (end == path)
- {
- /* error */
- return NULL;
- }
-
- if (node == NULL)
- {
- if (child == 0) node = ANJUTA_PROJECT_NODE (project);
- }
- else
- {
- node = anjuta_project_node_nth_child (node, child);
- }
- if (node == NULL)
- {
- /* no node */
- return NULL;
- }
-
- if (*end == '\0') break;
- path = end + 1;
- }
- }
-
- switch (anjuta_project_node_get_node_type (node))
- {
- case ANJUTA_PROJECT_GROUP:
- return g_file_get_uri (anjuta_project_node_get_file (node));
- case ANJUTA_PROJECT_TARGET:
- case ANJUTA_PROJECT_SOURCE:
- return g_base64_encode ((guchar *)&node, sizeof (node));
- default:
- return NULL;
- }
-}
-
-gchar *
amp_project_get_uri (AmpProject *project)
{
g_return_val_if_fail (project != NULL, NULL);
@@ -2515,9 +2032,7 @@ amp_load_setup (PmJob *job)
static gboolean
amp_load_work (PmJob *job)
{
- job->proxy = amp_project_load_node (AMP_PROJECT (job->user_data), job->proxy, job->parent, &job->error);
-
- return job->proxy != NULL;
+ return amp_node_load (AMP_NODE (job->proxy), AMP_NODE (job->parent), AMP_PROJECT (job->user_data), &job->error);
}
static gboolean
@@ -2605,79 +2120,12 @@ amp_add_after_setup (PmJob *job)
static gboolean
amp_add_work (PmJob *job)
{
- switch (anjuta_project_node_get_node_type (job->node))
- {
- case ANJUTA_PROJECT_GROUP:
- amp_group_node_create_token (AMP_PROJECT (job->user_data), AMP_GROUP_NODE (job->node), &job->error);
- break;
- case ANJUTA_PROJECT_TARGET:
- amp_target_node_create_token (AMP_PROJECT (job->user_data), AMP_TARGET_NODE (job->node), &job->error);
- break;
- case ANJUTA_PROJECT_SOURCE:
- amp_source_node_create_token (AMP_PROJECT (job->user_data), AMP_SOURCE_NODE (job->node), &job->error);
- break;
- case ANJUTA_PROJECT_MODULE:
- if ((job->parent != NULL) && (anjuta_project_node_get_node_type (job->parent) == ANJUTA_PROJECT_TARGET))
- {
- AnjutaProjectNode *group = anjuta_project_node_parent (job->parent);
- AnjutaProjectProperty *group_cpp;
- AnjutaProjectProperty *target_cpp;
- AnjutaProjectProperty *target_lib;
- gchar *lib_flags;
- gchar *cpp_flags;
- gint type;
-
- group_cpp = amp_node_get_property_from_token (group, AM_TOKEN__CPPFLAGS);
-
- type = anjuta_project_node_get_full_type (job->parent) & (ANJUTA_PROJECT_ID_MASK | ANJUTA_PROJECT_TYPE_MASK);
- switch (type)
- {
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_PROGRAM:
- target_lib = amp_node_get_property_from_token (job->parent, AM_TOKEN_TARGET_LDADD);
- break;
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_STATICLIB:
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SHAREDLIB:
- target_lib = amp_node_get_property_from_token (job->parent, AM_TOKEN_TARGET_LIBADD);
- break;
- default:
- break;
- }
- target_cpp = amp_node_get_property_from_token (job->parent, AM_TOKEN_TARGET_CPPFLAGS);
+ AmpNode *parent = AMP_NODE (job->parent);
+ gboolean ok;
- lib_flags = g_strconcat ("$(", anjuta_project_node_get_name (job->node), "_LIBS)", NULL);
- cpp_flags = g_strconcat ("$(", anjuta_project_node_get_name (job->node), "_CFLAGS)", NULL);
-
- if (!amp_node_property_has_flags (group, group_cpp, cpp_flags) && !amp_node_property_has_flags (job->parent, target_cpp, cpp_flags))
- {
- AnjutaProjectProperty *prop;
- prop = amp_node_property_add_flags (group, group_cpp, cpp_flags);
- amp_project_update_am_property (AMP_PROJECT (job->user_data), group, prop);
- }
-
- if (!amp_node_property_has_flags (job->parent, target_lib, lib_flags))
- {
- AnjutaProjectProperty *prop;
- prop = amp_node_property_add_flags (job->parent, target_lib, lib_flags);
- amp_project_update_am_property (AMP_PROJECT (job->user_data), job->parent, prop);
- }
-
- g_free (lib_flags);
- g_free (cpp_flags);
- pm_job_set_parent (job, group);
- }
- else
- {
- amp_module_node_create_token (AMP_PROJECT (job->user_data), AMP_MODULE_NODE (job->node), &job->error);
- }
- break;
- case ANJUTA_PROJECT_PACKAGE:
- amp_package_node_create_token (AMP_PROJECT (job->user_data), AMP_PACKAGE_NODE (job->node), &job->error);
- break;
- default:
- break;
- }
+ ok = amp_node_write (AMP_NODE (job->node), parent, AMP_PROJECT (job->user_data), &job->error);
- return TRUE;
+ return ok;
}
static gboolean
@@ -2708,105 +2156,12 @@ amp_remove_setup (PmJob *job)
static gboolean
amp_remove_work (PmJob *job)
{
- switch (anjuta_project_node_get_node_type (job->node))
- {
- case ANJUTA_PROJECT_GROUP:
- amp_group_node_delete_token (AMP_PROJECT (job->user_data), AMP_GROUP_NODE (job->node), &job->error);
- break;
- case ANJUTA_PROJECT_TARGET:
- amp_target_node_delete_token (AMP_PROJECT (job->user_data), AMP_TARGET_NODE (job->node), &job->error);
- break;
- case ANJUTA_PROJECT_SOURCE:
- amp_source_node_delete_token (AMP_PROJECT (job->user_data), AMP_SOURCE_NODE (job->node), &job->error);
- break;
- case ANJUTA_PROJECT_MODULE:
- if ((job->parent != NULL) && (anjuta_project_node_get_node_type (job->parent) == ANJUTA_PROJECT_TARGET))
- {
- AnjutaProjectNode *group = anjuta_project_node_parent (job->parent);
- AnjutaProjectProperty *prop;
- AnjutaProjectProperty *group_cpp;
- AnjutaProjectProperty *target_cpp;
- AnjutaProjectProperty *target_lib;
- gchar *lib_flags;
- gchar *cpp_flags;
- gint type;
-
- lib_flags = g_strconcat ("$(", anjuta_project_node_get_name (job->node), "_LIBS)", NULL);
- cpp_flags = g_strconcat ("$(", anjuta_project_node_get_name (job->node), "_CFLAGS)", NULL);
-
- group_cpp = amp_node_get_property_from_token (group, AM_TOKEN__CPPFLAGS);
- if (amp_node_property_has_flags (group, group_cpp, cpp_flags))
- {
- /* Remove flags in group variable if not more target has this module */
- gboolean used = FALSE;
- AnjutaProjectNode *target;
-
- for (target = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (group)); target != NULL; target = anjuta_project_node_next_sibling (target))
- {
- if (anjuta_project_node_get_node_type (target) == ANJUTA_PROJECT_TARGET)
- {
- AnjutaProjectNode *module;
-
- for (module = anjuta_project_node_first_child (target); module != NULL; module = anjuta_project_node_next_sibling (module))
- {
- if ((anjuta_project_node_get_node_type (module) == ANJUTA_PROJECT_MODULE) &&
- (module != job->node) &&
- (strcmp (anjuta_project_node_get_name (module), anjuta_project_node_get_name (job->node)) == 0))
- {
- used = TRUE;
- break;
- }
- }
- }
- if (used) break;
- }
+ AmpNode *parent = AMP_NODE (job->parent);
+ gboolean ok;
- if (!used)
- {
- AnjutaProjectProperty *prop;
+ ok = amp_node_erase (AMP_NODE (job->node), parent, AMP_PROJECT (job->user_data), &job->error);
- prop = amp_node_property_remove_flags (group, group_cpp, cpp_flags);
- if (prop != NULL) amp_project_update_am_property (AMP_PROJECT (job->user_data), group, prop);
- }
- }
-
- type = anjuta_project_node_get_full_type (job->parent) & (ANJUTA_PROJECT_ID_MASK | ANJUTA_PROJECT_TYPE_MASK);
- switch (type)
- {
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_PROGRAM:
- target_lib = amp_node_get_property_from_token (job->parent, AM_TOKEN_TARGET_LDADD);
- break;
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_STATICLIB:
- case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SHAREDLIB:
- target_lib = amp_node_get_property_from_token (job->parent, AM_TOKEN_TARGET_LIBADD);
- break;
- default:
- break;
- }
- target_cpp = amp_node_get_property_from_token (job->parent, AM_TOKEN_TARGET_CPPFLAGS);
-
- prop = amp_node_property_remove_flags (job->parent, target_cpp, cpp_flags);
- if (prop != NULL) amp_project_update_am_property (AMP_PROJECT (job->user_data), job->parent, prop);
- prop = amp_node_property_remove_flags (job->parent, target_lib, lib_flags);
- if (prop != NULL) amp_project_update_am_property (AMP_PROJECT (job->user_data), job->parent, prop);
-
- g_free (lib_flags);
- g_free (cpp_flags);
- pm_job_set_parent (job, group);
- }
- else
- {
- amp_module_node_delete_token (AMP_PROJECT (job->user_data), AMP_MODULE_NODE (job->node), &job->error);
- }
- break;
- case ANJUTA_PROJECT_PACKAGE:
- amp_package_node_delete_token (AMP_PROJECT (job->user_data), AMP_PACKAGE_NODE (job->node), &job->error);
- break;
- default:
- break;
- }
-
- return TRUE;
+ return ok;
}
static gboolean
@@ -2943,7 +2298,7 @@ iproject_add_node_before (IAnjutaProject *obj, AnjutaProjectNode *parent, Anjuta
if (AMP_PROJECT (obj)->queue == NULL) AMP_PROJECT (obj)->queue = pm_command_queue_new ();
- node = project_node_new (AMP_PROJECT (obj), parent, type, file, name, err);
+ node = amp_node_new (parent, type, file, name, err);
if (node != NULL)
{
add_job = pm_job_new (&_add_before_job, node, parent, sibling, ANJUTA_PROJECT_UNKNOWN, NULL, NULL, obj);
@@ -2961,7 +2316,7 @@ iproject_add_node_after (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaP
if (AMP_PROJECT (obj)->queue == NULL) AMP_PROJECT (obj)->queue = pm_command_queue_new ();
- node = project_node_new (AMP_PROJECT (obj), parent, type, file, name, err);
+ node = amp_node_new (parent, type, file, name, err);
if (node != NULL)
{
add_job = pm_job_new (&_add_after_job, node, parent, sibling, ANJUTA_PROJECT_UNKNOWN, NULL, NULL, obj);
@@ -3047,10 +2402,25 @@ iproject_iface_init(IAnjutaProjectIface* iface)
iface->is_loaded = iproject_is_loaded;
}
-/* Group access functions
+/* AmpNode implementation
*---------------------------------------------------------------------------*/
-/* GbfProject implementation
+static gboolean
+amp_project_load (AmpNode *root, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_project_load_root (AMP_PROJECT (root), error);
+}
+
+static gboolean
+amp_project_update (AmpNode *node, AmpNode *new_node)
+{
+ amp_project_update_root (AMP_PROJECT (node), AMP_PROJECT (new_node));
+
+ return TRUE;
+}
+
+
+/* GObject implementation
*---------------------------------------------------------------------------*/
static void
@@ -3110,11 +2480,16 @@ static void
amp_project_class_init (AmpProjectClass *klass)
{
GObjectClass *object_class;
+ AmpNodeClass *node_class;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->dispose = amp_project_dispose;
+
+ node_class = AMP_NODE_CLASS (klass);
+ node_class->load = amp_project_load;
+ node_class->update = amp_project_update;
}
static void
@@ -3130,14 +2505,8 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (AmpProject,
iproject_iface_init));
void
-amp_project_register_project (GTypeModule *module)
+amp_project_register (GTypeModule *module)
{
amp_node_register (module);
- amp_root_node_register (module);
- amp_module_node_register (module);
- amp_package_node_register (module);
- amp_group_node_register (module);
- amp_target_node_register (module);
- amp_source_node_register (module);
amp_project_register_type (module);
}
diff --git a/plugins/am-project/am-project.h b/plugins/am-project/am-project.h
index 532e71d..dadf64c 100644
--- a/plugins/am-project/am-project.h
+++ b/plugins/am-project/am-project.h
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
#define AMP_IS_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMP_TYPE_PROJECT))
#define AMP_IS_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), AMP_TYPE_PROJECT))
-typedef struct _AmpProject AmpProject;
+
typedef struct _AmpProjectClass AmpProjectClass;
typedef struct _AmpModuleNode AmpModuleNode;
@@ -57,12 +57,10 @@ typedef struct _AmpProperty AmpProperty;
GType amp_project_get_type (void);
AmpProject *amp_project_new (GFile *file, GError **error);
-void amp_project_register_project (GTypeModule *module);
+void amp_project_register (GTypeModule *module);
gint amp_project_probe (GFile *directory, GError **error);
-gboolean amp_project_load (AmpProject *project, GFile *directory, GError **error);
-AnjutaProjectNode *amp_project_load_node (AmpProject *project, AnjutaProjectNode *node, AnjutaProjectNode *parent, GError **error);
void amp_project_unload (AmpProject *project);
gboolean amp_project_is_loaded (AmpProject *project);
@@ -71,6 +69,8 @@ void amp_project_load_config (AmpProject *project, AnjutaToken *arg_list);
void amp_project_load_properties (AmpProject *project, AnjutaToken *macro, AnjutaToken *list);
void amp_project_load_module (AmpProject *project, AnjutaToken *module);
+AnjutaToken *amp_project_get_config_token (AmpProject *project, GFile *file);
+
AnjutaTokenFile* amp_project_set_configure (AmpProject *project, GFile *configure);
gboolean amp_project_update_configure (AmpProject *project, AnjutaToken *token);
AnjutaToken* amp_project_get_configure_token (AmpProject *project);
@@ -114,8 +114,6 @@ GList *amp_project_get_config_packages (AmpProject *project, const gchar* modul
GList *amp_project_get_target_types (AmpProject *project, GError **error);
-gchar * amp_project_get_node_id (AmpProject *project, const gchar *path);
-
AnjutaProjectNode *amp_node_parent (AnjutaProjectNode *node);
AnjutaProjectNode *amp_node_first_child (AnjutaProjectNode *node);
AnjutaProjectNode *amp_node_last_child (AnjutaProjectNode *node);
@@ -136,6 +134,8 @@ gchar *amp_source_node_get_id (AmpSourceNode *source);
GFile *amp_source_node_get_file (AmpSourceNode *source);
gchar* canonicalize_automake_variable (const gchar *name);
+gchar* get_relative_path (GFile *parent, GFile *file);
+GFileType file_type (GFile *file, const gchar *filename);
diff --git a/plugins/am-project/amp-group.c b/plugins/am-project/amp-group.c
index 718b9b7..d9a4f12 100644
--- a/plugins/am-project/amp-group.c
+++ b/plugins/am-project/amp-group.c
@@ -29,6 +29,7 @@
#include "amp-node.h"
#include "am-scanner.h"
#include "am-properties.h"
+#include "am-writer.h"
#include <libanjuta/interfaces/ianjuta-project.h>
@@ -81,6 +82,166 @@ error_set (GError **error, gint code, const gchar *message)
}
}
+/* Private functions
+ *---------------------------------------------------------------------------*/
+
+/* Find if pkg-config modules are used in group targets */
+static gboolean
+project_load_group_module (AmpProject *project, AmpGroupNode *group)
+{
+ AnjutaProjectNode *target;
+ AnjutaProjectProperty *prop;
+ gchar **group_cpp = NULL;
+
+ prop = amp_node_get_property_from_token (ANJUTA_PROJECT_NODE (group), AM_TOKEN__CPPFLAGS);
+ if (prop && (prop->value != NULL)) group_cpp = g_strsplit_set (prop->value, " \t", 0);
+
+ /* Check all targets */
+ for (target = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (group)); target != NULL; target = anjuta_project_node_next_sibling (target))
+ {
+ gint type = anjuta_project_node_get_full_type (target) & (ANJUTA_PROJECT_ID_MASK | ANJUTA_PROJECT_TYPE_MASK);
+ gchar **target_lib = NULL;
+ gchar **target_cpp = NULL;
+
+ prop = NULL;
+ switch (type)
+ {
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_PROGRAM:
+ prop = amp_node_get_property_from_token (target, AM_TOKEN_TARGET_LDADD);
+ break;
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_STATICLIB:
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SHAREDLIB:
+ prop = amp_node_get_property_from_token (target, AM_TOKEN_TARGET_LIBADD);
+ break;
+ default:
+ break;
+ }
+ if (prop && (prop->value != NULL)) target_lib = g_strsplit_set (prop->value, " \t", 0);
+
+ /* Check if targets use libraries */
+ if (target_lib != NULL)
+ {
+ AnjutaProjectNode *module;
+
+ prop = amp_node_get_property_from_token (target, AM_TOKEN_TARGET_CPPFLAGS);
+ if (prop && (prop->value != NULL)) target_cpp = g_strsplit_set (prop->value, " \t", 0);
+
+ for (module = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (project)); module != NULL; module = anjuta_project_node_next_sibling (module))
+ {
+ if (anjuta_project_node_get_node_type (module) == ANJUTA_PROJECT_MODULE)
+ {
+ const gchar *name = anjuta_project_node_get_name (module);
+ gchar *lib_flags = g_strconcat ("$(", name, "_LIBS)", NULL);
+ gchar **flags;
+
+ for (flags = target_lib; *flags != NULL; flags++)
+ {
+
+ if (strcmp (*flags, lib_flags) == 0)
+ {
+ gchar *cpp_flags = g_strconcat ("$(", name, "_CFLAGS)", NULL);
+ gchar **cflags;
+ gboolean found = FALSE;
+
+ if (group_cpp != NULL)
+ {
+ for (cflags = group_cpp; *cflags != NULL; cflags++)
+ {
+ if (strcmp (*cflags, cpp_flags) == 0)
+ {
+ found = TRUE;
+ break;
+ }
+ }
+ }
+ if ((target_cpp != NULL) && !found)
+ {
+ for (cflags = target_cpp; *cflags != NULL; cflags++)
+ {
+ if (strcmp (*cflags, cpp_flags) == 0)
+ {
+ found = TRUE;
+ break;
+ }
+ }
+ }
+ if (found)
+ {
+ /* Add new module */
+ AnjutaProjectNode *new_module;
+
+ new_module = amp_node_new (NULL, ANJUTA_PROJECT_MODULE, NULL, name, NULL);
+ anjuta_project_node_append (target, new_module);
+ }
+ g_free (cpp_flags);
+ }
+ }
+ g_free (lib_flags);
+ }
+ }
+ g_strfreev (target_cpp);
+ g_strfreev (target_lib);
+ }
+ }
+ g_strfreev (group_cpp);
+
+ return TRUE;
+}
+
+
+extern const gchar *valid_am_makefiles[];
+
+static AmpGroupNode*
+project_load_makefile (AmpProject *project, AmpGroupNode *group)
+{
+ const gchar **filename;
+ AnjutaTokenFile *tfile;
+ GFile *makefile = NULL;
+ GFile *file = anjuta_project_node_get_file ((AnjutaProjectNode *)group);
+
+ /* Find makefile name
+ * It has to be in the config_files list with .am extension */
+ for (filename = valid_am_makefiles; *filename != NULL; filename++)
+ {
+ makefile = g_file_get_child (file, *filename);
+ if (file_type (file, *filename) == G_FILE_TYPE_REGULAR)
+ {
+ gchar *final_filename = g_strdup (*filename);
+ gchar *ptr;
+ GFile *final_file;
+ AnjutaToken *token;
+
+ ptr = g_strrstr (final_filename,".am");
+ if (ptr != NULL) *ptr = '\0';
+ final_file = g_file_get_child (file, final_filename);
+ g_free (final_filename);
+
+ token = amp_project_get_config_token (project, final_file);
+ g_object_unref (final_file);
+ if (token != NULL)
+ {
+ amp_group_node_add_token (group, token, AM_GROUP_TOKEN_CONFIGURE);
+ break;
+ }
+ }
+ g_object_unref (makefile);
+ }
+
+ if (*filename == NULL)
+ {
+ /* Unable to find automake file */
+ return group;
+ }
+
+ /* Parse makefile.am */
+ DEBUG_PRINT ("Parse: %s", g_file_get_uri (makefile));
+ tfile = amp_group_node_set_makefile (group, makefile, project);
+
+ project_load_group_module (project, group);
+
+ return group;
+}
+
/* Variable object
*---------------------------------------------------------------------------*/
@@ -397,6 +558,45 @@ amp_group_node_free (AmpGroupNode *node)
g_object_unref (G_OBJECT (node));
}
+/* AmpNode implementation
+ *---------------------------------------------------------------------------*/
+
+static gboolean
+amp_group_node_load (AmpNode *group, AmpNode *parent, AmpProject *project, GError **error)
+{
+ if (project_load_makefile (project, AMP_GROUP_NODE (group)) == NULL)
+ {
+ g_set_error (error, IANJUTA_PROJECT_ERROR,
+ IANJUTA_PROJECT_ERROR_DOESNT_EXIST,
+ _("Project doesn't exist or invalid path"));
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean
+amp_group_node_update (AmpNode *node, AmpNode *new_node)
+{
+ amp_group_node_update_node (AMP_GROUP_NODE (node), AMP_GROUP_NODE (new_node));
+
+ return TRUE;
+}
+
+static gboolean
+amp_group_node_write (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_group_node_create_token (project, AMP_GROUP_NODE (node), error);
+}
+
+static gboolean
+amp_group_node_erase (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_group_node_delete_token (project, AMP_GROUP_NODE (node), error);
+}
+
+
/* GObjet implementation
*---------------------------------------------------------------------------*/
@@ -462,9 +662,16 @@ static void
amp_group_node_class_init (AmpGroupNodeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ AmpNodeClass* node_class;
object_class->finalize = amp_group_node_finalize;
object_class->dispose = amp_group_node_dispose;
+
+ node_class = AMP_NODE_CLASS (klass);
+ node_class->load = amp_group_node_load;
+ node_class->update = amp_group_node_update;
+ node_class->write = amp_group_node_write;
+ node_class->erase = amp_group_node_erase;
}
static void
diff --git a/plugins/am-project/amp-module.c b/plugins/am-project/amp-module.c
index 2cebc68..50737ff 100644
--- a/plugins/am-project/amp-module.c
+++ b/plugins/am-project/amp-module.c
@@ -29,6 +29,8 @@
#include "amp-node.h"
#include "am-scanner.h"
#include "am-properties.h"
+#include "ac-writer.h"
+#include "am-writer.h"
#include <libanjuta/interfaces/ianjuta-project.h>
@@ -97,6 +99,166 @@ amp_module_node_free (AmpModuleNode *node)
}
+
+/* AmpNode implementation
+ *---------------------------------------------------------------------------*/
+
+static gboolean
+amp_module_node_update (AmpNode *node, AmpNode *new_node)
+{
+ AMP_MODULE_NODE(node)->module = AMP_MODULE_NODE(new_node)->module;
+
+ return TRUE;
+}
+
+static gboolean
+amp_module_node_write (AmpNode *node, AmpNode *amp_parent, AmpProject *project, GError **error)
+{
+ AnjutaProjectNode *parent = ANJUTA_PROJECT_NODE (amp_parent);
+
+ if ((parent != NULL) && (anjuta_project_node_get_node_type (parent) == ANJUTA_PROJECT_TARGET))
+ {
+ AnjutaProjectNode *group = anjuta_project_node_parent (parent);
+ AnjutaProjectProperty *group_cpp;
+ AnjutaProjectProperty *target_cpp;
+ AnjutaProjectProperty *target_lib;
+ gchar *lib_flags;
+ gchar *cpp_flags;
+ gint type;
+
+ group_cpp = amp_node_get_property_from_token (group, AM_TOKEN__CPPFLAGS);
+
+ type = anjuta_project_node_get_full_type (parent) & (ANJUTA_PROJECT_ID_MASK | ANJUTA_PROJECT_TYPE_MASK);
+ switch (type)
+ {
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_PROGRAM:
+ target_lib = amp_node_get_property_from_token (parent, AM_TOKEN_TARGET_LDADD);
+ break;
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_STATICLIB:
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SHAREDLIB:
+ target_lib = amp_node_get_property_from_token (parent, AM_TOKEN_TARGET_LIBADD);
+ break;
+ default:
+ break;
+ }
+ target_cpp = amp_node_get_property_from_token (parent, AM_TOKEN_TARGET_CPPFLAGS);
+
+ lib_flags = g_strconcat ("$(", anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node)), "_LIBS)", NULL);
+ cpp_flags = g_strconcat ("$(", anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node)), "_CFLAGS)", NULL);
+
+ if (!amp_node_property_has_flags (group, group_cpp, cpp_flags) && !amp_node_property_has_flags (ANJUTA_PROJECT_NODE (parent), target_cpp, cpp_flags))
+ {
+ AnjutaProjectProperty *prop;
+ prop = amp_node_property_add_flags (group, group_cpp, cpp_flags);
+ amp_project_update_am_property (project, group, prop);
+ }
+
+ if (!amp_node_property_has_flags (parent, target_lib, lib_flags))
+ {
+ AnjutaProjectProperty *prop;
+ prop = amp_node_property_add_flags (parent, target_lib, lib_flags);
+ amp_project_update_am_property (project, parent, prop);
+ }
+
+ g_free (lib_flags);
+ g_free (cpp_flags);
+
+ return TRUE;
+ }
+ else
+ {
+ return amp_module_node_create_token (project, AMP_MODULE_NODE (node), error);
+ }
+}
+
+static gboolean
+amp_module_node_erase (AmpNode *node, AmpNode *amp_parent, AmpProject *project, GError **error)
+{
+ AnjutaProjectNode *parent = ANJUTA_PROJECT_NODE (amp_parent);
+
+ if ((parent != NULL) && (anjuta_project_node_get_node_type (parent) == ANJUTA_PROJECT_TARGET))
+ {
+ AnjutaProjectNode *group = anjuta_project_node_parent (parent);
+ AnjutaProjectProperty *prop;
+ AnjutaProjectProperty *group_cpp;
+ AnjutaProjectProperty *target_cpp;
+ AnjutaProjectProperty *target_lib;
+ gchar *lib_flags;
+ gchar *cpp_flags;
+ gint type;
+
+ lib_flags = g_strconcat ("$(", anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node)), "_LIBS)", NULL);
+ cpp_flags = g_strconcat ("$(", anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node)), "_CFLAGS)", NULL);
+
+ group_cpp = amp_node_get_property_from_token (group, AM_TOKEN__CPPFLAGS);
+ if (amp_node_property_has_flags (group, group_cpp, cpp_flags))
+ {
+ /* Remove flags in group variable if not more target has this module */
+ gboolean used = FALSE;
+ AnjutaProjectNode *target;
+
+ for (target = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (group)); target != NULL; target = anjuta_project_node_next_sibling (target))
+ {
+ if (anjuta_project_node_get_node_type (target) == ANJUTA_PROJECT_TARGET)
+ {
+ AnjutaProjectNode *module;
+
+ for (module = anjuta_project_node_first_child (target); module != NULL; module = anjuta_project_node_next_sibling (module))
+ {
+ if ((anjuta_project_node_get_node_type (module) == ANJUTA_PROJECT_MODULE) &&
+ (module != ANJUTA_PROJECT_NODE (node)) &&
+ (strcmp (anjuta_project_node_get_name (module), anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node))) == 0))
+ {
+ used = TRUE;
+ break;
+ }
+ }
+ }
+ if (used) break;
+ }
+
+ if (!used)
+ {
+ AnjutaProjectProperty *prop;
+
+ prop = amp_node_property_remove_flags (group, group_cpp, cpp_flags);
+ if (prop != NULL) amp_project_update_am_property (project, group, prop);
+ }
+ }
+
+ type = anjuta_project_node_get_full_type (ANJUTA_PROJECT_NODE (node)) & (ANJUTA_PROJECT_ID_MASK | ANJUTA_PROJECT_TYPE_MASK);
+ switch (type)
+ {
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_PROGRAM:
+ target_lib = amp_node_get_property_from_token (parent, AM_TOKEN_TARGET_LDADD);
+ break;
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_STATICLIB:
+ case ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SHAREDLIB:
+ target_lib = amp_node_get_property_from_token (parent, AM_TOKEN_TARGET_LIBADD);
+ break;
+ default:
+ break;
+ }
+ target_cpp = amp_node_get_property_from_token (parent, AM_TOKEN_TARGET_CPPFLAGS);
+
+ prop = amp_node_property_remove_flags (parent, target_cpp, cpp_flags);
+ if (prop != NULL) amp_project_update_am_property (project, parent, prop);
+ prop = amp_node_property_remove_flags (parent, target_lib, lib_flags);
+ if (prop != NULL) amp_project_update_am_property (project, parent, prop);
+
+ g_free (lib_flags);
+ g_free (cpp_flags);
+
+ return TRUE;
+ }
+ else
+ {
+ return amp_module_node_delete_token (project, AMP_MODULE_NODE (node), error);
+ }
+}
+
+
+
/* GObjet implementation
*---------------------------------------------------------------------------*/
@@ -132,8 +294,14 @@ static void
amp_module_node_class_init (AmpModuleNodeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ AmpNodeClass* node_class;
object_class->finalize = amp_module_node_finalize;
+
+ node_class = AMP_NODE_CLASS (klass);
+ node_class->update = amp_module_node_update;
+ node_class->erase = amp_module_node_erase;
+ node_class->write = amp_module_node_write;
}
static void
diff --git a/plugins/am-project/amp-node.c b/plugins/am-project/amp-node.c
index 36fa3f7..6e1e78d 100644
--- a/plugins/am-project/amp-node.c
+++ b/plugins/am-project/amp-node.c
@@ -25,11 +25,13 @@
#endif
#include "amp-node.h"
-#include "am-scanner.h"
-#include "am-properties.h"
-
-#include <libanjuta/interfaces/ianjuta-project.h>
+#include "amp-root.h"
+#include "amp-module.h"
+#include "amp-package.h"
+#include "amp-group.h"
+#include "amp-target.h"
+#include "amp-source.h"
#include <libanjuta/anjuta-debug.h>
@@ -40,6 +42,142 @@
#include <ctype.h>
+/* Public functions
+ *---------------------------------------------------------------------------*/
+
+AnjutaProjectNode *
+amp_node_new (AnjutaProjectNode *parent, AnjutaProjectNodeType type, GFile *file, const gchar *name, GError **error)
+{
+ AnjutaProjectNode *node = NULL;
+ GFile *new_file = NULL;
+
+ switch (type & ANJUTA_PROJECT_TYPE_MASK) {
+ case ANJUTA_PROJECT_GROUP:
+ if ((file == NULL) && (name != NULL))
+ {
+ new_file = g_file_get_child (anjuta_project_node_get_file (parent), name);
+ file = new_file;
+ }
+ node = ANJUTA_PROJECT_NODE (amp_group_node_new (file, FALSE, error));
+ break;
+ case ANJUTA_PROJECT_TARGET:
+ node = ANJUTA_PROJECT_NODE (amp_target_node_new (name, 0, NULL, 0, error));
+ break;
+ case ANJUTA_PROJECT_SOURCE:
+ if ((file == NULL) && (name != NULL))
+ {
+ /* Look for parent */
+ if (anjuta_project_node_get_node_type (parent) == ANJUTA_PROJECT_TARGET)
+ {
+ parent = anjuta_project_node_parent (parent);
+ }
+ if (anjuta_project_node_get_node_type (parent) == ANJUTA_PROJECT_GROUP)
+ {
+ new_file = g_file_get_child (anjuta_project_node_get_file (parent), name);
+ }
+ else
+ {
+ new_file = g_file_new_for_commandline_arg (name);
+ }
+ file = new_file;
+ }
+ node = ANJUTA_PROJECT_NODE (amp_source_node_new (file, error));
+ break;
+ case ANJUTA_PROJECT_MODULE:
+ node = ANJUTA_PROJECT_NODE (amp_module_node_new (name, error));
+ break;
+ case ANJUTA_PROJECT_PACKAGE:
+ node = ANJUTA_PROJECT_NODE (amp_package_node_new (name, error));
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ if (node != NULL) node->type = type;
+ if (new_file != NULL) g_object_unref (new_file);
+
+ return node;
+}
+
+gboolean
+amp_node_load (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error)
+{
+ g_return_val_if_fail (AMP_IS_NODE (node), FALSE);
+
+ return AMP_NODE_GET_CLASS (node)->load (node, parent, project, error);
+}
+
+gboolean
+amp_node_update (AmpNode *node,
+ AmpNode *new_node)
+{
+ g_return_val_if_fail (AMP_IS_NODE (node), FALSE);
+
+ return AMP_NODE_GET_CLASS (node)->update (node, new_node);
+}
+
+gboolean
+amp_node_write (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error)
+{
+ g_return_val_if_fail (AMP_IS_NODE (node), FALSE);
+
+ return AMP_NODE_GET_CLASS (node)->write (node, parent, project, error);
+}
+
+gboolean
+amp_node_erase (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error)
+{
+ g_return_val_if_fail (AMP_IS_NODE (node), FALSE);
+
+ return AMP_NODE_GET_CLASS (node)->erase (node, parent, project, error);
+}
+
+/* AmpNode implementation
+ *---------------------------------------------------------------------------*/
+
+static gboolean
+amp_node_real_load (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error)
+{
+ return FALSE;
+}
+
+static gboolean
+amp_node_real_update (AmpNode *node,
+ AmpNode *new_node)
+{
+ return FALSE;
+}
+
+static gboolean
+amp_node_real_write (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error)
+{
+ return FALSE;
+}
+
+static gboolean
+amp_node_real_erase (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error)
+{
+ return FALSE;
+}
+
/* GObjet implementation
*---------------------------------------------------------------------------*/
@@ -67,6 +205,11 @@ amp_node_class_init (AmpNodeClass *klass)
GObjectClass* object_class = G_OBJECT_CLASS (klass);
object_class->finalize = amp_node_finalize;
+
+ klass->load = amp_node_real_load;
+ klass->update = amp_node_real_update;
+ klass->write = amp_node_real_write;
+ klass->erase = amp_node_real_erase;
}
static void
@@ -75,8 +218,18 @@ amp_node_class_finalize (AmpNodeClass *klass)
}
+
+/* Register function
+ *---------------------------------------------------------------------------*/
+
void
amp_node_register (GTypeModule *module)
{
amp_node_register_type (module);
+ amp_root_node_register (module);
+ amp_module_node_register (module);
+ amp_package_node_register (module);
+ amp_group_node_register (module);
+ amp_target_node_register (module);
+ amp_source_node_register (module);
}
diff --git a/plugins/am-project/amp-node.h b/plugins/am-project/amp-node.h
index 2db8852..3a9ecde 100644
--- a/plugins/am-project/amp-node.h
+++ b/plugins/am-project/amp-node.h
@@ -44,6 +44,7 @@ G_BEGIN_DECLS
typedef struct _AmpNode AmpNode;
typedef struct _AmpNodeClass AmpNodeClass;
+typedef struct _AmpProject AmpProject;
/**
* AmpNode:
@@ -58,10 +59,54 @@ struct _AmpNode
struct _AmpNodeClass
{
AnjutaProjectNodeClass parent_class;
+
+ gboolean (*load) (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error);
+
+ gboolean (*update) (AmpNode *node,
+ AmpNode *parent);
+
+ gboolean (*erase) (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error);
+
+ gboolean (*write) (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error);
};
GType amp_node_get_type (void) G_GNUC_CONST;
+
+AnjutaProjectNode * amp_node_new (AnjutaProjectNode *parent,
+ AnjutaProjectNodeType type,
+ GFile *file,
+ const gchar *name,
+ GError **error);
+
+gboolean amp_node_load (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error);
+
+gboolean amp_node_update (AmpNode *node,
+ AmpNode *new_node);
+
+gboolean amp_node_write (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error);
+
+gboolean amp_node_erase (AmpNode *node,
+ AmpNode *parent,
+ AmpProject *project,
+ GError **error);
+
+
void amp_node_register (GTypeModule *module);
G_END_DECLS
diff --git a/plugins/am-project/amp-package.c b/plugins/am-project/amp-package.c
index 4968e9f..ca6f9fe 100644
--- a/plugins/am-project/amp-package.c
+++ b/plugins/am-project/amp-package.c
@@ -29,9 +29,12 @@
#include "amp-node.h"
#include "am-scanner.h"
#include "am-properties.h"
+#include "ac-writer.h"
#include <libanjuta/interfaces/ianjuta-project.h>
+#include <libanjuta/anjuta-utils.h>
+#include <libanjuta/anjuta-pkg-config.h>
#include <libanjuta/anjuta-debug.h>
@@ -51,6 +54,49 @@ struct _AmpPackageNode {
};
+/* Helper functions
+ *---------------------------------------------------------------------------*/
+
+static void
+list_all_children (GList **children, GFile *dir)
+{
+ GFileEnumerator *list;
+
+ list = g_file_enumerate_children (dir,
+ G_FILE_ATTRIBUTE_STANDARD_NAME,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ NULL,
+ NULL);
+
+ if (list != NULL)
+ {
+ GFileInfo *info;
+
+ while ((info = g_file_enumerator_next_file (list, NULL, NULL)) != NULL)
+ {
+ const gchar *name;
+ GFile *file;
+
+ name = g_file_info_get_name (info);
+ file = g_file_get_child (dir, name);
+ g_object_unref (info);
+
+ if (g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY)
+ {
+ list_all_children (children, file);
+ g_object_unref (file);
+ }
+ else
+ {
+ *children = g_list_prepend (*children, file);
+ }
+ }
+ g_file_enumerator_close (list, NULL, NULL);
+ g_object_unref (list);
+ }
+}
+
+
/* Package objects
*---------------------------------------------------------------------------*/
@@ -105,6 +151,85 @@ amp_package_node_update_node (AmpPackageNode *node, AmpPackageNode *new_node)
new_node->version = NULL;
}
+/* AmpNode implementation
+ *---------------------------------------------------------------------------*/
+
+static gboolean
+amp_package_node_load (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ GList* deps;
+ GList* dep;
+ GList* include_dirs = NULL;
+
+ deps = anjuta_pkg_config_list_dependencies (anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node)),
+ error);
+ for (dep = deps; dep != NULL; dep = g_list_next (dep))
+ {
+ /* Create a package node for the depedencies */
+ AnjutaProjectNode *pkg;
+
+ pkg = amp_node_new (NULL, ANJUTA_PROJECT_PACKAGE, NULL, dep->data, NULL);
+ anjuta_project_node_append (ANJUTA_PROJECT_NODE (node), pkg);
+ }
+ anjuta_util_glist_strings_free (deps);
+
+ if (*error != NULL)
+ {
+ g_warning ("Error getting dependencies: %s", (*error)->message);
+ g_error_free (*error);
+ *error = NULL;
+ }
+
+ if ((include_dirs = anjuta_pkg_config_get_directories (anjuta_project_node_get_name (ANJUTA_PROJECT_NODE (node)),
+ TRUE, error)))
+ {
+ GList* include_dir;
+
+ for (include_dir = include_dirs; include_dir != NULL; include_dir = g_list_next (include_dir))
+ {
+ GList* children = NULL;
+ GList* file = NULL;
+ GFile* dir = g_file_new_for_path (include_dir->data);
+
+ list_all_children (&children, dir);
+ for (file = g_list_first (children); file != NULL; file = g_list_next (file))
+ {
+ /* Create a source for files */
+ AnjutaProjectNode *source;
+
+ source = amp_node_new (NULL, ANJUTA_PROJECT_SOURCE, (GFile *)file->data, NULL, NULL);
+ anjuta_project_node_append (ANJUTA_PROJECT_NODE (node), source);
+ g_object_unref ((GObject *)file->data);
+ }
+ g_list_free (children);
+ g_object_unref (dir);
+ }
+ }
+ anjuta_util_glist_strings_free (include_dirs);
+
+ return TRUE;
+}
+
+static gboolean
+amp_package_node_update (AmpNode *node, AmpNode *new_node)
+{
+ amp_package_node_update_node (AMP_PACKAGE_NODE (node), AMP_PACKAGE_NODE (new_node));
+
+ return TRUE;
+}
+
+static gboolean
+amp_package_node_write (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_package_node_create_token (project, AMP_PACKAGE_NODE (node), error);
+}
+
+static gboolean
+amp_package_node_erase (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_package_node_delete_token (project, AMP_PACKAGE_NODE (node), error);
+}
+
/* GObjet implementation
*---------------------------------------------------------------------------*/
@@ -140,8 +265,15 @@ static void
amp_package_node_class_init (AmpPackageNodeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ AmpNodeClass* node_class;
object_class->finalize = amp_package_node_finalize;
+
+ node_class = AMP_NODE_CLASS (klass);
+ node_class->load = amp_package_node_load;
+ node_class->update = amp_package_node_update;
+ node_class->erase = amp_package_node_erase;
+ node_class->write = amp_package_node_write;
}
static void
diff --git a/plugins/am-project/amp-source.c b/plugins/am-project/amp-source.c
index b0cff09..d8326be 100644
--- a/plugins/am-project/amp-source.c
+++ b/plugins/am-project/amp-source.c
@@ -29,6 +29,7 @@
#include "amp-node.h"
#include "am-scanner.h"
#include "am-properties.h"
+#include "am-writer.h"
#include <libanjuta/interfaces/ianjuta-project.h>
@@ -99,6 +100,31 @@ amp_source_node_free (AmpSourceNode *node)
g_object_unref (G_OBJECT (node));
}
+/* AmpNode implementation
+ *---------------------------------------------------------------------------*/
+
+static gboolean
+amp_source_node_update (AmpNode *node, AmpNode *new_node)
+{
+ amp_source_node_update_node (AMP_SOURCE_NODE (node), AMP_SOURCE_NODE (new_node));
+
+ return TRUE;
+}
+
+static gboolean
+amp_source_node_write (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_source_node_create_token (project, AMP_SOURCE_NODE (node), error);
+}
+
+static gboolean
+amp_source_node_erase (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_source_node_delete_token (project, AMP_SOURCE_NODE (node), error);
+}
+
+
+
/* GObjet implementation
*---------------------------------------------------------------------------*/
@@ -133,8 +159,14 @@ static void
amp_source_node_class_init (AmpSourceNodeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ AmpNodeClass* node_class;
object_class->finalize = amp_source_node_finalize;
+
+ node_class = AMP_NODE_CLASS (klass);
+ node_class->update = amp_source_node_update;
+ node_class->write = amp_source_node_write;
+ node_class->erase = amp_source_node_erase;
}
static void
diff --git a/plugins/am-project/amp-target.c b/plugins/am-project/amp-target.c
index ec16bc9..23c48bd 100644
--- a/plugins/am-project/amp-target.c
+++ b/plugins/am-project/amp-target.c
@@ -29,7 +29,7 @@
#include "amp-node.h"
#include "am-scanner.h"
#include "am-properties.h"
-
+#include "am-writer.h"
#include <libanjuta/interfaces/ianjuta-project.h>
@@ -300,6 +300,32 @@ amp_target_node_free (AmpTargetNode *node)
}
+
+/* AmpNode implementation
+ *---------------------------------------------------------------------------*/
+
+static gboolean
+amp_target_node_update (AmpNode *node, AmpNode *new_node)
+{
+ amp_target_node_update_node (AMP_TARGET_NODE (node), AMP_TARGET_NODE (new_node));
+
+ return TRUE;
+}
+
+static gboolean
+amp_target_node_write (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_target_node_create_token (project, AMP_TARGET_NODE (node), error);
+}
+
+static gboolean
+amp_target_node_erase (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
+{
+ return amp_target_node_delete_token (project, AMP_TARGET_NODE (node), error);
+}
+
+
+
/* GObjet implementation
*---------------------------------------------------------------------------*/
@@ -339,8 +365,14 @@ static void
amp_target_node_class_init (AmpTargetNodeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ AmpNodeClass* node_class;
object_class->finalize = amp_target_node_finalize;
+
+ node_class = AMP_NODE_CLASS (klass);
+ node_class->update = amp_target_node_update;
+ node_class->write = amp_target_node_write;
+ node_class->erase = amp_target_node_erase;
}
static void
diff --git a/plugins/am-project/command-queue.c b/plugins/am-project/command-queue.c
index f29e7e8..4935798 100644
--- a/plugins/am-project/command-queue.c
+++ b/plugins/am-project/command-queue.c
@@ -348,9 +348,12 @@ pm_job_free (PmJob *job)
void
pm_job_set_parent (PmJob *job, AnjutaProjectNode *parent)
{
- if (job->parent != NULL) g_object_unref (job->parent);
- if (parent != NULL) g_object_ref (parent);
- job->parent = parent;
+ if (job->parent != parent)
+ {
+ if (job->parent != NULL) g_object_unref (job->parent);
+ if (parent != NULL) g_object_ref (parent);
+ job->parent = parent;
+ }
}
/* Public functions
diff --git a/plugins/am-project/plugin.c b/plugins/am-project/plugin.c
index 02f7852..f0c3377 100644
--- a/plugins/am-project/plugin.c
+++ b/plugins/am-project/plugin.c
@@ -121,7 +121,7 @@ amp_plugin_class_init (GObjectClass *klass)
ANJUTA_PLUGIN_BEGIN (AmpPlugin, amp_plugin);
ANJUTA_PLUGIN_ADD_INTERFACE (iproject_backend, IANJUTA_TYPE_PROJECT_BACKEND);
- amp_project_register_project (module);
+ amp_project_register (module);
ANJUTA_PLUGIN_END;
ANJUTA_SIMPLE_PLUGIN (AmpPlugin, amp_plugin);
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index 4a26274..05c3e72 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -516,7 +516,7 @@ main(int argc, char *argv[])
/* Register project types */
module = g_object_new (dummy_type_module_get_type (), NULL);
- amp_project_register_project (module);
+ amp_project_register (module);
/* Check for project type */
probe = amp_project_probe (file, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]