- mOrientation = orientation;
- // TODO: if orientation changed, apply the new style to all controls
- // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
- SetTheme();
+ DALI_LOG_STREAM( gLogFilter, Debug::Concise, "GetConfigurations()\n On entry, mThemeBuilder: " << (bool(mThemeBuilder)?"Created":"Empty") << " mThemeFile: " << mThemeFile);
+
+ Property::Map result;
+ if( mThemeBuilder )
+ {
+ result = mThemeBuilder.GetConfigurations();
+ }
+ else
+ {
+ DALI_LOG_STREAM( gLogFilter, Debug::Concise, "GetConfigurations() Loading default theme" );
+
+ bool themeLoaded = false;
+
+ mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+
+ // Load default theme because this is first try to load stylesheet.
+ themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+ mThemeFile = DEFAULT_THEME;
+
+ if( themeLoaded )
+ {
+ result = mThemeBuilder.GetConfigurations();
+ }
+ DALI_LOG_STREAM( gLogFilter, Debug::Concise, " themeLoaded" << (themeLoaded?"success":"failure") );
+ }
+
+ DALI_LOG_STREAM( gLogFilter, Debug::Concise, "GetConfigurations()\n On exit, result Count: " << (result.Count() != 0) );
+ DALI_LOG_STREAM( gLogFilter, Debug::Verbose, " result: " << result );
+
+ return result;
+}
+
+bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
+{
+ DALI_ASSERT_DEBUG( 0 != filename.length());
+
+ // as toolkit is platform agnostic, it cannot load files from filesystem
+ // ask style monitor to load the style sheet
+ if( mStyleMonitor )
+ {
+ return mStyleMonitor.LoadThemeFile( filename, stringOut );
+ }
+
+ return false;