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
45
46
47
48
49
50
51
52
53
54
|
#ifndef SYSTEMTAP_GRAPHSTYLE_HXX
#define SYSTEMTAP_GRAPHSTYLE_HXX 1
#include <tr1/memory>
#include <cairomm/context.h>
namespace systemtap
{
class GraphDataBase;
class Graph;
class GraphStyle
{
public:
virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
Graph* graph, Cairo::RefPtr<Cairo::Context> cr) = 0;
virtual ssize_t dataIndexAtPoint(double x, double y,
std::tr1::shared_ptr<GraphDataBase>
graphData,
std::tr1::shared_ptr<Graph> graph)
{
return -1;
}
};
class GraphStyleBar : public GraphStyle
{
public:
void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
Graph* graph, Cairo::RefPtr<Cairo::Context> cr);
static GraphStyleBar instance;
ssize_t dataIndexAtPoint(double x, double y,
std::tr1::shared_ptr<GraphDataBase> graphData,
std::tr1::shared_ptr<Graph> graph);
};
class GraphStyleDot : public GraphStyle
{
public:
void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
Graph* graph, Cairo::RefPtr<Cairo::Context> cr);
static GraphStyleDot instance;
};
class GraphStyleEvent : public GraphStyle
{
public:
void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
Graph* graph, Cairo::RefPtr<Cairo::Context> cr);
static GraphStyleEvent instance;
};
}
#endif
|