Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
Lisp_Object Qvisible;
Lisp_Object Qdisplay_type;
-Lisp_Object Qbackground_mode;
+static Lisp_Object Qbackground_mode;
Lisp_Object Qnoelisp;
-Lisp_Object Qx_frame_parameter;
+static Lisp_Object Qx_frame_parameter;
Lisp_Object Qx_resource_name;
Lisp_Object Qterminal;
Lisp_Object Qterminal_live_p;
Lisp_Object Qauto_raise, Qauto_lower;
Lisp_Object Qborder_color, Qborder_width;
Lisp_Object Qcursor_color, Qcursor_type;
-Lisp_Object Qgeometry; /* Not used */
+static Lisp_Object Qgeometry; /* Not used */
Lisp_Object Qheight, Qwidth;
Lisp_Object Qleft, Qright;
Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
Lisp_Object Qscreen_gamma;
Lisp_Object Qline_spacing;
-Lisp_Object Quser_position, Quser_size;
+static Lisp_Object Quser_position, Quser_size;
Lisp_Object Qwait_for_wm;
-Lisp_Object Qwindow_id;
+static Lisp_Object Qwindow_id;
#ifdef HAVE_X_WINDOWS
-Lisp_Object Qouter_window_id;
+static Lisp_Object Qouter_window_id;
#endif
Lisp_Object Qparent_id;
Lisp_Object Qtitle, Qname;
-Lisp_Object Qexplicit_name;
+static Lisp_Object Qexplicit_name;
Lisp_Object Qunsplittable;
Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position;
Lisp_Object Qleft_fringe, Qright_fringe;
-Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
+Lisp_Object Qbuffer_predicate;
+static Lisp_Object Qbuffer_list, Qburied_buffer_list;
Lisp_Object Qtty_color_mode;
Lisp_Object Qtty, Qtty_type;
static Lisp_Object Qdelete_frame_functions;
+#ifdef HAVE_WINDOW_SYSTEM
+static void x_report_frame_params (struct frame *, Lisp_Object *);
+#endif
+
\f
static void
set_menu_bar_lines_1 (Lisp_Object window, int n)
XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n);
XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n);
- if (INTEGERP (w->orig_top_line))
- XSETFASTINT (w->orig_top_line, XFASTINT (w->orig_top_line) + n);
- if (INTEGERP (w->orig_total_lines))
- XSETFASTINT (w->orig_total_lines, XFASTINT (w->orig_total_lines) - n);
-
/* Handle just the top child in a vertical split. */
if (!NILP (w->vchild))
set_menu_bar_lines_1 (w->vchild, n);
/* If buf is a 'hidden' buffer (i.e. one whose name starts with
a space), try to find another one. */
if (SREF (Fbuffer_name (buf), 0) == ' ')
- buf = Fother_buffer (buf, Qnil, Qnil);
+ buf = other_buffer_safely (buf);
/* Use set_window_buffer, not Fset_window_buffer, and don't let
hooks be run by it. The reason is that the whole frame/window
/* The default value of menu-bar-mode is t. */
set_menu_bar_lines (f, make_number (1), Qnil);
-#ifdef CANNOT_DUMP
if (!noninteractive)
init_frame_faces (f);
-#endif
return f;
}
-struct frame *
+static struct frame *
make_terminal_frame (struct terminal *terminal)
{
register struct frame *f;
{
/* Preserve prefix arg that the command loop just cleared. */
KVAR (current_kboard, Vprefix_arg) = Vcurrent_prefix_arg;
- call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
+ Frun_hooks (1, &Qmouse_leave_buffer_hook);
return do_switch_frame (event, 0, 0, Qnil);
}
{
return selected_frame;
}
-\f
-DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
- doc: /* Return the frame object that window WINDOW is on. */)
- (Lisp_Object window)
-{
- CHECK_LIVE_WINDOW (window);
- return XWINDOW (window)->frame;
-}
-
-DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
- doc: /* Returns the topmost, leftmost window of FRAME.
-If omitted, FRAME defaults to the currently selected frame. */)
- (Lisp_Object frame)
-{
- Lisp_Object w;
-
- if (NILP (frame))
- w = SELECTED_FRAME ()->root_window;
- else
- {
- CHECK_LIVE_FRAME (frame);
- w = XFRAME (frame)->root_window;
- }
- while (NILP (XWINDOW (w)->buffer))
- {
- if (! NILP (XWINDOW (w)->hchild))
- w = XWINDOW (w)->hchild;
- else if (! NILP (XWINDOW (w)->vchild))
- w = XWINDOW (w)->vchild;
- else
- abort ();
- }
- return w;
-}
-
-DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
- Sactive_minibuffer_window, 0, 0, 0,
- doc: /* Return the currently active minibuffer window, or nil if none. */)
- (void)
-{
- return minibuf_level ? minibuf_window : Qnil;
-}
-
-DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
- doc: /* Returns the root-window of FRAME.
-If omitted, FRAME defaults to the currently selected frame. */)
- (Lisp_Object frame)
-{
- Lisp_Object window;
-
- if (NILP (frame))
- window = SELECTED_FRAME ()->root_window;
- else
- {
- CHECK_LIVE_FRAME (frame);
- window = XFRAME (frame)->root_window;
- }
-
- return window;
-}
-
-DEFUN ("frame-selected-window", Fframe_selected_window,
- Sframe_selected_window, 0, 1, 0,
- doc: /* Return the selected window of FRAME.
-FRAME defaults to the currently selected frame. */)
- (Lisp_Object frame)
-{
- Lisp_Object window;
-
- if (NILP (frame))
- window = SELECTED_FRAME ()->selected_window;
- else
- {
- CHECK_LIVE_FRAME (frame);
- window = XFRAME (frame)->selected_window;
- }
-
- return window;
-}
-
-DEFUN ("set-frame-selected-window", Fset_frame_selected_window,
- Sset_frame_selected_window, 2, 3, 0,
- doc: /* Set selected window of FRAME to WINDOW.
-If FRAME is nil, use the selected frame. If FRAME is the
-selected frame, this makes WINDOW the selected window.
-Optional argument NORECORD non-nil means to neither change the
-order of recently selected windows nor the buffer list.
-Return WINDOW. */)
- (Lisp_Object frame, Lisp_Object window, Lisp_Object norecord)
-{
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
- CHECK_LIVE_WINDOW (window);
-
- if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
- error ("In `set-frame-selected-window', WINDOW is not on FRAME");
-
- if (EQ (frame, selected_frame))
- return Fselect_window (window, norecord);
-
- return XFRAME (frame)->selected_window = window;
-}
-
\f
DEFUN ("frame-list", Fframe_list, Sframe_list,
0, 0, 0,
0 if all frames aside from F are invisible.
(Exception: if F is the terminal frame, and we are using X, return 1.) */
-int
+static int
other_visible_frames (FRAME_PTR f)
{
/* We know the selected frame is visible,
return 1;
}
+DEFUN ("other-visible-frames-p", Fother_visible_frames_p, Sother_visible_frames_p, 0, 1, 0,
+ doc: /* Return t if there are other visible frames beside FRAME.
+FRAME defaults to the selected frame. */)
+ (Lisp_Object frame)
+{
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame);
+ return other_visible_frames (XFRAME (frame)) ? Qt : Qnil;
+}
+
/* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME
unconditionally. x_connection_closed and delete_terminal use
this. Any other value of FORCE implements the semantics
= Fcons (list3 (Qrun_hook_with_args, Qdelete_frame_functions, frame),
pending_funcalls);
else
- safe_call2 (Qrun_hook_with_args, Qdelete_frame_functions, frame);
+ {
+#ifdef HAVE_X_WINDOWS
+ /* Also, save clipboard to the the clipboard manager. */
+ x_clipboard_manager_save_frame (frame);
+#endif
+
+ safe_call2 (Qrun_hook_with_args, Qdelete_frame_functions, frame);
+ }
/* The hook may sometimes (indirectly) cause the frame to be deleted. */
if (! FRAME_LIVE_P (f))
/* Mark all the windows that used to be on FRAME as deleted, and then
remove the reference to them. */
- delete_all_subwindows (XWINDOW (f->root_window));
+ delete_all_subwindows (f->root_window);
f->root_window = Qnil;
Vframe_list = Fdelq (frame, Vframe_list);
enum scroll_bar_part party_dummy;
Lisp_Object x, y, retval;
int col, row;
- unsigned long long_dummy;
+ Time long_dummy;
struct gcpro gcpro1;
f = SELECTED_FRAME ();
Lisp_Object lispy_dummy;
enum scroll_bar_part party_dummy;
Lisp_Object x, y;
- unsigned long long_dummy;
+ Time long_dummy;
f = SELECTED_FRAME ();
x = y = Qnil;
\f
/* Return the value of frame parameter PROP in frame FRAME. */
+#if !HAVE_NS
+static
+#endif
Lisp_Object
get_frame_param (register struct frame *frame, Lisp_Object prop)
{
/* Return the buffer-list of the selected frame. */
-Lisp_Object
+static Lisp_Object
frame_buffer_list (Lisp_Object frame)
{
return XFRAME (frame)->buffer_list;
}
-/* Set the buffer-list of the selected frame. */
-
-void
-set_frame_buffer_list (Lisp_Object frame, Lisp_Object list)
-{
- XFRAME (frame)->buffer_list = list;
-}
-
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
void
static int
frame_name_fnn_p (char *str, EMACS_INT len)
{
- if (len > 1 && str[0] == 'F')
+ if (len > 1 && str[0] == 'F' && '0' <= str[1] && str[1] <= '9')
{
- char *end_ptr;
- long int n;
- errno = 0;
- n = strtol (str + 1, &end_ptr, 10);
-
- if (end_ptr == str + len
- && INT_MIN <= n && n <= INT_MAX
- && ((LONG_MIN < n && n < LONG_MAX) || errno != ERANGE))
+ char *p = str + 2;
+ while ('0' <= *p && *p <= '9')
+ p++;
+ if (p == str + len)
return 1;
}
return 0;
}
/* Now process them in reverse of specified order. */
- for (i--; i >= 0; i--)
+ while (--i >= 0)
{
prop = parms[i];
val = values[i];
{"tool-bar-position", &Qtool_bar_position},
};
-#ifdef HAVE_WINDOW_SYSTEM
+#ifdef WINDOWSNT
/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the
wanted positions of the WM window (not Emacs window).
*height = newheight;
}
+#endif /* WINDOWSNT */
+
+#ifdef HAVE_WINDOW_SYSTEM
/* Change the parameters of frame F as specified by ALIST.
If a parameter is not specially recognized, do nothing special;
/* Record in these vectors all the parms specified. */
Lisp_Object *parms;
Lisp_Object *values;
- int i, p;
+ size_t i, p;
int left_no_change = 0, top_no_change = 0;
int icon_left_no_change = 0, icon_top_no_change = 0;
int size_changed = 0;
}
/* Now process them in reverse of specified order. */
- for (i--; i >= 0; i--)
+ while (i-- != 0)
{
Lisp_Object prop, val;
return;
/* If name is entirely invalid, or nearly so, use `emacs'. */
- if (good_count == 0
- || (good_count == 1 && bad_count > 0))
+ if (good_count < 2)
{
Vx_resource_name = build_string ("emacs");
return;
class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
+ strlen (class) + 2);
- sprintf (name_key, "%s.%s", SDATA (Vinvocation_name), attribute);
+ sprintf (name_key, "%s.%s", SSDATA (Vinvocation_name), attribute);
sprintf (class_key, "%s.%s", EMACS_CLASS, class);
return x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb,
staticpro (&Vframe_list);
- defsubr (&Sactive_minibuffer_window);
defsubr (&Sframep);
defsubr (&Sframe_live_p);
defsubr (&Swindow_system);
defsubr (&Shandle_switch_frame);
defsubr (&Sselect_frame);
defsubr (&Sselected_frame);
- defsubr (&Swindow_frame);
- defsubr (&Sframe_root_window);
- defsubr (&Sframe_first_window);
- defsubr (&Sframe_selected_window);
- defsubr (&Sset_frame_selected_window);
defsubr (&Sframe_list);
defsubr (&Snext_frame);
defsubr (&Sprevious_frame);
+ defsubr (&Sother_visible_frames_p);
defsubr (&Sdelete_frame);
defsubr (&Smouse_position);
defsubr (&Smouse_pixel_position);