diff options
| author | Karl Heuer | 1995-07-17 22:12:45 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-07-17 22:12:45 +0000 |
| commit | 39d8bb4dcf6aca6d728b48d5af83a7e242fba3c5 (patch) | |
| tree | 2a450c7f5dac0a6f1115b67239d8fc023c86ee16 /src | |
| parent | 3c06d205922b5d07599a0ad906499a3833d6b04b (diff) | |
| download | emacs-39d8bb4dcf6aca6d728b48d5af83a7e242fba3c5.tar.gz emacs-39d8bb4dcf6aca6d728b48d5af83a7e242fba3c5.zip | |
[HAVE_X11XTR6]: Include locale.h
(x_term_init) [HAVE_X11XTR6]: Set LC_NUMERIC and LC_TIME back to C.
(note_mouse_movement): Set mouse_moved in the x_display_info.
(XTmouse_position, x_scroll_bar_note_movement): Likewise.
(x_scroll_bar_report_motion): Likewise.
(x_draw_box, x_display_box_cursor, x_display_bar_cursor):
New args x, y. Don't use curs_x or curs_y here. Callers changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 98 |
1 files changed, 58 insertions, 40 deletions
diff --git a/src/xterm.c b/src/xterm.c index d78bdd50071..3cd6c347886 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -100,6 +100,11 @@ extern void _XEditResCheckMessages (); | |||
| 100 | #endif | 100 | #endif |
| 101 | #endif | 101 | #endif |
| 102 | 102 | ||
| 103 | #ifdef HAVE_X11XTR6 | ||
| 104 | /* So we can do setlocale. */ | ||
| 105 | #include <locale.h> | ||
| 106 | #endif | ||
| 107 | |||
| 103 | #define min(a,b) ((a)<(b) ? (a) : (b)) | 108 | #define min(a,b) ((a)<(b) ? (a) : (b)) |
| 104 | #define max(a,b) ((a)>(b) ? (a) : (b)) | 109 | #define max(a,b) ((a)>(b) ? (a) : (b)) |
| 105 | 110 | ||
| @@ -1816,7 +1821,7 @@ note_mouse_movement (frame, event) | |||
| 1816 | 1821 | ||
| 1817 | if (event->window != FRAME_X_WINDOW (frame)) | 1822 | if (event->window != FRAME_X_WINDOW (frame)) |
| 1818 | { | 1823 | { |
| 1819 | mouse_moved = 1; | 1824 | frame->mouse_moved = 1; |
| 1820 | last_mouse_scroll_bar = Qnil; | 1825 | last_mouse_scroll_bar = Qnil; |
| 1821 | 1826 | ||
| 1822 | note_mouse_highlight (frame, -1, -1); | 1827 | note_mouse_highlight (frame, -1, -1); |
| @@ -1839,7 +1844,7 @@ note_mouse_movement (frame, event) | |||
| 1839 | || event->y < last_mouse_glyph.y | 1844 | || event->y < last_mouse_glyph.y |
| 1840 | || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) | 1845 | || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) |
| 1841 | { | 1846 | { |
| 1842 | mouse_moved = 1; | 1847 | frame->mouse_moved = 1; |
| 1843 | last_mouse_scroll_bar = Qnil; | 1848 | last_mouse_scroll_bar = Qnil; |
| 1844 | 1849 | ||
| 1845 | note_mouse_highlight (frame, event->x, event->y); | 1850 | note_mouse_highlight (frame, event->x, event->y); |
| @@ -2268,7 +2273,13 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) | |||
| 2268 | Window dummy_window; | 2273 | Window dummy_window; |
| 2269 | int dummy; | 2274 | int dummy; |
| 2270 | 2275 | ||
| 2271 | mouse_moved = 0; | 2276 | Lisp_Object frame, tail; |
| 2277 | |||
| 2278 | /* Clear the mouse-moved flag for every frame on this display. */ | ||
| 2279 | FOR_EACH_FRAME (tail, frame) | ||
| 2280 | if (FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp)) | ||
| 2281 | XFRAME (frame)->mouse_moved = 0; | ||
| 2282 | |||
| 2272 | last_mouse_scroll_bar = Qnil; | 2283 | last_mouse_scroll_bar = Qnil; |
| 2273 | 2284 | ||
| 2274 | /* Figure out which root window we're on. */ | 2285 | /* Figure out which root window we're on. */ |
| @@ -2955,9 +2966,11 @@ x_scroll_bar_note_movement (bar, event) | |||
| 2955 | struct scroll_bar *bar; | 2966 | struct scroll_bar *bar; |
| 2956 | XEvent *event; | 2967 | XEvent *event; |
| 2957 | { | 2968 | { |
| 2969 | FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); | ||
| 2970 | |||
| 2958 | last_mouse_movement_time = event->xmotion.time; | 2971 | last_mouse_movement_time = event->xmotion.time; |
| 2959 | 2972 | ||
| 2960 | mouse_moved = 1; | 2973 | f->mouse_moved = 1; |
| 2961 | XSETVECTOR (last_mouse_scroll_bar, bar); | 2974 | XSETVECTOR (last_mouse_scroll_bar, bar); |
| 2962 | 2975 | ||
| 2963 | /* If we're dragging the bar, display it. */ | 2976 | /* If we're dragging the bar, display it. */ |
| @@ -3053,7 +3066,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) | |||
| 3053 | XSETINT (*x, win_y); | 3066 | XSETINT (*x, win_y); |
| 3054 | XSETINT (*y, top_range); | 3067 | XSETINT (*y, top_range); |
| 3055 | 3068 | ||
| 3056 | mouse_moved = 0; | 3069 | f->mouse_moved = 0; |
| 3057 | last_mouse_scroll_bar = Qnil; | 3070 | last_mouse_scroll_bar = Qnil; |
| 3058 | } | 3071 | } |
| 3059 | 3072 | ||
| @@ -4069,14 +4082,16 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 4069 | /* Drawing the cursor. */ | 4082 | /* Drawing the cursor. */ |
| 4070 | 4083 | ||
| 4071 | 4084 | ||
| 4072 | /* Draw a hollow box cursor. Don't change the inside of the box. */ | 4085 | /* Draw a hollow box cursor on frame F at X, Y. |
| 4086 | Don't change the inside of the box. */ | ||
| 4073 | 4087 | ||
| 4074 | static void | 4088 | static void |
| 4075 | x_draw_box (f) | 4089 | x_draw_box (f, x, y) |
| 4076 | struct frame *f; | 4090 | struct frame *f; |
| 4091 | int x, y; | ||
| 4077 | { | 4092 | { |
| 4078 | int left = CHAR_TO_PIXEL_COL (f, curs_x); | 4093 | int left = CHAR_TO_PIXEL_COL (f, x); |
| 4079 | int top = CHAR_TO_PIXEL_ROW (f, curs_y); | 4094 | int top = CHAR_TO_PIXEL_ROW (f, y); |
| 4080 | int width = FONT_WIDTH (f->display.x->font); | 4095 | int width = FONT_WIDTH (f->display.x->font); |
| 4081 | int height = f->display.x->line_height; | 4096 | int height = f->display.x->line_height; |
| 4082 | 4097 | ||
| @@ -4122,15 +4137,16 @@ x_draw_single_glyph (f, row, column, glyph, highlight) | |||
| 4122 | } | 4137 | } |
| 4123 | 4138 | ||
| 4124 | static void | 4139 | static void |
| 4125 | x_display_bar_cursor (f, on) | 4140 | x_display_bar_cursor (f, on, x, y) |
| 4126 | struct frame *f; | 4141 | struct frame *f; |
| 4127 | int on; | 4142 | int on; |
| 4143 | int x, y; | ||
| 4128 | { | 4144 | { |
| 4129 | struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); | 4145 | struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); |
| 4130 | 4146 | ||
| 4131 | /* This is pointless on invisible frames, and dangerous on garbaged | 4147 | /* This is pointless on invisible frames, and dangerous on garbaged |
| 4132 | frames; in the latter case, the frame may be in the midst of | 4148 | frames; in the latter case, the frame may be in the midst of |
| 4133 | changing its size, and curs_x and curs_y may be off the frame. */ | 4149 | changing its size, and x and y may be off the frame. */ |
| 4134 | if (! FRAME_VISIBLE_P (f) || FRAME_GARBAGED_P (f)) | 4150 | if (! FRAME_VISIBLE_P (f) || FRAME_GARBAGED_P (f)) |
| 4135 | return; | 4151 | return; |
| 4136 | 4152 | ||
| @@ -4140,8 +4156,8 @@ x_display_bar_cursor (f, on) | |||
| 4140 | /* If there is anything wrong with the current cursor state, remove it. */ | 4156 | /* If there is anything wrong with the current cursor state, remove it. */ |
| 4141 | if (f->phys_cursor_x >= 0 | 4157 | if (f->phys_cursor_x >= 0 |
| 4142 | && (!on | 4158 | && (!on |
| 4143 | || f->phys_cursor_x != curs_x | 4159 | || f->phys_cursor_x != x |
| 4144 | || f->phys_cursor_y != curs_y | 4160 | || f->phys_cursor_y != y |
| 4145 | || f->display.x->current_cursor != bar_cursor)) | 4161 | || f->display.x->current_cursor != bar_cursor)) |
| 4146 | { | 4162 | { |
| 4147 | /* Erase the cursor by redrawing the character underneath it. */ | 4163 | /* Erase the cursor by redrawing the character underneath it. */ |
| @@ -4157,19 +4173,19 @@ x_display_bar_cursor (f, on) | |||
| 4157 | || (f->display.x->current_cursor != bar_cursor))) | 4173 | || (f->display.x->current_cursor != bar_cursor))) |
| 4158 | { | 4174 | { |
| 4159 | f->phys_cursor_glyph | 4175 | f->phys_cursor_glyph |
| 4160 | = ((current_glyphs->enable[curs_y] | 4176 | = ((current_glyphs->enable[y] |
| 4161 | && curs_x < current_glyphs->used[curs_y]) | 4177 | && x < current_glyphs->used[y]) |
| 4162 | ? current_glyphs->glyphs[curs_y][curs_x] | 4178 | ? current_glyphs->glyphs[y][x] |
| 4163 | : SPACEGLYPH); | 4179 | : SPACEGLYPH); |
| 4164 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 4180 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 4165 | f->display.x->cursor_gc, | 4181 | f->display.x->cursor_gc, |
| 4166 | CHAR_TO_PIXEL_COL (f, curs_x), | 4182 | CHAR_TO_PIXEL_COL (f, x), |
| 4167 | CHAR_TO_PIXEL_ROW (f, curs_y), | 4183 | CHAR_TO_PIXEL_ROW (f, y), |
| 4168 | max (f->display.x->cursor_width, 1), | 4184 | max (f->display.x->cursor_width, 1), |
| 4169 | f->display.x->line_height); | 4185 | f->display.x->line_height); |
| 4170 | 4186 | ||
| 4171 | f->phys_cursor_x = curs_x; | 4187 | f->phys_cursor_x = x; |
| 4172 | f->phys_cursor_y = curs_y; | 4188 | f->phys_cursor_y = y; |
| 4173 | 4189 | ||
| 4174 | f->display.x->current_cursor = bar_cursor; | 4190 | f->display.x->current_cursor = bar_cursor; |
| 4175 | } | 4191 | } |
| @@ -4180,19 +4196,19 @@ x_display_bar_cursor (f, on) | |||
| 4180 | 4196 | ||
| 4181 | 4197 | ||
| 4182 | /* Turn the displayed cursor of frame F on or off according to ON. | 4198 | /* Turn the displayed cursor of frame F on or off according to ON. |
| 4183 | If ON is nonzero, where to put the cursor is specified | 4199 | If ON is nonzero, where to put the cursor is specified by X and Y. */ |
| 4184 | by F->cursor_x and F->cursor_y. */ | ||
| 4185 | 4200 | ||
| 4186 | static void | 4201 | static void |
| 4187 | x_display_box_cursor (f, on) | 4202 | x_display_box_cursor (f, on, x, y) |
| 4188 | struct frame *f; | 4203 | struct frame *f; |
| 4189 | int on; | 4204 | int on; |
| 4205 | int x, y; | ||
| 4190 | { | 4206 | { |
| 4191 | struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); | 4207 | struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); |
| 4192 | 4208 | ||
| 4193 | /* This is pointless on invisible frames, and dangerous on garbaged | 4209 | /* This is pointless on invisible frames, and dangerous on garbaged |
| 4194 | frames; in the latter case, the frame may be in the midst of | 4210 | frames; in the latter case, the frame may be in the midst of |
| 4195 | changing its size, and curs_x and curs_y may be off the frame. */ | 4211 | changing its size, and x and y may be off the frame. */ |
| 4196 | if (! FRAME_VISIBLE_P (f) || FRAME_GARBAGED_P (f)) | 4212 | if (! FRAME_VISIBLE_P (f) || FRAME_GARBAGED_P (f)) |
| 4197 | return; | 4213 | return; |
| 4198 | 4214 | ||
| @@ -4206,8 +4222,8 @@ x_display_box_cursor (f, on) | |||
| 4206 | erase it. */ | 4222 | erase it. */ |
| 4207 | if (f->phys_cursor_x >= 0 | 4223 | if (f->phys_cursor_x >= 0 |
| 4208 | && (!on | 4224 | && (!on |
| 4209 | || f->phys_cursor_x != curs_x | 4225 | || f->phys_cursor_x != x |
| 4210 | || f->phys_cursor_y != curs_y | 4226 | || f->phys_cursor_y != y |
| 4211 | || (f->display.x->current_cursor != hollow_box_cursor | 4227 | || (f->display.x->current_cursor != hollow_box_cursor |
| 4212 | && (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)))) | 4228 | && (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)))) |
| 4213 | { | 4229 | { |
| @@ -4257,24 +4273,24 @@ x_display_box_cursor (f, on) | |||
| 4257 | && f == FRAME_X_DISPLAY_INFO (f)->x_highlight_frame))) | 4273 | && f == FRAME_X_DISPLAY_INFO (f)->x_highlight_frame))) |
| 4258 | { | 4274 | { |
| 4259 | f->phys_cursor_glyph | 4275 | f->phys_cursor_glyph |
| 4260 | = ((current_glyphs->enable[curs_y] | 4276 | = ((current_glyphs->enable[y] |
| 4261 | && curs_x < current_glyphs->used[curs_y]) | 4277 | && x < current_glyphs->used[y]) |
| 4262 | ? current_glyphs->glyphs[curs_y][curs_x] | 4278 | ? current_glyphs->glyphs[y][x] |
| 4263 | : SPACEGLYPH); | 4279 | : SPACEGLYPH); |
| 4264 | if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) | 4280 | if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) |
| 4265 | { | 4281 | { |
| 4266 | x_draw_box (f); | 4282 | x_draw_box (f, x, y); |
| 4267 | f->display.x->current_cursor = hollow_box_cursor; | 4283 | f->display.x->current_cursor = hollow_box_cursor; |
| 4268 | } | 4284 | } |
| 4269 | else | 4285 | else |
| 4270 | { | 4286 | { |
| 4271 | x_draw_single_glyph (f, curs_y, curs_x, | 4287 | x_draw_single_glyph (f, y, x, |
| 4272 | f->phys_cursor_glyph, 2); | 4288 | f->phys_cursor_glyph, 2); |
| 4273 | f->display.x->current_cursor = filled_box_cursor; | 4289 | f->display.x->current_cursor = filled_box_cursor; |
| 4274 | } | 4290 | } |
| 4275 | 4291 | ||
| 4276 | f->phys_cursor_x = curs_x; | 4292 | f->phys_cursor_x = x; |
| 4277 | f->phys_cursor_y = curs_y; | 4293 | f->phys_cursor_y = y; |
| 4278 | } | 4294 | } |
| 4279 | 4295 | ||
| 4280 | if (updating_frame != f) | 4296 | if (updating_frame != f) |
| @@ -4302,9 +4318,9 @@ x_display_cursor (f, on) | |||
| 4302 | } | 4318 | } |
| 4303 | 4319 | ||
| 4304 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) | 4320 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
| 4305 | x_display_box_cursor (f, on); | 4321 | x_display_box_cursor (f, on, curs_x, curs_y); |
| 4306 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) | 4322 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |
| 4307 | x_display_bar_cursor (f, on); | 4323 | x_display_bar_cursor (f, on, curs_x, curs_y); |
| 4308 | else | 4324 | else |
| 4309 | /* Those are the only two we have implemented! */ | 4325 | /* Those are the only two we have implemented! */ |
| 4310 | abort (); | 4326 | abort (); |
| @@ -4321,13 +4337,10 @@ x_update_cursor (f, on) | |||
| 4321 | { | 4337 | { |
| 4322 | BLOCK_INPUT; | 4338 | BLOCK_INPUT; |
| 4323 | 4339 | ||
| 4324 | curs_x = f->phys_cursor_x; | ||
| 4325 | curs_y = f->phys_cursor_y; | ||
| 4326 | |||
| 4327 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) | 4340 | if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
| 4328 | x_display_box_cursor (f, on); | 4341 | x_display_box_cursor (f, on, f->phys_cursor_x, f->phys_cursor_y); |
| 4329 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) | 4342 | else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |
| 4330 | x_display_bar_cursor (f, on); | 4343 | x_display_bar_cursor (f, on, f->phys_cursor_x, f->phys_cursor_y); |
| 4331 | else | 4344 | else |
| 4332 | /* Those are the only two we have implemented! */ | 4345 | /* Those are the only two we have implemented! */ |
| 4333 | abort (); | 4346 | abort (); |
| @@ -5750,6 +5763,11 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 5750 | resource_name, EMACS_CLASS, | 5763 | resource_name, EMACS_CLASS, |
| 5751 | emacs_options, XtNumber (emacs_options), | 5764 | emacs_options, XtNumber (emacs_options), |
| 5752 | &argc, argv); | 5765 | &argc, argv); |
| 5766 | |||
| 5767 | #ifdef HAVE_X11XTR6 | ||
| 5768 | setlocale (LC_NUMERIC, "C"); | ||
| 5769 | setlocale (LC_TIME, "C"); | ||
| 5770 | #endif | ||
| 5753 | } | 5771 | } |
| 5754 | 5772 | ||
| 5755 | #else /* not USE_X_TOOLKIT */ | 5773 | #else /* not USE_X_TOOLKIT */ |