comparison src/msdos.c @ 28553:56d5ca61cfd8

(NUM_MOUSE_BUTTONS): Define. (IT_frame_up_to_date): Support the buffer local value of cursor-type, if defined.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 12 Apr 2000 15:44:16 +0000
parents 4bba3027ae58
children f8b0ac62f238
comparison
equal deleted inserted replaced
28552:ccadb68eaefd 28553:56d5ca61cfd8
121 /* ------------------------ Mouse control --------------------------- 121 /* ------------------------ Mouse control ---------------------------
122 * 122 *
123 * Coordinates are in screen positions and zero based. 123 * Coordinates are in screen positions and zero based.
124 * Mouse buttons are numbered from left to right and also zero based. 124 * Mouse buttons are numbered from left to right and also zero based.
125 */ 125 */
126
127 /* This used to be in termhooks.h, but mainstream Emacs code no longer
128 uses it, and it was removed... */
129 #define NUM_MOUSE_BUTTONS (5)
126 130
127 int have_mouse; /* 0: no, 1: enabled, -1: disabled */ 131 int have_mouse; /* 0: no, 1: enabled, -1: disabled */
128 static int mouse_visible; 132 static int mouse_visible;
129 133
130 static int mouse_last_x; 134 static int mouse_last_x;
1896 1900
1897 static void 1901 static void
1898 IT_frame_up_to_date (struct frame *f) 1902 IT_frame_up_to_date (struct frame *f)
1899 { 1903 {
1900 struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1904 struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
1905 Lisp_Object new_cursor, frame_desired_cursor;
1906 struct window *sw;
1901 1907
1902 if (dpyinfo->mouse_face_deferred_gc 1908 if (dpyinfo->mouse_face_deferred_gc
1903 || f == dpyinfo->mouse_face_mouse_frame) 1909 || f == dpyinfo->mouse_face_mouse_frame)
1904 { 1910 {
1905 BLOCK_INPUT; 1911 BLOCK_INPUT;
1909 dpyinfo->mouse_face_mouse_y); 1915 dpyinfo->mouse_face_mouse_y);
1910 dpyinfo->mouse_face_deferred_gc = 0; 1916 dpyinfo->mouse_face_deferred_gc = 0;
1911 UNBLOCK_INPUT; 1917 UNBLOCK_INPUT;
1912 } 1918 }
1913 1919
1914 /* Set the cursor type to whatever they wanted. */ 1920 /* Set the cursor type to whatever they wanted. In a minibuffer
1915 IT_set_cursor_type (f, Fcdr (Fassq (Qcursor_type, f->param_alist))); 1921 window, we want the cursor to appear only if we are reading input
1922 from this window, and we want the cursor to be taken from the
1923 frame parameters. For the selected window, we use either its
1924 buffer-local value or the value from the frame parameters if the
1925 buffer doesn't define its local value for the cursor type. */
1926 sw = XWINDOW (f->selected_window);
1927 frame_desired_cursor = Fcdr (Fassq (Qcursor_type, f->param_alist));
1928 if (cursor_in_echo_area
1929 && FRAME_HAS_MINIBUF_P (f)
1930 && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)
1931 && sw == XWINDOW (echo_area_window))
1932 new_cursor = frame_desired_cursor;
1933 else
1934 {
1935 struct buffer *b = XBUFFER (sw->buffer);
1936
1937 if (EQ (b->cursor_type, Qt))
1938 new_cursor = frame_desired_cursor;
1939 else if (NILP (b->cursor_type)) /* nil means no cursor */
1940 new_cursor = Fcons (Qbar, make_number (0));
1941 else
1942 new_cursor = b->cursor_type;
1943 }
1944
1945 IT_set_cursor_type (f, new_cursor);
1916 1946
1917 IT_cmgoto (f); /* position cursor when update is done */ 1947 IT_cmgoto (f); /* position cursor when update is done */
1918 } 1948 }
1919 1949
1920 /* Copy LEN glyphs displayed on a single line whose vertical position 1950 /* Copy LEN glyphs displayed on a single line whose vertical position