ChromiumTouch

Attachment 'multi_touch_device.h'

Download

   1 #ifndef UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H
   2 #define UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H
   3 
   4 #include "ui/base/touch/axis.h"
   5 
   6 #include <iostream>
   7 #include <map>
   8 #include <string>
   9 #include <vector>
  10 
  11 namespace ui {
  12 
  13 class MultiTouchDevice {
  14  public:
  15 
  16   typedef std::map<Axis::Type,Axis> Axes;
  17   
  18   enum Type {
  19     DIRECT_TOUCH_DEVICE_TYPE,
  20     DEPENDENT_TOUCH_DEVICE_TYPE,
  21     INDEPENDENT_TOUCH_DEVICE_TYPE,
  22     SEMI_MULTI_TOUCH_DEVICE_TYPE,
  23     UNKNOWN_TOUCH_DEVICE_TYPE
  24   };
  25 
  26   MultiTouchDevice()
  27       : id_(-1),
  28         name_("Invalid touch device"),
  29         type_(UNKNOWN_TOUCH_DEVICE_TYPE),
  30         max_num_touches_(0),
  31         window_resolution_x_(0.f),
  32         window_resolution_y_(0.f) {
  33   }
  34 
  35   int id() const { return id_; }
  36   void set_id(int id) { id_ = id; }
  37   
  38   const std::string & name() const { return name_; }
  39   void set_name(const std::string& name) { name_ = name; }
  40   
  41   Type type() const { return type_; }
  42   void set_type(Type type) { type_ = type; }
  43   
  44   uint32_t max_num_touches() const { return max_num_touches_; }
  45   void set_max_num_touches(uint32_t num) { max_num_touches_ = num; }
  46   
  47   uint32_t num_axes() const { return axes_.size(); }
  48 
  49   const Axes & axes() const { return axes_; }
  50   void set_axes(const Axes & axes) { axes_ = axes; }
  51   
  52   float window_resolution_x() const { return window_resolution_x_; }
  53   void set_window_resolution_x(float res) { window_resolution_x_ = res; }
  54 
  55   float window_resolution_y() const { return window_resolution_y_; }
  56   void set_window_resolution_y(float res) { window_resolution_y_ = res; }
  57 
  58  private:
  59   int id_;
  60   std::string name_;
  61   Type type_;
  62   uint32_t max_num_touches_;
  63   Axes axes_;
  64   float window_resolution_x_;
  65   float window_resolution_y_;
  66 
  67   // DISALLOW_COPY_AND_ASSIGN(MultiTouchDevice);
  68 };
  69 
  70 std::ostream & operator<<(std::ostream & out, const MultiTouchDevice& device);
  71 
  72 }
  73 
  74 #endif // UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H
  75 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2012-02-03 06:39:50, 116.0 KB) [[attachment:ChromiumTouchArchitecture.png]]
  • [get | view] (2012-02-03 08:24:50, 41.3 KB) [[attachment:ChromiumTouchGestureCentricView.png]]
  • [get | view] (2012-02-07 09:57:43, 2.2 KB) [[attachment:axis.h]]
  • [get | view] (2012-02-07 09:57:33, 1.8 KB) [[attachment:multi_touch_device.h]]
  • [get | view] (2012-02-07 09:58:03, 4.3 KB) [[attachment:multi_touch_device_x11.cc]]
  • [get | view] (2012-02-07 09:57:54, 0.4 KB) [[attachment:multi_touch_device_x11.h]]
  • [get | view] (2012-02-03 06:40:18, 1301.0 KB) [[attachment:video2.mkv]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.