FancyZones and Shortcut Guide initial commit

Co-authored-by: Alexis Campailla <alexis@janeasystems.com>
Co-authored-by: Bret Anderson <bretan@microsoft.com>
Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Jeff Bogdan <jeffbog@microsoft.com>
Co-authored-by: March Rogers <marchr@microsoft.com>
Co-authored-by: Mike Harsh <mharsh@microsoft.com>
Co-authored-by: Nachum Bundak <Nachum.Bundak@microsoft.com>
Co-authored-by: Oliver Jones <ojones@microsoft.com>
Co-authored-by: Patrick Little <plittle@microsoft.com>
This commit is contained in:
Bartosz Sosnowski
2019-09-04 18:26:26 +02:00
committed by Bartosz Sosnowski
parent 10c5396099
commit 8431b80e48
341 changed files with 54766 additions and 62 deletions

31
src/common/animation.h Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
#include <chrono>
/*
Usage:
When creating animation contstructor takes one parameter - how long
should the animation take in seconds.
Call reset() when starting animation.
When redering, call value() to get value from 0 to 1 - depending on animation
progress.
*/
class Animation {
public:
enum AnimFunctions {
LINEAR = 0,
EASE_OUT_EXPO
};
Animation(double duration = 1, double start = 0, double stop = 1);
void reset();
void reset(double duration);
void reset(double duration, double start, double stop);
double value(AnimFunctions apply_function) const;
bool done() const;
private:
double apply_animation_function(double t, AnimFunctions apply_function) const;
std::chrono::high_resolution_clock::time_point start;
double start_value, end_value, duration;
};