aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-08 16:29:04 +0000
committerRichard M. Stallman1993-05-08 16:29:04 +0000
commit99e2d9a9152f55ebc40fd3f4eb1e3c22d2d662c5 (patch)
treeb06d4c1ab0cf903d50e712f7138d2090f93a269b /src
parent3a68f530fe1d1116bbb8458b73a3ff2ae677feff (diff)
downloademacs-99e2d9a9152f55ebc40fd3f4eb1e3c22d2d662c5.tar.gz
emacs-99e2d9a9152f55ebc40fd3f4eb1e3c22d2d662c5.zip
(Fx_get_mouse_event, Fx_mouse_events): Code deleted.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c213
1 files changed, 0 insertions, 213 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 93355e9311f..3aa9b117dab 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3302,212 +3302,6 @@ x_draw_pixmap (f, x, y, image_data, width, height)
3302} 3302}
3303#endif 3303#endif
3304 3304
3305#if 0
3306
3307#ifdef HAVE_X11
3308#define XMouseEvent XEvent
3309#define WhichMouseButton xbutton.button
3310#define MouseWindow xbutton.window
3311#define MouseX xbutton.x
3312#define MouseY xbutton.y
3313#define MouseTime xbutton.time
3314#define ButtonReleased ButtonRelease
3315#define ButtonPressed ButtonPress
3316#else
3317#define XMouseEvent XButtonEvent
3318#define WhichMouseButton detail
3319#define MouseWindow window
3320#define MouseX x
3321#define MouseY y
3322#define MouseTime time
3323#endif /* X11 */
3324
3325DEFUN ("x-mouse-events", Fx_mouse_events, Sx_mouse_events, 0, 0, 0,
3326 "Return number of pending mouse events from X window system.")
3327 ()
3328{
3329 return make_number (queue_event_count (&x_mouse_queue));
3330}
3331
3332/* Encode the mouse button events in the form expected by the
3333 mouse code in Lisp. For X11, this means moving the masks around. */
3334
3335static int
3336encode_mouse_button (mouse_event)
3337 XMouseEvent mouse_event;
3338{
3339 register int event_code;
3340 register char key_mask;
3341
3342 event_code = mouse_event.detail & 3;
3343 key_mask = (mouse_event.detail >> 8) & 0xf0;
3344 event_code |= key_mask >> 1;
3345 if (mouse_event.type == ButtonReleased) event_code |= 0x04;
3346 return event_code;
3347}
3348
3349DEFUN ("x-get-mouse-event", Fx_get_mouse_event, Sx_get_mouse_event,
3350 0, 1, 0,
3351 "Get next mouse event out of mouse event buffer.\n\
3352Optional ARG non-nil means return nil immediately if no pending event;\n\
3353otherwise, wait for an event. Returns a four-part list:\n\
3354 ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ TIMESTAMP).\n\
3355Normally X-POS and Y-POS are the position of the click on the frame\n\
3356 (measured in characters and lines), and WINDOW is the window clicked in.\n\
3357KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\
3358If FRAME-PART is non-nil, the event was on a scroll bar;\n\
3359then Y-POS is really the total length of the scroll bar, while X-POS is\n\
3360the relative position of the scroll bar's value within that total length,\n\
3361and a third element OFFSET appears in that list: the height of the thumb-up\n\
3362area at the top of the scroll bar.\n\
3363FRAME-PART is one of the following symbols:\n\
3364 `vertical-scroll-bar', `vertical-thumbup', `vertical-thumbdown',\n\
3365 `horizontal-scroll-bar', `horizontal-thumbleft', `horizontal-thumbright'.\n\
3366TIMESTAMP is the lower 23 bits of the X-server's timestamp for\n\
3367the mouse event.")
3368 (arg)
3369 Lisp_Object arg;
3370{
3371 XMouseEvent xrep;
3372 register int com_letter;
3373 register Lisp_Object tempx;
3374 register Lisp_Object tempy;
3375 Lisp_Object part, pos, timestamp;
3376 int prefix;
3377 struct frame *f;
3378
3379 int tem;
3380
3381 while (1)
3382 {
3383 BLOCK_INPUT;
3384 tem = dequeue_event (&xrep, &x_mouse_queue);
3385 UNBLOCK_INPUT;
3386
3387 if (tem)
3388 {
3389 switch (xrep.type)
3390 {
3391 case ButtonPressed:
3392 case ButtonReleased:
3393
3394 com_letter = encode_mouse_button (xrep);
3395 mouse_timestamp = xrep.MouseTime;
3396
3397 if ((f = x_window_to_frame (xrep.MouseWindow)) != 0)
3398 {
3399 Lisp_Object frame;
3400
3401 if (f->display.x->icon_desc == xrep.MouseWindow)
3402 {
3403 x_make_frame_visible (f);
3404 continue;
3405 }
3406
3407 XSET (tempx, Lisp_Int,
3408 min (f->width-1, max (0, (xrep.MouseX - f->display.x->internal_border_width)/FONT_WIDTH (f->display.x->font))));
3409 XSET (tempy, Lisp_Int,
3410 min (f->height-1, max (0, (xrep.MouseY - f->display.x->internal_border_width)/FONT_HEIGHT (f->display.x->font))));
3411 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
3412 XSET (frame, Lisp_Frame, f);
3413
3414 pos = Fcons (tempx, Fcons (tempy, Qnil));
3415 Vmouse_window
3416 = Flocate_window_from_coordinates (frame, pos);
3417
3418 Vmouse_event
3419 = Fcons (pos,
3420 Fcons (Vmouse_window,
3421 Fcons (Qnil,
3422 Fcons (Fchar_to_string (make_number (com_letter)),
3423 Fcons (timestamp, Qnil)))));
3424 return Vmouse_event;
3425 }
3426 else if ((f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) != 0)
3427 {
3428 int pos, len;
3429 Lisp_Object keyseq;
3430 char *partname;
3431
3432 keyseq = concat2 (Fchar_to_string (make_number (prefix)),
3433 Fchar_to_string (make_number (com_letter)));
3434
3435 pos = xrep.MouseY - (f->display.x->v_scroll_bar_width - 2);
3436 XSET (tempx, Lisp_Int, pos);
3437 len = ((FONT_HEIGHT (f->display.x->font) * f->height)
3438 + f->display.x->internal_border_width
3439 - (2 * (f->display.x->v_scroll_bar_width - 2)));
3440 XSET (tempy, Lisp_Int, len);
3441 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
3442 Vmouse_window = f->selected_window;
3443 Vmouse_event
3444 = Fcons (Fcons (tempx, Fcons (tempy,
3445 Fcons (make_number (f->display.x->v_scroll_bar_width - 2),
3446 Qnil))),
3447 Fcons (Vmouse_window,
3448 Fcons (intern (part),
3449 Fcons (keyseq, Fcons (timestamp,
3450 Qnil)))));
3451 return Vmouse_event;
3452 }
3453 else
3454 continue;
3455
3456#ifdef HAVE_X11
3457 case MotionNotify:
3458
3459 com_letter = x11_encode_mouse_button (xrep);
3460 if ((f = x_window_to_frame (xrep.MouseWindow)) != 0)
3461 {
3462 Lisp_Object frame;
3463
3464 XSET (tempx, Lisp_Int,
3465 min (f->width-1,
3466 max (0, (xrep.MouseX - f->display.x->internal_border_width)
3467 / FONT_WIDTH (f->display.x->font))));
3468 XSET (tempy, Lisp_Int,
3469 min (f->height-1,
3470 max (0, (xrep.MouseY - f->display.x->internal_border_width)
3471 / FONT_HEIGHT (f->display.x->font))));
3472
3473 XSET (frame, Lisp_Frame, f);
3474 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
3475
3476 pos = Fcons (tempx, Fcons (tempy, Qnil));
3477 Vmouse_window
3478 = Flocate_window_from_coordinates (frame, pos);
3479
3480 Vmouse_event
3481 = Fcons (pos,
3482 Fcons (Vmouse_window,
3483 Fcons (Qnil,
3484 Fcons (Fchar_to_string (make_number (com_letter)),
3485 Fcons (timestamp, Qnil)))));
3486 return Vmouse_event;
3487 }
3488
3489 break;
3490#endif /* HAVE_X11 */
3491
3492 default:
3493 if (f = x_window_to_frame (xrep.MouseWindow))
3494 Vmouse_window = f->selected_window;
3495 else if (f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix))
3496 Vmouse_window = f->selected_window;
3497 return Vmouse_event = Qnil;
3498 }
3499 }
3500
3501 if (!NILP (arg))
3502 return Qnil;
3503
3504 /* Wait till we get another mouse event. */
3505 wait_reading_process_input (0, 0, 2, 0);
3506 }
3507}
3508#endif
3509
3510
3511#ifndef HAVE_X11 3305#ifndef HAVE_X11
3512DEFUN ("x-store-cut-buffer", Fx_store_cut_buffer, Sx_store_cut_buffer, 3306DEFUN ("x-store-cut-buffer", Fx_store_cut_buffer, Sx_store_cut_buffer,
3513 1, 1, "sStore text in cut buffer: ", 3307 1, 1, "sStore text in cut buffer: ",
@@ -4004,13 +3798,6 @@ syms_of_xfns ()
4004 defsubr (&Sx_open_connection); 3798 defsubr (&Sx_open_connection);
4005 defsubr (&Sx_close_current_connection); 3799 defsubr (&Sx_close_current_connection);
4006 defsubr (&Sx_synchronize); 3800 defsubr (&Sx_synchronize);
4007
4008 /* This was used in the old event interface which used a separate
4009 event queue.*/
4010#if 0
4011 defsubr (&Sx_mouse_events);
4012 defsubr (&Sx_get_mouse_event);
4013#endif
4014} 3801}
4015 3802
4016#endif /* HAVE_X_WINDOWS */ 3803#endif /* HAVE_X_WINDOWS */