From 947b2afddc9f54a999125aa7e8c9a705ecb51e18 Mon Sep 17 00:00:00 2001 From: Alp Aker Date: Wed, 1 Aug 2012 16:15:30 -0400 Subject: [PATCH] * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar) (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:) (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114) * nsfns.m (ns_set_name_as_filename): Likewise. * nsmenu.m (ns_update_menubar): Likewise. * nsselect.m (symbol_to_nsstring): Adjust to use SVAR. --- src/ChangeLog | 9 +++++++++ src/nsfns.m | 2 +- src/nsmenu.m | 2 +- src/nsselect.m | 2 +- src/nsterm.m | 26 +++++++++++++------------- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 14c785e682f..5558a5c7c52 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-08-01 Alp Aker + + * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar) + (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:) + (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114) + * nsfns.m (ns_set_name_as_filename): Likewise. + * nsmenu.m (ns_update_menubar): Likewise. + * nsselect.m (symbol_to_nsstring): Adjust to use SVAR. + 2012-08-01 Eli Zaretskii * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym): diff --git a/src/nsfns.m b/src/nsfns.m index 3de78c05c23..af839589d33 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -607,7 +607,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = XWINDOW (FVAR (f, selected_window))->buffer; + Lisp_Object buf = WVAR (XWINDOW (FVAR (f, selected_window)), buffer); const char *title; NSAutoreleasePool *pool; struct gcpro gcpro1; diff --git a/src/nsmenu.m b/src/nsmenu.m index 86ffeec2952..9f1a43a08f2 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -193,7 +193,7 @@ = alloca (previous_menu_items_used * sizeof *previous_items); /* lisp preliminaries */ - buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; + buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); specbind (Qinhibit_quit, Qt); specbind (Qdebug_on_next_call, Qnil); record_unwind_save_match_data (); diff --git a/src/nsselect.m b/src/nsselect.m index a4d91dae1f2..e8c3f85011b 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -62,7 +62,7 @@ Updated by Christian Limpach (chris@nice.ch) if (EQ (sym, QPRIMARY)) return NXPrimaryPboard; if (EQ (sym, QSECONDARY)) return NXSecondaryPboard; if (EQ (sym, QTEXT)) return NSStringPboardType; - return [NSString stringWithUTF8String: SSDATA (XSYMBOL (sym)->xname)]; + return [NSString stringWithUTF8String: SSDATA (SVAR (XSYMBOL (sym), xname))]; } static NSPasteboard * diff --git a/src/nsterm.m b/src/nsterm.m index f13ec2795ea..48a3b7543a8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3624,9 +3624,9 @@ We tell read_avail_input() that input is "expected" because we do expect EmacsScroller *bar; /* optimization; display engine sends WAY too many of these.. */ - if (!NILP (window->vertical_scroll_bar)) + if (!NILP (WVAR (window, vertical_scroll_bar))) { - bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); + bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); if ([bar checkSamePosition: position portion: portion whole: whole]) { if (view->scrollbarsNeedingUpdate == 0) @@ -3674,27 +3674,27 @@ We tell read_avail_input() that input is "expected" because we do expect /* we want at least 5 lines to display a scrollbar */ if (WINDOW_TOTAL_LINES (window) < 5) { - if (!NILP (window->vertical_scroll_bar)) + if (!NILP (WVAR (window, vertical_scroll_bar))) { - bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); + bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); [bar removeFromSuperview]; - window->vertical_scroll_bar = Qnil; + WVAR (window, vertical_scroll_bar) = Qnil; } ns_clear_frame_area (f, sb_left, top, width, height); UNBLOCK_INPUT; return; } - if (NILP (window->vertical_scroll_bar)) + if (NILP (WVAR (window, vertical_scroll_bar))) { ns_clear_frame_area (f, sb_left, top, width, height); bar = [[EmacsScroller alloc] initFrame: r window: win]; - window->vertical_scroll_bar = make_save_value (bar, 0); + WVAR (window, vertical_scroll_bar) = make_save_value (bar, 0); } else { NSRect oldRect; - bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); + bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); oldRect = [bar frame]; r.size.width = oldRect.size.width; if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) @@ -3741,9 +3741,9 @@ We tell read_avail_input() that input is "expected" because we do expect { id bar; NSTRACE (ns_redeem_scroll_bar); - if (!NILP (window->vertical_scroll_bar)) + if (!NILP (WVAR (window, vertical_scroll_bar))) { - bar =XNS_SCROLL_BAR (window->vertical_scroll_bar); + bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); [bar reprieve]; } } @@ -6064,7 +6064,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); struct buffer *curbuf - = XBUFFER (XWINDOW (FVAR (f, selected_window))->buffer); + = XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer)); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; @@ -6239,7 +6239,7 @@ + (CGFloat) scrollerWidth if (pixel_height == 0) pixel_height = 1; min_portion = 20 / pixel_height; - frame = XFRAME (XWINDOW (win)->frame); + frame = XFRAME (WVAR (XWINDOW (win), frame)); if (FRAME_LIVE_P (frame)) { int i; @@ -6278,7 +6278,7 @@ - (void)dealloc { NSTRACE (EmacsScroller_dealloc); if (!NILP (win)) - XWINDOW (win)->vertical_scroll_bar = Qnil; + WVAR (XWINDOW (win), vertical_scroll_bar) = Qnil; [super dealloc]; }