#include "Utilities\commondefs.hpp" #define __INPUT_RAWMOUSEEVENT_CPP_ #include "RawMouseEvent.hpp" using namespace Input; RAW_MOUSE_EVENT_DECL RawMouseEvent::RawMouseEvent() :screenX(0) ,screenY(0) ,button(0) ,buttons(0) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " called"; parameter_strings parms; initialize(parms); // pick up the defaults } RAW_MOUSE_EVENT_DECL RawMouseEvent::RawMouseEvent(const parameter_strings & parms): RawCSAMEvent(parms) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " parameter_strings called"; initialize(parms); } RAW_MOUSE_EVENT_DECL void RawMouseEvent::initialize(const parameter_strings & parms) { screenX = SET_PARM_OR_DFLT(parms, "screenX", long, 0) ; screenY = SET_PARM_OR_DFLT(parms, "screenY", long, 0) ; button = SET_PARM_OR_DFLT(parms, "button", short,0) ; buttons = SET_PARM_OR_DFLT(parms, "buttons", short,0) ; } RAW_MOUSE_EVENT_DECL bool RawMouseEvent::operator==(RawMouseEvent const& cmp) const { // does a fast compare if possible, then does value compares if that doesn't work return (this == &cmp) || ( RawCSAMEvent::operator==(cmp) && (screenX == cmp.screenX) && (screenY == cmp.screenY) && (button == cmp.button) && (buttons == cmp.buttons) ); } RAW_MOUSE_EVENT_DECL RawMouseEvent::~RawMouseEvent() { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " called"; } template RAW_MOUSE_EVENT_DECL void RawMouseEvent::serialize(Archive &ar, const unsigned int version) { ar & boost::serialization::base_object(*this); ar & screenX; ar & screenY; ar & button; ar & buttons; } #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4244) #endif #include #include #include #include BOOST_CLASS_EXPORT_IMPLEMENT(Input::RawMouseEvent); BOOST_CLASS_IMPLEMENTATION(Input::RawMouseEvent,boost::serialization::object_serializable); BOOST_CLASS_TRACKING(Input::RawMouseEvent,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_MOUSE_EVENT_DECL void RawMouseEvent::serialize( boost::archive::text_iarchive & ar, const unsigned int file_version ); template RAW_MOUSE_EVENT_DECL void RawMouseEvent::serialize( boost::archive::text_oarchive & ar, const unsigned int file_version ); template RAW_MOUSE_EVENT_DECL void RawMouseEvent::serialize( boost::archive::binary_iarchive & ar, const unsigned int file_version ); template RAW_MOUSE_EVENT_DECL void RawMouseEvent::serialize( boost::archive::binary_oarchive & ar, const unsigned int file_version ); #ifdef BOOST_MSVC # pragma warning(pop) #endif