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

Unified Diff: components/exo/touch_stylus_delegate.h

Issue 2562803002: exo: Replace pointer based stylus and replace with touch based stylus (Closed)
Patch Set: updated deps in gn file Created 4 years 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 | « components/exo/touch.cc ('k') | components/exo/touch_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/touch_stylus_delegate.h
diff --git a/components/exo/touch_stylus_delegate.h b/components/exo/touch_stylus_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..e917a426486fe8bf4065241db7b2f6634e593022
--- /dev/null
+++ b/components/exo/touch_stylus_delegate.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_EXO_TOUCH_STYLUS_DELEGATE_H_
+#define COMPONENTS_EXO_TOUCH_STYLUS_DELEGATE_H_
+
+#include "base/time/time.h"
+#include "ui/events/event_constants.h"
+
+namespace gfx {
+class Vector2dF;
+}
+
+namespace exo {
+class Touch;
+
+// Handles stylus specific events as an extension to TouchDelegate.
+class TouchStylusDelegate {
+ public:
+ // Called at the top of the touch's destructor, to give observers a
+ // chance to remove themselves.
+ virtual void OnTouchDestroying(Touch* pointer) = 0;
+
+ // Called to set the tool type of a touch. Only called once with the down
+ // event. A tool type cannot change afterwards.
+ virtual void OnTouchTool(int touch_id, ui::EventPointerType type) = 0;
+
+ // Called when the force (pressure) of the touch changes.
+ // Normalized to be [0, 1].
+ virtual void OnTouchForce(base::TimeTicks time_stamp,
+ int touch_id,
+ float force) = 0;
+
+ // Called when the tilt of a pen/stylus changes. Measured from surface normal
+ // as plane angle in degrees, values lie in [-90,90]. A positive x is to the
+ // right and a positive y is towards the user.
+ virtual void OnTouchTilt(base::TimeTicks time_stamp,
+ int touch_id,
+ const gfx::Vector2dF& tilt) = 0;
+
+ protected:
+ virtual ~TouchStylusDelegate() {}
+};
+
+} // namespace exo
+
+#endif // COMPONENTS_EXO_TOUCH_STYLUS_DELEGATE_H_
« no previous file with comments | « components/exo/touch.cc ('k') | components/exo/touch_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698