From: Jan Djärv Date: Tue, 31 Jul 2012 15:15:29 +0000 (+0200) Subject: * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. X-Git-Tag: emacs-24.2.90~959 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f1310128a0fc933830436ceb51bd6293d14d3f25;p=emacs.git * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. --- diff --git a/src/ChangeLog b/src/ChangeLog index ed398888285..95de49dea14 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-07-31 Jan Djärv + + * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. + 2012-07-31 Dmitry Antipov Generalize INTERNAL_FIELD between buffers, keyboards and frames. diff --git a/src/nsfns.m b/src/nsfns.m index 420121a8215..3de78c05c23 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -448,16 +448,16 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) return; - f->icon_name = arg; + FVAR (f, icon_name) = arg; if (NILP (arg)) { - if (!NILP (f->title)) - arg = f->title; + if (!NILP (FVAR (f, title))) + arg = FVAR (f, title); else /* explicit name and no icon-name -> explicit_name */ if (f->explicit_name) - arg = f->name; + arg = FVAR (f, name); else { /* no explicit name and no icon-name -> @@ -496,10 +496,10 @@ ns_set_name_internal (FRAME_PTR f, Lisp_Object name) if (! [[[view window] title] isEqualToString: str]) [[view window] setTitle: str]; - if (!STRINGP (f->icon_name)) + if (!STRINGP (FVAR (f, icon_name))) encoded_icon_name = encoded_name; else - encoded_icon_name = ENCODE_UTF_8 (f->icon_name); + encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name)); str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)]; @@ -537,14 +537,14 @@ ns_set_name (struct frame *f, Lisp_Object name, int explicit) CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, f->name))) + if (! NILP (Fstring_equal (name, FVAR (f, name)))) return; - f->name = name; + FVAR (f, name) = name; /* title overrides explicit name */ - if (! NILP (f->title)) - name = f->title; + if (! NILP (FVAR (f, title))) + name = FVAR (f, title); ns_set_name_internal (f, name); } @@ -594,7 +594,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) FVAR (f, title) = name; if (NILP (name)) - name = f->name; + name = FVAR (f, name); else CHECK_STRING (name); @@ -607,7 +607,7 @@ ns_set_name_as_filename (struct frame *f) { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = XWINDOW (f->selected_window)->buffer; + Lisp_Object buf = XWINDOW (FVAR (f, selected_window))->buffer; const char *title; NSAutoreleasePool *pool; struct gcpro gcpro1; @@ -615,7 +615,7 @@ ns_set_name_as_filename (struct frame *f) NSString *str; NSTRACE (ns_set_name_as_filename); - if (f->explicit_name || ! NILP (f->title) || ns_in_resize) + if (f->explicit_name || ! NILP (FVAR (f, title)) || ns_in_resize) return; BLOCK_INPUT; @@ -677,7 +677,7 @@ ns_set_name_as_filename (struct frame *f) [[view window] setRepresentedFilename: fstr]; [[view window] setTitle: str]; - f->name = name; + FVAR (f, name) = name; } [pool release]; @@ -690,7 +690,7 @@ ns_set_doc_edited (struct frame *f, Lisp_Object arg) { NSView *view = FRAME_NS_VIEW (f); NSAutoreleasePool *pool; - if (!MINI_WINDOW_P (XWINDOW (f->selected_window))) + if (!MINI_WINDOW_P (XWINDOW (FVAR (f, selected_window)))) { BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; @@ -777,7 +777,7 @@ ns_implicitly_set_icon_type (struct frame *f) BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; if (f->output_data.ns->miniimage - && [[NSString stringWithUTF8String: SSDATA (f->name)] + && [[NSString stringWithUTF8String: SSDATA (FVAR (f, name))] isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) { [pool release]; @@ -785,7 +785,7 @@ ns_implicitly_set_icon_type (struct frame *f) return; } - tem = assq_no_quit (Qicon_type, f->param_alist); + tem = assq_no_quit (Qicon_type, FVAR (f, param_alist)); if (CONSP (tem) && ! NILP (XCDR (tem))) { [pool release]; @@ -799,17 +799,17 @@ ns_implicitly_set_icon_type (struct frame *f) { elt = XCAR (chain); /* special case: 't' means go by file type */ - if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (f->name)[0] == '/') + if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (FVAR (f, name))[0] == '/') { NSString *str - = [NSString stringWithUTF8String: SSDATA (f->name)]; + = [NSString stringWithUTF8String: SSDATA (FVAR (f, name))]; if ([[NSFileManager defaultManager] fileExistsAtPath: str]) image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; } else if (CONSP (elt) && STRINGP (XCAR (elt)) && STRINGP (XCDR (elt)) && - fast_string_match (XCAR (elt), f->name) >= 0) + fast_string_match (XCAR (elt), FVAR (f, name)) >= 0) { image = [EmacsImage allocInitFromFile: XCDR (elt)]; if (image == nil) @@ -1205,10 +1205,11 @@ This function is an internal primitive--use `make-frame' instead. */) FRAME_FONTSET (f) = -1; - f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", + FVAR (f, icon_name) = x_get_arg (dpyinfo, parms, Qicon_name, + "iconName", "Title", RES_TYPE_STRING); - if (! STRINGP (f->icon_name)) - f->icon_name = Qnil; + if (! STRINGP (FVAR (f, icon_name))) + FVAR (f, icon_name) = Qnil; FRAME_NS_DISPLAY_INFO (f) = dpyinfo; @@ -1231,12 +1232,12 @@ This function is an internal primitive--use `make-frame' instead. */) be set. */ if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name)) { - f->name = build_string ([ns_app_name UTF8String]); + FVAR (f, name) = build_string ([ns_app_name UTF8String]); f->explicit_name = 0; } else { - f->name = name; + FVAR (f, name) = name; f->explicit_name = 1; specbind (Qx_resource_name, name); } @@ -1397,7 +1398,7 @@ This function is an internal primitive--use `make-frame' instead. */) by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - f->param_alist = Fcons (XCAR (tem), f->param_alist); + FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); UNGCPRO; diff --git a/src/nsmenu.m b/src/nsmenu.m index d5b5f4b7526..61c4bd1e893 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -222,13 +222,13 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) /* Save the frame's previous menu bar contents data */ if (previous_menu_items_used) - memcpy (previous_items, &AREF (f->menu_bar_vector, 0), + memcpy (previous_items, &AREF (FVAR (f, menu_bar_vector), 0), previous_menu_items_used * sizeof (Lisp_Object)); /* parse stage 1: extract from lisp */ save_menu_items (); - menu_items = f->menu_bar_vector; + menu_items = FVAR (f, menu_bar_vector); menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; submenu_start = alloca (ASIZE (items) * sizeof *submenu_start); submenu_end = alloca (ASIZE (items) * sizeof *submenu_end); @@ -341,7 +341,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) } /* The menu items are different, so store them in the frame */ /* FIXME: this is not correct for single-submenu case */ - f->menu_bar_vector = menu_items; + FVAR (f, menu_bar_vector) = menu_items; f->menu_bar_items_used = menu_items_used; /* Calls restore_menu_items, etc., as they were outside */ @@ -1041,7 +1041,7 @@ update_frame_tool_bar (FRAME_PTR f) /* update EmacsToolbar as in GtkUtils, build items list */ for (i = 0; i < f->n_tool_bar_items; ++i) { -#define TOOLPROP(IDX) AREF (f->tool_bar_items, \ +#define TOOLPROP(IDX) AREF (FVAR (f, tool_bar_items), \ i * TOOL_BAR_ITEM_NSLOTS + (IDX)) BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); diff --git a/src/nsterm.m b/src/nsterm.m index 5681dc2e1c8..c1d889a94db 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1306,7 +1306,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows) FRAME_PIXEL_HEIGHT (f) = pixelheight; /* SET_FRAME_GARBAGED (f); // this short-circuits expose call in drawRect */ - mark_window_cursors_off (XWINDOW (f->root_window)); + mark_window_cursors_off (XWINDOW (FVAR (f, root_window))); cancel_mouse_face (f); UNBLOCK_INPUT; @@ -5535,7 +5535,7 @@ ns_term_shutdown (int sig) if (ns_drag_types) [self registerForDraggedTypes: ns_drag_types]; - tem = f->name; + tem = FVAR (f, name); name = [NSString stringWithUTF8String: NILP (tem) ? "Emacs" : SSDATA (tem)]; [win setTitle: name]; @@ -5553,7 +5553,7 @@ ns_term_shutdown (int sig) #endif FRAME_TOOLBAR_HEIGHT (f) = 0; - tem = f->icon_name; + tem = FVAR (f, icon_name); if (!NILP (tem)) [win setMiniwindowTitle: [NSString stringWithUTF8String: SSDATA (tem)]]; @@ -5734,7 +5734,7 @@ ns_term_shutdown (int sig) { NSInteger tag = [sender tag]; find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used, - emacsframe->menu_bar_vector, + FVAR (emacsframe, menu_bar_vector), (void *)tag); } @@ -5768,7 +5768,7 @@ ns_term_shutdown (int sig) emacs_event->kind = TOOL_BAR_EVENT; /* XSETINT (emacs_event->code, 0); */ - emacs_event->arg = AREF (emacsframe->tool_bar_items, + emacs_event->arg = AREF (FVAR (emacsframe, tool_bar_items), idx + TOOL_BAR_ITEM_KEY); emacs_event->modifiers = EV_MODIFIERS (theEvent); EV_TRAILER (theEvent); @@ -6056,7 +6056,8 @@ ns_term_shutdown (int sig) { Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); - struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->buffer); + struct buffer *curbuf + = XBUFFER (XWINDOW (FVAR (f, selected_window))->buffer); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole;