File: screem-link-view-util.c

package info (click to toggle)
screem 0.12.1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 19,728 kB
  • ctags: 8,333
  • sloc: ansic: 98,234; sh: 8,278; xml: 2,278; makefile: 1,054
file content (44 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <libgnomecanvas/gnome-canvas.h>
#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>

#include "screem-linkview-util.h"

GnomeCanvasItem* node_draw( GnomeCanvasGroup *root, gdouble x,
			    gdouble y, gint node_type, gboolean legend )
{
	GnomeCanvasItem *node;
	GtkType type;
	
	type = gnome_canvas_ellipse_get_type();
	node = gnome_canvas_item_new( root, type,
				      "x1", x,
				      "y1", y,
				      "x2", x + 10.0,
				      "y2", y +10.0,
				      "outline_color", "black",
				      "width_units", 2.0,
				      NULL);
	switch( node_type ) {
	case EXTERNALNODE:
		gnome_canvas_item_set( node, "fill_color", "blue", NULL );
		break;
	case BADNODE:
		gnome_canvas_item_set( node, "fill_color", "red", NULL );
		break;
	case NONODE:
		gnome_canvas_item_set( node, "fill_color", "gray", NULL );
		break;
	case UPDATENODE:
		gnome_canvas_item_set( node, "fill_color", "yellow", NULL );
		break;
	case CHECKNODE:
		gnome_canvas_item_set( node, "fill_color", "orange", NULL );
		break;
	case GOODNODE:
	default:
		gnome_canvas_item_set( node, "fill_color", "green", NULL );
		break;	
	}

	return node;
}