frame-mtdev.h   frame-mtdev.h 
skipping to change at line 29 skipping to change at line 29
* *
************************************************************************** **/ ************************************************************************** **/
#ifndef UTOUCH_FRAME_MTDEV_H #ifndef UTOUCH_FRAME_MTDEV_H
#define UTOUCH_FRAME_MTDEV_H #define UTOUCH_FRAME_MTDEV_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup v1
* @{
*
* \defgroup v1-mtdev MTDev
* @{
*/
#define MTDEV_NO_LEGACY_API #define MTDEV_NO_LEGACY_API
#include <utouch/frame.h> #include <utouch/frame.h>
#include <evemu.h> #include <evemu.h>
#include <mtdev.h> #include <mtdev.h>
int utouch_frame_is_supported_mtdev(const struct evemu_device *dev); int utouch_frame_is_supported_mtdev(const struct evemu_device *dev);
int utouch_frame_init_mtdev(utouch_frame_handle fh, int utouch_frame_init_mtdev(utouch_frame_handle fh,
const struct evemu_device *dev); const struct evemu_device *dev);
const struct utouch_frame * const struct utouch_frame *
utouch_frame_pump_mtdev(utouch_frame_handle fh, const struct input_event *e v); utouch_frame_pump_mtdev(utouch_frame_handle fh, const struct input_event *e v);
/**
* @}
*
* @}
*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 14 lines changed or added


 frame.h   frame.h 
skipping to change at line 22 skipping to change at line 22
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
* *
************************************************************************** **/ ************************************************************************** **/
#ifndef UTOUCH_FRAME_H /**
#define UTOUCH_FRAME_H * @file utouch/frame.h
* Definitions of the main and platform-generic API
*/
#ifndef UTOUCH_FRAME_UTOUCH_FRAME_H_
#define UTOUCH_FRAME_UTOUCH_FRAME_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdint.h> #include <stdint.h>
/**
* @defgroup v1 uTouch-Frame 1.x
* @{
* @internal
*/
#define UTOUCH_FRAME_VERSION 0x00001010 #define UTOUCH_FRAME_VERSION 0x00001010
/** /**
* struct utouch_surface - device surface details * struct utouch_surface - device surface details
* @needs_pointer: device needs a screen pointer to function * @needs_pointer: device needs a screen pointer to function
* @is_direct: surface is a direct device (e.g. touchscreen) * @is_direct: surface is a direct device (e.g. touchscreen)
* @is_buttonpad: surface has button(s) under it * @is_buttonpad: surface has button(s) under it
* @is_semi_mt: surface detects bounding rectangle only * @is_semi_mt: surface detects bounding rectangle only
* @use_touch_major: device uses major axis for contact modulation * @use_touch_major: device uses major axis for contact modulation
* @use_touch_minor: device uses minor axis for contact modulation * @use_touch_minor: device uses minor axis for contact modulation
skipping to change at line 303 skipping to change at line 314
* The frame returned is always the next in the cyclic list, and * The frame returned is always the next in the cyclic list, and
* always points back at the previous frame returned by this function. * always points back at the previous frame returned by this function.
* *
* The returned pointer is ABI agnostic and owned by the frame * The returned pointer is ABI agnostic and owned by the frame
* engine. It may very well be zero if there is nothing to report or * engine. It may very well be zero if there is nothing to report or
* if the frame rate is limited. * if the frame rate is limited.
*/ */
const struct utouch_frame *utouch_frame_sync(utouch_frame_handle fh, const struct utouch_frame *utouch_frame_sync(utouch_frame_handle fh,
utouch_frame_time_t time); utouch_frame_time_t time);
/**
* utouch_coordinate_transform_cb - user-definable callback that transforms
a touch point
* @x: pointer to an x coordinate (in, out)
* @y: pointer to a y coordinate (in, out)
* @user_data: opaque pointer, passed by the user when setting the callback
*/
typedef void (*utouch_coordinate_transform_cb)(float *x, float *y, void *us
er_data);
/**
* utouch_frame_set_coordinate_transform_callback - set a callback to obtai
n a transformation
* to apply to every touch point
* @fh: the frame engine in use
* @callback: the callback that transforms x and y
* @user_data: opaque pointer to user data for the callback
*/
void utouch_frame_set_coordinate_transform_callback(utouch_frame_handle fh,
utouch_coordinate_transf
orm_cb callback,
void *user_data);
/** @} */
/**
* @defgroup v2 uTouch-Frame 2.x
* @{
*/
/** An object for the context of the uTouch Frame instance */
typedef struct UFHandle_* UFHandle;
/** An object for an event */
typedef struct UFEvent_* UFEvent;
/** An object for a frame of touches */
typedef struct UFFrame_* UFFrame;
/** An object for a touch */
typedef struct UFTouch_* UFTouch;
/** An object for a device */
typedef struct UFDevice_* UFDevice;
/** An object for a device axis */
typedef struct UFAxis_* UFAxis;
/** An object for a window ID */
typedef uint64_t UFWindowId;
/** An object for a touch ID */
typedef uint64_t UFTouchId;
/** The status code denoting the result of a function call */
typedef enum UFStatus {
UFStatusSuccess = 0, /**< The call was successful */
UFStatusErrorGeneric, /**< A platform-dependent error occurred */
UFStatusErrorResources, /**< An error occurred due to insufficient resour
ces */
UFStatusErrorNoEvent, /**< No events were available to get */
UFStatusErrorUnknownProperty, /**< The requested property value was not s
et */
UFStatusErrorInvalidTouch, /**< The requested touch does not exist */
UFStatusErrorInvalidAxis, /**< The requested axis does not exist */
UFStatusErrorUnsupported, /**< The requested function is not supported by
the
window server */
} UFStatus;
/** Properties of a device */
typedef enum UFDeviceProperty {
/**
* The name of the device
*
* Value type: const char *
*
* The uTouch frame library owns the string. The string is valid until an
* event notifying removal of the device is released.
*/
UFDevicePropertyName = 0,
/**
* Whether the device is a direct touch device
*
* Value type: int with boolean semantics
*
* A direct touch device is a device where there is a direct transformati
on
* from the touch location to the event location on the screen. An indire
ct
* touch device is a device where the touch has meaning relative to a pos
ition
* on the screen, such as the location of a cursor. A touchscreens is an
* example of a direct device, and a trackpad is an example of an indirec
t
* device.
*/
UFDevicePropertyDirect,
/**
* Whether the device is an independent touch device
*
* Value type: int with boolean semantics
*
* An independent device is an indirect device whose cursor moves
* independently of the touches on the device. A mouse with a touch area
for
* gestures is an example of an independent device, and a trackpad is an
* example of a dependent device.
*/
UFDevicePropertyIndependent,
/**
* Whether the device is a semi-multitouch device
*
* Value type: int with boolean semantics
*
* A semi-multitouch device provides a bounding box of some touches on th
e
* touch surface. In contrast, a full-multitouch device provides accurate
* locations of each individual touch.
*/
UFDevicePropertySemiMT,
/**
* The maximum number of touches supported by the device
*
* Value type: unsigned int
*/
UFDevicePropertyMaxTouches,
/**
* The number of touch axes provided by the device
*
* Value type: unsigned int
*/
UFDevicePropertyNumAxes,
} UFDeviceProperty;
/** Device touch axis types */
typedef enum UFAxisType {
UFAxisTypeX = 0, /**< X coordinate */
UFAxisTypeY, /**< Y coordinate */
UFAxisTypeTouchMajor, /**< Width along major axis of contact area of touc
h */
UFAxisTypeTouchMinor, /**< Width along minor axis of contact area of touc
h */
UFAxisTypeWidthMajor, /**< Width along major axis of touch tool */
UFAxisTypeWidthMinor, /**< Width along minor axis of touch tool */
UFAxisTypeOrientation, /**< Orientation of major axis of contact ellipse
*/
UFAxisTypeTool, /**< Tool type */
UFAxisTypeBlobId, /**< Blob ID of group of touches */
UFAxisTypeTrackingId, /**< Tracking ID */
UFAxisTypePressure, /**< Pressure */
UFAxisTypeDistance, /**< Hover distance */
} UFAxisType;
/** Event properties */
typedef enum UFEventProperty {
/**
* Type of event
*
* Value type: UFEventType
*/
UFEventPropertyType = 0,
/**
* Device added or removed
*
* Value type: UFDevice
*
* This property is set only when the event type is UFEventTypeDeviceAdde
d
* or UFEventTypeDeviceRemoved. The object is owned by the library and is
* valid until an event notifying removal of the device is released.
*/
UFEventPropertyDevice,
/**
* Touch frame
*
* Value type: UFFrame
*
* This property is set only when the event type is UFEventTypeFrame. The
* object is owned by the library and is valid until the event is release
d.
*/
UFEventPropertyFrame,
/**
* Event time
*
* Value type: 64-bit unsigned int
*
* This property holds the time the event occurred in display server
* timespace. The time is provided in milliseconds (ms). If the event, su
ch as
* device addition, occurred before the uTouch Frame context was created,
the
* value will be 0.
*/
UFEventPropertyTime,
} UFEventProperty;
/** Event types */
typedef enum UFEventType {
UFEventTypeDeviceAdded = 0, /**< A new device has been added */
UFEventTypeDeviceRemoved, /**< An existing device has been removed */
UFEventTypeFrame, /**< The state of one or more touches has changed */
} UFEventType;
/** Touch frame properties */
typedef enum UFFrameProperty {
/**
* The device for the frame
*
* Value type: UFDevice
*/
UFFramePropertyDevice = 0,
/**
* The window server ID of the window for the frame
*
* Value type: UFWindowId
*/
UFFramePropertyWindowId,
/**
* Number of touches in the frame
*
* Value type: unsigned int
*
* Some devices can track more touches than they can report data for. Onl
y
* touches with X and Y position are provided in the frame.
*/
UFFramePropertyNumTouches,
/**
* Total number of active touches on the device
*
* Value type: unsigned int
*
* Some devices can track more touches than they can report data for. Thi
s
* value includes the number of reported and unreported touches.
*/
UFFramePropertyActiveTouches,
} UFFrameProperty;
/** State of an individual touch */
typedef enum UFTouchState {
UFTouchStateBegin = 0, /**< The touch began */
UFTouchStateUpdate, /**< A value or property of the touch changed */
UFTouchStateEnd, /**< The touch ended */
} UFTouchState;
/** Touch properties */
typedef enum UFTouchProperty {
/**
* Window server ID of the touch
*
* Value type: UFTouchId
*/
UFTouchPropertyId = 0,
/**
* State of the touch
*
* Value type: UFTouchState
*/
UFTouchPropertyState,
/**
* Location along X axis of touch relative to event window
*
* Value type: float
*
* The window server may provide touch location in window coordinate spac
e.
* This property will be set where available.
*/
UFTouchPropertyWindowX,
/**
* Location along Y axis of touch relative to event window
*
* Value type: float
*
* The window server may provide touch location in window coordinate spac
e.
* This property will be set where available.
*/
UFTouchPropertyWindowY,
/**
* Time of last touch state change
*
* Value type: 64-bit unsigned int
*
* See UFEventPropertyTime for the semantics of the value. If the touch h
as
* not changed during this frame, the value of this property will be less
than
* the value of the UFEventPropertyTime event property for this frame.
*/
UFTouchPropertyTime,
/**
* Start time of touch
*
* Value type: 64-bit unsigned int
*
* See UFEventPropertyTime for the semantics of the value.
*/
UFTouchPropertyStartTime,
/**
* Whether the touch is owned by the client
*
* Value type: int with boolean semantics
*
* Some window servers have the concept of touch ownership. This property
* is only valid when the server supports touch ownership.
*/
UFTouchPropertyOwned,
/**
* Whether the touch has physically ended before the touch sequence has e
nded
*
* Value type: int with boolean semantics
*
* Some window servers have the concept of touch ownership. If a touch ha
s
* ended before the client receives ownership, this property will be set
to
* true. The property will also be set to true when the touch has ended b
efore
* the client has accepted or rejected ownership of the touch sequence.
*/
UFTouchPropertyPendingEnd,
} UFTouchProperty;
/**
* Get the event file descriptor for the uTouch Frame context
*
* @param [in] handle The uTouch Frame context object
* @return A file descriptor for the context
*
* When events are available for processing, the file descriptor will be
* readable. Perform an 8-byte read from the file descriptor to clear the s
tate.
* Refer to the EVENTFD(2) man page for more details.
*/
int frame_get_fd(UFHandle handle);
/**
* Get an event from the uTouch Frame context
*
* @param [in] handle The context object
* @param [out] event The retrieved event
* @return UFStatusSuccess or UFStatusErrorNoEvent
*
* The reference count of the returned event is implicity incremented once.
*/
UFStatus frame_get_event(UFHandle handle, UFEvent *event);
/**
* Get the value of a property of a device
*
* @param [in] device The device object (const)
* @param [in] property The property to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess or UFStatusErrorUnknownProperty
*/
UFStatus frame_device_get_property(UFDevice device, UFDeviceProperty proper
ty,
void *value);
/**
* Get a device touch axis by index
*
* @param [in] device The device object (const)
* @param [in] index The index of the axis to get
* @param [out] axis The axis retrieved
* @return UFStatusSuccess or UFStatusErrorInvalidAxis
*
* The index value must be greater than or equal to 0 and less than the num
ber
* axes of the device.
*/
UFStatus frame_device_get_axis_by_index(UFDevice device, unsigned int index
,
UFAxis *axis);
/**
* Get a device touch axis by axis type
*
* @param [in] device The device object (const)
* @param [in] type The axis type
* @param [out] axis The axis retrieved
* @return UFStatusSuccess or UFStatusErrorInvalidAxis
*
* UFStatusErrorInvalidAxis is returned if the device does not have an axis
of
* the type requested.
*/
UFStatus frame_device_get_axis_by_type(UFDevice device, UFAxisType type,
UFAxis *axis);
/**
* Get the type of a touch device axis
*
* @param [in] axis The touch device axis (const)
* @return The type of the axis
*/
UFAxisType frame_axis_get_type(UFAxis axis);
/**
* Get the minimum value of a touch device axis
*
* @param [in] axis The touch device axis (const)
* @return The minimum value of the axis
*/
float frame_axis_get_minimum(UFAxis axis);
/**
* Get the maximum value of a touch device axis
*
* @param [in] axis The touch device axis (const)
* @return The maximum value of the axis
*/
float frame_axis_get_maximum(UFAxis axis);
/**
* Get the resolution of a touch device axis
*
* @param [in] axis The touch device axis (const)
* @return The resolution of the axis
*/
float frame_axis_get_resolution(UFAxis axis);
/**
* Increment the reference count of an event
*
* @param [in] event The event object
*/
void frame_event_ref(UFEvent event);
/**
* Decrement the reference count of an event
*
* @param [in] event The event object
*
* When the reference count reaches zero, the event is freed.
*/
void frame_event_unref(UFEvent event);
/**
* Get the value of a property of an event
*
* @param [in] event The event object (const)
* @param [in] property The property to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess or UFStatusErrorUnknownProperty
*/
UFStatus frame_event_get_property(UFEvent event, UFEventProperty property,
void *value);
/**
* Get the value of a property of a frame
*
* @param [in] frame The frame object (const)
* @param [in] property The property to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess or UFStatusErrorUnknownProperty
*/
UFStatus frame_frame_get_property(UFFrame frame, UFFrameProperty property,
void *value);
/**
* Get a touch of a frame by index
*
* @param [in] frame The frame object (const)
* @param [in] index The index of the touch to get
* @param [out] touch The touch retrieved
* @return UFStatusSuccess or UFStatusErrorInvalidTouch
*
* The index value must be greater than or equal to 0 and less than the num
ber
* touches reported in the frame.
*/
UFStatus frame_frame_get_touch_by_index(UFFrame frame, unsigned int index,
UFTouch *touch);
/**
* Get a touch from a frame by the window server ID
*
* @param [in] frame The frame object (const)
* @param [in] touch_id The window server ID of the touch
* The value type of the touch ID is window server dependent. S
ee
* UFTouchPropertyId for more details.
* @param [out] touch The touch object
* @return UFStatusSuccess or UFStatusErrorInvalidTouch
*/
UFStatus frame_frame_get_touch_by_id(UFFrame frame, UFTouchId touch_id,
UFTouch* touch);
/**
* Get the previous value of a property of a touch
*
* @param [in] frame The current frame object (const)
* @param [in] touch The current touch object (const)
* @param [in] property The property to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess, UFStatusErrorUnknownProperty, or
* UFStatusErrorInvalidTouch
*
* The previous value is the value of the property in the previous frame.
* UFStatusErrorInvalidTouch is returned if the touch did not exist in the
* previous frame.
*/
UFStatus frame_frame_get_previous_touch_property(UFFrame frame, UFTouch tou
ch,
UFTouchProperty property,
void *value);
/**
* Get the previous value of an axis of a touch
*
* @param [in] frame The current frame object (const)
* @param [in] touch The current touch object (const)
* @param [in] type The axis to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess, UFStatusErrorInvalidAxis, or
* UFStatusErrorInvalidTouch
*
* The previous value is the value of the axis in the previous frame.
* UFStatusErrorInvalidTouch is returned if the touch did not exist in the
* previous frame.
*/
UFStatus frame_frame_get_previous_touch_value(UFFrame frame, UFTouch touch,
UFAxisType type, float* value
);
/**
* Get the value of a property of a touch
*
* @param [in] touch The touch object (const)
* @param [in] property The property to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess or UFStatusErrorUnknownProperty
*/
UFStatus frame_touch_get_property(UFTouch touch, UFTouchProperty property,
void *value);
/**
* Get the value of an axis of a touch
*
* @param [in] touch The touch object (const)
* @param [in] type The axis to retrieve a value for
* @param [out] value The value retrieved
* @return UFStatusSuccess or UFStatusErrorInvalidAxis
*/
UFStatus frame_touch_get_value(UFTouch touch, UFAxisType type, float *value
);
/**
* @defgroup v2-helpers Helper Functions
* These helper functions may be used in place of the generic property gett
ers.
* They are limited to properties that are guaranteed to exist in all insta
nces
* of the objects.
* @{
*/
/**
* Get the type of an event
*
* @param [in] event The event object (const)
* @return The type of the event
*/
UFEventType frame_event_get_type(UFEvent event);
/**
* Get the time of an event
*
* @param [in] event The event object (const)
* @return The time of the event
*/
uint64_t frame_event_get_time(UFEvent event);
/**
* Get the number of axes of a device
*
* @param [in] device The device object (const)
* @return The number of axes
*/
unsigned int frame_device_get_num_axes(UFDevice device);
/**
* Get the number of touches in the frame
*
* @param [in] frame The frame object (const)
* @return The number of touches
*/
uint32_t frame_frame_get_num_touches(UFFrame frame);
/**
* Get the device of a frame
*
* @param [in] frame The frame context object (const)
* return The device of the window context
*/
UFDevice frame_frame_get_device(UFFrame frame);
/**
* Get the window ID of a frame
*
* @param [in] frame The frame context object (const)
* @return The window server ID of the window of the frame
*/
UFWindowId frame_frame_get_window_id(UFFrame frame);
/**
* Get the window server ID of a touch
*
* @param [in] touch The touch context object (const)
* @return The window server ID of the touch
*/
UFTouchId frame_touch_get_id(UFTouch touch);
/**
* Get the state of a touch
*
* @param [in] touch The touch object (const)
* @return The state of the touch
*/
UFTouchState frame_touch_get_state(UFTouch touch);
/**
* Get the X window coordinate of a touch
*
* @param [in] touch The touch object (const)
* @return The X window coordinate of the touch
*/
float frame_touch_get_window_x(UFTouch touch);
/**
* Get the Y window coordinate of a touch
*
* @param [in] touch The touch object (const)
* @return The Y window coordinate of the touch
*/
float frame_touch_get_window_y(UFTouch touch);
/**
* Get the X device coordinate of a touch
*
* @param [in] touch The touch object (const)
* @return The X device coordinate of the touch
*/
float frame_touch_get_device_x(UFTouch touch);
/**
* Get the Y device coordinate of a touch
*
* @param [in] touch The touch object (const)
* @return The Y device coordinate of the touch
*/
float frame_touch_get_device_y(UFTouch touch);
/**
* Get the time of a touch state change
*
* @param [in] touch The touch object (const)
* @return The time of the touch state change
*/
uint64_t frame_touch_get_time(UFTouch touch);
/**
* Get the start time of a touch
*
* @param [in] touch The touch object (const)
* @return The start time of the touch
*/
uint64_t frame_touch_get_start_time(UFTouch touch);
/** @} */
/** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif // UTOUCH_FRAME_UTOUCH_FRAME_H_
 End of changes. 4 change blocks. 
2 lines changed or deleted 684 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/