Chromium Code Reviews| Index: ui/base/touch/multi_touch_device.h |
| =================================================================== |
| --- ui/base/touch/multi_touch_device.h (revision 0) |
| +++ ui/base/touch/multi_touch_device.h (revision 0) |
| @@ -0,0 +1,72 @@ |
| +// 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_MULTI_TOUCH_DEVICE_H_ |
|
tfarina
2012/03/28 16:19:47
add a blank line above.
|
| +#define UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H_ |
| + |
|
tfarina
2012/03/28 16:19:47
add #pragma once
|
| +#include "ui/base/touch/axis.h" |
| + |
| +#include <map> |
| +#include <string> |
| +#include <vector> |
|
tfarina
2012/03/28 16:19:47
remove this unused include
|
| + |
| +namespace ui { |
| + |
| +class MultiTouchDevice { |
| + public: |
| + typedef std::map<Axis::Type, Axis> Axes; |
| + |
| + enum Type { |
| + DIRECT_TOUCH_DEVICE_TYPE, |
| + DEPENDENT_TOUCH_DEVICE_TYPE, |
| + INDEPENDENT_TOUCH_DEVICE_TYPE, |
| + SEMI_MULTI_TOUCH_DEVICE_TYPE, |
| + UNKNOWN_TOUCH_DEVICE_TYPE |
| + }; |
| + |
| + MultiTouchDevice() |
| + : id_(-1), |
|
tfarina
2012/03/28 16:19:47
initialize these members in source file instead.
|
| + name_("Invalid touch device"), |
| + type_(UNKNOWN_TOUCH_DEVICE_TYPE), |
| + max_num_touches_(0), |
| + window_resolution_x_(0.f), |
| + window_resolution_y_(0.f) { |
| + } |
| + |
|
Elliot Glaysher
2012/03/28 17:49:00
Please define a dtor and put the implementation in
|
| + int id() const { return id_; } |
| + void set_id(int id) { id_ = id; } |
| + |
| + const std::string & name() const { return name_; } |
| + void set_name(const std::string& name) { name_ = name; } |
| + |
| + Type type() const { return type_; } |
| + void set_type(Type type) { type_ = type; } |
| + |
| + uint32_t max_num_touches() const { return max_num_touches_; } |
| + void set_max_num_touches(uint32_t num) { max_num_touches_ = num; } |
| + |
| + uint32_t num_axes() const { return axes_.size(); } |
| + |
| + const Axes & axes() const { return axes_; } |
| + void set_axes(const Axes & axes) { axes_ = axes; } |
| + |
| + float window_resolution_x() const { return window_resolution_x_; } |
| + void set_window_resolution_x(float res) { window_resolution_x_ = res; } |
| + |
| + float window_resolution_y() const { return window_resolution_y_; } |
| + void set_window_resolution_y(float res) { window_resolution_y_ = res; } |
| + |
| + private: |
| + int id_; |
| + std::string name_; |
| + Type type_; |
| + uint32_t max_num_touches_; |
| + Axes axes_; |
| + float window_resolution_x_; |
| + float window_resolution_y_; |
| + |
| + // TODO(tvoss): Rework handling of devices to rely on shared ptr's. |
|
tfarina
2012/03/28 16:19:47
What is this TODO for?
|
| + // DISALLOW_COPY_AND_ASSIGN(MultiTouchDevice); |
|
tfarina
2012/03/28 16:19:47
add basictypes.h include for this. Also why is it
|
| +}; |
| +} |
|
tfarina
2012/03/28 16:19:47
add a blank line above.
tfarina
2012/03/28 16:19:47
} // namespace ui
|
| +#endif // UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H_ |
| Property changes on: ui/base/touch/multi_touch_device.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |