2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/events/hover-event-impl.h>
25 HoverEvent::HoverEvent()
31 HoverEvent::HoverEvent(unsigned long time)
37 HoverEventPtr HoverEvent::Clone(const HoverEvent& rhs)
39 HoverEventPtr hoverEvent(new HoverEvent);
40 hoverEvent->mPoints = rhs.mPoints;
41 hoverEvent->mTime = rhs.mTime;
45 unsigned long HoverEvent::GetTime() const
50 std::size_t HoverEvent::GetPointCount() const
52 return mPoints.size();
55 int32_t HoverEvent::GetDeviceId(std::size_t point) const
57 if(point < mPoints.size())
59 return mPoints[point].GetDeviceId();
64 PointState::Type HoverEvent::GetState(std::size_t point) const
66 if(point < mPoints.size())
68 return mPoints[point].GetState();
70 return PointState::FINISHED;
73 Dali::Actor HoverEvent::GetHitActor(std::size_t point) const
75 if(point < mPoints.size())
77 return mPoints[point].GetHitActor();
82 const Vector2& HoverEvent::GetLocalPosition(std::size_t point) const
84 if(point < mPoints.size())
86 return mPoints[point].GetLocalPosition();
91 const Vector2& HoverEvent::GetScreenPosition(std::size_t point) const
93 if(point < mPoints.size())
95 return mPoints[point].GetScreenPosition();
100 const Integration::Point& HoverEvent::GetPoint(std::size_t point) const
102 DALI_ASSERT_DEBUG(point < mPoints.size() && "No point at index");
103 return mPoints[point];
106 Integration::Point& HoverEvent::GetPoint(std::size_t point)
108 DALI_ASSERT_DEBUG(point < mPoints.size() && "No point at index");
109 return mPoints[point];
112 void HoverEvent::AddPoint(const Integration::Point& point)
114 mPoints.push_back(point);
117 } // namespace Internal