Different platforms can now implement their own method to get the Application resource path
Tizen Platform path used if Tizen version 3 or greater else dali defined locations
Change-Id: I463d395b3dc7ad9e77e5846907789392bb8056b1
#include <style-monitor.h>
#include <command-line-options.h>
#include <common/adaptor-impl.h>
+#include <common/framework.h>
#include <singleton-service-impl.h>
#include <lifecycle-controller-impl.h>
mWindow = newWindow;
}
+std::string Application::GetResourcePath()
+{
+ return Internal::Adaptor::Framework::GetResourcePath();
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ReplaceWindow(PositionSize windowPosition, const std::string& name);
+ /**
+ * @copydoc Dali::Application::GetResourcePath();
+ */
+ static std::string GetResourcePath();
+
public: // Stereoscopy
/**
{
/**
- * The Framework class is used to register callbacks with the TIZEN platform so that
+ * The Framework class is ideally placed to provide key API required by Applications.
+ *
+ * The class is also used to register callbacks with the TIZEN platform so that
* we know when any of the application lifecycle events occur. This includes events
* like when our application is to be initialised, terminated, paused, resumed etc.
+ *
*/
class Framework
{
*/
std::string GetBundleId() const;
+ /**
+ * Gets the path at which application resources are stored.
+ */
+ static std::string GetResourcePath();
+
private:
// Undefined
return "";
}
+std::string Framework::GetResourcePath()
+{
+ // TIZEN_PLATFORM_CONFIG_SUPPORTED not defined for libuv so path not available.
+ return "";
+}
+
void Framework::SetBundleId(const std::string& id)
{
}
Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
}
+std::string Application::GetResourcePath()
+{
+ return Internal::Adaptor::Application::GetResourcePath();
+}
+
void Application::SetViewMode( ViewMode viewMode )
{
Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
*/
void ReplaceWindow(PositionSize windowPosition, const std::string& name);
+ /**
+ * @brief Get path application resources are stored at
+ *
+ * @SINCE_1_2.2
+ * @return the full path of the resources
+ */
+ static std::string GetResourcePath();
+
+
public: // Stereoscopy
/**
#include <appcore-watch/watch_app.h>
#endif
+#if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED
+#include <tzplatform_config.h>
+#endif // TIZEN_PLATFORM_CONFIG_SUPPORTED
+
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
return mBundleId;
}
+std::string Framework::GetResourcePath()
+{
+ std::string resourcePath = "";
+#if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED
+ resourcePath = app_get_resource_path();
+#endif //TIZEN_PLATFORM_CONFIG_SUPPORTED
+
+ return resourcePath;
+}
+
void Framework::SetBundleId(const std::string& id)
{
mBundleId = id;
return mBundleId;
}
+std::string Framework::GetResourcePath()
+{
+ // "DALI_APPLICATION_PACKAGE" is used by Ubuntu specifically to get the already configured Application package path.
+ const char* ubuntuEnvironmentVariable = "DALI_APPLICATION_PACKAGE";
+ char* value = getenv( ubuntuEnvironmentVariable );
+ std::string resourcePath;
+ if ( value != NULL )
+ {
+ resourcePath = value;
+ }
+
+ return resourcePath;
+}
+
void Framework::SetBundleId(const std::string& id)
{
mBundleId = id;
-DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
-DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
-DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+ -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
-DNON_POWER_OF_TWO_TEXTURES \
-DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
-Werror -Wall -lgcc \
fontConfigurationFile=$FONT_CONFIGURATION_FILE
fi
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+ tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+ tizenPlatformConfigSupported=0
+fi
+
AC_SUBST(dataReadWriteDir)
AC_SUBST(dataReadOnlyDir)
AC_SUBST(DALI_ADAPTOR_CFLAGS)
AC_SUBST(DALI_PROFILE_CFLAGS)
AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
Font config file: $fontConfigurationFile
Building with EFL Libraries: $enable_efl
Using Tizen APP FW libraries: $enable_appfw
- OpenGL ES version: $enable_gles"
+ OpenGL ES version: $enable_gles
+ Tizen Platform Config supported: $tizenPlatformConfigSupported
+"
# optional output of node.js source path if we're building with libuv
if test "x$build_for_libuv" != "xno"; then
echo " LibUV header path $with_libuv"
-DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
-DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
-DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+ -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
-DNON_POWER_OF_TWO_TEXTURES \
-DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
-Werror -Wall -lgcc \
dataReadOnlyDir=${prefix}/share/dali/
fi
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+ tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+ tizenPlatformConfigSupported=0
+fi
+
if test x$FONT_CONFIGURATION_FILE != x; then
fontConfigurationFile=$FONT_CONFIGURATION_FILE
fi
AC_SUBST(DALI_ADAPTOR_CFLAGS)
AC_SUBST(DALI_PROFILE_CFLAGS)
AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
Building with EFL Libraries: $enable_efl
Using Tizen APP FW libraries: $enable_appfw
OpenGL ES version: $enable_gles
+ Tizen Platform Config supported $tizenPlatformConfigSupported
"
# optional output of node.js source path if we're building with libuv
if test "x$build_for_libuv" != "xno"; then
#need libtzplatform-config for directory if tizen version is 3.x
-%if "%{tizen_version_major}" == "3"
+%if "%{tizen_version_major}" >= "3"
+%define tizen_platform_config_supported 1
BuildRequires: pkgconfig(libtzplatform-config)
%endif
%prep
%setup -q
-#Use TZ_PATH when tizen version is 3.x
+#Use TZ_PATH when tizen version is 3.x or greater
-%if "%{tizen_version_major}" == "2"
-%define dali_data_rw_dir /usr/share/dali/
-%define dali_data_ro_dir /usr/share/dali/
-%define font_preloaded_path /usr/share/fonts/
-%define font_downloaded_path /opt/share/fonts/
-%define font_application_path /usr/share/app_fonts/
-%define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
-%else
+%if "%{tizen_version_major}" >= "3"
%define dali_data_rw_dir %TZ_SYS_RO_SHARE/dali/
%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
%define font_preloaded_path %TZ_SYS_RO_SHARE/fonts/
%define font_downloaded_path %TZ_SYS_SHARE/fonts/
%define font_application_path %TZ_SYS_RO_SHARE/app_fonts/
%define font_configuration_file %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
+%else
+%define dali_data_rw_dir /usr/share/dali/
+%define dali_data_ro_dir /usr/share/dali/
+%define font_preloaded_path /usr/share/fonts/
+%define font_downloaded_path /opt/share/fonts/
+%define font_application_path /usr/share/app_fonts/
+%define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
%endif
%define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
+%if 0%{?tizen_platform_config_supported}
+TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
+%endif
# Default to GLES 2.0 if not specified.
%{!?target_gles_version: %define target_gles_version 20}