Home | History | Annotate | Download | only in api
      1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  */
      5 
      6 
      7 /**
      8  * This file defines the API to create a touch point or position where fingers
      9  * makes contact with touch screen device.
     10  */
     11 
     12 /**
     13  * The <code>PP_TouchPoint</code> struct represents all information about a
     14  * single touch point, such as position, id, rotation angle, and pressure.
     15  */
     16 [assert_size(28), returnByValue]
     17 struct PP_TouchPoint {
     18   /**
     19    * This value represents the identifier for this TouchPoint. The id
     20    * corresponds to the order in which the points were pressed. For example,
     21    * the first point to be pressed has an id of 0, the second has an id of 1,
     22    * and so on. An id can be reused when a touch point is released.  For
     23    * example, if two fingers are down, with id 0 and 1, and finger 0 releases,
     24    * the next finger to be pressed can be assigned to id 0.
     25    */
     26   uint32_t id;
     27 
     28   /**
     29    * This value represents the x and y pixel position of this TouchPoint
     30    * relative to the upper-left of the module instance receiving the event.
     31    */
     32   PP_FloatPoint position;
     33 
     34   /**
     35    * This value represents the elliptical radii, in screen pixels, in the x
     36    * and y direction of this TouchPoint.
     37    */
     38   PP_FloatPoint radius;
     39 
     40   /**
     41    * This value represents the angle of rotation in degrees of the elliptical
     42    * model of this TouchPoint clockwise from "up."
     43    */
     44   float_t rotation_angle;
     45 
     46   /**
     47    * This value represents the pressure applied to this TouchPoint.  This value
     48    * is typically between 0 and 1, with 0 indicating no pressure and 1
     49    * indicating some maximum pressure. Scaling differs depending on the
     50    * hardware and the value is not guaranteed to stay within that range.
     51    */
     52   float_t pressure;
     53 };
     54 
     55 #inline c
     56 /**
     57  * @addtogroup Functions
     58  * @{
     59  */
     60 
     61 /**
     62  * PP_MakeTouchPoint() creates a <code>PP_TouchPoint</code>.
     63  *
     64  * @return A <code>PP_TouchPoint</code> structure.
     65  */
     66 PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint(void) {
     67   struct PP_TouchPoint result = { 0, {0, 0}, {0, 0}, 0, 0 };
     68   return result;
     69 }
     70 /**
     71  * @}
     72  */
     73 
     74 #endinl
     75