Revert "WheelEvent class pimpling"
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 1 Sep 2020 07:55:39 +0000 (16:55 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Tue, 1 Sep 2020 07:55:39 +0000 (16:55 +0900)
This reverts commit 477f1464fef5c1ca028c7c23e9cd74b4a7a7965a.

22 files changed:
automated-tests/src/dali/utc-Dali-Scene.cpp
automated-tests/src/dali/utc-Dali-Stage.cpp
automated-tests/src/dali/utc-Dali-WheelEvent.cpp
dali/devel-api/common/stage.h
dali/devel-api/events/wheel-event-devel.cpp [deleted file]
dali/devel-api/events/wheel-event-devel.h [deleted file]
dali/devel-api/file.list
dali/integration-api/events/wheel-event-integ.cpp
dali/integration-api/events/wheel-event-integ.h
dali/integration-api/scene.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/scene-impl.h
dali/internal/event/events/wheel-event-impl.cpp [deleted file]
dali/internal/event/events/wheel-event-impl.h [deleted file]
dali/internal/event/events/wheel-event-processor.cpp
dali/internal/file.list
dali/public-api/actors/actor.h
dali/public-api/actors/custom-actor-impl.h
dali/public-api/events/wheel-event.cpp
dali/public-api/events/wheel-event.h

index 299bf9b..2a72d80 100644 (file)
@@ -839,12 +839,12 @@ int UtcDaliSceneSignalWheelEventP(void)
   application.ProcessEvent( event );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.GetType() );
-  DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.GetDirection() );
-  DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.GetModifiers() );
-  DALI_TEST_CHECK( event.point == data.receivedWheelEvent.GetPoint() );
-  DALI_TEST_CHECK( event.delta == data.receivedWheelEvent.GetDelta() );
-  DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.GetTime() );
+  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.type );
+  DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.direction );
+  DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.modifiers );
+  DALI_TEST_CHECK( event.point == data.receivedWheelEvent.point );
+  DALI_TEST_CHECK( event.z == data.receivedWheelEvent.z );
+  DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.timeStamp );
 
   data.Reset();
 
@@ -852,12 +852,12 @@ int UtcDaliSceneSignalWheelEventP(void)
   application.ProcessEvent( event2 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.GetType() );
-  DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.GetDirection() );
-  DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.GetModifiers() );
-  DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.GetPoint() );
-  DALI_TEST_CHECK( event2.delta == data.receivedWheelEvent.GetDelta() );
-  DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.GetTime() );
+  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.type );
+  DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.direction );
+  DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.modifiers );
+  DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.point );
+  DALI_TEST_CHECK( event2.z == data.receivedWheelEvent.z );
+  DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.timeStamp );
   END_TEST;
 }
 
index d1a6444..4131d4b 100644 (file)
@@ -1406,12 +1406,12 @@ int UtcDaliStageSignalWheelEventP(void)
   application.ProcessEvent( event );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.GetType() );
-  DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.GetDirection() );
-  DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.GetModifiers() );
-  DALI_TEST_CHECK( event.point == data.receivedWheelEvent.GetPoint() );
-  DALI_TEST_CHECK( event.delta == data.receivedWheelEvent.GetDelta() );
-  DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.GetTime() );
+  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.type );
+  DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.direction );
+  DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.modifiers );
+  DALI_TEST_CHECK( event.point == data.receivedWheelEvent.point );
+  DALI_TEST_CHECK( event.z == data.receivedWheelEvent.z );
+  DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.timeStamp );
 
   data.Reset();
 
@@ -1419,12 +1419,12 @@ int UtcDaliStageSignalWheelEventP(void)
   application.ProcessEvent( event2 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.GetType() );
-  DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.GetDirection() );
-  DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.GetModifiers() );
-  DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.GetPoint() );
-  DALI_TEST_CHECK( event2.delta == data.receivedWheelEvent.GetDelta() );
-  DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.GetTime() );
+  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.type );
+  DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.direction );
+  DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.modifiers );
+  DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.point );
+  DALI_TEST_CHECK( event2.z == data.receivedWheelEvent.z );
+  DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.timeStamp );
   END_TEST;
 }
 
index dd9ea50..5d8d303 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/wheel-event-integ.h>
-#include <dali/devel-api/events/wheel-event-devel.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -45,7 +44,13 @@ struct SignalData
   {
     functorCalled = false;
 
-    receivedWheelEvent.Reset();
+    receivedWheelEvent.type = WheelEvent::MOUSE_WHEEL;
+    receivedWheelEvent.direction = 0;
+    receivedWheelEvent.modifiers = 0;
+    receivedWheelEvent.point = Vector2::ZERO;
+    receivedWheelEvent.z = 0;
+    receivedWheelEvent.timeStamp = 0;
+
     wheeledActor.Reset();
   }
 
