]> code.delx.au - gnu-emacs/blobdiff - src/frame.c
* xterm.c (XTread_socket): Turn off ControlMask for XLookupString.
[gnu-emacs] / src / frame.c
index 7d70b88dc1cb039b7384934e27cdd36a55ca2adf..e11a90affb69f9aacbdcd93fcbbcde28a41a113f 100644 (file)
@@ -82,6 +82,7 @@ Lisp_Object Qmodeline;
 Lisp_Object Qname;
 Lisp_Object Qonly;
 Lisp_Object Qunsplittable;
+Lisp_Object Qmenu_bar_lines;
 Lisp_Object Qwidth;
 Lisp_Object Qx;
 
@@ -162,6 +163,7 @@ make_frame (mini_p)
   f->param_alist = Qnil;
   f->scroll_bars = Qnil;
   f->condemned_scroll_bars = Qnil;
+  f->face_alist = Qnil;
 
   root_window = make_window ();
   if (mini_p)
@@ -323,17 +325,27 @@ make_terminal_frame ()
 }
 \f
 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
-  "Select the frame FRAME.  FRAME's selected window becomes \"the\"\n\
-selected window.  If the optional parameter NO-ENTER is non-nil, don't\n\
-focus on that frame.\n\
-\n\
-This function is interactive, and may be bound to the ``switch-frame''\n\
-event; when invoked this way, it switches to the frame named in the\n\
-event.  When called from lisp, FRAME may be a ``switch-frame'' event;\n\
-if it is, select the frame named in the event.\n\
+  "Select the frame FRAME.\n\
+Subseqent editing commands apply to its selected window.\n\
+The selection of FRAME lasts until the next time the user does\n\
+something to select a different frame, or until the next time this\n\
+function is called.")
+  (frame, no_enter)
+    Lisp_Object frame, no_enter;
+{
+  return Fhandle_switch_frame (frame, no_enter);
+}
+
+
+DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e",
+  "Handle a switch-frame event EVENT.\n\
+Switch-frame events is usually bound to this function.\n\
+A switch-frame event tells Emacs that the window manager has requested\n\
+that the user's events be directed to the frame mentioned in the event.\n\
+This function selects the selected window of the frame of EVENT.\n\
 \n\
-Changing the selected frame can change focus redirections.  See\n\
-`redirect-frame-focus' for details.")
+If EVENT is frame object, handle it as if it were a switch-frame event\n\
+to that frame.")
   (frame, no_enter)
      Lisp_Object frame, no_enter;
 {
@@ -640,7 +652,7 @@ A frame may not be deleted if its minibuffer is used by other frames.")
 
   /* Don't let the frame remain selected.  */
   if (f == selected_frame)
-    Fselect_frame (next_frame (frame, Qt), Qnil);
+    Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
 
   /* Don't allow minibuf_window to remain on a deleted frame.  */
   if (EQ (f->minibuffer_window, minibuf_window))
@@ -891,7 +903,7 @@ DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
 }
 
 
-DEFUN ("frame-to-front", Fframe_to_front, Sframe_to_front, 1, 1, 0,
+DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 1, 1, 0,
   "Bring FRAME to the front, so it occludes any frames it overlaps.\n\
 If FRAME is invisible, make it visible.\n\
 If Emacs is displaying on an ordinary terminal or some other device which\n\
@@ -907,7 +919,8 @@ doesn't support multiple overlapping frames, this function does nothing.")
   return Qnil;
 }
 
-DEFUN ("frame-to-back", Fframe_to_back, Sframe_to_back, 1, 1, 0,
+/* Should we have a corresponding function called Flower_Power?  */
+DEFUN ("lower-frame", Flower_frame, Slower_frame, 1, 1, 0,
   "Send FRAME to the back, so it is occluded by any frames that overlap it.\n\
 If Emacs is displaying on an ordinary terminal or some other device which\n\
 doesn't support multiple overlapping frames, this function does nothing.")
@@ -1065,6 +1078,7 @@ If FRAME is omitted, return information on the currently selected frame.")
                   : (FRAME_MINIBUF_ONLY_P (f) ? Qonly
                    : FRAME_MINIBUF_WINDOW (f))));
   store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil));
+  store_in_alist (&alist, Qmenu_bar_lines, (FRAME_MENU_BAR_LINES (f)));
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_X_WINDOWS
@@ -1421,6 +1435,8 @@ syms_of_frame ()
   staticpro (&Qwidth);
   Qx = intern ("x");
   staticpro (&Qx);
+  Qmenu_bar_lines = intern ("menu-bar-lines");
+  staticpro (&Qmenu_bar_lines);
 
   staticpro (&Vframe_list);
 
@@ -1458,6 +1474,7 @@ For values specific to the separate minibuffer frame, see\n\
 
   defsubr (&Sframep);
   defsubr (&Sframe_live_p);
+  defsubr (&Shandle_switch_frame);
   defsubr (&Sselect_frame);
   defsubr (&Sselected_frame);
   defsubr (&Swindow_frame);
@@ -1477,8 +1494,8 @@ For values specific to the separate minibuffer frame, see\n\
   defsubr (&Siconify_frame);
   defsubr (&Sframe_visible_p);
   defsubr (&Svisible_frame_list);
-  defsubr (&Sframe_to_front);
-  defsubr (&Sframe_to_back);
+  defsubr (&Sraise_frame);
+  defsubr (&Slower_frame);
   defsubr (&Sredirect_frame_focus);
   defsubr (&Sframe_focus);
   defsubr (&Sframe_parameters);
@@ -1498,7 +1515,7 @@ For values specific to the separate minibuffer frame, see\n\
 
 keys_of_frame ()
 {
-  initial_define_lispy_key (global_map, "switch-frame", "select-frame");
+  initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame");
 }
 \f
 #else /* not MULTI_FRAME */
@@ -1557,16 +1574,20 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
   return Qnil;
 }
 
-DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0,
-  "Return number of lines available for display on selected frame.")
-  ()
+DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 1, 0,
+  "Return number of lines available for display on FRAME.\n\
+If FRAME is omitted, describe the currently selected frame.")
+  (frame)
+    Lisp_Object frame;
 {
   return make_number (FRAME_HEIGHT (selected_frame));
 }
 
-DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0,
-  "Return number of columns available for display on selected frame.")
-  ()
+DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 1, 0,
+  "Return number of columns available for display on FRAME.\n\
+If FRAME is omitted, describe the currently selected frame.")
+  (frame)
+    Lisp_Object frame;
 {
   return make_number (FRAME_WIDTH (selected_frame));
 }