include/SDL_events.h
changeset 4694 c24ba2cc9583
parent 4635 0a07d002f10b
parent 4689 f9ab8df6d45a
child 4971 158bb5752974
     1.1 --- a/include/SDL_events.h	Sun Aug 22 11:56:07 2010 -0700
     1.2 +++ b/include/SDL_events.h	Sun Aug 22 12:07:55 2010 -0700
     1.3 @@ -36,6 +36,8 @@
     1.4  #include "SDL_mouse.h"
     1.5  #include "SDL_joystick.h"
     1.6  #include "SDL_quit.h"
     1.7 +#include "SDL_gesture.h"
     1.8 +#include "SDL_touch.h"
     1.9  
    1.10  #include "begin_code.h"
    1.11  /* Set up for C function definitions, even when using C++ */
    1.12 @@ -90,14 +92,28 @@
    1.13      SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
    1.14      SDL_JOYBUTTONUP,            /**< Joystick button released */
    1.15  
    1.16 +    /* Touch events */
    1.17 +    SDL_FINGERDOWN      = 0x700,
    1.18 +    SDL_FINGERUP,
    1.19 +    SDL_FINGERMOTION,
    1.20 +    SDL_TOUCHBUTTONDOWN,
    1.21 +    SDL_TOUCHBUTTONUP,    
    1.22 +
    1.23 +    /* Gesture events */
    1.24 +    SDL_DOLLARGESTURE   = 0x800,
    1.25 +    SDL_DOLLARRECORD,
    1.26 +    SDL_MULTIGESTURE,
    1.27 +
    1.28      /* Clipboard events */
    1.29 -    SDL_CLIPBOARDUPDATE = 0x700, /**< The clipboard changed */
    1.30 +
    1.31 +    SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
    1.32  
    1.33      /* Obsolete events */
    1.34      SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
    1.35      SDL_EVENT_COMPAT2,
    1.36      SDL_EVENT_COMPAT3,
    1.37  
    1.38 +
    1.39      /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
    1.40       *  and should be allocated with SDL_RegisterEvents()
    1.41       */
    1.42 @@ -263,6 +279,79 @@
    1.43      Uint8 padding1;
    1.44  } SDL_JoyButtonEvent;
    1.45  
    1.46 +
    1.47 +/**
    1.48 + *  \brief Touch finger motion/finger event structure (event.tmotion.*)
    1.49 + */
    1.50 +typedef struct SDL_TouchFingerEvent
    1.51 +{
    1.52 +    Uint32 type;        /**< ::SDL_FINGERMOTION OR 
    1.53 +			   SDL_FINGERDOWN OR SDL_FINGERUP*/
    1.54 +    Uint32 windowID;    /**< The window with mouse focus, if any */
    1.55 +    SDL_TouchID touchId;        /**< The touch device id */
    1.56 +    SDL_FingerID fingerId;
    1.57 +    Uint8 state;        /**< The current button state */
    1.58 +    Uint8 padding1;
    1.59 +    Uint8 padding2;
    1.60 +    Uint8 padding3;
    1.61 +    Uint16 x;
    1.62 +    Uint16 y;
    1.63 +    Sint16 dx;
    1.64 +    Sint16 dy;
    1.65 +    Uint16 pressure;
    1.66 +} SDL_TouchFingerEvent;
    1.67 +
    1.68 +
    1.69 +/**
    1.70 + *  \brief Touch finger motion/finger event structure (event.tmotion.*)
    1.71 + */
    1.72 +typedef struct SDL_TouchButtonEvent
    1.73 +{
    1.74 +    Uint32 type;        /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
    1.75 +    Uint32 windowID;    /**< The window with mouse focus, if any */
    1.76 +    SDL_TouchID touchId;        /**< The touch device index */
    1.77 +    Uint8 state;        /**< The current button state */
    1.78 +    Uint8 button;        /**< The button changing state */
    1.79 +    Uint8 padding1;
    1.80 +    Uint8 padding2;
    1.81 +} SDL_TouchButtonEvent;
    1.82 +
    1.83 +
    1.84 +
    1.85 +/**
    1.86 + *  \brief Multiple Finger Gesture Event
    1.87 + */
    1.88 +typedef struct SDL_MultiGestureEvent
    1.89 +{
    1.90 +    Uint32 type;        /**< ::SDL_MULTIGESTURE */
    1.91 +    Uint32 windowID;    /**< The window with mouse focus, if any */
    1.92 +    SDL_TouchID touchId;        /**< The touch device index */
    1.93 +    float dTheta;
    1.94 +    float dDist;
    1.95 +    float x;  //currently 0...1. Change to screen coords?
    1.96 +    float y;  
    1.97 +    Uint16 numFingers;
    1.98 +    Uint16 padding;
    1.99 +} SDL_MultiGestureEvent;
   1.100 +
   1.101 +typedef struct SDL_DollarGestureEvent
   1.102 +{
   1.103 +    Uint32 type;        /**< ::SDL_DOLLARGESTURE */
   1.104 +    Uint32 windowID;    /**< The window with mouse focus, if any */
   1.105 +    SDL_TouchID touchId;        /**< The touch device index */
   1.106 +    SDL_GestureID gestureId;
   1.107 +    Uint32 numFingers;
   1.108 +    float error;
   1.109 +  /*
   1.110 +    //TODO: Enable to give location?
   1.111 +    float x;  //currently 0...1. Change to screen coords?
   1.112 +    float y;  
   1.113 +  */
   1.114 +} SDL_DollarGestureEvent;
   1.115 +
   1.116 +
   1.117 +
   1.118 +
   1.119  /**
   1.120   *  \brief The "quit requested" event
   1.121   */
   1.122 @@ -345,6 +434,10 @@
   1.123      SDL_QuitEvent quit;             /**< Quit request event data */
   1.124      SDL_UserEvent user;             /**< Custom event data */
   1.125      SDL_SysWMEvent syswm;           /**< System dependent window event data */
   1.126 +    SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
   1.127 +    SDL_TouchButtonEvent tbutton;   /**< Touch button event data */
   1.128 +    SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/
   1.129 +    SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/
   1.130  
   1.131      /** Temporarily here for backwards compatibility */
   1.132      /*@{*/