#ifndef MouseEreignis_H
#define MouseEreignis_H

#include <functional>

#include "Vec3.h"

namespace Framework
{
    const int M_Left = 0;
    const int M_Middle = 1;
    const int M_Right = 2;
    const int ME_PLeft = 0;
    const int ME_PRight = 1;
    const int ME_PMiddle = 2;
    const int ME_RLeft = 3;
    const int ME_RRight = 4;
    const int ME_RMiddle = 5;
    const int ME_DCLeft = 6;
    const int ME_DCRight = 7;
    const int ME_DCMiddle = 8;
    const int ME_Enter = 9;
    const int ME_Leaves = 10;
    const int ME_Move = 11;
    const int ME_UScroll = 12;
    const int ME_DScroll = 13;
    const int ME_RScroll = 14;
    const int ME_LScroll = 15;

    //! Stores a specific mouse input from the user
    struct MouseEvent
    {
        //! Type of input
        int id;
        //! X coordinate on screen relative to the drawing position
        int mx;
        //! Y coordinate on screen relative to the drawing position
        int my;
        //! Stores whether the input has already been processed
        bool processed;
        //! Stores whether the mouse event is inside the object
        //! that contains this object
        bool insideParent;
        //! original X coordinate
        int originalX;
        //! original Y coordinate
        int originalY;
    };

    //! Stores a specific mouse input from the user in 3D
    struct MouseEvent3D
    {
        //! Type of input
        int id;
        //! The position of the mouse in the world
        Vec3<float> pos;
        //! The direction the camera is pointing
        Vec3<float> dir;
        //! Stores whether the input has already been processed
        bool processed;
    };

    typedef std::function<bool(void*, void*, MouseEvent)> MouseAction;

    //! Default mouse event callback function
    //! \param param An arbitrary parameter
    //! \param obj The drawing that calls this function
    //! \param te The mouse event to process
    //! \return (true) if the calling drawing should continue processing
    //! the event. (false) otherwise. Always returns (true)
    DLLEXPORT bool _ret1ME(void* param, void* obj, MouseEvent me);
    //! Default mouse event callback function
    //! \param param An arbitrary parameter
    //! \param obj The drawing that calls this function
    //! \param te The mouse event to process
    //! \return (true) if the calling drawing should continue processing
    //! the event. (false) otherwise. Always returns (true) and closes the
    //! window that called it (may only be set on windows)
    DLLEXPORT bool _closeWindowME(void* param, void* obj, MouseEvent me);
} // namespace Framework

#endif