aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Love2002-10-28 15:35:53 +0000
committerDave Love2002-10-28 15:35:53 +0000
commitd2020d6b11511d4160d4db83840f37224617d588 (patch)
tree98ed112b10093b8907af8a54ee97190aa82ad624 /src
parent58fa26d4529bf57060e0b38ad2b157f273ff3d8a (diff)
downloademacs-d2020d6b11511d4160d4db83840f37224617d588.tar.gz
emacs-d2020d6b11511d4160d4db83840f37224617d588.zip
(xaw_scroll_callback): Cast call_data.
(XTread_socket): Deal with ASCII keysyms. (syms_of_xterm) <Vx_keysym_table>: Fix args of make_hash_table.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c70
1 files changed, 42 insertions, 28 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 2c9ae41764b..71731deed2b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8629,7 +8629,7 @@ xaw_jump_callback (widget, client_data, call_data)
8629 i.e. line or page up or down. WIDGET is the Xaw scroll bar 8629 i.e. line or page up or down. WIDGET is the Xaw scroll bar
8630 widget. CLIENT_DATA is a pointer to the scroll_bar structure for 8630 widget. CLIENT_DATA is a pointer to the scroll_bar structure for
8631 the scroll bar. CALL_DATA is an integer specifying the action that 8631 the scroll bar. CALL_DATA is an integer specifying the action that
8632 has taken place. It's magnitude is in the range 0..height of the 8632 has taken place. Its magnitude is in the range 0..height of the
8633 scroll bar. Negative values mean scroll towards buffer start. 8633 scroll bar. Negative values mean scroll towards buffer start.
8634 Values < height of scroll bar mean line-wise movement. */ 8634 Values < height of scroll bar mean line-wise movement. */
8635 8635
@@ -8639,7 +8639,8 @@ xaw_scroll_callback (widget, client_data, call_data)
8639 XtPointer client_data, call_data; 8639 XtPointer client_data, call_data;
8640{ 8640{
8641 struct scroll_bar *bar = (struct scroll_bar *) client_data; 8641 struct scroll_bar *bar = (struct scroll_bar *) client_data;
8642 int position = (int) call_data; 8642 /* Fixme: Check this. */
8643 long position = (long) call_data;
8643 Dimension height; 8644 Dimension height;
8644 int part; 8645 int part;
8645 8646
@@ -10647,8 +10648,18 @@ XTread_socket (sd, bufp, numchars, expected)
10647 if (temp_index == sizeof temp_buffer / sizeof (short)) 10648 if (temp_index == sizeof temp_buffer / sizeof (short))
10648 temp_index = 0; 10649 temp_index = 0;
10649 temp_buffer[temp_index++] = keysym; 10650 temp_buffer[temp_index++] = keysym;
10650 if (! EQ ((c = Fgethash (make_number (keysym), 10651 /* First deal with keysyms which have
10651 Vx_keysym_table, Qnil)), 10652 defined translations to characters. */
10653 if (keysym > 0 && keysym < 128)
10654 /* Fixme: Is this always right? It avoids
10655 explicitly decoding each ASCII character. */
10656 {
10657 bufp->kind = ascii_keystroke;
10658 bufp->code = c;
10659 }
10660 else if (! EQ ((c = Fgethash (make_number (keysym),
10661 Vx_keysym_table,
10662 Qnil)),
10652 Qnil)) 10663 Qnil))
10653 { 10664 {
10654 bufp->kind = (ASCII_CHAR_P (c) 10665 bufp->kind = (ASCII_CHAR_P (c)
@@ -10657,6 +10668,9 @@ XTread_socket (sd, bufp, numchars, expected)
10657 bufp->code = c; 10668 bufp->code = c;
10658 } 10669 }
10659 else 10670 else
10671 /* Not a character keysym.
10672 make_lispy_event will convert it to a
10673 symbolic key. */
10660 { 10674 {
10661 bufp->kind = non_ascii_keystroke; 10675 bufp->kind = non_ascii_keystroke;
10662 bufp->code = keysym; 10676 bufp->code = keysym;
@@ -10672,7 +10686,7 @@ XTread_socket (sd, bufp, numchars, expected)
10672 numchars--; 10686 numchars--;
10673 } 10687 }
10674 else if (numchars > nbytes) 10688 else if (numchars > nbytes)
10675 { 10689 { /* Raw characters, not keysym. */
10676 register int i; 10690 register int i;
10677 register int c; 10691 register int c;
10678 int nchars, len; 10692 int nchars, len;
@@ -10685,26 +10699,26 @@ XTread_socket (sd, bufp, numchars, expected)
10685 temp_buffer[temp_index++] = copy_bufptr[i]; 10699 temp_buffer[temp_index++] = copy_bufptr[i];
10686 } 10700 }
10687 10701
10688 { 10702 {
10689 /* Decode the input data. */ 10703 /* Decode the input data. */
10690 coding.destination 10704 coding.destination
10691 = (unsigned char *) malloc (nbytes); 10705 = (unsigned char *) malloc (nbytes);
10692 if (! coding.destination) 10706 if (! coding.destination)
10693 break; 10707 break;
10694 coding.dst_bytes = nbytes; 10708 coding.dst_bytes = nbytes;
10695 coding.mode |= CODING_MODE_LAST_BLOCK; 10709 coding.mode |= CODING_MODE_LAST_BLOCK;
10696 decode_coding_c_string (&coding, copy_bufptr, 10710 decode_coding_c_string (&coding, copy_bufptr,
10697 nbytes, Qnil); 10711 nbytes, Qnil);
10698 nbytes = coding.produced; 10712 nbytes = coding.produced;
10699 nchars = coding.produced_char; 10713 nchars = coding.produced_char;
10700 if (copy_bufsiz < nbytes) 10714 if (copy_bufsiz < nbytes)
10701 { 10715 {
10702 copy_bufsiz = nbytes; 10716 copy_bufsiz = nbytes;
10703 copy_bufptr = (char *) alloca (nbytes); 10717 copy_bufptr = (char *) alloca (nbytes);
10704 } 10718 }
10705 bcopy (coding.destination, copy_bufptr, nbytes); 10719 bcopy (coding.destination, copy_bufptr, nbytes);
10706 free (coding.destination); 10720 free (coding.destination);
10707 } 10721 }
10708 10722
10709 /* Convert the input data to a sequence of 10723 /* Convert the input data to a sequence of
10710 character events. */ 10724 character events. */
@@ -15301,9 +15315,9 @@ default is nil, which is the same as `super'. */);
15301 15315
15302 DEFVAR_LISP ("x-keysym-table", &Vx_keysym_table, 15316 DEFVAR_LISP ("x-keysym-table", &Vx_keysym_table,
15303 doc: /* Hash table of character codes indexed by X keysym codes. */); 15317 doc: /* Hash table of character codes indexed by X keysym codes. */);
15304 Vx_keysym_table = make_hash_table (Qeql, make_number (800), 15318 Vx_keysym_table = make_hash_table (Qeql, make_number (900),
15305 make_number (DEFAULT_REHASH_SIZE), 15319 make_float (DEFAULT_REHASH_SIZE),
15306 make_number (DEFAULT_REHASH_THRESHOLD), 15320 make_float (DEFAULT_REHASH_THRESHOLD),
15307 Qnil, Qnil, Qnil); 15321 Qnil, Qnil, Qnil);
15308} 15322}
15309 15323