From f2a4ea2dc8c0d915e0f2af6f4ec1a228e1e94453 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Fri, 25 Jun 2004 17:54:38 +0000 Subject: - on devices capable of full-color OSD, bpp's have no meaning anymore (but will still work like usual). On such devices, a full-screen 8-bit OSD will be used - new display-item "PresentTextDescription" displays combined ShortText/Description - displaying replay symbols only if information is actually available - exchanged x, y, width, height with x1, y1, x2, y2 coordinates (skin version is now 0.0.3) - coordinates may be negative to respect dynamic OSD settings (negative coordinates give pixels from the right or bottom edge) - added base parameter to Skin item to be able to use full screen in absolute mode - added a script to convert 0.0.2 skins to 0.0.3 - added parsing quoted texts (path="Bla.jpg" etc. will work correctly now) - fixed translator to escape the dollar sign - fixed display of scrollbar (REALLY!) - fixed linkage of libMagick++ --- common.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'common.c') diff --git a/common.c b/common.c index 5ec7970..de6f476 100644 --- a/common.c +++ b/common.c @@ -1,5 +1,5 @@ /* - * $Id: common.c,v 1.10 2004/06/16 18:46:50 lordjaxom Exp $ + * $Id: common.c,v 1.12 2004/06/25 17:51:34 lordjaxom Exp $ */ #include "data.h" @@ -29,10 +29,13 @@ const string DisplayNames[__DISPLAY_COUNT__] = "MessageStatus", "MessageInfo", "MessageWarning", "MessageError", "MenuTitle", "MenuRed", "MenuGreen", "MenuYellow", "MenuBlue", "MenuText", "MenuRecording", "MenuScrollUp", "MenuScrollDown", "MenuItems", - "MenuCurrent", "MenuGroups", "ReplayMode" }; + "MenuCurrent", "MenuGroups", "ReplayMode", "PresentTextDescription" }; const string ReplayNames[__REPLAY_COUNT__] = { "", "normal", "mp3", "mplayer", "dvd", "vcd" }; + +const string BaseNames[__BASE_COUNT__] = + { "rel", "abs" }; const char *SkinPath(void) { return cPlugin::ConfigDirectory(PLUGIN_NAME_I18N); @@ -123,8 +126,13 @@ bool ParseVar(const char *Text, const char *Name, string &Value){ --ptr1; ptr1 += strlen(str); if ((ptr2 = strchr(ptr1, ',')) || (ptr2 = strchr(ptr1, ';'))) { + int pos; Value = ptr1; Value.erase(ptr2 - ptr1); + if (Value[0] == '"') + SkipQuotes(Value); + while ((pos = Value.find('$')) != -1) + Value.replace(pos, 1, "{*}"); res = true; } } @@ -166,3 +174,32 @@ bool ParseVar(const char *Text, const char *Name, const cFont **Value) { return false; } +bool ParseVar(const char *Text, const char *Name, eBaseCoordinate *Value) { + string value; + if (ParseVar(Text, Name, value)) { + int i; + for (i = 0; i < __BASE_COUNT__; ++i) { + if (BaseNames[i] == value) { + *Value = (eBaseCoordinate)i; + return true; + } + if (i == __BASE_COUNT__) + esyslog("ERROR: text2skin: unknown coordinate base %s", value.c_str()); + } + } + return false; +} + +void SkipQuotes(string &Value) { + char quote = Value[0]; + int i; + Value.erase(0, 1); + for (i = 0; i < (int)Value.length() && Value[i] != quote; ++i) { + if (Value[i] == '\\') + Value.erase(i, 1); + } + if (Value[i] == quote) + Value.erase(i, 1); + else + esyslog("ERROR: text2skin: missing closing %c", quote); +} -- cgit v1.2.3