Merge pull request #26148 from ksooo/fix-secondstotimestring-warning
[xbmc.git] / xbmc / input / InertialScrollingHandler.h
blob3fc2584ad3414d9d6915a09acfd676ceac1ee57d
1 /*
2 * Copyright (C) 2011-2024 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "utils/Geometry.h"
12 #include "utils/Vector.h"
14 #include <deque>
16 class CApplication;
17 class CAction;
19 class CInertialScrollingHandler
21 friend class CApplication;
23 public:
24 CInertialScrollingHandler();
26 bool IsScrolling() { return m_bScrolling; }
28 private:
29 bool CheckForInertialScrolling(const CAction* action);
30 bool ProcessInertialScroll(float frameTime);
33 * vars for inertial scrolling animation with gestures
36 // flag indicating that we currently do the inertial scrolling emulation
37 bool m_bScrolling = false;
39 // flag indicating an abort of scrolling
40 bool m_bAborting = false;
42 CVector m_iFlickVelocity;
44 struct PanPoint
46 unsigned int time;
47 CVector velocity;
48 PanPoint(unsigned int time, CVector velocity) : time(time), velocity(velocity) {}
49 unsigned int TimeElapsed() const;
51 std::deque<PanPoint> m_panPoints;
52 CPoint m_iLastGesturePoint;
53 CVector m_inertialDeacceleration;
54 unsigned int m_inertialStartTime = 0;
55 float m_timeToZero = 0.0f;