diff include/SDL_events.h @ 3132:88861448961f gsoc2009_IME

Add SDL_TEXTEDTING event to inform application about marked text.
author Jiang Jiang <gzjjgod@gmail.com>
date Wed, 01 Jul 2009 07:33:58 +0000
parents 9da8f57ab92c
children
line wrap: on
line diff
--- a/include/SDL_events.h	Wed Jul 01 05:52:17 2009 +0000
+++ b/include/SDL_events.h	Wed Jul 01 07:33:58 2009 +0000
@@ -74,9 +74,10 @@
     SDL_SYSWMEVENT,             /**< System specific event */
     SDL_PROXIMITYIN,            /**< Proximity In event */
     SDL_PROXIMITYOUT,           /**< Proximity Out event */
-    SDL_EVENT_RESERVED1,        /**< Reserved for future use... */
+    SDL_EVENT_RESERVED1,
     SDL_EVENT_RESERVED2,
     SDL_EVENT_RESERVED3,
+    SDL_TEXTEDITING,            /**< Reserved for future use... */
     /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
     SDL_USEREVENT = 24,
     /* This last event is only for bounding internal arrays
@@ -116,7 +117,8 @@
     SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
     SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT),
     SDL_PROXIMITYINMASK = SDL_EVENTMASK(SDL_PROXIMITYIN),
-    SDL_PROXIMITYOUTMASK = SDL_EVENTMASK(SDL_PROXIMITYOUT)
+    SDL_PROXIMITYOUTMASK = SDL_EVENTMASK(SDL_PROXIMITYOUT),
+    SDL_TEXTEDITINGMASK = SDL_EVENTMASK(SDL_TEXTEDITING)
 } SDL_EventMask;
 #define SDL_ALLEVENTS		0xFFFFFFFF
 
@@ -163,6 +165,20 @@
 } SDL_TextInputEvent;
 
 /**
+ * \struct SDL_TextEditingEvent
+ *
+ * \brief Keyboard text editing event structure (event.edit.*)
+ */
+#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
+typedef struct SDL_TextEditingEvent
+{
+    Uint8 type;                                 /**< SDL_TEXTEDITING */
+    char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
+    int start;                                  /**< The start cursor of selected editing text */
+    int length;                                 /**< The length of selected editing text */
+} SDL_TextEditingEvent;
+
+/**
  * \struct SDL_MouseMotionEvent
  *
  * \brief Mouse motion event structure (event.motion.*)
@@ -358,6 +374,7 @@
     SDL_UserEvent user;             /**< Custom event data */
     SDL_SysWMEvent syswm;           /**< System dependent window event data */
     SDL_ProximityEvent proximity;   /**< Proximity In or Out event */
+    SDL_TextEditingEvent edit;      /**< Text editing event data */
 
     /* Temporarily here for backwards compatibility */
     SDL_ActiveEvent active;