Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: remoting/client/gesture_interpreter.h

Issue 2869723007: [CRD iOS] Viewport fling animation (Closed)
Patch Set: Merge branch 'master' into feat-fling-animation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/fling_tracker.cc ('k') | remoting/client/gesture_interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/gesture_interpreter.h
diff --git a/remoting/client/gesture_interpreter.h b/remoting/client/gesture_interpreter.h
index 9ad968fff2353ef1e62c8ded65b05eee744deff2..f4d369b8af60ccf4ad225baba3f2e2cd2382a283 100644
--- a/remoting/client/gesture_interpreter.h
+++ b/remoting/client/gesture_interpreter.h
@@ -9,6 +9,7 @@
#include "remoting/client/chromoting_session.h"
#include "remoting/client/desktop_viewport.h"
+#include "remoting/client/fling_animation.h"
#include "remoting/proto/event.pb.h"
namespace remoting {
@@ -27,19 +28,39 @@ class GestureInterpreter {
~GestureInterpreter();
// Coordinates of the OpenGL view surface will be used.
+
+ // This can happen in conjunction with Pan().
void Pinch(float pivot_x, float pivot_y, float scale);
+
+ // Called whenever the user did a pan gesture. It can be one-finger pan, no
+ // matter long-press in on or not, or two-finger pan in conjunction with the
+ // pinch gesture. Two-finger pan without pinch is consider a scroll gesture.
void Pan(float translation_x, float translation_y);
+
+ // Called when the user did a one-finger tap.
void Tap(float x, float y);
+
void TwoFingerTap(float x, float y);
// Caller is expected to call both Pan() and LongPress() when long-press is in
// progress.
void LongPress(float x, float y, GestureState state);
+ // Called when the user has just done a one-finger pan (no long-press or
+ // pinching) and the pan gesture still has some final velocity.
+ void OneFingerFling(float velocity_x, float velocity_y);
+
+ // Called to process one animation frame.
+ void ProcessAnimations();
+
void OnSurfaceSizeChanged(int width, int height);
void OnDesktopSizeChanged(int width, int height);
private:
+ void PanWithoutAbortAnimations(float translation_x, float translation_y);
+
+ void AbortAnimations();
+
void InjectMouseClick(float x,
float y,
protocol::MouseEvent_MouseButton button);
@@ -49,6 +70,8 @@ class GestureInterpreter {
ChromotingSession* input_stub_;
bool is_dragging_mode_ = false;
+ FlingAnimation pan_animation_;
+
// GestureInterpreter is neither copyable nor movable.
GestureInterpreter(const GestureInterpreter&) = delete;
GestureInterpreter& operator=(const GestureInterpreter&) = delete;
« no previous file with comments | « remoting/client/fling_tracker.cc ('k') | remoting/client/gesture_interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698