respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 0, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_DOT, 0);
gtk_object_destroy((GtkObject *) Dlg);
cursor = gdk_cursor_new(GDK_HAND2);
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 1, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_NEATO, 0);
gtk_object_destroy((GtkObject *) Dlg);
gtk_button_set_image(GTK_BUTTON
(glade_xml_get_widget(xml, "btn_neato")),
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 2, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_TWOPI, 0);
gtk_object_destroy((GtkObject *) Dlg);
}
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 3, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_CIRCO, 0);
gtk_object_destroy((GtkObject *) Dlg);
}
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 4, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_FDP, 0);
gtk_object_destroy((GtkObject *) Dlg);
break;
case 4:
if (strstr(ss, "ALL_ENGINES")) {
- attr[attrcount].Engine[0] = 1;
- attr[attrcount].Engine[1] = 1;
- attr[attrcount].Engine[2] = 1;
- attr[attrcount].Engine[3] = 1;
- attr[attrcount].Engine[4] = 1;
+ attr[attrcount].Engine[GVK_DOT] = 1;
+ attr[attrcount].Engine[GVK_NEATO] = 1;
+ attr[attrcount].Engine[GVK_TWOPI] = 1;
+ attr[attrcount].Engine[GVK_CIRCO] = 1;
+ attr[attrcount].Engine[GVK_FDP] = 1;
} else {
- attr[attrcount].Engine[0] =
+ attr[attrcount].Engine[GVK_DOT] =
strstr(ss, "DOT") ? 1 : 0;
- attr[attrcount].Engine[1] =
+ attr[attrcount].Engine[GVK_NEATO] =
strstr(ss, "NEATO") ? 1 : 0;
- attr[attrcount].Engine[2] =
+ attr[attrcount].Engine[GVK_TWOPI] =
strstr(ss, "TWOPI") ? 1 : 0;
- attr[attrcount].Engine[3] =
+ attr[attrcount].Engine[GVK_CIRCO] =
strstr(ss, "CIRCO") ? 1 : 0;
- attr[attrcount].Engine[4] =
+ attr[attrcount].Engine[GVK_FDP] =
strstr(ss, "FDP") ? 1 : 0;
}
break;
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 0, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_DOT, 0);
gtk_object_destroy((GtkObject *) Dlg);
cursor = gdk_cursor_new(GDK_HAND2);
"This will change the graph layout\n all your position changes will be lost\n Are you sure?");
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 1, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_NEATO, 0);
gtk_object_destroy((GtkObject *) Dlg);
}
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 2, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_TWOPI, 0);
gtk_object_destroy((GtkObject *) Dlg);
}
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 3, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_CIRCO, 0);
gtk_object_destroy((GtkObject *) Dlg);
}
respond = gtk_dialog_run((GtkDialog *) Dlg);
if (respond == GTK_RESPONSE_YES)
- do_graph_layout(view->g[view->activeGraph], 4, 0);
+ do_graph_layout(view->g[view->activeGraph], GVK_FDP, 0);
gtk_object_destroy((GtkObject *) Dlg);
}
} attribute;
+typedef enum { GVK_DOT,GVK_NEATO,GVK_TWOPI,GVK_CIRCO,GVK_FDP } gvk_layout;
+
//bind this to cgraph g
typedef struct _custom_graph_data {
Agrec_t h;
int AlwaysShow; //active or not draw it
int TopView; //default 0, 1 for topview data, dots and lines
int Locked;
- int Engine; //enum GVEngine{DOT,NEATO,TWOPI,CIRCO,FDP};
+ gvk_layout Engine;
//graph's location, change these to move the whole graph
int Modified; //if graph has been modified after loading
float offsetx;
int selectedEdgesCount;
} custom_graph_data;
+#define GD_Engine(g) (((custom_graph_data*)AGDATA(g))->Engine)
+#define GD_GraphFileName(g) (((custom_graph_data*)AGDATA(g))->GraphFileName)
+#define GD_Modified(g) (((custom_graph_data*)AGDATA(g))->Modified)
-
-enum GEunit { GEpixels, GEinches, GEmm };
-
+typedef enum { GEpixels, GEinches, GEmm } GEunit;
typedef struct _custom_object_data //has to be attached to every Node, Edge, Graph and cluster
{
float bdxRight,bdyBottom,bdzBottom;
/*reserved , not being used yet*/
- enum GEunit unit; //default pixels :0
+ GEunit unit; //default pixels :0
/*variable to hold mouse coordinates temporarily*/
float GLx,GLy,GLz;