// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/context-notifier.h>
#include <tizen-logging.h>
#include <image-loading.h>
+#include <locale-utils.h>
+
using Dali::TextAbstraction::FontClient;
namespace Dali
{
Dali::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
}
+
+ SetupSystemInformation();
}
Adaptor::~Adaptor()
return mCore->GetStereoBase();
}
+void Adaptor::SetRootLayoutDirection( std::string locale )
+{
+ Dali::Stage stage = Dali::Stage::GetCurrent();
+
+ stage.GetRootLayer().SetProperty( DevelActor::Property::LAYOUT_DIRECTION, Internal::Adaptor::Locale::GetLayoutDirection( locale ) );
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize );
+ /**
+ * Sets layout direction of root by system language
+ * @param[in] locale System locale
+ */
+ void SetRootLayoutDirection( std::string locale );
+
public: //AdaptorInternalServices
/**
*/
void GetDataStoragePath(std::string& path);
+ /**
+ * Sets up system information if needs
+ */
+ void SetupSystemInformation();
+
private:
/**
{ "am", "Amharic", Dali::ImfManager::LeftToRight },
{ "ar", "Arabic", Dali::ImfManager::RightToLeft },
{ "as", "Assamese", Dali::ImfManager::LeftToRight },
- { "az", "Azeri", Dali::ImfManager::LeftToRight },
+ { "az", "Azerbaijani", Dali::ImfManager::RightToLeft },
{ "be", "Belarusian", Dali::ImfManager::LeftToRight },
{ "bg", "Bulgarian", Dali::ImfManager::LeftToRight },
{ "bn", "Bengali", Dali::ImfManager::LeftToRight },
return direction;
}
+// ToDo: ImfManager enum should be removed from this function or locale-util should be modified.
+DevelActor::LayoutDirection::Type GetLayoutDirection( std::string locale )
+{
+ Dali::ImfManager::TextDirection textDirection( Dali::ImfManager::LeftToRight );
+ DevelActor::LayoutDirection::Type direction( DevelActor::LayoutDirection::LTR );
+
+ textDirection = GetTextDirection( locale );
+
+ if( textDirection == Dali::ImfManager::RightToLeft )
+ {
+ direction = DevelActor::LayoutDirection::RTL;
+ }
+
+ return direction;
+}
+
} // namespace Locale
} // namespace Adaptor
// EXTERNAL INCLUDES
#include <string>
+#include <dali/devel-api/actors/actor-devel.h>
// INTERNAL INCLUDES
#include <imf-manager.h>
Dali::ImfManager::TextDirection GetTextDirection( std::string locale );
+DevelActor::LayoutDirection::Type GetLayoutDirection( std::string locale );
+
} // namespace Locale
} // namespace Adaptor
#include <ecore-wl-render-surface.h>
#endif
+#include <system_settings.h>
+
namespace Dali
{
namespace Adaptor
{
+namespace
+{
+
+static void OnSystemLanguageChanged( system_settings_key_e key, void* data )
+{
+ char* locale = NULL;
+ if( system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale ) != SYSTEM_SETTINGS_ERROR_NONE ||
+ locale == NULL )
+ {
+ DALI_LOG_ERROR( "DALI OnSystemLanguageChanged failed " );
+ return;
+ }
+
+ Adaptor* adaptor = static_cast< Adaptor* >( data );
+ if( adaptor != NULL )
+ {
+ adaptor->SetRootLayoutDirection( locale );
+ }
+
+ free( locale );
+}
+
+} // namesapce
+
void Adaptor::GetDataStoragePath( std::string& path)
{
#ifdef USE_APPFW
#endif
}
+void Adaptor::SetupSystemInformation()
+{
+ if( system_settings_set_changed_cb( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, OnSystemLanguageChanged, this ) != SYSTEM_SETTINGS_ERROR_NONE )
+ {
+ DALI_LOG_ERROR( "DALI system_settings_set_changed_cb failed.\n" );
+ return;
+ }
+
+ char* locale = NULL;
+ if( system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale ) != SYSTEM_SETTINGS_ERROR_NONE ||
+ locale == NULL )
+ {
+ DALI_LOG_ERROR( "DALI OnSystemLanguageChanged failed " );
+ return;
+ }
+
+ SetRootLayoutDirection( locale );
+
+ free( locale );
+
+}
+
} // namespace Adaptor
} // namespace Internal
{
}
+void Adaptor::SetupSystemInformation()
+{
+}
+
} // namespace Adaptor
} // namespace Internal
BuildRequires: pkgconfig(screen_connector_provider)
BuildRequires: pkgconfig(ecore-imf)
%endif
+
BuildRequires: pkgconfig(capi-system-system-settings)
# for feedback plugin