[3.0] Modify to use remote-surface for WatchApplication
[platform/core/uifw/dali-adaptor.git] / adaptors / tizen / adaptor-impl-tizen.cpp
index ff2468e..cd002cd 100644 (file)
 #include <adaptor-impl.h>
 
 // EXTERNAL INCLUDES
-#ifdef OVER_TIZEN_SDK_2_2
 #include <app.h>
+#ifdef APPCORE_WATCH_AVAILABLE
+#include <aul_rsm_provider.h>
+#include <ecore-wl-render-surface.h>
 #endif
 
 namespace Dali
@@ -34,14 +36,49 @@ namespace Adaptor
 
 void Adaptor::GetDataStoragePath( std::string& path)
 {
-  path = "";
-#ifdef OVER_TIZEN_SDK_2_2
+#ifdef USE_APPFW
   char *pathInt = app_get_data_path();
   if ( pathInt )
   {
     path = pathInt;
     free( pathInt );
   }
+  else
+  {
+    path = "";
+  }
+#endif
+
+}
+
+void Adaptor::GetAppId( std::string& appId )
+{
+#ifdef USE_APPFW
+  char *id;
+  app_get_id(&id);
+  if ( id )
+  {
+    appId = id;
+  }
+  else
+  {
+    appId = "";
+  }
+#endif
+}
+
+void Adaptor::SurfaceInitialized()
+{
+#ifdef APPCORE_WATCH_AVAILABLE
+  if ( !mUseRemoteSurface )
+  {
+    return;
+  }
+  char *appId;
+  app_get_id(&appId);
+
+  Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
+  aul_rsm_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
 #endif
 }