[anjuta-extras] class-inheritance: Combined layout and draw since they need to happen together



commit 958c9562cb34922c8351f670b4a1096d9c3a84ac
Author: Naba Kumar <naba gnome org>
Date:   Tue Mar 2 23:15:23 2010 +0200

    class-inheritance: Combined layout and draw since they need to happen together

 plugins/class-inheritance/class-callbacks.c |    3 ---
 plugins/class-inheritance/class-inherit.c   |   23 +++++------------------
 plugins/class-inheritance/plugin.h          |    1 -
 3 files changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/plugins/class-inheritance/class-callbacks.c b/plugins/class-inheritance/class-callbacks.c
index c0535aa..abffd56 100644
--- a/plugins/class-inheritance/class-callbacks.c
+++ b/plugins/class-inheritance/class-callbacks.c
@@ -62,7 +62,6 @@ on_expanded_class_title_event (GnomeCanvasItem *item, GdkEvent *event,
 		    cls_node->expansion_status != CLS_NODE_COLLAPSED &&
 		    cls_node_collapse (cls_node))
 		{
-			cls_inherit_layout (cls_node->plugin);
 			cls_inherit_draw(cls_node->plugin);
 			return TRUE;
 		}
@@ -152,7 +151,6 @@ on_expanded_class_more_event (GnomeCanvasItem *item, GdkEvent *event,
 		    cls_node->expansion_status == CLS_NODE_SEMI_EXPANDED &&
 		    cls_node_expand (cls_node, CLS_NODE_FULL_EXPANDED))
 		{
-			cls_inherit_layout (cls_node->plugin);
 			cls_inherit_draw(cls_node->plugin);
 		}
 		break;
@@ -193,7 +191,6 @@ on_collapsed_class_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
 		{
 			if (cls_node_expand (cls_node, CLS_NODE_SEMI_EXPANDED))
 			{
-			    cls_inherit_layout (plugin);
 			    cls_inherit_draw(plugin);
 		    }
 			return TRUE;
diff --git a/plugins/class-inheritance/class-inherit.c b/plugins/class-inheritance/class-inherit.c
index f847f33..7dc3de9 100644
--- a/plugins/class-inheritance/class-inherit.c
+++ b/plugins/class-inheritance/class-inherit.c
@@ -830,6 +830,10 @@ cls_inherit_draw (AnjutaClassInheritance *plugin)
 {
 	ClsBox bounds;
 
+	gvLayout (plugin->gvc, plugin->graph, "dot");
+	/* DEBUG */
+	/* gvRenderFilename (plugin->gvc, plugin->graph, "png", "class-inheritance-test.png"); */
+	
 	/* set the size of the canvas. We need this to set the scrolling.. */
 	bounds.x1 = 0;
 	bounds.y1 = 0;
@@ -845,24 +849,8 @@ cls_inherit_draw (AnjutaClassInheritance *plugin)
 	gnome_canvas_set_scroll_region (GNOME_CANVAS (plugin->canvas),
 	                                bounds.x1 - 10, bounds.y1 - 10,
 	                                bounds.x2 + 10, bounds.y2 + 10);
-}
-
-/*----------------------------------------------------------------------------
- * draw the graph on the canvas. So nodes, edges, arrows, texts..
- */
-void
-cls_inherit_layout (AnjutaClassInheritance *plugin)
-{
-	g_return_if_fail (plugin->graph != NULL);
-
-	if (plugin->layout_started)
-		gvFreeLayout(plugin->gvc, plugin->graph);
 
-	gvLayout (plugin->gvc, plugin->graph, "dot");
-	plugin->layout_started = TRUE;
-
-	/* DEBUG */
-	/* gvRenderFilename (plugin->gvc, plugin->graph, "png", "class-inheritance-test.png"); */
+	gvFreeLayout(plugin->gvc, plugin->graph);
 }
 
 /*----------------------------------------------------------------------------
@@ -969,7 +957,6 @@ cls_inherit_update (AnjutaClassInheritance *plugin)
 
 	g_object_unref (iter);
 
-	cls_inherit_layout (plugin);
 	cls_inherit_draw (plugin);
 }
 
diff --git a/plugins/class-inheritance/plugin.h b/plugins/class-inheritance/plugin.h
index cfcb2dd..270c3f1 100644
--- a/plugins/class-inheritance/plugin.h
+++ b/plugins/class-inheritance/plugin.h
@@ -55,7 +55,6 @@ struct _AnjutaClassInheritance {
 	/* graphviz stuff */	
 	GVC_t *gvc;
 	Agraph_t *graph;
-	gboolean layout_started;
 	
 	gchar *top_dir;
 	guint root_watch_id;



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