Mercurial > emacs
comparison src/xterm.c @ 1530:a7f8a1fe258e
* xterm.c (x_convert_modifiers): Declare this to return an
unsigned int, not a Lisp_Object. Remember that the quiescent
value for part is Qnil, not zero, that x_mouse_x and x_mouse_y
are ints, not Lisp_Objects, and that RESULT->x and RESULT->y are
Lisp_Objects, not ints.
(XTread_socket): Declare this to return int, not Lisp_Object.
When calling construct_mouse_click on a non-scrollbar click, pass
PART as Qnil, not zero.
(x_calc_absolute_position): Remember that x_screen_width and
x_screen_height are ints, not Lisp_Objects.
e
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sat, 31 Oct 1992 05:43:00 +0000 |
parents | e7c5faab6571 |
children | 452ba03935d7 |
comparison
equal
deleted
inserted
replaced
1529:d73ee126c15d | 1530:a7f8a1fe258e |
---|---|
1520 | 1520 |
1521 | 1521 |
1522 /* Convert a set of X modifier bits to the proper form for a | 1522 /* Convert a set of X modifier bits to the proper form for a |
1523 struct input_event modifiers value. */ | 1523 struct input_event modifiers value. */ |
1524 | 1524 |
1525 static Lisp_Object | 1525 static unsigned int |
1526 x_convert_modifiers (state) | 1526 x_convert_modifiers (state) |
1527 unsigned int state; | 1527 unsigned int state; |
1528 { | 1528 { |
1529 return ( ((state & (ShiftMask | x_shift_lock_mask)) ? shift_modifier : 0) | 1529 return ( ((state & (ShiftMask | x_shift_lock_mask)) ? shift_modifier : 0) |
1530 | ((state & ControlMask) ? ctrl_modifier : 0) | 1530 | ((state & ControlMask) ? ctrl_modifier : 0) |
1573 x_mouse_grabbed &= ~(1 << event->button); | 1573 x_mouse_grabbed &= ~(1 << event->button); |
1574 if (!x_mouse_grabbed) | 1574 if (!x_mouse_grabbed) |
1575 Vmouse_depressed = Qnil; | 1575 Vmouse_depressed = Qnil; |
1576 } | 1576 } |
1577 | 1577 |
1578 if (part) /* Scrollbar event */ | 1578 if (! NILP (part)) /* Scrollbar event */ |
1579 { | 1579 { |
1580 int pos, len; | 1580 int pos, len; |
1581 | 1581 |
1582 pos = event->y - (f->display.x->v_scrollbar_width - 2); | 1582 pos = event->y - (f->display.x->v_scrollbar_width - 2); |
1583 XSET (x_mouse_x, Lisp_Int, pos); | 1583 x_mouse_x = pos; |
1584 len = ((FONT_HEIGHT (f->display.x->font) * f->height) | 1584 len = ((FONT_HEIGHT (f->display.x->font) * f->height) |
1585 + f->display.x->internal_border_width | 1585 + f->display.x->internal_border_width |
1586 - (2 * (f->display.x->v_scrollbar_width - 2))); | 1586 - (2 * (f->display.x->v_scrollbar_width - 2))); |
1587 XSET (x_mouse_y, Lisp_Int, len); | 1587 x_mouse_y = len; |
1588 | 1588 |
1589 result->kind = scrollbar_click; | 1589 result->kind = scrollbar_click; |
1590 result->part = part; | 1590 result->part = part; |
1591 XSET (result->x, Lisp_Int, (f->display.x->top_pos - event->y)); | 1591 XSET (result->x, Lisp_Int, (f->display.x->top_pos - event->y)); |
1592 XSET (result->y, Lisp_Int, f->display.x->pixel_height); | 1592 XSET (result->y, Lisp_Int, f->display.x->pixel_height); |
1596 { | 1596 { |
1597 int row, column; | 1597 int row, column; |
1598 | 1598 |
1599 pixel_to_glyph_coords (f, event->x, event->y, &column, &row, NULL); | 1599 pixel_to_glyph_coords (f, event->x, event->y, &column, &row, NULL); |
1600 result->kind = mouse_click; | 1600 result->kind = mouse_click; |
1601 result->x = column; | 1601 XFASTINT (result->x) = column; |
1602 result->y = row; | 1602 XFASTINT (result->y) = row; |
1603 result->frame = f; | 1603 result->frame = f; |
1604 } | 1604 } |
1605 } | 1605 } |
1606 | 1606 |
1607 | 1607 |
1787 thus pretending to be `read'. | 1787 thus pretending to be `read'. |
1788 | 1788 |
1789 WAITP is nonzero if we should block until input arrives. | 1789 WAITP is nonzero if we should block until input arrives. |
1790 EXPECTED is nonzero if the caller knows input is available. */ | 1790 EXPECTED is nonzero if the caller knows input is available. */ |
1791 | 1791 |
1792 Lisp_Object | 1792 int |
1793 XTread_socket (sd, bufp, numchars, waitp, expected) | 1793 XTread_socket (sd, bufp, numchars, waitp, expected) |
1794 register int sd; | 1794 register int sd; |
1795 register struct input_event *bufp; | 1795 register struct input_event *bufp; |
1796 register int numchars; | 1796 register int numchars; |
1797 int waitp; | 1797 int waitp; |
2339 | 2339 |
2340 f = x_window_to_frame (event.xbutton.window); | 2340 f = x_window_to_frame (event.xbutton.window); |
2341 if (f) | 2341 if (f) |
2342 if (!x_focus_frame || (f == x_focus_frame)) | 2342 if (!x_focus_frame || (f == x_focus_frame)) |
2343 construct_mouse_click (&emacs_event, | 2343 construct_mouse_click (&emacs_event, |
2344 &event, f, 0, 0); | 2344 &event, f, Qnil, 0); |
2345 else | 2345 else |
2346 continue; | 2346 continue; |
2347 else | 2347 else |
2348 if ((f = x_window_to_scrollbar (event.xbutton.window, | 2348 if ((f = x_window_to_scrollbar (event.xbutton.window, |
2349 &part, &prefix))) | 2349 &part, &prefix))) |
3175 struct frame *f; | 3175 struct frame *f; |
3176 { | 3176 { |
3177 #ifdef HAVE_X11 | 3177 #ifdef HAVE_X11 |
3178 if (f->display.x->left_pos < 0) | 3178 if (f->display.x->left_pos < 0) |
3179 f->display.x->left_pos | 3179 f->display.x->left_pos |
3180 = XINT (x_screen_width) - PIXEL_WIDTH (f) + f->display.x->left_pos; | 3180 = x_screen_width - PIXEL_WIDTH (f) + f->display.x->left_pos; |
3181 | 3181 |
3182 if (f->display.x->top_pos < 0) | 3182 if (f->display.x->top_pos < 0) |
3183 f->display.x->top_pos | 3183 f->display.x->top_pos |
3184 = XINT (x_screen_height) - PIXEL_HEIGHT (f) + f->display.x->top_pos; | 3184 = x_screen_height - PIXEL_HEIGHT (f) + f->display.x->top_pos; |
3185 #else /* ! defined (HAVE_X11) */ | 3185 #else /* ! defined (HAVE_X11) */ |
3186 WINDOWINFO_TYPE parentinfo; | 3186 WINDOWINFO_TYPE parentinfo; |
3187 | 3187 |
3188 XGetWindowInfo (FRAME_X_WINDOW (f), &parentinfo); | 3188 XGetWindowInfo (FRAME_X_WINDOW (f), &parentinfo); |
3189 | 3189 |