[graph-gtk] Made GraphGtkNode's recalculate_size method virtual



commit e9ed521f988aa9b7eda69dba3c0364bfcc100c6a
Author: Isaac Wagner <isaacbw src gnome org>
Date:   Sat Aug 4 11:01:33 2012 -0400

    Made GraphGtkNode's recalculate_size method virtual

 graph-gtk/graph-gtk-node.c |   10 ++++++++++
 graph-gtk/graph-gtk-node.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/graph-gtk/graph-gtk-node.c b/graph-gtk/graph-gtk-node.c
index 3c62a46..e6fdb0f 100644
--- a/graph-gtk/graph-gtk-node.c
+++ b/graph-gtk/graph-gtk-node.c
@@ -72,6 +72,7 @@ void cairo_image_surface_blur( cairo_surface_t* surface, double radius )
 static void graph_gtk_node_dispose (GObject *object);
 static void graph_gtk_node_finalize (GObject *object);
 static void graph_gtk_node_render_default(GraphGtkNode* self, cairo_t* cairo);
+static gboolean graph_gtk_node_recalculate_size_default(GraphGtkNode* self);
 
 G_DEFINE_TYPE (GraphGtkNode, graph_gtk_node, G_TYPE_OBJECT);
 
@@ -84,6 +85,7 @@ graph_gtk_node_class_init (GraphGtkNodeClass *klass)
   gobject_class->finalize = graph_gtk_node_finalize;
 
   klass->render_node = graph_gtk_node_render_default;
+  klass->recalculate_size = graph_gtk_node_recalculate_size_default;
 }
 
 static void
@@ -368,6 +370,14 @@ graph_gtk_node_connect_to(GraphGtkNode* source, const gchar* output_pad, GraphGt
 gboolean
 graph_gtk_node_recalculate_size(GraphGtkNode* self)
 {
+  g_return_if_fail(IS_GRAPH_GTK_NODE(self));
+
+  return GRAPH_GTK_NODE_GET_CLASS(self)->recalculate_size(self);
+}
+
+gboolean
+graph_gtk_node_recalculate_size_default(GraphGtkNode* self)
+{
   GraphGtkView *view = self->view;
   if(!view)
     return FALSE;
diff --git a/graph-gtk/graph-gtk-node.h b/graph-gtk/graph-gtk-node.h
index e02d066..b9bb58c 100644
--- a/graph-gtk/graph-gtk-node.h
+++ b/graph-gtk/graph-gtk-node.h
@@ -39,6 +39,7 @@ struct _GraphGtkNodeClass
 {
   GObjectClass parent_class;
   void (*render_node) (GraphGtkNode* self, cairo_t* cairo);
+  gboolean (*recalculate_size) (GraphGtkNode *self);
 };
 
 struct _GraphGtkNode



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