[anjuta/newproject] Add a new type of properties for list (not complete)



commit 935fe60a78213432225d850f1eeb49cf576feebc
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Fri Oct 15 20:37:01 2010 +0200

    Add a new type of properties for list (not complete)

 libanjuta/anjuta-project.h              |    3 +-
 plugins/am-project/am-node.c            |  103 ++++++++++++++++++++++++++++---
 plugins/am-project/am-node.h            |    7 +-
 plugins/am-project/am-project-private.h |    2 +-
 plugins/am-project/am-project.c         |   11 +++-
 plugins/am-project/am-properties.c      |   48 +++++++-------
 plugins/am-project/am-writer.c          |   10 ++--
 plugins/am-project/projectparser.c      |    3 +-
 plugins/project-manager/dialogs.c       |    6 +-
 9 files changed, 144 insertions(+), 49 deletions(-)
---
diff --git a/libanjuta/anjuta-project.h b/libanjuta/anjuta-project.h
index db4ca72..1c2e6d9 100644
--- a/libanjuta/anjuta-project.h
+++ b/libanjuta/anjuta-project.h
@@ -101,8 +101,9 @@ typedef struct _AnjutaProjectTargetInformation
 typedef enum
 {
 	ANJUTA_PROJECT_PROPERTY_STRING = 1,
+	ANJUTA_PROJECT_PROPERTY_LIST,
 	ANJUTA_PROJECT_PROPERTY_BOOLEAN,
-	ANJUTA_PROJECT_PROPERTY_LIST
+	ANJUTA_PROJECT_PROPERTY_MAP
 } AnjutaProjectValueType;
 
 typedef struct _AnjutaProjectProperty AnjutaProjectProperty;
diff --git a/plugins/am-project/am-node.c b/plugins/am-project/am-node.c
index 048ef81..0a49919 100644
--- a/plugins/am-project/am-node.c
+++ b/plugins/am-project/am-node.c
@@ -39,8 +39,6 @@
 #include <string.h>
 #include <ctype.h>
 
-/* Node types
- *---------------------------------------------------------------------------*/
 
 
 /* Helper functions
@@ -68,6 +66,89 @@ error_set (GError **error, gint code, const gchar *message)
         }
 }
 
+/* Tagged token list
+ *
+ * This structure is used to keep a list of useful tokens in each
+ * node. It is a two levels list. The level lists all kinds of token
+ * and has a pointer of another list of token of  this kind.
+ *---------------------------------------------------------------------------*/
+
+typedef struct _TaggedTokenItem {
+	AmTokenType type;
+	GList *tokens;
+} TaggedTokenItem;
+
+
+static TaggedTokenItem *
+tagged_token_item_new (AmTokenType type)
+{
+    TaggedTokenItem *item;
+
+	item = g_slice_new0(TaggedTokenItem); 
+
+	item->type = type;
+
+	return item;
+}
+
+static void
+tagged_token_item_free (TaggedTokenItem* item)
+{
+	g_list_free (item->tokens);
+    g_slice_free (TaggedTokenItem, item);
+}
+
+static gint
+tagged_token_item_compare (gconstpointer a, gconstpointer b)
+{
+	return ((TaggedTokenItem *)a)->type - (GPOINTER_TO_INT(b));
+}
+
+static GList*
+tagged_token_list_insert (GList *list, AmTokenType type, AnjutaToken *token)
+{
+	GList *existing;
+	
+	existing = g_list_find_custom (list, GINT_TO_POINTER (type), tagged_token_item_compare);
+	if (existing == NULL)
+	{
+		/* Add a new item */
+		TaggedTokenItem *item;
+
+		item = tagged_token_item_new (type);
+		list = g_list_prepend (list, item);
+		existing = list;
+	}
+
+	((TaggedTokenItem *)(existing->data))->tokens = g_list_prepend (((TaggedTokenItem *)(existing->data))->tokens, token);
+
+	return list;
+}
+
+static GList*
+tagged_token_list_get (GList *list, AmTokenType type)
+{
+	GList *existing;
+	GList *tokens = NULL;
+	
+	existing = g_list_find_custom (list, GINT_TO_POINTER (type), tagged_token_item_compare);
+	if (existing != NULL)
+	{
+		tokens = ((TaggedTokenItem *)(existing->data))->tokens;
+	}
+	
+	return tokens;
+}
+
+static GList*
+tagged_token_list_free (GList *list)
+{
+	g_list_foreach (list, (GFunc)tagged_token_item_free, NULL);
+	g_list_free (list);
+
+	return NULL;
+}
+
 
 /* Variable object
  *---------------------------------------------------------------------------*/