@@ -77,15 +82,14 @@ int UtcDaliWheelEventConstructor(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event(WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2(1.0f, 1.0f), 1, 1000u);  // coustruct a wheel event
 
-  DALI_TEST_EQUALS(Dali::WheelEvent::MOUSE_WHEEL, event.GetType(), TEST_LOCATION); // check type
-  DALI_TEST_EQUALS(1, event.GetDirection(), TEST_LOCATION); // check direction
-  DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetModifiers(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(Vector2(1.0f, 1.0f), event.GetPoint(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(1, event.GetDelta(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(1000u, event.GetTime(), TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(WheelEvent::MOUSE_WHEEL, event.type, TEST_LOCATION); // check type
+  DALI_TEST_EQUALS(1, event.direction, TEST_LOCATION); // check direction
+  DALI_TEST_EQUALS(SHIFT_MODIFIER, event.modifiers, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(Vector2(1.0f, 1.0f), event.point, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(1, event.z, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(1000u, event.timeStamp, TEST_LOCATION); // check modifier
   END_TEST;
 }
 
@@ -94,10 +98,12 @@ int UtcDaliWheelEventIsShiftModifier(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event;
+  DALI_TEST_EQUALS(0u, event.modifiers, TEST_LOCATION);
+
+  event.modifiers = SHIFT_MODIFIER; // Set to Shift Modifier
 
-  DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetModifiers(), TEST_LOCATION);
+  DALI_TEST_EQUALS(SHIFT_MODIFIER, event.modifiers, TEST_LOCATION); // check able to set
 
   DALI_TEST_EQUALS(true, event.IsShiftModifier(), TEST_LOCATION); // check IsShiftModifier
 
@@ -109,10 +115,12 @@ int UtcDaliWheelEventIsCtrlModifier(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, CTRL_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event;
+  DALI_TEST_EQUALS(0u, event.modifiers, TEST_LOCATION);
+
+  event.modifiers = CTRL_MODIFIER; // Set to Ctrl Modifier
 
-  DALI_TEST_EQUALS(CTRL_MODIFIER, event.GetModifiers(), TEST_LOCATION);
+  DALI_TEST_EQUALS(CTRL_MODIFIER, event.modifiers, TEST_LOCATION); // check able to set
 
   DALI_TEST_EQUALS(true, event.IsCtrlModifier(), TEST_LOCATION); // check IsCtrlModifier
   END_TEST;
@@ -123,10 +131,12 @@ int UtcDaliWheelEventIsAltModifier(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, ALT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event;
+  DALI_TEST_EQUALS(0u, event.modifiers, TEST_LOCATION);
 
-  DALI_TEST_EQUALS(ALT_MODIFIER, event.GetModifiers(), TEST_LOCATION);
+  event.modifiers = ALT_MODIFIER; // Set to Alt Modifier
+
+  DALI_TEST_EQUALS(ALT_MODIFIER, event.modifiers, TEST_LOCATION); // check able to set
 
   DALI_TEST_EQUALS(true, event.IsAltModifier(), TEST_LOCATION);  // IsAltModifier
   END_TEST;
@@ -137,10 +147,9 @@ int UtcDaliWheelEventIsNotShiftModifier(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, CTRL_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event(WheelEvent::MOUSE_WHEEL, 1, CTRL_MODIFIER, Vector2(1.0f, 1.0f), 1, 1000u);
 
-  DALI_TEST_EQUALS(CTRL_MODIFIER, event.GetModifiers(), TEST_LOCATION);  // check different modifier used
+  DALI_TEST_EQUALS(CTRL_MODIFIER, event.modifiers, TEST_LOCATION);  // check different modifier used
 
   DALI_TEST_EQUALS(false, event.IsShiftModifier(), TEST_LOCATION);
   END_TEST;
@@ -151,10 +160,9 @@ int UtcDaliWheelEventIsNotCtrlModifier(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, ALT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event(WheelEvent::MOUSE_WHEEL, 1, ALT_MODIFIER, Vector2(1.0f, 1.0f), 1, 1000u);
 
-  DALI_TEST_EQUALS(ALT_MODIFIER, event.GetModifiers(), TEST_LOCATION);  // check different modifier used
+  DALI_TEST_EQUALS(ALT_MODIFIER, event.modifiers, TEST_LOCATION);  // check different modifier used
 
   DALI_TEST_EQUALS(false, event.IsCtrlModifier(), TEST_LOCATION);
   END_TEST;
@@ -165,10 +173,9 @@ int UtcDaliWheelEventIsNotAltModifier(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event(WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2(1.0f, 1.0f), 1, 1000u);
 
-  DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetModifiers(), TEST_LOCATION);  // check different modifier used
+  DALI_TEST_EQUALS(SHIFT_MODIFIER, event.modifiers, TEST_LOCATION);  // check different modifier used
 
   DALI_TEST_EQUALS(false, event.IsAltModifier(), TEST_LOCATION);
   END_TEST;
@@ -179,12 +186,12 @@ int UtcDaliWheelEventANDModifer(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_AND_CTRL_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event(WheelEvent::MOUSE_WHEEL, 1, SHIFT_AND_CTRL_MODIFIER, Vector2(1.0f, 1.0f), 1, 1000u);
   DALI_TEST_EQUALS(true, event.IsCtrlModifier() && event.IsShiftModifier(), TEST_LOCATION);
 
-  Dali::WheelEvent newEvent = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_EQUALS(false, newEvent.IsCtrlModifier() && newEvent.IsShiftModifier(), TEST_LOCATION);
+  event.modifiers = SHIFT_MODIFIER;
+
+  DALI_TEST_EQUALS(false, event.IsCtrlModifier() && event.IsShiftModifier(), TEST_LOCATION);
   END_TEST;
 }
 
@@ -193,12 +200,12 @@ int UtcDaliWheelEventORModifer(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  Dali::WheelEvent event = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_AND_CTRL_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_CHECK( event );
+  WheelEvent event(WheelEvent::MOUSE_WHEEL, 1, SHIFT_AND_CTRL_MODIFIER, Vector2(1.0f, 1.0f), 1, 1000u);
   DALI_TEST_EQUALS(true, event.IsCtrlModifier() || event.IsAltModifier(), TEST_LOCATION);
 
-  Dali::WheelEvent newEvent = DevelWheelEvent::New( Dali::WheelEvent::MOUSE_WHEEL, 1, SHIFT_MODIFIER, Vector2( 1.0f, 1.0f ), 1, 1000u );
-  DALI_TEST_EQUALS(false, newEvent.IsCtrlModifier() && newEvent.IsAltModifier(), TEST_LOCATION);
+  event.modifiers = SHIFT_MODIFIER;
+
+  DALI_TEST_EQUALS(false, event.IsCtrlModifier() && event.IsAltModifier(), TEST_LOCATION);
   END_TEST;
 }
 
@@ -227,12 +234,12 @@ int UtcDaliWheelEventSignalling(void)
   application.ProcessEvent( event );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   DALI_TEST_CHECK( actor == data.wheeledActor );
-  DALI_TEST_EQUALS(WheelEvent::MOUSE_WHEEL, data.receivedWheelEvent.GetType(), TEST_LOCATION); // check type
-  DALI_TEST_EQUALS(0, data.receivedWheelEvent.GetDirection(), TEST_LOCATION); // check direction
-  DALI_TEST_EQUALS(SHIFT_MODIFIER, data.receivedWheelEvent.GetModifiers(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(screenCoordinates, data.receivedWheelEvent.GetPoint(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(1, data.receivedWheelEvent.GetDelta(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(1000u, data.receivedWheelEvent.GetTime(), TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(WheelEvent::MOUSE_WHEEL, data.receivedWheelEvent.type, TEST_LOCATION); // check type
+  DALI_TEST_EQUALS(0, data.receivedWheelEvent.direction, TEST_LOCATION); // check direction
+  DALI_TEST_EQUALS(SHIFT_MODIFIER, data.receivedWheelEvent.modifiers, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(screenCoordinates, data.receivedWheelEvent.point, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(1, data.receivedWheelEvent.z, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(1000u, data.receivedWheelEvent.timeStamp, TEST_LOCATION); // check modifier
   data.Reset();
 
   // Emit a wheel signal where the actor is not present, will hit the root actor though
@@ -249,12 +256,12 @@ int UtcDaliWheelEventSignalling(void)
   DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
   DALI_TEST_CHECK( rootActor == rootData.wheeledActor );
-  DALI_TEST_EQUALS(WheelEvent::MOUSE_WHEEL, rootData.receivedWheelEvent.GetType(), TEST_LOCATION); // check type
-  DALI_TEST_EQUALS(0, rootData.receivedWheelEvent.GetDirection(), TEST_LOCATION); // check direction
-  DALI_TEST_EQUALS(SHIFT_MODIFIER, rootData.receivedWheelEvent.GetModifiers(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(screenCoordinates, rootData.receivedWheelEvent.GetPoint(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(1, rootData.receivedWheelEvent.GetDelta(), TEST_LOCATION); // check modifier
-  DALI_TEST_EQUALS(1000u, rootData.receivedWheelEvent.GetTime(), TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(WheelEvent::MOUSE_WHEEL, rootData.receivedWheelEvent.type, TEST_LOCATION); // check type
+  DALI_TEST_EQUALS(0, rootData.receivedWheelEvent.direction, TEST_LOCATION); // check direction
+  DALI_TEST_EQUALS(SHIFT_MODIFIER, rootData.receivedWheelEvent.modifiers, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(screenCoordinates, rootData.receivedWheelEvent.point, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(1, rootData.receivedWheelEvent.z, TEST_LOCATION); // check modifier
+  DALI_TEST_EQUALS(1000u, rootData.receivedWheelEvent.timeStamp, TEST_LOCATION); // check modifier
 
   // Remove actor from the scene
   application.GetScene().Remove( actor );
index 50ba0de..743f38e 100644 (file)
@@ -42,11 +42,11 @@ class Layer;
 class ObjectRegistry;
 class TouchEvent;
 class RenderTaskList;
-class WheelEvent;
 struct Vector2;
 struct Vector3;
 struct Vector4;
 struct KeyEvent;
+struct WheelEvent;
 
 /**
  * @brief The Stage is a top-level object used for displaying a tree of Actors.
diff --git a/dali/devel-api/events/wheel-event-devel.cpp b/dali/devel-api/events/wheel-event-devel.cpp
deleted file mode 100644 (file)
index 83ca780..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-// INTERNAL INCLUDES\r
-#include <dali/devel-api/events/wheel-event-devel.h>\r
-#include <dali/internal/event/events/wheel-event-impl.h>\r
-\r
-namespace Dali\r
-{\r
-\r
-namespace DevelWheelEvent\r
-{\r
-\r
-WheelEvent New( WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp )\r
-{\r
-  Internal::WheelEventPtr internal = Internal::WheelEvent::New( type, direction, modifiers, point, delta, timeStamp );\r
-\r
-  return WheelEvent( internal.Get() );\r
-}\r
-\r
-} // namespace DevelKeyEvent\r
-\r
-} // namespace Dali\r
-\r
diff --git a/dali/devel-api/events/wheel-event-devel.h b/dali/devel-api/events/wheel-event-devel.h
deleted file mode 100644 (file)
index 36f9b79..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef DALI_WHEEL_EVENT_DEVEL_H\r
-#define DALI_WHEEL_EVENT_DEVEL_H\r
-\r
-/*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-// INTERNAL INCLUDES\r
-#include <dali/public-api/events/wheel-event.h>\r
-\r
-namespace Dali\r
-{\r
-\r
-namespace DevelWheelEvent\r
-{\r
-\r
-/**\r
- * @brief Creates an initialized WheelEvent.\r
- *\r
- * @SINCE_1_9.26\r
- * @param[in] type      The type of the wheel event\r
- * @param[in] direction The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)\r
- * @param[in] modifiers Modifier keys pressed during the event (such as shift, alt and control)\r
- * @param[in] point     The co-ordinates of the cursor relative to the top-left of the screen\r
- * @param[in] delta     The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)\r
- * @param[in] timeStamp The time the wheel is being rolled\r
- * @return A handle to a newly allocated Dali resource\r
- */\r
-DALI_CORE_API WheelEvent New( WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp );\r
-\r
-\r
-} // namespace DevelWheelEvent\r
-\r
-} // namespace Dali\r
-\r
-#endif // DALI_WHEEL_EVENT_DEVEL_H\r
index 5ae82c1..b3f5f40 100644 (file)
@@ -16,7 +16,6 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/events/hit-test-algorithm.cpp
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
   ${devel_api_src_dir}/events/key-event-devel.cpp
-  ${devel_api_src_dir}/events/wheel-event-devel.cpp
   ${devel_api_src_dir}/images/distance-field.cpp
   ${devel_api_src_dir}/images/pixel-data-devel.cpp
   ${devel_api_src_dir}/object/handle-devel.cpp
@@ -72,7 +71,6 @@ SET( devel_api_core_events_header_files
   ${devel_api_src_dir}/events/hit-test-algorithm.h
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
   ${devel_api_src_dir}/events/key-event-devel.h
-  ${devel_api_src_dir}/events/wheel-event-devel.h
 )
 
 
index cf0d7ab..3f99995 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,18 +30,18 @@ WheelEvent::WheelEvent()
   direction( 0 ),
   modifiers( 0 ),
   point( Vector2::ZERO ),
-  delta( 0 ),
+  z( 0 ),
   timeStamp( 0 )
 {
 }
 
-WheelEvent::WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int delta, unsigned int timeStamp )
+WheelEvent::WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp )
 : Event( Wheel ),
   type( type ),
   direction( direction ),
   modifiers( modifiers ),
   point( point ),
-  delta( delta ),
+  z( z ),
   timeStamp( timeStamp )
 {
 }
index eb47e2c..cf23ffb 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_WHEEL_EVENT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,10 +60,10 @@ struct DALI_CORE_API WheelEvent : public Event
    * @param[in]  direction  The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)
    * @param[in]  modifiers  modifier keys pressed during the event (such as shift, alt and control)
    * @param[in]  point      The co-ordinates of the cursor relative to the top-left of the screen.
-   * @param[in]  delta      The offset of rolling (positive value means roll down, and negative value means roll up)
+   * @param[in]  z          The offset of rolling (positive value means roll down, and negative value means roll up)
    * @param[in]  timeStamp  The time the wheel is being rolled.
    */
-  WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int delta, unsigned int timeStamp );
+  WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp );
 
   /**
    * Virtual destructor
@@ -73,32 +73,32 @@ struct DALI_CORE_API WheelEvent : public Event
   // Data
 
   /**
-   *@copydoc Dali::WheelEvent::GetType
+   *@copydoc Dali::WheelEvent::type
    */
   Type type;
 
   /**
-   *@copydoc Dali::WheelEvent::GetDrection
+   *@copydoc Dali::WheelEvent::direction
    */
   int direction;
 
   /**
-   *@copydoc Dali::WheelEvent::GetModifiers
+   *@copydoc Dali::WheelEvent::modifiers
    */
   unsigned int modifiers;
 
   /**
-   *@copydoc Dali::WheelEvent::GetPoint
+   *@copydoc Dali::WheelEvent::point
    */
   Vector2 point;
 
   /**
-   *@copydoc Dali::WheelEvent::GetDelta
+   *@copydoc Dali::WheelEvent::z
    */
-  int delta;
+  int z;
 
   /**
-   *@copydoc Dali::WheelEvent::GetTime
+   *@copydoc Dali::WheelEvent::timeStamp
    */
   unsigned int timeStamp;
 
index 34c25b5..acd0dae 100755 (executable)
@@ -35,7 +35,7 @@ struct KeyEvent;
 class Layer;
 class RenderTaskList;
 class TouchEvent;
-class WheelEvent;
+struct WheelEvent;
 
 namespace Internal DALI_INTERNAL
 {
index 91f19d9..bd42ddc 100644 (file)
@@ -1854,7 +1854,7 @@ bool Actor::EmitHoverEventSignal( const Dali::HoverEvent& event )
   return consumed;
 }
 
-bool Actor::EmitWheelEventSignal( const Dali::WheelEvent& event )
+bool Actor::EmitWheelEventSignal( const WheelEvent& event )
 {
   bool consumed = false;
 
index 699cbf8..d6065af 100644 (file)
@@ -44,7 +44,7 @@ namespace Dali
 struct KeyEvent;
 class TouchData;
 class TouchEvent;
-class WheelEvent;
+struct WheelEvent;
 
 namespace Internal
 {
@@ -1422,7 +1422,7 @@ public:
    * @param[in] event The wheel event.
    * @return True if the event was consumed.
    */
-  bool EmitWheelEventSignal( const Dali::WheelEvent& event );
+  bool EmitWheelEventSignal( const WheelEvent& event );
 
   /**
    * @brief Emits the visibility change signal for this actor and all its children.
index 54301e1..22921d4 100755 (executable)
@@ -329,7 +329,7 @@ void Scene::EmitTouchedSignal( const Dali::TouchEvent& touch )
   }
 }
 
-void Scene::EmitWheelEventSignal(const Dali::WheelEvent& event)
+void Scene::EmitWheelEventSignal(const WheelEvent& event)
 {
   if ( !mWheelEventSignal.Empty() )
   {
index 3a8a3b2..c7eb739 100755 (executable)
@@ -263,7 +263,7 @@ public:
    * Used by the EventProcessor to emit wheel event signals.
    * @param[in] event The wheel event.
    */
-  void EmitWheelEventSignal( const Dali::WheelEvent& event );
+  void EmitWheelEventSignal( const WheelEvent& event );
 
   /**
    * @copydoc Dali::Integration::Scene::AddFrameRenderedCallback
diff --git a/dali/internal/event/events/wheel-event-impl.cpp b/dali/internal/event/events/wheel-event-impl.cpp
deleted file mode 100755 (executable)
index 2508796..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/events/wheel-event-impl.h>
-
-namespace Dali
-{
-
-namespace
-{
-const uint32_t MODIFIER_SHIFT = 0x1;
-const uint32_t MODIFIER_CTRL  = 0x2;
-const uint32_t MODIFIER_ALT   = 0x4;
-}
-
-namespace Internal
-{
-
-WheelEvent::WheelEvent()
-: mType( Dali::WheelEvent::MOUSE_WHEEL ),
-  mDirection( 0 ),
-  mModifiers( 0 ),
-  mPoint( Vector2::ZERO ),
-  mDelta( 0 ),
-  mTimeStamp( 0 )
-{
-}
-
-WheelEvent::WheelEvent( Dali::WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp )
-: mType( type ),
-  mDirection( direction ),
-  mModifiers( modifiers ),
-  mPoint( point ),
-  mDelta( delta ),
-  mTimeStamp( timeStamp )
-{
-}
-
-WheelEvent::~WheelEvent()
-{
-}
-
-WheelEventPtr WheelEvent::New( Dali::WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp )
-{
-  WheelEventPtr wheelEvent = new WheelEvent( type, direction, modifiers, point, delta, timeStamp );
-  return wheelEvent;
-}
-
-bool WheelEvent::IsShiftModifier() const
-{
-  return ( ( MODIFIER_SHIFT & mModifiers ) == MODIFIER_SHIFT );
-}
-
-bool WheelEvent::IsCtrlModifier() const
-{
-  return ( ( MODIFIER_CTRL & mModifiers ) == MODIFIER_CTRL );
-}
-
-bool WheelEvent::IsAltModifier() const
-{
-  return ( ( MODIFIER_ALT & mModifiers ) == MODIFIER_ALT );
-}
-
-Dali::WheelEvent::Type WheelEvent::GetType() const
-{
-  return mType;
-}
-
-int32_t WheelEvent::GetDirection() const
-{
-  return mDirection;
-}
-
-uint32_t WheelEvent::GetModifiers() const
-{
-  return mModifiers;
-}
-
-const Vector2& WheelEvent::GetPoint() const
-{
-  return mPoint;
-}
-
-int32_t WheelEvent::GetDelta() const
-{
-  return mDelta;
-}
-
-uint32_t WheelEvent::GetTime() const
-{
-  return mTimeStamp;
-}
-
-} // namsespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/event/events/wheel-event-impl.h b/dali/internal/event/events/wheel-event-impl.h
deleted file mode 100755 (executable)
index 91c8152..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef DALI_INTERNAL_WHEEL_EVENT_H
-#define DALI_INTERNAL_WHEEL_EVENT_H
-
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/object/base-object.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class WheelEvent;
-typedef IntrusivePtr< WheelEvent > WheelEventPtr;
-
-/**
- * @copydoc Dali::WheelEvent
- */
-class WheelEvent : public BaseObject
-{
-public:
-
-  // Construction & Destruction
-
-  /**
-   * @brief Default constructor
-   */
-  WheelEvent();
-
-  /**
-   * @brief Constructor.
-   *
-   * @param[in] type      The type of the wheel event
-   * @param[in] direction The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)
-   * @param[in] modifiers Modifier keys pressed during the event (such as shift, alt and control)
-   * @param[in] point     The co-ordinates of the cursor relative to the top-left of the screen
-   * @param[in] delta     The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
-   * @param[in] timeStamp The time the wheel is being rolled
-   */
-  WheelEvent( Dali::WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp );
-
-  /**
-   * @brief Destructor
-   */
-  ~WheelEvent();
-
-  /**
-   * Create a new WheelEvent.
-   *
-   * @param[in] type      The type of the wheel event
-   * @param[in] direction The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)
-   * @param[in] modifiers Modifier keys pressed during the event (such as shift, alt and control)
-   * @param[in] point     The co-ordinates of the cursor relative to the top-left of the screen
-   * @param[in] delta     The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
-   * @param[in] timeStamp The time the wheel is being rolled
-   * @return A smart-pointer to the newly allocated WheelEvent.
-   */
-  static WheelEventPtr New( Dali::WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp );
-
-  /**
-   * @copydoc Dali::WheelEvent::IsShiftModifier()
-   */
-  bool IsShiftModifier() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::IsCtrlModifier()
-   */
-  bool IsCtrlModifier() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::IsAltModifier()
-   */
-  bool IsAltModifier() const;
-
-  // Getters
-
-  /**
-   * @copydoc Dali::WheelEvent::GetType()
-   */
-  Dali::WheelEvent::Type GetType() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::GetDirection()
-   */
-  int32_t GetDirection() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::GetModifiers()
-   */
-  uint32_t GetModifiers() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::GetPoint()
-   */
-  const Vector2& GetPoint() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::GetDelta()
-   */
-  int32_t GetDelta() const;
-
-  /**
-   * @copydoc Dali::WheelEvent::GetTime()
-   */
-  uint32_t GetTime() const;
-
-private:
-
-  // Not copyable or movable
-
-  WheelEvent( const WheelEvent& rhs ) = delete;             ///< Deleted copy constructor
-  WheelEvent( WheelEvent&& rhs ) = delete;                  ///< Deleted move constructor
-  WheelEvent& operator=( const WheelEvent& rhs ) = delete;  ///< Deleted copy assignment operator
-  WheelEvent& operator=( WheelEvent&& rhs ) = delete;       ///< Deleted move assignment operator
-
-private:
-
-  Dali::WheelEvent::Type mType; ///< The type of the event
-  int32_t mDirection;           ///< The direction in which the wheel is being rolled
-  uint32_t mModifiers;          ///< Modifier keys pressed during the event
-  Vector2 mPoint;               ///< The co-ordinates of the cursor relative to the top-left of the screen when the wheel is being rolled.
-  int32_t mDelta;               ///< The offset of the wheel rolling
-  uint32_t mTimeStamp;          ///< The time when the wheel is being rolled
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::WheelEvent& GetImplementation( Dali::WheelEvent& wheelEvent )
-{
-  DALI_ASSERT_ALWAYS( wheelEvent && "Wheel Event handle is empty" );
-
-  BaseObject& object = wheelEvent.GetBaseObject();
-
-  return static_cast< Internal::WheelEvent& >( object );
-}
-
-inline const Internal::WheelEvent& GetImplementation( const Dali::WheelEvent& wheelEvent )
-{
-  DALI_ASSERT_ALWAYS( wheelEvent && "Wheel Event handle is empty" );
-
-  const BaseObject& object = wheelEvent.GetBaseObject();
-
-  return static_cast< const Internal::WheelEvent& >( object );
-}
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_WHEEL_EVENT_H
index a5c93e8..d2a7645 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
-#include <dali/internal/event/events/wheel-event-impl.h>
 
 namespace Dali
 {
@@ -44,7 +43,7 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WHE
 /**
  *  Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached.
  */
-Dali::Actor EmitWheelSignals( Dali::Actor actor, const Dali::WheelEvent& event )
+Dali::Actor EmitWheelSignals( Dali::Actor actor, const WheelEvent& event )
 {
   Dali::Actor consumedActor;
 
@@ -134,10 +133,9 @@ WheelEventProcessor::~WheelEventProcessor()
 
 void WheelEventProcessor::ProcessWheelEvent( const Integration::WheelEvent& event )
 {
-  WheelEventPtr wheelEvent = WheelEvent::New( static_cast< Dali::WheelEvent::Type >( event.type ), event.direction, event.modifiers, event.point, event.delta, event.timeStamp );
-  Dali::WheelEvent wheelEventHandle( wheelEvent.Get() );
+  WheelEvent wheelEvent( static_cast< WheelEvent::Type >( event.type ), event.direction, event.modifiers, event.point, event.z, event.timeStamp );
 
-  if( wheelEvent->GetType() == Dali::WheelEvent::MOUSE_WHEEL )
+  if( wheelEvent.type == WheelEvent::MOUSE_WHEEL )
   {
     Dali::HitTestAlgorithm::Results hitTestResults;
     HitTestAlgorithm::HitTest( mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), event.point, hitTestResults, IsActorWheelableFunction );
@@ -149,7 +147,7 @@ void WheelEventProcessor::ProcessWheelEvent( const Integration::WheelEvent& even
                    hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
 
     // Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached.
-    Dali::Actor consumedActor = EmitWheelSignals( hitTestResults.actor, wheelEventHandle );
+    Dali::Actor consumedActor = EmitWheelSignals( hitTestResults.actor, wheelEvent );
 
     DALI_LOG_INFO( gLogFilter, Debug::Concise, "HitActor:      (%p) %s\n", hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL, hitTestResults.actor ? hitTestResults.actor.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str() : "" );
     DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str() : "" );
@@ -157,7 +155,7 @@ void WheelEventProcessor::ProcessWheelEvent( const Integration::WheelEvent& even
   else
   {
     // if CUSTOM_WHEEL, emit the wheel event signal from the scene.
-    mScene.EmitWheelEventSignal( wheelEventHandle );
+    mScene.EmitWheelEventSignal( wheelEvent );
   }
 }
 
index f748935..b8ca1e2 100644 (file)
@@ -55,7 +55,6 @@ SET( internal_src_files
   ${internal_src_dir}/event/events/hit-test-algorithm-impl.cpp
   ${internal_src_dir}/event/events/hover-event-impl.cpp
   ${internal_src_dir}/event/events/hover-event-processor.cpp
-  ${internal_src_dir}/event/events/wheel-event-impl.cpp
   ${internal_src_dir}/event/events/wheel-event-processor.cpp
   ${internal_src_dir}/event/events/multi-point-event-util.cpp
   ${internal_src_dir}/event/events/touch-event-impl.cpp
index 09de0d7..18d1c3d 100644 (file)
@@ -51,7 +51,7 @@ class Quaternion;
 class Layer;
 class TouchEvent;
 class HoverEvent;
-class WheelEvent;
+struct WheelEvent;
 struct Vector2;
 struct Vector3;
 struct Vector4;
index aab7f0b..c4eaeb1 100644 (file)
@@ -46,7 +46,7 @@ class CustomActorImpl;
 class RelayoutContainer;
 struct KeyEvent;
 class HoverEvent;
-class WheelEvent;
+struct WheelEvent;
 struct Vector2;
 struct Vector3;
 
index c6dd583..7494ef0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // CLASS HEADER
 #include <dali/public-api/events/wheel-event.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/event/events/wheel-event-impl.h>
-
 namespace Dali
 {
 
-WheelEvent::WheelEvent()
-: BaseHandle()
+namespace
 {
-}
-
-WheelEvent::WheelEvent( const WheelEvent& rhs ) = default;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL  = 0x2;
+const uint32_t MODIFIER_ALT   = 0x4;
 
-WheelEvent::WheelEvent( WheelEvent&& rhs ) = default;
-
-WheelEvent::~WheelEvent()
-{
-}
-
-WheelEvent& WheelEvent::operator=( const WheelEvent& rhs ) = default;
-
-WheelEvent& WheelEvent::operator=( WheelEvent&& rhs ) = default;
-
-bool WheelEvent::IsShiftModifier() const
-{
-  return GetImplementation( *this ).IsShiftModifier();
 }
 
-bool WheelEvent::IsCtrlModifier() const
+WheelEvent::WheelEvent()
+: type( MOUSE_WHEEL ),
+  direction( 0 ),
+  modifiers( 0 ),
+  point( Vector2::ZERO ),
+  z( 0 ),
+  timeStamp( 0 )
 {
-  return GetImplementation( *this ).IsCtrlModifier();
 }
 
-bool WheelEvent::IsAltModifier() const
+WheelEvent::WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp )
+: type( type ),
+  direction( direction ),
+  modifiers( modifiers ),
+  point( point ),
+  z( z ),
+  timeStamp( timeStamp )
 {
-  return GetImplementation( *this ).IsAltModifier();
 }
 
-WheelEvent::Type WheelEvent::GetType() const
+WheelEvent::~WheelEvent()
 {
-  return GetImplementation( *this ).GetType();
 }
 
-int32_t WheelEvent::GetDirection() const
+bool WheelEvent::IsShiftModifier() const
 {
-  return GetImplementation( *this ).GetDirection();
-}
+  if ((MODIFIER_SHIFT & modifiers) == MODIFIER_SHIFT)
+  {
+    return true;
+  }
 
-uint32_t WheelEvent::GetModifiers() const
-{
-  return GetImplementation( *this ).GetModifiers();
+  return false;
 }
 
-const Vector2& WheelEvent::GetPoint() const
+bool WheelEvent::IsCtrlModifier() const
 {
-  return GetImplementation( *this ).GetPoint();
-}
+  if ((MODIFIER_CTRL & modifiers) == MODIFIER_CTRL)
+  {
+    return true;
+  }
 
-int32_t WheelEvent::GetDelta() const
-{
-  return GetImplementation( *this ).GetDelta();
+  return false;
 }
 
-uint32_t WheelEvent::GetTime() const
+bool WheelEvent::IsAltModifier() const
 {
-  return GetImplementation( *this ).GetTime();
-}
+  if ((MODIFIER_ALT & modifiers) == MODIFIER_ALT)
+  {
+    return true;
+  }
 
-WheelEvent::WheelEvent( Internal::WheelEvent* internal )
-: BaseHandle( internal )
-{
+  return false;
 }
 
 } // namespace Dali
index 4e6a985..7e310ee 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_WHEEL_EVENT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/vector2.h>
-#include <dali/public-api/object/base-handle.h>
 
-namespace Dali
-{
 
-namespace Internal DALI_INTERNAL
+namespace Dali
 {
-class WheelEvent;
-}
-
 /**
  * @addtogroup dali_core_events
  * @{
  */
 
 /**
- * @brief The wheel event class is used to store a wheel rolling, it facilitates
+ * @brief The wheel event structure is used to store a wheel rolling, it facilitates
  * processing of the wheel rolling and passing to other libraries like Toolkit.
  *
  * There is a key modifier which relates to keys like alt, shift and control functions are
@@ -50,11 +44,8 @@ class WheelEvent;
  * The mouse wheel event can be sent to the specific actor but the custom wheel event will be sent to the stage.
  * @SINCE_1_0.0
  */
-class DALI_CORE_API WheelEvent : public BaseHandle
+struct DALI_CORE_API WheelEvent
 {
-
-public:
-
   // Enumerations
 
   /**
@@ -67,31 +58,24 @@ public:
     CUSTOM_WHEEL      ///< Custom wheel event @SINCE_1_0.0
   };
 
-  // Construction & Destruction
-
   /**
-   * @brief An uninitialized WheelEvent instance.
-   *
-   * Calling member functions with an uninitialized WheelEvent handle is not allowed.
+   * @brief Default constructor.
    * @SINCE_1_0.0
    */
   WheelEvent();
 
   /**
-   * @brief Copy constructor.
+   * @brief Constructor.
    *
-   * @SINCE_1_9.26
-   * @param[in] rhs The WheelEvent to copy from
-   */
-  WheelEvent( const WheelEvent& rhs );
-
-  /**
-   * @brief Move constructor.
-   *
-   * @SINCE_1_9.26
-   * @param[in] rhs A reference to the moved WheelEvent
+   * @SINCE_1_0.0
+   * @param[in] type      The type of the wheel event
+   * @param[in] direction The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)
+   * @param[in] modifiers Modifier keys pressed during the event (such as shift, alt and control)
+   * @param[in] point     The co-ordinates of the cursor relative to the top-left of the screen
+   * @param[in] z         The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
+   * @param[in] timeStamp The time the wheel is being rolled
    */
-  WheelEvent( WheelEvent&& rhs );
+  WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp );
 
   /**
    * @brief Destructor.
@@ -100,24 +84,6 @@ public:
   ~WheelEvent();
 
   /**
-   * @brief Copy assignment operator.
-   *
-   * @SINCE_1_9.26
-   * @param[in] rhs The WheelEvent to copy from
-   * @return A reference to this
-   */
-  WheelEvent& operator=( const WheelEvent& rhs );
-
-  /**
-   * @brief Move assignment operator.
-   *
-   * @SINCE_1_9.26
-   * @param[in] rhs A reference to the moved WheelEvent
-   * @return A reference to this
-   */
-  WheelEvent& operator=( WheelEvent&& rhs );
-
-  /**
    * @brief Checks to see if Shift key modifier has been supplied.
    *
    * @SINCE_1_0.0
@@ -141,68 +107,44 @@ public:
    */
   bool IsAltModifier() const;
 
-  // Getters
+  // Data
 
   /**
-   * @brief Get the type of the wheel event.
+   * @brief Type of the event.
    *
-   * @SINCE_1_9.26
-   * @return The type of the wheel event
+   * @see Type
    */
-  Type GetType() const;
+  Type type;
 
   /**
-   * @brief Get the direction in which the wheel is being rolled.
+   * @brief The direction in which the wheel is being rolled.
    *
-   * @SINCE_1_9.26
-   * @return The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)
+   * 0 means the default vertical wheel, and 1 means horizontal wheel.
    */
-  int32_t GetDirection() const;
+  int32_t direction;
 
   /**
-   * @brief Get the modifier keys pressed during the event (such as shift, alt and control).
-   *
-   * @SINCE_1_9.26
-   * @return The modifier keys pressed during the event
+   * @brief Modifier keys pressed during the event (such as shift, alt and control).
    */
-  uint32_t GetModifiers() const;
+  uint32_t modifiers;
 
   /**
-   * @brief Get the co-ordinates of the cursor relative to the top-left of the screen
+   * @brief The co-ordinates of the cursor relative to the top-left of the screen
    * when the wheel is being rolled.
-   *
-   * @SINCE_1_9.26
-   * @return The co-ordinates of the cursor relative to the top-left of the screen
    */
-  const Vector2& GetPoint() const;
+  Vector2 point;
 
   /**
-   * @brief Get the offset of the wheel rolling
-   *
-   * @SINCE_1_9.26
-   * @return The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
+   * @brief The offset of the wheel rolling, where positive value means rolling down or clockwise
+   * and negative value means rolling up or counter-clockwise.
    */
-  int32_t GetDelta() const;
+  int32_t z;
 
   /**
-   * @brief Get the time when the wheel is being rolled.
-   *
-   * @SINCE_1_9.26
-   * @return The time when the wheel is being rolled
+   * @brief The time when the wheel is being rolled.
    */
-  uint32_t GetTime() const;
-
-public: // Not intended for application developers
+  uint32_t timeStamp;
 
-  /// @cond internal
-  /**
-   * @brief This constructor is used internally to Create an initialized WheelEvent handle.
-   *
-   * @SINCE_1_9.26
-   * @param[in] wheelEvent A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL WheelEvent( Internal::WheelEvent* hoverEvent );
-  /// @endcond
 };
 
 /**