diff src/frame-tty.c @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents abe6d1db359e
children e38acbeb1cae
line wrap: on
line diff
--- a/src/frame-tty.c	Fri Mar 08 13:33:14 2002 +0000
+++ b/src/frame-tty.c	Wed Mar 13 08:54:06 2002 +0000
@@ -1,7 +1,6 @@
 /* TTY frame functions.
-   Copyright (C) 1995  Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996 Ben Wing.
-   Copyright (C) 1997  Free Software Foundation, Inc.
+   Copyright (C) 1995, 1997  Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -37,11 +36,14 @@
 /* Default properties to use when creating frames.  */
 Lisp_Object Vdefault_tty_frame_plist;
 
+Lisp_Object Qframe_number;
+
 static void tty_raise_frame (struct frame *);
 
 
 static void
-tty_init_frame_1 (struct frame *f, Lisp_Object props)
+tty_init_frame_1 (struct frame *f, Lisp_Object props,
+		  int frame_name_is_defaulted)
 {
   struct device *d = XDEVICE (FRAME_DEVICE (f));
   struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
@@ -50,6 +52,8 @@
   f->order_count = CONSOLE_TTY_DATA (c)->frame_count;
   f->height = CONSOLE_TTY_DATA (c)->height;
   f->width = CONSOLE_TTY_DATA (c)->width;
+  if (frame_name_is_defaulted)
+    f->name = emacs_sprintf_string ("F%d", f->order_count);
 }
 
 static void
@@ -86,7 +90,7 @@
 static void
 tty_make_frame_visible (struct frame *f)
 {
-  if (!FRAME_VISIBLE_P(f))
+  if (!FRAME_VISIBLE_P (f))
     {
       f->visible = -1;
     }
@@ -108,9 +112,9 @@
 static void
 tty_make_frame_unhidden (struct frame *f)
 {
-  if (!FRAME_REPAINT_P(f))
+  if (!FRAME_REPAINT_P (f))
     {
-      SET_FRAME_CLEAR(f);
+      SET_FRAME_CLEAR (f);
       f->visible = 1;
     }
 }
@@ -160,7 +164,7 @@
 
   /* To lower this frame, another frame has to be raised.  Return if
      there is no other frame. */
-  if (NILP (tail) && EQ(frame_list, tail))
+  if (NILP (tail) && EQ (frame_list, tail))
     return;
 
   tty_make_frame_hidden (f);
@@ -180,6 +184,31 @@
   if (!NILP (DEVICE_SELECTED_FRAME (d)))
     tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d)));
 }
+
+static Lisp_Object
+tty_frame_property (struct frame *f, Lisp_Object property)
+{
+  if (EQ (Qframe_number, property))
+    return make_int (f->order_count);
+
+  return Qunbound;
+}
+
+static int
+tty_internal_frame_property_p (struct frame *f, Lisp_Object property)
+{
+  return EQ (property, Qframe_number);
+}
+
+static Lisp_Object
+tty_frame_properties (struct frame *f)
+{
+  Lisp_Object props = Qnil;
+
+  props = cons3 (Qframe_number, make_int (f->order_count), props);
+
+  return props;
+}
 
 /************************************************************************/
 /*			      initialization				*/
@@ -197,6 +226,15 @@
   CONSOLE_HAS_METHOD (tty, raise_frame);
   CONSOLE_HAS_METHOD (tty, lower_frame);
   CONSOLE_HAS_METHOD (tty, delete_frame);
+  CONSOLE_HAS_METHOD (tty, frame_property);
+  CONSOLE_HAS_METHOD (tty, internal_frame_property_p);
+  CONSOLE_HAS_METHOD (tty, frame_properties);
+}
+
+void
+syms_of_frame_tty (void)
+{
+  DEFSYMBOL (Qframe_number);
 }
 
 void