amd64: small changes w.r.t. stack alignment.
[libfirm] / ir / be / bechordal_draw.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Paint chordal graphs.
23  * @author      Sebastian Hack
24  * @date        12.05.2005
25  * @version     $Id$
26  */
27 #ifndef FIRM_BE_BECHORDAL_DRAW_H
28 #define FIRM_BE_BECHORDAL_DRAW_H
29
30 #include "bechordal.h"
31
32 typedef struct _plotter_t           plotter_t;
33 typedef struct _plotter_if_t        plotter_if_t;
34 typedef struct _rect_t              rect_t;
35 typedef struct _draw_chordal_opts_t draw_chordal_opts_t;
36 typedef struct _color_t             color_t;
37
38 struct _color_t {
39         double r, g, b;
40 };
41
42 struct _rect_t {
43         int x, y, w, h;
44 };
45
46 struct _plotter_if_t {
47         void (*begin)(plotter_t *self, const rect_t *visible_area);
48
49         void (*set_color)(plotter_t *self, const color_t * color);
50         const color_t *(*get_color)(const plotter_t *self);
51         void (*set_width)(plotter_t *self, int width);
52         int (*get_width)(const plotter_t *self);
53         void (*line)(plotter_t *self, int x1, int y1, int x2, int y2);
54         void (*box)(plotter_t *self, const rect_t *rect);
55         void (*text)(plotter_t *self, int x, int y, const char *str);
56
57         void (*finish)(plotter_t *self);
58         void (*free)(plotter_t *self);
59 };
60
61 extern void plotter_free(plotter_t *self);
62
63 struct _plotter_t {
64         const plotter_if_t *vtab;
65 };
66
67 struct _draw_chordal_opts_t {
68         int h_gap;
69         int h_inter_gap;
70         int v_gap;
71         int v_inter_gap;
72         int x_margin;
73         int y_margin;
74 };
75
76 extern const draw_chordal_opts_t draw_chordal_def_opts;
77
78 extern plotter_t *new_plotter_ps(const char *filename);
79
80 extern void draw_interval_tree(const draw_chordal_opts_t *opts, const be_chordal_env_t *chordal_env, plotter_t *plotter);
81
82 #endif /* FIRM_BE_BECHORDAL_DRAW_H */