(CHAR_TO_CHARC): New inline function.
[chise/xemacs-chise.git-] / src / events.h
index 3174fe8..7088301 100644 (file)
@@ -329,6 +329,7 @@ struct event_stream
   void (*select_process_cb)    (Lisp_Process *);
   void (*unselect_process_cb)  (Lisp_Process *);
   void (*quit_p_cb)            (void);
   void (*select_process_cb)    (Lisp_Process *);
   void (*unselect_process_cb)  (Lisp_Process *);
   void (*quit_p_cb)            (void);
+  void (*force_event_pending)  (struct frame* f);
   USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ ,
                                 Lisp_Object* /* instream */,
                                 Lisp_Object* /* outstream */,
   USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ ,
                                 Lisp_Object* /* instream */,
                                 Lisp_Object* /* outstream */,
@@ -366,20 +367,20 @@ typedef enum emacs_event_type
 struct key_data
 {
   Lisp_Object       keysym;
 struct key_data
 {
   Lisp_Object       keysym;
-  unsigned char     modifiers;
+  int              modifiers;
 };
 
 struct button_data
 {
   int               button;
 };
 
 struct button_data
 {
   int               button;
-  unsigned char     modifiers;
+  int              modifiers;
   int               x, y;
 };
 
 struct motion_data
 {
   int               x, y;
   int               x, y;
 };
 
 struct motion_data
 {
   int               x, y;
-  unsigned char     modifiers;
+  int              modifiers;
 };
 
 struct process_data
 };
 
 struct process_data
@@ -406,7 +407,7 @@ struct misc_user_data
   Lisp_Object       function;
   Lisp_Object      object;
   int               button;
   Lisp_Object       function;
   Lisp_Object      object;
   int               button;
-  unsigned char     modifiers;
+  int              modifiers;
   int               x, y;
 };
 
   int               x, y;
 };
 
@@ -532,9 +533,9 @@ extern Lisp_Object QKbackspace, QKdelete, QKescape, QKlinefeed, QKreturn;
 extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property;
 extern Lisp_Object Qcancel_mode_internal;
 
 extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property;
 extern Lisp_Object Qcancel_mode_internal;
 
-/* Note: under X Windows, MOD_ALT is generated by the Alt key if there are
+/* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key if there are
    both Alt and Meta keys.  If there are no Meta keys, then Alt generates
    both Alt and Meta keys.  If there are no Meta keys, then Alt generates
-   MOD_META instead.
+   XEMACS_MOD_META instead.
  */
 
 #ifdef emacs
  */
 
 #ifdef emacs
@@ -661,4 +662,60 @@ USID event_stream_unixoid_delete_stream_pair (Lisp_Object instream,
 
 #endif /* emacs */
 
 
 #endif /* emacs */
 
+/* #### a hack, until accelerator shit is cleaned up */
+
+/* This structure is what we use to encapsulate the state of a command sequence
+   being composed; key events are executed by adding themselves to the command
+   builder; if the command builder is then complete (does not still represent
+   a prefix key sequence) it executes the corresponding command.
+ */
+struct command_builder
+{
+  struct lcrecord_header header;
+  Lisp_Object console; /* back pointer to the console this command
+                         builder is for */
+  /* Qnil, or a Lisp_Event representing the first event read
+   *  after the last command completed.  Threaded. */
+  /* #### NYI */
+  Lisp_Object prefix_events;
+  /* Qnil, or a Lisp_Event representing event in the current
+   *  keymap-lookup sequence.  Subsequent events are threaded via
+   *  the event's next slot */
+  Lisp_Object current_events;
+  /* Last elt of above  */
+  Lisp_Object most_current_event;
+  /* Last elt before function map code took over. What this means is:
+     All prefixes up to (but not including) this event have non-nil
+     bindings, but the prefix including this event has a nil binding.
+     Any events in the chain after this one were read solely because
+     we're part of a possible function key.  If we end up with
+     something that's not part of a possible function key, we have to
+     unread all of those events. */
+  Lisp_Object last_non_munged_event;
+  /* One set of values for function-key-map, one for key-translation-map */
+  struct munging_key_translation
+  {
+    /* First event that can begin a possible function key sequence
+       (to be translated according to function-key-map).  Normally
+       this is the first event in the chain.  However, once we've
+       translated a sequence through function-key-map, this will point
+       to the first event after the translated sequence: we don't ever
+       want to translate any events twice through function-key-map, or
+       things could get really screwed up (e.g. if the user created a
+       translation loop).  If this is nil, then the next-read event is
+       the first that can begin a function key sequence. */
+    Lisp_Object first_mungeable_event;
+  } munge_me[2];
+
+  Bufbyte *echo_buf;
+  Bytecount echo_buf_length;          /* size of echo_buf */
+  Bytecount echo_buf_index;           /* index into echo_buf
+                                      * -1 before doing echoing for new cmd */
+  /* Self-insert-command is magic in that it doesn't always push an undo-
+     boundary: up to 20 consecutive self-inserts can happen before an undo-
+     boundary is pushed.  This variable is that counter.
+     */
+  int self_insert_countdown;
+};
+
 #endif /* INCLUDED_events_h_ */
 #endif /* INCLUDED_events_h_ */