Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / ubuntu / framework-ubuntu.cpp
index 404d1c2..dea0df7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
 #include <dali/internal/adaptor/common/framework.h>
 
 // EXTERNAL INCLUDES
-#include <Ecore.h>
-#include <Elementary.h>
+#include <dali/internal/system/linux/dali-ecore.h>
+#include <dali/internal/system/linux/dali-elementary.h>
 #include <X11/Xlib.h>
 
 #include <dali/integration-api/debug.h>
@@ -167,7 +167,7 @@ void Framework::Run()
 {
   mRunning = true;
 
-  elm_init(*mArgc, *mArgv);
+  elm_init( mArgc ? *mArgc : 0, mArgv ? *mArgv : nullptr );
 
   Impl::AppCreate(this);
 
@@ -219,9 +219,27 @@ std::string Framework::GetResourcePath()
     resourcePath = value;
   }
 
+  if( resourcePath.back() != '/' )
+  {
+    resourcePath+="/";
+  }
+
   return resourcePath;
 }
 
+std::string Framework::GetDataPath()
+{
+  const char* ubuntuEnvironmentVariable = "DALI_APPLICATION_DATA_DIR";
+  char* value = getenv( ubuntuEnvironmentVariable );
+  std::string dataPath;
+  if ( value != NULL )
+  {
+    dataPath = value;
+  }
+
+  return dataPath;
+}
+
 void Framework::SetBundleId(const std::string& id)
 {
   mBundleId = id;