summaryrefslogtreecommitdiffstats
path: root/src/report/report-data-html.h
blob: e506f5a8c659c53671147b0eedbc312f0fb5ea23 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713
#define PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713

#include <string>
#include <sstream>

using namespace std;

struct tag_attr {
	const char *css_class;
	const char *css_id;
};
/* T:Top, L:Left, TL:Top-Left, TLC: Top-Left-Center */
enum position { T, L, TL, TC, TLC };

struct table_attributes {
	const char *table_class;
	const char *td_class;
	const char *tr_class;
	const char *th_class;
	position pos_table_title;
	int title_mod;
	int rows;
	int cols;
};

struct table_size {
	int rows;
	int cols;
};


/* Definition of css attributes for the cases that apply to powertop
 * html report
 * */

void
init_div(struct tag_attr *div_attr, const char *css_class, const char *css_id);

void
init_top_table_attr(struct table_attributes *table_css, int rows, int cols);

void
init_title_attr(struct tag_attr *title_attr);

void
init_std_table_attr(struct table_attributes *table_css, int rows, int cols);

void
init_std_side_table_attr(struct table_attributes *table_css, int rows,
		int cols);

void
init_pkg_table_attr(struct table_attributes *table_css, int rows, int cols);

void
init_core_table_attr(struct table_attributes *table_css, int title_mod,
		int rows, int cols);

void
init_cpu_table_attr(struct table_attributes *table_css, int title_mod,
		int rows, int cols);
void
init_nowarp_table_attr(struct table_attributes *table_css, int rows, int cols);

void
init_tune_table_attr(struct table_attributes *table_css, int rows, int cols);

void
init_wakeup_table_attr(struct table_attributes *table_css, int rows, int cols);

/* Other helper functions */
string
double_to_string(double dval);

#endif