* frame.h (FGET, FSET): New macros similar to AREF and ASET.
* buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
* fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
* print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
* xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
+2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Separate read and write access to Lisp_Object slots of struct frame.
+ * frame.h (FGET, FSET): New macros similar to AREF and ASET.
+ * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
+ * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
+ * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
+ * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
+
2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
* emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
Lisp_Object args[3];
CHECK_FRAME (frame);
- framelist = Fcopy_sequence (FVAR (XFRAME (frame), buffer_list));
+ framelist = Fcopy_sequence (FGET (XFRAME (frame), buffer_list));
prevlist = Fnreverse (Fcopy_sequence
- (FVAR (XFRAME (frame), buried_buffer_list)));
+ (FGET (XFRAME (frame), buried_buffer_list)));
/* Remove from GENERAL any buffer that duplicates one in
FRAMELIST or PREVLIST. */
pred = frame_buffer_predicate (frame);
/* Consider buffers that have been seen in the frame first. */
- tail = FVAR (XFRAME (frame), buffer_list);
+ tail = FGET (XFRAME (frame), buffer_list);
for (; CONSP (tail); tail = XCDR (tail))
{
buf = XCAR (tail);
Vinhibit_quit = tem;
/* Update buffer list of selected frame. */
- FVAR (f, buffer_list) = Fcons (buffer, Fdelq (buffer, FVAR (f, buffer_list)));
- FVAR (f, buried_buffer_list) = Fdelq (buffer, FVAR (f, buried_buffer_list));
+ FSET (f, buffer_list, Fcons (buffer, Fdelq (buffer, FGET (f, buffer_list))));
+ FSET (f, buried_buffer_list, Fdelq (buffer, FGET (f, buried_buffer_list)));
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
Vinhibit_quit = tem;
/* Update buffer lists of selected frame. */
- FVAR (f, buffer_list) = Fdelq (buffer, FVAR (f, buffer_list));
- FVAR (f, buried_buffer_list)
- = Fcons (buffer, Fdelq (buffer, FVAR (f, buried_buffer_list)));
+ FSET (f, buffer_list, Fdelq (buffer, FGET (f, buffer_list)));
+ FSET (f, buried_buffer_list,
+ Fcons (buffer, Fdelq (buffer, FGET (f, buried_buffer_list))));
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
XSETSYMBOL (var, symbol);
if (blv->frame_local)
{
- tem1 = assq_no_quit (var, FVAR (XFRAME (selected_frame), param_alist));
+ tem1 = assq_no_quit (var, FGET (XFRAME (selected_frame),
+ param_alist));
blv->where = selected_frame;
}
else
XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
tem1 = Fassq (symbol,
(blv->frame_local
- ? FVAR (XFRAME (where), param_alist)
+ ? FGET (XFRAME (where), param_alist)
: BVAR (XBUFFER (where), local_var_alist)));
blv->where = where;
blv->found = 1;
/* Clear the matrix of the menu bar window, if such a window exists.
The menu bar window is currently used to display menus on X when
no toolkit support is compiled in. */
- if (WINDOWP (FVAR (f, menu_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix);
+ if (WINDOWP (FGET (f, menu_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->current_matrix);
/* Clear the matrix of the tool-bar window, if any. */
- if (WINDOWP (FVAR (f, tool_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix);
+ if (WINDOWP (FGET (f, tool_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix);
/* Clear current window matrices. */
eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
if (f->desired_matrix)
clear_glyph_matrix (f->desired_matrix);
- if (WINDOWP (FVAR (f, menu_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->desired_matrix);
+ if (WINDOWP (FGET (f, menu_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->desired_matrix);
- if (WINDOWP (FVAR (f, tool_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->desired_matrix);
+ if (WINDOWP (FGET (f, tool_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->desired_matrix);
/* Do it for window matrices. */
eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
adjust_frame_glyphs_initially (void)
{
struct frame *sf = SELECTED_FRAME ();
- struct window *root = XWINDOW (FVAR (sf, root_window));
+ struct window *root = XWINDOW (FGET (sf, root_window));
struct window *mini = XWINDOW (WVAR (root, next));
int frame_lines = FRAME_LINES (sf);
int frame_cols = FRAME_COLS (sf);
{
/* Allocate a dummy window if not already done. */
struct window *w;
- if (NILP (FVAR (f, menu_bar_window)))
+ if (NILP (FGET (f, menu_bar_window)))
{
- FVAR (f, menu_bar_window) = make_window ();
- w = XWINDOW (FVAR (f, menu_bar_window));
+ FSET (f, menu_bar_window, make_window ());
+ w = XWINDOW (FGET (f, menu_bar_window));
XSETFRAME (WVAR (w, frame), f);
w->pseudo_window_p = 1;
}
else
- w = XWINDOW (FVAR (f, menu_bar_window));
+ w = XWINDOW (FGET (f, menu_bar_window));
/* Set window dimensions to frame dimensions and allocate or
adjust glyph matrices of W. */
/* Allocate/ reallocate matrices of the tool bar window. If we
don't have a tool bar window yet, make one. */
struct window *w;
- if (NILP (FVAR (f, tool_bar_window)))
+ if (NILP (FGET (f, tool_bar_window)))
{
- FVAR (f, tool_bar_window) = make_window ();
- w = XWINDOW (FVAR (f, tool_bar_window));
+ FSET (f, tool_bar_window, make_window ());
+ w = XWINDOW (FGET (f, tool_bar_window));
XSETFRAME (WVAR (w, frame), f);
w->pseudo_window_p = 1;
}
else
- w = XWINDOW (FVAR (f, tool_bar_window));
+ w = XWINDOW (FGET (f, tool_bar_window));
XSETFASTINT (WVAR (w, top_line), FRAME_MENU_BAR_LINES (f));
XSETFASTINT (WVAR (w, left_col), 0);
f->glyphs_initialized_p = 0;
/* Release window sub-matrices. */
- if (!NILP (FVAR (f, root_window)))
- free_window_matrices (XWINDOW (FVAR (f, root_window)));
+ if (!NILP (FGET (f, root_window)))
+ free_window_matrices (XWINDOW (FGET (f, root_window)));
/* Free the dummy window for menu bars without X toolkit and its
glyph matrices. */
- if (!NILP (FVAR (f, menu_bar_window)))
+ if (!NILP (FGET (f, menu_bar_window)))
{
- struct window *w = XWINDOW (FVAR (f, menu_bar_window));
+ struct window *w = XWINDOW (FGET (f, menu_bar_window));
free_glyph_matrix (w->desired_matrix);
free_glyph_matrix (w->current_matrix);
w->desired_matrix = w->current_matrix = NULL;
- FVAR (f, menu_bar_window) = Qnil;
+ FSET (f, menu_bar_window, Qnil);
}
/* Free the tool bar window and its glyph matrices. */
- if (!NILP (FVAR (f, tool_bar_window)))
+ if (!NILP (FGET (f, tool_bar_window)))
{
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (FGET (f, tool_bar_window));
free_glyph_matrix (w->desired_matrix);
free_glyph_matrix (w->current_matrix);
w->desired_matrix = w->current_matrix = NULL;
- FVAR (f, tool_bar_window) = Qnil;
+ FSET (f, tool_bar_window, Qnil);
}
/* Release frame glyph matrices. Reset fields to zero in
/* If we are called on frame matrices, perform analogous operations
for window matrices. */
if (frame_matrix_frame)
- mirror_make_current (XWINDOW (FVAR (frame_matrix_frame, root_window)), row);
+ mirror_make_current (XWINDOW (FGET (frame_matrix_frame, root_window)), row);
}
/* Do the same for window matrices, if MATRIX is a frame matrix. */
if (frame_matrix_frame)
- mirror_line_dance (XWINDOW (FVAR (frame_matrix_frame, root_window)),
+ mirror_line_dance (XWINDOW (FGET (frame_matrix_frame, root_window)),
unchanged_at_top, nlines, copy_from, retained_p);
}
{
/* 1 means display has been paused because of pending input. */
int paused_p;
- struct window *root_window = XWINDOW (FVAR (f, root_window));
+ struct window *root_window = XWINDOW (FGET (f, root_window));
if (redisplay_dont_pause)
force_p = 1;
/* Update the menu bar on X frames that don't have toolkit
support. */
- if (WINDOWP (FVAR (f, menu_bar_window)))
- update_window (XWINDOW (FVAR (f, menu_bar_window)), 1);
+ if (WINDOWP (FGET (f, menu_bar_window)))
+ update_window (XWINDOW (FGET (f, menu_bar_window)), 1);
/* Update the tool-bar window, if present. */
- if (WINDOWP (FVAR (f, tool_bar_window)))
+ if (WINDOWP (FGET (f, tool_bar_window)))
{
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (FGET (f, tool_bar_window));
/* Update tool-bar window. */
if (w->must_be_updated_p)
/* Swap tool-bar strings. We swap because we want to
reuse strings. */
- tem = FVAR (f, current_tool_bar_string);
- FVAR (f, current_tool_bar_string) = FVAR (f,
- desired_tool_bar_string);
- FVAR (f, desired_tool_bar_string) = tem;
+ tem = FGET (f, current_tool_bar_string);
+ FSET (f, current_tool_bar_string,
+ FGET (f, desired_tool_bar_string));
+ FSET (f, desired_tool_bar_string, tem);
}
}
if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
FrameCols (FRAME_TTY (f)) = newwidth;
- if (WINDOWP (FVAR (f, tool_bar_window)))
- XSETFASTINT (WVAR (XWINDOW (FVAR (f, tool_bar_window)), total_cols), newwidth);
+ if (WINDOWP (FGET (f, tool_bar_window)))
+ XSETFASTINT (WVAR (XWINDOW (FGET (f, tool_bar_window)), total_cols), newwidth);
}
FRAME_LINES (f) = newheight;
goto changed;
if (vecp == end)
goto changed;
- if (!EQ (*vecp++, FVAR (XFRAME (frame), name)))
+ if (!EQ (*vecp++, FGET (XFRAME (frame), name)))
goto changed;
}
/* Check that the buffer info matches. */
FOR_EACH_FRAME (tail, frame)
{
*vecp++ = frame;
- *vecp++ = FVAR (XFRAME (frame), name);
+ *vecp++ = FGET (XFRAME (frame), name);
}
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
x_set_title (struct frame *f, Lisp_Object name)
{
/* Don't change the title if it's already NAME. */
- if (EQ (name, FVAR (f, title)))
+ if (EQ (name, FGET (f, title)))
return;
update_mode_lines = 1;
- FVAR (f, title) = name;
+ FSET (f, title, name);
if (NILP (name))
- name = FVAR (f, name);
+ name = FGET (f, name);
if (FRAME_MSDOS_P (f))
{
local binding, but only if that binding still exists. */
else if (BUFFERP (where)
? !NILP (Flocal_variable_p (symbol, where))
- : !NILP (Fassq (symbol, FVAR (XFRAME (where), param_alist))))
+ : !NILP (Fassq (symbol, FGET (XFRAME (where), param_alist))))
set_internal (symbol, this_binding.old_value, where, 1);
}
/* If variable has a trivial value (no forwarding), we can
if (FRAME_LIVE_P (f))
ASET (vec, 1,
Fcons (FONTSET_NAME (FONTSET_BASE (fontset)),
- FVAR (f, name)));
+ FGET (f, name)));
else
ASET (vec, 1,
Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), Qnil));
windows_or_buffers_changed++;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
FRAME_MENU_BAR_LINES (f) = nlines;
- set_menu_bar_lines_1 (FVAR (f, root_window), nlines - olines);
+ set_menu_bar_lines_1 (FGET (f, root_window), nlines - olines);
adjust_glyphs (f);
}
}
/* Initialize Lisp data. Note that allocate_frame initializes all
Lisp data to nil, so do it only for slots which should not be nil. */
- FVAR (f, tool_bar_position) = Qtop;
+ FSET (f, tool_bar_position, Qtop);
/* Initialize non-Lisp data. Note that allocate_frame zeroes out all
non-Lisp data, so do it only for slots which should not be zero.
WVAR (XWINDOW (mini_window), prev) = root_window;
XWINDOW (mini_window)->mini = 1;
WVAR (XWINDOW (mini_window), frame) = frame;
- FVAR (f, minibuffer_window) = mini_window;
+ FSET (f, minibuffer_window, mini_window);
}
else
{
mini_window = Qnil;
WVAR (XWINDOW (root_window), next) = Qnil;
- FVAR (f, minibuffer_window) = Qnil;
+ FSET (f, minibuffer_window, Qnil);
}
WVAR (XWINDOW (root_window), frame) = frame;
etc. Running Lisp functions at this point surely ends in a
SEGV. */
set_window_buffer (root_window, buf, 0, 0);
- FVAR (f, buffer_list) = Fcons (buf, Qnil);
+ FSET (f, buffer_list, Fcons (buf, Qnil));
}
if (mini_p)
0, 0);
}
- FVAR (f, root_window) = root_window;
- FVAR (f, selected_window) = root_window;
+ FSET (f, root_window, root_window);
+ FSET (f, selected_window, root_window);
/* Make sure this window seems more recently used than
a newly-created, never-selected window. */
- XWINDOW (FVAR (f, selected_window))->use_time = ++window_select_count;
+ XWINDOW (FGET (f, selected_window))->use_time = ++window_select_count;
return f;
}
UNGCPRO;
}
- mini_window = FVAR (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)),
- minibuffer_window);
+ mini_window = FGET (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)),
+ minibuffer_window);
}
- FVAR (f, minibuffer_window) = mini_window;
+ FSET (f, minibuffer_window, mini_window);
/* Make the chosen minibuffer window display the proper minibuffer,
unless it is already showing a minibuffer. */
Avoid infinite looping on the window chain by marking next pointer
as nil. */
- mini_window = FVAR (f, minibuffer_window) = FVAR (f, root_window);
+ mini_window = FSET (f, minibuffer_window, FGET (f, root_window));
XWINDOW (mini_window)->mini = 1;
WVAR (XWINDOW (mini_window), next) = Qnil;
WVAR (XWINDOW (mini_window), prev) = Qnil;
Vframe_list = Fcons (frame, Vframe_list);
tty_frame_count = 1;
- FVAR (f, name) = build_pure_c_string ("F1");
+ FSET (f, name, build_pure_c_string ("F1"));
f->visible = 1;
f->async_visible = 1;
XSETFRAME (frame, f);
Vframe_list = Fcons (frame, Vframe_list);
- FVAR (f, name) = make_formatted_string (name, "F%"pMd, ++tty_frame_count);
+ FSET (f, name, make_formatted_string (name, "F%"pMd, ++tty_frame_count));
f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
f->async_visible = 1; /* Don't let visible be cleared later. */
result = Fassq (parameter, supplied_parms);
if (NILP (result))
- result = Fassq (parameter, FVAR (XFRAME (selected_frame), param_alist));
+ result = Fassq (parameter, FGET (XFRAME (selected_frame), param_alist));
if (NILP (result) && current_value != NULL)
result = build_string (current_value);
if (!NILP (result) && !STRINGP (result))
/* Make the frame face alist be frame-specific, so that each
frame could change its face definitions independently. */
- FVAR (f, face_alist) = Fcopy_alist (FVAR (sf, face_alist));
+ FSET (f, face_alist, Fcopy_alist (FGET (sf, face_alist)));
/* Simple Fcopy_alist isn't enough, because we need the contents of
the vectors which are the CDRs of associations in face_alist to
be copied as well. */
- for (tem = FVAR (f, face_alist); CONSP (tem); tem = XCDR (tem))
+ for (tem = FGET (f, face_alist); CONSP (tem); tem = XCDR (tem))
XSETCDR (XCAR (tem), Fcopy_sequence (XCDR (XCAR (tem))));
return frame;
}
if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
last_nonminibuf_frame = XFRAME (selected_frame);
- Fselect_window (FVAR (XFRAME (frame), selected_window), norecord);
+ Fselect_window (FGET (XFRAME (frame), selected_window), norecord);
/* We want to make sure that the next event generates a frame-switch
event to the appropriate frame. This seems kludgy to me, but
}
/* Don't allow minibuf_window to remain on a deleted frame. */
- if (EQ (FVAR (f, minibuffer_window), minibuf_window))
+ if (EQ (FGET (f, minibuffer_window), minibuf_window))
{
- Fset_window_buffer (FVAR (sf, minibuffer_window),
+ Fset_window_buffer (FGET (sf, minibuffer_window),
WVAR (XWINDOW (minibuf_window), buffer), Qnil);
- minibuf_window = FVAR (sf, minibuffer_window);
+ minibuf_window = FGET (sf, minibuffer_window);
/* If the dying minibuffer window was selected,
select the new one. */
}
/* Don't let echo_area_window to remain on a deleted frame. */
- if (EQ (FVAR (f, minibuffer_window), echo_area_window))
- echo_area_window = FVAR (sf, minibuffer_window);
+ if (EQ (FGET (f, minibuffer_window), echo_area_window))
+ echo_area_window = FGET (sf, minibuffer_window);
/* Clear any X selections for this frame. */
#ifdef HAVE_X_WINDOWS
/* Mark all the windows that used to be on FRAME as deleted, and then
remove the reference to them. */
- delete_all_child_windows (FVAR (f, root_window));
- FVAR (f, root_window) = Qnil;
+ delete_all_child_windows (FGET (f, root_window));
+ FSET (f, root_window, Qnil);
Vframe_list = Fdelq (frame, Vframe_list);
FRAME_SET_VISIBLE (f, 0);
garbage collection. The frame object itself may not be garbage
collected until much later, because recent_keys and other data
structures can still refer to it. */
- FVAR (f, menu_bar_vector) = Qnil;
+ FSET (f, menu_bar_vector, Qnil);
free_font_driver_list (f);
xfree (f->namebuf);
}
#endif
- make_frame_visible_1 (FVAR (XFRAME (frame), root_window));
+ make_frame_visible_1 (FGET (XFRAME (frame), root_window));
/* Make menu bar update for the Buffers and Frames menus. */
windows_or_buffers_changed++;
error ("Attempt to make invisible the sole visible or iconified frame");
/* Don't allow minibuf_window to remain on a deleted frame. */
- if (EQ (FVAR (XFRAME (frame), minibuffer_window), minibuf_window))
+ if (EQ (FGET (XFRAME (frame), minibuffer_window), minibuf_window))
{
struct frame *sf = XFRAME (selected_frame);
- Fset_window_buffer (FVAR (sf, minibuffer_window),
+ Fset_window_buffer (FGET (sf, minibuffer_window),
WVAR (XWINDOW (minibuf_window), buffer), Qnil);
- minibuf_window = FVAR (sf, minibuffer_window);
+ minibuf_window = FGET (sf, minibuffer_window);
}
/* I think this should be done with a hook. */
#endif
/* Don't allow minibuf_window to remain on a deleted frame. */
- if (EQ (FVAR (XFRAME (frame), minibuffer_window), minibuf_window))
+ if (EQ (FGET (XFRAME (frame), minibuffer_window), minibuf_window))
{
struct frame *sf = XFRAME (selected_frame);
- Fset_window_buffer (FVAR (sf, minibuffer_window),
+ Fset_window_buffer (FGET (sf, minibuffer_window),
WVAR (XWINDOW (minibuf_window), buffer), Qnil);
- minibuf_window = FVAR (sf, minibuffer_window);
+ minibuf_window = FGET (sf, minibuffer_window);
}
/* I think this should be done with a hook. */
f = XFRAME (frame);
- FVAR (f, focus_frame) = focus_frame;
+ FSET (f, focus_frame, focus_frame);
if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
(*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f);
{
register Lisp_Object tem;
- tem = Fassq (prop, FVAR (frame, param_alist));
+ tem = Fassq (prop, FGET (frame, param_alist));
if (EQ (tem, Qnil))
return tem;
return Fcdr (tem);
Lisp_Object
frame_buffer_predicate (Lisp_Object frame)
{
- return FVAR (XFRAME (frame), buffer_predicate);
+ return FGET (XFRAME (frame), buffer_predicate);
}
/* Return the buffer-list of the selected frame. */
static Lisp_Object
frame_buffer_list (Lisp_Object frame)
{
- return FVAR (XFRAME (frame), buffer_list);
+ return FGET (XFRAME (frame), buffer_list);
}
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
FOR_EACH_FRAME (tail, frame)
{
- FVAR (XFRAME (frame), buffer_list)
- = Fdelq (buffer, FVAR (XFRAME (frame), buffer_list));
- FVAR (XFRAME (frame), buried_buffer_list)
- = Fdelq (buffer, FVAR (XFRAME (frame), buried_buffer_list));
+ FSET (XFRAME (frame), buffer_list,
+ Fdelq (buffer, FGET (XFRAME (frame), buffer_list)));
+ FSET (XFRAME (frame), buried_buffer_list,
+ Fdelq (buffer, FGET (XFRAME (frame), buried_buffer_list)));
}
}
/* Check for no change needed in this very common case
before we do any consing. */
- if (frame_name_fnn_p (SSDATA (FVAR (f, name)),
- SBYTES (FVAR (f, name))))
+ if (frame_name_fnn_p (SSDATA (FGET (f, name)),
+ SBYTES (FGET (f, name))))
return;
name = make_formatted_string (namebuf, "F%"pMd, ++tty_frame_count);
CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
- if (! NILP (Fstring_equal (name, FVAR (f, name))))
+ if (! NILP (Fstring_equal (name, FGET (f, name))))
return;
/* Don't allow the user to set the frame name to F<num>, so it
error ("Frame names of the form F<num> are usurped by Emacs");
}
- FVAR (f, name) = name;
+ FSET (f, name, name);
update_mode_lines = 1;
}
for (; CONSP (val); val = XCDR (val))
if (!NILP (Fbuffer_live_p (XCAR (val))))
list = Fcons (XCAR (val), list);
- FVAR (f, buffer_list) = Fnreverse (list);
+ FSET (f, buffer_list, Fnreverse (list));
return;
}
if (EQ (prop, Qburied_buffer_list))
for (; CONSP (val); val = XCDR (val))
if (!NILP (Fbuffer_live_p (XCAR (val))))
list = Fcons (XCAR (val), list);
- FVAR (f, buried_buffer_list) = Fnreverse (list);
+ FSET (f, buried_buffer_list, Fnreverse (list));
return;
}
FRAME_TTY (f)->previous_frame = NULL;
/* Update the frame parameter alist. */
- old_alist_elt = Fassq (prop, FVAR (f, param_alist));
+ old_alist_elt = Fassq (prop, FGET (f, param_alist));
if (EQ (old_alist_elt, Qnil))
- FVAR (f, param_alist) = Fcons (Fcons (prop, val), FVAR (f, param_alist));
+ FSET (f, param_alist, Fcons (Fcons (prop, val), FGET (f, param_alist)));
else
Fsetcdr (old_alist_elt, val);
in addition to the alist. */
if (EQ (prop, Qbuffer_predicate))
- FVAR (f, buffer_predicate) = val;
+ FSET (f, buffer_predicate, val);
if (! FRAME_WINDOW_P (f))
{
error ("Surrogate minibuffer windows must be minibuffer windows");
if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
- && !EQ (val, FVAR (f, minibuffer_window)))
+ && !EQ (val, FGET (f, minibuffer_window)))
error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
/* Install the chosen minibuffer window, with proper buffer. */
- FVAR (f, minibuffer_window) = val;
+ FSET (f, minibuffer_window, val);
}
}
if (!FRAME_LIVE_P (f))
return Qnil;
- alist = Fcopy_alist (FVAR (f, param_alist));
+ alist = Fcopy_alist (FGET (f, param_alist));
GCPRO1 (alist);
if (!FRAME_WINDOW_P (f))
: FRAME_W32_P (f) ? "w32term"
:"tty"));
}
- store_in_alist (&alist, Qname, FVAR (f, name));
+ store_in_alist (&alist, Qname, FGET (f, name));
height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f));
store_in_alist (&alist, Qheight, make_number (height));
width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f));
store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame));
store_in_alist (&alist, Qburied_buffer_list,
- FVAR (XFRAME (frame), buried_buffer_list));
+ FGET (XFRAME (frame), buried_buffer_list));
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
{
/* Avoid consing in frequent cases. */
if (EQ (parameter, Qname))
- value = FVAR (f, name);
+ value = FGET (f, name);
#ifdef HAVE_X_WINDOWS
else if (EQ (parameter, Qdisplay) && FRAME_X_P (f))
value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element);
else if (EQ (parameter, Qbackground_color)
|| EQ (parameter, Qforeground_color))
{
- value = Fassq (parameter, FVAR (f, param_alist));
+ value = Fassq (parameter, FGET (f, param_alist));
if (CONSP (value))
{
value = XCDR (value);
}
else if (EQ (parameter, Qdisplay_type)
|| EQ (parameter, Qbackground_mode))
- value = Fcdr (Fassq (parameter, FVAR (f, param_alist)));
+ value = Fcdr (Fassq (parameter, FGET (f, param_alist)));
else
/* FIXME: Avoid this code path at all (as well as code duplication)
by sharing more code with Fframe_parameters. */
if (! TYPE_RANGED_INTEGERP (int, icon_left))
{
icon_left_no_change = 1;
- icon_left = Fcdr (Fassq (Qicon_left, FVAR (f, param_alist)));
+ icon_left = Fcdr (Fassq (Qicon_left, FGET (f, param_alist)));
if (NILP (icon_left))
XSETINT (icon_left, 0);
}
if (! TYPE_RANGED_INTEGERP (int, icon_top))
{
icon_top_no_change = 1;
- icon_top = Fcdr (Fassq (Qicon_top, FVAR (f, param_alist)));
+ icon_top = Fcdr (Fassq (Qicon_top, FGET (f, param_alist)));
if (NILP (icon_top))
XSETINT (icon_top, 0);
}
store_in_alist (alistptr, Qouter_window_id,
make_formatted_string (buf, "%lu", w));
#endif
- store_in_alist (alistptr, Qicon_name, FVAR (f, icon_name));
+ store_in_alist (alistptr, Qicon_name, FGET (f, icon_name));
FRAME_SAMPLE_VISIBILITY (f);
store_in_alist (alistptr, Qvisibility,
(FRAME_VISIBLE_P (f) ? Qt
XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc);
store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
store_in_alist (alistptr, Qparent_id, tem);
- store_in_alist (alistptr, Qtool_bar_position, FVAR (f, tool_bar_position));
+ store_in_alist (alistptr, Qtool_bar_position, FGET (f, tool_bar_position));
}
signal_error ("Invalid screen-gamma", new_value);
/* Apply the new gamma value to the frame background. */
- bgcolor = Fassq (Qbackground_color, FVAR (f, param_alist));
+ bgcolor = Fassq (Qbackground_color, FGET (f, param_alist));
if (CONSP (bgcolor) && (bgcolor = XCDR (bgcolor), STRINGP (bgcolor)))
{
Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter);
{
Lisp_Object tem;
- tem = assq_no_quit (Qicon_type, FVAR (f, param_alist));
+ tem = assq_no_quit (Qicon_type, FGET (f, param_alist));
if (CONSP (tem))
return XCDR (tem);
else
struct font_driver_list;
-/* Most code should use this macro to access Lisp fields in struct frame. */
+/* Most code should use these macros to access Lisp fields
+ in struct frame. FGET should not be used as lvalue. */
-#define FVAR(frame, field) ((frame)->INTERNAL_FIELD (field))
+#define FGET(f, field) \
+ (eassert (offsetof (struct frame, field ## _) \
+ < offsetof (struct frame, face_cache)), \
+ ((f)->INTERNAL_FIELD (field)))
+
+#define FSET(f, field, value) ((f)->INTERNAL_FIELD (field) = (value))
struct frame
{
#define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed
/* The minibuffer window of frame F, if it has one; otherwise nil. */
-#define FRAME_MINIBUF_WINDOW(f) FVAR (f, minibuffer_window)
+#define FRAME_MINIBUF_WINDOW(f) FGET (f, minibuffer_window)
/* The root window of the window tree of frame F. */
-#define FRAME_ROOT_WINDOW(f) FVAR (f, root_window)
+#define FRAME_ROOT_WINDOW(f) FGET (f, root_window)
/* The currently selected window of the window tree of frame F. */
-#define FRAME_SELECTED_WINDOW(f) FVAR (f, selected_window)
+#define FRAME_SELECTED_WINDOW(f) FGET (f, selected_window)
#define FRAME_INSERT_COST(f) (f)->insert_line_cost
#define FRAME_DELETE_COST(f) (f)->delete_line_cost
#define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
#define FRAME_MESSAGE_BUF(f) (f)->message_buf
#define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
-#define FRAME_FOCUS_FRAME(f) FVAR (f, focus_frame)
+#define FRAME_FOCUS_FRAME(f) FGET (f, focus_frame)
/* Nonzero if frame F supports scroll bars.
If this is zero, then it is impossible to enable scroll bars
/* Nonzero if frame F has scroll bars. */
-#define FRAME_SCROLL_BARS(f) (FVAR (f, scroll_bars))
+#define FRAME_SCROLL_BARS(f) (FGET (f, scroll_bars))
-#define FRAME_CONDEMNED_SCROLL_BARS(f) (FVAR (f, condemned_scroll_bars))
-#define FRAME_MENU_BAR_ITEMS(f) (FVAR (f, menu_bar_items))
+#define FRAME_CONDEMNED_SCROLL_BARS(f) (FGET (f, condemned_scroll_bars))
+#define FRAME_MENU_BAR_ITEMS(f) (FGET (f, menu_bar_items))
#define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
#define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor)
int o_right = FRAME_RIGHT_FRINGE_WIDTH (f);
int o_cols = FRAME_FRINGE_COLS (f);
- Lisp_Object left_fringe = Fassq (Qleft_fringe, FVAR (f, param_alist));
- Lisp_Object right_fringe = Fassq (Qright_fringe, FVAR (f, param_alist));
+ Lisp_Object left_fringe = Fassq (Qleft_fringe, FGET (f, param_alist));
+ Lisp_Object right_fringe = Fassq (Qright_fringe, FGET (f, param_alist));
int left_fringe_width, right_fringe_width;
if (!NILP (left_fringe))
gtk_widget_set_name (wfixed, SSDATA (Vx_resource_name));
/* If this frame has a title or name, set it in the title bar. */
- if (! NILP (FVAR (f, title)))
- title = SSDATA (ENCODE_UTF_8 (FVAR (f, title)));
- else if (! NILP (FVAR (f, name)))
- title = SSDATA (ENCODE_UTF_8 (FVAR (f, name)));
+ if (! NILP (FGET (f, title)))
+ title = SSDATA (ENCODE_UTF_8 (FGET (f, title)));
+ else if (! NILP (FGET (f, name)))
+ title = SSDATA (ENCODE_UTF_8 (FGET (f, name)));
if (title) gtk_window_set_title (GTK_WINDOW (wtop), title);
{
cl_data = xmalloc (sizeof *cl_data);
cl_data->f = f;
- cl_data->menu_bar_vector = FVAR (f, menu_bar_vector);
+ cl_data->menu_bar_vector = FGET (f, menu_bar_vector);
cl_data->menu_bar_items_used = f->menu_bar_items_used;
cl_data->highlight_cb = highlight_cb;
cl_data->ref_count = 0;
if (cl_data)
{
cl_data->f = f;
- cl_data->menu_bar_vector = FVAR (f, menu_bar_vector);
+ cl_data->menu_bar_vector = FGET (f, menu_bar_vector);
cl_data->menu_bar_items_used = f->menu_bar_items_used;
cl_data->highlight_cb = highlight_cb;
}
struct input_event event;
EVENT_INIT (event);
- if (! f || ! f->n_tool_bar_items || NILP (FVAR (f, tool_bar_items)))
+ if (! f || ! f->n_tool_bar_items || NILP (FGET (f, tool_bar_items)))
return;
idx *= TOOL_BAR_ITEM_NSLOTS;
- key = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_KEY);
+ key = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_KEY);
XSETFRAME (frame, f);
/* We generate two events here. The first one is to set the prefix
FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
Lisp_Object help, frame;
- if (! f || ! f->n_tool_bar_items || NILP (FVAR (f, tool_bar_items)))
+ if (! f || ! f->n_tool_bar_items || NILP (FGET (f, tool_bar_items)))
return FALSE;
if (event->type == GDK_ENTER_NOTIFY)
{
idx *= TOOL_BAR_ITEM_NSLOTS;
- help = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_HELP);
+ help = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_HELP);
if (NILP (help))
- help = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_CAPTION);
+ help = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_CAPTION);
}
else
help = Qnil;
}
-#define PROP(IDX) AREF (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX))
+#define PROP(IDX) AREF (FGET (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX))
/* Find the right-to-left image named by RTL in the tool bar images for F.
Returns IMAGE if RTL is not found. */
if (f->n_tool_bar_items != 0)
{
if (pack_tool_bar)
- xg_pack_tool_bar (f, FVAR (f, tool_bar_position));
+ xg_pack_tool_bar (f, FGET (f, tool_bar_position));
gtk_widget_show_all (GTK_WIDGET (x->handlebox_widget));
if (xg_update_tool_bar_sizes (f))
xg_height_or_width_changed (f);
{
if (FRAMEP (selected_frame)
&& FRAME_LIVE_P (XFRAME (selected_frame))
- && !EQ (minibuf_window, FVAR (XFRAME (selected_frame), minibuffer_window)))
+ && !EQ (minibuf_window, FGET (XFRAME (selected_frame), minibuffer_window)))
{
struct frame *sf = XFRAME (selected_frame);
Lisp_Object buffer;
/* I don't think that any frames may validly have a null minibuffer
window anymore. */
- if (NILP (FVAR (sf, minibuffer_window)))
+ if (NILP (FGET (sf, minibuffer_window)))
abort ();
/* Under X, we come here with minibuf_window being the
init_window_once. That window doesn't have a buffer. */
buffer = WVAR (XWINDOW (minibuf_window), buffer);
if (BUFFERP (buffer))
- Fset_window_buffer (FVAR (sf, minibuffer_window), buffer, Qnil);
- minibuf_window = FVAR (sf, minibuffer_window);
+ Fset_window_buffer (FGET (sf, minibuffer_window), buffer, Qnil);
+ minibuf_window = FGET (sf, minibuffer_window);
}
/* Make sure no other frame has a minibuffer as its selected window,
frame parameters. For the selected window, we use either its
buffer-local value or the value from the frame parameters if the
buffer doesn't define its local value for the cursor type. */
- sw = XWINDOW (FVAR (f, selected_window));
- frame_desired_cursor = Fcdr (Fassq (Qcursor_type, FVAR (f, param_alist)));
+ sw = XWINDOW (FGET (f, selected_window));
+ frame_desired_cursor = Fcdr (Fassq (Qcursor_type, FGET (f, param_alist)));
if (cursor_in_echo_area
&& FRAME_HAS_MINIBUF_P (f)
&& EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)
Lisp_Object *values
= (Lisp_Object *) alloca (length * word_size);
/* Do we have to reverse the foreground and background colors? */
- int reverse = EQ (Fcdr (Fassq (Qreverse, FVAR (f, param_alist))), Qt);
+ int reverse = EQ (Fcdr (Fassq (Qreverse, FGET (f, param_alist))), Qt);
int redraw = 0, fg_set = 0, bg_set = 0;
unsigned long orig_fg, orig_bg;
struct tty_display_info *tty = FRAME_TTY (f);
else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
return;
- FVAR (f, icon_name) = arg;
+ FSET (f, icon_name, arg);
if (NILP (arg))
{
- if (!NILP (FVAR (f, title)))
- arg = FVAR (f, title);
+ if (!NILP (FGET (f, title)))
+ arg = FGET (f, title);
else
/* explicit name and no icon-name -> explicit_name */
if (f->explicit_name)
- arg = FVAR (f, name);
+ arg = FGET (f, name);
else
{
/* no explicit name and no icon-name ->
if (! [[[view window] title] isEqualToString: str])
[[view window] setTitle: str];
- if (!STRINGP (FVAR (f, icon_name)))
+ if (!STRINGP (FGET (f, icon_name)))
encoded_icon_name = encoded_name;
else
- encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name));
+ encoded_icon_name = ENCODE_UTF_8 (FGET (f, icon_name));
str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)];
CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
- if (! NILP (Fstring_equal (name, FVAR (f, name))))
+ if (! NILP (Fstring_equal (name, FGET (f, name))))
return;
- FVAR (f, name) = name;
+ FSET (f, name, name);
/* title overrides explicit name */
- if (! NILP (FVAR (f, title)))
- name = FVAR (f, title);
+ if (! NILP (FGET (f, title)))
+ name = FGET (f, title);
ns_set_name_internal (f, name);
}
{
NSTRACE (x_set_title);
/* Don't change the title if it's already NAME. */
- if (EQ (name, FVAR (f, title)))
+ if (EQ (name, FGET (f, title)))
return;
update_mode_lines = 1;
- FVAR (f, title) = name;
+ FSET (f, title, name);
if (NILP (name))
- name = FVAR (f, name);
+ name = FGET (f, name);
else
CHECK_STRING (name);
{
NSView *view;
Lisp_Object name, filename;
- Lisp_Object buf = WVAR (XWINDOW (FVAR (f, selected_window)), buffer);
+ Lisp_Object buf = WVAR (XWINDOW (FGET (f, selected_window)), buffer);
const char *title;
NSAutoreleasePool *pool;
struct gcpro gcpro1;
NSString *str;
NSTRACE (ns_set_name_as_filename);
- if (f->explicit_name || ! NILP (FVAR (f, title)) || ns_in_resize)
+ if (f->explicit_name || ! NILP (FGET (f, title)) || ns_in_resize)
return;
BLOCK_INPUT;
[[view window] setRepresentedFilename: fstr];
[[view window] setTitle: str];
- FVAR (f, name) = name;
+ FSET (f, name, name);
}
[pool release];
{
NSView *view = FRAME_NS_VIEW (f);
NSAutoreleasePool *pool;
- if (!MINI_WINDOW_P (XWINDOW (FVAR (f, selected_window))))
+ if (!MINI_WINDOW_P (XWINDOW (FGET (f, selected_window))))
{
BLOCK_INPUT;
pool = [[NSAutoreleasePool alloc] init];
BLOCK_INPUT;
pool = [[NSAutoreleasePool alloc] init];
if (f->output_data.ns->miniimage
- && [[NSString stringWithUTF8String: SSDATA (FVAR (f, name))]
+ && [[NSString stringWithUTF8String: SSDATA (FGET (f, name))]
isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]])
{
[pool release];
return;
}
- tem = assq_no_quit (Qicon_type, FVAR (f, param_alist));
+ tem = assq_no_quit (Qicon_type, FGET (f, param_alist));
if (CONSP (tem) && ! NILP (XCDR (tem)))
{
[pool release];
{
elt = XCAR (chain);
/* special case: 't' means go by file type */
- if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (FVAR (f, name))[0] == '/')
+ if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (FGET (f, name))[0] == '/')
{
NSString *str
- = [NSString stringWithUTF8String: SSDATA (FVAR (f, name))];
+ = [NSString stringWithUTF8String: SSDATA (FGET (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), FVAR (f, name)) >= 0)
+ fast_string_match (XCAR (elt), FGET (f, name)) >= 0)
{
image = [EmacsImage allocInitFromFile: XCDR (elt)];
if (image == nil)
FRAME_FONTSET (f) = -1;
- FVAR (f, icon_name) = x_get_arg (dpyinfo, parms, Qicon_name,
- "iconName", "Title",
- RES_TYPE_STRING);
- if (! STRINGP (FVAR (f, icon_name)))
- FVAR (f, icon_name) = Qnil;
+ FSET (f, icon_name, x_get_arg (dpyinfo, parms, Qicon_name,
+ "iconName", "Title",
+ RES_TYPE_STRING));
+ if (! STRINGP (FGET (f, icon_name)))
+ FSET (f, icon_name, Qnil);
FRAME_NS_DISPLAY_INFO (f) = dpyinfo;
be set. */
if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name))
{
- FVAR (f, name) = build_string ([ns_app_name UTF8String]);
+ FSET (f, name, build_string ([ns_app_name UTF8String]));
f->explicit_name = 0;
}
else
{
- FVAR (f, name) = name;
+ FSET (f, name, name);
f->explicit_name = 1;
specbind (Qx_resource_name, name);
}
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))))
- FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist));
+ FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist)));
UNGCPRO;
/* Save the frame's previous menu bar contents data */
if (previous_menu_items_used)
- memcpy (previous_items, aref_addr (FVAR (f, menu_bar_vector), 0),
+ memcpy (previous_items, aref_addr (FGET (f, menu_bar_vector), 0),
previous_menu_items_used * sizeof (Lisp_Object));
/* parse stage 1: extract from lisp */
save_menu_items ();
- menu_items = FVAR (f, menu_bar_vector);
+ menu_items = FGET (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);
}
/* The menu items are different, so store them in the frame */
/* FIXME: this is not correct for single-submenu case */
- FVAR (f, menu_bar_vector) = menu_items;
+ FSET (f, menu_bar_vector, menu_items);
f->menu_bar_items_used = menu_items_used;
/* Calls restore_menu_items, etc., as they were outside */
/* update EmacsToolbar as in GtkUtils, build items list */
for (i = 0; i < f->n_tool_bar_items; ++i)
{
-#define TOOLPROP(IDX) AREF (FVAR (f, tool_bar_items), \
+#define TOOLPROP(IDX) AREF (FGET (f, tool_bar_items), \
i * TOOL_BAR_ITEM_NSLOTS + (IDX))
BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P));
FRAME_PIXEL_HEIGHT (f) = pixelheight;
/* SET_FRAME_GARBAGED (f); // this short-circuits expose call in drawRect */
- mark_window_cursors_off (XWINDOW (FVAR (f, root_window)));
+ mark_window_cursors_off (XWINDOW (FGET (f, root_window)));
cancel_mouse_face (f);
UNBLOCK_INPUT;
int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
/* Internal border is drawn below the tool bar. */
- if (WINDOWP (FVAR (f, tool_bar_window))
- && w == XWINDOW (FVAR (f, tool_bar_window)))
+ if (WINDOWP (FGET (f, tool_bar_window))
+ && w == XWINDOW (FGET (f, tool_bar_window)))
y -= width;
/* end copy from other terms */
if (ns_drag_types)
[self registerForDraggedTypes: ns_drag_types];
- tem = FVAR (f, name);
+ tem = FGET (f, name);
name = [NSString stringWithUTF8String:
NILP (tem) ? "Emacs" : SSDATA (tem)];
[win setTitle: name];
#endif
FRAME_TOOLBAR_HEIGHT (f) = 0;
- tem = FVAR (f, icon_name);
+ tem = FGET (f, icon_name);
if (!NILP (tem))
[win setMiniwindowTitle:
[NSString stringWithUTF8String: SSDATA (tem)]];
{
NSInteger tag = [sender tag];
find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used,
- FVAR (emacsframe, menu_bar_vector),
+ FGET (emacsframe, menu_bar_vector),
(void *)tag);
}
emacs_event->kind = TOOL_BAR_EVENT;
/* XSETINT (emacs_event->code, 0); */
- emacs_event->arg = AREF (FVAR (emacsframe, tool_bar_items),
- idx + TOOL_BAR_ITEM_KEY);
+ emacs_event->arg = AREF (FGET (emacsframe, tool_bar_items),
+ idx + TOOL_BAR_ITEM_KEY);
emacs_event->modifiers = EV_MODIFIERS (theEvent);
EV_TRAILER (theEvent);
return self;
Lisp_Object str = Qnil;
struct frame *f = SELECTED_FRAME ();
struct buffer *curbuf
- = XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer));
+ = XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer));
if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
return NSAccessibilityTextFieldRole;
else if (FRAMEP (obj))
{
int len;
- Lisp_Object frame_name = FVAR (XFRAME (obj), name);
+ Lisp_Object frame_name = FGET (XFRAME (obj), name);
strout ((FRAME_LIVE_P (XFRAME (obj))
? "#<frame " : "#<dead frame "),
Lisp_Object tty_color_mode_alist
= Fintern_soft (build_string ("tty-color-mode-alist"), Qnil);
- tem = assq_no_quit (Qtty_color_mode, FVAR (f, param_alist));
+ tem = assq_no_quit (Qtty_color_mode, FGET (f, param_alist));
val = CONSP (tem) ? XCDR (tem) : Qnil;
if (INTEGERP (val))
else if (!NILP (arg) || NILP (oldval))
return;
- FVAR (f, icon_name) = arg;
+ FSET (f, icon_name, arg);
#if 0
if (f->output_data.w32->icon_bitmap != 0)
BLOCK_INPUT;
result = x_text_icon (f,
- SSDATA ((!NILP (FVAR (f, icon_name))
- ? FVAR (f, icon_name)
- : !NILP (FVAR (f, title))
- ? FVAR (f, title)
- : FVAR (f, name))));
+ SSDATA ((!NILP (FGET (f, icon_name))
+ ? FGET (f, icon_name)
+ : !NILP (FGET (f, title))
+ ? FGET (f, title)
+ : FGET (f, name))));
if (result)
{
}
UNBLOCK_INPUT;
- if (WINDOWP (FVAR (f, tool_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix);
+ if (WINDOWP (FGET (f, tool_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix);
}
run_window_configuration_change_hook (f);
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
- SDATA (FVAR (f, name))))
+ SDATA (FGET (f, name))))
return;
name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
}
CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
- if (! NILP (Fstring_equal (name, FVAR (f, name))))
+ if (! NILP (Fstring_equal (name, FGET (f, name))))
return;
- FVAR (f, name) = name;
+ FSET (f, name, name);
/* For setting the frame title, the title parameter should override
the name parameter. */
- if (! NILP (FVAR (f, title)))
- name = FVAR (f, title);
+ if (! NILP (FGET (f, title)))
+ name = FGET (f, title);
if (FRAME_W32_WINDOW (f))
{
x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
- if (EQ (name, FVAR (f, title)))
+ if (EQ (name, FGET (f, title)))
return;
update_mode_lines = 1;
- FVAR (f, title) = name;
+ FSET (f, title, name);
if (NILP (name))
- name = FVAR (f, name);
+ name = FGET (f, name);
if (FRAME_W32_WINDOW (f))
{
int explicit = f->explicit_name;
f->explicit_name = 0;
- name = FVAR (f, name);
- FVAR (f, name) = Qnil;
+ name = FGET (f, name);
+ FSET (f, name, Qnil);
x_set_name (f, name, explicit);
}
? IconicState
: NormalState));
- x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name))
- ? FVAR (f, icon_name)
- : FVAR (f, name))));
+ x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name))
+ ? FGET (f, icon_name)
+ : FGET (f, name))));
#endif
UNBLOCK_INPUT;
f->output_data.w32 = xzalloc (sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
- FVAR (f, icon_name)
- = x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
- RES_TYPE_STRING);
- if (! STRINGP (FVAR (f, icon_name)))
- FVAR (f, icon_name) = Qnil;
+ FSET (f, icon_name,
+ x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
+ RES_TYPE_STRING));
+ if (! STRINGP (FGET (f, icon_name)))
+ FSET (f, icon_name, Qnil);
/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */
be set. */
if (EQ (name, Qunbound) || NILP (name))
{
- FVAR (f, name) = build_string (dpyinfo->w32_id_name);
+ FSET (f, name, build_string (dpyinfo->w32_id_name));
f->explicit_name = 0;
}
else
{
- FVAR (f, name) = name;
+ FSET (f, name, name);
f->explicit_name = 1;
/* use the frame's title when getting resources for this frame. */
specbind (Qx_resource_name, name);
by x_get_arg and friends, now go in the misc. alist of the frame. */
for (tem = parameters; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
- FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist));
+ FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist)));
UNGCPRO;
f->output_data.w32 = xzalloc (sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
- FVAR (f, icon_name) = Qnil;
+ FSET (f, icon_name, Qnil);
#ifdef GLYPH_DEBUG
image_cache_refcount =
be set. */
if (EQ (name, Qunbound) || NILP (name))
{
- FVAR (f, name) = build_string (dpyinfo->w32_id_name);
+ FSET (f, name, build_string (dpyinfo->w32_id_name));
f->explicit_name = 0;
}
else
{
- FVAR (f, name) = name;
+ FSET (f, name, name);
f->explicit_name = 1;
/* use the frame's title when getting resources for this frame. */
specbind (Qx_resource_name, name);
return;
entry = Qnil;
subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * word_size);
- vector = FVAR (f, menu_bar_vector);
+ vector = FGET (f, menu_bar_vector);
prefix = Qnil;
i = 0;
while (i < f->menu_bar_items_used)
/* Save the frame's previous menu bar contents data. */
if (previous_menu_items_used)
- memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents,
+ memcpy (previous_items, XVECTOR (FGET (f, menu_bar_vector))->contents,
previous_menu_items_used * word_size);
/* Fill in menu_items with the current menu bar contents.
This can evaluate Lisp code. */
save_menu_items ();
- menu_items = FVAR (f, menu_bar_vector);
+ menu_items = FGET (f, menu_bar_vector);
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
submenu_start = (int *) alloca (ASIZE (items) * sizeof (int));
submenu_end = (int *) alloca (ASIZE (items) * sizeof (int));
return;
}
- FVAR (f, menu_bar_vector) = menu_items;
+ FSET (f, menu_bar_vector, menu_items);
f->menu_bar_items_used = menu_items_used;
/* This undoes save_menu_items. */
/* We may get paint messages even though the client
area is clipped - these are not expose events. */
DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f,
- SDATA (FVAR (f, name))));
+ SDATA (FGET (f, name))));
}
else if (f->async_visible != 1)
{
f->async_iconified = 0;
SET_FRAME_GARBAGED (f);
DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f,
- SDATA (FVAR (f, name))));
+ SDATA (FGET (f, name))));
/* WM_PAINT serves as MapNotify as well, so report
visibility changes properly. */
if (f && !f->iconified)
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
- && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window))
+ && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window))
{
clear_mouse_face (hlinfo);
hlinfo->mouse_face_hidden = 1;
if (f && !f->iconified)
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
- && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window))
+ && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window))
{
clear_mouse_face (hlinfo);
hlinfo->mouse_face_hidden = 1;
if (f && !f->iconified)
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
- && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window))
+ && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window))
{
clear_mouse_face (hlinfo);
hlinfo->mouse_face_hidden = 1;
construct_mouse_click (&inev, &msg, f);
/* Is this in the tool-bar? */
- if (WINDOWP (FVAR (f, tool_bar_window))
- && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))))
+ if (WINDOWP (FGET (f, tool_bar_window))
+ && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))))
{
Lisp_Object window;
int x = XFASTINT (inev.x);
window = window_from_coordinates (f, x, y, 0, 1);
- if (EQ (window, FVAR (f, tool_bar_window)))
+ if (EQ (window, FGET (f, tool_bar_window)))
{
w32_handle_tool_bar_click (f, &inev);
tool_bar_p = 1;
if (!FRAME_OBSCURED_P (f))
{
DebPrint (("frame %p (%s) obscured\n", f,
- SDATA (FVAR (f, name))));
+ SDATA (FGET (f, name))));
}
}
else
{
SET_FRAME_GARBAGED (f);
DebPrint (("obscured frame %p (%s) found to be visible\n", f,
- SDATA (FVAR (f, name))));
+ SDATA (FGET (f, name))));
/* Force a redisplay sooner or later. */
record_asynch_buffer_change ();
SET_FRAME_GARBAGED (f);
/* If cursor was outside the new size, mark it as off. */
- mark_window_cursors_off (XWINDOW (FVAR (f, root_window)));
+ mark_window_cursors_off (XWINDOW (FGET (f, root_window)));
/* Clear out any recollection of where the mouse highlighting was,
since it might be in a place that's outside the new frame size.
Lisp_Object window;
if (NILP (frame_or_window))
- window = FVAR (SELECTED_FRAME (), root_window);
+ window = FGET (SELECTED_FRAME (), root_window);
else if (WINDOWP (frame_or_window))
- window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window);
+ window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window);
else
{
CHECK_LIVE_FRAME (frame_or_window);
- window = FVAR (XFRAME (frame_or_window), root_window);
+ window = FGET (XFRAME (frame_or_window), root_window);
}
return window;
Lisp_Object window;
if (NILP (frame_or_window))
- window = FVAR (SELECTED_FRAME (), root_window);
+ window = FGET (SELECTED_FRAME (), root_window);
else if (WINDOWP (frame_or_window))
- window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window);
+ window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window);
else
{
CHECK_LIVE_FRAME (frame_or_window);
- window = FVAR (XFRAME (frame_or_window), root_window);
+ window = FGET (XFRAME (frame_or_window), root_window);
}
while (NILP (WVAR (XWINDOW (window), buffer)))
Lisp_Object window;
if (NILP (frame_or_window))
- window = FVAR (SELECTED_FRAME (), selected_window);
+ window = FGET (SELECTED_FRAME (), selected_window);
else if (WINDOWP (frame_or_window))
- window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))),
+ window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))),
selected_window);
else
{
CHECK_LIVE_FRAME (frame_or_window);
- window = FVAR (XFRAME (frame_or_window), selected_window);
+ window = FGET (XFRAME (frame_or_window), selected_window);
}
return window;
if (EQ (frame, selected_frame))
return Fselect_window (window, norecord);
else
- return FVAR (XFRAME (frame), selected_window) = window;
+ return FSET (XFRAME (frame), selected_window, window);
}
DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
sf = SELECTED_FRAME ();
if (XFRAME (WINDOW_FRAME (w)) != sf)
{
- FVAR (XFRAME (WINDOW_FRAME (w)), selected_window) = window;
+ FSET (XFRAME (WINDOW_FRAME (w)), selected_window, window);
/* Use this rather than Fhandle_switch_frame
so that FRAME_FOCUS_FRAME is moved appropriately as we
move around in the state where a minibuffer in a separate
return window;
}
else
- FVAR (sf, selected_window) = window;
+ FSET (sf, selected_window, window);
/* Store the current buffer's actual point into the
old selected window. It belongs to that window,
bar exists. */
if (NILP (window)
&& tool_bar_p
- && WINDOWP (FVAR (f, tool_bar_window))
- && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0
- && (coordinates_in_window (XWINDOW (FVAR (f, tool_bar_window)), x, y)
+ && WINDOWP (FGET (f, tool_bar_window))
+ && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))) > 0
+ && (coordinates_in_window (XWINDOW (FGET (f, tool_bar_window)), x, y)
!= ON_NOTHING))
{
*part = ON_TEXT;
- window = FVAR (f, tool_bar_window);
+ window = FGET (f, tool_bar_window);
}
return window;
/* If OLD is its frame's root window, then NEW is the new
root window for that frame. */
if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WVAR (o, frame)))))
- FRAME_ROOT_WINDOW (XFRAME (WVAR (o, frame))) = new;
+ FSET (XFRAME (WVAR (o, frame)), selected_window, new);
if (setflag)
{
(Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window)
{
if (NILP (window))
- window = FRAMEP (frame) ? FVAR (XFRAME (frame), selected_window) : selected_window;
+ window = FRAMEP (frame) ? FGET (XFRAME (frame), selected_window) : selected_window;
CHECK_WINDOW (window);
if (NILP (frame))
frame = selected_frame;
if (EQ (selected_frame, WVAR (w, frame)))
Fselect_window (window, Qnil);
else
- FRAME_SELECTED_WINDOW (f) = window;
+ FSET (f, selected_window, window);
}
}
else
if (EQ (selected_frame, WVAR (w, frame)))
Fselect_window (swindow, Qnil);
else
- FRAME_SELECTED_WINDOW (f) = swindow;
+ FSET (f, selected_window, swindow);
}
}
void
resize_frame_windows (struct frame *f, int size, int horflag)
{
- Lisp_Object root = FVAR (f, root_window);
+ Lisp_Object root = FGET (f, root_window);
struct window *r = XWINDOW (root);
- Lisp_Object mini = FVAR (f, minibuffer_window);
+ Lisp_Object mini = FGET (f, minibuffer_window);
struct window *m;
/* new_size is the new size of the frame's root window. */
int new_size = (horflag
{
/* We lost. Delete all windows but the frame's
selected one. */
- root = FVAR (f, selected_window);
+ root = FGET (f, selected_window);
Fdelete_other_windows_internal (root, Qnil);
if (horflag)
XSETFASTINT (WVAR (XWINDOW (root), total_cols), new_size);
if (EQ (FRAME_SELECTED_WINDOW (f), selected_window))
Fselect_window (new_selected_window, Qt);
else
- FRAME_SELECTED_WINDOW (f) = new_selected_window;
+ FSET (f, selected_window, new_selected_window);
UNBLOCK_INPUT;
if (EQ (FRAME_SELECTED_WINDOW (f), selected_window))
Fselect_window (new_selected_window, Qnil);
else
- FRAME_SELECTED_WINDOW (f) = new_selected_window;
+ FSET (f, selected_window, new_selected_window);
}
else
UNBLOCK_INPUT;
}
}
- FRAME_ROOT_WINDOW (f) = data->root_window;
+ FSET (f, root_window, data->root_window);
/* Arrange *not* to restore point in the buffer that was
current when the window configuration was saved. */
if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer))
struct frame *f = make_initial_frame ();
XSETFRAME (selected_frame, f);
Vterminal_frame = selected_frame;
- minibuf_window = FVAR (f, minibuffer_window);
- selected_window = FVAR (f, selected_window);
+ minibuf_window = FGET (f, minibuffer_window);
+ selected_window = FGET (f, selected_window);
last_nonminibuf_frame = f;
window_initialized = 1;
/* 1 if W is a menu bar window. */
#define WINDOW_MENU_BAR_P(W) \
- (WINDOWP (FVAR (WINDOW_XFRAME (W), menu_bar_window)) \
- && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), menu_bar_window)))
+ (WINDOWP (FGET (WINDOW_XFRAME (W), menu_bar_window)) \
+ && (W) == XWINDOW (FGET (WINDOW_XFRAME (W), menu_bar_window)))
/* 1 if W is a tool bar window. */
#define WINDOW_TOOL_BAR_P(W) \
- (WINDOWP (FVAR (WINDOW_XFRAME (W), tool_bar_window)) \
- && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), tool_bar_window)))
+ (WINDOWP (FGET (WINDOW_XFRAME (W), tool_bar_window)) \
+ && (W) == XWINDOW (FGET (WINDOW_XFRAME (W), tool_bar_window)))
/* Return the frame y-position at which window W starts.
This includes a header line, if any. */
/* Similarly to `with-selected-window', if the operation selects
a window on another frame, we must restore that frame's
selected window, and (for a tty) the top-frame. */
- ASET (vector, 8, FVAR (target_frame, selected_window));
+ ASET (vector, 8, FGET (target_frame, selected_window));
if (FRAME_TERMCAP_P (target_frame))
ASET (vector, 9, FRAME_TTY (target_frame)->top_frame);
}
format_mode_line_unwind_data
(f, current_buffer, selected_window, 0));
- Fselect_window (FVAR (f, selected_window), Qt);
+ Fselect_window (FGET (f, selected_window), Qt);
set_buffer_internal_1
- (XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer)));
+ (XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer)));
fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
mode_line_target = MODE_LINE_TITLE;
title_start = MODE_LINE_NOPROP_LEN (0);
- init_iterator (&it, XWINDOW (FVAR (f, selected_window)), -1, -1,
+ init_iterator (&it, XWINDOW (FGET (f, selected_window)), -1, -1,
NULL, DEFAULT_FACE_ID);
display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
len = MODE_LINE_NOPROP_LEN (title_start);
already wasted too much time by walking through the list with
display_mode_element, then we might need to optimize at a
higher level than this.) */
- if (! STRINGP (FVAR (f, name))
- || SBYTES (FVAR (f, name)) != len
- || memcmp (title, SDATA (FVAR (f, name)), len) != 0)
+ if (! STRINGP (FGET (f, name))
+ || SBYTES (FGET (f, name)) != len
+ || memcmp (title, SDATA (FGET (f, name)), len) != 0)
x_implicitly_set_name (f, make_string (title, len), Qnil);
}
}
&& FRAME_NS_P (f))
ns_set_doc_edited
(f, Fbuffer_modified_p
- (WVAR (XWINDOW (FVAR (f, selected_window)), buffer)));
+ (WVAR (XWINDOW (FGET (f, selected_window)), buffer)));
#endif
UNGCPRO;
}
}
XSETFRAME (Vmenu_updating_frame, f);
- FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
+ FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
/* Redisplay the menu bar in case we changed it. */
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
#if defined (USE_GTK) || defined (HAVE_NS)
int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
#else
- int do_update = WINDOWP (FVAR (f, tool_bar_window))
- && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0;
+ int do_update = WINDOWP (FGET (f, tool_bar_window))
+ && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))) > 0;
#endif
if (do_update)
/* Build desired tool-bar items from keymaps. */
new_tool_bar
- = tool_bar_items (Fcopy_sequence (FVAR (f, tool_bar_items)),
+ = tool_bar_items (Fcopy_sequence (FGET (f, tool_bar_items)),
&new_n_tool_bar);
/* Redisplay the tool-bar if we changed it. */
if (new_n_tool_bar != f->n_tool_bar_items
- || NILP (Fequal (new_tool_bar, FVAR (f, tool_bar_items))))
+ || NILP (Fequal (new_tool_bar, FGET (f, tool_bar_items))))
{
/* Redisplay that happens asynchronously due to an expose event
may access f->tool_bar_items. Make sure we update both
variables within BLOCK_INPUT so no such event interrupts. */
BLOCK_INPUT;
- FVAR (f, tool_bar_items) = new_tool_bar;
+ FSET (f, tool_bar_items, new_tool_bar);
f->n_tool_bar_items = new_n_tool_bar;
w->update_mode_line = 1;
UNBLOCK_INPUT;
Otherwise, make a new string. */
/* The size of the string we might be able to reuse. */
- size = (STRINGP (FVAR (f, desired_tool_bar_string))
- ? SCHARS (FVAR (f, desired_tool_bar_string))
+ size = (STRINGP (FGET (f, desired_tool_bar_string))
+ ? SCHARS (FGET (f, desired_tool_bar_string))
: 0);
/* We need one space in the string for each image. */
size_needed = f->n_tool_bar_items;
/* Reuse f->desired_tool_bar_string, if possible. */
- if (size < size_needed || NILP (FVAR (f, desired_tool_bar_string)))
- FVAR (f, desired_tool_bar_string)
- = Fmake_string (make_number (size_needed), make_number (' '));
+ if (size < size_needed || NILP (FGET (f, desired_tool_bar_string)))
+ FSET (f, desired_tool_bar_string,
+ Fmake_string (make_number (size_needed), make_number (' ')));
else
{
props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil);
Fremove_text_properties (make_number (0), make_number (size),
- props, FVAR (f, desired_tool_bar_string));
+ props, FGET (f, desired_tool_bar_string));
}
/* Put a `display' property on the string for the images to display,
for (i = 0; i < f->n_tool_bar_items; ++i)
{
#define PROP(IDX) \
- AREF (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX))
+ AREF (FGET (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX))
int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
string. The string can be longer than needed when we reuse a
previous string. */
if (i + 1 == f->n_tool_bar_items)
- end = SCHARS (FVAR (f, desired_tool_bar_string));
+ end = SCHARS (FGET (f, desired_tool_bar_string));
else
end = i + 1;
Fadd_text_properties (make_number (i), make_number (end),
- props, FVAR (f, desired_tool_bar_string));
+ props, FGET (f, desired_tool_bar_string));
#undef PROP
}
static int
tool_bar_lines_needed (struct frame *f, int *n_rows)
{
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (FGET (f, tool_bar_window));
struct it it;
/* tool_bar_lines_needed is called from redisplay_tool_bar after building
the desired matrix, so use (unused) mode-line row as temporary row to
init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
it.first_visible_x = 0;
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
- reseat_to_string (&it, NULL, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1);
+ reseat_to_string (&it, NULL, FGET (f, desired_tool_bar_string), 0, 0, 0, -1);
it.paragraph_embedding = L2R;
while (!ITERATOR_AT_END_P (&it))
CHECK_FRAME (frame);
f = XFRAME (frame);
- if (WINDOWP (FVAR (f, tool_bar_window))
- && (w = XWINDOW (FVAR (f, tool_bar_window)),
+ if (WINDOWP (FGET (f, tool_bar_window))
+ && (w = XWINDOW (FGET (f, tool_bar_window)),
WINDOW_TOTAL_LINES (w) > 0))
{
update_tool_bar (f, 1);
do anything. This means you must start with tool-bar-lines
non-zero to get the auto-sizing effect. Or in other words, you
can turn off tool-bars by specifying tool-bar-lines zero. */
- if (!WINDOWP (FVAR (f, tool_bar_window))
- || (w = XWINDOW (FVAR (f, tool_bar_window)),
+ if (!WINDOWP (FGET (f, tool_bar_window))
+ || (w = XWINDOW (FGET (f, tool_bar_window)),
WINDOW_TOTAL_LINES (w) == 0))
return 0;
/* Build a string that represents the contents of the tool-bar. */
build_desired_tool_bar_string (f);
- reseat_to_string (&it, NULL, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1);
+ reseat_to_string (&it, NULL, FGET (f, desired_tool_bar_string), 0, 0, 0, -1);
/* FIXME: This should be controlled by a user option. But it
doesn't make sense to have an R2L tool bar if the menu bar cannot
be drawn also R2L, and making the menu bar R2L is tricky due
/* This function can be called asynchronously, which means we must
exclude any possibility that Fget_text_property signals an
error. */
- charpos = min (SCHARS (FVAR (f, current_tool_bar_string)), glyph->charpos);
+ charpos = min (SCHARS (FGET (f, current_tool_bar_string)), glyph->charpos);
charpos = max (0, charpos);
/* Get the text property `menu-item' at pos. The value of that
property is the start index of this item's properties in
F->tool_bar_items. */
prop = Fget_text_property (make_number (charpos),
- Qmenu_item, FVAR (f, current_tool_bar_string));
+ Qmenu_item, FGET (f, current_tool_bar_string));
if (INTEGERP (prop))
{
*prop_idx = XINT (prop);
int *hpos, int *vpos, int *prop_idx)
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (FGET (f, tool_bar_window));
int area;
/* Find the glyph under X/Y. */
return -1;
/* Is mouse on the highlighted item? */
- if (EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)
+ if (EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)
&& *vpos >= hlinfo->mouse_face_beg_row
&& *vpos <= hlinfo->mouse_face_end_row
&& (*vpos > hlinfo->mouse_face_beg_row
int modifiers)
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (FGET (f, tool_bar_window));
int hpos, vpos, prop_idx;
struct glyph *glyph;
Lisp_Object enabled_p;
return;
/* If item is disabled, do nothing. */
- enabled_p = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P);
+ enabled_p = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P);
if (NILP (enabled_p))
return;
show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED;
- key = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_KEY);
+ key = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_KEY);
XSETFRAME (frame, f);
event.kind = TOOL_BAR_EVENT;
static void
note_tool_bar_highlight (struct frame *f, int x, int y)
{
- Lisp_Object window = FVAR (f, tool_bar_window);
+ Lisp_Object window = FGET (f, tool_bar_window);
struct window *w = XWINDOW (window);
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
/* If tool-bar item is not enabled, don't highlight it. */
- enabled_p = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P);
+ enabled_p = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P);
if (!NILP (enabled_p))
{
/* Compute the x-position of the glyph. In front and past the
XTread_socket does the rest. */
help_echo_object = help_echo_window = Qnil;
help_echo_pos = -1;
- help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP);
+ help_echo_string = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP);
if (NILP (help_echo_string))
- help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION);
+ help_echo_string = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION);
}
#endif /* HAVE_WINDOW_SYSTEM */
selected_frame = frame;
do {
- for (tail = FVAR (XFRAME (frame), param_alist);
+ for (tail = FGET (XFRAME (frame), param_alist);
CONSP (tail); tail = XCDR (tail))
if (CONSP (XCAR (tail))
&& (tem = XCAR (XCAR (tail)),
if (!f->already_hscrolled_p)
{
f->already_hscrolled_p = 1;
- if (hscroll_windows (FVAR (f, root_window)))
+ if (hscroll_windows (FGET (f, root_window)))
goto retry;
}
STOP_POLLING;
/* Update the display. */
- set_window_update_flags (XWINDOW (FVAR (f, root_window)), 1);
+ set_window_update_flags (XWINDOW (FGET (f, root_window)), 1);
pending |= update_frame (f, 0, 0);
f->updated_p = 1;
}
and selected_window to be temporarily out-of-sync but let's make
sure this stays contained. */
select_frame_for_redisplay (old_frame);
- eassert (EQ (FVAR (XFRAME (selected_frame), selected_window),
+ eassert (EQ (FGET (XFRAME (selected_frame), selected_window),
selected_window));
if (!pending)
struct frame *f = XFRAME (frame);
if (f->updated_p)
{
- mark_window_display_accurate (FVAR (f, root_window), 1);
+ mark_window_display_accurate (FGET (f, root_window), 1);
if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
FRAME_TERMINAL (f)->frame_up_to_date_hook (f);
}
if (FRAME_EXTERNAL_TOOL_BAR (f))
redisplay_tool_bar (f);
#else
- if (WINDOWP (FVAR (f, tool_bar_window))
+ if (WINDOWP (FGET (f, tool_bar_window))
&& (FRAME_TOOL_BAR_LINES (f) > 0
|| !NILP (Vauto_resize_tool_bars))
&& redisplay_tool_bar (f))
(Lisp_Object row, Lisp_Object glyphs)
{
struct frame *sf = SELECTED_FRAME ();
- struct glyph_matrix *m = XWINDOW (FVAR (sf, tool_bar_window))->current_matrix;
+ struct glyph_matrix *m = XWINDOW (FGET (sf, tool_bar_window))->current_matrix;
EMACS_INT vpos;
CHECK_NUMBER (row);
/* Menu bar lines are displayed in the desired matrix of the
dummy window menu_bar_window. */
struct window *menu_w;
- eassert (WINDOWP (FVAR (f, menu_bar_window)));
- menu_w = XWINDOW (FVAR (f, menu_bar_window));
+ eassert (WINDOWP (FGET (f, menu_bar_window)));
+ menu_w = XWINDOW (FGET (f, menu_bar_window));
init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
MENU_FACE_ID);
it.first_visible_x = 0;
case 'F':
/* %F displays the frame name. */
- if (!NILP (FVAR (f, title)))
- return SSDATA (FVAR (f, title));
+ if (!NILP (FGET (f, title)))
+ return SSDATA (FGET (f, title));
if (f->explicit_name || ! FRAME_WINDOW_P (f))
- return SSDATA (FVAR (f, name));
+ return SSDATA (FGET (f, name));
return "Emacs";
case 'f':
}
/* Detect a nonselected window or nonselected frame. */
- else if (w != XWINDOW (FVAR (f, selected_window))
+ else if (w != XWINDOW (FGET (f, selected_window))
|| f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)
{
*active_cursor = 0;
void
x_update_cursor (struct frame *f, int on_p)
{
- update_cursor_in_window_tree (XWINDOW (FVAR (f, root_window)), on_p);
+ update_cursor_in_window_tree (XWINDOW (FGET (f, root_window)), on_p);
}
if (FRAME_WINDOW_P (f))
{
if (draw == DRAW_NORMAL_TEXT
- && !EQ (hlinfo->mouse_face_window, FVAR (f, tool_bar_window)))
+ && !EQ (hlinfo->mouse_face_window, FGET (f, tool_bar_window)))
FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
else if (draw == DRAW_MOUSE_FACE)
FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
#ifdef HAVE_WINDOW_SYSTEM
/* Handle tool-bar window differently since it doesn't display a
buffer. */
- if (EQ (window, FVAR (f, tool_bar_window)))
+ if (EQ (window, FGET (f, tool_bar_window)))
{
note_tool_bar_highlight (f, x, y);
return;
}
TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height));
- mouse_face_overwritten_p = expose_window_tree (XWINDOW (FVAR (f, root_window)), &r);
+ mouse_face_overwritten_p = expose_window_tree (XWINDOW (FGET (f, root_window)), &r);
- if (WINDOWP (FVAR (f, tool_bar_window)))
+ if (WINDOWP (FGET (f, tool_bar_window)))
mouse_face_overwritten_p
- |= expose_window (XWINDOW (FVAR (f, tool_bar_window)), &r);
+ |= expose_window (XWINDOW (FGET (f, tool_bar_window)), &r);
#ifdef HAVE_X_WINDOWS
#ifndef MSDOS
#ifndef USE_X_TOOLKIT
- if (WINDOWP (FVAR (f, menu_bar_window)))
+ if (WINDOWP (FGET (f, menu_bar_window)))
mouse_face_overwritten_p
- |= expose_window (XWINDOW (FVAR (f, menu_bar_window)), &r);
+ |= expose_window (XWINDOW (FGET (f, menu_bar_window)), &r);
#endif /* not USE_X_TOOLKIT */
#endif
#endif
Lisp_Object lface;
if (f)
- lface = assq_no_quit (face_name, FVAR (f, face_alist));
+ lface = assq_no_quit (face_name, FGET (f, face_alist));
else
lface = assq_no_quit (face_name, Vface_new_frame_defaults);
lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE),
Qunspecified);
ASET (lface, 0, Qface);
- FVAR (f, face_alist) = Fcons (Fcons (face, lface), FVAR (f,
- face_alist));
+ FSET (f, face_alist,
+ Fcons (Fcons (face, lface), FGET (f, face_alist)));
}
else
for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
/* If there are no faces yet, give up. This is the case when called
from Fx_create_frame, and we do the necessary things later in
face-set-after-frame-defaults. */
- if (NILP (FVAR (f, face_alist)))
+ if (NILP (FGET (f, face_alist)))
return;
if (EQ (param, Qforeground_color))
(Lisp_Object frame)
{
struct frame *f = frame_or_selected_frame (frame, 0);
- return FVAR (f, face_alist);
+ return FGET (f, face_alist);
}
matrices as invalid because they will reference faces freed
above. This function is also called when a frame is
destroyed. In this case, the root window of F is nil. */
- if (WINDOWP (FVAR (f, root_window)))
+ if (WINDOWP (FGET (f, root_window)))
{
clear_current_matrices (f);
++windows_or_buffers_changed;
{
frame = XCAR (fl_tail);
if (!NILP (Fequal (Fcdr (Fassq (Qdisplay,
- FVAR (XFRAME (frame), param_alist))),
+ FGET (XFRAME (frame), param_alist))),
display)))
break;
}
{
/* This function is called so early that colors are not yet
set in the frame parameter list. */
- Lisp_Object color = Fassq (Qforeground_color, FVAR (f, param_alist));
+ Lisp_Object color = Fassq (Qforeground_color, FGET (f, param_alist));
if (CONSP (color) && STRINGP (XCDR (color)))
ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color));
{
/* This function is called so early that colors are not yet
set in the frame parameter list. */
- Lisp_Object color = Fassq (Qbackground_color, FVAR (f, param_alist));
+ Lisp_Object color = Fassq (Qbackground_color, FGET (f, param_alist));
if (CONSP (color) && STRINGP (XCDR (color)))
ASET (lface, LFACE_BACKGROUND_INDEX, XCDR (color));
else if (FRAME_WINDOW_P (f))
#ifdef USE_GTK
if (xg_change_toolbar_position (f, new_value))
- FVAR (f, tool_bar_position) = new_value;
+ FSET (f, tool_bar_position, new_value);
#endif
}
BLOCK_INPUT;
if (NILP (arg))
result = x_text_icon (f,
- SSDATA ((!NILP (FVAR (f, icon_name))
- ? FVAR (f, icon_name)
- : FVAR (f, name))));
+ SSDATA ((!NILP (FGET (f, icon_name))
+ ? FGET (f, icon_name)
+ : FGET (f, name))));
else
result = x_bitmap_icon (f, arg);
else if (!NILP (arg) || NILP (oldval))
return;
- FVAR (f, icon_name) = arg;
+ FSET (f, icon_name, arg);
if (f->output_data.x->icon_bitmap != 0)
return;
BLOCK_INPUT;
result = x_text_icon (f,
- SSDATA ((!NILP (FVAR (f, icon_name))
- ? FVAR (f, icon_name)
- : !NILP (FVAR (f, title))
- ? FVAR (f, title)
- : FVAR (f, name))));
+ SSDATA ((!NILP (FGET (f, icon_name))
+ ? FGET (f, icon_name)
+ : !NILP (FGET (f, title))
+ ? FGET (f, title)
+ : FGET (f, name))));
if (result)
{
UNBLOCK_INPUT;
}
- if (nlines == 0 && WINDOWP (FVAR (f, menu_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix);
+ if (nlines == 0 && WINDOWP (FGET (f, menu_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->current_matrix);
}
#endif /* not USE_X_TOOLKIT && not USE_GTK */
adjust_glyphs (f);
UNBLOCK_INPUT;
}
- if (WINDOWP (FVAR (f, tool_bar_window)))
- clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix);
+ if (WINDOWP (FGET (f, tool_bar_window)))
+ clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix);
}
run_window_configuration_change_hook (f);
if (text.nitems != bytes)
error ("Window name too large");
- if (!STRINGP (FVAR (f, icon_name)))
+ if (!STRINGP (FGET (f, icon_name)))
{
icon = text;
encoded_icon_name = encoded_name;
else
{
/* See the above comment "Note: Encoding strategy". */
- icon.value = x_encode_text (FVAR (f, icon_name), coding_system, 0,
+ icon.value = x_encode_text (FGET (f, icon_name), coding_system, 0,
&bytes, &stringp, &do_free_icon_value);
icon.encoding = (stringp ? XA_STRING
: FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
if (icon.nitems != bytes)
error ("Icon name too large");
- encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name));
+ encoded_icon_name = ENCODE_UTF_8 (FGET (f, icon_name));
}
#ifdef USE_GTK
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name,
- SSDATA (FVAR (f, name))))
+ SSDATA (FGET (f, name))))
return;
name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);
}
CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
- if (! NILP (Fstring_equal (name, FVAR (f, name))))
+ if (! NILP (Fstring_equal (name, FGET (f, name))))
return;
- FVAR (f, name) = name;
+ FSET (f, name, name);
/* For setting the frame title, the title parameter should override
the name parameter. */
- if (! NILP (FVAR (f, title)))
- name = FVAR (f, title);
+ if (! NILP (FGET (f, title)))
+ name = FGET (f, title);
x_set_name_internal (f, name);
}
x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
- if (EQ (name, FVAR (f, title)))
+ if (EQ (name, FGET (f, title)))
return;
update_mode_lines = 1;
- FVAR (f, title) = name;
+ FSET (f, title, name);
if (NILP (name))
- name = FVAR (f, name);
+ name = FGET (f, name);
else
CHECK_STRING (name);
int explicit = f->explicit_name;
f->explicit_name = 0;
- name = FVAR (f, name);
- FVAR (f, name) = Qnil;
+ name = FGET (f, name);
+ FSET (f, name, Qnil);
x_set_name (f, name, explicit);
}
int explicit = f->explicit_name;
f->explicit_name = 0;
- name = FVAR (f, name);
- FVAR (f, name) = Qnil;
+ name = FGET (f, name);
+ FSET (f, name, Qnil);
x_set_name (f, name, explicit);
}
: NormalState));
#endif
- x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name))
- ? FVAR (f, icon_name)
- : FVAR (f, name))));
+ x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name))
+ ? FGET (f, icon_name)
+ : FGET (f, name))));
UNBLOCK_INPUT;
}
f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
#endif /* USE_TOOLKIT_SCROLL_BARS */
- FVAR (f, icon_name)
- = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
- RES_TYPE_STRING);
- if (! STRINGP (FVAR (f, icon_name)))
- FVAR (f, icon_name) = Qnil;
+ FSET (f, icon_name,
+ x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
+ RES_TYPE_STRING));
+ if (! STRINGP (FGET (f, icon_name)))
+ FSET (f, icon_name, Qnil);
FRAME_X_DISPLAY_INFO (f) = dpyinfo;
be set. */
if (EQ (name, Qunbound) || NILP (name))
{
- FVAR (f, name) = build_string (dpyinfo->x_id_name);
+ FSET (f, name, build_string (dpyinfo->x_id_name));
f->explicit_name = 0;
}
else
{
- FVAR (f, name) = name;
+ FSET (f, name, name);
f->explicit_name = 1;
/* use the frame's title when getting resources for this frame. */
specbind (Qx_resource_name, name);
x_default_parameter (f, parms, Qfullscreen, Qnil,
"fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
x_default_parameter (f, parms, Qtool_bar_position,
- FVAR (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL);
+ FGET (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL);
/* Compute the size of the X window. */
window_prompting = x_figure_window_size (f, parms, 1);
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))))
- FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist));
+ FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist)));
UNGCPRO;
f->output_data.x->scroll_bar_top_shadow_pixel = -1;
f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
#endif /* USE_TOOLKIT_SCROLL_BARS */
- FVAR (f, icon_name) = Qnil;
+ FSET (f, icon_name, Qnil);
FRAME_X_DISPLAY_INFO (f) = dpyinfo;
f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
f->output_data.x->explicit_parent = 0;
be set. */
if (EQ (name, Qunbound) || NILP (name))
{
- FVAR (f, name) = build_string (dpyinfo->x_id_name);
+ FSET (f, name, build_string (dpyinfo->x_id_name));
f->explicit_name = 0;
}
else
{
- FVAR (f, name) = name;
+ FSET (f, name, name);
f->explicit_name = 1;
/* use the frame's title when getting resources for this frame. */
specbind (Qx_resource_name, name);
if (!f)
return;
find_and_call_menu_selection (f, f->menu_bar_items_used,
- FVAR (f, menu_bar_vector), client_data);
+ FGET (f, menu_bar_vector), client_data);
}
#endif /* not USE_GTK */
\f
if (! NILP (Vlucid_menu_bar_dirty_flag))
call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
- FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
+ FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
items = FRAME_MENU_BAR_ITEMS (f);
/* Save the frame's previous menu bar contents data. */
if (previous_menu_items_used)
- memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents,
+ memcpy (previous_items, XVECTOR (FGET (f, menu_bar_vector))->contents,
previous_menu_items_used * word_size);
/* Fill in menu_items with the current menu bar contents.
This can evaluate Lisp code. */
save_menu_items ();
- menu_items = FVAR (f, menu_bar_vector);
+ menu_items = FGET (f, menu_bar_vector);
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
subitems = ASIZE (items) / 4;
submenu_start = alloca ((subitems + 1) * sizeof *submenu_start);
}
/* The menu items are different, so store them in the frame. */
- FVAR (f, menu_bar_vector) = menu_items;
+ FSET (f, menu_bar_vector, menu_items);
f->menu_bar_items_used = menu_items_used;
/* This undoes save_menu_items. */
{
/* This function is called before the first chance to redisplay
the frame. It has to be, so the frame will have the right size. */
- FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
+ FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
set_frame_menubar (f, 1, 1);
}
: dpyinfo->x_focus_frame);
if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
{
- FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame) = Qnil;
+ FSET (dpyinfo->x_focus_frame, focus_frame, Qnil);
dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame;
}
}
struct frame *f = XFRAME (WVAR (w, frame));
struct scroll_bar *bar
= ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER);
+ Lisp_Object barobj;
BLOCK_INPUT;
/* Add bar to its frame's list of scroll bars. */
bar->next = FRAME_SCROLL_BARS (f);
bar->prev = Qnil;
- XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
+ XSETVECTOR (barobj, bar);
+ FSET (f, scroll_bars, barobj);
if (!NILP (bar->next))
XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
{
Lisp_Object bar;
bar = FRAME_SCROLL_BARS (frame);
- FRAME_SCROLL_BARS (frame) = XSCROLL_BAR (bar)->next;
+ FSET (frame, scroll_bars, XSCROLL_BAR (bar)->next);
XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
XSCROLL_BAR (bar)->prev = Qnil;
if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar;
- FRAME_CONDEMNED_SCROLL_BARS (frame) = bar;
+ FSET (frame, condemned_scroll_bars, bar);
}
}
{
struct scroll_bar *bar;
struct frame *f;
+ Lisp_Object barobj;
/* We can't redeem this window's scroll bar if it doesn't have one. */
if (NILP (WVAR (window, vertical_scroll_bar)))
return;
else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
WVAR (window, vertical_scroll_bar)))
- FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
+ FSET (f, condemned_scroll_bars, bar->next);
else
/* If its prev pointer is nil, it must be at the front of
one or the other! */
bar->next = FRAME_SCROLL_BARS (f);
bar->prev = Qnil;
- XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
+ XSETVECTOR (barobj, bar);
+ FSET (f, scroll_bars, barobj);
if (! NILP (bar->next))
XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
}
/* Clear out the condemned list now so we won't try to process any
more events on the hapless scroll bars. */
- FRAME_CONDEMNED_SCROLL_BARS (f) = Qnil;
+ FSET (f, condemned_scroll_bars, Qnil);
for (; ! NILP (bar); bar = next)
{
mouse highlighting. */
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& (f == 0
- || !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)))
+ || !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)))
{
clear_mouse_face (hlinfo);
hlinfo->mouse_face_hidden = 1;
if (f)
{
/* Is this in the tool-bar? */
- if (WINDOWP (FVAR (f, tool_bar_window))
- && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))))
+ if (WINDOWP (FGET (f, tool_bar_window))
+ && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))))
{
Lisp_Object window;
int x = event.xbutton.x;
int y = event.xbutton.y;
window = window_from_coordinates (f, x, y, 0, 1);
- tool_bar_p = EQ (window, FVAR (f, tool_bar_window));
+ tool_bar_p = EQ (window, FGET (f, tool_bar_window));
if (tool_bar_p && event.xbutton.button < 4)
{
}
#ifdef HAVE_X_I18N
- if (w == XWINDOW (FVAR (f, selected_window)))
+ if (w == XWINDOW (FGET (f, selected_window)))
if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMPreeditPosition))
xic_set_preeditarea (w, x, y);
#endif
xic_set_statusarea (f);
if (FRAME_XIC_STYLE (f) & XIMPreeditPosition)
{
- struct window *w = XWINDOW (FVAR (f, selected_window));
+ struct window *w = XWINDOW (FGET (f, selected_window));
xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
}
}
#endif /* not USE_GTK */
/* If cursor was outside the new size, mark it as off. */
- mark_window_cursors_off (XWINDOW (FVAR (f, root_window)));
+ mark_window_cursors_off (XWINDOW (FGET (f, root_window)));
/* Clear out any recollection of where the mouse highlighting was,
since it might be in a place that's outside the new frame size.