Commit 4f5450203b57333db6c4b649aa72cf6e796158d9
[dali_1.2.33] Merge branch 'devel/master'
Change-Id: I96f3f8887814d6813999650dfa210bd3ce946992
Showing
6 changed files
with
85 additions
and
5 deletions
examples/focus-integration/focus-integration.cpp
| @@ -141,6 +141,9 @@ public: | @@ -141,6 +141,9 @@ public: | ||
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &FocusIntegrationExample::OnPreFocusChange ); | 143 | KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &FocusIntegrationExample::OnPreFocusChange ); |
| 144 | + | ||
| 145 | + // Respond to key events | ||
| 146 | + mStage.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnKeyEvent ); | ||
| 144 | } | 147 | } |
| 145 | 148 | ||
| 146 | // Callback for KeyboardFocusManager | 149 | // Callback for KeyboardFocusManager |
examples/rendering-cube/rendering-cube.cpp
| @@ -100,6 +100,9 @@ public: | @@ -100,6 +100,9 @@ public: | ||
| 100 | 100 | ||
| 101 | // Respond to a click anywhere on the stage | 101 | // Respond to a click anywhere on the stage |
| 102 | stage.GetRootLayer().TouchSignal().Connect( this, &DrawCubeController::OnTouch ); | 102 | stage.GetRootLayer().TouchSignal().Connect( this, &DrawCubeController::OnTouch ); |
| 103 | + | ||
| 104 | + // Respond to key events | ||
| 105 | + stage.KeyEventSignal().Connect( this, &DrawCubeController::OnKeyEvent ); | ||
| 103 | } | 106 | } |
| 104 | 107 | ||
| 105 | bool OnTouch( Actor actor, const TouchData& touch ) | 108 | bool OnTouch( Actor actor, const TouchData& touch ) |
| @@ -110,6 +113,23 @@ public: | @@ -110,6 +113,23 @@ public: | ||
| 110 | } | 113 | } |
| 111 | 114 | ||
| 112 | /** | 115 | /** |
| 116 | + * @brief Called when any key event is received | ||
| 117 | + * | ||
| 118 | + * Will use this to quit the application if Back or the Escape key is received | ||
| 119 | + * @param[in] event The key event information | ||
| 120 | + */ | ||
| 121 | + void OnKeyEvent( const KeyEvent& event ) | ||
| 122 | + { | ||
| 123 | + if( event.state == KeyEvent::Down ) | ||
| 124 | + { | ||
| 125 | + if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | ||
| 126 | + { | ||
| 127 | + mApplication.Quit(); | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + /** | ||
| 113 | * This function creates a cube geometry including texture coordinates. | 133 | * This function creates a cube geometry including texture coordinates. |
| 114 | * Also it demonstrates using the indexed draw feature by setting an index array. | 134 | * Also it demonstrates using the indexed draw feature by setting an index array. |
| 115 | */ | 135 | */ |
examples/rendering-line/rendering-line.cpp
| @@ -93,6 +93,9 @@ public: | @@ -93,6 +93,9 @@ public: | ||
| 93 | 93 | ||
| 94 | // Respond to a click anywhere on the stage | 94 | // Respond to a click anywhere on the stage |
| 95 | stage.GetRootLayer().TouchSignal().Connect( this, &DrawLineController::OnTouch ); | 95 | stage.GetRootLayer().TouchSignal().Connect( this, &DrawLineController::OnTouch ); |
| 96 | + | ||
| 97 | + // Respond to key events | ||
| 98 | + stage.KeyEventSignal().Connect( this, &DrawLineController::OnKeyEvent ); | ||
| 96 | } | 99 | } |
| 97 | 100 | ||
| 98 | bool OnTouch( Actor actor, const TouchData& touch ) | 101 | bool OnTouch( Actor actor, const TouchData& touch ) |
| @@ -103,6 +106,23 @@ public: | @@ -103,6 +106,23 @@ public: | ||
| 103 | } | 106 | } |
| 104 | 107 | ||
| 105 | /** | 108 | /** |
| 109 | + * @brief Called when any key event is received | ||
| 110 | + * | ||
| 111 | + * Will use this to quit the application if Back or the Escape key is received | ||
| 112 | + * @param[in] event The key event information | ||
| 113 | + */ | ||
| 114 | + void OnKeyEvent( const KeyEvent& event ) | ||
| 115 | + { | ||
| 116 | + if( event.state == KeyEvent::Down ) | ||
| 117 | + { | ||
| 118 | + if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | ||
| 119 | + { | ||
| 120 | + mApplication.Quit(); | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + /** | ||
| 106 | * This function creates a line geometry made of two vertices in order | 126 | * This function creates a line geometry made of two vertices in order |
| 107 | * to draw a diagonal line. | 127 | * to draw a diagonal line. |
| 108 | */ | 128 | */ |
examples/rendering-textured-cube/rendering-textured-cube.cpp
| @@ -106,6 +106,9 @@ public: | @@ -106,6 +106,9 @@ public: | ||
| 106 | 106 | ||
| 107 | // Respond to a click anywhere on the stage | 107 | // Respond to a click anywhere on the stage |
| 108 | stage.GetRootLayer().TouchSignal().Connect( this, &TexturedCubeController::OnTouch ); | 108 | stage.GetRootLayer().TouchSignal().Connect( this, &TexturedCubeController::OnTouch ); |
| 109 | + | ||
| 110 | + // Respond to key events | ||
| 111 | + stage.KeyEventSignal().Connect( this, &TexturedCubeController::OnKeyEvent ); | ||
| 109 | } | 112 | } |
| 110 | 113 | ||
| 111 | bool OnTouch( Actor actor, const TouchData& touch ) | 114 | bool OnTouch( Actor actor, const TouchData& touch ) |
| @@ -116,6 +119,23 @@ public: | @@ -116,6 +119,23 @@ public: | ||
| 116 | } | 119 | } |
| 117 | 120 | ||
| 118 | /** | 121 | /** |
| 122 | + * @brief Called when any key event is received | ||
| 123 | + * | ||
| 124 | + * Will use this to quit the application if Back or the Escape key is received | ||
| 125 | + * @param[in] event The key event information | ||
| 126 | + */ | ||
| 127 | + void OnKeyEvent( const KeyEvent& event ) | ||
| 128 | + { | ||
| 129 | + if( event.state == KeyEvent::Down ) | ||
| 130 | + { | ||
| 131 | + if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | ||
| 132 | + { | ||
| 133 | + mApplication.Quit(); | ||
| 134 | + } | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + /** | ||
| 119 | * @brief CreateCubeGeometry | 139 | * @brief CreateCubeGeometry |
| 120 | * This function creates a cube geometry including texture coordinates. | 140 | * This function creates a cube geometry including texture coordinates. |
| 121 | * Also it demonstrates using the indexed draw feature by setting an index array. | 141 | * Also it demonstrates using the indexed draw feature by setting an index array. |
examples/rendering-triangle/rendering-triangle.cpp
| @@ -93,6 +93,9 @@ public: | @@ -93,6 +93,9 @@ public: | ||
| 93 | 93 | ||
| 94 | // Respond to a click anywhere on the stage | 94 | // Respond to a click anywhere on the stage |
| 95 | stage.GetRootLayer().TouchSignal().Connect( this, &DrawTriangleController::OnTouch ); | 95 | stage.GetRootLayer().TouchSignal().Connect( this, &DrawTriangleController::OnTouch ); |
| 96 | + | ||
| 97 | + // Respond to key events | ||
| 98 | + stage.KeyEventSignal().Connect( this, &DrawTriangleController::OnKeyEvent ); | ||
| 96 | } | 99 | } |
| 97 | 100 | ||
| 98 | bool OnTouch( Actor actor, const TouchData& touch ) | 101 | bool OnTouch( Actor actor, const TouchData& touch ) |
| @@ -103,6 +106,23 @@ public: | @@ -103,6 +106,23 @@ public: | ||
| 103 | } | 106 | } |
| 104 | 107 | ||
| 105 | /** | 108 | /** |
| 109 | + * @brief Called when any key event is received | ||
| 110 | + * | ||
| 111 | + * Will use this to quit the application if Back or the Escape key is received | ||
| 112 | + * @param[in] event The key event information | ||
| 113 | + */ | ||
| 114 | + void OnKeyEvent( const KeyEvent& event ) | ||
| 115 | + { | ||
| 116 | + if( event.state == KeyEvent::Down ) | ||
| 117 | + { | ||
| 118 | + if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | ||
| 119 | + { | ||
| 120 | + mApplication.Quit(); | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + /** | ||
| 106 | * This function creates a triangle geometry made of three vertices in order | 126 | * This function creates a triangle geometry made of three vertices in order |
| 107 | * to draw a coloured triangle. | 127 | * to draw a coloured triangle. |
| 108 | */ | 128 | */ |
packaging/com.samsung.dali-demo.spec
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | Name: com.samsung.dali-demo | 3 | Name: com.samsung.dali-demo |
| 4 | Summary: The OpenGLES Canvas Core Demo | 4 | Summary: The OpenGLES Canvas Core Demo |
| 5 | -Version: 1.2.32 | 5 | +Version: 1.2.33 |
| 6 | Release: 1 | 6 | Release: 1 |
| 7 | Group: System/Libraries | 7 | Group: System/Libraries |
| 8 | License: Apache-2.0 | 8 | License: Apache-2.0 |
| @@ -105,9 +105,6 @@ mkdir -p %{buildroot}%{smack_rule_dir} | @@ -105,9 +105,6 @@ mkdir -p %{buildroot}%{smack_rule_dir} | ||
| 105 | cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir} | 105 | cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir} |
| 106 | %endif | 106 | %endif |
| 107 | 107 | ||
| 108 | -# LICENSE | ||
| 109 | -mkdir -p %{buildroot}/usr/share/license | ||
| 110 | -cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name} | ||
| 111 | 108 | ||
| 112 | ############################## | 109 | ############################## |
| 113 | # Post Install | 110 | # Post Install |
| @@ -151,4 +148,4 @@ exit 0 | @@ -151,4 +148,4 @@ exit 0 | ||
| 151 | %if 0%{?enable_dali_smack_rules} && !%{with wayland} | 148 | %if 0%{?enable_dali_smack_rules} && !%{with wayland} |
| 152 | %config %{smack_rule_dir}/%{name}.rule | 149 | %config %{smack_rule_dir}/%{name}.rule |
| 153 | %endif | 150 | %endif |
| 154 | -%{_datadir}/license/%{name} | 151 | +%license LICENSE |