#ifndef INPUTEVENT_H
#define INPUTEVENT_H

#include <libinput.h>

typedef libinput_event_type InputEventType;
typedef libinput_switch SwitchEventType;
typedef libinput_switch_state SwitchEventState;

/*!
 * \brief libinput event
 */
struct SwipeGestureEvent{
    bool        cancelled;
    int         time;
    int         fingerCount;
    double      deltaX;
    double      deltaY;
    double      unacceleratedDeltaX;
    double      unacceleratedDeltaY;
};

struct PinchGestureEvent{
    bool        cancelled;
    int         time;
    int         fingerCount;
    double      deltaX;
    double      deltaY;
    double      unacceleratedDeltaX;
    double      unacceleratedDeltaY;
    double      scale;
    double      angleDelta;
};

struct TapGestureEvent{
    int         time;
    int         fingerCount;
    double      deltaX;
    double      deltaY;
    bool        cancelled;
};

struct SwitchToggleEvent
{
//    SwitchToggleEvent() {}
    libinput_switch switchType;
    libinput_switch_state switchState;
};

/*!
 *  \brief input device
 */
struct Device{
    char        name[256];
};

/*!
 *  \brief EventData
 */
union EventData{
    SwipeGestureEvent       swipeEventData;
    PinchGestureEvent       pinchEventData;
    TapGestureEvent         tapEventData;
    SwitchToggleEvent       switchEventDate;
};

/*!
 * \brief Event
 */
struct Event{
    InputEventType          type;
    Device                  device;
    EventData               event;
};
#endif // INPUTEVENT_H
