17#include <glade/glade.h>
48 return GLUT_BITMAP_9_BY_15;
51 return GLUT_BITMAP_8_BY_13;
54 return GLUT_BITMAP_TIMES_ROMAN_10;
57 return GLUT_BITMAP_HELVETICA_10;
60 return GLUT_BITMAP_HELVETICA_12;
63 return GLUT_BITMAP_HELVETICA_18;
66 return GLUT_BITMAP_TIMES_ROMAN_10;
80 if (!buf || *buf ==
'\0')
191 FILE *input_file =
NULL;
192 FILE *input_file2 =
NULL;
197 "default attributes template graph file \"%s\" not found\n",
206 "could not load default attributes template graph file \"%s\"\n",
212 input_file2 = fopen(
path,
"rb");
216 char *attrwidgets =
smyrnaPath(
"attr_widgets.dot");
217 fprintf(stderr,
"default attributes template graph file \"%s\" not found\n", attrwidgets);
223 fclose (input_file2);
225 char *attrwidgets =
smyrnaPath(
"attr_widgets.dot");
226 fprintf(stderr,
"could not load default attribute widgets graph file \"%s\"\n", attrwidgets);
300 vi->
timer = g_timer_new();
301 vi->
timer2 = g_timer_new();
302 vi->
timer3 = g_timer_new();
304 g_timer_stop(vi->
timer);
339 if (!(input_file = fopen(filename,
"r"))) {
340 g_print(
"Cannot open %s\n", filename);
346 g_print(
"Cannot read graph in %s\n", filename);
353 g_print(
"There is no position info in graph %s in %s\n",
agnameof(g), filename);
470 g_print(
"there is no file name to save! Programmer error\n");
473 if (output_file ==
NULL) {
474 g_print(
"Cannot create file \n");
479 fclose (output_file);
481 g_print(
"%s successfully saved \n",
fileName);
514 GtkWidget *dialog = gtk_file_chooser_dialog_new(
"Save File",
516 GTK_FILE_CHOOSER_ACTION_SAVE,
520 GTK_RESPONSE_ACCEPT,
NULL);
521 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER
523 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
525 gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
529 gtk_widget_destroy(dialog);
533 gtk_widget_destroy(dialog);
545static float interpol(
float minv,
float maxv,
float minc,
float maxc,
float x)
547 return (x - minv) * (maxc - minc) / (maxv - minv) + minc;
553 float percl = l / maxl;
557 if (percl < sc.
s[ind].
perc)
561 sc.
s[ind].
c.
R, percl);
563 sc.
s[ind].
c.
G, percl);
565 sc.
s[ind].
c.
B, percl);
579 av_perc = 1.0f / (float)(colorcnt - 1);
580 for (
size_t ind = 0; ind < colorcnt; ind++) {
586 sc->
s[ind].
perc = (float)ind * av_perc;
591 "#C8CBED",
"#9297D3",
"#0000FF",
"#2C2E41"
594 "#EBBE29",
"#D58C4A",
"#74AE09",
"#893C49"
597 "#E0061E",
"#F0F143",
"#95192B",
"#EB712F"
600 "#1E6A10",
"#2ABE0E",
"#AEDD39",
"#5EE88B"
602#define CSZ(x) (sizeof(x)/sizeof(char*))
613#define NUM_SCHEMES (sizeof(palette)/sizeof(colordata))
617 fprintf (stderr,
"colorschemaset: illegal themeid %d\n", themeid);
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static char * gv_strdup(const char *original)
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
void colorxlate(char *str, agxbuf *buf)
static NORETURN void graphviz_exit(int status)
glCompSet * glcreate_gl_topview_menu(void)
gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, void *data)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
char * agget(void *obj, char *name)
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
int agwrite(Agraph_t *g, void *chan)
Return 0 on success, EOF on failure.
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
char * agnameof(void *)
returns a string descriptor for the object.
void * agbindrec(void *obj, const char *name, unsigned int recsize, int move_to_front)
attaches a new record of the given size to the object
Agraph_t * graph(char *name)
void load_mouse_actions(ViewInfo *v)
char * fileName(ingraph_state *sp)
Return name of current file being processed.
char * smyrnaPath(char *suffix)
#define GG_labelattribute(g)
#define GG_nodelabelcolor(g)
#define GN_labelattribute(g)
#define GG_edgelabelcolor(g)
#define GE_labelattribute(g)
#define GG_elabelattribute(g)
platform abstraction for case-insensitive string functions
GtkComboBox * graphComboBox
glCompColor nodelabelcolor
glCompColor edgelabelcolor
glCompColor selectedNodeColor
viewport_camera ** cameras
GtkWidget * drawing_area
open gl canvas
systemgraphs systemGraphs
size_t active_camera
<number of cameras
struct topview::@55 fisheyeParams
void initSmGraph(Agraph_t *g, topview *rv)
void load_settings_from_graph(void)
void update_graph_from_settings(Agraph_t *g)
static float interpol(float minv, float maxv, float minc, float maxc, float x)
static void clear_color_theme(colorschemaset *cs)
void set_viewport_settings_from_template(ViewInfo *vi, Agraph_t *g)
static gboolean gl_main_expose(void *data)
static char * deep_blue[]
static void set_color_theme_color(colorschemaset *sc, char **colorstr)
static colorschemaset create_color_theme(int themeid)
static char * rain_forest[]
void close_graph(ViewInfo *vi)
int save_graph_with_file_name(Agraph_t *graph, char *fileName)
void switch_graph(int graphId)
static colordata palette[]
static void * get_glut_font(int ind)
void getcolorfromschema(const colorschemaset sc, float l, float maxl, glCompColor *c)
static Agraph_t * loadGraph(char *filename)
void init_viewport(ViewInfo *vi)
static void activate(int id)
static void get_data_dir(void)
static void update_graph_params(Agraph_t *graph)
char * get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g)
void updateRecord(Agraph_t *g)
int add_graph_to_viewport_from_file(char *fileName)
void refreshViewport(void)
int add_graph_to_viewport(Agraph_t *graph, char *id)
static void clear_viewport(ViewInfo *vi)
static void graphRecord(Agraph_t *g)