comparison src/events.h @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents c5d627a313b1
children 558f606b08ae
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
225 225
226 misc_user_event 226 misc_user_event
227 function An elisp function to call with this event object. 227 function An elisp function to call with this event object.
228 internal_function Ignored. 228 internal_function Ignored.
229 object Anything. 229 object Anything.
230 button What button went down or up.
231 modifiers Bucky-bits on that button: shift, control, meta, etc.
232 x, y Where it was at the button-state-change (in pixels).
230 This is similar to an eval_event, except that it is 233 This is similar to an eval_event, except that it is
231 generated by user actions: selections in the 234 generated by user actions: selections in the
232 menubar or scrollbar actions. It is a "command" 235 menubar, scrollbar actions, or drag and drop actions.
233 event, like key and mouse presses (and unlike mouse 236 It is a "command" event, like key and mouse presses
234 motion, process output, and enter and leave window 237 (and unlike mouse motion, process output, and enter
235 hooks). In many ways, eval_events are not the same 238 and leave window hooks). In many ways, eval_events
236 as keypresses or misc_user_events. 239 are not the same as keypresses or misc_user_events.
240 The button, modifiers, x, and y parts are only used
241 by the XEmacs Drag'n'Drop system. Don't depend on their
242 values for other types of misc_user_events.
237 243
238 magic_event 244 magic_event
239 No user-serviceable parts within. This is for things 245 No user-serviceable parts within. This is for things
240 like KeymapNotify and ExposeRegion events and so on 246 like KeymapNotify and ExposeRegion events and so on
241 that XEmacs itself doesn't care about, but which it 247 that XEmacs itself doesn't care about, but which it
257 eval events" that call non-Lisp-accessible functions. 263 eval events" that call non-Lisp-accessible functions.
258 Externally, a magic_eval_event just appears as 264 Externally, a magic_eval_event just appears as
259 a magic_event; the Lisp programmer need not know 265 a magic_event; the Lisp programmer need not know
260 anything more. 266 anything more.
261 267
262 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) 268 */
263 dnd_drop_event
264 dnd_drag_event (* to be implemented *)
265 button What button went down or up.
266 modifiers Bucky-bits on that button: shift, control, meta, etc.
267 x, y Where it was at the button-state-change (in pixels).
268 data A list of type and data.
269 This events are created by Drag'n'Drop actions.
270 Currently only the OffiX Dnd Protocol is supported.
271 #endif
272
273 */
274 269
275 /* 270 /*
276 Stream pairs description 271 Stream pairs description
277 ------------------------ 272 ------------------------
278 273
340 void (*unselect_process_cb) (struct Lisp_Process *); 335 void (*unselect_process_cb) (struct Lisp_Process *);
341 void (*quit_p_cb) (void); 336 void (*quit_p_cb) (void);
342 USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ , 337 USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ ,
343 Lisp_Object* /* instream */, 338 Lisp_Object* /* instream */,
344 Lisp_Object* /* outstream */, 339 Lisp_Object* /* outstream */,
345 int /* pty_flag */); 340 int /* flags */);
346 USID (*delete_stream_pair_cb) (Lisp_Object /* instream */, 341 USID (*delete_stream_pair_cb) (Lisp_Object /* instream */,
347 Lisp_Object /* outstream */); 342 Lisp_Object /* outstream */);
348 }; 343 };
344
345 /* Flags for create_stream_pair_cb() FLAGS parameter */
346 #define STREAM_PTY_FLUSHING 0x0001
347 #define STREAM_NETWORK_CONNECTION 0x0002
349 348
350 extern struct event_stream *event_stream; 349 extern struct event_stream *event_stream;
351 350
352 typedef enum emacs_event_type 351 typedef enum emacs_event_type
353 { 352 {
360 timeout_event, 359 timeout_event,
361 magic_event, 360 magic_event,
362 magic_eval_event, 361 magic_eval_event,
363 eval_event, 362 eval_event,
364 misc_user_event, 363 misc_user_event,
365 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS)
366 dnd_drop_event,
367 #endif
368 dead_event 364 dead_event
369 } emacs_event_type; 365 } emacs_event_type;
370 366
371 #define first_event_type empty_event 367 #define first_event_type empty_event
372 #define last_event_type dead_event 368 #define last_event_type dead_event
407 { 403 {
408 Lisp_Object function; 404 Lisp_Object function;
409 Lisp_Object object; 405 Lisp_Object object;
410 }; 406 };
411 407
412 struct magic_eval_data 408 struct misc_user_data
413 { 409 {
414 void (*internal_function) (Lisp_Object); 410 Lisp_Object function;
415 Lisp_Object object; 411 Lisp_Object object;
416 };
417
418 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS)
419 struct dnd_drop_data
420 {
421 int button; 412 int button;
422 unsigned char modifiers; 413 unsigned char modifiers;
423 int x, y; 414 int x, y;
424 Lisp_Object data; 415 };
425 }; 416
426 #endif 417 struct magic_eval_data
418 {
419 void (*internal_function) (Lisp_Object);
420 Lisp_Object object;
421 };
427 422
428 #if defined (HAVE_X_WINDOWS) && defined(emacs) 423 #if defined (HAVE_X_WINDOWS) && defined(emacs)
429 # include <X11/Xlib.h> 424 # include <X11/Xlib.h>
430 #endif 425 #endif
431 426
460 struct key_data key; 455 struct key_data key;
461 struct button_data button; 456 struct button_data button;
462 struct motion_data motion; 457 struct motion_data motion;
463 struct process_data process; 458 struct process_data process;
464 struct timeout_data timeout; 459 struct timeout_data timeout;
465 struct eval_data eval; /* misc_user_event uses this too */ 460 struct eval_data eval; /* misc_user_event no loger uses this */
461 struct misc_user_data misc; /* because it needs position information */
466 union magic_data magic; 462 union magic_data magic;
467 struct magic_eval_data magic_eval; 463 struct magic_eval_data magic_eval;
468 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS)
469 struct dnd_drop_data dnd_drop;
470 #endif
471 } event; 464 } event;
472 }; 465 };
473 466
474 DECLARE_LRECORD (event, struct Lisp_Event); 467 DECLARE_LRECORD (event, struct Lisp_Event);
475 #define XEVENT(x) XRECORD (x, event, struct Lisp_Event) 468 #define XEVENT(x) XRECORD (x, event, struct Lisp_Event)
593 586
594 /* from signal.c */ 587 /* from signal.c */
595 int event_stream_add_async_timeout (EMACS_TIME thyme); 588 int event_stream_add_async_timeout (EMACS_TIME thyme);
596 void event_stream_remove_async_timeout (int id); 589 void event_stream_remove_async_timeout (int id);
597 590
591 /* from event-stream.c -- focus sanity */
592 extern int focus_follows_mouse;
593 void investigate_frame_change (void);
594
598 void emacs_handle_focus_change_preliminary (Lisp_Object frame_inp_and_dev); 595 void emacs_handle_focus_change_preliminary (Lisp_Object frame_inp_and_dev);
599 void emacs_handle_focus_change_final (Lisp_Object frame_inp_and_dev); 596 void emacs_handle_focus_change_final (Lisp_Object frame_inp_and_dev);
600 597
601 Lisp_Object extract_this_command_keys_nth_mouse_event (int n); 598 Lisp_Object extract_this_command_keys_nth_mouse_event (int n);
602 Lisp_Object extract_vector_nth_mouse_event (Lisp_Object vector, int n); 599 Lisp_Object extract_vector_nth_mouse_event (Lisp_Object vector, int n);