@@ -419,9 +500,9 @@ amp_group_set_makefile (AnjutaAmGroupNode *group, GFile *makefile, GObject* proj
 		group->tfile = anjuta_token_file_new (makefile);
 
 		token = anjuta_token_file_load (group->tfile, NULL);
-		amp_project_add_file (project, makefile, group->tfile);
+		amp_project_add_file (AMP_PROJECT (project), makefile, group->tfile);
 			
-		scanner = amp_am_scanner_new (project, group);
+		scanner = amp_am_scanner_new (AMP_PROJECT (project), group);
 		group->make_token = amp_am_scanner_parse_token (scanner, anjuta_token_new_static (ANJUTA_TOKEN_FILE, NULL), token, makefile, NULL);
 		amp_am_scanner_free (scanner);
 		fprintf (stderr, "group->make_token %p\n", group->make_token);
@@ -577,6 +658,7 @@ anjuta_am_group_node_finalize (GObject *object)
 	g_list_foreach (node->base.custom_properties, (GFunc)amp_property_free, NULL);
 	if (node->tfile) anjuta_token_file_free (node->tfile);
 	if (node->makefile) g_object_unref (node->makefile);
+
 	for (i = 0; i < AM_GROUP_TOKEN_LAST; i++)
 	{
 		if (node->tokens[i] != NULL) g_list_free (node->tokens[i]);
@@ -607,15 +689,15 @@ anjuta_am_group_node_class_init (AnjutaAmGroupNodeClass *klass)
 
 
 void
-amp_target_add_token (AnjutaAmTargetNode *target, AnjutaToken *token, AmpTargetTokenCategory category)
+amp_target_add_token (AnjutaAmTargetNode *target, AmTokenType type, AnjutaToken *token)
 {
-	target->tokens[category] = g_list_prepend (target->tokens[category], token);
+	target->tokens = tagged_token_list_insert (target->tokens, type, token);
 }
 
 GList *
-amp_target_get_token (AnjutaAmTargetNode *node, AmpTargetTokenCategory category)
+amp_target_get_token (AnjutaAmTargetNode *target, AmTokenType type)
 {
-	return node->tokens[category];
+	return tagged_token_list_get	(target->tokens, type);
 }
 
 
@@ -676,7 +758,7 @@ amp_target_new (const gchar *name, AnjutaProjectNodeType type, const gchar *inst
 						ANJUTA_PROJECT_CAN_REMOVE;
 	node->install = g_strdup (install);
 	node->flags = flags;
-	memset (node->tokens, 0, sizeof (node->tokens));
+	node->tokens = NULL;
 	
 	return node;
 }
@@ -710,6 +792,9 @@ anjuta_am_target_node_finalize (GObject *object)
 	AnjutaAmTargetNode *node = ANJUTA_AM_TARGET_NODE (object);
 
 	g_list_foreach (node->base.custom_properties, (GFunc)amp_property_free, NULL);
+	tagged_token_list_free (node->tokens);
+	node->tokens = NULL;
+	
 	G_OBJECT_CLASS (anjuta_am_target_node_parent_class)->finalize (object);
 }
 
diff --git a/plugins/am-project/am-node.h b/plugins/am-project/am-node.h
index ec3f202..5e4dab5 100644
--- a/plugins/am-project/am-node.h
+++ b/plugins/am-project/am-node.h
@@ -23,6 +23,7 @@
 #define _AM_NODE_H_
 
 #include "am-project-private.h"
+#include "am-scanner.h"
 
 #include <glib-object.h>
 
@@ -52,7 +53,7 @@ gboolean amp_root_update_configure (AnjutaAmRootNode *group, AnjutaToken *token)
 AnjutaProjectNode* amp_module_new (AnjutaToken *token, GError **error);
 void amp_module_free (AnjutaAmModuleNode *node);
 
-AnjutaProjectNode* am_package_node_new (const gchar *name, GError **error);
+AnjutaProjectNode* amp_package_new (const gchar *name, GError **error);
 void amp_package_free (AnjutaAmPackageNode *node);
 void amp_package_set_version (AnjutaAmPackageNode *node, const gchar *compare, const gchar *version);
 
@@ -80,8 +81,8 @@ typedef enum _AmpTargetFlag
 } AmpTargetFlag;
 
 
