2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/adaptor/common/adaptor-impl.h>
22 #include <app_common.h>
23 #ifdef APPCORE_WATCH_AVAILABLE
24 #include <screen_connector_provider.h>
26 #include <dali/integration-api/wayland/ecore-wl2/ecore-wl2-render-surface.h>
28 #include <dali/integration-api/wayland/ecore-wl/ecore-wl-render-surface.h>
32 #include <system_settings.h>
46 static void OnSystemLanguageChanged( system_settings_key_e key, void* data )
49 if( system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale ) != SYSTEM_SETTINGS_ERROR_NONE ||
52 DALI_LOG_ERROR( "DALI OnSystemLanguageChanged failed " );
56 Adaptor* adaptor = static_cast< Adaptor* >( data );
59 adaptor->SetRootLayoutDirection( locale );
67 void Adaptor::GetDataStoragePath( std::string& path)
70 char *pathInt = app_get_data_path();
84 void Adaptor::GetAppId( std::string& appId )
100 void Adaptor::SurfaceInitialized()
102 #ifdef APPCORE_WATCH_AVAILABLE
103 if ( !mUseRemoteSurface )
110 // Use strdup() in app_get_id(), so need to free memory
114 Ecore_Wl2_Window* ecoreWlWindow = AnyCast<Ecore_Wl2_Window*>( mNativeWindow );
115 screen_connector_provider_remote_enable(appId, ecore_wl2_window_surface_get(ecoreWlWindow));
117 Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
118 screen_connector_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
125 void Adaptor::SetupSystemInformation()
127 if( system_settings_set_changed_cb( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, OnSystemLanguageChanged, this ) != SYSTEM_SETTINGS_ERROR_NONE )
129 DALI_LOG_ERROR( "DALI system_settings_set_changed_cb failed.\n" );
134 if( system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale ) != SYSTEM_SETTINGS_ERROR_NONE ||
137 DALI_LOG_ERROR( "DALI OnSystemLanguageChanged failed " );
141 SetRootLayoutDirection( locale );
147 } // namespace Adaptor
149 } // namespace Internal