Resource folder retreived from Framework API 86/83386/7
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 5 Aug 2016 15:43:10 +0000 (16:43 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 18 Aug 2016 12:06:24 +0000 (05:06 -0700)
Change-Id: I70e63f2f9adb250d21535d7e64b0b1abdb49b242

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/public-api/styling/style-manager.h
docs/content/programming-guide/styling.h

index 97c0df1..034e416 100644 (file)
@@ -41,6 +41,8 @@ public:
 
 public:
 
+  static std::string GetResourcePath();
+
   //Orientation& GetOrientation();
 
 public: // static methods
@@ -74,6 +76,10 @@ Application::~Application()
   //delete mOrientation;
 }
 
+std::string Application::GetResourcePath()
+{
+  return "";
+}
 //Orientation& Application::GetOrientation()
 //{
 //  return *mOrientation;
index 1d648c3..8203437 100644 (file)
@@ -102,7 +102,7 @@ bool GetMappingKey( const std::string& str, std::string& key )
 }
 
 /*
- * Recursively collects all stylesin a node (An array of style names).
+ * Recursively collects all styles in a node (An array of style names).
  *
  * stylesCollection The set of styles from the json file (a json object of named styles)
  * style The style array to begin the collection from
index 71baa96..7e08cf4 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/adaptor-framework/application.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
@@ -39,6 +40,8 @@ const char* FONT_SIZE_QUALIFIER = "FontSize";
 const char* DEFAULT_THEME = DALI_STYLE_DIR "dali-toolkit-default-theme.json";
 
 const char* PACKAGE_PATH_KEY = "PACKAGE_PATH";
+const char* APPLICATION_RESOURCE_PATH_KEY = "APPLICATION_RESOURCE_PATH";
+
 const char* DEFAULT_PACKAGE_PATH = DALI_DATA_READ_ONLY_DIR "/toolkit/";
 
 } // namespace
@@ -104,12 +107,12 @@ StyleManager::StyleManager()
 {
   // Add theme builder constants
   mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
+  mThemeBuilderConstants[ APPLICATION_RESOURCE_PATH_KEY ] = Application::GetResourcePath();
 
   mStyleMonitor = StyleMonitor::Get();
   if( mStyleMonitor )
   {
     mStyleMonitor.StyleChangeSignal().Connect( this, &StyleManager::StyleMonitorChange );
-
     mDefaultFontSize = mStyleMonitor.GetDefaultFontSize();
   }
 
index 7b8efbb..bb84ea5 100644 (file)
@@ -54,6 +54,11 @@ class StyleManager;
  * If the application wants to customize the theme, RequestThemeChange
  * needs to be called.
  *
+ * To supply resource paths ( in json ) the following constant is available: APPLICATION_RESOURCE_PATH.
+ * It provides the path to the  application resource root folder, from there the filename can an be specified along with
+ * any sub folders, e.g Images, Models etc.
+ * The APPLICATION_RESOURCE_PATH can be retrieved using Application::GetResourcePath()
+ *
  * Signals
  * | %Signal Name            | Method                           |
  * |------------------------------------------------------------|
@@ -106,7 +111,7 @@ public:
    *
    * @SINCE_1_1.32
    * @param[in] themeFile If a relative path is specified, then this is relative
-   * to the directory returned by app_get_resource_path().
+   * to the directory returned by Application::GetResourcePath().
    */
   void ApplyTheme( const std::string& themeFile );
 
@@ -150,7 +155,7 @@ public:
    * @param[in] control The control to which to apply the style.
    * @param[in] jsonFileName The name of the JSON style file to apply. If a
    * relative path is specified, then this is relative to the directory
-   * returned by app_get_resource_path().
+   * returned by Application::GetResourcePath().
    * @param[in] styleName The name of the style within the JSON file to apply.
    */
   void ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName );
index d6c197f..f28eb47 100644 (file)
@@ -58,5 +58,15 @@ Each style selector can have resource folders associated with it.
 Images for that style should be in their own folder named images.
 
 Common images not specific for a particular style will be in the images-common folder located in the style folder.
+
+All application resources are stored in a defined path (application resource path), from this path sub directories can be specified.
+
+The application resource path  can be retrieved using Application::GetResourcePath()
+
+Alternatively to supply resource paths in json the following constant is available: APPLICATION_RESOURCE_PATH.
+
+It provides the path to the  application resource root folder, from there the filename can an be specified along with any sub folders, e.g Images, Models etc.
+
+
 *
 */