diff options
| author | Karl Heuer | 1994-10-04 19:46:12 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-10-04 19:46:12 +0000 |
| commit | e0c1aef22bc59c2c7871846d1231b68fe4abb6c3 (patch) | |
| tree | 09a38cd940ac5b30c4878ef17fcd9e082f19ddf4 /src | |
| parent | c0a04927384f3254c83a97ea4cf1c5f808324e25 (diff) | |
| download | emacs-e0c1aef22bc59c2c7871846d1231b68fe4abb6c3.tar.gz emacs-e0c1aef22bc59c2c7871846d1231b68fe4abb6c3.zip | |
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
note_mouse_highlight, XTmouse_position, x_scroll_bar_create,
x_scroll_bar_set_handle, x_scroll_bar_move, XTset_vertical_scroll_bar,
XTredeem_scroll_bar, x_scroll_bar_handle_click, x_scroll_bar_note_movement,
x_scroll_bar_report_motion, XTread_socket, x_make_frame_visible): Use new
accessor macros instead of calling XSET directly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/src/xterm.c b/src/xterm.c index bb290730c32..9721233a075 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1453,8 +1453,8 @@ x_new_focus_frame (frame) | |||
| 1453 | 1453 | ||
| 1454 | #if 0 | 1454 | #if 0 |
| 1455 | selected_frame = frame; | 1455 | selected_frame = frame; |
| 1456 | XSET (XWINDOW (selected_frame->selected_window)->frame, | 1456 | XSETFRAME (XWINDOW (selected_frame->selected_window)->frame, |
| 1457 | Lisp_Frame, selected_frame); | 1457 | selected_frame); |
| 1458 | Fselect_window (selected_frame->selected_window); | 1458 | Fselect_window (selected_frame->selected_window); |
| 1459 | choose_minibuf_frame (); | 1459 | choose_minibuf_frame (); |
| 1460 | #endif /* ! 0 */ | 1460 | #endif /* ! 0 */ |
| @@ -1743,9 +1743,9 @@ construct_mouse_click (result, event, f) | |||
| 1743 | XFASTINT (result->x) = column; | 1743 | XFASTINT (result->x) = column; |
| 1744 | XFASTINT (result->y) = row; | 1744 | XFASTINT (result->y) = row; |
| 1745 | #endif | 1745 | #endif |
| 1746 | XSET (result->x, Lisp_Int, event->x); | 1746 | XSETINT (result->x, event->x); |
| 1747 | XSET (result->y, Lisp_Int, event->y); | 1747 | XSETINT (result->y, event->y); |
| 1748 | XSET (result->frame_or_window, Lisp_Frame, f); | 1748 | XSETFRAME (result->frame_or_window, f); |
| 1749 | } | 1749 | } |
| 1750 | } | 1750 | } |
| 1751 | 1751 | ||
| @@ -1760,16 +1760,16 @@ construct_menu_click (result, event, f) | |||
| 1760 | /* Make the event type no_event; we'll change that when we decide | 1760 | /* Make the event type no_event; we'll change that when we decide |
| 1761 | otherwise. */ | 1761 | otherwise. */ |
| 1762 | result->kind = mouse_click; | 1762 | result->kind = mouse_click; |
| 1763 | XSET (result->code, Lisp_Int, event->button - Button1); | 1763 | XSETINT (result->code, event->button - Button1); |
| 1764 | result->timestamp = event->time; | 1764 | result->timestamp = event->time; |
| 1765 | result->modifiers = (x_x_to_emacs_modifiers (event->state) | 1765 | result->modifiers = (x_x_to_emacs_modifiers (event->state) |
| 1766 | | (event->type == ButtonRelease | 1766 | | (event->type == ButtonRelease |
| 1767 | ? up_modifier | 1767 | ? up_modifier |
| 1768 | : down_modifier)); | 1768 | : down_modifier)); |
| 1769 | 1769 | ||
| 1770 | XSET (result->x, Lisp_Int, event->x); | 1770 | XSETINT (result->x, event->x); |
| 1771 | XSET (result->y, Lisp_Int, -1); | 1771 | XSETINT (result->y, -1); |
| 1772 | XSET (result->frame_or_window, Lisp_Frame, f); | 1772 | XSETFRAME (result->frame_or_window, f); |
| 1773 | } | 1773 | } |
| 1774 | 1774 | ||
| 1775 | /* Function to report a mouse movement to the mainstream Emacs code. | 1775 | /* Function to report a mouse movement to the mainstream Emacs code. |
| @@ -1937,7 +1937,7 @@ note_mouse_highlight (f, x, y) | |||
| 1937 | clear_mouse_face (); | 1937 | clear_mouse_face (); |
| 1938 | 1938 | ||
| 1939 | /* Is this char mouse-active? */ | 1939 | /* Is this char mouse-active? */ |
| 1940 | XSET (position, Lisp_Int, pos); | 1940 | XSETINT (position, pos); |
| 1941 | 1941 | ||
| 1942 | len = 10; | 1942 | len = 10; |
| 1943 | overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); | 1943 | overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); |
| @@ -1996,9 +1996,8 @@ note_mouse_highlight (f, x, y) | |||
| 1996 | int ignore; | 1996 | int ignore; |
| 1997 | 1997 | ||
| 1998 | beginning = Fmarker_position (w->start); | 1998 | beginning = Fmarker_position (w->start); |
| 1999 | XSET (end, Lisp_Int, | 1999 | XSETINT (end, (BUF_Z (XBUFFER (w->buffer)) |
| 2000 | (BUF_Z (XBUFFER (w->buffer)) | 2000 | - XFASTINT (w->window_end_pos))); |
| 2001 | - XFASTINT (w->window_end_pos))); | ||
| 2002 | before | 2001 | before |
| 2003 | = Fprevious_single_property_change (make_number (pos + 1), | 2002 | = Fprevious_single_property_change (make_number (pos + 1), |
| 2004 | Qmouse_face, | 2003 | Qmouse_face, |
| @@ -2319,8 +2318,8 @@ XTmouse_position (f, bar_window, part, x, y, time) | |||
| 2319 | *bar_window = Qnil; | 2318 | *bar_window = Qnil; |
| 2320 | *part = 0; | 2319 | *part = 0; |
| 2321 | *f = f1; | 2320 | *f = f1; |
| 2322 | XSET (*x, Lisp_Int, win_x); | 2321 | XSETINT (*x, win_x); |
| 2323 | XSET (*y, Lisp_Int, win_y); | 2322 | XSETINT (*y, win_y); |
| 2324 | *time = last_mouse_movement_time; | 2323 | *time = last_mouse_movement_time; |
| 2325 | } | 2324 | } |
| 2326 | } | 2325 | } |
| @@ -2420,21 +2419,21 @@ x_scroll_bar_create (window, top, left, width, height) | |||
| 2420 | mask, &a)); | 2419 | mask, &a)); |
| 2421 | } | 2420 | } |
| 2422 | 2421 | ||
| 2423 | XSET (bar->window, Lisp_Window, window); | 2422 | XSETWINDOW (bar->window, window); |
| 2424 | XSET (bar->top, Lisp_Int, top); | 2423 | XSETINT (bar->top, top); |
| 2425 | XSET (bar->left, Lisp_Int, left); | 2424 | XSETINT (bar->left, left); |
| 2426 | XSET (bar->width, Lisp_Int, width); | 2425 | XSETINT (bar->width, width); |
| 2427 | XSET (bar->height, Lisp_Int, height); | 2426 | XSETINT (bar->height, height); |
| 2428 | XSET (bar->start, Lisp_Int, 0); | 2427 | XSETINT (bar->start, 0); |
| 2429 | XSET (bar->end, Lisp_Int, 0); | 2428 | XSETINT (bar->end, 0); |
| 2430 | bar->dragging = Qnil; | 2429 | bar->dragging = Qnil; |
| 2431 | 2430 | ||
| 2432 | /* Add bar to its frame's list of scroll bars. */ | 2431 | /* Add bar to its frame's list of scroll bars. */ |
| 2433 | bar->next = FRAME_SCROLL_BARS (frame); | 2432 | bar->next = FRAME_SCROLL_BARS (frame); |
| 2434 | bar->prev = Qnil; | 2433 | bar->prev = Qnil; |
| 2435 | XSET (FRAME_SCROLL_BARS (frame), Lisp_Vector, bar); | 2434 | XSETVECTOR (FRAME_SCROLL_BARS (frame), bar); |
| 2436 | if (! NILP (bar->next)) | 2435 | if (! NILP (bar->next)) |
| 2437 | XSET (XSCROLL_BAR (bar->next)->prev, Lisp_Vector, bar); | 2436 | XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
| 2438 | 2437 | ||
| 2439 | XMapWindow (x_current_display, SCROLL_BAR_X_WINDOW (bar)); | 2438 | XMapWindow (x_current_display, SCROLL_BAR_X_WINDOW (bar)); |
| 2440 | 2439 | ||
| @@ -2495,8 +2494,8 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) | |||
| 2495 | } | 2494 | } |
| 2496 | 2495 | ||
| 2497 | /* Store the adjusted setting in the scroll bar. */ | 2496 | /* Store the adjusted setting in the scroll bar. */ |
| 2498 | XSET (bar->start, Lisp_Int, start); | 2497 | XSETINT (bar->start, start); |
| 2499 | XSET (bar->end, Lisp_Int, end); | 2498 | XSETINT (bar->end, end); |
| 2500 | 2499 | ||
| 2501 | /* Clip the end position, just for display. */ | 2500 | /* Clip the end position, just for display. */ |
| 2502 | if (end > top_range) | 2501 | if (end > top_range) |
| @@ -2571,10 +2570,10 @@ x_scroll_bar_move (bar, top, left, width, height) | |||
| 2571 | mask, &wc); | 2570 | mask, &wc); |
| 2572 | } | 2571 | } |
| 2573 | 2572 | ||
| 2574 | XSET (bar->left, Lisp_Int, left); | 2573 | XSETINT (bar->left, left); |
| 2575 | XSET (bar->top, Lisp_Int, top); | 2574 | XSETINT (bar->top, top); |
| 2576 | XSET (bar->width, Lisp_Int, width); | 2575 | XSETINT (bar->width, width); |
| 2577 | XSET (bar->height, Lisp_Int, height); | 2576 | XSETINT (bar->height, height); |
| 2578 | 2577 | ||
| 2579 | UNBLOCK_INPUT; | 2578 | UNBLOCK_INPUT; |
| 2580 | } | 2579 | } |
| @@ -2653,7 +2652,7 @@ XTset_vertical_scroll_bar (window, portion, whole, position) | |||
| 2653 | } | 2652 | } |
| 2654 | } | 2653 | } |
| 2655 | 2654 | ||
| 2656 | XSET (window->vertical_scroll_bar, Lisp_Vector, bar); | 2655 | XSETVECTOR (window->vertical_scroll_bar, bar); |
| 2657 | } | 2656 | } |
| 2658 | 2657 | ||
| 2659 | 2658 | ||
| @@ -2724,9 +2723,9 @@ XTredeem_scroll_bar (window) | |||
| 2724 | 2723 | ||
| 2725 | bar->next = FRAME_SCROLL_BARS (f); | 2724 | bar->next = FRAME_SCROLL_BARS (f); |
| 2726 | bar->prev = Qnil; | 2725 | bar->prev = Qnil; |
| 2727 | XSET (FRAME_SCROLL_BARS (f), Lisp_Vector, bar); | 2726 | XSETVECTOR (FRAME_SCROLL_BARS (f), bar); |
| 2728 | if (! NILP (bar->next)) | 2727 | if (! NILP (bar->next)) |
| 2729 | XSET (XSCROLL_BAR (bar->next)->prev, Lisp_Vector, bar); | 2728 | XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
| 2730 | } | 2729 | } |
| 2731 | } | 2730 | } |
| 2732 | 2731 | ||
| @@ -2832,7 +2831,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event) | |||
| 2832 | holding it. */ | 2831 | holding it. */ |
| 2833 | if (event->type == ButtonPress | 2832 | if (event->type == ButtonPress |
| 2834 | && emacs_event->part == scroll_bar_handle) | 2833 | && emacs_event->part == scroll_bar_handle) |
| 2835 | XSET (bar->dragging, Lisp_Int, y - XINT (bar->start)); | 2834 | XSETINT (bar->dragging, y - XINT (bar->start)); |
| 2836 | #endif | 2835 | #endif |
| 2837 | 2836 | ||
| 2838 | /* If the user has released the handle, set it to its final position. */ | 2837 | /* If the user has released the handle, set it to its final position. */ |
| @@ -2853,12 +2852,12 @@ x_scroll_bar_handle_click (bar, event, emacs_event) | |||
| 2853 | if (emacs_event->part == scroll_bar_handle) | 2852 | if (emacs_event->part == scroll_bar_handle) |
| 2854 | emacs_event->x = bar->start; | 2853 | emacs_event->x = bar->start; |
| 2855 | else | 2854 | else |
| 2856 | XSET (emacs_event->x, Lisp_Int, y); | 2855 | XSETINT (emacs_event->x, y); |
| 2857 | #else | 2856 | #else |
| 2858 | XSET (emacs_event->x, Lisp_Int, y); | 2857 | XSETINT (emacs_event->x, y); |
| 2859 | #endif | 2858 | #endif |
| 2860 | 2859 | ||
| 2861 | XSET (emacs_event->y, Lisp_Int, top_range); | 2860 | XSETINT (emacs_event->y, top_range); |
| 2862 | } | 2861 | } |
| 2863 | } | 2862 | } |
| 2864 | 2863 | ||
| @@ -2874,7 +2873,7 @@ x_scroll_bar_note_movement (bar, event) | |||
| 2874 | last_mouse_movement_time = event->xmotion.time; | 2873 | last_mouse_movement_time = event->xmotion.time; |
| 2875 | 2874 | ||
| 2876 | mouse_moved = 1; | 2875 | mouse_moved = 1; |
| 2877 | XSET (last_mouse_scroll_bar, Lisp_Vector, bar); | 2876 | XSETVECTOR (last_mouse_scroll_bar, bar); |
| 2878 | 2877 | ||
| 2879 | /* If we're dragging the bar, display it. */ | 2878 | /* If we're dragging the bar, display it. */ |
| 2880 | if (! GC_NILP (bar->dragging)) | 2879 | if (! GC_NILP (bar->dragging)) |
| @@ -2965,8 +2964,8 @@ x_scroll_bar_report_motion (f, bar_window, part, x, y, time) | |||
| 2965 | else | 2964 | else |
| 2966 | *part = scroll_bar_below_handle; | 2965 | *part = scroll_bar_below_handle; |
| 2967 | 2966 | ||
| 2968 | XSET (*x, Lisp_Int, win_y); | 2967 | XSETINT (*x, win_y); |
| 2969 | XSET (*y, Lisp_Int, top_range); | 2968 | XSETINT (*y, top_range); |
| 2970 | 2969 | ||
| 2971 | mouse_moved = 0; | 2970 | mouse_moved = 0; |
| 2972 | last_mouse_scroll_bar = Qnil; | 2971 | last_mouse_scroll_bar = Qnil; |
| @@ -3257,7 +3256,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3257 | abort (); | 3256 | abort (); |
| 3258 | 3257 | ||
| 3259 | bufp->kind = delete_window_event; | 3258 | bufp->kind = delete_window_event; |
| 3260 | XSET (bufp->frame_or_window, Lisp_Frame, f); | 3259 | XSETFRAME (bufp->frame_or_window, f); |
| 3261 | bufp++; | 3260 | bufp++; |
| 3262 | 3261 | ||
| 3263 | count += 1; | 3262 | count += 1; |
| @@ -3563,7 +3562,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3563 | temp_buffer[temp_index++] = keysym; | 3562 | temp_buffer[temp_index++] = keysym; |
| 3564 | bufp->kind = non_ascii_keystroke; | 3563 | bufp->kind = non_ascii_keystroke; |
| 3565 | bufp->code = keysym; | 3564 | bufp->code = keysym; |
| 3566 | XSET (bufp->frame_or_window, Lisp_Frame, f); | 3565 | XSETFRAME (bufp->frame_or_window, f); |
| 3567 | bufp->modifiers = x_x_to_emacs_modifiers (modifiers); | 3566 | bufp->modifiers = x_x_to_emacs_modifiers (modifiers); |
| 3568 | bufp->timestamp = event.xkey.time; | 3567 | bufp->timestamp = event.xkey.time; |
| 3569 | bufp++; | 3568 | bufp++; |
| @@ -3581,7 +3580,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3581 | temp_buffer[temp_index++] = copy_buffer[i]; | 3580 | temp_buffer[temp_index++] = copy_buffer[i]; |
| 3582 | bufp->kind = ascii_keystroke; | 3581 | bufp->kind = ascii_keystroke; |
| 3583 | bufp->code = copy_buffer[i]; | 3582 | bufp->code = copy_buffer[i]; |
| 3584 | XSET (bufp->frame_or_window, Lisp_Frame, f); | 3583 | XSETFRAME (bufp->frame_or_window, f); |
| 3585 | bufp->modifiers = x_x_to_emacs_modifiers (modifiers); | 3584 | bufp->modifiers = x_x_to_emacs_modifiers (modifiers); |
| 3586 | bufp->timestamp = event.xkey.time; | 3585 | bufp->timestamp = event.xkey.time; |
| 3587 | bufp++; | 3586 | bufp++; |
| @@ -4960,7 +4959,7 @@ x_make_frame_visible (f) | |||
| 4960 | /* This must come after we set COUNT. */ | 4959 | /* This must come after we set COUNT. */ |
| 4961 | UNBLOCK_INPUT; | 4960 | UNBLOCK_INPUT; |
| 4962 | 4961 | ||
| 4963 | XSET (frame, Lisp_Frame, f); | 4962 | XSETFRAME (frame, f); |
| 4964 | 4963 | ||
| 4965 | while (1) | 4964 | while (1) |
| 4966 | { | 4965 | { |