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

Unified Diff: ui/aura/event.h

Issue 9773024: This patch implements Chromium's Aura gesture recognizer in terms of utouch-grail and utouch-frame … (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 8 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 | « ui/aura/aura.gyp ('k') | ui/aura/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event.h
===================================================================
--- ui/aura/event.h (revision 126124)
+++ ui/aura/event.h (working copy)
@@ -294,8 +294,7 @@
int flags)
: MouseEvent(model, source, target, type, flags),
x_offset_(model.x_offset_),
- y_offset_(model.y_offset_) {
- }
+ y_offset_(model.y_offset_) {}
float x_offset() const { return x_offset_; }
float y_offset() const { return y_offset_; }
@@ -309,25 +308,56 @@
class AURA_EXPORT GestureEvent : public LocatedEvent {
public:
+ // Bundles properties of a gesture event and allows
+ // for a uniform c'tor signature for GestureEvent.
+ // REMARK(tvoss): Instead of modelling "isolated" fields
+ // in this property, a 3x3 transformation matrix might be
+ // more appropriate.
+ struct Properties {
+ Properties()
+ : point_id(-1),
+ delta_x(0.f),
+ delta_y(0.f),
+ scale_x(1.f),
+ scale_y(1.f) {
+ }
+
+ // Point or touch-id in case of long-press gestures.
+ int point_id;
+
+ // For drag gestures
+ float delta_x;
+ float delta_y;
+
+ // For pinch gestures
+ float scale_x;
+ float scale_y;
+ };
+
GestureEvent(ui::EventType type,
int x,
int y,
int flags,
base::Time time_stamp,
- float delta_x,
- float delta_y);
+ const Properties& properties);
// Create a new TouchEvent which is identical to the provided model.
// If source / target windows are provided, the model location will be
// converted from |source| coordinate system to |target| coordinate system.
GestureEvent(const GestureEvent& model, Window* source, Window* target);
- float delta_x() const { return delta_x_; }
- float delta_y() const { return delta_y_; }
+ int point_id() const { return properties_.point_id; }
+ float delta_x() const { return properties_.delta_x; }
+ float delta_y() const { return properties_.delta_y; }
+
+ float scale_x() const { return properties_.scale_x; }
+ float scale_y() const { return properties_.scale_y; }
+
+ const Properties& properties() const { return properties_; }
+
private:
- float delta_x_;
- float delta_y_;
+ Properties properties_;
DISALLOW_COPY_AND_ASSIGN(GestureEvent);
};
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698