-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreenstate.h
More file actions
56 lines (42 loc) · 1.05 KB
/
screenstate.h
File metadata and controls
56 lines (42 loc) · 1.05 KB
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
#ifndef SCREENSTATE_H
#define SCREENSTATE_H
#include <map>
#include "pointervector.h"
#include "page.h"
/* This is global so signal handlers can modify it. */
extern bool quit;
class KeyAction;
class ScreenState {
private:
typedef std::map<int, KeyAction*> KeyMap;
PointerVector<Page> &pageList;
KeyMap keyMap;
unsigned pageIndex;
unsigned statIndex;
unsigned missedStatIndex;
bool forceUpdate;
time_t lastUpdate;
int updateRate;
bool perCpu;
void SetupShortcuts(PmcContext &pmc);
public:
ScreenState(PointerVector<Page> &pages, bool pcpu, PmcContext &pmc,
int updateRate);
~ScreenState();
void LoadPage(PmcContext &pmc);
void WaitForKeypress(PmcContext &pmc);
void MissedStat(int index);
void CompleteUpdate(void);
bool UpdateScreen() const;
const char *ScreenName() const;
const char *ScreenShortcut() const;
PointerVector<Statistic> & ScreenStats();
bool PerCPU() const
{
return perCpu;
}
void TogglePerCpu();
void ChangePage(PmcContext &pmc, int newIndex);
void IncrementPage(PmcContext &pmc, int increment);
};
#endif