-void amp_target_add_token (AnjutaAmTargetNode *group, AnjutaToken *token, AmpTargetTokenCategory category);
-GList * amp_target_get_token (AnjutaAmTargetNode *group, AmpTargetTokenCategory category);
+void amp_target_add_token (AnjutaAmTargetNode *group, AmTokenType type, AnjutaToken *token);
+GList * amp_target_get_token (AnjutaAmTargetNode *group, AmTokenType type);
 AnjutaAmTargetNode* amp_target_new (const gchar *name, AnjutaProjectNodeType type, const gchar *install, gint flags, GError **error);
 void amp_target_free (AnjutaAmTargetNode *node);
 
diff --git a/plugins/am-project/am-project-private.h b/plugins/am-project/am-project-private.h
index 1d78e8f..3ac1f6f 100644
--- a/plugins/am-project/am-project-private.h
+++ b/plugins/am-project/am-project-private.h
@@ -155,7 +155,7 @@ struct _AnjutaAmTargetNode {
 	AnjutaProjectNode base;
 	gchar *install;
 	gint flags;
-	GList* tokens[AM_TARGET_TOKEN_LAST];	
+	GList* tokens;	
 };
 
 
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index b93d9a4..fd63015 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -997,7 +997,7 @@ project_load_target (AmpProject *project, AnjutaToken *name, AnjutaTokenType tok
 		//fprintf(stderr, "create target %p\n", target);
 		if (target != NULL)
 		{
-			amp_target_add_token (target, arg, AM_TARGET_TOKEN_TARGET);
+			amp_target_add_token (target, ANJUTA_TOKEN_ARGUMENT, arg);
 			anjuta_project_node_append (parent, target);
 			DEBUG_PRINT ("create target %p name %s", target, value);
 
@@ -1103,7 +1103,7 @@ project_load_sources (AmpProject *project, AnjutaToken *name, AnjutaToken *list,
 		}
 		else
 		{
-			amp_target_add_token (parent, name, AM_TARGET_TOKEN_SOURCES);
+			amp_target_add_token (parent, AM_TOKEN__SOURCES, name);
 		}
 		
 		for (arg = anjuta_token_first_word (list); arg != NULL; arg = anjuta_token_next_word (arg))
@@ -1190,7 +1190,7 @@ project_load_data (AmpProject *project, AnjutaToken *name, AnjutaToken *list, An
 	{
 		/* Create target */
 		target = amp_target_new (target_id, info->base.type, install, flags, NULL);
-		amp_target_add_token (target, arg, AM_TARGET_TOKEN_TARGET);
+		amp_target_add_token (target, ANJUTA_TOKEN_ARGUMENT, arg);
 		anjuta_project_node_append (parent, target);
 		DEBUG_PRINT ("create target %p name %s", target, target_id);
 	}
@@ -1259,7 +1259,10 @@ project_load_target_properties (AmpProject *project, AnjutaToken *name, AnjutaTo
 		parent = (gchar *)find != target_id ? (AnjutaProjectNode *)find : NULL;
 
 		/* Create property */
+		g_message ("new property");
+		anjuta_token_dump (list);
 		value = anjuta_token_evaluate (list);
+		g_message ("variable value =%s", value);
 		prop = amp_property_new (NULL, type, 0, value, list);
 
 		if (parent == NULL)
@@ -1476,6 +1479,8 @@ amp_project_set_am_variable (AmpProject* project, AnjutaAmGroupNode* group, Anju
 	case AM_TOKEN_TARGET_LFLAGS:
 	case AM_TOKEN_TARGET_YFLAGS:
 	case AM_TOKEN_TARGET_DEPENDENCIES:
+	case AM_TOKEN_TARGET_LIBADD:
+	case AM_TOKEN_TARGET_LDADD:
 		project_load_target_properties (project, name, variable, list, group, orphan_properties);
 		break;
 	default:
diff --git a/plugins/am-project/am-properties.c b/plugins/am-project/am-properties.c
index 0955279..b92f122 100644
--- a/plugins/am-project/am-properties.c
+++ b/plugins/am-project/am-properties.c
@@ -53,16 +53,16 @@ static GList* AmpProjectPropertyList = NULL;
 
 
 static AmpProperty AmpGroupProperties[] = {
-	{{N_("Linker flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__LDFLAGS, 0, NULL},
-	{{N_("C preprocessor flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__CPPFLAGS, 0, NULL},
-	{{N_("C compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__CFLAGS, 0, NULL},
-	{{N_("C++ compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__CXXFLAGS, 0, NULL},
-	{{N_("Java Compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__JAVACFLAGS, 0, NULL},
-	{{N_("Fortan compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__FCFLAGS, 0, NULL},
-	{{N_("Objective C compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__OBJCFLAGS, 0, NULL},
-	{{N_("Lex/Flex flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__LFLAGS, 0, NULL},
-	{{N_("Yacc/Bison flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL},AM_TOKEN__YFLAGS, 0, NULL},
-	{{N_("Install directories:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_DIR, 0, NULL},
+	{{N_("Linker flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__LDFLAGS, 0, NULL},
+	{{N_("C preprocessor flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__CPPFLAGS, 0, NULL},
+	{{N_("C compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__CFLAGS, 0, NULL},
+	{{N_("C++ compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__CXXFLAGS, 0, NULL},
+	{{N_("Java Compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__JAVACFLAGS, 0, NULL},
+	{{N_("Fortan compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__FCFLAGS, 0, NULL},
+	{{N_("Objective C compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__OBJCFLAGS, 0, NULL},
+	{{N_("Lex/Flex flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN__LFLAGS, 0, NULL},
+	{{N_("Yacc/Bison flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL},AM_TOKEN__YFLAGS, 0, NULL},
+	{{N_("Install directories:"), ANJUTA_PROJECT_PROPERTY_MAP, NULL, NULL}, AM_TOKEN_DIR, 0, NULL},
 	{{NULL, ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, 0, 0, NULL}};
 
 static GList* AmpGroupPropertyList = NULL;
@@ -71,18 +71,18 @@ static GList* AmpGroupPropertyList = NULL;
 static AmpProperty AmpTargetProperties[] = {
 	{{N_("Do not install:"), ANJUTA_PROJECT_PROPERTY_BOOLEAN, NULL, NULL}, AM_TOKEN__PROGRAMS, 3, NULL},
 	{{N_("Installation directory:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__PROGRAMS, 6, NULL},
-	{{N_("Linker flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_LDFLAGS, 0, NULL},
-	{{N_("Additional libraries:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_LIBADD, 0, NULL},
-	{{N_("Additional objects:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_LDADD, 0, NULL},
-	{{N_("C preprocessor flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_CPPFLAGS, 0, NULL},
-	{{N_("C compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_CFLAGS, 0, NULL},
-	{{N_("C++ compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_CXXFLAGS, 0, NULL},
-	{{N_("Java Compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_JAVACFLAGS, 0, NULL},
-	{{N_("Fortan compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_FCFLAGS, 0, NULL},
-	{{N_("Objective C compiler flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_OBJCFLAGS, 0, NULL},
-	{{N_("Lex/Flex flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_LFLAGS, 0, NULL},
-	{{N_("Yacc/Bison flags:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_YFLAGS, 0, NULL},
-	{{N_("Additional dependencies:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN_TARGET_DEPENDENCIES, 0, NULL},
+	{{N_("Linker flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_LDFLAGS, 0, NULL},
+	{{N_("Additional libraries:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_LIBADD, 0, NULL},
+	{{N_("Additional objects:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_LDADD, 0, NULL},
+	{{N_("C preprocessor flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_CPPFLAGS, 0, NULL},
+	{{N_("C compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_CFLAGS, 0, NULL},
+	{{N_("C++ compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_CXXFLAGS, 0, NULL},
+	{{N_("Java Compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_JAVACFLAGS, 0, NULL},
+	{{N_("Fortan compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_FCFLAGS, 0, NULL},
+	{{N_("Objective C compiler flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_OBJCFLAGS, 0, NULL},
+	{{N_("Lex/Flex flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_LFLAGS, 0, NULL},
+	{{N_("Yacc/Bison flags:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_YFLAGS, 0, NULL},
+	{{N_("Additional dependencies:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, AM_TOKEN_TARGET_DEPENDENCIES, 0, NULL},
 	{{N_("Include in distribution:"), ANJUTA_PROJECT_PROPERTY_BOOLEAN, NULL, NULL}, AM_TOKEN__PROGRAMS, 2, NULL},
 	{{N_("Build for check only:"), ANJUTA_PROJECT_PROPERTY_BOOLEAN, NULL, NULL}, AM_TOKEN__PROGRAMS, 4, NULL},
 	{{N_("Do not use prefix:"), ANJUTA_PROJECT_PROPERTY_BOOLEAN, NULL, NULL}, AM_TOKEN__PROGRAMS, 1, NULL},
@@ -92,7 +92,7 @@ static AmpProperty AmpTargetProperties[] = {
 static GList* AmpTargetPropertyList = NULL;
 
 static AmpProperty AmpManTargetProperties[] = {
-	{{N_("Additional dependencies:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, 0, 0, NULL},
+	{{N_("Additional dependencies:"), ANJUTA_PROJECT_PROPERTY_LIST, NULL, NULL}, 0, 0, NULL},
 	{{N_("Do not use prefix:"), ANJUTA_PROJECT_PROPERTY_BOOLEAN, NULL, NULL}, AM_TOKEN__PROGRAMS, 1, NULL},
 	{{N_("Manual section:"), ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, AM_TOKEN__PROGRAMS, 5, NULL},
 	{{NULL, ANJUTA_PROJECT_PROPERTY_STRING, NULL, NULL}, 0, 0, NULL}};
@@ -205,7 +205,7 @@ amp_node_property_add (AnjutaProjectNode *node, AnjutaProjectProperty *new_prop)
 
 		if ((prop->token_type == ((AmpProperty *)new_prop)->token_type) && (prop->position == ((AmpProperty *)new_prop)->position))
 		{
-			if (prop->base.type != ANJUTA_PROJECT_PROPERTY_LIST)
+			if (prop->base.type != ANJUTA_PROJECT_PROPERTY_MAP)
 			{
 				/* Replace property */
 				AnjutaProjectProperty *old_prop;
diff --git a/plugins/am-project/am-writer.c b/plugins/am-project/am-writer.c
index 967af91..09e587f 100644
--- a/plugins/am-project/am-writer.c
+++ b/plugins/am-project/am-writer.c
@@ -490,7 +490,7 @@ amp_target_create_token (AmpProject  *project, AnjutaAmTargetNode *target, GErro
 	prev = NULL;
 	if (sibling != NULL)
 	{
-		last = amp_target_get_token (sibling, AM_TARGET_TOKEN_TARGET);
+		last = amp_target_get_token (sibling, ANJUTA_TOKEN_ARGUMENT);
 
 		if (last != NULL) 
 		{
@@ -571,7 +571,7 @@ amp_target_create_token (AmpProject  *project, AnjutaAmTargetNode *target, GErro
 		
 		amp_group_update_makefile (parent, token);
 		
-		amp_target_add_token (target, token, AM_TARGET_TOKEN_TARGET);
+		amp_target_add_token (target, ANJUTA_TOKEN_ARGUMENT, token);
 	}
 	g_free (name);
 
@@ -587,7 +587,7 @@ amp_target_delete_token (AmpProject  *project, AnjutaAmTargetNode *target, GErro
 	/* Get parent target */
 	parent = ANJUTA_AM_GROUP_NODE (anjuta_project_node_parent (ANJUTA_PROJECT_NODE (target)));
 
-	for (item = amp_target_get_token (target, AM_TARGET_TOKEN_TARGET); item != NULL; item = g_list_next (item))
+	for (item = amp_target_get_token (target, ANJUTA_TOKEN_ARGUMENT); item != NULL; item = g_list_next (item))
 	{
 		AnjutaToken *token = (AnjutaToken *)item->data;
 		AnjutaToken *args;
@@ -713,7 +713,7 @@ amp_source_create_token (AmpProject  *project, AnjutaAmSourceNode *source, GErro
 	if (args == NULL)
 	{
 		GList *last;
-		for (last = amp_target_get_token (target, AM_TARGET_TOKEN_SOURCES); last != NULL; last = g_list_next (last))
+		for (last = amp_target_get_token (target, AM_TOKEN__SOURCES); last != NULL; last = g_list_next (last))
 		{
 			args = anjuta_token_last_item (anjuta_token_list ((AnjutaToken *)last->data));
 			break;
@@ -732,7 +732,7 @@ amp_source_create_token (AmpProject  *project, AnjutaAmSourceNode *source, GErro
 
 		/* Search where the target is declared */
 		var = NULL;
-		list = amp_target_get_token (target, AM_TARGET_TOKEN_TARGET);
+		list = amp_target_get_token (target, ANJUTA_TOKEN_ARGUMENT);
 		if (list != NULL)
 		{
 			var = (AnjutaToken *)list->data;
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index 1fee521..b7bcf64 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -90,12 +90,13 @@ list_property (IAnjutaProject *project, AnjutaProjectNode *parent, gint indent)
 		switch (prop->type)
 		{
 		case ANJUTA_PROJECT_PROPERTY_STRING:
+		case ANJUTA_PROJECT_PROPERTY_LIST:
 				g_string_assign (value, prop->value == NULL ? "" : prop->value);
 				break;
 		case ANJUTA_PROJECT_PROPERTY_BOOLEAN:
 				g_string_assign (value, (prop->value != NULL) && (*prop->value == '1') ? "true" : "false");
 				break;
-		case ANJUTA_PROJECT_PROPERTY_LIST:
+		case ANJUTA_PROJECT_PROPERTY_MAP:
 				g_string_assign (value, "");
 				for (list = anjuta_project_node_get_custom_properties (parent); list != NULL; list = g_list_next (list))
 				{
diff --git a/plugins/project-manager/dialogs.c b/plugins/project-manager/dialogs.c
index 6697fe5..535a266 100644
--- a/plugins/project-manager/dialogs.c
+++ b/plugins/project-manager/dialogs.c
@@ -412,6 +412,7 @@ add_entry (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProper
 	switch (prop->type)
 	{
 	case ANJUTA_PROJECT_PROPERTY_STRING:
+	case ANJUTA_PROJECT_PROPERTY_LIST:
 		entry = gtk_entry_new ();
 		gtk_entry_set_text (GTK_ENTRY (entry), prop->value != NULL ? prop->value : "");
 		break;
@@ -419,7 +420,7 @@ add_entry (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProper
 		entry = gtk_check_button_new ();
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (entry), (prop->value != NULL) && (*prop->value == '1'));
 		break;
-	case ANJUTA_PROJECT_PROPERTY_LIST:
+	case ANJUTA_PROJECT_PROPERTY_MAP:
 			model = GTK_TREE_MODEL (gtk_list_store_newv (LIST_COLUMNS_NB, column_type));
 
 			if (prop->native != NULL) prop = prop->native;
@@ -624,6 +625,7 @@ on_properties_dialog_response (GtkWidget *dialog,
 			switch (prop->type)
 			{
 			case ANJUTA_PROJECT_PROPERTY_STRING:
+			case ANJUTA_PROJECT_PROPERTY_LIST:
 				text = gtk_entry_get_text (GTK_ENTRY (entry->entry));
 				if (*text == '\0')
 				{
@@ -664,7 +666,7 @@ on_properties_dialog_response (GtkWidget *dialog,
 					modified = g_list_prepend (modified, value);
 				}
 				break;
-			case ANJUTA_PROJECT_PROPERTY_LIST:
+			case ANJUTA_PROJECT_PROPERTY_MAP:
 				break;
 			default:
 				break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]