namespace
{
-const char* LANDSCAPE_QUALIFIER = "landscape";
+//const char* LANDSCAPE_QUALIFIER = "landscape";
const char* PORTRAIT_QUALIFIER = "portrait";
const char* FONT_SIZE_QUALIFIER = "fontsize";
void StyleManager::ApplyDefaultTheme()
{
- std::string empty;
- SetTheme( empty );
+ SetTheme( DEFAULT_THEME );
}
const std::string& StyleManager::GetDefaultFontFamily() const
{
bool themeLoaded = false;
- mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-
- // Always load the default theme first, then merge in the custom theme if present
- themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+ if( mThemeFile.compare(DEFAULT_THEME) == 0 && mThemeBuilder )
+ {
+ // We have already loaded the default theme into mThemeBuilder
+ }
+ else
+ {
+ // Reload the default theme
+ mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
+ themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
+ }
- if( ! themeFile.empty() )
+ if( themeFile.compare(DEFAULT_THEME) != 0 )
{
+ // The theme is different to the default: Merge it
+ themeLoaded = LoadJSON( mThemeBuilder, themeFile );
mThemeFile = themeFile;
- themeLoaded = LoadJSON( mThemeBuilder, mThemeFile );
}
if( themeLoaded )
}
}
+const Property::Map StyleManager::GetConfigurations()
+{
+ Property::Map result;
+ if( mThemeBuilder )
+ {
+ result = mThemeBuilder.GetConfigurations();
+ }
+ else
+ {
+ 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();
+ }
+ }
+
+ return result;
+}
+
bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut )
{
DALI_ASSERT_DEBUG( 0 != filename.length());
static void CollectQualifiers( std::vector<std::string>& qualifiersOut )
{
// Append the relevant qualifier for orientation
- int orientation = 0; // Get the orientation from the system
- switch( orientation )
- {
- case 90:
- case 270:
- {
- qualifiersOut.push_back( std::string( LANDSCAPE_QUALIFIER ) );
- break;
- }
- case 180:
- case 0: // fall through
- default:
- {
- qualifiersOut.push_back( std::string( PORTRAIT_QUALIFIER ) );
- break;
- }
- }
+ // int orientation = 0; // Get the orientation from the system
+ /*
+ //// To Do /////
+ Getting orientation from the system, and determine Qualifie LANDSCAPE or PORTRAIT
+ orientation 0, 180 : PORTRAIT_QUALIFIER (default)
+ orientation 90, 270 : LANDSCAPE_QUALIFIER
+ */
+
+ qualifiersOut.push_back( std::string( PORTRAIT_QUALIFIER ) );
+
}
/**