30 #ifndef __ZOOM_CONTROLLER_H 31 #define __ZOOM_CONTROLLER_H 65 using TIMEOUT = std::chrono::milliseconds;
68 using CLOCK = std::chrono::steady_clock;
71 using TIME_PT = std::chrono::time_point<CLOCK>;
double GetScaleForRotation(int aRotation) override
Get the scale factor produced by a given mousewheel rotation.
The Cairo implementation of the graphics abstraction layer.
static constexpr double MSW_SCALE
A suitable (magic) scale factor for Windows systems.
std::chrono::time_point< CLOCK > TIME_PT
The default timeout, after which a another scroll will not be accelerated.
virtual double GetScaleForRotation(int aRotation)=0
Get the scale factor produced by a given mousewheel rotation.
Handle the response of the zoom scale to external inputs.
CONSTANT_ZOOM_CONTROLLER(double aScale)
TIME_PT m_lastTimestamp
The timeout value.
static constexpr TIMEOUT DEFAULT_TIMEOUT
The default minimum step factor for accelerating controller.
double m_scale
A multiplier for the minimum zoom step size.
static constexpr double DEFAULT_ACCELERATION_SCALE
TIMESTAMP_PROVIDER * m_timestampProv
< The timestamp provider to use (might be provided externally).
TIMEOUT GetTimeout() const
std::chrono::steady_clock CLOCK
The type of the time stamps.
ACCELERATING_ZOOM_CONTROLLER(double aScale=DEFAULT_ACCELERATION_SCALE, const TIMEOUT &aAccTimeout=DEFAULT_TIMEOUT, TIMESTAMP_PROVIDER *aTimestampProv=nullptr)
static constexpr double GTK3_SCALE
A suitable (magic) scale factor for Mac systems.
std::chrono::milliseconds TIMEOUT
The clock used for the timestamp (guaranteed to be monotonic).
virtual ~TIMESTAMP_PROVIDER()=default
double m_scale
< The scale factor set by the constructor.
Class that zooms faster if scroll events happen very close together.
static constexpr double MAC_SCALE
double GetScaleForRotation(int aRotation) override
A suitable (magic) scale factor for GTK3 systems.
A #ZOOM_CONTROLLER that zooms by a fixed factor based only on the magnitude of the scroll wheel rotat...
virtual TIME_PT GetTimestamp()=0
static constexpr double MANUAL_SCALE_FACTOR
virtual ~ZOOM_CONTROLLER()=default
std::unique_ptr< TIMESTAMP_PROVIDER > m_ownTimestampProv
The timestamp of the last event.
void SetTimeout(const TIMEOUT &aNewTimeout)