summaryrefslogtreecommitdiff
path: root/fontmanager.c
blob: c7a08fd3d0f4cacb5568a20246c3d28729e3f0da (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include "fontmanager.h"

cFontManager::cFontManager() {
}

cFontManager::~cFontManager() {
    DeleteFonts();
}

void cFontManager::SetFonts() {
    SetFontsMenu();
    SetFontsChannel();
    SetFontsReplay();
    SetFontsMessage();
    SetFontsTrack();
    SetFontsVolume();
}

void cFontManager::DeleteFonts() {
    DeleteFontsMenu();
    DeleteFontsChannel();
    DeleteFontsReplay();
    DeleteFontsMessage();
    DeleteFontsTrack();
    DeleteFontsVolume();
}

cFont *cFontManager::CreateFont(int size) {
    return cFont::CreateFont(config.fontName, size);
}

void cFontManager::SetFontsMenu(void) {
    menuHeader = CreateFont(geoManager->menuHeaderHeight / 2 + config.GetValue("fontHeader"));
    menuDate = CreateFont(geoManager->menuHeaderHeight / 2 + config.GetValue("fontDate"));
    menuItemLarge = CreateFont(geoManager->menuItemHeightMain/3 + 4 + config.GetValue("fontMenuitemLarge"));
    menuItemSchedule = CreateFont(geoManager->menuItemHeightSchedule / 4 + 5 + config.GetValue("fontMenuitemSchedule"));
    menuItemScheduleSmall = CreateFont(geoManager->menuItemHeightSchedule / 4 - 5 + config.GetValue("fontMenuitemScheduleSmall"));
    menuItemChannel = CreateFont(geoManager->menuItemHeightSchedule / 3 + config.GetValue("fontMenuitemChannel"));
    menuItemChannelSmall = CreateFont(geoManager->menuItemHeightSchedule / 5 - 2 + config.GetValue("fontMenuitemChannelSmall"));
    menuItemRecordings = CreateFont(geoManager->menuItemHeightRecordings / 2 - 14 + config.GetValue("fontMenuitemRecordings"));
    menuItemRecordingsSmall = CreateFont(geoManager->menuItemHeightRecordings / 4 - 3 + config.GetValue("fontMenuitemRecordingsSmall"));
    menuItemTimers = CreateFont(geoManager->menuItemHeightSchedule / 3 + config.GetValue("fontMenuitemTimers"));
    menuItemTimersSmall = CreateFont(geoManager->menuItemHeightSchedule / 4 - 3 + config.GetValue("fontMenuitemTimersSmall"));
    menuItemDefault = CreateFont(geoManager->menuItemHeightDefault * 2 / 3 + config.GetValue("fontMenuitemDefault"));
    menuDiskUsage = CreateFont(geoManager->menuDiskUsageHeight/6 - 2 + config.GetValue("fontDiskUsage"));
    menuDiskUsagePercent = CreateFont(geoManager->menuDiskUsageHeight/5 - 4 + config.GetValue("fontDiskUsagePercent"));
    menuTimersHead = CreateFont((geoManager->menuContentHeight - 3*geoManager->menuSpace - geoManager->menuDiskUsageHeight) / 25 + config.GetValue("fontTimersHead"));
    menuTimers = CreateFont((geoManager->menuContentHeight - 3*geoManager->menuSpace - geoManager->menuDiskUsageHeight) / 25 - 6 + config.GetValue("fontTimers"));
    menuButtons = CreateFont(geoManager->menuButtonHeight*0.8 + config.GetValue("fontButtons"));
    menuMessage = CreateFont(geoManager->menuMessageHeight / 3 + config.GetValue("fontMessageMenu"));
    menuEPGInfoWindow = CreateFont(geoManager->menuContentHeight / 30 + config.GetValue("fontEPGInfoWindow"));
    menuEPGInfoWindowLarge = CreateFont(geoManager->menuContentHeight / 20 + config.GetValue("fontEPGInfoWindowLarge"));
}

void cFontManager::DeleteFontsMenu(void) {
    delete menuHeader;
    delete menuDate;
    delete menuItemLarge;
    delete menuItemSchedule;
    delete menuItemScheduleSmall;
    delete menuItemChannel;
    delete menuItemChannelSmall;
    delete menuItemRecordings;
    delete menuItemRecordingsSmall;
    delete menuItemTimers;
    delete menuItemTimersSmall;
    delete menuItemDefault;
    delete menuDiskUsage;
    delete menuDiskUsagePercent;
    delete menuTimers;
    delete menuTimersHead;
    delete menuButtons;
    delete menuMessage;
    delete menuEPGInfoWindow;
    delete menuEPGInfoWindowLarge;
}

void cFontManager::SetFontsChannel(void) {
    channelHeader = CreateFont(geoManager->channelHeaderHeight - 8 + config.GetValue("fontChannelHeaderSize"));
    channelDate = CreateFont(geoManager->channelHeaderHeight/2 + config.GetValue("fontChannelDateSize"));
    channelEPG = CreateFont(geoManager->channelEpgInfoLineHeight + config.GetValue("fontEPGSize"));
    channelEPGSmall = CreateFont(geoManager->channelEpgInfoLineHeight - 6 + config.GetValue("fontEPGSmallSize"));
    channelSourceInfo = CreateFont(geoManager->channelFooterHeight/2 + config.GetValue("fontChannelSourceInfoSize"));;
    channelChannelGroup = CreateFont(geoManager->channelEpgInfoHeight/3 + config.GetValue("fontChannelGroupSize"));
    channelChannelGroupSmall = CreateFont(geoManager->channelEpgInfoHeight/3 - 5 + config.GetValue("fontChannelGroupSmallSize"));
}

void cFontManager::DeleteFontsChannel(void) {
    delete channelHeader;
    delete channelDate;
    delete channelEPG;
    delete channelEPGSmall;
    delete channelSourceInfo;
    delete channelChannelGroup;
    delete channelChannelGroupSmall;
}

void cFontManager::SetFontsReplay(void) {
    replayHeader = CreateFont(geoManager->replayHeaderHeight - 8 + config.GetValue("fontReplayHeader"));
    replayText = CreateFont(geoManager->replayCurrentHeight);
}

void cFontManager::DeleteFontsReplay(void) {
    delete replayHeader;
    delete replayText;
}

void cFontManager::SetFontsMessage(void) {
    messageText = CreateFont(geoManager->messageHeight / 4 + 15 + config.GetValue("fontMessage"));
}

void cFontManager::DeleteFontsMessage(void) {
    delete messageText;
}

void cFontManager::SetFontsTrack(void) {
    trackText = CreateFont(geoManager->menuItemHeightTracks/3 + config.GetValue("fontTracks"));
    trackHeader = CreateFont(geoManager->menuItemHeightTracks/2 + config.GetValue("fontTracksHeader"));
}

void cFontManager::DeleteFontsTrack(void) {
    delete trackText;
    delete trackHeader;
}

void cFontManager::SetFontsVolume(void) {
    volumeText = CreateFont(geoManager->volumeLabelHeight - 6 + config.GetValue("fontVolume"));
}

void cFontManager::DeleteFontsVolume(void) {
    delete volumeText;
}