summaryrefslogtreecommitdiff
path: root/theme.c
blob: 69c19e16c6322e84aa0051b43dd9b04dd625c081 (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
//								-*- c++ -*-

#include "theme.h"
#include <vdr/osd.h>

cText2SkinTheme::cText2SkinTheme(const char *Skin): cText2SkinFile(Skin) {
}

cText2SkinTheme::~cText2SkinTheme() {
}

bool cText2SkinTheme::Parse(const char *Text) {
	int l = strlen(Text);
	bool result = false;
	if (l) {
		if (strncmp(Text, "Item=Color,", 11) == 0) {
			Text += 11;
			std::string name;
			tColor value;
			if (ParseVar(Text, "name", name) && ParseVar(Text, "default", &value)) {
				mMap[name] = mTheme.AddColor(name.c_str(), value);
				result = true;
			} else
				esyslog("ERROR: text2skin: Parameters name and default must be present");
		} else
			esyslog("ERROR: text2skin: syntax error");
	}
	return result;
}