[Tizen] Add New API of Scene with screen orientation 26/243726/1
authorWonsik Jung <sidein@samsung.com>
Wed, 9 Sep 2020 09:35:00 +0000 (18:35 +0900)
committerWonsik Jung <sidein@samsung.com>
Wed, 9 Sep 2020 09:38:51 +0000 (18:38 +0900)
Add New API of Scene with screen orientation.
It is for application launching with avaiable screen orientation.

Change-Id: I35cfe7b6bb58880977ac4c72118fe471b8a93ae7

dali/integration-api/scene.cpp
dali/integration-api/scene.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/scene-impl.h

index bd0398b..f580379 100644 (file)
@@ -35,6 +35,12 @@ Scene Scene::New( Size size )
   return Scene( internal.Get() );
 }
 
+Scene Scene::New( Size size, int orientation )
+{
+  Internal::ScenePtr internal = Internal::Scene::New( size, orientation );
+  return Scene( internal.Get() );
+}
+
 Scene Scene::DownCast( BaseHandle handle )
 {
   return Scene( dynamic_cast<Dali::Internal::Scene*>( handle.GetObjectPtr()) );
index a3dbab0..43b3015 100755 (executable)
@@ -74,6 +74,16 @@ public:
   static Scene New( Size size );
 
   /**
+   * @brief Create an initialized Scene handle.
+   *
+   * @param[in] size The size of the set surface for this scene
+   * @param[in] orientation The orientation of the set surface for this scene
+   *
+   * @return a handle to a newly allocated Dali resource.
+   */
+  static Scene New( Size size, int orientation );
+
+  /**
    * @brief Downcast an Object handle to Scene handle.
    *
    * If handle points to a Scene object the downcast produces
index 45bda4d..208c1f7 100755 (executable)
@@ -48,7 +48,17 @@ ScenePtr Scene::New( Size size )
   ScenePtr scene = new Scene;
 
   // Second-phase construction
-  scene->Initialize( size );
+  scene->Initialize( size, 0 );
+
+  return scene;
+}
+
+ScenePtr Scene::New( Size size, int orientation )
+{
+  ScenePtr scene = new Scene;
+
+  // Second-phase construction
+  scene->Initialize( size, orientation );
 
   return scene;
 }
@@ -95,7 +105,7 @@ Scene::~Scene()
   // When this destructor is called, the scene has either already been removed from Core or Core has already been destroyed
 }
 
-void Scene::Initialize( Size size )
+void Scene::Initialize( Size size, int orientation )
 {
   ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
 
@@ -131,6 +141,7 @@ void Scene::Initialize( Size size )
   // Create the default render-task and ensure clear is enabled on it to show the background color
   RenderTaskPtr renderTask = mRenderTaskList->CreateTask( mRootLayer.Get(), mDefaultCamera.Get() );
   renderTask->SetClearEnabled(true);
+  mSurfaceOrientation = orientation;
 
   SurfaceResized( size.width, size.height, mSurfaceOrientation, false );
 
index c5c2e4d..9d8c8fb 100755 (executable)
@@ -117,6 +117,11 @@ public:
   static ScenePtr New( Size size );
 
   /**
+   * @copydoc Dali::Integration::Scene::New
+   */
+  static ScenePtr New( Size size, int orientation );
+
+  /**
    * virtual destructor
    */
   virtual ~Scene();
@@ -340,8 +345,9 @@ private:
    * Second-phase constructor.
    *
    * @param[in] size The size of the set surface
+   * @param[in] orientation The orientation of the set surface for this scene
    */
-  void Initialize( Size size );
+  void Initialize( Size size, int orientation );
 
   // Undefined
   Scene(const Scene&) = delete;