From 70ec338b9f2376f4a6b8598fdc9e774b50ea7174 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Wed, 2 Sep 2020 14:44:06 +0100 Subject: [PATCH] Add devel API to create an initialized HoverEvent handle Change-Id: I8860e77d8abce7d2097cdd146316dff936303086 --- .../src/dali/utc-Dali-HoverProcessing.cpp | 16 ++++++++ dali/devel-api/events/hover-event-devel.cpp | 36 ++++++++++++++++++ dali/devel-api/events/hover-event-devel.h | 44 ++++++++++++++++++++++ dali/devel-api/file.list | 2 + 4 files changed, 98 insertions(+) create mode 100644 dali/devel-api/events/hover-event-devel.cpp create mode 100644 dali/devel-api/events/hover-event-devel.h diff --git a/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp b/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp index c0dc5b6..861ade2 100644 --- a/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include 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 index 0000000..7f67b81 --- /dev/null +++ b/dali/devel-api/events/hover-event-devel.cpp @@ -0,0 +1,36 @@ +/* + * 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 +#include + +namespace Dali +{ + +namespace DevelHoverEvent +{ + +HoverEvent New( uint32_t time ) +{ + return HoverEvent( new Internal::HoverEvent( time ) ); +} + +} // namespace DevelHoverEvent + +} // namespace Dali + diff --git a/dali/devel-api/events/hover-event-devel.h b/dali/devel-api/events/hover-event-devel.h new file mode 100644 index 0000000..13f2c0a --- /dev/null +++ b/dali/devel-api/events/hover-event-devel.h @@ -0,0 +1,44 @@ +#ifndef DALI_HOVER_EVENT_DEVEL_H +#define DALI_HOVER_EVENT_DEVEL_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 + +namespace Dali +{ + +namespace DevelHoverEvent +{ + +/** + * @brief Creates an initialized HoverEvent. + * + * @SINCE_1_9.28 + * @param[in] time The time the event occurred. + * @return A handle to a newly allocated Dali resource + */ +DALI_CORE_API HoverEvent New( uint32_t time ); + + +} // namespace DevelHoverEvent + +} // namespace Dali + +#endif // DALI_HOVER_EVENT_DEVEL_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index e756df5..6f83f08 100644 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -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 -- 2.7.4