Better workaround for GNOME bug when --enable-gcc-warnings.
[bpt/emacs.git] / src / frame.c
index 77326df..9b12842 100644 (file)
@@ -30,15 +30,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 #include "character.h"
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-#ifdef WINDOWSNT
-#include "w32term.h"
-#endif
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
+
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #include "buffer.h"
 /* These help us bind and responding to switch-frame events.  */
 #include "commands.h"
@@ -58,11 +54,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "dosfns.h"
 #endif
 
-
-#ifdef HAVE_WINDOW_SYSTEM
-
-#endif
-
 #ifdef HAVE_NS
 Lisp_Object Qns_parse_geometry;
 #endif
@@ -148,8 +139,8 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
   struct window *w = XWINDOW (window);
 
   w->last_modified = 0;
-  WSET (w, top_line, make_number (XFASTINT (w->top_line) + n));
-  WSET (w, total_lines, make_number (XFASTINT (w->total_lines) - n));
+  wset_top_line (w, make_number (XFASTINT (w->top_line) + n));
+  wset_total_lines (w, make_number (XFASTINT (w->total_lines) - n));
 
   /* Handle just the top child in a vertical split.  */
   if (!NILP (w->vchild))
@@ -223,7 +214,7 @@ See also `frame-live-p'.  */)
     case output_ns:
       return Qns;
     default:
-      abort ();
+      emacs_abort ();
     }
 }
 
@@ -305,20 +296,20 @@ make_frame (int mini_p)
   if (mini_p)
     {
       mini_window = make_window ();
-      WSET (XWINDOW (root_window), next, mini_window);
-      WSET (XWINDOW (mini_window), prev, root_window);
+      wset_next (XWINDOW (root_window), mini_window);
+      wset_prev (XWINDOW (mini_window), root_window);
       XWINDOW (mini_window)->mini = 1;
-      WSET (XWINDOW (mini_window), frame, frame);
+      wset_frame (XWINDOW (mini_window), frame);
       fset_minibuffer_window (f, mini_window);
     }
   else
     {
       mini_window = Qnil;
-      WSET (XWINDOW (root_window), next, Qnil);
+      wset_next (XWINDOW (root_window), Qnil);
       fset_minibuffer_window (f, Qnil);
     }
 
-  WSET (XWINDOW (root_window), frame, frame);
+  wset_frame (XWINDOW (root_window), frame);
 
   /* 10 is arbitrary,
      just so that there is "something there."
@@ -327,21 +318,21 @@ make_frame (int mini_p)
   SET_FRAME_COLS (f, 10);
   FRAME_LINES (f) = 10;
 
-  WSET (XWINDOW (root_window), total_cols, make_number (10));
-  WSET (XWINDOW (root_window), total_lines, make_number (mini_p ? 9 : 10));
+  wset_total_cols (XWINDOW (root_window), make_number (10));
+  wset_total_lines (XWINDOW (root_window), make_number (mini_p ? 9 : 10));
 
   if (mini_p)
     {
-      WSET (XWINDOW (mini_window), total_cols, make_number (10));
-      WSET (XWINDOW (mini_window), top_line, make_number (9));
-      WSET (XWINDOW (mini_window), total_lines, make_number (1));
+      wset_total_cols (XWINDOW (mini_window), make_number (10));
+      wset_top_line (XWINDOW (mini_window), make_number (9));
+      wset_total_lines (XWINDOW (mini_window), make_number (1));
     }
 
   /* Choose a buffer for the frame's root window.  */
   {
     Lisp_Object buf;
 
-    WSET (XWINDOW (root_window), buffer, Qt);
+    wset_buffer (XWINDOW (root_window), Qt);
     buf = Fcurrent_buffer ();
     /* If buf is a 'hidden' buffer (i.e. one whose name starts with
        a space), try to find another one.  */
@@ -360,7 +351,7 @@ make_frame (int mini_p)
 
   if (mini_p)
     {
-      WSET (XWINDOW (mini_window), buffer, Qt);
+      wset_buffer (XWINDOW (mini_window), Qt);
       set_window_buffer (mini_window,
                         (NILP (Vminibuffer_list)
                          ? get_minibuffer (0)
@@ -458,9 +449,9 @@ make_minibuffer_frame (void)
   mini_window = f->root_window;
   fset_minibuffer_window (f, mini_window);
   XWINDOW (mini_window)->mini = 1;
-  WSET (XWINDOW (mini_window), next, Qnil);
-  WSET (XWINDOW (mini_window), prev, Qnil);
-  WSET (XWINDOW (mini_window), frame, frame);
+  wset_next (XWINDOW (mini_window), Qnil);
+  wset_prev (XWINDOW (mini_window), Qnil);
+  wset_frame (XWINDOW (mini_window), frame);
 
   /* Put the proper buffer in that window.  */
 
@@ -629,7 +620,7 @@ affects all frames on the same terminal device.  */)
 #ifdef MSDOS
   if (sf->output_method != output_msdos_raw
       && sf->output_method != output_termcap)
-    abort ();
+    emacs_abort ();
 #else /* not MSDOS */
 
 #ifdef WINDOWSNT                           /* This should work now! */
@@ -776,7 +767,7 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
          Lisp_Object focus;
 
          if (!FRAMEP (XCAR (tail)))
-           abort ();
+           emacs_abort ();
 
          focus = FRAME_FOCUS_FRAME (XFRAME (XCAR (tail)));
 
@@ -906,7 +897,7 @@ next_frame (Lisp_Object frame, Lisp_Object minibuf)
 
   /* There must always be at least one frame in Vframe_list.  */
   if (! CONSP (Vframe_list))
-    abort ();
+    emacs_abort ();
 
   /* If this frame is dead, it won't be in Vframe_list, and we'll loop
      forever.  Forestall that.  */
@@ -984,7 +975,7 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf)
 
   /* There must always be at least one frame in Vframe_list.  */
   if (! CONSP (Vframe_list))
-    abort ();
+    emacs_abort ();
 
   prev = Qnil;
   for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
@@ -993,7 +984,7 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf)
 
       f = XCAR (tail);
       if (!FRAMEP (f))
-       abort ();
+       emacs_abort ();
 
       if (EQ (frame, f) && !NILP (prev))
        return prev;
@@ -1394,7 +1385,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
 
          this = XCAR (frames);
          if (!FRAMEP (this))
-           abort ();
+           emacs_abort ();
          f1 = XFRAME (this);
 
          if (kb == FRAME_KBOARD (f1))
@@ -1430,7 +1421,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
 
          this = XCAR (frames);
          if (!FRAMEP (this))
-           abort ();
+           emacs_abort ();
          f1 = XFRAME (this);
 
          /* Consider only frames on the same kboard
@@ -1456,7 +1447,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
             that is prohibited at the top; you can't delete surrogate
             minibuffer frames.  */
          if (NILP (frame_with_minibuf))
-           abort ();
+           emacs_abort ();
 
          kset_default_minibuffer_frame (kb, frame_with_minibuf);
        }
@@ -1700,7 +1691,7 @@ make_frame_visible_1 (Lisp_Object window)
       w = XWINDOW (window);
 
       if (!NILP (w->buffer))
-       BSET (XBUFFER (w->buffer), display_time, Fcurrent_time ());
+       bset_display_time (XBUFFER (w->buffer), Fcurrent_time ());
 
       if (!NILP (w->vchild))
        make_frame_visible_1 (w->vchild);
@@ -2117,7 +2108,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
              swap_in_global_binding (sym);
            break;
          }
-       default: abort ();
+       default: emacs_abort ();
        }
     }
 
@@ -3844,7 +3835,7 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param,
              }
 
            default:
-             abort ();
+             emacs_abort ();
            }
        }
       else
@@ -4247,7 +4238,6 @@ syms_of_frame (void)
   DEFSYM (Qx, "x");
   DEFSYM (Qw32, "w32");
   DEFSYM (Qpc, "pc");
-  DEFSYM (Qmac, "mac");
   DEFSYM (Qns, "ns");
   DEFSYM (Qvisible, "visible");
   DEFSYM (Qbuffer_predicate, "buffer-predicate");