Otawa  0.10
display.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * display classes interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2007, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_DISPLAY_DISPLAY_H
23 #define OTAWA_DISPLAY_DISPLAY_H
24 
25 #include <elm/string.h>
26 
27 namespace otawa { namespace display {
28 
29 using namespace elm;
30 
31 // Color class
32 class Color {
33 public:
34  typedef t::uint8 comp_t;
35 
36  inline Color(void) { }
37  Color(comp_t red, comp_t green, comp_t blue);
38  Color(t::uint32 color);
39  Color(string name);
40  inline const string& asText(void) const { return text; }
41 
42 private:
43  string text;
44 };
45 
46 
47 // TextStyle class
48 class TextStyle {
49 public:
50  static const int NORMAL = 0x00;
51  static const int BOLD = 0x01;
52  static const int ITALIC = 0x02;
53  static const int UNDERLINE = 0x04;
54 
55  inline TextStyle(void): style(NORMAL), size(0) { }
56 
57  string name;
58  int style;
59  int size;
61 };
62 
63 
64 // LineStyle class
65 class LineStyle {
66 public:
67  typedef enum style_t {
71  DASHED
72  } style_t;
73 
74  inline LineStyle(void): weight(0), style(PLAIN) { }
75 
77  int weight;
79 };
80 
81 
82 // FillStyle class
83 class FillStyle {
84 public:
85  typedef enum fill_t {
87  FILL_SOLID
88  } fill_t;
89 
90  inline FillStyle(void): color(0xffffff), fill(FILL_NONE) { }
91 
94 };
95 
96 
97 // ShapeStyle class
98 class ShapeStyle {
99 public:
100  typedef enum shape_t {
101  SHAPE_NONE = 0,
113  SHAPE_DIAMOND
114  } shape_t;
115 
116  inline ShapeStyle(void): shape(SHAPE_RECORD) { }
117 
122 };
123 
124 } } // otawa::display
125 
126 #endif /* OTAWA_DISPLAY_DISPLAY_H */
LineStyle line
Style used to draw the border of the shape.
Definition: display.h:120
Color color
Color the displayed text.
Definition: display.h:60
fill_t fill
Fill style of the area.
Definition: display.h:93
Definition: display.h:107
FillStyle(void)
Definition: display.h:90
style_t
Definition: Graph.h:31
Color color
Background color.
Definition: display.h:92
int weight
The wright of the line : 0 for minimal line width.
Definition: display.h:77
ShapeStyle(void)
Definition: display.h:116
shape_t shape
The used shape (one of SHAPE_xxx).
Definition: display.h:118
string text
Definition: display.h:43
The style of a filled area.
Definition: display.h:83
uint32 size
Description of the style of text.
Definition: display.h:48
string name
Name of the text font.
Definition: display.h:57
Definition: display.h:86
LineStyle(void)
Definition: display.h:74
Definition: display.h:69
int size
The size of the font.
Definition: display.h:59
Shape style.
Definition: display.h:98
const string & asText(void) const
Definition: display.h:40
Definition: display.h:68
word_t fill(int size, bool init)
Color(void)
Definition: display.h:36
Definition: display.h:70
uint8_t uint8
shape_t
Definition: display.h:100
int style
Style of the displayed text.
Definition: display.h:58
style_t
Definition: display.h:67
fill_t
Definition: display.h:85
t::uint8 comp_t
Definition: display.h:34
cstring name
Definition: odisasm.cpp:107
A color description.
Definition: display.h:32
TextStyle(void)
Definition: display.h:55
FillStyle fill
Style used to fill the shape.
Definition: display.h:119
Color color
The color of the line.
Definition: display.h:76
style_t style
The style of the line : one of HIDDEN, PLAIN, DOTTED or DASHED.
Definition: display.h:78
uint32_t uint32
Definition: display.h:65
Definition: display.h:104
TextStyle text
Style to draw text in the shape.
Definition: display.h:121