[anjuta/newproject] Change IAnjutaProject interface for properties
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/newproject] Change IAnjutaProject interface for properties
- Date: Sun, 18 Apr 2010 10:52:52 +0000 (UTC)
commit a9d9f41b3d46f0d3eabef72c7c242e8fbaafd423
Author: Sébastien Granjoux <seb sfo free fr>
Date: Sat Apr 17 09:52:56 2010 +0200
Change IAnjutaProject interface for properties
libanjuta/anjuta-project.c | 40 ++++++++--------
libanjuta/anjuta-project.h | 34 ++++++-------
libanjuta/interfaces/libanjuta.idl | 92 ++++++++++++++++++++++++++++--------
plugins/am-project/am-dialogs.c | 18 ++++----
plugins/am-project/am-project.c | 84 ++++++++++++++++++++++++---------
plugins/am-project/am-project.h | 2 +-
plugins/am-project/am-properties.c | 14 +++---
plugins/am-project/am-properties.h | 2 +-
plugins/am-project/projectparser.c | 23 ++++-----
plugins/dir-project/dir-project.c | 57 ++++++++++++++++-------
plugins/mk-project/mk-project.c | 57 ++++++++++++++++-------
plugins/project-manager/project.c | 4 +-
12 files changed, 279 insertions(+), 148 deletions(-)
---
diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c
index e0b6d3d..f7d6480 100644
--- a/libanjuta/anjuta-project.c
+++ b/libanjuta/anjuta-project.c
@@ -64,8 +64,8 @@ typedef struct {
/* Properties functions
*---------------------------------------------------------------------------*/
-AnjutaProjectPropertyList *
-anjuta_project_property_first (AnjutaProjectPropertyList *list)
+AnjutaProjectProperty *
+anjuta_project_property_first (AnjutaProjectProperty *list)
{
if (list != NULL)
{
@@ -79,20 +79,20 @@ anjuta_project_property_first (AnjutaProjectPropertyList *list)
return list;
}
-AnjutaProjectPropertyItem *
-anjuta_project_property_next (AnjutaProjectPropertyItem *list)
+AnjutaProjectProperty *
+anjuta_project_property_next (AnjutaProjectProperty *list)
{
return g_list_next (list);
}
AnjutaProjectPropertyInfo *
-anjuta_project_property_get_info (AnjutaProjectPropertyItem *list)
+anjuta_project_property_get_info (AnjutaProjectProperty *list)
{
return (AnjutaProjectPropertyInfo *)list->data;
}
AnjutaProjectPropertyInfo *
-anjuta_project_property_lookup (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop)
+anjuta_project_property_lookup (AnjutaProjectProperty *list, AnjutaProjectProperty *prop)
{
AnjutaProjectPropertyInfo *info;
@@ -115,10 +115,10 @@ anjuta_project_property_lookup (AnjutaProjectPropertyList *list, AnjutaProjectPr
return info;
}
-AnjutaProjectPropertyItem *
-anjuta_project_property_override (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop)
+AnjutaProjectProperty *
+anjuta_project_property_override (AnjutaProjectProperty *list, AnjutaProjectProperty *prop)
{
- AnjutaProjectPropertyItem *item;
+ AnjutaProjectProperty *item;
for (item = list; item != NULL; item = g_list_next (item))
{
@@ -140,10 +140,10 @@ anjuta_project_property_override (AnjutaProjectPropertyList *list, AnjutaProject
return item;
}
-AnjutaProjectPropertyItem *
-anjuta_project_property_next_item (AnjutaProjectPropertyItem *item)
+AnjutaProjectProperty *
+anjuta_project_property_next_item (AnjutaProjectProperty *item)
{
- AnjutaProjectPropertyItem *prop = ((AnjutaProjectPropertyInfo *)item->data)->override;
+ AnjutaProjectProperty *prop = ((AnjutaProjectPropertyInfo *)item->data)->override;
for (item = g_list_next (item); item != NULL; item = g_list_next (item))
{
@@ -165,8 +165,8 @@ anjuta_project_property_next_item (AnjutaProjectPropertyItem *item)
return item;
}
-AnjutaProjectPropertyList *
-anjuta_project_property_insert (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop, AnjutaProjectPropertyInfo *info)
+AnjutaProjectProperty *
+anjuta_project_property_insert (AnjutaProjectProperty *list, AnjutaProjectProperty *prop, AnjutaProjectPropertyInfo *info)
{
GList *next;
@@ -184,8 +184,8 @@ anjuta_project_property_insert (AnjutaProjectPropertyList *list, AnjutaProjectPr
return list;
}
-AnjutaProjectPropertyList *
-anjuta_project_property_remove (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop)
+AnjutaProjectProperty *
+anjuta_project_property_remove (AnjutaProjectProperty *list, AnjutaProjectProperty *prop)
{
AnjutaProjectPropertyInfo *info;
GList *link;
@@ -209,7 +209,7 @@ anjuta_project_property_remove (AnjutaProjectPropertyList *list, AnjutaProjectPr
}
void
-anjuta_project_property_foreach (AnjutaProjectPropertyList *list, GFunc func, gpointer user_data)
+anjuta_project_property_foreach (AnjutaProjectProperty *list, GFunc func, gpointer user_data)
{
g_list_foreach (list, func, user_data);
}
@@ -410,7 +410,7 @@ anjuta_project_node_get_file (AnjutaProjectNode *node)
return data->file;
}
-AnjutaProjectPropertyList *
+AnjutaProjectProperty *
anjuta_project_node_get_property_list (AnjutaProjectNode *node)
{
GList *list = NULL;
@@ -447,7 +447,7 @@ anjuta_project_node_get_property_list (AnjutaProjectNode *node)
return list;
}
-const gchar *
+/*const gchar *
anjuta_project_node_get_property_value (AnjutaProjectNode *node, AnjutaProjectProperty prop)
{
GList *item;
@@ -463,7 +463,7 @@ anjuta_project_node_get_property_value (AnjutaProjectNode *node, AnjutaProjectPr
}
return NULL;
-}
+}*/
/* Group access functions
*---------------------------------------------------------------------------*/
diff --git a/libanjuta/anjuta-project.h b/libanjuta/anjuta-project.h
index fd2df89..cad9f21 100644
--- a/libanjuta/anjuta-project.h
+++ b/libanjuta/anjuta-project.h
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
#define ANJUTA_IS_PROJECT_GROUP(obj) (((AnjutaProjectNodeData *)obj->data)->type == ANJUTA_PROJECT_GROUP)
#define ANJUTA_IS_PROJECT_TARGET(obj) (((AnjutaProjectNodeData *)obj->data)->type == ANJUTA_PROJECT_TARGET)
#define ANJUTA_IS_PROJECT_NODE(obj) (1)
+#define ANJUTA_IS_PROJECT_PROPERTY(obj) (1)
typedef enum
{
@@ -88,26 +89,23 @@ typedef enum
ANJUTA_PROJECT_PROPERTY_STRING = 1,
ANJUTA_PROJECT_PROPERTY_BOOLEAN,
ANJUTA_PROJECT_PROPERTY_LIST
-} AnjutaProjectPropertyType;
+} AnjutaProjectValueType;
typedef struct
{
gchar *name;
- AnjutaProjectPropertyType type;
+ AnjutaProjectValueType type;
gchar *value;
GList *override;
} AnjutaProjectPropertyInfo;
-typedef AnjutaProjectPropertyInfo* AnjutaProjectProperty;
-
-typedef GList AnjutaProjectPropertyList;
-typedef GList AnjutaProjectPropertyItem;
+typedef GList AnjutaProjectProperty;
typedef struct
{
AnjutaProjectNodeType type;
- AnjutaProjectPropertyList *properties;
+ AnjutaProjectProperty *properties;
GFile *file;
gchar *name;
AnjutaProjectTargetType target_type;
@@ -143,15 +141,15 @@ typedef GNode AnjutaProjectSource;
typedef void (*AnjutaProjectNodeFunc) (AnjutaProjectNode *node, gpointer data);
-AnjutaProjectPropertyItem *anjuta_project_property_first (AnjutaProjectPropertyList *list);
-AnjutaProjectPropertyItem *anjuta_project_property_next (AnjutaProjectPropertyItem *list);
-AnjutaProjectPropertyItem *anjuta_project_property_override (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop);
-AnjutaProjectPropertyItem *anjuta_project_property_next_item (AnjutaProjectPropertyItem *item);
-AnjutaProjectPropertyInfo *anjuta_project_property_get_info (AnjutaProjectPropertyItem *list);
-AnjutaProjectPropertyInfo *anjuta_project_property_lookup (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop);
-AnjutaProjectPropertyList *anjuta_project_property_insert (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop, AnjutaProjectPropertyInfo *info);
-AnjutaProjectPropertyList *anjuta_project_property_remove (AnjutaProjectPropertyList *list, AnjutaProjectPropertyItem *prop);
-void anjuta_project_property_foreach (AnjutaProjectPropertyList *list, GFunc func, gpointer user_data);
+AnjutaProjectProperty *anjuta_project_property_first (AnjutaProjectProperty *list);
+AnjutaProjectProperty *anjuta_project_property_next (AnjutaProjectProperty *list);
+AnjutaProjectProperty *anjuta_project_property_override (AnjutaProjectProperty *list, AnjutaProjectProperty *prop);
+AnjutaProjectProperty *anjuta_project_property_next_item (AnjutaProjectProperty *item);
+AnjutaProjectPropertyInfo *anjuta_project_property_get_info (AnjutaProjectProperty *list);
+AnjutaProjectPropertyInfo *anjuta_project_property_lookup (AnjutaProjectProperty *list, AnjutaProjectProperty *prop);
+AnjutaProjectProperty *anjuta_project_property_insert (AnjutaProjectProperty *list, AnjutaProjectProperty *prop, AnjutaProjectPropertyInfo *info);
+AnjutaProjectProperty *anjuta_project_property_remove (AnjutaProjectProperty *list, AnjutaProjectProperty *prop);
+void anjuta_project_property_foreach (AnjutaProjectProperty *list, GFunc func, gpointer user_data);
AnjutaProjectNode *anjuta_project_node_parent (AnjutaProjectNode *node);
@@ -179,8 +177,8 @@ gchar *anjuta_project_node_get_name (const AnjutaProjectNode *node);
gchar *anjuta_project_node_get_uri (AnjutaProjectNode *node);
GFile *anjuta_project_node_get_file (AnjutaProjectNode *node);
-AnjutaProjectPropertyList *anjuta_project_node_get_property_list (AnjutaProjectNode *node);
-const gchar *anjuta_project_node_get_property_value (AnjutaProjectNode *node, AnjutaProjectProperty prop);
+AnjutaProjectProperty *anjuta_project_node_get_property_list (AnjutaProjectNode *node);
+//const gchar *anjuta_project_node_get_property_value (AnjutaProjectNode *node, AnjutaProjectProperty prop);
AnjutaProjectNode *anjuta_project_group_get_node_from_file (const AnjutaProjectNode *root, GFile *directory);
AnjutaProjectNode *anjuta_project_target_get_node_from_name (const AnjutaProjectNode *parent, const gchar *name);
diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl
index 5bcdcaf..d8e56a3 100644
--- a/libanjuta/interfaces/libanjuta.idl
+++ b/libanjuta/interfaces/libanjuta.idl
@@ -3055,6 +3055,7 @@ interface IAnjutaProject
ERROR_ALREADY_EXISTS,
ERROR_VALIDATION_FAILED,
ERROR_PROJECT_MALFORMED,
+ ERROR_NOT_SUPPORTED,
ERROR_GENERAL_FAILURE
}
@@ -3108,7 +3109,7 @@ interface IAnjutaProject
AnjutaProjectNode *save_node (AnjutaProjectNode *node);
/**
- * ianjuta_project_new_root:
+ * ianjuta_project_new_root_node:
* @obj: Self
* @file: Project file or directory
* @err: Error propagation and reporting
@@ -3117,10 +3118,10 @@ interface IAnjutaProject
*
* Return value: The newly created node, NULL if error
*/
- AnjutaProjectNode *new_root (GFile *file);
+ AnjutaProjectNode *new_root_node (GFile *file);
/**
- * ianjuta_project_new_file:
+ * ianjuta_project_add_file:
* @obj: Self
* @parent: Parent node
* @sibling: Sibling node or NULL
@@ -3133,10 +3134,10 @@ interface IAnjutaProject
*
* Return value: The newly created node, NULL if error
*/
- AnjutaProjectNode *new_file (AnjutaProjectNode *node, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file);
+ AnjutaProjectNode *add_file_node (AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file);
/**
- * ianjuta_project_new_name:
+ * ianjuta_project_add_name:
* @obj: Self
* @parent: Parent node
* @sibling: Sibling node or NULL
@@ -3149,17 +3150,80 @@ interface IAnjutaProject
*
* Return value: The newly created node, NULL if error
*/
- AnjutaProjectNode *new_name (AnjutaProjectNode *node, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name);
+ AnjutaProjectNode *add_name_node (AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name);
/**
- * ianjuta_project_free_node:
+ * ianjuta_project_remove_node:
* @obj: Self
* @node: Node
* @err: Error propagation and reporting
*
* Free a node and its children.
+ *
+ * Return value: TRUE if the node has been successfully removed
+ * else FALSE
+ */
+ gboolean remove_node (AnjutaProjectNode *node);
+
+ /**
+ * ianjuta_project_set_boolean_property:
+ * @obj: Self
+ * @node: Node
+ * @property: Property
+ * @value: Property value
+ * @err: Error propagation and reporting
+ *
+ * Set a property type of node to the corresponding value, overwrite
+ * the existing value if it exists.
+ *
+ * Return value: The newly created property, NULL on error
+ */
+ AnjutaProjectProperty *set_boolean_property (AnjutaProjectNode *node, AnjutaProjectProperty *property, gboolean value);
+
+ /**
+ * ianjuta_project_set_string_property:
+ * @obj: Self
+ * @node: Parent node
+ * @property: Property
+ * @value: Property value
+ * @err: Error propagation and reporting
+ *
+ * Set a property type of node to the corresponding value, overwrite
+ * the existing value if it exists.
+ *
+ * Return value: The newly created property, NULL on error
+ */
+ AnjutaProjectProperty *set_string_property (AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *value);
+
+ /**
+ * ianjuta_project_set_list_property:
+ * @obj: Self
+ * @node: Parent node
+ * @type: Node type
+ * @property: Property
+ * @name: Property name
+ * @value: Node name
+ * @err: Error propagation and reporting
+ *
+ * Add a new value to the property type of node to the corresponding.
+ *
+ * Return value: The newly created property, NULL on error
*/
- void free_node (AnjutaProjectNode *node);
+ AnjutaProjectProperty *set_list_property (AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *name, const gchar *value);
+
+ /**
+ * ianjuta_project_remove_property:
+ * @obj: Self
+ * @node: Node
+ * @property: Property
+ * @err: Error propagation and reporting
+ *
+ * Remove a property from a node.
+ *
+ * Return value: TRUE if the property has been successfully removed
+ * else FALSE
+ */
+ gboolean remove_property (AnjutaProjectNode *node, AnjutaProjectProperty *property);
/**
* ianjuta_project_load:
@@ -3279,18 +3343,6 @@ interface IAnjutaProject
AnjutaProjectNode* add_source (AnjutaProjectNode *parent, GFile *file);
/**
- * ianjuta_project_remove_node:
- * @obj: Self
- * @node: node to configure
- * @err: Error propagation and reporting.
- *
- * Remove a node (a group, a target or a source) from the project.
- *
- * Returns: TRUE if the node has been removed
- */
- gboolean remove_node (AnjutaProjectNode *node);
-
- /**
* ianjuta_project_configure_node:
* @obj: Self
* @node: node to configure
diff --git a/plugins/am-project/am-dialogs.c b/plugins/am-project/am-dialogs.c
index 9ae6799..5740a8a 100644
--- a/plugins/am-project/am-dialogs.c
+++ b/plugins/am-project/am-dialogs.c
@@ -64,7 +64,7 @@ on_project_widget_destroy (GtkWidget *wid, AmpConfigureProjectDialog *dlg)
}
static void
-add_entry (AmpProject *project, AnjutaProjectNode *node, AnjutaProjectPropertyItem *prop, GtkWidget *table, gint *position)
+add_entry (AmpProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *prop, GtkWidget *table, gint *position)
{
GtkWidget *label;
GtkWidget *entry = NULL;
@@ -185,8 +185,8 @@ amp_configure_project_dialog (AmpProject *project, GError **error)
GtkWidget *table;
gint pos;
gchar *name;
- AnjutaProjectPropertyItem *prop;
- AnjutaProjectPropertyList *list;
+ AnjutaProjectProperty *prop;
+ AnjutaProjectProperty *list;
bxml = anjuta_util_builder_new (GLADE_FILE, NULL);
if (!bxml) return NULL;
@@ -233,8 +233,8 @@ amp_configure_group_dialog (AmpProject *project, AmpGroup *group, GError **error
gint extra_pos;
AmpConfigureProjectDialog *dlg;
gchar *name;
- AnjutaProjectPropertyList *list;
- AnjutaProjectPropertyItem *prop;
+ AnjutaProjectProperty *list;
+ AnjutaProjectProperty *prop;
bxml = anjuta_util_builder_new (GLADE_FILE, NULL);
if (!bxml) return NULL;
@@ -258,7 +258,7 @@ amp_configure_group_dialog (AmpProject *project, AmpGroup *group, GError **error
list = ANJUTA_PROJECT_NODE_DATA ((AnjutaProjectNode *)group)->properties;
for (prop = anjuta_project_property_first (list); prop != NULL; prop = anjuta_project_property_next (prop))
{
- AnjutaProjectPropertyItem *item;
+ AnjutaProjectProperty *item;
item = anjuta_project_property_override (list, prop);
if (item != NULL)
@@ -289,8 +289,8 @@ amp_configure_target_dialog (AmpProject *project, AmpTarget *target, GError **er
AmpConfigureProjectDialog *dlg;
AnjutaProjectTargetType type;
const gchar *name;
- AnjutaProjectPropertyList *list;
- AnjutaProjectPropertyItem *prop;
+ AnjutaProjectProperty *list;
+ AnjutaProjectProperty *prop;
bxml = anjuta_util_builder_new (GLADE_FILE, NULL);
if (!bxml) return NULL;
@@ -315,7 +315,7 @@ amp_configure_target_dialog (AmpProject *project, AmpTarget *target, GError **er
list = ANJUTA_PROJECT_NODE_DATA ((AnjutaProjectNode *)target)->properties;
for (prop = anjuta_project_property_first (list); prop != NULL; prop = anjuta_project_property_next (prop))
{
- AnjutaProjectPropertyItem *item;
+ AnjutaProjectProperty *item;
item = anjuta_project_property_override (list, prop);
if (item != NULL)
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index a5147a0..639c376 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -1053,11 +1053,11 @@ foreach_node_destroy (AnjutaProjectNode *g_node,
}
}
-static void
+static gboolean
project_node_destroy (AmpProject *project, AnjutaProjectNode *g_node)
{
- g_return_if_fail (project != NULL);
- g_return_if_fail (AMP_IS_PROJECT (project));
+ 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 */
@@ -1067,6 +1067,8 @@ project_node_destroy (AmpProject *project, AnjutaProjectNode *g_node)
/* now destroy the tree itself */
//g_node_destroy (g_node);
}
+
+ return TRUE;
}
static AnjutaProjectNode *
@@ -1105,7 +1107,7 @@ project_node_new (AmpProject *project, AnjutaProjectNodeType type, GFile *file,
void
amp_project_load_properties (AmpProject *project, AnjutaToken *macro, AnjutaToken *args)
{
- AnjutaProjectPropertyItem *list;
+ AnjutaProjectProperty *list;
//fprintf (stdout, "property list:\n");
//anjuta_token_dump (args);
@@ -3021,7 +3023,7 @@ amp_project_get_file (AmpProject *project)
return project->root_file;
}
-AnjutaProjectPropertyList *
+AnjutaProjectProperty *
amp_project_get_property_list (AmpProject *project)
{
return project->properties;
@@ -3174,12 +3176,6 @@ static gboolean
iproject_refresh (IAnjutaProject *obj, GError **err)
{
//return amp_project_reload (AMP_PROJECT (obj), err);
- return NULL;
-}
-
-static gboolean
-iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
-{
return TRUE;
}
@@ -3206,35 +3202,74 @@ iproject_load_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
}
static AnjutaProjectNode *
-iproject_save_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
+iproject_save_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **error)
{
- return NULL;
+ switch (anjuta_project_node_get_type (node))
+ {
+ case ANJUTA_PROJECT_ROOT:
+ if (!amp_project_save (AMP_PROJECT (obj), error))
+ {
+ node = NULL;
+ }
+ break;
+ default:
+ node = NULL;
+ error_set (error, IANJUTA_PROJECT_ERROR_NOT_SUPPORTED,
+ _("Only the root node can be saved in an autotools project"));
+ break;
+ }
+
+ return node;
}
static AnjutaProjectNode *
-iproject_new_root (IAnjutaProject *obj, GFile *file, GError **err)
+iproject_new_root_node (IAnjutaProject *obj, GFile *file, GError **err)
{
return project_node_new (AMP_PROJECT (obj), ANJUTA_PROJECT_ROOT, file, NULL);
}
static AnjutaProjectNode *
-iproject_new_file (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file, GError **err)
+iproject_add_file_node (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file, GError **err)
{
return NULL;
}
static AnjutaProjectNode *
-iproject_new_name (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name, GError **err)
+iproject_add_name_node (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name, GError **err)
{
return NULL;
}
-static void
-iproject_free_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
+static gboolean
+iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
{
return project_node_destroy (AMP_PROJECT (obj), node);
}
+static AnjutaProjectProperty *
+iproject_set_boolean_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, gboolean value, GError **err )
+{
+ return NULL;
+}
+
+static AnjutaProjectProperty *
+iproject_set_string_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *value, GError **err )
+{
+ return NULL;
+}
+
+static AnjutaProjectProperty *
+iproject_set_list_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *name, const gchar *value, GError **err )
+{
+ return NULL;
+}
+
+static gboolean
+iproject_remove_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, GError **err)
+{
+ return FALSE;
+}
+
static void
iproject_iface_init(IAnjutaProjectIface* iface)
{
@@ -3248,14 +3283,17 @@ iproject_iface_init(IAnjutaProjectIface* iface)
iface->get_target_types = iproject_get_target_types;
iface->load = iproject_load;
iface->refresh = iproject_refresh;
- iface->remove_node = iproject_remove_node;
iface->configure_node = iproject_configure_node;
iface->load_node = iproject_load_node;
iface->save_node = iproject_save_node;
- iface->new_root = iproject_new_root;
- iface->new_file = iproject_new_file;
- iface->new_name = iproject_new_name;
- iface->free_node = iproject_free_node;
+ iface->new_root_node = iproject_new_root_node;
+ iface->add_file_node = iproject_add_file_node;
+ iface->add_name_node = iproject_add_name_node;
+ iface->remove_node = iproject_remove_node;
+ iface->set_boolean_property = iproject_set_boolean_property;
+ iface->set_string_property = iproject_set_string_property;
+ iface->set_list_property = iproject_set_list_property;
+ iface->remove_property = iproject_remove_property;
}
/* Group access functions
diff --git a/plugins/am-project/am-project.h b/plugins/am-project/am-project.h
index 70c890e..7b5216d 100644
--- a/plugins/am-project/am-project.h
+++ b/plugins/am-project/am-project.h
@@ -119,7 +119,7 @@ GList *amp_project_get_config_packages (AmpProject *project, const gchar* modul
GList *amp_project_get_target_types (AmpProject *project, GError **error);
-AnjutaProjectPropertyList *amp_project_get_property_list (AmpProject *project);
+AnjutaProjectProperty *amp_project_get_property_list (AmpProject *project);
//gchar* amp_project_get_property (AmpProject *project, AmpPropertyType type);
//gboolean amp_project_set_property (AmpProject *project, AmpPropertyType type, const gchar* value);
diff --git a/plugins/am-project/am-properties.c b/plugins/am-project/am-properties.c
index 829b579..fdcf44c 100644
--- a/plugins/am-project/am-properties.c
+++ b/plugins/am-project/am-properties.c
@@ -165,8 +165,8 @@ amp_property_free (AnjutaProjectPropertyInfo *prop)
gboolean
amp_node_property_set (AnjutaProjectNode *node, gint token_type, gint position, const gchar *value, AnjutaToken *token)
{
- AnjutaProjectPropertyList **properties = &(ANJUTA_PROJECT_NODE_DATA(node)->properties);
- AnjutaProjectPropertyItem *list;
+ AnjutaProjectProperty **properties = &(ANJUTA_PROJECT_NODE_DATA(node)->properties);
+ AnjutaProjectProperty *list;
gboolean set = FALSE;
for (list = anjuta_project_property_first (*properties); list != NULL; list = anjuta_project_property_next (list))
@@ -197,8 +197,8 @@ amp_node_property_set (AnjutaProjectNode *node, gint token_type, gint position,
gboolean
amp_node_property_add (AnjutaProjectNode *node, AmpPropertyInfo *prop)
{
- AnjutaProjectPropertyList **properties = &(ANJUTA_PROJECT_NODE_DATA(node)->properties);
- AnjutaProjectPropertyItem *list;
+ AnjutaProjectProperty **properties = &(ANJUTA_PROJECT_NODE_DATA(node)->properties);
+ AnjutaProjectProperty *list;
gboolean set = FALSE;
for (list = anjuta_project_property_first (*properties); list != NULL; list = anjuta_project_property_next (list))
@@ -231,10 +231,10 @@ amp_node_property_add (AnjutaProjectNode *node, AmpPropertyInfo *prop)
}
gboolean
-amp_project_property_set (AmpProject *project, AnjutaProjectPropertyItem *prop, const gchar* value)
+amp_project_property_set (AmpProject *project, AnjutaProjectProperty *prop, const gchar* value)
{
- AnjutaProjectPropertyList **properties = &(project->properties);
- AnjutaProjectPropertyItem *item;
+ AnjutaProjectProperty **properties = &(project->properties);
+ AnjutaProjectProperty *item;
AmpPropertyInfo *info;
item = anjuta_project_property_override (*properties, prop);
diff --git a/plugins/am-project/am-properties.h b/plugins/am-project/am-properties.h
index fa2187c..a9c6e6d 100644
--- a/plugins/am-project/am-properties.h
+++ b/plugins/am-project/am-properties.h
@@ -33,7 +33,7 @@ void amp_property_free (AnjutaProjectPropertyInfo *prop);
gboolean amp_node_property_set (AnjutaProjectNode *target, gint token_type, gint position, const gchar *value, AnjutaToken *token);
gboolean amp_node_property_add (AnjutaProjectNode *node, AmpPropertyInfo *info);
-gboolean amp_project_property_set (AmpProject *project, AnjutaProjectPropertyItem *prop, const gchar* value);
+gboolean amp_project_property_set (AmpProject *project, AnjutaProjectProperty *prop, const gchar* value);
GList* amp_get_project_property_list (void);
GList* amp_get_group_property_list (void);
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index 6e0ed3b..22e8ab5 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -141,13 +141,13 @@ list_property (IAnjutaProject *project)
{
if (AMP_IS_PROJECT (project))
{
- AnjutaProjectPropertyList *list;
- AnjutaProjectPropertyItem *prop;
+ AnjutaProjectProperty *list;
+ AnjutaProjectProperty *prop;
list = amp_project_get_property_list (AMP_PROJECT (project));
for (prop = anjuta_project_property_first (list); prop != NULL; prop = anjuta_project_property_next (prop))
{
- AnjutaProjectPropertyItem *item;
+ AnjutaProjectProperty *item;
item = anjuta_project_property_override (list, prop);
if (item != NULL)
@@ -330,12 +330,12 @@ get_type (IAnjutaProject *project, const char *id)
return type;
}
-static AnjutaProjectPropertyItem *
+static AnjutaProjectProperty *
get_project_property (AmpProject *project, const gchar *id)
{
- AnjutaProjectPropertyList *list;
- AnjutaProjectPropertyItem *item;
- AnjutaProjectPropertyItem *prop = NULL;
+ AnjutaProjectProperty *list;
+ AnjutaProjectProperty *item;
+ AnjutaProjectProperty *prop = NULL;
gint best = G_MAXINT;
list = amp_project_get_property_list (project);
@@ -436,7 +436,7 @@ main(int argc, char *argv[])
}
}
- root = ianjuta_project_new_root (project, file, &error);
+ root = ianjuta_project_new_root_node (project, file, &error);
root = ianjuta_project_load_node (project, root, &error);
g_object_unref (file);
}
@@ -455,10 +455,7 @@ main(int argc, char *argv[])
}
else if (g_ascii_strcasecmp (*command, "save") == 0)
{
- if (AMP_IS_PROJECT (project))
- {
- amp_project_save (AMP_PROJECT (project), NULL);
- }
+ ianjuta_project_save_node (project, root, NULL);
}
else if (g_ascii_strcasecmp (*command, "remove") == 0)
{
@@ -541,7 +538,7 @@ main(int argc, char *argv[])
{
if (AMP_IS_PROJECT (project))
{
- AnjutaProjectPropertyItem *item;
+ AnjutaProjectProperty *item;
AnjutaProjectPropertyInfo *info = NULL;
item = get_project_property (AMP_PROJECT (project), command[1]);
diff --git a/plugins/dir-project/dir-project.c b/plugins/dir-project/dir-project.c
index 6b59978..214d719 100644
--- a/plugins/dir-project/dir-project.c
+++ b/plugins/dir-project/dir-project.c
@@ -963,12 +963,6 @@ iproject_refresh (IAnjutaProject *obj, GError **err)
return FALSE; //dir_project_reload (DIR_PROJECT (obj), err);
}
-static gboolean
-iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
-{
- return TRUE;
-}
-
static AnjutaProjectNode *
iproject_load_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
{
@@ -982,27 +976,53 @@ iproject_save_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
}
static AnjutaProjectNode *
-iproject_new_root (IAnjutaProject *obj, GFile *file, GError **err)
+iproject_new_root_node (IAnjutaProject *obj, GFile *file, GError **err)
{
return project_node_new (DIR_PROJECT (obj), ANJUTA_PROJECT_ROOT, file, NULL);
}
static AnjutaProjectNode *
-iproject_new_file (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file, GError **err)
+iproject_add_file_node (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file, GError **err)
{
return NULL;
}
static AnjutaProjectNode *
-iproject_new_name (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name, GError **err)
+iproject_add_name_node (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name, GError **err)
{
return NULL;
}
-static void
-iproject_free_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
+static gboolean
+iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
{
- return project_node_destroy (DIR_PROJECT (obj), node);
+ project_node_destroy (DIR_PROJECT (obj), node);
+
+ return TRUE;
+}
+
+static AnjutaProjectProperty *
+iproject_set_boolean_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, gboolean value, GError **err )
+{
+ return NULL;
+}
+
+static AnjutaProjectProperty *
+iproject_set_string_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *value, GError **err )
+{
+ return NULL;
+}
+
+static AnjutaProjectProperty *
+iproject_set_list_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *name, const gchar *value, GError **err )
+{
+ return NULL;
+}
+
+static gboolean
+iproject_remove_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, GError **err)
+{
+ return FALSE;
}
static void
@@ -1018,13 +1038,16 @@ iproject_iface_init(IAnjutaProjectIface* iface)
iface->get_target_types = iproject_get_target_types;
iface->load = iproject_load;
iface->refresh = iproject_refresh;
- iface->remove_node = iproject_remove_node;
iface->load_node = iproject_load_node;
iface->save_node = iproject_save_node;
- iface->new_root = iproject_new_root;
- iface->new_file = iproject_new_file;
- iface->new_name = iproject_new_name;
- iface->free_node = iproject_free_node;
+ iface->new_root_node = iproject_new_root_node;
+ iface->add_file_node = iproject_add_file_node;
+ iface->add_name_node = iproject_add_name_node;
+ iface->remove_node = iproject_remove_node;
+ iface->set_boolean_property = iproject_set_boolean_property;
+ iface->set_string_property = iproject_set_string_property;
+ iface->set_list_property = iproject_set_list_property;
+ iface->remove_property = iproject_remove_property;
}
/* GbfProject implementation
diff --git a/plugins/mk-project/mk-project.c b/plugins/mk-project/mk-project.c
index ed4bf85..6d9a160 100644
--- a/plugins/mk-project/mk-project.c
+++ b/plugins/mk-project/mk-project.c
@@ -1413,12 +1413,6 @@ iproject_refresh (IAnjutaProject *obj, GError **err)
return FALSE; //mkp_project_reload (MKP_PROJECT (obj), err);
}
-static gboolean
-iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
-{
- return TRUE;
-}
-
static AnjutaProjectNode *
iproject_load_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
{
@@ -1432,27 +1426,53 @@ iproject_save_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
}
static AnjutaProjectNode *
-iproject_new_root (IAnjutaProject *obj, GFile *file, GError **err)
+iproject_new_root_node (IAnjutaProject *obj, GFile *file, GError **err)
{
return project_node_new (MKP_PROJECT (obj), ANJUTA_PROJECT_ROOT, file, NULL);
}
static AnjutaProjectNode *
-iproject_new_file (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file, GError **err)
+iproject_add_file_node (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, GFile *file, GError **err)
{
return NULL;
}
static AnjutaProjectNode *
-iproject_new_name (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name, GError **err)
+iproject_add_name_node (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, AnjutaProjectNodeType type, const gchar *name, GError **err)
{
return NULL;
}
-static void
-iproject_free_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
+static gboolean
+iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err)
+{
+ project_node_destroy (MKP_PROJECT (obj), node);
+
+ return TRUE;
+}
+
+static AnjutaProjectProperty *
+iproject_set_boolean_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, gboolean value, GError **err )
+{
+ return NULL;
+}
+
+static AnjutaProjectProperty *
+iproject_set_string_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *value, GError **err )
+{
+ return NULL;
+}
+
+static AnjutaProjectProperty *
+iproject_set_list_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *name, const gchar *value, GError **err )
{
- return project_node_destroy (MKP_PROJECT (obj), node);
+ return NULL;
+}
+
+static gboolean
+iproject_remove_property (IAnjutaProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property, GError **err)
+{
+ return FALSE;
}
static void
@@ -1468,13 +1488,16 @@ iproject_iface_init(IAnjutaProjectIface* iface)
iface->get_target_types = iproject_get_target_types;
iface->load = iproject_load;
iface->refresh = iproject_refresh;
- iface->remove_node = iproject_remove_node;
iface->load_node = iproject_load_node;
iface->save_node = iproject_save_node;
- iface->new_root = iproject_new_root;
- iface->new_file = iproject_new_file;
- iface->new_name = iproject_new_name;
- iface->free_node = iproject_free_node;
+ iface->new_root_node = iproject_new_root_node;
+ iface->add_file_node = iproject_add_file_node;
+ iface->add_name_node = iproject_add_name_node;
+ iface->remove_node = iproject_remove_node;
+ iface->set_boolean_property = iproject_set_boolean_property;
+ iface->set_string_property = iproject_set_string_property;
+ iface->set_list_property = iproject_set_list_property;
+ iface->remove_property = iproject_remove_property;
}
/* GObject implementation
diff --git a/plugins/project-manager/project.c b/plugins/project-manager/project.c
index 22916e2..99d17fc 100644
--- a/plugins/project-manager/project.c
+++ b/plugins/project-manager/project.c
@@ -193,7 +193,7 @@ pm_project_thread_main_loop (AnjutaPmProject *project)
switch (job->command)
{
case LOAD:
- root = ianjuta_project_new_root (project->project, job->file, NULL);
+ root = ianjuta_project_new_root_node (project->project, job->file, NULL);
node = ianjuta_project_load_node (project->project, root, &(job->error));
g_message ("load get root %p node %p, error %p", root, node, job->error);
if (job->error == NULL)
@@ -202,7 +202,7 @@ pm_project_thread_main_loop (AnjutaPmProject *project)
}
else
{
- ianjuta_project_free_node (project->project, root, NULL);
+ ianjuta_project_remove_node (project->project, root, NULL);
}
break;
case RELOAD:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]