#include "Utilities\commondefs.hpp" #define __INPUT_RAWPOINTEREVENT_CPP_ #include "RawPointerEvent.hpp" using namespace Input; RAW_POINTER_EVENT_DECL RawPointerEvent::RawPointerEvent(): width(0), height(0), pressure(0), tiltX(0), tiltY(0), ptrType(RawPointerEvent::undefined), isPrimary(false) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD<< " called"; parameter_strings parms; initialize(parms); // pick up the defaults } RAW_POINTER_EVENT_DECL RawPointerEvent::RawPointerEvent(const parameter_strings & parms): RawMouseEvent(parms) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " parameter_strings called"; initialize(parms); } RAW_POINTER_EVENT_DECL void RawPointerEvent::initialize(const parameter_strings & parms) { width = SET_PARM_OR_DFLT( parms, "width", long, 0) ; height = SET_PARM_OR_DFLT( parms, "height", long, 0) ; pressure = SET_PARM_OR_DFLT( parms, "pressure",short,0) ; tiltX = SET_PARM_OR_DFLT( parms, "tiltX", long, 0) ; tiltY = SET_PARM_OR_DFLT( parms, "tiltY", long, 0) ; ptrType = SET_ENUM_PARM_OR_DFLT(parms, "ptrType", RawPointerEvent::PTR_TYPE, RawPointerEvent::undefined) ; isPrimary = SET_PARM_OR_DFLT( parms, "isPrimary", bool, false) ; } RAW_POINTER_EVENT_DECL bool RawPointerEvent::operator==(RawPointerEvent const& cmp) const { // does a fast compare if possible, then does value compares if that doesn't work return (this == &cmp) || ( RawMouseEvent::operator==(cmp) // && (pointerID == cmp.pointerID) && (width == cmp.width) && (height == cmp.height) && (pressure == cmp.pressure) && (tiltX == cmp.tiltX) && (tiltY == cmp.tiltY) && (ptrType == cmp.ptrType) && (isPrimary == cmp.isPrimary) ); } RAW_POINTER_EVENT_DECL RawPointerEvent::~RawPointerEvent() { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " called"; } template RAW_POINTER_EVENT_DECL void RawPointerEvent::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; } #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4244) #endif #include #include #include #include BOOST_CLASS_EXPORT_IMPLEMENT(Input::RawPointerEvent); BOOST_CLASS_IMPLEMENTATION(Input::RawPointerEvent,boost::serialization::object_serializable); BOOST_CLASS_TRACKING(Input::RawPointerEvent,boost::serialization::track_never); // without the explicit instantiations below, the program will // fail to link for lack of instantiantiation of the above function // note: the following failed to fix link errors for vc 7.0 ! template RAW_POINTER_EVENT_DECL void RawPointerEvent::serialize( boost::archive::text_iarchive & ar, const unsigned int file_version ); template RAW_POINTER_EVENT_DECL void RawPointerEvent::serialize( boost::archive::text_oarchive & ar, const unsigned int file_version ); template RAW_POINTER_EVENT_DECL void RawPointerEvent::serialize( boost::archive::binary_iarchive & ar, const unsigned int file_version ); template RAW_POINTER_EVENT_DECL void RawPointerEvent::serialize( boost::archive::binary_oarchive & ar, const unsigned int file_version ); #ifdef BOOST_MSVC # pragma warning(pop) #endif