#pragma once
#include "RawMouseEvent.hpp"
/*
This table contains the complete list of event types defined by Pointer Events Recommendation . (* indicates redefinition from DOM Level 2 )
The type attribute contains the local name of the event type.
The bubble attr indicates if the event accomplish the bubbling phase or not (all events accomplish the capture and target phases).
The intfc attr indicates the DOM interface implemented by the event object.
The cancel attr indicates if the default action associated with the event can be canceled.
Attributes mean: type = string id of event type; sync = whether event is synchronous or asynchronous; bubble = whether event can be processed in bubbling phase; intfc = data structure used for event data; cancel = whether event is cancellable
*/
#ifdef __INPUT_RAWPOINTEREVENT_CPP_
#define RAW_POINTER_EVENT_DECL FDX_DLL_EXPORT
#else
#define RAW_POINTER_EVENT_DECL FDX_DLL_IMPORT
#endif
namespace Input
{
class RawPointerEvent :
public RawMouseEvent
{
public:
RAW_POINTER_EVENT_DECL RawPointerEvent();
RAW_POINTER_EVENT_DECL RawPointerEvent(const parameter_strings & parms);
RAW_POINTER_EVENT_DECL virtual ~RawPointerEvent();
DECL_CLASS_COMMON_TYPES(RawPointerEvent);
RAW_POINTER_EVENT_DECL void initialize(const parameter_strings & parms);
///Give comparisons value semantics
RAW_POINTER_EVENT_DECL bool operator==(RawPointerEvent const& cmp) const;
public:
enum PTR_TYPE { undefined=0,
mouse,
pen,
touch,
eye };
/**
(from W3C Pointer Events)
A unique identifier for the pointer causing the event. This identifier must be unique from all other active pointers at the time. A user agent may recycle previously retired values for pointerId from previous active pointers, if necessary.
NOTE
The pointerId selection algorithm is implementation specific. Therefore authors cannot assume values convey any particular meaning other than an identifier for the pointer that is unique from all other active pointers. As an example, values are not guaranteed to be monotonically increasing.
*/
//long pointerID; // GUID of ptr device
// use RawEvent::source instead - it has exactly the same purpose
/**
(from W3C Pointer Events)
The width (magnitude on the X axis), in CSS pixels (see [CSS21]), of the contact geometry of the pointer. This value may be updated on each event for a given
pointer. For devices which have a contact geometry but the actual geometry is not reported by the hardware, a default value should be provided by the user
agent to approximate the geometry typical of that pointer type. Otherwise, the value must be 0.
*/
long width; // width of "point"
/**
(from W3C Pointer Events)
The height (magnitude on the Y axis), in CSS pixels (see [CSS21]), of the contact geometry of the pointer. This value may be updated on each event for a given
pointer. For devices which have a contact geometry but the actual geometry is not reported by the hardware, a default value should be provided by the user
agent to approximate the geometry typical of that pointer type. Otherwise, the value must be 0.
*/
long height; // height of "point"
/**
(from W3C Pointer Events)
The normalized pressure of the pointer input in the range of [0,1], where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting,
respectively. For hardware that does not support pressure, including but not limited to mouse, the value must be 0.5 when in the active buttons state and 0
otherwise.
*/
long pressure; // pressure where point is
/**
(from W3C Pointer Events)
The plane angle (in degrees, in the range of [-90,90]) between the Y-Z plane and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis.
A positive tiltX is to the right. tiltX can be used along with tiltY to represent the tilt away from the normal of a transducer with the digitizer.
For devices that do not report tilt, the value must be 0.
*/
long tiltX; // tilt of stylus
/**
(from W3C Pointer Events)
The plane angle (in degrees, in the range of [-90,90]) between the X-Z plane and the plane containing both the transducer (e.g. pen stylus) axis and the X axis.
A positive tiltY is towards the user. tiltY can be used along with tiltX to represent the tilt away from the normal of a transducer with the digitizer.
For devices that do not report tilt, the value must be 0.
*/
long tiltY; // tilt of stylus
/**
(from W3C Pointer Events)
Indicates the device type that caused the event (mouse, pen, touch, etc.)
*/
PTR_TYPE ptrType;
/**
(from W3C Pointer Event Rec)
Indicates if the pointer represents the primary pointer of this pointer type.
*/
bool isPrimary;
protected:
friend class boost::serialization::access;
template
RAW_POINTER_EVENT_DECL void serialize(Archive &ar, const unsigned int version);
// {
// ar & boost::serialization::base_object(*this);
//// ar & pointerID;
// ar & width;
// ar & height;
// ar & pressure;
// ar & tiltX;
// ar & tiltY;
// ar & ptrType;
// ar & isPrimary;
// }
};
}
BOOST_CLASS_EXPORT_KEY(Input::RawPointerEvent);