diff options
| author | Dmitry Antipov | 2012-08-06 14:24:26 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-08-06 14:24:26 +0400 |
| commit | 077288cf3f654776ee44bc9b56954c4e26b10d96 (patch) | |
| tree | 00bbcb4dab9c879efde73a01786977b1c1364f67 /src/xterm.c | |
| parent | 71688bd7f9169c12ea8be54e084470f19d44ce44 (diff) | |
| download | emacs-077288cf3f654776ee44bc9b56954c4e26b10d96.tar.gz emacs-077288cf3f654776ee44bc9b56954c4e26b10d96.zip | |
Separate read and write access to Lisp_Object slots of struct window.
* window.h (WGET, WSET): New macros similar to AREF and ASET.
* alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
* fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
* insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
* nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
* w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
Adjust users.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/xterm.c b/src/xterm.c index ea74c2c86b6..771b68e1be0 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -628,7 +628,7 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1) | |||
| 628 | static void | 628 | static void |
| 629 | x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) | 629 | x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) |
| 630 | { | 630 | { |
| 631 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); | 631 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); |
| 632 | 632 | ||
| 633 | if (!w->pseudo_window_p) | 633 | if (!w->pseudo_window_p) |
| 634 | { | 634 | { |
| @@ -728,7 +728,7 @@ x_after_update_window_line (struct glyph_row *desired_row) | |||
| 728 | overhead is very small. */ | 728 | overhead is very small. */ |
| 729 | if (windows_or_buffers_changed | 729 | if (windows_or_buffers_changed |
| 730 | && desired_row->full_width_p | 730 | && desired_row->full_width_p |
| 731 | && (f = XFRAME (WVAR (w, frame)), | 731 | && (f = XFRAME (WGET (w, frame)), |
| 732 | width = FRAME_INTERNAL_BORDER_WIDTH (f), | 732 | width = FRAME_INTERNAL_BORDER_WIDTH (f), |
| 733 | width != 0) | 733 | width != 0) |
| 734 | && (height = desired_row->visible_height, | 734 | && (height = desired_row->visible_height, |
| @@ -3295,7 +3295,7 @@ x_ins_del_lines (struct frame *f, int vpos, int n) | |||
| 3295 | static void | 3295 | static void |
| 3296 | x_scroll_run (struct window *w, struct run *run) | 3296 | x_scroll_run (struct window *w, struct run *run) |
| 3297 | { | 3297 | { |
| 3298 | struct frame *f = XFRAME (WVAR (w, frame)); | 3298 | struct frame *f = XFRAME (WGET (w, frame)); |
| 3299 | int x, y, width, height, from_y, to_y, bottom_y; | 3299 | int x, y, width, height, from_y, to_y, bottom_y; |
| 3300 | 3300 | ||
| 3301 | /* Get frame-relative bounding box of the text display area of W, | 3301 | /* Get frame-relative bounding box of the text display area of W, |
| @@ -4244,9 +4244,9 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name, | |||
| 4244 | scroll_bar_end_scroll, 0, 0); | 4244 | scroll_bar_end_scroll, 0, 0); |
| 4245 | w = XWINDOW (window_being_scrolled); | 4245 | w = XWINDOW (window_being_scrolled); |
| 4246 | 4246 | ||
| 4247 | if (!NILP (XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging)) | 4247 | if (!NILP (XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging)) |
| 4248 | { | 4248 | { |
| 4249 | XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging = Qnil; | 4249 | XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging = Qnil; |
| 4250 | /* The thumb size is incorrect while dragging: fix it. */ | 4250 | /* The thumb size is incorrect while dragging: fix it. */ |
| 4251 | set_vertical_scroll_bar (w); | 4251 | set_vertical_scroll_bar (w); |
| 4252 | } | 4252 | } |
| @@ -4277,7 +4277,7 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole) | |||
| 4277 | XEvent event; | 4277 | XEvent event; |
| 4278 | XClientMessageEvent *ev = (XClientMessageEvent *) &event; | 4278 | XClientMessageEvent *ev = (XClientMessageEvent *) &event; |
| 4279 | struct window *w = XWINDOW (window); | 4279 | struct window *w = XWINDOW (window); |
| 4280 | struct frame *f = XFRAME (WVAR (w, frame)); | 4280 | struct frame *f = XFRAME (WGET (w, frame)); |
| 4281 | ptrdiff_t i; | 4281 | ptrdiff_t i; |
| 4282 | 4282 | ||
| 4283 | BLOCK_INPUT; | 4283 | BLOCK_INPUT; |
| @@ -4353,7 +4353,7 @@ x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent) | |||
| 4353 | ievent->timestamp = CurrentTime; | 4353 | ievent->timestamp = CurrentTime; |
| 4354 | #else | 4354 | #else |
| 4355 | ievent->timestamp = | 4355 | ievent->timestamp = |
| 4356 | XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WVAR (w, frame)))); | 4356 | XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WGET (w, frame)))); |
| 4357 | #endif | 4357 | #endif |
| 4358 | ievent->part = ev->data.l[1]; | 4358 | ievent->part = ev->data.l[1]; |
| 4359 | ievent->code = ev->data.l[2]; | 4359 | ievent->code = ev->data.l[2]; |
| @@ -4954,7 +4954,7 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio | |||
| 4954 | static struct scroll_bar * | 4954 | static struct scroll_bar * |
| 4955 | x_scroll_bar_create (struct window *w, int top, int left, int width, int height) | 4955 | x_scroll_bar_create (struct window *w, int top, int left, int width, int height) |
| 4956 | { | 4956 | { |
| 4957 | struct frame *f = XFRAME (WVAR (w, frame)); | 4957 | struct frame *f = XFRAME (WGET (w, frame)); |
| 4958 | struct scroll_bar *bar | 4958 | struct scroll_bar *bar |
| 4959 | = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); | 4959 | = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); |
| 4960 | Lisp_Object barobj; | 4960 | Lisp_Object barobj; |
| @@ -5182,7 +5182,7 @@ x_scroll_bar_remove (struct scroll_bar *bar) | |||
| 5182 | #endif | 5182 | #endif |
| 5183 | 5183 | ||
| 5184 | /* Dissociate this scroll bar from its window. */ | 5184 | /* Dissociate this scroll bar from its window. */ |
| 5185 | WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; | 5185 | WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil); |
| 5186 | 5186 | ||
| 5187 | UNBLOCK_INPUT; | 5187 | UNBLOCK_INPUT; |
| 5188 | } | 5188 | } |
| @@ -5196,7 +5196,8 @@ x_scroll_bar_remove (struct scroll_bar *bar) | |||
| 5196 | static void | 5196 | static void |
| 5197 | XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) | 5197 | XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) |
| 5198 | { | 5198 | { |
| 5199 | struct frame *f = XFRAME (WVAR (w, frame)); | 5199 | struct frame *f = XFRAME (WGET (w, frame)); |
| 5200 | Lisp_Object barobj; | ||
| 5200 | struct scroll_bar *bar; | 5201 | struct scroll_bar *bar; |
| 5201 | int top, height, left, sb_left, width, sb_width; | 5202 | int top, height, left, sb_left, width, sb_width; |
| 5202 | int window_y, window_height; | 5203 | int window_y, window_height; |
| @@ -5247,7 +5248,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio | |||
| 5247 | #endif | 5248 | #endif |
| 5248 | 5249 | ||
| 5249 | /* Does the scroll bar exist yet? */ | 5250 | /* Does the scroll bar exist yet? */ |
| 5250 | if (NILP (WVAR (w, vertical_scroll_bar))) | 5251 | if (NILP (WGET (w, vertical_scroll_bar))) |
| 5251 | { | 5252 | { |
| 5252 | if (width > 0 && height > 0) | 5253 | if (width > 0 && height > 0) |
| 5253 | { | 5254 | { |
| @@ -5270,7 +5271,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio | |||
| 5270 | /* It may just need to be moved and resized. */ | 5271 | /* It may just need to be moved and resized. */ |
| 5271 | unsigned int mask = 0; | 5272 | unsigned int mask = 0; |
| 5272 | 5273 | ||
| 5273 | bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); | 5274 | bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); |
| 5274 | 5275 | ||
| 5275 | BLOCK_INPUT; | 5276 | BLOCK_INPUT; |
| 5276 | 5277 | ||
| @@ -5394,7 +5395,8 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio | |||
| 5394 | } | 5395 | } |
| 5395 | #endif /* not USE_TOOLKIT_SCROLL_BARS */ | 5396 | #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
| 5396 | 5397 | ||
| 5397 | XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); | 5398 | XSETVECTOR (barobj, bar); |
| 5399 | WSET (w, vertical_scroll_bar, barobj); | ||
| 5398 | } | 5400 | } |
| 5399 | 5401 | ||
| 5400 | 5402 | ||
| @@ -5439,10 +5441,10 @@ XTredeem_scroll_bar (struct window *window) | |||
| 5439 | Lisp_Object barobj; | 5441 | Lisp_Object barobj; |
| 5440 | 5442 | ||
| 5441 | /* We can't redeem this window's scroll bar if it doesn't have one. */ | 5443 | /* We can't redeem this window's scroll bar if it doesn't have one. */ |
| 5442 | if (NILP (WVAR (window, vertical_scroll_bar))) | 5444 | if (NILP (WGET (window, vertical_scroll_bar))) |
| 5443 | abort (); | 5445 | abort (); |
| 5444 | 5446 | ||
| 5445 | bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); | 5447 | bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); |
| 5446 | 5448 | ||
| 5447 | /* Unlink it from the condemned list. */ | 5449 | /* Unlink it from the condemned list. */ |
| 5448 | f = XFRAME (WINDOW_FRAME (window)); | 5450 | f = XFRAME (WINDOW_FRAME (window)); |
| @@ -5450,11 +5452,11 @@ XTredeem_scroll_bar (struct window *window) | |||
| 5450 | { | 5452 | { |
| 5451 | /* If the prev pointer is nil, it must be the first in one of | 5453 | /* If the prev pointer is nil, it must be the first in one of |
| 5452 | the lists. */ | 5454 | the lists. */ |
| 5453 | if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) | 5455 | if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) |
| 5454 | /* It's not condemned. Everything's fine. */ | 5456 | /* It's not condemned. Everything's fine. */ |
| 5455 | return; | 5457 | return; |
| 5456 | else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), | 5458 | else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), |
| 5457 | WVAR (window, vertical_scroll_bar))) | 5459 | WGET (window, vertical_scroll_bar))) |
| 5458 | FSET (f, condemned_scroll_bars, bar->next); | 5460 | FSET (f, condemned_scroll_bars, bar->next); |
| 5459 | else | 5461 | else |
| 5460 | /* If its prev pointer is nil, it must be at the front of | 5462 | /* If its prev pointer is nil, it must be at the front of |
| @@ -5614,7 +5616,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_e | |||
| 5614 | static void | 5616 | static void |
| 5615 | x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) | 5617 | x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) |
| 5616 | { | 5618 | { |
| 5617 | FRAME_PTR f = XFRAME (WVAR (XWINDOW (bar->window), frame)); | 5619 | FRAME_PTR f = XFRAME (WGET (XWINDOW (bar->window), frame)); |
| 5618 | 5620 | ||
| 5619 | last_mouse_movement_time = event->xmotion.time; | 5621 | last_mouse_movement_time = event->xmotion.time; |
| 5620 | 5622 | ||
| @@ -6788,8 +6790,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6788 | create event iff we don't leave the | 6790 | create event iff we don't leave the |
| 6789 | selected frame. */ | 6791 | selected frame. */ |
| 6790 | && (focus_follows_mouse | 6792 | && (focus_follows_mouse |
| 6791 | || (EQ (WVAR (XWINDOW (window), frame), | 6793 | || (EQ (WGET (XWINDOW (window), frame), |
| 6792 | WVAR (XWINDOW (selected_window), frame))))) | 6794 | WGET (XWINDOW (selected_window), frame))))) |
| 6793 | { | 6795 | { |
| 6794 | inev.ie.kind = SELECT_WINDOW_EVENT; | 6796 | inev.ie.kind = SELECT_WINDOW_EVENT; |
| 6795 | inev.ie.frame_or_window = window; | 6797 | inev.ie.frame_or_window = window; |
| @@ -7338,7 +7340,7 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row) | |||
| 7338 | static void | 7340 | static void |
| 7339 | x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) | 7341 | x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) |
| 7340 | { | 7342 | { |
| 7341 | struct frame *f = XFRAME (WVAR (w, frame)); | 7343 | struct frame *f = XFRAME (WGET (w, frame)); |
| 7342 | struct glyph *cursor_glyph; | 7344 | struct glyph *cursor_glyph; |
| 7343 | 7345 | ||
| 7344 | /* If cursor is out of bounds, don't draw garbage. This can happen | 7346 | /* If cursor is out of bounds, don't draw garbage. This can happen |