comparison src/events.h @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
128 XEmacs has its own event structures, which are distinct from the event 128 XEmacs has its own event structures, which are distinct from the event
129 structures used by X or any other window system. It is the job of the 129 structures used by X or any other window system. It is the job of the
130 event_stream layer to translate to this format. 130 event_stream layer to translate to this format.
131 131
132 NOTE: #### All timestamps should be measured as milliseconds since XEmacs 132 NOTE: #### All timestamps should be measured as milliseconds since XEmacs
133 started. Currently many or most events have a 0 as their 133 started. Currently they are raw server timestamps. (The X protocol
134 timestamp value, and for other timestamps, they are raw server 134 doesn't provide any easy way of translating between server time and
135 timestamps. (The X protocol doesn't provide any easy way of 135 real process time; yuck.)
136 translating between server time and real process time; yuck.)
137 136
138 Every event type has the following structures: 137 Every event type has the following structures:
139 138
140 channel Where this event occurred on. This will be 139 channel Where this event occurred on. This will be
141 a frame, device, console, or nil, depending on the 140 a frame, device, console, or nil, depending on the
174 key_press_event 173 key_press_event
175 key What keysym this is; an integer or a symbol. 174 key What keysym this is; an integer or a symbol.
176 If this is an integer, it will be in the printing 175 If this is an integer, it will be in the printing
177 ASCII range: >32 and <127. 176 ASCII range: >32 and <127.
178 modifiers Bucky-bits on that key: control, meta, etc. 177 modifiers Bucky-bits on that key: control, meta, etc.
178 Also includes buttons.
179 For many keys, Shift is not a bit; that is implicit 179 For many keys, Shift is not a bit; that is implicit
180 in the keyboard layout. 180 in the keyboard layout.
181 181
182 button_press_event 182 button_press_event
183 button_release_event 183 button_release_event
184 button What button went down or up. 184 button What button went down or up.
185 modifiers Bucky-bits on that button: shift, control, meta, etc. 185 modifiers Bucky-bits on that button: shift, control, meta, etc.
186 Also includes other buttons (not the one pressed).
186 x, y Where it was at the button-state-change (in pixels). 187 x, y Where it was at the button-state-change (in pixels).
187 188
188 pointer_motion_event 189 pointer_motion_event
189 x, y Where it was after it moved (in pixels). 190 x, y Where it was after it moved (in pixels).
190 modifiers Bucky-bits down when the motion was detected. 191 modifiers Bucky-bits down when the motion was detected.
191 (Possibly not all window systems will provide this?)
192 192
193 process_event 193 process_event
194 process the XEmacs "process" object in question 194 process the XEmacs "process" object in question
195 195
196 timeout_event 196 timeout_event
327 void (*select_console_cb) (struct console *); 327 void (*select_console_cb) (struct console *);
328 void (*unselect_console_cb) (struct console *); 328 void (*unselect_console_cb) (struct console *);
329 void (*select_process_cb) (Lisp_Process *); 329 void (*select_process_cb) (Lisp_Process *);
330 void (*unselect_process_cb) (Lisp_Process *); 330 void (*unselect_process_cb) (Lisp_Process *);
331 void (*quit_p_cb) (void); 331 void (*quit_p_cb) (void);
332 void (*force_event_pending) (struct frame* f);
332 USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ , 333 USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ ,
333 Lisp_Object* /* instream */, 334 Lisp_Object* /* instream */,
334 Lisp_Object* /* outstream */, 335 Lisp_Object* /* outstream */,
335 int /* flags */); 336 int /* flags */);
336 USID (*delete_stream_pair_cb) (Lisp_Object /* instream */, 337 USID (*delete_stream_pair_cb) (Lisp_Object /* instream */,
337 Lisp_Object /* outstream */); 338 Lisp_Object /* outstream */);
339 int (*current_event_timestamp_cb) (struct console *);
338 }; 340 };
339 341
340 /* Flags for create_stream_pair_cb() FLAGS parameter */ 342 /* Flags for create_stream_pair_cb() FLAGS parameter */
341 #define STREAM_PTY_FLUSHING 0x0001 343 #define STREAM_PTY_FLUSHING 0x0001
342 #define STREAM_NETWORK_CONNECTION 0x0002 344 #define STREAM_NETWORK_CONNECTION 0x0002
364 366
365 367
366 struct key_data 368 struct key_data
367 { 369 {
368 Lisp_Object keysym; 370 Lisp_Object keysym;
369 unsigned char modifiers; 371 int modifiers;
370 }; 372 };
371 373
372 struct button_data 374 struct button_data
373 { 375 {
374 int button; 376 int button;
375 unsigned char modifiers; 377 int modifiers;
376 int x, y; 378 int x, y;
377 }; 379 };
378 380
379 struct motion_data 381 struct motion_data
380 { 382 {
381 int x, y; 383 int x, y;
382 unsigned char modifiers; 384 int modifiers;
383 }; 385 };
384 386
385 struct process_data 387 struct process_data
386 { 388 {
387 Lisp_Object process; 389 Lisp_Object process;
404 struct misc_user_data 406 struct misc_user_data
405 { 407 {
406 Lisp_Object function; 408 Lisp_Object function;
407 Lisp_Object object; 409 Lisp_Object object;
408 int button; 410 int button;
409 unsigned char modifiers; 411 int modifiers;
410 int x, y; 412 int x, y;
411 }; 413 };
412 414
413 struct magic_eval_data 415 struct magic_eval_data
414 { 416 {
530 532
531 extern Lisp_Object QKbackspace, QKdelete, QKescape, QKlinefeed, QKreturn; 533 extern Lisp_Object QKbackspace, QKdelete, QKescape, QKlinefeed, QKreturn;
532 extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property; 534 extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property;
533 extern Lisp_Object Qcancel_mode_internal; 535 extern Lisp_Object Qcancel_mode_internal;
534 536
535 /* Note: under X Windows, MOD_ALT is generated by the Alt key if there are 537 /* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key if there are
536 both Alt and Meta keys. If there are no Meta keys, then Alt generates 538 both Alt and Meta keys. If there are no Meta keys, then Alt generates
537 MOD_META instead. 539 XEMACS_MOD_META instead.
538 */ 540 */
539 541
540 #ifdef emacs 542 #ifdef emacs
541 /* Maybe this should be trickier */ 543 /* Maybe this should be trickier */
542 #define KEYSYM(x) (intern (x)) 544 #define KEYSYM(x) (intern (x))
659 first console is tty, even if HAVE_X_WINDOWS is defined */ 661 first console is tty, even if HAVE_X_WINDOWS is defined */
660 /* #define DEBUG_TTY_EVENT_STREAM */ 662 /* #define DEBUG_TTY_EVENT_STREAM */
661 663
662 #endif /* emacs */ 664 #endif /* emacs */
663 665
666 /* #### a hack, until accelerator shit is cleaned up */
667
668 /* This structure is what we use to encapsulate the state of a command sequence
669 being composed; key events are executed by adding themselves to the command
670 builder; if the command builder is then complete (does not still represent
671 a prefix key sequence) it executes the corresponding command.
672 */
673 struct command_builder
674 {
675 struct lcrecord_header header;
676 Lisp_Object console; /* back pointer to the console this command
677 builder is for */
678 /* Qnil, or a Lisp_Event representing the first event read
679 * after the last command completed. Threaded. */
680 /* #### NYI */
681 Lisp_Object prefix_events;
682 /* Qnil, or a Lisp_Event representing event in the current
683 * keymap-lookup sequence. Subsequent events are threaded via
684 * the event's next slot */
685 Lisp_Object current_events;
686 /* Last elt of above */
687 Lisp_Object most_current_event;
688 /* Last elt before function map code took over. What this means is:
689 All prefixes up to (but not including) this event have non-nil
690 bindings, but the prefix including this event has a nil binding.
691 Any events in the chain after this one were read solely because
692 we're part of a possible function key. If we end up with
693 something that's not part of a possible function key, we have to
694 unread all of those events. */
695 Lisp_Object last_non_munged_event;
696 /* One set of values for function-key-map, one for key-translation-map */
697 struct munging_key_translation
698 {
699 /* First event that can begin a possible function key sequence
700 (to be translated according to function-key-map). Normally
701 this is the first event in the chain. However, once we've
702 translated a sequence through function-key-map, this will point
703 to the first event after the translated sequence: we don't ever
704 want to translate any events twice through function-key-map, or
705 things could get really screwed up (e.g. if the user created a
706 translation loop). If this is nil, then the next-read event is
707 the first that can begin a function key sequence. */
708 Lisp_Object first_mungeable_event;
709 } munge_me[2];
710
711 Bufbyte *echo_buf;
712 Bytecount echo_buf_length; /* size of echo_buf */
713 Bytecount echo_buf_index; /* index into echo_buf
714 * -1 before doing echoing for new cmd */
715 /* Self-insert-command is magic in that it doesn't always push an undo-
716 boundary: up to 20 consecutive self-inserts can happen before an undo-
717 boundary is pushed. This variable is that counter.
718 */
719 int self_insert_countdown;
720 };
721
664 #endif /* INCLUDED_events_h_ */ 722 #endif /* INCLUDED_events_h_ */