#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130521.1]"
+#define OSP_INSTALLER_VERSION "version=[20130522.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
#define TIZEN_CATEGORY_MENUSCREEN "http://tizen.org/category/menuscreen"
#define TIZEN_CATEGORY_ANTIVIRUS "http://tizen.org/category/antivirus"
+// custom metadata
#define METADATA_FONT L"http://developer.samsung.com/tizen/metadata/font"
+#define METADATA_SPLASH L"http://developer.samsung.com/tizen/metadata/splash"
+#define METADATA_SPLASH_INDICATOR_DISPLAY L"http://developer.samsung.com/tizen/metadata/splash/indicatordisplay"
+#define METADATA_SPLASH_PORTRAIT L"http://developer.samsung.com/tizen/metadata/splash/portrait"
+#define METADATA_SPLASH_LANDSCAPE L"http://developer.samsung.com/tizen/metadata/splash/landscape"
#define DIR_APPLICATIONS_TMP "/opt/usr/apps/tmp"
}
bool
+ManifestGenerator::GetSplashAttributes(int index, String& indicatorDisplay, String& portraitValue, String& landscapeValue)
+{
+ AppLog("GetSplashAttributes");
+
+ bool isSplashDetected = false;
+
+ IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+ TryReturn(pAppDataList, false, "pAppDataList is null");
+
+ AppData* pAppData = null;
+ pAppDataList->GetAt(index, pAppData);
+ TryReturn(pAppData, false, "pAppData is null");
+
+ HashMap* pMetadataMap = pAppData->__pMetadataMap;
+ TryReturn(pMetadataMap, false, "pMetadataMap is null");
+
+ std::unique_ptr< IMapEnumerator > pEnum(pMetadataMap->GetMapEnumeratorN());
+ TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pKey = static_cast< String* > (pEnum->GetKey());
+ TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ AppLog("key=[%ls] is detected.", pKey->GetPointer());
+
+ if (pKey->Equals(METADATA_SPLASH, false) == true)
+ {
+ isSplashDetected = true;
+ }
+ else if (pKey->Equals(METADATA_SPLASH_INDICATOR_DISPLAY, false) == true)
+ {
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ if (pValue && (pValue->Equals("false", false) == true))
+ {
+ AppLog("value=[%ls] is detected.", pValue->GetPointer());
+ indicatorDisplay = L"false";
+ }
+ }
+ else if (pKey->Equals(METADATA_SPLASH_PORTRAIT, false) == true)
+ {
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ if (pValue)
+ {
+ AppLog("value=[%ls] is detected.", pValue->GetPointer());
+ portraitValue = __pContext->__rootPath + L"/" + *pValue;
+ }
+ }
+ else if (pKey->Equals(METADATA_SPLASH_LANDSCAPE, false) == true)
+ {
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ if (pValue)
+ {
+ AppLog("value=[%ls] is detected.", pValue->GetPointer());
+ landscapeValue = __pContext->__rootPath + L"/" + *pValue;;
+ }
+ }
+ }
+
+ return isSplashDetected;
+}
+
+bool
ManifestGenerator::WriteCategory(int index) const
{
IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
__pWriter->WriteAttribute("hw-acceleration", glFrame);
__pWriter->WriteAttribute("mainapp", mainapp);
+ String indicatorDisplay;
+ String portraitValue;
+ String landscapeValue;
+ if (GetSplashAttributes(index, indicatorDisplay, portraitValue, landscapeValue) == true)
+ {
+ __pWriter->WriteAttribute("indicatordisplay", indicatorDisplay);
+ __pWriter->WriteAttribute("portrait-effectimage", portraitValue);
+ __pWriter->WriteAttribute("landscape-effectimage", landscapeValue);
+ }
+
if (pAppData->__pLaunchConditionList->GetCount() > 0)
{
__pWriter->WriteAttribute("launchcondition", "true");
}
bool
-XmlWriter::WriteAttribute(const Tizen::Base::String& name, const Tizen::Base::String& content)
+XmlWriter::WriteAttribute(const Tizen::Base::String& name, const Tizen::Base::String& value)
{
ByteBuffer* pNameBuf = null;
- ByteBuffer* pContentBuf = null;
+ ByteBuffer* pValueBuf = null;
int err = 0;
bool res = true;
pNameBuf = StringUtil::StringToUtf8N(name);
- pContentBuf = StringUtil::StringToUtf8N(content);
+ pValueBuf = StringUtil::StringToUtf8N(value);
- if (pNameBuf && pContentBuf)
+ if (pNameBuf && pValueBuf)
{
- err = xmlTextWriterWriteAttribute(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer(), (xmlChar *)pContentBuf->GetPointer());
+ err = xmlTextWriterWriteAttribute(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer(), (xmlChar *)pValueBuf->GetPointer());
if (err != 0)
{
res = false;
}
delete pNameBuf;
- delete pContentBuf;
+ delete pValueBuf;
return res;
}