[dali_1.2.33] Merge branch 'devel/master' 42/122442/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 3 Apr 2017 10:31:42 +0000 (11:31 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 3 Apr 2017 10:31:46 +0000 (11:31 +0100)
Change-Id: I96f3f8887814d6813999650dfa210bd3ce946992

examples/focus-integration/focus-integration.cpp
examples/rendering-cube/rendering-cube.cpp
examples/rendering-line/rendering-line.cpp
examples/rendering-textured-cube/rendering-textured-cube.cpp
examples/rendering-triangle/rendering-triangle.cpp
packaging/com.samsung.dali-demo.spec

index 10520b9..2e80a96 100644 (file)
@@ -141,6 +141,9 @@ public:
     }
 
     KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &FocusIntegrationExample::OnPreFocusChange );
+
+    // Respond to key events
+    mStage.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnKeyEvent );
   }
 
   // Callback for KeyboardFocusManager
index a42e832..9d745bd 100644 (file)
@@ -100,6 +100,9 @@ public:
 
     // Respond to a click anywhere on the stage
     stage.GetRootLayer().TouchSignal().Connect( this, &DrawCubeController::OnTouch );
+
+    // Respond to key events
+    stage.KeyEventSignal().Connect( this, &DrawCubeController::OnKeyEvent );
   }
 
   bool OnTouch( Actor actor, const TouchData& touch )
@@ -110,6 +113,23 @@ public:
   }
 
   /**
+   * @brief Called when any key event is received
+   *
+   * Will use this to quit the application if Back or the Escape key is received
+   * @param[in] event The key event information
+   */
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+  /**
    * This function creates a cube geometry including texture coordinates.
    * Also it demonstrates using the indexed draw feature by setting an index array.
    */
index 70d55cc..d16f8e6 100644 (file)
@@ -93,6 +93,9 @@ public:
 
     // Respond to a click anywhere on the stage
     stage.GetRootLayer().TouchSignal().Connect( this, &DrawLineController::OnTouch );
+
+    // Respond to key events
+    stage.KeyEventSignal().Connect( this, &DrawLineController::OnKeyEvent );
   }
 
   bool OnTouch( Actor actor, const TouchData& touch )
@@ -103,6 +106,23 @@ public:
   }
 
   /**
+   * @brief Called when any key event is received
+   *
+   * Will use this to quit the application if Back or the Escape key is received
+   * @param[in] event The key event information
+   */
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+  /**
    * This function creates a line geometry made of two vertices in order
    * to draw a diagonal line.
    */
index eeda48b..c2abc59 100644 (file)
@@ -106,6 +106,9 @@ public:
 
     // Respond to a click anywhere on the stage
     stage.GetRootLayer().TouchSignal().Connect( this, &TexturedCubeController::OnTouch );
+
+    // Respond to key events
+    stage.KeyEventSignal().Connect( this, &TexturedCubeController::OnKeyEvent );
   }
 
   bool OnTouch( Actor actor, const TouchData& touch )
@@ -116,6 +119,23 @@ public:
   }
 
   /**
+   * @brief Called when any key event is received
+   *
+   * Will use this to quit the application if Back or the Escape key is received
+   * @param[in] event The key event information
+   */
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+  /**
    * @brief CreateCubeGeometry
    * This function creates a cube geometry including texture coordinates.
    * Also it demonstrates using the indexed draw feature by setting an index array.
index 57233f8..00b4ff1 100644 (file)
@@ -93,6 +93,9 @@ public:
 
     // Respond to a click anywhere on the stage
     stage.GetRootLayer().TouchSignal().Connect( this, &DrawTriangleController::OnTouch );
+
+    // Respond to key events
+    stage.KeyEventSignal().Connect( this, &DrawTriangleController::OnKeyEvent );
   }
 
   bool OnTouch( Actor actor, const TouchData& touch )
@@ -103,6 +106,23 @@ public:
   }
 
   /**
+   * @brief Called when any key event is received
+   *
+   * Will use this to quit the application if Back or the Escape key is received
+   * @param[in] event The key event information
+   */
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+  /**
    * This function creates a triangle geometry made of three vertices in order
    * to draw a coloured triangle.
    */
index 9348b84..2098463 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       com.samsung.dali-demo
 Summary:    The OpenGLES Canvas Core Demo
-Version:    1.2.32
+Version:    1.2.33
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
@@ -105,9 +105,6 @@ mkdir -p %{buildroot}%{smack_rule_dir}
 cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir}
 %endif
 
-# LICENSE
-mkdir -p %{buildroot}/usr/share/license
-cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
 
 ##############################
 # Post Install
@@ -151,4 +148,4 @@ exit 0
 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
 %config %{smack_rule_dir}/%{name}.rule
 %endif
-%{_datadir}/license/%{name}
+%license LICENSE