diff options
| author | Eli Zaretskii | 1997-10-13 16:40:24 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1997-10-13 16:40:24 +0000 |
| commit | 211c7152abf2bad41a6f6959c83b49658a0f0193 (patch) | |
| tree | efe11792d8bde58b1b719f68e1c67be06aee431e /src | |
| parent | 05d059c20d3cd8cc6203503fe94ae701fc4fbd63 (diff) | |
| download | emacs-211c7152abf2bad41a6f6959c83b49658a0f0193.tar.gz emacs-211c7152abf2bad41a6f6959c83b49658a0f0193.zip | |
(mouse_get_pos): Remove reduntant call to `int86'.
Clear the mouse-moved flag for all frames. Update last mouse
position.
(IT_set_menu_bar_lines): Remove.
(x_set_menu_bar_lines): Call `set_menu_bar_line' (from frame.c)
instead of duplicating its code.
(IT_set_frame_parameters): Support the `title' and `reverse'
properties.
Diffstat (limited to 'src')
| -rw-r--r-- | src/msdos.c | 108 |
1 files changed, 39 insertions, 69 deletions
diff --git a/src/msdos.c b/src/msdos.c index 72b485869b8..9bd5e2dd6d2 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -157,6 +157,17 @@ mouse_off () | |||
| 157 | } | 157 | } |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static void | ||
| 161 | mouse_get_xy (int *x, int *y) | ||
| 162 | { | ||
| 163 | union REGS regs; | ||
| 164 | |||
| 165 | regs.x.ax = 0x0003; | ||
| 166 | int86 (0x33, ®s, ®s); | ||
| 167 | *x = regs.x.cx / 8; | ||
| 168 | *y = regs.x.dx / 8; | ||
| 169 | } | ||
| 170 | |||
| 160 | void | 171 | void |
| 161 | mouse_moveto (x, y) | 172 | mouse_moveto (x, y) |
| 162 | int x, y; | 173 | int x, y; |
| @@ -203,17 +214,6 @@ mouse_released (b, xp, yp) | |||
| 203 | return (regs.x.bx != 0); | 214 | return (regs.x.bx != 0); |
| 204 | } | 215 | } |
| 205 | 216 | ||
| 206 | static void | ||
| 207 | mouse_get_xy (int *x, int *y) | ||
| 208 | { | ||
| 209 | union REGS regs; | ||
| 210 | |||
| 211 | regs.x.ax = 0x0003; | ||
| 212 | int86 (0x33, ®s, ®s); | ||
| 213 | *x = regs.x.cx / 8; | ||
| 214 | *y = regs.x.dx / 8; | ||
| 215 | } | ||
| 216 | |||
| 217 | void | 217 | void |
| 218 | mouse_get_pos (f, insist, bar_window, part, x, y, time) | 218 | mouse_get_pos (f, insist, bar_window, part, x, y, time) |
| 219 | FRAME_PTR *f; | 219 | FRAME_PTR *f; |
| @@ -223,17 +223,18 @@ mouse_get_pos (f, insist, bar_window, part, x, y, time) | |||
| 223 | unsigned long *time; | 223 | unsigned long *time; |
| 224 | { | 224 | { |
| 225 | int ix, iy; | 225 | int ix, iy; |
| 226 | union REGS regs; | 226 | Lisp_Object frame, tail; |
| 227 | |||
| 228 | /* Clear the mouse-moved flag for every frame on this display. */ | ||
| 229 | FOR_EACH_FRAME (tail, frame) | ||
| 230 | XFRAME (frame)->mouse_moved = 0; | ||
| 227 | 231 | ||
| 228 | regs.x.ax = 0x0003; | ||
| 229 | int86 (0x33, ®s, ®s); | ||
| 230 | *f = selected_frame; | 232 | *f = selected_frame; |
| 231 | *bar_window = Qnil; | 233 | *bar_window = Qnil; |
| 232 | mouse_get_xy (&ix, &iy); | 234 | mouse_get_xy (&ix, &iy); |
| 233 | selected_frame->mouse_moved = 0; | ||
| 234 | *x = make_number (ix); | ||
| 235 | *y = make_number (iy); | ||
| 236 | *time = event_timestamp (); | 235 | *time = event_timestamp (); |
| 236 | *x = make_number (mouse_last_x = ix); | ||
| 237 | *y = make_number (mouse_last_y = iy); | ||
| 237 | } | 238 | } |
| 238 | 239 | ||
| 239 | static void | 240 | static void |
| @@ -783,63 +784,20 @@ IT_update_end () | |||
| 783 | { | 784 | { |
| 784 | } | 785 | } |
| 785 | 786 | ||
| 786 | /* This was more or less copied from xterm.c | 787 | /* set-window-configuration on window.c needs this. */ |
| 787 | |||
| 788 | Nowadays, the corresponding function under X is `x_set_menu_bar_lines_1' | ||
| 789 | on xfns.c */ | ||
| 790 | |||
| 791 | static void | ||
| 792 | IT_set_menu_bar_lines (window, n) | ||
| 793 | Lisp_Object window; | ||
| 794 | int n; | ||
| 795 | { | ||
| 796 | struct window *w = XWINDOW (window); | ||
| 797 | |||
| 798 | XSETFASTINT (w->last_modified, 0); | ||
| 799 | XSETFASTINT (w->last_overlay_modified, 0); | ||
| 800 | XSETFASTINT (w->top, XFASTINT (w->top) + n); | ||
| 801 | XSETFASTINT (w->height, XFASTINT (w->height) - n); | ||
| 802 | |||
| 803 | /* Handle just the top child in a vertical split. */ | ||
| 804 | if (!NILP (w->vchild)) | ||
| 805 | IT_set_menu_bar_lines (w->vchild, n); | ||
| 806 | |||
| 807 | /* Adjust all children in a horizontal split. */ | ||
| 808 | for (window = w->hchild; !NILP (window); window = w->next) | ||
| 809 | { | ||
| 810 | w = XWINDOW (window); | ||
| 811 | IT_set_menu_bar_lines (window, n); | ||
| 812 | } | ||
| 813 | } | ||
| 814 | |||
| 815 | /* This was copied from xfns.c */ | ||
| 816 | |||
| 817 | Lisp_Object Qbackground_color; | ||
| 818 | Lisp_Object Qforeground_color; | ||
| 819 | |||
| 820 | void | 788 | void |
| 821 | x_set_menu_bar_lines (f, value, oldval) | 789 | x_set_menu_bar_lines (f, value, oldval) |
| 822 | struct frame *f; | 790 | struct frame *f; |
| 823 | Lisp_Object value, oldval; | 791 | Lisp_Object value, oldval; |
| 824 | { | 792 | { |
| 825 | int nlines; | 793 | set_menu_bar_lines (f, value, oldval); |
| 826 | int olines = FRAME_MENU_BAR_LINES (f); | 794 | } |
| 827 | |||
| 828 | /* Right now, menu bars don't work properly in minibuf-only frames; | ||
| 829 | most of the commands try to apply themselves to the minibuffer | ||
| 830 | frame itslef, and get an error because you can't switch buffers | ||
| 831 | in or split the minibuffer window. */ | ||
| 832 | if (FRAME_MINIBUF_ONLY_P (f)) | ||
| 833 | return; | ||
| 834 | 795 | ||
| 835 | if (INTEGERP (value)) | 796 | /* This was copied from xfns.c */ |
| 836 | nlines = XINT (value); | ||
| 837 | else | ||
| 838 | nlines = 0; | ||
| 839 | 797 | ||
| 840 | FRAME_MENU_BAR_LINES (f) = nlines; | 798 | Lisp_Object Qbackground_color; |
| 841 | IT_set_menu_bar_lines (f->root_window, nlines - olines); | 799 | Lisp_Object Qforeground_color; |
| 842 | } | 800 | extern Lisp_Object Qtitle; |
| 843 | 801 | ||
| 844 | /* IT_set_terminal_modes is called when emacs is started, | 802 | /* IT_set_terminal_modes is called when emacs is started, |
| 845 | resumed, and whenever the screen is redrawn! */ | 803 | resumed, and whenever the screen is redrawn! */ |
| @@ -1010,9 +968,21 @@ IT_set_frame_parameters (f, alist) | |||
| 1010 | fprintf (termscript, "<BGCOLOR %lu>\n", new_color); | 968 | fprintf (termscript, "<BGCOLOR %lu>\n", new_color); |
| 1011 | } | 969 | } |
| 1012 | } | 970 | } |
| 1013 | else if (EQ (prop, intern ("menu-bar-lines"))) | 971 | else if (EQ (prop, Qtitle)) |
| 1014 | x_set_menu_bar_lines (f, val, 0); | 972 | { |
| 973 | x_set_title (f, val); | ||
| 974 | if (termscript) | ||
| 975 | fprintf (termscript, "<TITLE: %s>\n", XSTRING (val)->data); | ||
| 976 | } | ||
| 977 | else if (EQ (prop, intern ("reverse")) && EQ (val, Qt)) | ||
| 978 | { | ||
| 979 | unsigned long fg = FRAME_FOREGROUND_PIXEL (f); | ||
| 1015 | 980 | ||
| 981 | FRAME_FOREGROUND_PIXEL (f) = FRAME_BACKGROUND_PIXEL (f); | ||
| 982 | FRAME_BACKGROUND_PIXEL (f) = fg; | ||
| 983 | if (termscript) | ||
| 984 | fprintf (termscript, "<INVERSE-VIDEO>\n"); | ||
| 985 | } | ||
| 1016 | store_frame_param (f, prop, val); | 986 | store_frame_param (f, prop, val); |
| 1017 | 987 | ||
| 1018 | } | 988 | } |