[anjuta/newproject: 160/160] libanjuta: Remove some dead code in anjuta-project



commit bf7e77d00fecb28f2756d4030eb023a09fd3a769
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Wed Nov 3 21:59:03 2010 +0100

    libanjuta: Remove some dead code in anjuta-project

 libanjuta/anjuta-project.c |  418 --------------------------------------------
 libanjuta/anjuta-project.h |   51 ------
 2 files changed, 0 insertions(+), 469 deletions(-)
---
diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c
index d0e89b4..00c983f 100644
--- a/libanjuta/anjuta-project.c
+++ b/libanjuta/anjuta-project.c
@@ -1134,63 +1134,6 @@ struct _AnjutaProjectProxyNode{
 AnjutaProjectNode *
 anjuta_project_proxy_new (AnjutaProjectNode *node)
 {
-#if 0	
-	AnjutaProjectNode *proxy;
-	GTypeQuery node_type_info;
-	GTypeQuery base_type_info;
-	guint extra_size;
-	
-
-	/* Clone node object */
-	proxy = g_object_new (G_TYPE_FROM_INSTANCE (node), NULL);
-
-	/* Swap specific data */
-	g_type_query (G_TYPE_FROM_INSTANCE (node), &node_type_info);
-	g_type_query (ANJUTA_TYPE_PROJECT_NODE, &base_type_info);
-
-	extra_size = node_type_info.instance_size - base_type_info.instance_size;
-	if (extra_size > 0)
-	{
-		gchar *data;
-
-		data = g_new (gchar , extra_size);
-		memcpy (data, ((gchar *)node) +  base_type_info.instance_size, extra_size);
-		memcpy (((gchar *)node) +  base_type_info.instance_size, ((gchar *)proxy) +  base_type_info.instance_size, extra_size);
-		memcpy (((gchar *)proxy) +  base_type_info.instance_size, data, extra_size);
-		g_free (data);
-	}
-
-	/* Copy node data */
-	proxy->type = node->type;
-	proxy->file = node->file != NULL ? g_file_dup (node->file) : NULL;
-	proxy->name = g_strdup (node->name);
-	proxy->state = node->state;
-
-	/* Shallow copy of all properties */
-	if ((node->properties == NULL) || (((AnjutaProjectPropertyInfo *)node->properties->data)->override == NULL))
-	{
-		proxy->properties = node->properties;
-	}
-	else
-	{
-		GList *item;
-
-		proxy->properties = node->properties;
-		node->properties = g_list_copy (proxy->properties);
-		for (item = g_list_first (node->properties); item != NULL; item = g_list_next (item))
-		{
-			AnjutaProjectPropertyInfo *info = (AnjutaProjectPropertyInfo *)item->data;
-			AnjutaProjectPropertyInfo *new_info;
-
-			new_info = g_slice_new0(AnjutaProjectPropertyInfo);
-			new_info->name = g_strdup (info->name);
-			new_info->type = info->type;
-			new_info->value = g_strdup (info->value);
-			new_info->override = info->override;
-			item->data = new_info;
-		}
-	}
-#endif	
 	AnjutaProjectProxyNode *proxy;
 	GList *item;
 	
@@ -1307,13 +1250,6 @@ anjuta_project_proxy_exchange (AnjutaProjectNode *proxy, AnjutaProjectNode *node
 	node->custom_properties = proxy->custom_properties;
 	proxy->custom_properties = NULL;
 	
-#if 0	
-	AnjutaProjectNodeData *data;
-	
-	data = proxy->data;
-	proxy->data = node->data;
-	node->data = data;
-#endif	
 	return proxy;
 }
 
@@ -1339,357 +1275,3 @@ anjuta_project_node_is_proxy (AnjutaProjectNode *node)
 
 	return NODE_DATA (node)->type & ANJUTA_PROJECT_PROXY ? TRUE : FALSE;
 }
-
-#if 0
-typedef struct {
-	AnjutaProjectNodeData base;
-	gpointer data;
-	guint reference;
-} AnjutaProjectIntrospectionData;
-
-
-/**
- * anjuta_project_introspection_node_new:
- * 
- * @type: node type
- * @file: (allow-none): file
- * @name: file name
- * @user_data:
- * 
- * Returns: (transfer none): A list of #GFile corresponding to
- * each target of the requested type or %NULL if none exists. Free the returned list
- * with g_list_free() and the files with g_object_unref().
- */
-AnjutaProjectNode *
-anjuta_project_introspection_node_new (AnjutaProjectNodeType type, GFile *file, const gchar *name, gpointer user_data)
-{
-	AnjutaProjectIntrospectionData *data;
-	AnjutaProjectNode *node;
-
-	data = g_slice_new0(AnjutaProjectIntrospectionData); 
-	data->base.type = type;
-	data->base.properties = NULL;
-	data->base.file = file != NULL ? g_object_ref (file) : NULL;
-	data->base.name = name != NULL ? g_strdup (name) : NULL;
-	data->data = user_data;
-
-	node = g_node_new (data);
-	//g_message ("New node %p data %p", node, data);
-
-	return node;
-}
-
-/**
- * anjuta_project_introspection_node_new0:
- * 
- * Blah Blah
- * 
- * Returns: (transfer none): A list of #GFile corresponding to
- * each target of the requested type or %NULL if none exists. Free the returned list
- * with g_list_free() and the files with g_object_unref().
- */
-AnjutaProjectNode *
-anjuta_project_introspection_node_new0 (void)
-{
-	AnjutaProjectIntrospectionData *data;
-
-	data = g_slice_new0(AnjutaProjectIntrospectionData); 
-	data->base.type = 0;
-	data->base.properties = NULL;
-	data->base.file = NULL;
-	data->base.state = 0;
-
-    return g_node_new (data);
-	
-}
-
-void
-anjuta_project_introspection_node_free (AnjutaProjectNode *node)
-{
-    AnjutaProjectIntrospectionData *data = (AnjutaProjectIntrospectionData *)node->data;
-	
-	//g_message ("Free node %p data %p", node, data);
-	if (data->base.file) g_object_unref (data->base.file);
-	if (data->base.name) g_free (data->base.name);
-	
-    g_slice_free (AnjutaProjectIntrospectionData, data);
-	
-	g_node_destroy (node);
-}
-
-/**
- * anjuta_project_introspection_node_get_user_data
- * 
- * @node: node type
- * 
- * Returns: A list of #GFile corresponding to
- * each target of the requested type or %NULL if none exists. Free the returned list
- * with g_list_free() and the files with g_object_unref().
- */
-gpointer
-anjuta_project_introspection_node_get_user_data (AnjutaProjectNode *node)
-{
-    AnjutaProjectIntrospectionData *data = (AnjutaProjectIntrospectionData *)node->data;
-
-	return data->data;
-}
-
-/* Implement GObject
- *---------------------------------------------------------------------------*/
-
-static unsigned int signals[LAST_SIGNAL] = { 0 };
-
-G_DEFINE_TYPE (AnjutaProjectGObjectNode, anjuta_project_gobject_node, G_TYPE_OBJECT);
-
-static void
-anjuta_project_gobject_node_init (AnjutaProjectGObjectNode *node)
-{
-	node->next = NULL;
-	node->prev = NULL;
-	node->parent = NULL;
-	node->children = NULL;
-	node->base.type = 0;
-	node->base.properties = NULL;
-	node->base.file = NULL;
-	node->base.name = NULL;
-	node->data = NULL;	
-}
-
-static void
-anjuta_project_gobject_node_dispose (GObject *object)
-{
-	AnjutaProjectGObjectNode *node = ANJUTA_PROJECT_GOBJECT_NODE(object);
-
-	if (node->base.file != NULL) g_object_unref (node->base.file);
-	node->base.file = NULL;
-	
-	G_OBJECT_CLASS (anjuta_project_gobject_node_parent_class)->dispose (object);
-}
-
-static void
-anjuta_project_gobject_node_finalize (GObject *object)
-{
-	AnjutaProjectGObjectNode *node = ANJUTA_PROJECT_GOBJECT_NODE(object);
-
-	if (node->base.name != NULL) g_free (node->base.name);
-
-	G_OBJECT_CLASS (anjuta_project_gobject_node_parent_class)->finalize (object);
-}
-
-static void 
-anjuta_project_gobject_node_get_property (GObject    *object,
-	      guint       prop_id,
-	      GValue     *value,
-	      GParamSpec *pspec)
-{
-	AnjutaProjectGObjectNode *node = ANJUTA_PROJECT_GOBJECT_NODE(object);
-        
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-}
-
-static void 
-anjuta_project_gobject_node_set_property (GObject      *object,
-	      guint         prop_id,
-	      const GValue *value,
-	      GParamSpec   *pspec)
-{
-	AnjutaProjectGObjectNode *node = ANJUTA_PROJECT_GOBJECT_NODE(object);
-       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-}
-
-static void
-anjuta_project_gobject_node_class_init (AnjutaProjectGObjectNodeClass *klass)
-{
-	GObjectClass* object_class = G_OBJECT_CLASS (klass);
-	
-	object_class->finalize = anjuta_project_gobject_node_finalize;
-	object_class->dispose = anjuta_project_gobject_node_dispose;
-	object_class->get_property = anjuta_project_gobject_node_get_property;
-	object_class->set_property = anjuta_project_gobject_node_set_property;
-
- 	/*Change both signal to use marshal_VOID__POINTER_BOXED
-	adding a AnjutaProjectNode pointer corresponding to the
-	 loaded node => done
-	 Such marshal doesn't exist as glib marshal, so look in the
-	 symbol db plugin how to add new marshal => done
-	 ToDo :
-	 This new argument can be used in the plugin object in
-	 order to add corresponding shortcut when the project
-	 is loaded and a new node is loaded.
-	 The plugin should probably get the GFile from the
-	 AnjutaProjectNode object and then use a function
-	 in project-view.c to create the corresponding shortcut*/
-	
-	signals[UPDATED] = g_signal_new ("updated",
-	    G_OBJECT_CLASS_TYPE (object_class),
-	    G_SIGNAL_RUN_LAST,
-	    G_STRUCT_OFFSET (AnjutaProjectGObjectNodeClass, updated),
-	    NULL, NULL,
-        anjuta_cclosure_marshal_VOID__STRING_BOXED,
-	    G_TYPE_NONE,
-	    2,
-	    G_TYPE_POINTER,
-	    G_TYPE_ERROR);
-	
-	signals[LOADED] = g_signal_new ("loaded",
-		G_OBJECT_CLASS_TYPE (object_class),
-		G_SIGNAL_RUN_LAST,
-		G_STRUCT_OFFSET (AnjutaProjectGObjectNodeClass, loaded),
-		NULL, NULL,
-        anjuta_cclosure_marshal_VOID__STRING_BOXED,
-		G_TYPE_NONE,
-		2,
-	    G_TYPE_POINTER,
-		G_TYPE_ERROR);
-
-	g_object_class_install_property 
-                (G_OBJECT_CLASS (klass), PROP_TYPE,
-                 g_param_spec_pointer ("type", 
-                                       "Type",
-                                       "Node type",
-                                       G_PARAM_READWRITE));
-
-	g_object_class_install_property 
-                (G_OBJECT_CLASS (klass), PROP_STATE,
-                 g_param_spec_pointer ("state", 
-                                       "Stroject",
-                                       "GbfProject Object",
-                                       G_PARAM_READWRITE));
-
-	g_object_class_install_property 
-                (G_OBJECT_CLASS (klass), PROP_DATA,
-                 g_param_spec_pointer ("project", 
-                                       "Project",
-                                       "GbfProject Object",
-                                       G_PARAM_READWRITE));
-
-	g_object_class_install_property 
-                (G_OBJECT_CLASS (klass), PROP_NAME,
-                 g_param_spec_string ("name", 
-                                      "Name",
-                                      "GbfProject Object",
-				       "",
-                                       G_PARAM_READWRITE));
-
-	g_object_class_install_property 
-                (G_OBJECT_CLASS (klass), PROP_FILE,
-                 g_param_spec_object ("file", 
-                                       "PDroject",
-                                       "GbfProject Object",
-				       G_TYPE_FILE,
-                                       G_PARAM_READWRITE));
-
-}
-
-/* Constructor & Destructor
- *---------------------------------------------------------------------------*/
-
-/**
- * anjuta_project_gobject_node_new:
- * 
- * @type: node type
- * @file: (allow-none): file
- * @name: file name
- * @user_data:
- * 
- * Returns: A list of #GFile corresponding to
- * each target of the requested type or %NULL if none exists. Free the returned list
- * with g_list_free() and the files with g_object_unref().
- */
-AnjutaProjectGObjectNode*
-anjuta_project_gobject_node_new (AnjutaProjectNodeType type, GFile *file, const gchar *name, gpointer user_data)
-{
-	AnjutaProjectGObjectNode* node;
-
-	node = g_object_new (ANJUTA_TYPE_PROJECT_GOBJECT_NODE, NULL);
-	node->base.type = type;
-	if (file != NULL) node->base.file = g_object_ref (file);
-	if (name != NULL) node->base.name = g_strdup (name);
-	node->data = user_data;
-	//g_message ("New gnode %p", node);
-
-	return node;
-}
-
-void
-anjuta_project_gobject_node_free (AnjutaProjectGObjectNode* node)
-{
-//	g_message ("Free gnode %p", node);
-	g_object_unref (node);
-}
-
-// (type ANJUTA_TYPE_PROJECT_BOXED_NODE):
-
-/**
- * anjuta_project_boxed_node_new:
- * 
- * @type: node type
- * @file: (allow-none): file
- * @name: file name
- * @user_data:
- * 
- * Returns: (type Anjuta.TYPE_PROJECT_BOXED_NODE):  A list of #GFile corresponding to
- * each target of the requested type or %NULL if none exists. Free the returned list
- * with g_list_free() and the files with g_object_unref().
- */
-AnjutaProjectNode *
-anjuta_project_boxed_node_new (AnjutaProjectNodeType type, GFile *file, const gchar *name, gpointer user_data)
-{
-	AnjutaProjectIntrospectionData *data;
-	AnjutaProjectNode *node;
-
-	data = g_slice_new0(AnjutaProjectIntrospectionData); 
-	data->base.type = type;
-	data->base.properties = NULL;
-	data->base.file = file != NULL ? g_object_ref (file) : NULL;
-	data->base.name = name != NULL ? g_strdup (name) : NULL;
-	data->data = user_data;
-	data->reference = 1;
-
-	node = g_node_new (data);
-	//g_message ("New node %p data %p", node, data);
-
-	return node;
-}
-
-static gpointer
-anjuta_project_boxed_node_copy (gpointer boxed)
-{
-	AnjutaProjectNode *node = (AnjutaProjectNode *)boxed;
-	AnjutaProjectIntrospectionData *data = (AnjutaProjectIntrospectionData *)node->data;
-
-	data->reference++;
-
-	return boxed;
-}
-
-static void
-anjuta_project_boxed_node_free (gpointer boxed)
-{
-	AnjutaProjectNode *node = (AnjutaProjectNode *)boxed;
-	AnjutaProjectIntrospectionData *data = (AnjutaProjectIntrospectionData *)node->data;
-
-	data->reference--;
-	if (data->reference == 0)
-	{
-		anjuta_project_introspection_node_free (node);
-	}
-}
-
-void
-anjuta_project_boxed_node_register (void)
-{
- 	g_boxed_type_register_static ("ANJUTA_TYPE_PROJECT_BOXED_NODE", anjuta_project_boxed_node_copy, anjuta_project_boxed_node_free);
-}
-
-GType
-anjuta_project_boxed_node_get_type (void)
-{
-  static GType type_id = 0;
-
-  if (!type_id)
- 	type_id = g_boxed_type_register_static ("ANJUTA_TYPE_PROJECT_BOXED_NODE", anjuta_project_boxed_node_copy, anjuta_project_boxed_node_free);
-	
-  return type_id;
-}
-#endif
diff --git a/libanjuta/anjuta-project.h b/libanjuta/anjuta-project.h
index 5d1e651..5890faf 100644
--- a/libanjuta/anjuta-project.h
+++ b/libanjuta/anjuta-project.h
@@ -265,57 +265,6 @@ AnjutaProjectNode *anjuta_project_proxy_get_node (AnjutaProjectNode *proxy);
 
 gboolean anjuta_project_node_is_proxy (AnjutaProjectNode *node);
 
-
-/* Temporary function for introspection */
-AnjutaProjectNode * anjuta_project_introspection_node_new (AnjutaProjectNodeType type, GFile *file, const gchar *name, gpointer user_data);
-AnjutaProjectNode * anjuta_project_introspection_node_new0 (void);
-gpointer anjuta_project_introspection_node_get_user_data (AnjutaProjectNode *node);
-void anjuta_project_introspection_node_free (AnjutaProjectNode *node);
-
-void anjuta_project_boxed_node_register (void);
-AnjutaProjectNode *anjuta_project_boxed_node_new (AnjutaProjectNodeType type, GFile *file, const gchar *name, gpointer user_data);
-GType anjuta_project_boxed_node_get_type (void);
-
-#define ANJUTA_TYPE_PROJECT_BOXED_NODE             (anjuta_project_boxed_node_get_type ())
-
-
-#define ANJUTA_TYPE_PROJECT_GOBJECT_NODE             		(anjuta_project_gobject_node_get_type ())
-#define ANJUTA_PROJECT_GOBJECT_NODE(obj)             			(G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PROJECT_GOBJECT_NODE, AnjutaProjectGObjectNode))
-#define ANJUTA_PROJECT_GOBJECT_NODE_CLASS(klass)     	(G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_PROJECT_GOBJECT_NODE, AnjutaProjectGObjectNodeClass))
-#define ANJUTA_IS_PROJECT_GOBJECT_NODE(obj)          		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_PROJECT_GOBJECT_NODE))
-#define ANJUTA_IS_PROJECT_GOBJECT_NODE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_PROJECT_GOBJECT_NODE))
-#define ANJUTA_PROJECT_GOBJECT_NODE_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_PROJECT_GOBJECT_NODE, AnjutaProjectGObjectNodeClass))
-
-typedef struct _AnjutaProjectGObjectNodeClass AnjutaProjectGObjectNodeClass;
-typedef struct _AnjutaProjectGObjectNode AnjutaProjectGObjectNode;
-
-struct _AnjutaProjectGObjectNodeClass
-{
-	GObjectClass parent_class;
-
-	void (*updated) (GError *error);
-	void (*loaded) (GError *error);
-};
-
-struct _AnjutaProjectGObjectNode
-{
-	GObject object;
-	
-    GNode	  *next;
-  	GNode	  *prev;
-  	GNode	  *parent;
-  	GNode	  *children;
-	AnjutaProjectNodeData base;
-	gpointer 	data;
-};
-
-GType anjuta_project_gobject_node_get_type (void) G_GNUC_CONST;
-
-AnjutaProjectGObjectNode* anjuta_project_gobject_node_new (AnjutaProjectNodeType type, GFile *file, const gchar *name, gpointer user_data);
-void anjuta_project_gobject_node_free (AnjutaProjectGObjectNode* project);
-
-void anjuta_project_node_register_boxed (void);
-
 G_END_DECLS
 
 #endif



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