summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordongsug.song <dongsug.song@samsung.com>2017-03-31 14:57:03 +0900
committerdongsug.song <dongsug.song@samsung.com>2017-03-31 14:57:09 +0900
commit0fb488b9861d0539e9ea6d8dbc1cee05faedf508 (patch)
treee9dca680714e33e37e4709e6cb5e1b40cd53af5b
parente92a30bfea4fa13511c3dbdc23e6fd9c2b8dca08 (diff)
parent06ff0486b4ecc6a5b89d7a50eda92faafb1f6721 (diff)
downloaddali-demo-0fb488b9861d0539e9ea6d8dbc1cee05faedf508.tar.gz
dali-demo-0fb488b9861d0539e9ea6d8dbc1cee05faedf508.tar.bz2
dali-demo-0fb488b9861d0539e9ea6d8dbc1cee05faedf508.zip
Change-Id: If12fb6560b14a3d83693d4135c4e2d3530ccc55e
-rw-r--r--examples/focus-integration/focus-integration.cpp3
-rw-r--r--examples/rendering-cube/rendering-cube.cpp20
-rw-r--r--examples/rendering-line/rendering-line.cpp20
-rw-r--r--examples/rendering-textured-cube/rendering-textured-cube.cpp20
-rw-r--r--examples/rendering-triangle/rendering-triangle.cpp20
-rwxr-xr-xpackaging/com.samsung.dali-demo.spec5
6 files changed, 84 insertions, 4 deletions
diff --git a/examples/focus-integration/focus-integration.cpp b/examples/focus-integration/focus-integration.cpp
index 10520b9a..2e80a965 100644
--- a/examples/focus-integration/focus-integration.cpp
+++ b/examples/focus-integration/focus-integration.cpp
@@ -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
diff --git a/examples/rendering-cube/rendering-cube.cpp b/examples/rendering-cube/rendering-cube.cpp
index a42e8324..9d745bd7 100644
--- a/examples/rendering-cube/rendering-cube.cpp
+++ b/examples/rendering-cube/rendering-cube.cpp
@@ -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.
*/
diff --git a/examples/rendering-line/rendering-line.cpp b/examples/rendering-line/rendering-line.cpp
index 70d55cca..d16f8e67 100644
--- a/examples/rendering-line/rendering-line.cpp
+++ b/examples/rendering-line/rendering-line.cpp
@@ -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.
*/
diff --git a/examples/rendering-textured-cube/rendering-textured-cube.cpp b/examples/rendering-textured-cube/rendering-textured-cube.cpp
index eeda48b9..c2abc592 100644
--- a/examples/rendering-textured-cube/rendering-textured-cube.cpp
+++ b/examples/rendering-textured-cube/rendering-textured-cube.cpp
@@ -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.
diff --git a/examples/rendering-triangle/rendering-triangle.cpp b/examples/rendering-triangle/rendering-triangle.cpp
index 57233f81..00b4ff1b 100644
--- a/examples/rendering-triangle/rendering-triangle.cpp
+++ b/examples/rendering-triangle/rendering-triangle.cpp
@@ -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.
*/
diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec
index 9348b844..ca21b3dc 100755
--- a/packaging/com.samsung.dali-demo.spec
+++ b/packaging/com.samsung.dali-demo.spec
@@ -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