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

Unified Diff: ui/base/touch/axis.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, 9 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
Index: ui/base/touch/axis.h
===================================================================
--- ui/base/touch/axis.h (revision 0)
+++ ui/base/touch/axis.h (revision 0)
@@ -0,0 +1,89 @@
+// Copyright (c) 2012 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 UI_BASE_TOUCH_AXIS_H_
+#define UI_BASE_TOUCH_AXIS_H_
+
+#include "base/property_bag.h"
+
+#include <limits>
+#include <string>
+
+namespace ui {
+
+class Axis {
+ public:
+ enum Type {
+ AXIS_TYPE_X = 0, /**< X coordinate */
+ AXIS_TYPE_Y, /**< Y coordinate */
+ AXIS_TYPE_TOUCH_MAJOR,
+ /**< Width along major axis of contact area of touch */
+ AXIS_TYPE_TOUCH_MINOR,
+ /**< Width along minor axis of contact area of touch */
+ AXIS_TYPE_WIDTH_MAJOR, /**< Width along major axis of touch tool */
+ AXIS_TYPE_WIDTH_MINOR, /**< Width along minor axis of touch tool */
+ AXIS_TYPE_ORIENTATION, /**< Orientation of major axis of contact ellipse */
+ AXIS_TYPE_TOOL, /**< Tool type */
+ AXIS_TYPE_BLOB_ID, /**< Blob ID of group of touches */
+ AXIS_TYPE_TRACKING_ID, /**< Tracking ID */
+ AXIS_TYPE_PRESSURE, /**< Pressure */
+ AXIS_TYPE_HOVER_DISTANCE, /**< Hover distance */
+ AXIS_TYPE_UNKNOWN,
+ AXIS_TYPE_LAST
+ };
+
+ Axis()
+ : id_(-1),
+ type_(AXIS_TYPE_UNKNOWN),
+ name_("Unknown axis"),
+ min_(-std::numeric_limits<float>::max()),
+ max_(std::numeric_limits<float>::max()),
+ resolution_(0.f),
+ value_(0.f),
+ payload_(NULL) {
+ }
+
+ ~Axis() {
+ delete(payload_);
+ }
+
+ int id() const { return id_; }
+ void set_id(int id) { id_ = id; }
+
+ Type type() const { return type_; }
+ void set_type(Type type) { type_ = type; }
+
+ const std::string & name() const { return name_; }
+ void set_name(const std::string& name) { name_ = name; }
+
+ float min() const { return min_; }
+ void set_min(float min) { min_ = min; }
+
+ float max() const { return max_; }
+ void set_max(float max) { max_ = max; }
+
+ float resolution() const { return resolution_; }
+ void set_resolution(float res) { resolution_ = res; }
+
+ float value() const { return value_; }
+ void set_value(float value) { value_ = value; }
+
+ base::PropertyBag * payload() {
+ if (payload_ == NULL)
+ payload_ = new base::PropertyBag();
+
+ return payload_;
+ }
+
+ private:
+ int id_;
+ Type type_;
+ std::string name_;
+ float min_;
+ float max_;
+ float resolution_;
+ float value_;
+ base::PropertyBag* payload_;
+};
+}
+#endif // UI_BASE_TOUCH_AXIS_H_
Property changes on: ui/base/touch/axis.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698