-
Notifications
You must be signed in to change notification settings - Fork 3
/
overallstate.h
60 lines (45 loc) · 1.81 KB
/
overallstate.h
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
#ifndef __PICLOCK_OVERALLSTATE_H_INCLUDED
#define __PICLOCK_OVERALLSTATE_H_INCLUDED
#include <memory>
#include "piclock_messages.h"
#include "regionstate.h"
#include "imagescaling.h"
class OverallState
{
public:
bool RotationReqd(VGfloat width, VGfloat height) const;
bool Landscape() const;
bool ScreenSaver() const;
const std::string & FontTally() const;
const std::string & FontTally(bool bIsDigitalClock) const;
const std::string & FontTallyLabel() const;
const std::string & FontStatus() const;
const std::string & FontDigital() const;
const std::string & FontDate() const;
const std::string & FontHours() const;
void UpdateFromMessage(const std::shared_ptr<ClockMsg_SetGlobal> &pMsg);
void UpdateFromMessage(const ClockMsg_SetGlobal &message);
bool UpdateFromMessage(const std::shared_ptr<ClockMsg_SetFonts> &pMsg);
bool UpdateFromMessage(const ClockMsg_SetFonts &message);
void SetLandscape(bool bLandscape);
void NvgInit(NVGcontext *vg);
RegionsMap Regions;
ImagesMap Images;
std::map<std::string, int> TextSizes;
std::map<std::string, int> LabelSizes;
bool HandleClockMessages(NVGcontext *vg, std::queue<std::shared_ptr<ClockMsg> > &msgs, struct timeval & tvCur);
private:
void resetFonts(NVGcontext *vg, const std::string &remove_font);
bool UpdateRegionCount(int newCount);
bool updateFont(std::string & target, const std::string & newVal, const std::string & defaultVal);
bool m_bLandscape = true;
bool m_bScreenSaver = true;
std::string font_Tally = DEFAULT_FONT_TALLY;
std::string font_TallyLabel = DEFAULT_FONT_TALLYLABEL;
std::string font_Status = DEFAULT_FONT_TALLY;
std::string font_Digital = DEFAULT_FONT_DIGITAL;
std::string font_Date = DEFAULT_FONT_DATE;
std::string font_Hours = DEFAULT_FONT_HOURS;
std::map<std::string, std::string> FontData;
};
#endif