Added clique walker
[libfirm] / ir / be / bechordal_draw.h
1
2 /**
3  * @file   bechordal_draw.h
4  * @date   13.05.2005
5  * @author Sebastian Hack
6  *
7  * Drawing chordal graphs.
8  *
9  * Copyright (C) 2005 Universitaet Karlsruhe
10  * Released under the GPL
11  */
12
13 #ifndef _BECHORDAL_DRAW_H
14 #define _BECHORDAL_DRAW_H
15
16 #include "irgraph.h"
17 #include "bearch.h"
18
19 typedef struct _plotter_t plotter_t;
20 typedef struct _plotter_if_t plotter_if_t;
21 typedef struct _rect_t rect_t;
22 typedef struct _draw_chordal_opts_t draw_chordal_opts_t;
23 typedef struct _color_t color_t;
24
25 struct _color_t {
26   double r, g, b;
27 };
28
29 struct _rect_t {
30   int x, y, w, h;
31 };
32
33 struct _plotter_if_t {
34   void (*begin)(plotter_t *self, const rect_t *visible_area);
35
36   void (*set_color)(plotter_t *self, const color_t * color);
37   const color_t * (*get_color)(const plotter_t *self);
38   void (*set_width)(plotter_t *self, int width);
39   int (*get_width)(const plotter_t *self);
40   void (*line)(plotter_t *self, int x1, int y1, int x2, int y2);
41   void (*box)(plotter_t *self, const rect_t *rect);
42   void (*text)(plotter_t *self, int x, int y, const char *str);
43
44   void (*finish)(plotter_t *self);
45   void (*free)(plotter_t *self);
46 };
47
48 extern void plotter_free(plotter_t *self);
49
50 struct _plotter_t {
51   const plotter_if_t *vtab;
52 };
53
54 struct _draw_chordal_opts_t {
55   int h_gap;
56   int h_inter_gap;
57   int v_gap;
58   int v_inter_gap;
59   int x_margin;
60   int y_margin;
61 };
62
63 extern const draw_chordal_opts_t draw_chordal_def_opts;
64
65 extern plotter_t *new_plotter_ps(const char *filename);
66
67 extern void draw_interval_tree(
68     const draw_chordal_opts_t *opts,
69     const be_chordal_env_t *chordal_env,
70     plotter_t *plotter);
71
72 #endif /* _BECHORDAL_DRAW_H */