From 4e0b98bf0cca1afa86b8c655c490392a70b56b36 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Sat, 1 Jan 2005 23:44:36 +0000 Subject: - some formatting issues - moved translation to skin object --- xml/skin.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'xml/skin.c') diff --git a/xml/skin.c b/xml/skin.c index c787021..6f3e938 100644 --- a/xml/skin.c +++ b/xml/skin.c @@ -1,18 +1,23 @@ /* - * $Id: skin.c,v 1.2 2004/12/21 18:35:54 lordjaxom Exp $ + * $Id: skin.c,v 1.3 2005/01/01 23:44:36 lordjaxom Exp $ */ #include "xml/skin.h" +#include "i18n.h" #include #include const std::string ScreenBases[] = { "relative", "absolute" }; -cxSkin::cxSkin(const std::string &Name): - mName(Name) { +cxSkin::cxSkin(const std::string &Name, cText2SkinI18n *I18n, cText2SkinTheme *Theme): + mName(Name), + mI18n(I18n), + mTheme(Theme) +{ } -void cxSkin::SetBase(eScreenBase Base) { +void cxSkin::SetBase(eScreenBase Base) +{ if (Base != (eScreenBase)-1) mBase = Base; @@ -32,7 +37,8 @@ void cxSkin::SetBase(eScreenBase Base) { } } -bool cxSkin::ParseBase(const std::string &Text) { +bool cxSkin::ParseBase(const std::string &Text) +{ int i; for (i = 0; i < (int)__COUNT_BASE__; ++i) { if (ScreenBases[i] == Text) @@ -44,3 +50,10 @@ bool cxSkin::ParseBase(const std::string &Text) { } return false; } + +std::string cxSkin::Translate(const std::string &Text) +{ + if (mI18n != NULL) + return mI18n->Translate(Text); + return Text; +} -- cgit v1.2.3