Mercurial > emacs
annotate lisp/term/tvi970.el @ 1717:aa7d6d57504b
* frame.h (struct frame): New fields `can_have_scrollbars' and
`has_vertical_scrollbars'.
(FRAME_CAN_HAVE_SCROLLBARS, FRAME_HAS_VERTICAL_SCROLLBARS): New
accessors, for both the MULTI_FRAME and non-MULTI_FRAME.
(VERTICAL_SCROLLBAR_WIDTH, WINDOW_VERTICAL_SCROLLBAR,
WINDOW_VERTICAL_SCROLLBAR_COLUMN,
WINDOW_VERTICAL_SCROLLBAR_HEIGHT): New macros.
* window.h (struct window): New field `vertical_scrollbar'.
* xterm.h (struct x_display): vertical_scrollbars,
judge_timestamp, vertical_scrollbar_extra: New fields.
(struct scrollbar): New struct.
(VERTICAL_SCROLLBAR_PIXEL_WIDTH, VERTICAL_SCROLLBAR_PIXEL_HEIGHT,
VERTICAL_SCROLLBAR_LEFT_BORDER, VERTICAL_SCROLLBAR_RIGHT_BORDER,
VERTICAL_SCROLLBAR_TOP_BORDER, VERTICAL_SCROLLBAR_BOTTOM_BORDER,
CHAR_TO_PIXEL_WIDTH, CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_WIDTH,
PIXEL_TO_CHAR_HEIGHT): New accessors and macros.
* frame.c (make_frame): Initialize the `can_have_scrollbars' and
`has_vertical_scrollbars' fields of the frame.
* term.c (term_init): Note that TERMCAP terminals don't support
scrollbars.
(mouse_position_hook): Document new args.
(set_vertical_scrollbar_hook, condemn_scrollbars_hook,
redeem_scrollbar_hook, judge_scrollbars_hook): New hooks.
* termhooks.h: Declare and document them.
(enum scrollbar_part): New type.
(struct input_event): Describe the new form of the scrollbar_click
event type. Change `part' from a Lisp_Object to an enum
scrollbar_part. Add a new field `scrollbar'.
* keyboard.c (kbd_buffer_get_event): Pass appropriate new
parameters to *mouse_position_hook, and make_lispy_movement.
* xfns.c (x_set_vertical_scrollbar): New function.
(x_figure_window_size): Use new macros to calculate frame size.
(Fx_create_frame): Note that X Windows frames do support scroll
bars. Default to "yes".
* xterm.c: #include <X11/cursorfont.h> and "window.h".
(x_vertical_scrollbar_cursor): New variable.
(x_term_init): Initialize it.
(last_mouse_bar, last_mouse_bar_frame, last_mouse_part,
last_mouse_scroll_range_start, last_mouse_scroll_range_end): New
variables.
(XTmouse_position): Use them to return scrollbar movement events.
Take new arguments, for that purpose.
(x_window_to_scrollbar, x_scrollbar_create,
x_scrollbar_set_handle, x_scrollbar_remove, x_scrollbar_move,
XTset_scrollbar, XTcondemn_scrollbars, XTredeem_scrollbar,
XTjudge_scrollbars, x_scrollbar_expose,
x_scrollbar_background_expose, x_scrollbar_handle_click,
x_scrollbar_handle_motion): New functions to implement scrollbars.
(x_term_init): Set the termhooks.h hooks to point to them.
(x_set_window_size): Use new macros to calculate frame size. Set
vertical_scrollbar_extra field.
(x_make_frame_visible): Use the frame accessor
FRAME_HAS_VERTICAL_SCROLLBARS to decide if we need to map the
frame's subwindows as well.
(XTread_socket): Use new size-calculation macros from xterm.h when
processing ConfigureNotify events.
(x_wm_set_size_hint): Use PIXEL_TO_CHAR_WIDTH and
PIXEL_TO_CHAR_HEIGHT macros.
* ymakefile (xdisp.o): This now depends on termhooks.h.
(xterm.o): This now depends on window.h.
| author | Jim Blandy <jimb@redhat.com> |
|---|---|
| date | Thu, 24 Dec 1992 06:17:18 +0000 |
| parents | 86f90c43ef3e |
| children | 9bc89a98c002 |
| rev | line source |
|---|---|
| 530 | 1 ;;; Terminal support for the Televideo 970. |
| 2 ;;; Jim Blandy <jimb@occs.cs.oberlin.edu>, January 1992 | |
| 3 | |
| 4 | |
| 5 ;;; Define the escape codes sent by the function keys. | |
| 6 (or (lookup-key function-key-map "\e[") | |
| 7 (define-key function-key-map "\e[" (make-keymap))) | |
| 8 (or (lookup-key function-key-map "\eO") | |
| 9 (define-key function-key-map "\eO" (make-keymap))) | |
| 10 | |
| 11 ;; Miscellaneous keys | |
| 12 (mapcar (function (lambda (key-binding) | |
| 13 (define-key function-key-map | |
| 14 (car key-binding) (nth 1 key-binding)))) | |
| 15 '(("\e[H" [home]) | |
| 16 ("\e[Z" [backtab]) | |
| 17 ("\e[i" [print]) | |
| 18 ("\e[2J" [clear]) | |
| 19 ("\e[@" [insert]) | |
| 20 ("\e[P" [delete]) | |
| 21 ("\e[L" [insertline]) | |
| 22 ("\e[M" [deleteline]) | |
| 23 ("\e[K" [eraseline]) | |
| 24 ("\e[J" [erasepage]) | |
| 25 ("\e[U" [page]) | |
| 26 ("\e[g" [S-tab]) | |
| 27 ("\e[2N" [clearentry]) | |
| 28 ("\e[2K" [S-clearentry]) | |
| 29 ("\e[E" [?\C-j]) | |
| 30 ("\e[g" [S-backtab]) | |
| 31 ("\e[?1i" [S-print]) | |
| 32 ("\e[4h" [S-insert]) | |
| 33 ("\e[4l" [S-delete]) | |
| 34 ("\e[Q" [S-insertline]) | |
| 35 ("\e[1Q" [S-deleteline]) | |
| 36 ("\e[19l" [S-eraseline]) | |
| 37 ("\e[19h" [S-erasepage]) | |
| 38 ("\e[V" [S-page]) | |
| 39 ("\eS" [send]) | |
| 40 ("\e5" [S-send]) | |
| 41 ("\eOm" [kp-subtract]) | |
| 42 ("\eOl" [kp-separator]) | |
| 43 ("\eOn" [kp-decimal]) | |
| 44 ("\eOM" [enter]) | |
| 45 ("\eOP" [kp-f1]) | |
| 46 ("\eOQ" [kp-f2]) | |
| 47 ("\eOR" [kp-f3]) | |
| 48 ("\eOS" [kp-f4]))) | |
| 49 ;; The numeric keypad keys. | |
| 50 (let ((i 0)) | |
| 51 (while (< i 10) | |
| 52 (define-key function-key-map | |
| 53 (format "\eO%c" (+ i ?p)) | |
| 54 (vector (intern (format "kp-%d" i)))) | |
| 55 (setq i (1+ i)))) | |
| 56 ;; The numbered function keys. | |
| 57 (let ((i 0)) | |
| 58 (while (< i 16) | |
| 59 (define-key function-key-map | |
| 60 (format "\e?%c" (+ i ?a)) | |
| 61 (vector (intern (format "f%d" (1+ i))))) | |
| 62 (define-key function-key-map | |
| 63 (format "\e?%c" (+ i ?A)) | |
| 64 (vector (intern (format "S-f%d" (1+ i))))) | |
| 65 (setq i (1+ i)))) | |
| 66 | |
| 67 | |
| 68 ;;; Should keypad numbers send ordinary digits or distinct escape sequences? | |
| 69 (defvar tvi970-keypad-numeric nil | |
| 70 "The terminal should be in numeric keypad mode iff this variable is non-nil. | |
| 71 Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") | |
| 72 | |
| 73 (defun tvi970-set-keypad-mode (&optional arg) | |
| 74 "Set the current mode of the TVI 970 numeric keypad. | |
| 75 In ``numeric keypad mode'', the number keys on the keypad act as | |
| 76 ordinary digits. In ``alternate keypad mode'', the keys send distinct | |
| 77 escape sequences, meaning that they can have their own bindings, | |
| 78 independent of the normal number keys. | |
| 79 With no argument, toggle between the two possible modes. | |
| 80 With a positive argument, select alternate keypad mode. | |
| 81 With a negative argument, select numeric keypad mode." | |
| 82 (interactive "P") | |
| 83 (setq tvi970-keypad-numeric | |
| 84 (if (null arg) | |
| 85 (not tvi970-keypad-numeric) | |
| 86 (> (prefix-numeric-value arg) 0))) | |
| 87 (send-string-to-terminal (if tvi970-keypad-numeric "\e=" "\e>"))) | |
| 88 | |
| 89 (tvi970-set-keypad-mode 1) |
