Add devel API to create an initialized HoverEvent handle 34/243034/2
authorRichard Huang <r.huang@samsung.com>
Wed, 2 Sep 2020 13:44:06 +0000 (14:44 +0100)
committerRichard Huang <r.huang@samsung.com>
Wed, 2 Sep 2020 16:06:19 +0000 (17:06 +0100)
Change-Id: I8860e77d8abce7d2097cdd146316dff936303086

automated-tests/src/dali/utc-Dali-HoverProcessing.cpp
dali/devel-api/events/hover-event-devel.cpp [new file with mode: 0644]
dali/devel-api/events/hover-event-devel.h [new file with mode: 0644]
dali/devel-api/file.list

index c0dc5b6..861ade2 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
+#include <dali/devel-api/events/hover-event-devel.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -1280,3 +1281,18 @@ int UtcDaliHoverClippingActor(void)
 
   END_TEST;
 }
+
+int UtcDaliHoverEventCreate(void)
+{
+  TestApplication application;
+
+  Dali::HoverEvent hoverEvent = DevelHoverEvent::New( 100 );
+  DALI_TEST_CHECK( hoverEvent );
+
+  // Emit a started signal
+  DALI_TEST_EQUALS( 100, hoverEvent.GetTime(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0, hoverEvent.GetPointCount(), TEST_LOCATION );
+
+  END_TEST;
+}
+
diff --git a/dali/devel-api/events/hover-event-devel.cpp b/dali/devel-api/events/hover-event-devel.cpp
new file mode 100644 (file)
index 0000000..7f67b81
--- /dev/null
@@ -0,0 +1,36 @@
+/*\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/hover-event-devel.h>\r
+#include <dali/internal/event/events/hover-event-impl.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace DevelHoverEvent\r
+{\r
+\r
+HoverEvent New( uint32_t time )\r
+{\r
+  return HoverEvent( new Internal::HoverEvent( time ) );\r
+}\r
+\r
+} // namespace DevelHoverEvent\r
+\r
+} // namespace Dali\r
+\r
diff --git a/dali/devel-api/events/hover-event-devel.h b/dali/devel-api/events/hover-event-devel.h
new file mode 100644 (file)
index 0000000..13f2c0a
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef DALI_HOVER_EVENT_DEVEL_H\r
+#define DALI_HOVER_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/hover-event.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace DevelHoverEvent\r
+{\r
+\r
+/**\r
+ * @brief Creates an initialized HoverEvent.\r
+ *\r
+ * @SINCE_1_9.28\r
+ * @param[in] time The time the event occurred.\r
+ * @return A handle to a newly allocated Dali resource\r
+ */\r
+DALI_CORE_API HoverEvent New( uint32_t time );\r
+\r
+\r
+} // namespace DevelHoverEvent\r
+\r
+} // namespace Dali\r
+\r
+#endif // DALI_HOVER_EVENT_DEVEL_H\r
index e756df5..6f83f08 100644 (file)
@@ -14,6 +14,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/common/stage-devel.cpp
   ${devel_api_src_dir}/common/stage.cpp
   ${devel_api_src_dir}/events/hit-test-algorithm.cpp
+  ${devel_api_src_dir}/events/hover-event-devel.cpp
   ${devel_api_src_dir}/events/key-event-devel.cpp
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
   ${devel_api_src_dir}/events/pan-gesture-devel.cpp
@@ -72,6 +73,7 @@ SET( devel_api_core_common_header_files
 
 SET( devel_api_core_events_header_files
   ${devel_api_src_dir}/events/hit-test-algorithm.h
+  ${devel_api_src_dir}/events/hover-event-devel.h
   ${devel_api_src_dir}/events/key-event-devel.h
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
   ${devel_api_src_dir}/events/pan-gesture-devel.h