include/SDL_events.h
changeset 4694 c24ba2cc9583
parent 4635 0a07d002f10b
parent 4689 f9ab8df6d45a
child 4971 158bb5752974
equal deleted inserted replaced
4638:08d22c54a21f 4694:c24ba2cc9583
    34 #include "SDL_video.h"
    34 #include "SDL_video.h"
    35 #include "SDL_keyboard.h"
    35 #include "SDL_keyboard.h"
    36 #include "SDL_mouse.h"
    36 #include "SDL_mouse.h"
    37 #include "SDL_joystick.h"
    37 #include "SDL_joystick.h"
    38 #include "SDL_quit.h"
    38 #include "SDL_quit.h"
       
    39 #include "SDL_gesture.h"
       
    40 #include "SDL_touch.h"
    39 
    41 
    40 #include "begin_code.h"
    42 #include "begin_code.h"
    41 /* Set up for C function definitions, even when using C++ */
    43 /* Set up for C function definitions, even when using C++ */
    42 #ifdef __cplusplus
    44 #ifdef __cplusplus
    43 /* *INDENT-OFF* */
    45 /* *INDENT-OFF* */
    88     SDL_JOYBALLMOTION,          /**< Joystick trackball motion */
    90     SDL_JOYBALLMOTION,          /**< Joystick trackball motion */
    89     SDL_JOYHATMOTION,           /**< Joystick hat position change */
    91     SDL_JOYHATMOTION,           /**< Joystick hat position change */
    90     SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
    92     SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
    91     SDL_JOYBUTTONUP,            /**< Joystick button released */
    93     SDL_JOYBUTTONUP,            /**< Joystick button released */
    92 
    94 
       
    95     /* Touch events */
       
    96     SDL_FINGERDOWN      = 0x700,
       
    97     SDL_FINGERUP,
       
    98     SDL_FINGERMOTION,
       
    99     SDL_TOUCHBUTTONDOWN,
       
   100     SDL_TOUCHBUTTONUP,    
       
   101 
       
   102     /* Gesture events */
       
   103     SDL_DOLLARGESTURE   = 0x800,
       
   104     SDL_DOLLARRECORD,
       
   105     SDL_MULTIGESTURE,
       
   106 
    93     /* Clipboard events */
   107     /* Clipboard events */
    94     SDL_CLIPBOARDUPDATE = 0x700, /**< The clipboard changed */
   108 
       
   109     SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
    95 
   110 
    96     /* Obsolete events */
   111     /* Obsolete events */
    97     SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
   112     SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
    98     SDL_EVENT_COMPAT2,
   113     SDL_EVENT_COMPAT2,
    99     SDL_EVENT_COMPAT3,
   114     SDL_EVENT_COMPAT3,
       
   115 
   100 
   116 
   101     /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
   117     /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
   102      *  and should be allocated with SDL_RegisterEvents()
   118      *  and should be allocated with SDL_RegisterEvents()
   103      */
   119      */
   104     SDL_USEREVENT    = 0x8000,
   120     SDL_USEREVENT    = 0x8000,
   260     Uint8 which;        /**< The joystick device index */
   276     Uint8 which;        /**< The joystick device index */
   261     Uint8 button;       /**< The joystick button index */
   277     Uint8 button;       /**< The joystick button index */
   262     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   278     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   263     Uint8 padding1;
   279     Uint8 padding1;
   264 } SDL_JoyButtonEvent;
   280 } SDL_JoyButtonEvent;
       
   281 
       
   282 
       
   283 /**
       
   284  *  \brief Touch finger motion/finger event structure (event.tmotion.*)
       
   285  */
       
   286 typedef struct SDL_TouchFingerEvent
       
   287 {
       
   288     Uint32 type;        /**< ::SDL_FINGERMOTION OR 
       
   289 			   SDL_FINGERDOWN OR SDL_FINGERUP*/
       
   290     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   291     SDL_TouchID touchId;        /**< The touch device id */
       
   292     SDL_FingerID fingerId;
       
   293     Uint8 state;        /**< The current button state */
       
   294     Uint8 padding1;
       
   295     Uint8 padding2;
       
   296     Uint8 padding3;
       
   297     Uint16 x;
       
   298     Uint16 y;
       
   299     Sint16 dx;
       
   300     Sint16 dy;
       
   301     Uint16 pressure;
       
   302 } SDL_TouchFingerEvent;
       
   303 
       
   304 
       
   305 /**
       
   306  *  \brief Touch finger motion/finger event structure (event.tmotion.*)
       
   307  */
       
   308 typedef struct SDL_TouchButtonEvent
       
   309 {
       
   310     Uint32 type;        /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
       
   311     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   312     SDL_TouchID touchId;        /**< The touch device index */
       
   313     Uint8 state;        /**< The current button state */
       
   314     Uint8 button;        /**< The button changing state */
       
   315     Uint8 padding1;
       
   316     Uint8 padding2;
       
   317 } SDL_TouchButtonEvent;
       
   318 
       
   319 
       
   320 
       
   321 /**
       
   322  *  \brief Multiple Finger Gesture Event
       
   323  */
       
   324 typedef struct SDL_MultiGestureEvent
       
   325 {
       
   326     Uint32 type;        /**< ::SDL_MULTIGESTURE */
       
   327     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   328     SDL_TouchID touchId;        /**< The touch device index */
       
   329     float dTheta;
       
   330     float dDist;
       
   331     float x;  //currently 0...1. Change to screen coords?
       
   332     float y;  
       
   333     Uint16 numFingers;
       
   334     Uint16 padding;
       
   335 } SDL_MultiGestureEvent;
       
   336 
       
   337 typedef struct SDL_DollarGestureEvent
       
   338 {
       
   339     Uint32 type;        /**< ::SDL_DOLLARGESTURE */
       
   340     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   341     SDL_TouchID touchId;        /**< The touch device index */
       
   342     SDL_GestureID gestureId;
       
   343     Uint32 numFingers;
       
   344     float error;
       
   345   /*
       
   346     //TODO: Enable to give location?
       
   347     float x;  //currently 0...1. Change to screen coords?
       
   348     float y;  
       
   349   */
       
   350 } SDL_DollarGestureEvent;
       
   351 
       
   352 
       
   353 
   265 
   354 
   266 /**
   355 /**
   267  *  \brief The "quit requested" event
   356  *  \brief The "quit requested" event
   268  */
   357  */
   269 typedef struct SDL_QuitEvent
   358 typedef struct SDL_QuitEvent
   343     SDL_JoyHatEvent jhat;           /**< Joystick hat event data */
   432     SDL_JoyHatEvent jhat;           /**< Joystick hat event data */
   344     SDL_JoyButtonEvent jbutton;     /**< Joystick button event data */
   433     SDL_JoyButtonEvent jbutton;     /**< Joystick button event data */
   345     SDL_QuitEvent quit;             /**< Quit request event data */
   434     SDL_QuitEvent quit;             /**< Quit request event data */
   346     SDL_UserEvent user;             /**< Custom event data */
   435     SDL_UserEvent user;             /**< Custom event data */
   347     SDL_SysWMEvent syswm;           /**< System dependent window event data */
   436     SDL_SysWMEvent syswm;           /**< System dependent window event data */
       
   437     SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
       
   438     SDL_TouchButtonEvent tbutton;   /**< Touch button event data */
       
   439     SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/
       
   440     SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/
   348 
   441 
   349     /** Temporarily here for backwards compatibility */
   442     /** Temporarily here for backwards compatibility */
   350     /*@{*/
   443     /*@{*/
   351 #ifndef SDL_NO_COMPAT
   444 #ifndef SDL_NO_COMPAT
   352     SDL_ActiveEvent active;
   445     SDL_ActiveEvent active;